mirror of
https://github.com/ansible/awx.git
synced 2026-05-11 19:37:38 -02:30
Refactor UI Build System (#3203)
* initial build trial, clean up awx/ui * fix hardcoded refs to ng-toast, add jshint preloader * remove browserify test * update grunt-jshint -> jshint module loader, browser-sync, update dev targets to build-docker-machine & build-docker-cid, fix blocking tasks * less autoprefixer * sample build commands * fix release build * update README * karma config stub * webpack config for karma tests * karma preview for shane * fix build-docker-machine target * karma+webpack test pipeline configuration, stub tests * fix smart/job status icons classes * fix jquery + jsyaml shims, fix LESS cascade * fix angular-codemirror dependency, explicitly import style/mode dependencies * shim jsonlint * fix angular-scheduler AMD imports, remove jquuery-ui shim, fix release config * use closed $.fn.datepicker for system-tracking * remove packaging/node/ * remove old tests * shrinkwrap fragile dependency sandcastle, update README, lint * first pass at fixing rrule shim * update makefile targets * update gitignore w/ new flag file * add saucelabs karma config * add license controller test * add examples of service and directive tests * Makefile flubs * consolidate clean-ui target, compulsively update flag file location * dep on CJS/AMD/UMD compatible version of rrule lib, fix example tests/config for demo * boilerplate karma config for saucelabs (should be abstracted to common config after proven to work) * update docs * docs feedback * update Dockerfile with Node 6.x dep
This commit is contained in:
20
awx/ui/grunt-tasks/browserSync.js
Normal file
20
awx/ui/grunt-tasks/browserSync.js
Normal file
@@ -0,0 +1,20 @@
|
||||
var django_port = process.env.npm_package_config_django_port,
|
||||
django_host = process.env.npm_package_config_django_host;
|
||||
|
||||
module.exports = {
|
||||
http: {
|
||||
bsFiles: {
|
||||
src: [
|
||||
'static/**/*'
|
||||
]
|
||||
},
|
||||
options: {
|
||||
proxy: {
|
||||
target: `${django_host}:${django_port}`,
|
||||
ws: true
|
||||
},
|
||||
keepalive: false,
|
||||
watchTask: true
|
||||
}
|
||||
}
|
||||
};
|
||||
4
awx/ui/grunt-tasks/clean.js
Normal file
4
awx/ui/grunt-tasks/clean.js
Normal file
@@ -0,0 +1,4 @@
|
||||
module.exports = {
|
||||
static: 'static/*',
|
||||
coverage: 'coverage/*'
|
||||
};
|
||||
0
awx/ui/grunt-tasks/complexity.js
Normal file
0
awx/ui/grunt-tasks/complexity.js
Normal file
14
awx/ui/grunt-tasks/concurrent.js
Normal file
14
awx/ui/grunt-tasks/concurrent.js
Normal file
@@ -0,0 +1,14 @@
|
||||
module.exports = {
|
||||
dev: {
|
||||
tasks: ['copy:vendor', 'copy:assets', 'copy:partials', 'copy:config', 'less:dev'],
|
||||
},
|
||||
prod: {
|
||||
tasks: ['newer:copy:vendor', 'newer:copy:assets', 'newer:copy:partials', 'newer:copy:config', 'newer:less:prod']
|
||||
},
|
||||
watch: {
|
||||
tasks: ['watch:css', 'watch:partials', 'watch:assets', ['webpack:dev', 'watch:config']],
|
||||
options: {
|
||||
logConcurrentOutput: true
|
||||
}
|
||||
}
|
||||
};
|
||||
49
awx/ui/grunt-tasks/copy.js
Normal file
49
awx/ui/grunt-tasks/copy.js
Normal file
@@ -0,0 +1,49 @@
|
||||
var staticFiles = ['angular-tz-extensions/tz/data/*',
|
||||
'angular-scheduler/lib/angular-scheduler-detail.html',
|
||||
'angular-scheduler/lib/angular-scheduler.html',
|
||||
'nvd3/build/nv.d3.css',
|
||||
'ng-toast/dist/ngToast.min.css',
|
||||
'codemirror/addon/lint/lint.css',
|
||||
'codemirror/theme/elegant.css',
|
||||
'codemirror/lib/codemirror.css',
|
||||
'select2/dist/css/select2.css',
|
||||
'components-font-awesome/css/font-awesome.min.css',
|
||||
'components-font-awesome/fonts/fontawesome-webfont.ttf',
|
||||
'components-font-awesome/fonts/fontawesome-webfont.woff',
|
||||
'components-font-awesome/fonts/fontawesome-webfont.woff2'
|
||||
];
|
||||
|
||||
module.exports = {
|
||||
assets: {
|
||||
files: [{
|
||||
cwd: 'client/',
|
||||
expand: true,
|
||||
src: 'assets/**/*',
|
||||
dest: 'static/'
|
||||
}]
|
||||
},
|
||||
vendor: {
|
||||
files: [{
|
||||
expand: true,
|
||||
cwd: 'node_modules/',
|
||||
src: staticFiles,
|
||||
dest: 'static/lib/'
|
||||
}]
|
||||
},
|
||||
partials: {
|
||||
files: [{
|
||||
cwd: 'client/src',
|
||||
expand: true,
|
||||
src: ['**/*.partial.html'],
|
||||
dest: 'static/partials'
|
||||
}, {
|
||||
cwd: 'client/src/partials',
|
||||
expand: true,
|
||||
src: ['*.html'],
|
||||
dest: 'static/partials/'
|
||||
}]
|
||||
},
|
||||
config: {
|
||||
files: { 'static/config.js': ['client/src/config.js'] }
|
||||
}
|
||||
};
|
||||
29
awx/ui/grunt-tasks/less.js
Normal file
29
awx/ui/grunt-tasks/less.js
Normal file
@@ -0,0 +1,29 @@
|
||||
module.exports = {
|
||||
options: {
|
||||
options : {
|
||||
plugins : [ new (require('less-plugin-autoprefix'))({browsers : [ "last 2 versions" ]}) ]
|
||||
}
|
||||
},
|
||||
dev: {
|
||||
files: [{
|
||||
dest: 'static/tower.min.css',
|
||||
src: [
|
||||
'client/legacy-styles/*.less',
|
||||
'client/src/**/*.less',
|
||||
]
|
||||
}]
|
||||
},
|
||||
|
||||
prod: {
|
||||
files: {
|
||||
'static/tower.min.css': [
|
||||
'client/legacy-styles/*.less',
|
||||
'client/src/**/*.less',
|
||||
]
|
||||
},
|
||||
options: {
|
||||
compress: true,
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
18
awx/ui/grunt-tasks/watch.js
Normal file
18
awx/ui/grunt-tasks/watch.js
Normal file
@@ -0,0 +1,18 @@
|
||||
module.exports = {
|
||||
css: {
|
||||
files: 'client/**/*.less',
|
||||
tasks: ['newer:less:dev']
|
||||
},
|
||||
partials: {
|
||||
files: 'client/src/**/*.html',
|
||||
tasks: ['newer:copy:partials']
|
||||
},
|
||||
assets: {
|
||||
files: 'client/assets',
|
||||
tasks: ['newer:copy:assets']
|
||||
},
|
||||
config: {
|
||||
files: 'client/src/config.js',
|
||||
tasks: ['newer:copy:config']
|
||||
}
|
||||
};
|
||||
5
awx/ui/grunt-tasks/webpack.js
Normal file
5
awx/ui/grunt-tasks/webpack.js
Normal file
@@ -0,0 +1,5 @@
|
||||
var config = require('../webpack.config.js');
|
||||
module.exports = {
|
||||
dev: config.dev,
|
||||
prod: config.release
|
||||
};
|
||||
Reference in New Issue
Block a user