Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Commit

Permalink
Merge pull request #196 from rcos/auto_update_dep
Browse files Browse the repository at this point in the history
Add auto updating of npm and grunt dependencies
  • Loading branch information
agundy committed Oct 4, 2015
2 parents ce3e69b + ae6dd22 commit dc5f993
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 46 deletions.
74 changes: 57 additions & 17 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ module.exports = function (grunt) {
cdnify: 'grunt-google-cdn',
protractor: 'grunt-protractor-runner',
injector: 'grunt-asset-injector',
buildcontrol: 'grunt-build-control'
buildcontrol: 'grunt-build-control',
bower: 'grunt-bower-task',
auto_install: 'grunt-auto-install'
});

// Time how long tasks take. Can help when optimizing build times
Expand Down Expand Up @@ -54,13 +56,46 @@ module.exports = function (grunt) {
url: 'http://localhost:<%= express.options.port %>'
}
},
bower: {
options: {
targetDir: 'client/bower_components',
layout: 'byType',
install: true,
verbose: false,
cleanTargetDir: false,
cleanBowerDir: false,
bowerOptions: {}
},
all: {
src: ['bower.json','.bowerrc'],
}
},
auto_install: {
local: {},
subdir: {
options: {
bower: false
}
},
src: ['package.json'],

},
watch: {
installBower: {
files: ['bower.json','.bowerrc'],
tasks: ['changed:bower']
},
installNPM: {
files: ['package.json'],
tasks: ['changed:auto_install']
},
injectJS: {
files: [
'<%= yeoman.client %>/{app,components}/**/*.js',
'!<%= yeoman.client %>/{app,components}/**/*.spec.js',
'!<%= yeoman.client %>/{app,components}/**/*.mock.js',
'!<%= yeoman.client %>/app/app.js'],
'!<%= yeoman.client %>/app/app.js'
],
tasks: ['injector:scripts']
},
injectCss: {
Expand All @@ -81,13 +116,12 @@ module.exports = function (grunt) {
tasks: ['newer:jshint:all', 'karma']
},
injectSass: {
files: [
'<%= yeoman.client %>/{app,components}/**/*.{scss,sass}'],
files: [
'<%= yeoman.client %>/{app,components}/**/*.{scss,sass}'],
tasks: ['injector:sass']
},
sass: {
files: [
'<%= yeoman.client %>/{app,components}/**/*.{scss,sass}'],
files: ['<%= yeoman.client %>/{app,components}/**/*.{scss,sass}'],
tasks: ['sass', 'autoprefixer']
},
gruntfile: {
Expand Down Expand Up @@ -497,11 +531,11 @@ module.exports = function (grunt) {
},
files: {
'<%= yeoman.client %>/index.html': [
['{.tmp,<%= yeoman.client %>}/{app,components}/**/*.js',
'!{.tmp,<%= yeoman.client %>}/app/app.js',
'!{.tmp,<%= yeoman.client %>}/{app,components}/**/*.spec.js',
'!{.tmp,<%= yeoman.client %>}/{app,components}/**/*.mock.js']
]
['{.tmp,<%= yeoman.client %>}/{app,components}/**/*.js',
'!{.tmp,<%= yeoman.client %>}/app/app.js',
'!{.tmp,<%= yeoman.client %>}/{app,components}/**/*.spec.js',
'!{.tmp,<%= yeoman.client %>}/{app,components}/**/*.mock.js']
]
}
},

