diff --git a/app/src/router.js b/app/src/router.js index a008eea2..bdee31d3 100644 --- a/app/src/router.js +++ b/app/src/router.js @@ -11,10 +11,10 @@ module.exports = function(GulpAngularGenerator) { if (this.props.router.module === 'ngRoute') { this.routerHtml = '
'; - this.routerJs = this.fs.read(this.templatePath('src/app/__ngroute.' + this.props.jsPreprocessor.extension)); + this.routerJs = this.fs.read(this.templatePath('src/app/_ngroute/__ngroute.' + this.props.jsPreprocessor.extension)); } else if (this.props.router.module === 'ui.router') { this.routerHtml = '
'; - this.routerJs = this.fs.read(this.templatePath('src/app/__uirouter.' + this.props.jsPreprocessor.extension)); + this.routerJs = this.fs.read(this.templatePath('src/app/_uirouter/__uirouter.' + this.props.jsPreprocessor.extension)); } else { this.routerHtml = this.fs.read(this.templatePath(routerPartialSrc)); this.routerHtml = this.routerHtml.replace( diff --git a/app/src/ui.js b/app/src/ui.js index 3a9fb8a3..e7c5188f 100644 --- a/app/src/ui.js +++ b/app/src/ui.js @@ -55,14 +55,14 @@ module.exports = function(GulpAngularGenerator) { } this.files.push({ - src: 'src/app/__' + this.props.ui.key + '-index.' + this.props.cssPreprocessor.extension, + src: 'src/app/_' + this.props.ui.key + '/__' + this.props.ui.key + '-index.' + this.props.cssPreprocessor.extension, dest: 'src/app/index.' + this.props.cssPreprocessor.extension, template: false }); - if(this.isVendorStylesPreprocessed && this.props.ui.key !== 'none') { + if(this.props.cssPreprocessor.key !== 'none') { this.files.push({ - src: 'src/app/__' + this.props.ui.key + '-vendor.' + this.props.cssPreprocessor.extension, + src: 'src/app/_' + this.props.ui.key + '/__' + this.props.ui.key + '-vendor.' + this.props.cssPreprocessor.extension, dest: 'src/app/vendor.' + this.props.cssPreprocessor.extension, template: true }); @@ -80,7 +80,7 @@ module.exports = function(GulpAngularGenerator) { if (this.props.ui.key === 'bootstrap') { if(this.props.bootstrapComponents.key !== 'official') { if(this.props.cssPreprocessor.extension === 'scss') { - this.wiredepExclusions.push('/bootstrap-sass-official/'); + this.wiredepExclusions.push('/bootstrap-sass-official\\/.*\\.js/'); } else { this.wiredepExclusions.push('/bootstrap\\.js/'); } diff --git a/app/templates/_gulpfile.js b/app/templates/_gulpfile.js index b599fedd..f47bbabc 100644 --- a/app/templates/_gulpfile.js +++ b/app/templates/_gulpfile.js @@ -2,7 +2,6 @@ var gulp = require('gulp'); var gutil = require('gulp-util'); -var _ = require('lodash'); var wrench = require('wrench'); var options = { @@ -15,6 +14,12 @@ var options = { gutil.log(gutil.colors.red('[' + title + ']'), err.toString()); this.emit('end'); }; + }, + wiredep: { + directory: 'bower_components' +<% if(wiredepExclusions.length > 0) { %>, + exclude: [<%= wiredepExclusions.join(', ') %>] +<% } %> } }; diff --git a/app/templates/gulp/_inject.js b/app/templates/gulp/_inject.js index a7707660..a081ccf9 100644 --- a/app/templates/gulp/_inject.js +++ b/app/templates/gulp/_inject.js @@ -19,8 +19,8 @@ module.exports = function(options) { options.src + '/app/**/*.css' ], { read: false }); <% } %> - <% if (props.jsPreprocessor.key === 'typescript') { %> + var sortOutput = require('../' + options.tmp + '/sortOutput.json'); <% } %> @@ -49,17 +49,10 @@ module.exports = function(options) { addRootSlash: false }; - var wiredepOptions = { - directory: 'bower_components' -<% if(wiredepExclusions.length > 0) { %>, - exclude: [<%= wiredepExclusions.join(', ') %>] -<% } %> - }; - return gulp.src(options.src + '/*.html') .pipe($.inject(injectStyles, injectOptions)) .pipe($.inject(injectScripts, injectOptions)) - .pipe(wiredep(wiredepOptions)) + .pipe(wiredep(options.wiredep)) .pipe(gulp.dest(options.tmp + '/serve')); }); diff --git a/app/templates/gulp/_styles.js b/app/templates/gulp/_styles.js index a6e8271a..899b127a 100644 --- a/app/templates/gulp/_styles.js +++ b/app/templates/gulp/_styles.js @@ -5,6 +5,8 @@ var browserSync = require('browser-sync'); var $ = require('gulp-load-plugins')(); +var wiredep = require('wiredep').stream; + module.exports = function(options) { gulp.task('styles', function () { <% if (props.cssPreprocessor.key === 'less') { %> @@ -37,6 +39,7 @@ module.exports = function(options) { }; var indexFilter = $.filter('index.<%= props.cssPreprocessor.extension %>'); + var vendorFilter = $.filter('vendor.<%= props.cssPreprocessor.extension %>'); <% if (props.cssPreprocessor.key === 'ruby-sass') { %> var cssFilter = $.filter('**/*.css'); <% } %> @@ -45,28 +48,31 @@ module.exports = function(options) { options.src + '/app/index.<%= props.cssPreprocessor.extension %>', options.src + '/app/vendor.<%= props.cssPreprocessor.extension %>' ]) - .pipe(indexFilter) - .pipe($.inject(injectFiles, injectOptions)) - .pipe(indexFilter.restore()) + .pipe(indexFilter) + .pipe($.inject(injectFiles, injectOptions)) + .pipe(indexFilter.restore()) + .pipe(vendorFilter) + .pipe(wiredep(options.wiredep)) + .pipe(vendorFilter.restore()) <% if (props.cssPreprocessor.key === 'ruby-sass') { %> - .pipe($.rubySass(sassOptions)).on('error', options.errorHandler('RubySass')) - .pipe(cssFilter) - .pipe($.sourcemaps.init({ loadMaps: true })) + .pipe($.rubySass(sassOptions)).on('error', options.errorHandler('RubySass')) + .pipe(cssFilter) + .pipe($.sourcemaps.init({ loadMaps: true })) <% } else { %> - .pipe($.sourcemaps.init()) + .pipe($.sourcemaps.init()) <% } if (props.cssPreprocessor.key === 'less') { %> - .pipe($.less(lessOptions)).on('error', options.errorHandler('Less')) + .pipe($.less(lessOptions)).on('error', options.errorHandler('Less')) <% } else if (props.cssPreprocessor.key === 'node-sass') { %> - .pipe($.sass(sassOptions)).on('error', options.errorHandler('Sass')) + .pipe($.sass(sassOptions)).on('error', options.errorHandler('Sass')) <% } else if (props.cssPreprocessor.key === 'stylus') { %> - .pipe($.stylus()).on('error', options.errorHandler('Stylus')) + .pipe($.stylus()).on('error', options.errorHandler('Stylus')) <% } %> - .pipe($.autoprefixer()).on('error', options.errorHandler('Autoprefixer')) - .pipe($.sourcemaps.write()) + .pipe($.autoprefixer()).on('error', options.errorHandler('Autoprefixer')) + .pipe($.sourcemaps.write()) <% if (props.cssPreprocessor.key === 'ruby-sass') { %> - .pipe(cssFilter.restore()) + .pipe(cssFilter.restore()) <% } %> - .pipe(gulp.dest(options.tmp + '/serve/app/')) - .pipe(browserSync.reload({ stream: true })); + .pipe(gulp.dest(options.tmp + '/serve/app/')) + .pipe(browserSync.reload({ stream: true })); }); }; diff --git a/app/templates/gulp/_unit-tests.js b/app/templates/gulp/_unit-tests.js index a4a73d56..6f6c91a7 100644 --- a/app/templates/gulp/_unit-tests.js +++ b/app/templates/gulp/_unit-tests.js @@ -11,14 +11,11 @@ var _ = require('lodash'); module.exports = function(options) { function listFiles(callback) { - var bowerDeps = wiredep({ - directory: 'bower_components', -<% if(wiredepExclusions.length > 0) { %> - exclude: [<%= wiredepExclusions.join(', ') %>], -<% } %> + var wiredepOptions = _.extend({}, options.wiredep, { dependencies: true, devDependencies: true }); + var bowerDeps = wiredep(wiredepOptions); var specFiles = [ options.src + '/**/*.spec.js', diff --git a/app/templates/src/_index.html b/app/templates/src/_index.html index a454901f..53ff5700 100644 --- a/app/templates/src/_index.html +++ b/app/templates/src/_index.html @@ -8,11 +8,9 @@ -<% if (isVendorStylesPreprocessed) { %> +<% if (props.cssPreprocessor.key !== 'none') { %> -<% } else if (props.ui.key === 'bootstrap') { %> - -<% } %> +<% } %> diff --git a/app/templates/src/app/__bootstrap-vendor.less b/app/templates/src/app/__bootstrap-vendor.less deleted file mode 100644 index d982d428..00000000 --- a/app/templates/src/app/__bootstrap-vendor.less +++ /dev/null @@ -1,3 +0,0 @@ -@import '../<%= computedPaths.appToBower %>/bower_components/bootstrap/less/bootstrap.less'; - -@icon-font-path: '../<%= computedPaths.appToBower %>/bower_components/bootstrap/fonts/'; diff --git a/app/templates/src/app/__bootstrap-vendor.scss b/app/templates/src/app/__bootstrap-vendor.scss deleted file mode 100644 index 15114180..00000000 --- a/app/templates/src/app/__bootstrap-vendor.scss +++ /dev/null @@ -1,3 +0,0 @@ -$icon-font-path: "../<%= computedPaths.appToBower %>/bower_components/bootstrap-sass-official/assets/fonts/bootstrap/"; - -@import '../<%= computedPaths.appToBower %>/bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap'; diff --git a/app/templates/src/app/__foundation-vendor.scss b/app/templates/src/app/__foundation-vendor.scss deleted file mode 100644 index c8ad54a7..00000000 --- a/app/templates/src/app/__foundation-vendor.scss +++ /dev/null @@ -1 +0,0 @@ -@import '../<%= computedPaths.appToBower %>/bower_components/foundation/scss/foundation'; diff --git a/app/templates/src/app/__none-vendor.less b/app/templates/src/app/__none-vendor.less deleted file mode 100644 index 05936976..00000000 --- a/app/templates/src/app/__none-vendor.less +++ /dev/null @@ -1 +0,0 @@ -// Nothing yet diff --git a/app/templates/src/app/__none-vendor.scss b/app/templates/src/app/__none-vendor.scss deleted file mode 100644 index 05936976..00000000 --- a/app/templates/src/app/__none-vendor.scss +++ /dev/null @@ -1 +0,0 @@ -// Nothing yet diff --git a/app/templates/src/app/__angular-material-index.css b/app/templates/src/app/_angular-material/__angular-material-index.css similarity index 100% rename from app/templates/src/app/__angular-material-index.css rename to app/templates/src/app/_angular-material/__angular-material-index.css diff --git a/app/templates/src/app/__angular-material-index.less b/app/templates/src/app/_angular-material/__angular-material-index.less similarity index 85% rename from app/templates/src/app/__angular-material-index.less rename to app/templates/src/app/_angular-material/__angular-material-index.less index 41a326fc..d5a0d605 100644 --- a/app/templates/src/app/__angular-material-index.less +++ b/app/templates/src/app/_angular-material/__angular-material-index.less @@ -53,5 +53,8 @@ section.jumbotron { } } } + +/* Do not remove this comments bellow. It's the markers used by gulp-inject to inject + all your less files automatically */ // injector // endinjector diff --git a/app/templates/src/app/__angular-material-index.scss b/app/templates/src/app/_angular-material/__angular-material-index.scss similarity index 85% rename from app/templates/src/app/__angular-material-index.scss rename to app/templates/src/app/_angular-material/__angular-material-index.scss index 41a326fc..bd1edb3a 100644 --- a/app/templates/src/app/__angular-material-index.scss +++ b/app/templates/src/app/_angular-material/__angular-material-index.scss @@ -53,5 +53,8 @@ section.jumbotron { } } } + +/* Do not remove this comments bellow. It's the markers used by gulp-inject to inject + all your sass files automatically */ // injector // endinjector diff --git a/app/templates/src/app/__angular-material-index.styl b/app/templates/src/app/_angular-material/__angular-material-index.styl similarity index 84% rename from app/templates/src/app/__angular-material-index.styl rename to app/templates/src/app/_angular-material/__angular-material-index.styl index a4a36b4f..72c794ac 100644 --- a/app/templates/src/app/__angular-material-index.styl +++ b/app/templates/src/app/_angular-material/__angular-material-index.styl @@ -41,5 +41,8 @@ section &.pull-right float right width 50px + +/* Do not remove this comments bellow. It's the markers used by gulp-inject to inject + all your stylus files automatically */ // injector // endinjector diff --git a/app/templates/src/app/_angular-material/__angular-material-vendor.less b/app/templates/src/app/_angular-material/__angular-material-vendor.less new file mode 100644 index 00000000..3f3b40e1 --- /dev/null +++ b/app/templates/src/app/_angular-material/__angular-material-vendor.less @@ -0,0 +1,4 @@ +/* Do not remove this comments bellow. It's the markers used by wiredep to inject + less dependencies when defined in the bower.json of your dependencies */ +// bower:less +// endbower diff --git a/app/templates/src/app/_angular-material/__angular-material-vendor.scss b/app/templates/src/app/_angular-material/__angular-material-vendor.scss new file mode 100644 index 00000000..053b0f09 --- /dev/null +++ b/app/templates/src/app/_angular-material/__angular-material-vendor.scss @@ -0,0 +1,4 @@ +/* Do not remove this comments bellow. It's the markers used by wiredep to inject + sass dependencies when defined in the bower.json of your dependencies */ +// bower:scss +// endbower diff --git a/app/templates/src/app/_angular-material/__angular-material-vendor.styl b/app/templates/src/app/_angular-material/__angular-material-vendor.styl new file mode 100644 index 00000000..fff90697 --- /dev/null +++ b/app/templates/src/app/_angular-material/__angular-material-vendor.styl @@ -0,0 +1,4 @@ +/* Do not remove this comments bellow. It's the markers used by wiredep to inject + stylus dependencies when defined in the bower.json of your dependencies */ +// bower:styl +// endbower diff --git a/app/templates/src/app/__bootstrap-index.css b/app/templates/src/app/_bootstrap/__bootstrap-index.css similarity index 100% rename from app/templates/src/app/__bootstrap-index.css rename to app/templates/src/app/_bootstrap/__bootstrap-index.css diff --git a/app/templates/src/app/__bootstrap-index.less b/app/templates/src/app/_bootstrap/__bootstrap-index.less similarity index 60% rename from app/templates/src/app/__bootstrap-index.less rename to app/templates/src/app/_bootstrap/__bootstrap-index.less index 87955cbe..75350b29 100644 --- a/app/templates/src/app/__bootstrap-index.less +++ b/app/templates/src/app/_bootstrap/__bootstrap-index.less @@ -12,5 +12,8 @@ width: 50px; } } + +/* Do not remove this comments bellow. It's the markers used by gulp-inject to inject + all your less files automatically */ // injector // endinjector diff --git a/app/templates/src/app/__bootstrap-index.scss b/app/templates/src/app/_bootstrap/__bootstrap-index.scss similarity index 60% rename from app/templates/src/app/__bootstrap-index.scss rename to app/templates/src/app/_bootstrap/__bootstrap-index.scss index 87955cbe..4c58ef3f 100644 --- a/app/templates/src/app/__bootstrap-index.scss +++ b/app/templates/src/app/_bootstrap/__bootstrap-index.scss @@ -12,5 +12,8 @@ width: 50px; } } + +/* Do not remove this comments bellow. It's the markers used by gulp-inject to inject + all your sass files automatically */ // injector // endinjector diff --git a/app/templates/src/app/__bootstrap-index.styl b/app/templates/src/app/_bootstrap/__bootstrap-index.styl similarity index 56% rename from app/templates/src/app/__bootstrap-index.styl rename to app/templates/src/app/_bootstrap/__bootstrap-index.styl index 188950bf..db6eec17 100644 --- a/app/templates/src/app/__bootstrap-index.styl +++ b/app/templates/src/app/_bootstrap/__bootstrap-index.styl @@ -9,5 +9,8 @@ img.pull-right width 50px + +/* Do not remove this comments bellow. It's the markers used by gulp-inject to inject + all your stylus files automatically */ // injector // endinjector diff --git a/app/templates/src/app/_bootstrap/__bootstrap-vendor.less b/app/templates/src/app/_bootstrap/__bootstrap-vendor.less new file mode 100644 index 00000000..c69e9018 --- /dev/null +++ b/app/templates/src/app/_bootstrap/__bootstrap-vendor.less @@ -0,0 +1,6 @@ +/* Do not remove this comments bellow. It's the markers used by wiredep to inject + less dependencies when defined in the bower.json of your dependencies */ +// bower:less +// endbower + +@icon-font-path: '../<%= computedPaths.appToBower %>/bower_components/bootstrap/fonts/'; diff --git a/app/templates/src/app/_bootstrap/__bootstrap-vendor.scss b/app/templates/src/app/_bootstrap/__bootstrap-vendor.scss new file mode 100644 index 00000000..b13b8eb0 --- /dev/null +++ b/app/templates/src/app/_bootstrap/__bootstrap-vendor.scss @@ -0,0 +1,6 @@ +$icon-font-path: "../<%= computedPaths.appToBower %>/bower_components/bootstrap-sass-official/assets/fonts/bootstrap/"; + +/* Do not remove this comments bellow. It's the markers used by wiredep to inject + sass dependencies when defined in the bower.json of your dependencies */ +// bower:scss +// endbower diff --git a/app/templates/src/app/_bootstrap/__bootstrap-vendor.styl b/app/templates/src/app/_bootstrap/__bootstrap-vendor.styl new file mode 100644 index 00000000..fff90697 --- /dev/null +++ b/app/templates/src/app/_bootstrap/__bootstrap-vendor.styl @@ -0,0 +1,4 @@ +/* Do not remove this comments bellow. It's the markers used by wiredep to inject + stylus dependencies when defined in the bower.json of your dependencies */ +// bower:styl +// endbower diff --git a/app/templates/src/app/__foundation-index.css b/app/templates/src/app/_foundation/__foundation-index.css similarity index 100% rename from app/templates/src/app/__foundation-index.css rename to app/templates/src/app/_foundation/__foundation-index.css diff --git a/app/templates/src/app/__foundation-index.less b/app/templates/src/app/_foundation/__foundation-index.less similarity index 64% rename from app/templates/src/app/__foundation-index.less rename to app/templates/src/app/_foundation/__foundation-index.less index cc75fda8..bf0f6dbd 100644 --- a/app/templates/src/app/__foundation-index.less +++ b/app/templates/src/app/_foundation/__foundation-index.less @@ -17,5 +17,8 @@ width: 50px; } } + +/* Do not remove this comments bellow. It's the markers used by gulp-inject to inject + all your less files automatically */ // injector // endinjector diff --git a/app/templates/src/app/__foundation-index.scss b/app/templates/src/app/_foundation/__foundation-index.scss similarity index 64% rename from app/templates/src/app/__foundation-index.scss rename to app/templates/src/app/_foundation/__foundation-index.scss index cc75fda8..41472002 100644 --- a/app/templates/src/app/__foundation-index.scss +++ b/app/templates/src/app/_foundation/__foundation-index.scss @@ -17,5 +17,8 @@ width: 50px; } } + +/* Do not remove this comments bellow. It's the markers used by gulp-inject to inject + all your sass files automatically */ // injector // endinjector diff --git a/app/templates/src/app/__foundation-index.styl b/app/templates/src/app/_foundation/__foundation-index.styl similarity index 59% rename from app/templates/src/app/__foundation-index.styl rename to app/templates/src/app/_foundation/__foundation-index.styl index 92262f2e..53113c93 100644 --- a/app/templates/src/app/__foundation-index.styl +++ b/app/templates/src/app/_foundation/__foundation-index.styl @@ -13,5 +13,8 @@ img.right width 50px + +/* Do not remove this comments bellow. It's the markers used by gulp-inject to inject + all your stylus files automatically */ // injector // endinjector diff --git a/app/templates/src/app/_foundation/__foundation-vendor.less b/app/templates/src/app/_foundation/__foundation-vendor.less new file mode 100644 index 00000000..3f3b40e1 --- /dev/null +++ b/app/templates/src/app/_foundation/__foundation-vendor.less @@ -0,0 +1,4 @@ +/* Do not remove this comments bellow. It's the markers used by wiredep to inject + less dependencies when defined in the bower.json of your dependencies */ +// bower:less +// endbower diff --git a/app/templates/src/app/_foundation/__foundation-vendor.scss b/app/templates/src/app/_foundation/__foundation-vendor.scss new file mode 100644 index 00000000..a927510c --- /dev/null +++ b/app/templates/src/app/_foundation/__foundation-vendor.scss @@ -0,0 +1,8 @@ +/* The import of foundation is made manually because there is still no links of the + sass version in theit bower.json... */ +@import '../<%= computedPaths.appToBower %>/bower_components/foundation/scss/foundation'; + +/* Do not remove this comments bellow. It's the markers used by wiredep to inject + sass dependencies when defined in the bower.json of your dependencies */ +// bower:scss +// endbower diff --git a/app/templates/src/app/_foundation/__foundation-vendor.styl b/app/templates/src/app/_foundation/__foundation-vendor.styl new file mode 100644 index 00000000..fff90697 --- /dev/null +++ b/app/templates/src/app/_foundation/__foundation-vendor.styl @@ -0,0 +1,4 @@ +/* Do not remove this comments bellow. It's the markers used by wiredep to inject + stylus dependencies when defined in the bower.json of your dependencies */ +// bower:styl +// endbower diff --git a/app/templates/src/app/__ngroute.coffee b/app/templates/src/app/_ngroute/__ngroute.coffee similarity index 100% rename from app/templates/src/app/__ngroute.coffee rename to app/templates/src/app/_ngroute/__ngroute.coffee diff --git a/app/templates/src/app/__ngroute.es6 b/app/templates/src/app/_ngroute/__ngroute.es6 similarity index 100% rename from app/templates/src/app/__ngroute.es6 rename to app/templates/src/app/_ngroute/__ngroute.es6 diff --git a/app/templates/src/app/__ngroute.js b/app/templates/src/app/_ngroute/__ngroute.js similarity index 100% rename from app/templates/src/app/__ngroute.js rename to app/templates/src/app/_ngroute/__ngroute.js diff --git a/app/templates/src/app/__ngroute.ts b/app/templates/src/app/_ngroute/__ngroute.ts similarity index 100% rename from app/templates/src/app/__ngroute.ts rename to app/templates/src/app/_ngroute/__ngroute.ts diff --git a/app/templates/src/app/__none-index.css b/app/templates/src/app/_none/__none-index.css similarity index 100% rename from app/templates/src/app/__none-index.css rename to app/templates/src/app/_none/__none-index.css diff --git a/app/templates/src/app/__none-index.less b/app/templates/src/app/_none/__none-index.less similarity index 93% rename from app/templates/src/app/__none-index.less rename to app/templates/src/app/_none/__none-index.less index f9c6265d..80214b4c 100644 --- a/app/templates/src/app/__none-index.less +++ b/app/templates/src/app/_none/__none-index.less @@ -114,5 +114,8 @@ a { hr { clear: both; } + +/* Do not remove this comments bellow. It's the markers used by gulp-inject to inject + all your less files automatically */ // injector // endinjector diff --git a/app/templates/src/app/__none-index.scss b/app/templates/src/app/_none/__none-index.scss similarity index 93% rename from app/templates/src/app/__none-index.scss rename to app/templates/src/app/_none/__none-index.scss index f9c6265d..ec27a4e3 100644 --- a/app/templates/src/app/__none-index.scss +++ b/app/templates/src/app/_none/__none-index.scss @@ -114,5 +114,8 @@ a { hr { clear: both; } + +/* Do not remove this comments bellow. It's the markers used by gulp-inject to inject + all your sass files automatically */ // injector // endinjector diff --git a/app/templates/src/app/__none-index.styl b/app/templates/src/app/_none/__none-index.styl similarity index 92% rename from app/templates/src/app/__none-index.styl rename to app/templates/src/app/_none/__none-index.styl index 520f4403..2239e60b 100644 --- a/app/templates/src/app/__none-index.styl +++ b/app/templates/src/app/_none/__none-index.styl @@ -112,5 +112,8 @@ a hr clear both + +/* Do not remove this comments bellow. It's the markers used by gulp-inject to inject + all your stylus files automatically */ // injector // endinjector diff --git a/app/templates/src/app/_none/__none-vendor.less b/app/templates/src/app/_none/__none-vendor.less new file mode 100644 index 00000000..3f3b40e1 --- /dev/null +++ b/app/templates/src/app/_none/__none-vendor.less @@ -0,0 +1,4 @@ +/* Do not remove this comments bellow. It's the markers used by wiredep to inject + less dependencies when defined in the bower.json of your dependencies */ +// bower:less +// endbower diff --git a/app/templates/src/app/_none/__none-vendor.scss b/app/templates/src/app/_none/__none-vendor.scss new file mode 100644 index 00000000..053b0f09 --- /dev/null +++ b/app/templates/src/app/_none/__none-vendor.scss @@ -0,0 +1,4 @@ +/* Do not remove this comments bellow. It's the markers used by wiredep to inject + sass dependencies when defined in the bower.json of your dependencies */ +// bower:scss +// endbower diff --git a/app/templates/src/app/_none/__none-vendor.styl b/app/templates/src/app/_none/__none-vendor.styl new file mode 100644 index 00000000..fff90697 --- /dev/null +++ b/app/templates/src/app/_none/__none-vendor.styl @@ -0,0 +1,4 @@ +/* Do not remove this comments bellow. It's the markers used by wiredep to inject + stylus dependencies when defined in the bower.json of your dependencies */ +// bower:styl +// endbower diff --git a/app/templates/src/app/__uirouter.coffee b/app/templates/src/app/_uirouter/__uirouter.coffee similarity index 100% rename from app/templates/src/app/__uirouter.coffee rename to app/templates/src/app/_uirouter/__uirouter.coffee diff --git a/app/templates/src/app/__uirouter.es6 b/app/templates/src/app/_uirouter/__uirouter.es6 similarity index 100% rename from app/templates/src/app/__uirouter.es6 rename to app/templates/src/app/_uirouter/__uirouter.es6 diff --git a/app/templates/src/app/__uirouter.js b/app/templates/src/app/_uirouter/__uirouter.js similarity index 100% rename from app/templates/src/app/__uirouter.js rename to app/templates/src/app/_uirouter/__uirouter.js diff --git a/app/templates/src/app/__uirouter.ts b/app/templates/src/app/_uirouter/__uirouter.ts similarity index 100% rename from app/templates/src/app/__uirouter.ts rename to app/templates/src/app/_uirouter/__uirouter.ts diff --git a/test/node/test-router.js b/test/node/test-router.js index 9aa9017e..52be8283 100644 --- a/test/node/test-router.js +++ b/test/node/test-router.js @@ -30,14 +30,14 @@ describe('gulp-angular generator techs script', function () { ui: { key: 'testUi' }, jsPreprocessor: { extension: 'testExtension' } }; - read.withArgs('template/src/app/__ngroute.testExtension') + read.withArgs('template/src/app/_ngroute/__ngroute.testExtension') .returns('my test content 1'); generator.computeRouter(); generator.routerHtml.should.match(/ng-view/); generator.routerJs.should.equal('my test content 1'); generator.props.router.module = 'ui.router'; - read.withArgs('template/src/app/__uirouter.testExtension') + read.withArgs('template/src/app/_uirouter/__uirouter.testExtension') .returns('my test content 2'); generator.computeRouter(); generator.routerHtml.should.match(/ui-view/); diff --git a/test/node/test-ui.js b/test/node/test-ui.js index a97f3295..124b27a0 100644 --- a/test/node/test-ui.js +++ b/test/node/test-ui.js @@ -105,13 +105,12 @@ describe('gulp-angular generator ui script', function () { generator.props = { router: { module: null }, ui: { key: 'none' }, - cssPreprocessor: { extension: 'scss' } + cssPreprocessor: { key: 'none', extension: 'css' } }; - generator.isVendorStylesPreprocessed = true; generator.files = []; generator.uiFiles(); generator.files[0].src.should.be.equal('src/app/components/navbar/__none-navbar.html'); - generator.files[1].src.should.be.equal('src/app/__none-index.scss'); + generator.files[1].src.should.be.equal('src/app/_none/__none-index.css'); generator.files.length.should.be.equal(2); }); @@ -119,11 +118,14 @@ describe('gulp-angular generator ui script', function () { generator.props = { router: { module: 'ngRoute' }, ui: { key: 'bootstrap' }, - cssPreprocessor: { extension: 'scss' } + cssPreprocessor: { key: 'notnone', extension: 'scss' } }; - generator.isVendorStylesPreprocessed = true; generator.files = []; generator.uiFiles(); + generator.files[0].src.should.be.equal('src/app/components/navbar/__bootstrap-navbar.html'); + generator.files[1].src.should.be.equal('src/app/main/__bootstrap.html'); + generator.files[2].src.should.be.equal('src/app/_bootstrap/__bootstrap-index.scss'); + generator.files[3].src.should.be.equal('src/app/_bootstrap/__bootstrap-vendor.scss'); generator.files.length.should.be.equal(4); }); }); @@ -137,7 +139,7 @@ describe('gulp-angular generator ui script', function () { cssPreprocessor: { extension: 'scss' } }; generator.computeWiredepExclusions(); - generator.wiredepExclusions[0].should.be.equal('/bootstrap-sass-official/'); + generator.wiredepExclusions[0].should.be.equal('/bootstrap-sass-official\\/.*\\.js/'); generator.wiredepExclusions[1].should.be.equal('/bootstrap\\.css/'); }); diff --git a/test/template/test-gulpfile.js b/test/template/test-gulpfile.js index 5319a074..3df19f0e 100644 --- a/test/template/test-gulpfile.js +++ b/test/template/test-gulpfile.js @@ -35,4 +35,14 @@ describe('gulp-angular gulpfile template', function () { result.should.match(/e2e: 'test\/e2e\/dir'/); }); + it('should configure wiredep with wiredep exclusions', function() { + model.wiredepExclusions = []; + var result = gulpfile(model); + result.should.not.match(/exclude:/); + + model.wiredepExclusions = ['\'a\'', '\'b\'']; + result = gulpfile(model); + result.should.match(/exclude: \['a', 'b'\]/); + }); + }); diff --git a/test/template/test-index-html.js b/test/template/test-index-html.js index 968a872f..202cc13a 100644 --- a/test/template/test-index-html.js +++ b/test/template/test-index-html.js @@ -31,24 +31,16 @@ describe('gulp-angular index js template', function () { }); it('should insert the vendor build block depending of data', function() { - model.props.ui.key = 'bootstrap'; + model.props.cssPreprocessor.key = 'none'; model.props.paths.src = 'src'; model.props.paths.tmp = 'tmp'; - model.computedPaths.appToBower = 'appToBower'; - model.isVendorStylesPreprocessed = false; var result = indexHtml(model); result.should.match(//); - result.should.match(/