diff --git a/app/index.js b/app/index.js index 412ed67..fbbf5ee 100644 --- a/app/index.js +++ b/app/index.js @@ -98,7 +98,7 @@ var AppGenerator = Class.extend({ }, { name: 'ngCordova', type: 'confirm', - message: 'Would you like to include ngCordova?', + message: 'Would you like to include ng-cordova?', default: true }, { name: 'material', diff --git a/class/component.js b/class/component.js index 8609742..aeb2600 100644 --- a/class/component.js +++ b/class/component.js @@ -1,3 +1,4 @@ +/*eslint no-process-exit:0*/ 'use strict'; var path = require('path'); @@ -109,6 +110,7 @@ var ComponentGenerator = Class.extend({ }]; this.prompt(prompts, function(answers) { that.modulename = that.modulename || answers.modulename; + that.modulename = that.camelize(that.modulename); that.moduleFolder = that.casify(that.modulename); that[_templateFolder + 'name'] = that[_templateFolder + 'name'] || answers[_templateFolder + 'name']; @@ -118,6 +120,10 @@ var ComponentGenerator = Class.extend({ }, writing: function() { + if(!_.contains(this.clientModules, this.modulename)) { + this.log(this.utils.chalk.red('Error: ') + 'The module name ' + this.utils.chalk.yellow(this.modulename) + ' does not exist'); + return; + } var done = this.async(); this.sourceRoot(path.join(__dirname, '../templates/' + this.templateFolder)); var targetDir = path.join(this.clientFolder, 'scripts', this.moduleFolder, this.localFolder); diff --git a/directive/index.js b/directive/index.js index 907bf5f..76f6260 100644 --- a/directive/index.js +++ b/directive/index.js @@ -2,6 +2,7 @@ var path = require('path'); var utils = require('../utils'); var Class = require('../class/component.js')('directives', 'directive'); +var _ = require('lodash'); var DirectiveGenerator = Class.extend({ constructor: function() { @@ -39,6 +40,10 @@ var DirectiveGenerator = Class.extend({ }, writing: function() { + if(!_.contains(this.clientModules, this.modulename)) { + this.log(this.utils.chalk.red('Error: ') + 'The module name ' + this.utils.chalk.yellow(this.modulename) + ' does not exist'); + return; + } var done = this.async(); this.sourceRoot(path.join(__dirname, '../templates/' + 'directive')); var targetDir = path.join(this.clientFolder, 'scripts', this.moduleFolder, 'directives'); diff --git a/gulp_tasks/common/helper.js b/gulp_tasks/common/helper.js index 0c4aa54..db385b9 100644 --- a/gulp_tasks/common/helper.js +++ b/gulp_tasks/common/helper.js @@ -2,7 +2,6 @@ var fs = require('fs'); var gutil = require('gulp-util'); -var chalk = require('chalk'); var stripJsonComments = require('strip-json-comments'); var _ = require('lodash'); var path = require('path'); @@ -25,13 +24,13 @@ var isMobile = exports.isMobile = function(constants) { */ var execHandler = exports.execHandler = function(err, stdout, stderr) { if(err) { - gutil.log(chalk.red('An error occured executing a command line action')); + gutil.log(gutil.colors.red('An error occured executing a command line action')); } if(stdout) { gutil.log(stdout); } if(stderr) { - gutil.log(chalk.red('Error: ') + stderr); + gutil.log(gutil.colors.red('Error: ') + stderr); } }; diff --git a/gulp_tasks/tasks/release.js b/gulp_tasks/tasks/release.js index 342b3ff..0815605 100644 --- a/gulp_tasks/tasks/release.js +++ b/gulp_tasks/tasks/release.js @@ -136,11 +136,11 @@ var github = new GitHubApi({ timeout: 0 }); -var gitGetEmailAsync = Q.nbind(git.exec, git, { +var gitGetEmailAsync = Q.denodeify(git.exec, { args: 'config --get user.email', quiet: true }); -var githubUsernameAsync = Q.nfbind(githubUsername); +var githubUsernameAsync = Q.denodeify(githubUsername); var inquireAsync = function(result) { var deferred = Q.defer(); diff --git a/gulp_tasks/tasks/test.js b/gulp_tasks/tasks/test.js index e527da1..4001898 100644 --- a/gulp_tasks/tasks/test.js +++ b/gulp_tasks/tasks/test.js @@ -6,7 +6,6 @@ var mocha = $.mocha; var istanbul = $.istanbul; var karma = $.karma; var gutil = require('gulp-util'); -var chalk = require('chalk'); var constants = require('../common/constants')(); @@ -37,7 +36,7 @@ gulp.task('karma', function() { configFile: 'karma.conf.js', action: 'run' })).on('error', function() { - gutil.log(chalk.red('(ERROR)'), 'karma'); + gutil.log(gutil.colors.red('(ERROR)'), 'karma'); }); }); diff --git a/package.json b/package.json index 2d00ec0..ddd3790 100644 --- a/package.json +++ b/package.json @@ -47,56 +47,56 @@ "scaffold" ], "dependencies": { - "chalk": "0.5.1", - "del": "1.1.1", + "chalk": "1.0.0", + "del": "1.2.0", "glob-to-regexp": "0.0.2", - "gulp": "3.8.10", - "gulp-inject": "1.1.1", + "gulp": "3.9.0", + "gulp-inject": "1.2.0", "gulp-mux": "latest", "lodash": "2.4.1", - "q": "1.1.2", - "shelljs": "0.3.0", - "update-notifier": "0.3.0", + "q": "1.4.1", + "shelljs": "0.5.1", + "update-notifier": "0.5.0", "yeoman-generator": "0.17.7", - "yosay": "1.0.2" + "yosay": "1.0.4" }, "devDependencies": { - "chai": "1.10.0", - "conventional-changelog": "0.0.11", - "github": "0.2.3", - "github-username": "1.1.1", - "gulp-bump": "0.1.13", - "gulp-concat": "2.4.3", - "gulp-eslint": "0.2.2", + "chai": "3.0.0", + "conventional-changelog": "0.0.17", + "github": "0.2.4", + "github-username": "2.0.0", + "gulp-bump": "0.3.1", + "gulp-concat": "2.5.2", + "gulp-eslint": "0.13.2", "gulp-exec": "2.1.1", - "gulp-git": "0.5.6", - "gulp-help": "1.3.2", + "gulp-git": "1.2.4", + "gulp-help": "1.4.0", "gulp-if": "1.2.5", - "gulp-istanbul": "0.6.0", - "gulp-jscs": "1.4.0", - "gulp-jshint": "1.9.2", - "gulp-load-plugins": "0.8.0", - "gulp-mocha": "2.0.0", - "gulp-plumber": "0.6.6", + "gulp-istanbul": "0.9.0", + "gulp-jscs": "1.6.0", + "gulp-jshint": "1.11.0", + "gulp-load-plugins": "0.10.0", + "gulp-mocha": "2.1.1", + "gulp-plumber": "1.0.1", "gulp-tap": "0.1.3", - "gulp-util": "3.0.3", - "inquirer": "0.8.0", - "jshint-stylish": "1.0.0", + "gulp-util": "3.0.5", + "inquirer": "0.8.5", + "jshint-stylish": "2.0.0", "map-stream": "0.1.0", - "mocha": "2.1.0", - "mocha-lcov-reporter": "0.0.1", + "mocha": "2.2.5", + "mocha-lcov-reporter": "0.0.2", "mockery": "1.4.0", "node-jsxml": "0.6.0", - "require-dir": "0.1.0", - "run-sequence": "1.0.2", - "sinon": "1.12.2", - "stream-combiner": "0.2.1", - "streamqueue": "0.1.1", + "require-dir": "0.3.0", + "run-sequence": "1.1.0", + "sinon": "1.14.1", + "stream-combiner": "0.2.2", + "streamqueue": "0.1.3", "strip-json-comments": "1.0.2", - "yargs": "1.3.3" + "yargs": "3.10.0" }, "peerDependencies": { "yo": ">=1.0.0", - "generator-sublime": ">=1.7.7" + "generator-sublime": ">=1.7.8" } } diff --git a/service/index.js b/service/index.js index 48a7236..b7d1d64 100644 --- a/service/index.js +++ b/service/index.js @@ -140,6 +140,10 @@ var ServiceGenerator = Class.extend({ }, writing: function() { + if(!_.contains(this.clientModules, this.modulename)) { + this.log(this.utils.chalk.red('Error: ') + 'The module name ' + this.utils.chalk.yellow(this.modulename) + ' does not exist'); + return; + } var done = this.async(); this.sourceRoot(path.join(__dirname, '../templates/service')); var targetDir = path.join(this.clientFolder, 'scripts', this.moduleFolder, 'services'); @@ -161,4 +165,4 @@ var ServiceGenerator = Class.extend({ } }); -module.exports = ServiceGenerator; \ No newline at end of file +module.exports = ServiceGenerator; diff --git a/templates/app/_bower.json b/templates/app/_bower.json index 18d8ab2..be121e9 100644 --- a/templates/app/_bower.json +++ b/templates/app/_bower.json @@ -9,23 +9,13 @@ "tests" ], "dependencies": { - "angular": "1.3.15", - "angular-mocks": "1.3.15", - "angular-animate": "1.3.15", - "angular-sanitize": "1.3.15", - "angular-resource": "1.3.15", - "angular-ui-router": "0.2.13"<% if (ionic) { %>, + "marked":"0.3.3"<% if (ionic) { %>, "ionic":"1.0.0"<% } %><% if (famous) { %>, - "famous-angular": "0.5.0"<% } %><% if (ngCordova) { %>, - "ngCordova": "0.1.15-alpha"<% } %><% if (fontawesome) { %>, - "font-awesome": "4.2.0"<% } %><% if (bootstrap) { %>, - "angular-bootstrap": "0.12.0", - "bootstrap": "3.3.1"<% } %><% if (material) { %>, - "angular-material": "0.8.3"<% } %> + "famous-angular": "0.5.0"<% } %><% if (fontawesome) { %>, + "font-awesome": "4.3.0"<% } %><% if (bootstrap) { %>, + "bootstrap": "3.3.4"<% } %><% if (material) { %>, + "angular-material": "0.9.8-rc1"<% } %> }, "resolutions": { - "angular": "1.3.15", - "angular-animate": "1.3.15", - "angular-sanitize": "1.3.15" } } \ No newline at end of file diff --git a/templates/app/_package.json b/templates/app/_package.json index 673c868..6bc8ba3 100644 --- a/templates/app/_package.json +++ b/templates/app/_package.json @@ -5,9 +5,17 @@ "test": "gulp test", "postinstall": "bower install && node ./bin/protractor-fix-version.js" }, - "dependencies": {<% if (famous) { %> + "dependencies": { + "angular": "^1.3.16", + "angular-animate": "^1.3.16", + "angular-mocks": "^1.3.16", + "angular-resource": "^1.3.16", + "angular-sanitize": "^1.3.16", + "angular-ui-router": "^0.2.15"<% if (famous) { %>, "famous": "^0.3.5", - "famous-polyfills": "^0.3.0"<% } %> + "famous-polyfills": "^0.3.0"<% } %><% if(ngCordova) { %>, + "ng-cordova": "^0.1.17-alpha"<% } %><% if(bootstrap) { %>, + "angular-bootstrap": "^0.12.0"<% } %> }, "devDependencies": { }, @@ -16,19 +24,10 @@ }, "browser": { "unitHelper": "./test/unit/unitHelper.js", - "angular": "./bower_components/angular/angular.js", - "angular-mocks": "./bower_components/angular-mocks/angular-mocks.js", - "angular-ui-router": "./bower_components/angular-ui-router/release/angular-ui-router.js", - "angular-animate": "./bower_components/angular-animate/angular-animate.js", - "angular-resource": "./bower_components/angular-resource/angular-resource.js", - "lbServices": "./client/scripts/lbServices.js", - "angular-sanitize": "./bower_components/angular-sanitize/angular-sanitize.js"<% if(ionic) { %>, + "lbServices": "./client/scripts/lbServices.js"<% if (ionic) { %>, "ionic": "./bower_components/ionic/release/js/ionic.js", "angular-ionic": "./bower_components/ionic/release/js/ionic-angular.js"<% } %><% if(famous) { %>, - "famous-angular": "./bower_components/famous-angular/dist/famous-angular.js"<% } %><% if(ngCordova) { %>, - "ngCordova": "./bower_components/ngCordova/dist/ng-cordova.js", - "ngCordovaMocks": "./bower_components/ngCordova/dist/ng-cordova-mocks.js"<% } %><% if(bootstrap) { %>, - "angular-bootstrap": "./bower_components/angular-bootstrap/ui-bootstrap-tpls.js"<% } %><% if(material) { %>, + "famous-angular": "./bower_components/famous-angular/dist/famous-angular.js"<% } %><% if(material) { %>, "angular-material": "./bower_components/angular-material/angular-material.js", "angular-aria": "./bower_components/angular-aria/angular-aria.js"<% } %> }, @@ -43,29 +42,10 @@ ] }, "browserify-shim": { - "angular": { - "exports": "angular" - }, - "angular-mocks": { - "exports": "angular", - "depends": [ - "angular" - ] - }, - "angular-resource": { - "depends": [ - "angular" - ] - }, "lbServices": { "depends": [ "angular-resource" ] - }, - "angular-ui-router": { - "depends": [ - "angular" - ] }<% if(ionic) { %>, "angular-ionic": { "exports": "ionic", @@ -86,24 +66,6 @@ "angular-sanitize", "angular-ui-router" ] - }<% } %><% if(ngCordova) { %>, - "ngCordova": { - "exports": "ngCordova", - "depends": [ - "angular" - ] - }, - "ngCordovaMocks": { - "exports": "ngCordovaMocks", - "depends": [ - "angular" - ] - }<% } %><% if(bootstrap) { %>, - "angular-bootstrap": { - "depends": [ - "angular" - ], - "exports": "angular.module('ui.bootstrap').name" }<% } %><% if(material) { %>, "angular-material": { "depends": [ diff --git a/templates/app/test/_jshintrc b/templates/app/test/_jshintrc index 859e62d..820e087 100644 --- a/templates/app/test/_jshintrc +++ b/templates/app/test/_jshintrc @@ -67,7 +67,7 @@ "maxparams": 15, "newcap": true, "node": true, - "noempty": true, + "noempty": false, "nonstandard": true, "quotmark": "single", "sub": true, diff --git a/templates/constant/index.test.js b/templates/constant/index.test.js index 7898e42..26dfcc5 100644 --- a/templates/constant/index.test.js +++ b/templates/constant/index.test.js @@ -1,6 +1,7 @@ 'use strict'; /*eslint consistent-this:[0] */ -var angular = require('angular-mocks'); +var angular = require('angular'); +require('angular-mocks'); var app = require('../')('app'); var constantname = '<%= constantname %>'; describe(app.name, function() { diff --git a/templates/controller/index.test.js b/templates/controller/index.test.js index ccb4478..96341e5 100644 --- a/templates/controller/index.test.js +++ b/templates/controller/index.test.js @@ -1,6 +1,7 @@ 'use strict'; /*eslint consistent-this:[0] */ -var angular = require('angular-mocks'); +var angular = require('angular'); +require('angular-mocks'); var app = require('../')('app'); var controllername = '<%= controllername %>'; describe(app.name, function() { diff --git a/templates/directive/index.test.js b/templates/directive/index.test.js index ce52591..30ae8a8 100644 --- a/templates/directive/index.test.js +++ b/templates/directive/index.test.js @@ -1,6 +1,7 @@ 'use strict'; /*eslint consistent-this:[0] */ -var angular = require('angular-mocks'); +var angular = require('angular'); +require('angular-mocks'); var app = require('../')('app'); var directivename = '<%= directivename %>'; var unitHelper = require('unitHelper'); diff --git a/templates/filter/index.test.js b/templates/filter/index.test.js index 77907cd..8852395 100644 --- a/templates/filter/index.test.js +++ b/templates/filter/index.test.js @@ -1,6 +1,7 @@ 'use strict'; /*eslint consistent-this:[0] */ -var angular = require('angular-mocks'); +var angular = require('angular'); +require('angular-mocks'); var app = require('../')('app'); var filtername = '<%= filtername %>'; describe(app.name, function() { diff --git a/templates/module/index.js b/templates/module/index.js index 87568bc..dc5dc91 100644 --- a/templates/module/index.js +++ b/templates/module/index.js @@ -3,7 +3,7 @@ require('angular-ui-router');<% if (ionic) { %> require('angular-ionic');<% } %><% if (material) { %> require('angular-material');<% } %><% if (famous) { %> require('famous-angular');<% } %><% if (ngCordova) { %> -require('ngCordova');<% } %> +require('ng-cordova');<% } %> var modulename = '<%= modulename %>'; diff --git a/templates/service/index.test.js b/templates/service/index.test.js index e51a8bf..c0f33cc 100644 --- a/templates/service/index.test.js +++ b/templates/service/index.test.js @@ -1,6 +1,7 @@ 'use strict'; /*eslint consistent-this:[0] */ -var angular = require('angular-mocks'); +var angular = require('angular'); +require('angular-mocks'); var app = require('../')('app'); var servicename = '<%= servicename %>'; describe(app.name, function() { diff --git a/templates/target/scripts/main.test.js b/templates/target/scripts/main.test.js index 901a4d0..11a2303 100644 --- a/templates/target/scripts/main.test.js +++ b/templates/target/scripts/main.test.js @@ -1,5 +1,6 @@ 'use strict'; -var angular = require('angular-mocks'); +var angular = require('angular'); +require('angular-mocks'); var app = require('./main<%=suffix%>.js'); describe('app', function() { diff --git a/templates/value/index.test.js b/templates/value/index.test.js index cff68b6..08d62c0 100644 --- a/templates/value/index.test.js +++ b/templates/value/index.test.js @@ -1,6 +1,7 @@ 'use strict'; /*eslint consistent-this:[0] */ -var angular = require('angular-mocks'); +var angular = require('angular'); +require('angular-mocks'); var app = require('../')('app'); var valuename = '<%= valuename %>'; describe(app.name, function() { diff --git a/test/module.test.js b/test/module.test.js index f72546a..ae1f5d5 100644 --- a/test/module.test.js +++ b/test/module.test.js @@ -302,7 +302,7 @@ describe('angular-famous-ionic:module', function() { .on('end', function() { var file = clientFolder + '/scripts/' + modulename + '/index.js'; var body = testHelper.readTextFile(file); - assert(_.contains(body, 'require(\'ngCordova\');')); + assert(_.contains(body, 'require(\'ng-cordova\');')); done(); }); @@ -339,7 +339,7 @@ describe('angular-famous-ionic:module', function() { assert(_.contains(body, 'require(\'famous-angular\');')); assert(_.contains(body, 'require(\'angular-ionic\');')); - assert(_.contains(body, 'require(\'ngCordova\');')); + assert(_.contains(body, 'require(\'ng-cordova\');')); assert(_.contains(body, 'require(\'angular-material\');')); assert(_.contains(body, '\'ionic\'')); assert(_.contains(body, '\'famous.angular\''));