Skip to content

Commit a644812

Browse files
committed
chore(gen): update yeoman-generator to 0.23.0
1 parent aedb37e commit a644812

File tree

3 files changed

+10
-26
lines changed

3 files changed

+10
-26
lines changed

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"insight": "~0.8.1",
4848
"lodash": "^4.6.1",
4949
"underscore.string": "^3.1.1",
50-
"yeoman-generator": "^0.22.5",
50+
"yeoman-generator": "~0.23.0",
5151
"yeoman-welcome": "^1.0.1"
5252
},
5353
"devDependencies": {

Diff for: src/generators/app/index.js

+8-22
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,15 @@ export class Generator extends Base {
6363
this.log('Out of the box I create an AngularJS app with an Express server.\n');
6464
},
6565
checkForConfig: function() {
66-
var cb = this.async();
6766
var existingFilters = this.config.get('filters');
6867

6968
if(existingFilters) {
70-
this.prompt([{
69+
return this.prompt([{
7170
type: 'confirm',
7271
name: 'skipConfig',
7372
message: 'Existing .yo-rc configuration found, would you like to use it?',
7473
default: true,
75-
}], answers => {
74+
}]).then(answers => {
7675
this.skipConfig = answers.skipConfig;
7776

7877
if(this.skipConfig) {
@@ -92,11 +91,7 @@ export class Generator extends Base {
9291
this.config.set('filters', this.filters);
9392
this.config.forceSave();
9493
}
95-
96-
cb();
9794
});
98-
} else {
99-
cb();
10095
}
10196
}
10297
};
@@ -106,11 +101,10 @@ export class Generator extends Base {
106101
return {
107102
clientPrompts: function() {
108103
if(this.skipConfig) return;
109-
var cb = this.async();
110104

111105
this.log('# Client\n');
112106

113-
this.prompt([{
107+
return this.prompt([{
114108
type: 'list',
115109
name: 'transpiler',
116110
message: 'What would you like to write scripts with?',
@@ -156,7 +150,7 @@ export class Generator extends Base {
156150
name: 'uibootstrap',
157151
message: 'Would you like to include UI Bootstrap?',
158152
when: answers => answers.bootstrap
159-
}], answers => {
153+
}]).then(answers => {
160154
this.filters.js = true;
161155
this.filters[answers.transpiler] = true;
162156
insight.track('transpiler', answers.transpiler);
@@ -184,18 +178,15 @@ export class Generator extends Base {
184178

185179
var styleExt = {sass: 'scss', stylus: 'styl'}[answers.stylesheet];
186180
this.styleExt = styleExt ? styleExt : answers.stylesheet;
187-
188-
cb();
189181
});
190182
},
191183
serverPrompts: function() {
192184
if(this.skipConfig) return;
193-
var cb = this.async();
194185
var self = this;
195186

196187
this.log('\n# Server\n');
197188

198-
this.prompt([{
189+
return this.prompt([{
199190
type: 'checkbox',
200191
name: 'odms',
201192
message: 'What would you like to use for data modeling?',
@@ -245,7 +236,7 @@ export class Generator extends Base {
245236
// to-do: should not be dependent on ODMs
246237
when: answers => answers.odms && answers.odms.length !== 0,
247238
default: true
248-
}], answers => {
239+
}]).then(answers => {
249240
if(answers.socketio) this.filters.socketio = true;
250241
insight.track('socketio', !!answers.socketio);
251242

@@ -284,18 +275,15 @@ export class Generator extends Base {
284275
insight.track('google-oauth', !!this.filters['googleAuth']);
285276
insight.track('facebook-oauth', !!this.filters['facebookAuth']);
286277
insight.track('twitter-oauth', !!this.filters['twitterAuth']);
287-
288-
cb();
289278
});
290279
},
291280
projectPrompts: function() {
292281
if(this.skipConfig) return;
293-
var cb = this.async();
294282
var self = this;
295283

296284
this.log('\n# Project\n');
297285

298-
this.prompt([{
286+
return this.prompt([{
299287
type: 'list',
300288
name: 'buildtool',
301289
message: 'Would you like to use Gulp or Grunt?',
@@ -320,7 +308,7 @@ export class Generator extends Base {
320308
choices: ['Expect', 'Should'],
321309
filter: val => val.toLowerCase(),
322310
when: answers => answers.testing === 'mocha'
323-
}], answers => {
311+
}]).then(answers => {
324312
this.filters[answers.buildtool] = true;
325313
insight.track('buildtool', answers.buildtool);
326314

@@ -338,8 +326,6 @@ export class Generator extends Base {
338326
this.filters.should = false;
339327
this.filters.expect = false;
340328
}
341-
342-
cb();
343329
});
344330
}
345331
};

Diff for: src/generators/endpoint/index.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export class Generator extends Base {
3333
}
3434

3535
prompting() {
36-
var done = this.async();
3736
var promptCb = (props) => {
3837
if(props.route.charAt(0) !== '/') {
3938
props.route = '/' + props.route;
@@ -50,7 +49,6 @@ export class Generator extends Base {
5049
this.filters[props.models] = true;
5150
this.filters[props.models + 'Models'] = true;
5251
}
53-
done();
5452
};
5553

5654
if (this.options.route) {
@@ -92,7 +90,7 @@ export class Generator extends Base {
9290
when: () => this.filters.mongoose && this.filters.sequelize
9391
}];
9492

95-
this.prompt(prompts, promptCb);
93+
return this.prompt(prompts).then(promptCb);
9694
}
9795

9896
configuring() {

0 commit comments

Comments
 (0)