From f272a49ee0e9d389674addd4966f4cdcc0a1bd68 Mon Sep 17 00:00:00 2001 From: Kevin Ross Date: Fri, 4 Dec 2015 10:50:06 -0600 Subject: [PATCH] - moved babel generated files to dist - concat the babel generated files instead of the source es6 (not sure if this is the exactly right thing to do yet for general consumption, but seems correct) - allow local runs of docs to see the mdb js babel files so we can better debug sources --- Gruntfile.js | 54 ++++++++++++--------------- docs/_includes/footer.html | 10 ++--- docs/assets/scss/.READONLY-MOSTLY.txt | 2 +- docs/assets/scss/docs.scss | 2 +- docs/components/.READONLY.txt | 2 +- docs/content/.READONLY.txt | 2 +- grunt/configBridge.json | 12 ++++++ 7 files changed, 44 insertions(+), 40 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 0fca1a7a..ddf7f6d9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -100,18 +100,15 @@ module.exports = function (grunt) { modules: 'ignore' }, files: { - 'js/dist/util.js': 'js/src/util.js', - 'js/dist/ripples.js': 'js/src/ripples.js', - 'js/dist/autofill.js': 'js/src/autofill.js', - 'js/dist/input.js': 'js/src/input.js', - 'js/dist/checkbox.js': 'js/src/checkbox.js', - 'js/dist/togglebutton.js': 'js/src/togglebutton.js', - 'js/dist/radio.js': 'js/src/radio.js', - 'js/dist/fileinput.js': 'js/src/fileInput.js', - 'js/dist/bootstrapMaterialDesign.js': 'js/src/bootstrapMaterialDesign.js', - //'js/dist/tab.js' : 'js/src/tab.js', - //'js/dist/tooltip.js' : 'js/src/tooltip.js', - //'js/dist/popover.js' : 'js/src/popover.js' + 'dist/js/babel/util.js': 'js/src/util.js', + 'dist/js/babel/ripples.js': 'js/src/ripples.js', + 'dist/js/babel/autofill.js': 'js/src/autofill.js', + 'dist/js/babel/input.js': 'js/src/input.js', + 'dist/js/babel/checkbox.js': 'js/src/checkbox.js', + 'dist/js/babel/togglebutton.js': 'js/src/togglebutton.js', + 'dist/js/babel/radio.js': 'js/src/radio.js', + 'dist/js/babel/fileInput.js': 'js/src/fileInput.js', + 'dist/js/babel/bootstrapMaterialDesign.js': 'js/src/bootstrapMaterialDesign.js', } }, docs: { @@ -144,11 +141,8 @@ module.exports = function (grunt) { 'dist/js/umd/checkbox.js': 'js/src/checkbox.js', 'dist/js/umd/togglebutton.js': 'js/src/togglebutton.js', 'dist/js/umd/radio.js': 'js/src/radio.js', - 'dist/js/umd/fileinput.js': 'js/src/fileInput.js', + 'dist/js/umd/fileInput.js': 'js/src/fileInput.js', 'dist/js/umd/bootstrapMaterialDesign.js': 'js/src/bootstrapMaterialDesign.js', - //'dist/js/umd/tab.js' : 'js/src/tab.js', - //'dist/js/umd/tooltip.js' : 'js/src/tooltip.js', - //'dist/js/umd/popover.js' : 'js/src/popover.js' } } }, @@ -195,22 +189,20 @@ module.exports = function (grunt) { concat: { options: { - stripBanners: false + stripBanners: false, + sourceMap: true }, bootstrap: { src: [ - 'js/src/util.js', - 'js/src/ripples.js', - 'js/src/autofill.js', - 'js/src/input.js', - 'js/src/checkbox.js', - 'js/src/togglebutton.js', - 'js/src/radio.js', - 'js/src/fileInput.js', - 'js/src/bootstrapMaterialDesign.js', - //'js/src/tab.js', - //'js/src/tooltip.js', - //'js/src/popover.js' + 'dist/js/babel/util.js', + 'dist/js/babel/ripples.js', + 'dist/js/babel/autofill.js', + 'dist/js/babel/input.js', + 'dist/js/babel/checkbox.js', + 'dist/js/babel/togglebutton.js', + 'dist/js/babel/radio.js', + 'dist/js/babel/fileInput.js', + 'dist/js/babel/bootstrapMaterialDesign.js', ], dest: 'dist/js/<%= pkg.name %>.js' } @@ -581,9 +573,9 @@ module.exports = function (grunt) { grunt.registerTask('docs-css', ['sass:docs', 'postcss:docs', 'postcss:examples', 'csscomb:docs', 'csscomb:examples', 'cssmin:docs']); grunt.registerTask('docs-js', ['babel:docs', 'uglify:docsJs']); grunt.registerTask('lint-docs-js', ['jscs:assets']); - grunt.registerTask('docs-copy-bootstrap', ['copy:bs-docs-scss', 'copy:bs-docs-components', 'copy:bs-docs-content']); + grunt.registerTask('docs-copy-bootstrap-docs', ['copy:bs-docs-scss', 'copy:bs-docs-components', 'copy:bs-docs-content']); - grunt.registerTask('docs', ['docs-copy-bootstrap', 'docs-css', 'docs-js', 'lint-docs-js', 'clean:docs', 'copy:docs']); + grunt.registerTask('docs', ['clean:docs', 'docs-copy-bootstrap-docs', 'docs-css', 'docs-js', 'lint-docs-js', 'copy:docs']); grunt.registerTask('prep-release', ['dist', 'docs', 'jekyll:github', 'htmlmin', 'compress']); diff --git a/docs/_includes/footer.html b/docs/_includes/footer.html index 9179f63f..5e2ebe58 100644 --- a/docs/_includes/footer.html +++ b/docs/_includes/footer.html @@ -25,13 +25,13 @@ {% if site.github %} -{% else %} - -{% endif %} - -{% if site.github %} {% else %} + + {% for file in site.data.configBridge.paths.coreJs %} + + {% endfor %} + {% for file in site.data.configBridge.paths.docsJs %} {% endfor %} diff --git a/docs/assets/scss/.READONLY-MOSTLY.txt b/docs/assets/scss/.READONLY-MOSTLY.txt index a7844356..6ffc3013 100644 --- a/docs/assets/scss/.READONLY-MOSTLY.txt +++ b/docs/assets/scss/.READONLY-MOSTLY.txt @@ -1,6 +1,6 @@ DO NOT edit files in this folder EXCEPT docs.scss. These files are copied using - grunt docs-copy-bootstrap + grunt docs-copy-bootstrap-docs This is done to keep samples in sync with the upstream bs4. diff --git a/docs/assets/scss/docs.scss b/docs/assets/scss/docs.scss index fa3651c0..316d0211 100644 --- a/docs/assets/scss/docs.scss +++ b/docs/assets/scss/docs.scss @@ -1,5 +1,5 @@ // This is the only customized file in this immediate directory, the rest are copied with: -// grunt docs-copy-bootstrap +// grunt docs-copy-bootstrap-docs // (perhaps add customizations in subdirectories) /*! diff --git a/docs/components/.READONLY.txt b/docs/components/.READONLY.txt index 08e70e0b..3d9e7b09 100644 --- a/docs/components/.READONLY.txt +++ b/docs/components/.READONLY.txt @@ -1,6 +1,6 @@ DO NOT edit files in this folder. These files are copied using - grunt docs-copy-bootstrap + grunt docs-copy-bootstrap-docs This is done to keep samples in sync with the upstream bs4. diff --git a/docs/content/.READONLY.txt b/docs/content/.READONLY.txt index 08e70e0b..3d9e7b09 100644 --- a/docs/content/.READONLY.txt +++ b/docs/content/.READONLY.txt @@ -1,6 +1,6 @@ DO NOT edit files in this folder. These files are copied using - grunt docs-copy-bootstrap + grunt docs-copy-bootstrap-docs This is done to keep samples in sync with the upstream bs4. diff --git a/grunt/configBridge.json b/grunt/configBridge.json index 27ba1816..b63fd5ac 100644 --- a/grunt/configBridge.json +++ b/grunt/configBridge.json @@ -6,6 +6,18 @@ "../assets/js/vendor/holder.min.js", "../assets/js/dist/style.js", "../assets/js/dist/application.js" + ], + + "coreJs": [ + "../dist/js/babel/autofill.js", + "../dist/js/babel/bootstrapMaterialDesign.js", + "../dist/js/babel/checkbox.js", + "../dist/js/babel/fileInput.js", + "../dist/js/babel/input.js", + "../dist/js/babel/radio.js", + "../dist/js/babel/ripples.js", + "../dist/js/babel/togglebutton.js", + "../dist/js/babel/util.js" ] } }