From 6a1678953bce069b4ac79f68e0959e80cbdbaa3f Mon Sep 17 00:00:00 2001 From: Stephen Sawchuk Date: Mon, 17 Feb 2014 10:48:31 -0500 Subject: [PATCH] feat(deps): upgrade to grunt-bower-install 1.0 Upgrade command changed from `grunt bower-install` to `grunt bowerInstall`. --- app/index.js | 12 +++++++++--- app/templates/styles/main.scss | 5 ++++- package.json | 2 +- templates/common/Gruntfile.js | 23 ++++++++++++++--------- templates/common/_package.json | 2 +- 5 files changed, 29 insertions(+), 15 deletions(-) diff --git a/app/index.js b/app/index.js index 89964a3d6..b80b4f9af 100644 --- a/app/index.js +++ b/app/index.js @@ -269,7 +269,7 @@ Generator.prototype._injectDependencies = function _injectDependencies() { '\nAfter running `npm install & bower install`, inject your front end dependencies into' + '\nyour HTML by running:' + '\n' + - chalk.yellow.bold('\n grunt bower-install'); + chalk.yellow.bold('\n grunt bowerInstall'); if (this.options['skip-install']) { console.log(howToInstall); @@ -278,8 +278,14 @@ Generator.prototype._injectDependencies = function _injectDependencies() { directory: 'app/bower_components', bowerJson: JSON.parse(fs.readFileSync('./bower.json')), ignorePath: 'app/', - htmlFile: 'app/index.html', - cssPattern: '' + src: 'app/index.html', + fileTypes: { + html: { + replace: { + css: '' + } + } + } }); } }; diff --git a/app/templates/styles/main.scss b/app/templates/styles/main.scss index 033261fe2..7c1080f37 100644 --- a/app/templates/styles/main.scss +++ b/app/templates/styles/main.scss @@ -2,7 +2,10 @@ @import 'sass-bootstrap/lib/bootstrap'; -<% } %>.browsehappy { +<% } %>// bower:scss +// endbower + +.browsehappy { margin: 0.2em 0; background: #ccc; color: #000; diff --git a/package.json b/package.json index e84f9271a..dd6da0dce 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ }, "dependencies": { "chalk": "~0.4.0", - "wiredep": "~0.4.2", + "wiredep": "~1.0.0", "yeoman-generator": "~0.16.0" }, "peerDependencies": { diff --git a/templates/common/Gruntfile.js b/templates/common/Gruntfile.js index c36416ae2..bcb121440 100644 --- a/templates/common/Gruntfile.js +++ b/templates/common/Gruntfile.js @@ -153,14 +153,17 @@ module.exports = function (grunt) { }, // Automatically inject Bower components into the app - 'bower-install': { + bowerInstall: { app: { - html: '<%%= yeoman.app %>/index.html', + src: ['<%%= yeoman.app %>/index.html'], ignorePath: '<%%= yeoman.app %>/' - } - }, + }<% if (compass) { %>, + sass: { + src: ['<%%= yeoman.app %>/styles/{,*/}*.{scss,sass}'], + ignorePath: '<%%= yeoman.app %>/bower_components/' + }<% } %> + },<% if (coffee) { %> -<% if (coffee) { %> // Compiles CoffeeScript to JavaScript coffee: { options: { @@ -185,9 +188,8 @@ module.exports = function (grunt) { ext: '.js' }] } - },<% } %> + },<% } %><% if (compass) { %> -<% if (compass) { %> // Compiles Sass to CSS and generates necessary files if requested compass: { options: { @@ -265,6 +267,7 @@ module.exports = function (grunt) { root: '<%%= yeoman.app %>' } }, + imagemin: { dist: { files: [{ @@ -275,6 +278,7 @@ module.exports = function (grunt) { }] } }, + svgmin: { dist: { files: [{ @@ -285,6 +289,7 @@ module.exports = function (grunt) { }] } }, + htmlmin: { dist: { options: { @@ -419,7 +424,7 @@ module.exports = function (grunt) { grunt.task.run([ 'clean:server', - 'bower-install', + 'bowerInstall', 'concurrent:server', 'autoprefixer', 'connect:livereload', @@ -442,7 +447,7 @@ module.exports = function (grunt) { grunt.registerTask('build', [ 'clean:dist', - 'bower-install', + 'bowerInstall', 'useminPrepare', 'concurrent:dist', 'autoprefixer', diff --git a/templates/common/_package.json b/templates/common/_package.json index 33ca14254..3e98e6167 100644 --- a/templates/common/_package.json +++ b/templates/common/_package.json @@ -5,7 +5,7 @@ "devDependencies": { "grunt": "~0.4.1", "grunt-autoprefixer": "~0.4.0", - "grunt-bower-install": "~0.7.0", + "grunt-bower-install": "~1.0.0", "grunt-concurrent": "~0.4.1", "grunt-contrib-clean": "~0.5.0",<% if (coffee) { %> "grunt-contrib-coffee": "~0.7.0",<% } %><% if (compass) { %>