From 1dfc856d21f94808954c0dd5cae97741a216e62f Mon Sep 17 00:00:00 2001 From: kingcody Date: Fri, 24 Jul 2015 03:17:00 -0400 Subject: [PATCH 1/2] chore(dependencies): update yeoman-generator to ~0.8.10 --- app/index.js | 9 +++++---- endpoint/index.js | 16 ++++++++-------- package.json | 4 ++-- test/test-file-creation.js | 30 +++++++++++++++--------------- 4 files changed, 30 insertions(+), 29 deletions(-) diff --git a/app/index.js b/app/index.js index 6c0a7fe3f..4ae1ad871 100644 --- a/app/index.js +++ b/app/index.js @@ -37,7 +37,7 @@ var AngularFullstackGenerator = yeoman.generators.Base.extend({ }, info: function () { - this.log(this.yeoman); + this.log(this.welcome); this.log('Out of the box I create an AngularJS app with an Express server.\n'); }, @@ -60,14 +60,15 @@ var AngularFullstackGenerator = yeoman.generators.Base.extend({ }); // NOTE: temp(?) fix for #403 - if(typeof this.filters.oauth==='undefined') { + if(typeof this.filters.oauth === 'undefined') { var strategies = Object.keys(this.filters).filter(function(key) { - return key.match(/Auth$/) && key; - }); + return key.match(/Auth$/) && this.filters[key]; + }.bind(this)); if(strategies.length) this.filters.oauth = true; } + this.config.set('filters', this.filters); this.config.forceSave(); cb(); diff --git a/endpoint/index.js b/endpoint/index.js index 8fa1f498d..22e8e8950 100644 --- a/endpoint/index.js +++ b/endpoint/index.js @@ -11,7 +11,7 @@ var Generator = module.exports = function Generator() { util.inherits(Generator, ScriptBase); -Generator.prototype.askFor = function askFor() { +Generator.prototype.prompting = function askFor() { var done = this.async(); var name = this.name; @@ -66,7 +66,13 @@ Generator.prototype.askFor = function askFor() { }.bind(this)); }; -Generator.prototype.registerEndpoint = function registerEndpoint() { +Generator.prototype.writing = function createFiles() { + var dest = this.config.get('endpointDirectory') || 'server/api/' + this.name; + this.sourceRoot(path.join(__dirname, './templates')); + ngUtil.processDirectory(this, '.', dest); +}; + +Generator.prototype.end = function registerEndpoint() { if(this.config.get('insertRoutes')) { var routeConfig = { file: this.config.get('registerRoutesFile'), @@ -110,9 +116,3 @@ Generator.prototype.registerEndpoint = function registerEndpoint() { } } }; - -Generator.prototype.createFiles = function createFiles() { - var dest = this.config.get('endpointDirectory') || 'server/api/' + this.name; - this.sourceRoot(path.join(__dirname, './templates')); - ngUtil.processDirectory(this, '.', dest); -}; diff --git a/package.json b/package.json index f66b72cb0..c1a50c792 100644 --- a/package.json +++ b/package.json @@ -26,9 +26,9 @@ "test": "grunt test" }, "dependencies": { - "yeoman-generator": "~0.17.0", "chalk": "~0.4.0", - "generator-ng-component": "~0.0.4" + "generator-ng-component": "~0.0.4", + "yeoman-generator": "~0.18.10" }, "devDependencies": { "chai": "^1.9.1", diff --git a/test/test-file-creation.js b/test/test-file-creation.js index bec4ab17d..ce8635c0b 100644 --- a/test/test-file-creation.js +++ b/test/test-file-creation.js @@ -26,13 +26,13 @@ describe('angular-fullstack generator', function () { }, dependenciesInstalled = false; function generatorTest(generatorType, name, mockPrompt, callback) { - gen.run({}, function () { + gen.run(function () { var afGenerator; var deps = [path.join('../..', generatorType)]; afGenerator = helpers.createGenerator('angular-fullstack:' + generatorType, deps, [name]); helpers.mockPrompt(afGenerator, mockPrompt); - afGenerator.run([], function () { + afGenerator.run(function () { callback(); }); }); @@ -107,7 +107,7 @@ describe('angular-fullstack generator', function () { if (endpoint) { generatorTest('endpoint', endpoint, {}, execFn); } else { - gen.run({}, execFn); + gen.run(execFn); } } @@ -430,7 +430,7 @@ describe('angular-fullstack generator', function () { helpers.mockPrompt(gen, { skipConfig: true }); - gen.run({}, function () { + gen.run(function () { helpers.assertFile([ 'client/app/main/main.less', 'client/app/main/main.coffee', @@ -454,7 +454,7 @@ describe('angular-fullstack generator', function () { helpers.mockPrompt(gen, { skipConfig: true }); - gen.run({}, function () { + gen.run(function () { var yoConfig = require(__dirname + '/temp/.yo-rc.json'); expect(yoConfig['generator-angular-fullstack'].filters.oauth).to.be.true; done(); @@ -462,14 +462,14 @@ describe('angular-fullstack generator', function () { }); it('should generate expected files', function (done) { - gen.run({}, function () { + gen.run(function () { helpers.assertFile(genFiles(defaultOptions)); done(); }); }); it('should not generate unexpected files', function (done) { - gen.run({}, function () { + gen.run(function () { assertOnlyFiles(genFiles(defaultOptions), done); }); }); @@ -533,14 +533,14 @@ describe('angular-fullstack generator', function () { }); it('should generate expected files', function (done) { - gen.run({}, function () { + gen.run(function () { helpers.assertFile(genFiles(testOptions)); done(); }); }); it('should not generate unexpected files', function (done) { - gen.run({}, function () { + gen.run(function () { assertOnlyFiles(genFiles(testOptions), done); }); }); @@ -605,14 +605,14 @@ describe('angular-fullstack generator', function () { }); it('should generate expected files', function (done) { - gen.run({}, function () { + gen.run(function () { helpers.assertFile(genFiles(testOptions)); done(); }); }); it('should not generate unexpected files', function (done) { - gen.run({}, function () { + gen.run(function () { assertOnlyFiles(genFiles(testOptions), done); }); }); @@ -679,14 +679,14 @@ describe('angular-fullstack generator', function () { }); it('should generate expected files', function (done) { - gen.run({}, function () { + gen.run(function () { helpers.assertFile(genFiles(testOptions)); done(); }); }); it('should not generate unexpected files', function (done) { - gen.run({}, function () { + gen.run(function () { assertOnlyFiles(genFiles(testOptions), done); }); }); @@ -740,14 +740,14 @@ describe('angular-fullstack generator', function () { }); it('should generate expected files', function (done) { - gen.run({}, function () { + gen.run(function () { helpers.assertFile(genFiles(testOptions)); done(); }); }); it('should not generate unexpected files', function (done) { - gen.run({}, function () { + gen.run(function () { assertOnlyFiles(genFiles(testOptions), done); }); }); From 533bbd7991e4066e724f7c4807020eeef2739384 Mon Sep 17 00:00:00 2001 From: kingcody Date: Thu, 6 Aug 2015 02:58:35 -0400 Subject: [PATCH 2/2] chore(dependencies): update generator-ng-component to ~0.1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c1a50c792..a062a68a9 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ }, "dependencies": { "chalk": "~0.4.0", - "generator-ng-component": "~0.0.4", + "generator-ng-component": "~0.1.0", "yeoman-generator": "~0.18.10" }, "devDependencies": {