Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b0de503

Browse files
committedMay 14, 2017
chore(gen): update yeoman-generator to 1.x
1 parent ee9cecc commit b0de503

File tree

4 files changed

+15
-18
lines changed

4 files changed

+15
-18
lines changed
 

‎package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"lodash": "^4.17.0",
5050
"semver": "^5.1.0",
5151
"underscore.string": "^3.1.1",
52-
"yeoman-generator": "~0.24.1",
52+
"yeoman-generator": "^1.1.1",
5353
"yeoman-welcome": "^1.0.1"
5454
},
5555
"devDependencies": {

‎src/generators/app/index.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ export class Generator extends Base {
124124
this.filters = {};
125125
this.forceConfig = true;
126126
this.config.set('filters', this.filters);
127-
this.config.forceSave();
128127
}
129128
});
130129
},
@@ -575,12 +574,10 @@ export class Generator extends Base {
575574
} else if(this.filters.sequelizeModels) {
576575
models = 'sequelize';
577576
}
578-
this.composeWith('angular-fullstack:endpoint', {
579-
options: {
580-
route: '/api/things',
581-
models: models
582-
},
583-
args: ['thing']
577+
this.composeWith(require.resolve('../endpoint'), {
578+
route: '/api/things',
579+
models: models,
580+
arguments: ['thing'],
584581
});
585582
}
586583
};

‎src/generators/endpoint/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class Generator extends NamedBase {
5454
}
5555
}
5656

57-
var name = this.name;
57+
var name = this.options.name;
5858

5959
var base = this.config.get('routesBase') || '/api/';
6060
if(base.charAt(base.length - 1) !== '/') {
@@ -86,7 +86,7 @@ export class Generator extends NamedBase {
8686
configuring() {
8787
this.routeDest = path.join(this.options.endpointDirectory
8888
|| this.config.get('endpointDirectory')
89-
|| 'server/api/', this.name);
89+
|| 'server/api/', this.options.name);
9090
}
9191

9292
writing() {

‎src/generators/generator-base.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
import path from 'path';
44
import _ from 'lodash';
55
import s from 'underscore.string';
6-
import { Base as YoBase } from 'yeoman-generator';
6+
import Generator from 'yeoman-generator';
77
import yoWelcome from 'yeoman-welcome';
88
import * as genUtils from './util';
99

1010
// extend lodash with underscore.string
1111
_.mixin(s.exports());
1212

13-
export class Base extends YoBase {
13+
export class Base extends Generator {
1414
constructor(...args) {
1515
super(...args);
1616

@@ -37,7 +37,7 @@ export class Base extends YoBase {
3737
}
3838

3939
determineAppname() {
40-
if(this.name) return this.name;
40+
if(this.options.name) return this.options.name;
4141
else return super.determineAppname();
4242
}
4343

@@ -63,15 +63,15 @@ export class NamedBase extends Base {
6363

6464
this.argument('name', { type: String, required: true });
6565

66-
var name = this.name.replace(/\//g, '-');
66+
var name = this.options.name.replace(/\//g, '-');
6767

6868
this.cameledName = _.camelize(name);
6969
this.classedName = _.classify(name);
7070

71-
this.basename = path.basename(this.name);
72-
this.dirname = this.name.includes('/')
73-
? path.dirname(this.name)
74-
: this.name;
71+
this.basename = path.basename(this.options.name);
72+
this.dirname = this.options.name.includes('/')
73+
? path.dirname(this.options.name)
74+
: this.options.name;
7575
}
7676
}
7777

0 commit comments

Comments
 (0)
Please sign in to comment.