From 0d725c17508d69a660f0da2c2b14163cd6c534d7 Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Thu, 23 Jun 2016 10:23:48 -0300 Subject: [PATCH 01/27] Adding task of grunt: "load-grunt-config" for the config of task modules, in folder: "grunt-task/" --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index d20d91818..3c7fb3795 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "grunt-cssjanus": "^0.2.4", "grunt-image": "^1.0.5", "grunt-includes": "^0.4.5", - "grunt-sass": "^1.1.0" + "grunt-sass": "^1.1.0", + "load-grunt-config": "^0.19.2" } } From 561ea689555dd6a85c3f42d95032c71c96c90650 Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Thu, 23 Jun 2016 10:25:08 -0300 Subject: [PATCH 02/27] Separate: task 'WATCH' and create module for 'load-config-grunt' --- grunt-tasks/watch.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 grunt-tasks/watch.js diff --git a/grunt-tasks/watch.js b/grunt-tasks/watch.js new file mode 100644 index 000000000..67b6ef9bb --- /dev/null +++ b/grunt-tasks/watch.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = function (grunt) { + return { + // If any .less file changes in directory "build/less/" run the "less"-task. + // files: ["build/less/*.less", "build/less/skins/*.less", "dist/js/app.js"], + files: [ + "build/scss/*.scss", + "build/scss/skins/*.scss", + "dist/js/app.js" + ], + tasks: ["sass", "uglify"] + }; +}; From 5ba76d12701da60c20603ac9803d52959ddc7076 Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Thu, 23 Jun 2016 10:25:16 -0300 Subject: [PATCH 03/27] Separate: task 'SASS' and create module for 'load-config-grunt' --- grunt-tasks/sass.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 grunt-tasks/sass.js diff --git a/grunt-tasks/sass.js b/grunt-tasks/sass.js new file mode 100644 index 000000000..3aced1e15 --- /dev/null +++ b/grunt-tasks/sass.js @@ -0,0 +1,22 @@ +'use strict'; + +module.exports = function (grunt) { + return { + development: { + options: { + style: 'expanded' + }, + files: { + 'dist/tmp/AdminLTE.css': 'build/scss/AdminLTE.scss' + } + }, + production: { + options: { + style: 'compressed' + }, + files: { + 'dist/tmp/AdminLTE.min.css': 'build/scss/AdminLTE.scss' + } + } + }; +}; From d0c2e697249df3d297cb8d2318df47a0c6e0fd58 Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Thu, 23 Jun 2016 10:26:11 -0300 Subject: [PATCH 04/27] Separate: task 'UGLIFY' and create module for 'load-config-grunt' --- grunt-tasks/uglify.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 grunt-tasks/uglify.js diff --git a/grunt-tasks/uglify.js b/grunt-tasks/uglify.js new file mode 100644 index 000000000..e18327758 --- /dev/null +++ b/grunt-tasks/uglify.js @@ -0,0 +1,15 @@ +'use strict'; + +module.exports = function (grunt) { + return { + options: { + mangle: true, + preserveComments: 'some' + }, + my_target: { + files: { + 'dist/js/app.min.js': ['dist/js/app.js'] + } + } + }; +}; From 8e15275c225fac832f9ae93409736dbe02568c67 Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Thu, 23 Jun 2016 10:27:27 -0300 Subject: [PATCH 05/27] Separate: task 'BABEL' and create module for 'load-config-grunt' --- grunt-tasks/babel.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 grunt-tasks/babel.js diff --git a/grunt-tasks/babel.js b/grunt-tasks/babel.js new file mode 100644 index 000000000..49474ee81 --- /dev/null +++ b/grunt-tasks/babel.js @@ -0,0 +1,15 @@ +'use strict'; + +module.exports = function (grunt) { + return { + options: { + sourceMap: true, + presets: ['es2015'] + }, + dist: { + files: { + 'dist/js/AdminLTE.js': 'build/js/AdminLTE.js' + } + } + }; +}; From acd331b6dc39efcd2a2dfe10b93a1ca699dc4d03 Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Thu, 23 Jun 2016 10:28:15 -0300 Subject: [PATCH 06/27] Separate: task 'INCLUDES' and create module for 'load-config-grunt' --- grunt-tasks/includes.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 grunt-tasks/includes.js diff --git a/grunt-tasks/includes.js b/grunt-tasks/includes.js new file mode 100644 index 000000000..a881b7d0a --- /dev/null +++ b/grunt-tasks/includes.js @@ -0,0 +1,16 @@ +'use strict'; + +module.exports = function (grunt) { + return { + build: { + src: ['*.html'], // Source files + dest: 'documentation/', // Destination directory + flatten: true, + cwd: 'documentation/build', + options: { + silent: true, + includePath: 'documentation/build/include' + } + } + }; +}; From f3e425f2c17cea3cce740f2be832232d37583f42 Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Thu, 23 Jun 2016 10:28:57 -0300 Subject: [PATCH 07/27] Separate: task 'CLEAN' and create module for 'load-config-grunt' --- grunt-tasks/clean.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 grunt-tasks/clean.js diff --git a/grunt-tasks/clean.js b/grunt-tasks/clean.js new file mode 100644 index 000000000..63d48ac5e --- /dev/null +++ b/grunt-tasks/clean.js @@ -0,0 +1,7 @@ +'use strict'; + +module.exports = function (grunt) { + return { + build: ["build/img/*"] + }; +}; From ed7235e0e022267d695628f066a0401d84aa5ea0 Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Thu, 23 Jun 2016 11:45:26 -0300 Subject: [PATCH 08/27] Separate: task 'BOOTLINT' and create module for 'load-config-grunt' --- grunt-tasks/bootlint.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 grunt-tasks/bootlint.js diff --git a/grunt-tasks/bootlint.js b/grunt-tasks/bootlint.js new file mode 100644 index 000000000..2c442ec3d --- /dev/null +++ b/grunt-tasks/bootlint.js @@ -0,0 +1,10 @@ +'use strict'; + +module.exports = function (grunt) { + return { + options: { + relaxerror: ['W005'] + }, + files: ['pages/**/*.html', '*.html'] + }; +}; From 46f087d3a0a3be4dd4455b83771cffa6c3b2bf10 Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Thu, 23 Jun 2016 11:46:11 -0300 Subject: [PATCH 09/27] Separate: task 'JSHINT' and create module for 'load-config-grunt' --- grunt-tasks/jshint.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 grunt-tasks/jshint.js diff --git a/grunt-tasks/jshint.js b/grunt-tasks/jshint.js new file mode 100644 index 000000000..e85e24aa9 --- /dev/null +++ b/grunt-tasks/jshint.js @@ -0,0 +1,18 @@ +'use strict'; + +module.exports = function (grunt) { + return { + options: { + jshintrc: '.jshintrc' + }, + core: { + src: 'dist/js/app.js' + }, + demo: { + src: 'dist/js/demo.js' + }, + pages: { + src: 'dist/js/pages/*.js' + } + }; +}; From f91a394270d2430d5d42c94fb4ec65f43138ab7f Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Thu, 23 Jun 2016 11:48:14 -0300 Subject: [PATCH 10/27] modify structure JSON in task --- grunt-tasks/csslint.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 grunt-tasks/csslint.js diff --git a/grunt-tasks/csslint.js b/grunt-tasks/csslint.js new file mode 100644 index 000000000..6f4b94e23 --- /dev/null +++ b/grunt-tasks/csslint.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = function (grunt) { + return { + options: { + csslintrc: 'build/less/.csslintrc' + }, + dist: [ + 'dist/css/AdminLTE.css', + ] + } + +}; From fdd077c936caec6fa91291f7b80ce382853273db Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Thu, 23 Jun 2016 11:48:31 -0300 Subject: [PATCH 11/27] Separate: task 'IMAGE' and create module for 'load-config-grunt' --- grunt-tasks/image.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 grunt-tasks/image.js diff --git a/grunt-tasks/image.js b/grunt-tasks/image.js new file mode 100644 index 000000000..a378bb87f --- /dev/null +++ b/grunt-tasks/image.js @@ -0,0 +1,14 @@ +'use strict'; + +module.exports = function (grunt) { + return { + dynamic: { + files: [{ + expand: true, + cwd: 'build/img/', + src: ['**/*.{png,jpg,gif,svg,jpeg}'], + dest: 'dist/img/' + }] + } + }; +}; From 071a2c166e8d5484d85775eb5ca646e1fb841c7d Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Thu, 23 Jun 2016 11:49:39 -0300 Subject: [PATCH 12/27] remove task and using the task loader: "load-grunt-config" for load the modules of tasks of folder: "grunt-tasks" --- Gruntfile.js | 150 +++------------------------------------------------ 1 file changed, 6 insertions(+), 144 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index fd3c35c85..8ce332ec6 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -3,153 +3,15 @@ module.exports = function (grunt) { 'use strict'; - - grunt.initConfig({ - watch: { - // If any .less file changes in directory "build/less/" run the "less"-task. - // files: ["build/less/*.less", "build/less/skins/*.less", "dist/js/app.js"], - files: ["build/scss/*.scss", "build/scss/skins/*.scss", "dist/js/app.js"], - tasks: ["sass", "uglify"] - }, - - // SASS compiler - sass: { - development: { - options: { - style: 'expanded' - }, - files: { - 'dist/tmp/AdminLTE.css': 'build/scss/AdminLTE.scss' - } - }, - production: { - options: { - style: 'compressed' - }, - files: { - 'dist/tmp/AdminLTE.min.css': 'build/scss/AdminLTE.scss' - } - } - }, - - // Uglify task info. Compress the js files. - uglify: { - options: { - mangle: true, - preserveComments: 'some' - }, - my_target: { - files: { - 'dist/js/app.min.js': ['dist/js/app.js'] - } - } - }, - - // Compile ECMA6 to ECMA5 - babel: { - options: { - sourceMap: true, - presets: ['es2015'] - }, - dist: { - files: { - 'dist/js/AdminLTE.js': 'build/js/AdminLTE.js' - } - } - }, - - // Build the documentation files - includes: { - build: { - src: ['*.html'], // Source files - dest: 'documentation/', // Destination directory - flatten: true, - cwd: 'documentation/build', - options: { - silent: true, - includePath: 'documentation/build/include' - } - } - }, - - // Optimize images - image: { - dynamic: { - files: [{ - expand: true, - cwd: 'build/img/', - src: ['**/*.{png,jpg,gif,svg,jpeg}'], - dest: 'dist/img/' - }] - } - }, - - // Validate JS code - jshint: { - options: { - jshintrc: '.jshintrc' - }, - core: { - src: 'dist/js/app.js' - }, - demo: { - src: 'dist/js/demo.js' - }, - pages: { - src: 'dist/js/pages/*.js' - } - }, - - // Validate CSS files - csslint: { - options: { - csslintrc: 'build/less/.csslintrc' - }, - dist: [ - 'dist/css/AdminLTE.css', - ] - }, - - // Validate Bootstrap HTML - bootlint: { - options: { - relaxerror: ['W005'] - }, - files: ['pages/**/*.html', '*.html'] - }, - - // Delete images in build directory - // After compressing the images in the build/img dir, there is no need - // for them - clean: { - build: ["build/img/*"] + // Load all grunt tasks + var configs = require('load-grunt-config')(grunt,{ + configPath: __dirname + '/grunt-tasks', + data:{ + pkg: grunt.file.readJSON("package.json") } }); - // Load all grunt tasks - - // LESS Compiler - grunt.loadNpmTasks('grunt-contrib-less'); - // SASS compiler - grunt.loadNpmTasks('grunt-sass'); - // Watch File Changes - grunt.loadNpmTasks('grunt-contrib-watch'); - // Compress JS Files - grunt.loadNpmTasks('grunt-contrib-uglify'); - // Include Files Within HTML - grunt.loadNpmTasks('grunt-includes'); - // Optimize images - grunt.loadNpmTasks('grunt-image'); - // Validate JS code - grunt.loadNpmTasks('grunt-contrib-jshint'); - // Delete not needed files - grunt.loadNpmTasks('grunt-contrib-clean'); - // Lint CSS - grunt.loadNpmTasks('grunt-contrib-csslint'); - // Lint Bootstrap - grunt.loadNpmTasks('grunt-bootlint'); - // Grunt Babel to compile ECMA6 to ECMA5 - grunt.loadNpmTasks('grunt-babel'); + grunt.initConfig(configs); // Linting task grunt.registerTask('lint', ['jshint', 'csslint', 'bootlint']); From 5297b27e51fd22b888e1365c7852d87716944f24 Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Thu, 23 Jun 2016 11:53:52 -0300 Subject: [PATCH 13/27] Description of module: BABEL --- grunt-tasks/babel.js | 1 + 1 file changed, 1 insertion(+) diff --git a/grunt-tasks/babel.js b/grunt-tasks/babel.js index 49474ee81..5eb9e5993 100644 --- a/grunt-tasks/babel.js +++ b/grunt-tasks/babel.js @@ -1,3 +1,4 @@ +// Compile ECMA6 to ECMA5 'use strict'; module.exports = function (grunt) { From fc5ef6217b570e6d3593e1aae67689a1685049f5 Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Thu, 23 Jun 2016 11:54:05 -0300 Subject: [PATCH 14/27] Description of module: BOOTLINT --- grunt-tasks/bootlint.js | 1 + 1 file changed, 1 insertion(+) diff --git a/grunt-tasks/bootlint.js b/grunt-tasks/bootlint.js index 2c442ec3d..f690ce3d9 100644 --- a/grunt-tasks/bootlint.js +++ b/grunt-tasks/bootlint.js @@ -1,3 +1,4 @@ +// Validate Bootstrap HTML 'use strict'; module.exports = function (grunt) { From b6a21d5dc77212de425323c2424e05205d150a84 Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Thu, 23 Jun 2016 11:54:19 -0300 Subject: [PATCH 15/27] Description of module: CLEAN --- grunt-tasks/clean.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/grunt-tasks/clean.js b/grunt-tasks/clean.js index 63d48ac5e..4afd571eb 100644 --- a/grunt-tasks/clean.js +++ b/grunt-tasks/clean.js @@ -1,3 +1,6 @@ +// Delete images in build directory +// After compressing the images in the build/img dir, there is no need +// for them 'use strict'; module.exports = function (grunt) { From e140f96d127cee8697409f547cd1ef1383ce2b46 Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Thu, 23 Jun 2016 11:54:27 -0300 Subject: [PATCH 16/27] Description of module: CSSLINT --- grunt-tasks/csslint.js | 1 + 1 file changed, 1 insertion(+) diff --git a/grunt-tasks/csslint.js b/grunt-tasks/csslint.js index 6f4b94e23..13352d1f8 100644 --- a/grunt-tasks/csslint.js +++ b/grunt-tasks/csslint.js @@ -1,3 +1,4 @@ +// Validate CSS files 'use strict'; module.exports = function (grunt) { From 7ed8bfa8e4d1a59e3eca909482028072db25c29c Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Thu, 23 Jun 2016 11:54:36 -0300 Subject: [PATCH 17/27] Description of module: IMAGE --- grunt-tasks/image.js | 1 + 1 file changed, 1 insertion(+) diff --git a/grunt-tasks/image.js b/grunt-tasks/image.js index a378bb87f..599251364 100644 --- a/grunt-tasks/image.js +++ b/grunt-tasks/image.js @@ -1,3 +1,4 @@ +// Optimize images 'use strict'; module.exports = function (grunt) { From c6995623a475c687df91cbad305a17d4248b71c1 Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Thu, 23 Jun 2016 11:54:49 -0300 Subject: [PATCH 18/27] Description of module: INCLUDES --- grunt-tasks/includes.js | 1 + 1 file changed, 1 insertion(+) diff --git a/grunt-tasks/includes.js b/grunt-tasks/includes.js index a881b7d0a..630028931 100644 --- a/grunt-tasks/includes.js +++ b/grunt-tasks/includes.js @@ -1,3 +1,4 @@ +// Build the documentation files 'use strict'; module.exports = function (grunt) { From 754f44af5dae5aab83b12176a533fc5d70c5af1d Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Thu, 23 Jun 2016 11:54:57 -0300 Subject: [PATCH 19/27] Description of module: JSHINT --- grunt-tasks/jshint.js | 1 + 1 file changed, 1 insertion(+) diff --git a/grunt-tasks/jshint.js b/grunt-tasks/jshint.js index e85e24aa9..4afaacc7a 100644 --- a/grunt-tasks/jshint.js +++ b/grunt-tasks/jshint.js @@ -1,3 +1,4 @@ +// Validate JS code 'use strict'; module.exports = function (grunt) { From e031a7b0de0b6fa4565a6d4e1cf8529a4a278caf Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Thu, 23 Jun 2016 11:55:04 -0300 Subject: [PATCH 20/27] Description of module: SASS --- grunt-tasks/sass.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/grunt-tasks/sass.js b/grunt-tasks/sass.js index 3aced1e15..3c6591922 100644 --- a/grunt-tasks/sass.js +++ b/grunt-tasks/sass.js @@ -1,3 +1,5 @@ +// SASS compiler + 'use strict'; module.exports = function (grunt) { From a6e1acb8edf60cc087ccd87d5b2032cbf487c4da Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Thu, 23 Jun 2016 11:55:12 -0300 Subject: [PATCH 21/27] Description of module: UGLIFY --- grunt-tasks/uglify.js | 1 + 1 file changed, 1 insertion(+) diff --git a/grunt-tasks/uglify.js b/grunt-tasks/uglify.js index e18327758..9e9465e58 100644 --- a/grunt-tasks/uglify.js +++ b/grunt-tasks/uglify.js @@ -1,3 +1,4 @@ +// Uglify task info. Compress the js files. 'use strict'; module.exports = function (grunt) { From df23666eff172219b09d62e3ac7193bfd586a0ff Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Thu, 23 Jun 2016 11:55:18 -0300 Subject: [PATCH 22/27] Description of module: WATCH --- grunt-tasks/watch.js | 1 + 1 file changed, 1 insertion(+) diff --git a/grunt-tasks/watch.js b/grunt-tasks/watch.js index 67b6ef9bb..bb7d11c13 100644 --- a/grunt-tasks/watch.js +++ b/grunt-tasks/watch.js @@ -1,3 +1,4 @@ +// Watch File Changes 'use strict'; module.exports = function (grunt) { From b97973d8c5d7fd83c0b310517fee3022667e8127 Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Tue, 28 Jun 2016 21:08:01 -0300 Subject: [PATCH 23/27] add outer files in config module: BABEL --- grunt-tasks/babel.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/grunt-tasks/babel.js b/grunt-tasks/babel.js index 5eb9e5993..f462c105e 100644 --- a/grunt-tasks/babel.js +++ b/grunt-tasks/babel.js @@ -9,7 +9,11 @@ module.exports = function (grunt) { }, dist: { files: { - 'dist/js/AdminLTE.js': 'build/js/AdminLTE.js' + 'build/js/dist/Layout.js': 'build/js/src/Layout.js', + 'build/js/dist/Treeview.js': 'build/js/src/Treeview.js', + 'build/js/dist/PushMenu.js': 'build/js/src/PushMenu.js', + 'build/js/dist/Widget.js': 'build/js/src/Widget.js', + 'dist/js/adminlte.js': 'build/js/src/AdminLTE.js' } } }; From 70c5d7341da24c95539b0cfb0bd54c1b86436c2a Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Tue, 28 Jun 2016 21:10:35 -0300 Subject: [PATCH 24/27] add outer files in config module of merged request old --- grunt-tasks/bootlint.js | 5 +++-- grunt-tasks/sass.js | 4 ++-- grunt-tasks/uglify.js | 3 ++- grunt-tasks/watch.js | 24 ++++++++++++++---------- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/grunt-tasks/bootlint.js b/grunt-tasks/bootlint.js index f690ce3d9..20923ce98 100644 --- a/grunt-tasks/bootlint.js +++ b/grunt-tasks/bootlint.js @@ -2,10 +2,11 @@ 'use strict'; module.exports = function (grunt) { - return { + return { options: { relaxerror: ['W005'] }, - files: ['pages/**/*.html', '*.html'] + // files: ['pages/**/*.html', '*.html'] + files: ['starter.html'] }; }; diff --git a/grunt-tasks/sass.js b/grunt-tasks/sass.js index 3c6591922..6188c7b7c 100644 --- a/grunt-tasks/sass.js +++ b/grunt-tasks/sass.js @@ -9,7 +9,7 @@ module.exports = function (grunt) { style: 'expanded' }, files: { - 'dist/tmp/AdminLTE.css': 'build/scss/AdminLTE.scss' + 'dist/css/AdminLTE.css': 'build/scss/AdminLTE.scss' } }, production: { @@ -17,7 +17,7 @@ module.exports = function (grunt) { style: 'compressed' }, files: { - 'dist/tmp/AdminLTE.min.css': 'build/scss/AdminLTE.scss' + 'dist/css/adminlte.min.css': 'build/scss/AdminLTE.scss' } } }; diff --git a/grunt-tasks/uglify.js b/grunt-tasks/uglify.js index 9e9465e58..3608df687 100644 --- a/grunt-tasks/uglify.js +++ b/grunt-tasks/uglify.js @@ -7,8 +7,9 @@ module.exports = function (grunt) { mangle: true, preserveComments: 'some' }, - my_target: { + target: { files: { + 'dist/js/adminlte.min.js': ['dist/js/adminlte.js'], 'dist/js/app.min.js': ['dist/js/app.js'] } } diff --git a/grunt-tasks/watch.js b/grunt-tasks/watch.js index bb7d11c13..25b8e6d10 100644 --- a/grunt-tasks/watch.js +++ b/grunt-tasks/watch.js @@ -1,15 +1,19 @@ -// Watch File Changes +// Watch files for changes and invoke appropriate compiler 'use strict'; module.exports = function (grunt) { return { - // If any .less file changes in directory "build/less/" run the "less"-task. - // files: ["build/less/*.less", "build/less/skins/*.less", "dist/js/app.js"], - files: [ - "build/scss/*.scss", - "build/scss/skins/*.scss", - "dist/js/app.js" - ], - tasks: ["sass", "uglify"] - }; + sass: { + files: ['build/scss/*.scss', 'build/scss/skins/*.scss'], + tasks: ['sass'] + }, + es6: { + files: ['build/js/src/*.js'], + tasks: ['concat', 'babel', 'uglify'] + }, + js: { + files: ['dist/js/adminlte.js', 'dist/js/app.js'], + tasks: ['uglify'] + } + }; }; From 1d7f8fa444ca78dc75dc4e0bedc61c36a6ef5375 Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Tue, 28 Jun 2016 21:12:20 -0300 Subject: [PATCH 25/27] Separate: task 'CONCAT' and create module for 'load-config-grunt' --- grunt-tasks/concat.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 grunt-tasks/concat.js diff --git a/grunt-tasks/concat.js b/grunt-tasks/concat.js new file mode 100644 index 000000000..365be72df --- /dev/null +++ b/grunt-tasks/concat.js @@ -0,0 +1,20 @@ +// Concat compiled JS files +'use strict'; + +module.exports = function (grunt) { + return { + options: { + stripBanners: true, + banner: '<%= banner %>' + }, + adminlte: { + src: [ + 'build/js/src/Layout.js', + 'build/js/src/Treeview.js', + 'build/js/src/PushMenu.js', + 'build/js/src/Widget.js' + ], + dest: 'build/js/src/AdminLTE.js' + } + }; +}; From 78bdcb26ec5ca4f02f9ab856260b5d4c9cc207c2 Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Tue, 28 Jun 2016 21:12:31 -0300 Subject: [PATCH 26/27] Separate: task 'ESLINT' and create module for 'load-config-grunt' --- grunt-tasks/eslint.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 grunt-tasks/eslint.js diff --git a/grunt-tasks/eslint.js b/grunt-tasks/eslint.js new file mode 100644 index 000000000..52ca858eb --- /dev/null +++ b/grunt-tasks/eslint.js @@ -0,0 +1,11 @@ +// Lint ECMASCRIPT +'use strict'; + +module.exports = function (grunt) { + return { + options: { + configFile: 'build/js/.eslintrc' + }, + target: 'build/js/src/*.js' + }; +}; From ba167fa22de256171c16f3d2d4af4987b762e7c7 Mon Sep 17 00:00:00 2001 From: Arno Roldao Junior Date: Tue, 28 Jun 2016 21:12:44 -0300 Subject: [PATCH 27/27] Separate: task 'JSCS' and create module for 'load-config-grunt' --- grunt-tasks/jscs.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 grunt-tasks/jscs.js diff --git a/grunt-tasks/jscs.js b/grunt-tasks/jscs.js new file mode 100644 index 000000000..373d0c923 --- /dev/null +++ b/grunt-tasks/jscs.js @@ -0,0 +1,19 @@ +// Lint JS code +'use strict'; + +module.exports = function (grunt) { + return { + options: { + config: 'build/js/.jscsrc' + }, + grunt: { + src: ['Gruntfile.js'] + }, + core: { + src: 'js/src/*.js' + } + /*app: { + src: 'dist/js/app.js' + }*/ + }; +};