-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat(app): read module name form bower.json #975
Conversation
pushes further job done with #572 - with it --app-suffix will be saved for future submodules runs. |
@@ -20,5 +20,6 @@ | |||
"angular-mocks": "^<%= ngVer %>", | |||
"angular-scenario": "^<%= ngVer %>" | |||
}<% if (appPath) { %>, | |||
"appPath": "<%= appPath %>"<% } %> | |||
"appPath": "<%= appPath %>"<% } %>, | |||
"moduleName": "<%= scriptAppName %>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eddiemonge these should be in .yo-rc.json
.
@@ -14,7 +14,12 @@ var Generator = module.exports = function Generator() { | |||
this.appname = path.basename(process.cwd()); | |||
} | |||
this.appname = this._.slugify(this._.humanize(this.appname)); | |||
this.scriptAppName = this._.camelize(this.appname) + angularUtils.appName(this); | |||
|
|||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change this try catch to make the bower.json
variables available as a top level variable so it can be used on line 27(32) as well without having two try catch blocks for essentially the same thing.
eventually (soon) these are going int he .yo-rc.json file.
284f821
to
d836bce
Compare
try { | ||
this.env.options.appPath = require(path.join(process.cwd(), 'bower.json')).appPath; | ||
} catch (e) {} | ||
this.env.options.appPath = bowerJson.appPath; | ||
} | ||
this.env.options.appPath = this.env.options.appPath || 'app'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove 33-35 and change 36 to:
this.env.options.appPath = this.env.options.appPath || bowerJson.appPath || 'app';
app-suffix option is not saved for later uses and needs to be readded to each future subgenerator. This change reads module name from new bower.json field so module author have full flexibility about naming it.
d836bce
to
b3d09f0
Compare
feat(app): read module name form bower.json
app-suffix option is not saved for later uses and needs to be readded to each
future subgenerator. This change reads module name from new bower.json field
so module author have full flexibility about naming it.