Expand Down Expand Up @@ -562,14 +596,16 @@ module.exports = function (grunt) {

grunt.registerTask('serve', function (target) {
if (target === 'dist') {
return grunt.task.run(['build', 'env:all', 'env:prod', 'express:prod', 'wait', 'open', 'express-keepalive']);
return grunt.task.run(['changed:bower', 'changed:auto_install','build', 'env:all', 'env:prod', 'express:prod', 'wait', 'open', 'express-keepalive']);
}

if (target === 'debug') {
return grunt.task.run([
'clean:server',
'env:all',
'injector:sass',
'changed:bower',
'changed:auto_install',
'injector:sass',
'concurrent:server',
'injector',
'wiredep',
Expand All @@ -581,7 +617,9 @@ module.exports = function (grunt) {
grunt.task.run([
'clean:server',
'env:all',
'injector:sass',
'changed:bower',
'changed:auto_install',
'injector:sass',
'concurrent:server',
'injector',
'wiredep',
Expand Down Expand Up @@ -611,7 +649,7 @@ module.exports = function (grunt) {
return grunt.task.run([
'clean:server',
'env:all',
'injector:sass',
'injector:sass',
'concurrent:test',
'injector',
'autoprefixer',
Expand All @@ -624,7 +662,7 @@ module.exports = function (grunt) {
'clean:server',
'env:all',
'env:test',
'injector:sass',
'injector:sass',
'concurrent:test',
'injector',
'wiredep',
Expand All @@ -641,8 +679,10 @@ module.exports = function (grunt) {
});

grunt.registerTask('build', [
'changed:bower',
'changed:auto_install',
'clean:dist',
'injector:sass',
'injector:sass',
'concurrent:dist',
'injector',
'wiredep',
Expand Down
62 changes: 33 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "observatory3",
"version": "0.0.0",
"main": "server/app.js",
"license" : "MIT",
"license": "MIT",
"dependencies": {
"MD5": ">=1.2.1",
"body-parser": "~1.5.0",
Expand All @@ -29,9 +29,15 @@
"serve-favicon": "~2.0.1"
},
"devDependencies": {
"connect-livereload": "~0.4.0",
"grunt": "~0.4.4",
"grunt-angular-templates": "^0.5.4",
"grunt-asset-injector": "^0.1.0",
"grunt-auto-install": "^0.2.4",
"grunt-autoprefixer": "~0.7.2",
"grunt-wiredep": "~1.8.0",
"grunt-bower-task": "^0.4.0",
"grunt-build-control": "DaftMonk/grunt-build-control",
"grunt-changed": "~0.1.1",
"grunt-concurrent": "~0.5.0",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-concat": "~0.4.0",
Expand All @@ -40,48 +46,46 @@
"grunt-contrib-htmlmin": "~0.2.0",
"grunt-contrib-imagemin": "~0.7.1",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-sass": "^0.7.3",
"grunt-contrib-uglify": "~0.4.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-dom-munger": "^3.4.0",
"grunt-env": "~0.4.1",
"grunt-express-server": "~0.4.17",
"grunt-google-cdn": "~0.4.0",
"grunt-karma": "~0.8.2",
"grunt-mocha-test": "~0.10.2",
"grunt-newer": "~0.7.0",
"grunt-ng-annotate": "^0.2.3",
"grunt-rev": "~0.1.0",
"grunt-svgmin": "~0.4.0",
"grunt-usemin": "~2.1.1",
"grunt-env": "~0.4.1",
"grunt-node-inspector": "~0.1.5",
"grunt-nodemon": "~0.2.0",
"grunt-angular-templates": "^0.5.4",
"grunt-dom-munger": "^3.4.0",
"grunt-npm-install": "^0.2.0",
"grunt-open": "~0.2.3",
"grunt-protractor-runner": "^1.1.0",
"grunt-asset-injector": "^0.1.0",
"grunt-karma": "~0.8.2",
"grunt-build-control": "DaftMonk/grunt-build-control",
"grunt-mocha-test": "~0.10.2",
"grunt-contrib-sass": "^0.7.3",
"grunt-rev": "~0.1.0",
"grunt-svgmin": "~0.4.0",
"grunt-usemin": "~2.1.1",
"grunt-wiredep": "~1.8.0",
"jit-grunt": "^0.5.0",
"time-grunt": "~0.3.1",
"grunt-express-server": "~0.4.17",
"grunt-open": "~0.2.3",
"open": "~0.0.4",
"jshint-stylish": "~0.1.5",
"connect-livereload": "~0.4.0",
"karma-ng-scenario": "~0.1.0",
"karma-firefox-launcher": "~0.1.3",
"karma-script-launcher": "~0.1.0",
"karma-html2js-preprocessor": "~0.1.0",
"karma-ng-jade2js-preprocessor": "^0.1.2",
"karma-jasmine": "~0.1.5",
"karma": "~0.12.9",
"karma-chrome-launcher": "~0.1.3",
"requirejs": "~2.1.11",
"karma-requirejs": "~0.2.1",
"karma-coffee-preprocessor": "~0.2.1",
"karma-firefox-launcher": "~0.1.3",
"karma-html2js-preprocessor": "~0.1.0",
"karma-jade-preprocessor": "0.0.11",
"karma-phantomjs-launcher": "~0.1.4",
"karma": "~0.12.9",
"karma-jasmine": "~0.1.5",
"karma-ng-html2js-preprocessor": "~0.1.0",
"karma-ng-jade2js-preprocessor": "^0.1.2",
"karma-ng-scenario": "~0.1.0",
"karma-phantomjs-launcher": "~0.1.4",
"karma-requirejs": "~0.2.1",
"karma-script-launcher": "~0.1.0",
"open": "~0.0.4",
"requirejs": "~2.1.11",
"should": "~3.3.1",
"supertest": "~0.11.0",
"should": "~3.3.1"
"time-grunt": "~0.3.1"
},
"engines": {
"node": ">=0.10.0"
Expand Down

0 comments on commit dc5f993

Please sign in to comment.