Skip to content

Commit

Permalink
refactor(build): ensure a newly generated app starts out with latest …
Browse files Browse the repository at this point in the history
…versions of dependencies

Also in the face of contstraints like ie8 support.
  • Loading branch information
cueedee committed Mar 18, 2015
1 parent e3d3113 commit 5f9a5a5
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 41 deletions.
52 changes: 42 additions & 10 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,6 @@ module.exports = yeoman.generators.Base.extend(
this.copy( "coffeelint.json", "coffeelint.json" );
this.copy( "jshintrc", ".jshintrc" );

// Determine jQuery version
//
if( this.ie8 === true )
{
this.jQueryVersion = "^1.11.1";
}
else {
this.jQueryVersion = "^2.1.1";
}

// write package.json and readme file
//
this.template( "_package.json", "package.json" );
Expand Down Expand Up @@ -235,6 +225,48 @@ module.exports = yeoman.generators.Base.extend(

, install: function ()
{
var deps =
[
"backbone"
, ( "jquery" + ( this.ie8 ? "@<2" : "" ))
, "madlib-console"
, "madlib-hostmapping"
, "madlib-settings"
, "q"
]
, devDeps =
[
"browserify"
, "browserify-shim"
, "chai"
, "coffeeify"
, "grunt"
, "grunt-browserify"
, "grunt-coffee-jshint"
, "grunt-coffeelint"
, "grunt-contrib-clean"
, "grunt-contrib-compass"
, "grunt-contrib-compress"
, "grunt-contrib-copy"
, "grunt-contrib-uglify"
, "grunt-contrib-watch"
, "grunt-contrib-yuidoc-iq"
, "grunt-mocha-test"
, "grunt-template"
, "handlebars"
, "hbsfy"
, "yuidoc-marviq-theme"
]
;

if ( this.i18n )
{
deps.push( "madlib-locale" );
}

this.npmInstall( deps, { save: true } );
this.npmInstall( devDeps, { saveDev: true } );

this.installDependencies(
{
bower: false
Expand Down
33 changes: 2 additions & 31 deletions generators/app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,9 @@
]
},
"browserify-shim": {},
"dependencies": {
"backbone": "~1.1.2",
"jquery": "<%= jQueryVersion %>",
"madlib-console": "~0.1.4",
"madlib-hostmapping": "~0.1.7"<% if ( i18n ) { %>,
"madlib-locale": "~0.0.1"<% } %>,
"madlib-settings": "~0.1.7",
"q": "~1.1.2"
},
"dependencies": {},
"description": "<%= packageDescription %>",
"devDependencies": {
"browserify": "~7.0.0",
"browserify-shim": "~3.8.1",
"chai": "~1.10.0",
"coffeeify": "~1.0.0",
"grunt": "~0.4.5",
"grunt-browserify": "~3.2.1",
"grunt-coffee-jshint": "^0.2.1",
"grunt-coffeelint": "^0.0.13",
"grunt-contrib-clean": "~0.6.0",
"grunt-contrib-compass": "~1.0.1",
"grunt-contrib-compress": "~0.12.0",
"grunt-contrib-copy": "~0.7.0",
"grunt-contrib-uglify": "~0.6.0",
"grunt-contrib-watch": "~0.6.1",
"grunt-contrib-yuidoc-iq": "~0.1.4",
"grunt-mocha-test": "~0.12.4",
"grunt-template": "^0.2.3",
"handlebars": "^2.0.0",
"hbsfy": "~2.2.1",
"yuidoc-marviq-theme": "~0.1.5"
},
"devDependencies": {},
"licenses": [
{
"type": "BSD"
Expand Down

0 comments on commit 5f9a5a5

Please sign in to comment.