mirror of
https://github.com/wassname/generator-react-webpack.git
synced 2026-09-11 12:10:36 +08:00
Add flux support including generators
This commit is contained in:
+12
-4
@@ -8,8 +8,8 @@ var Generator = module.exports = function Generator() {
|
||||
yeoman.generators.NamedBase.apply(this, arguments);
|
||||
|
||||
// Add capitalize mixin
|
||||
this._.mixin({ 'capitalize': generalUtils.capitalize });
|
||||
this._.mixin({ 'capitalizeFile': generalUtils.capitalizeFile });
|
||||
this._.mixin({ 'capitalize': generalUtils.capitalize });
|
||||
this._.mixin({ 'capitalizeFile': generalUtils.capitalizeFile });
|
||||
this._.mixin({ 'capitalizeClass': generalUtils.capitalizeClass });
|
||||
this._.mixin({ 'lowercase': generalUtils.lowercase });
|
||||
|
||||
@@ -18,8 +18,8 @@ var Generator = module.exports = function Generator() {
|
||||
this.appname = this._.slugify(this._.humanize(this.appname));
|
||||
this.scriptAppName = this._.camelize(this._.capitalize(this.appname)) + generalUtils.appName(this);
|
||||
this.classedFileName = this._.capitalizeFile(this.name);
|
||||
this.classedName = this._.capitalizeClass(this.name);
|
||||
this.stylesLanguage = this.config.get('styles-language');
|
||||
this.classedName = this._.capitalizeClass(this.name);
|
||||
this.stylesLanguage = this.config.get('styles-language');
|
||||
|
||||
if (typeof this.options.appPath === 'undefined') {
|
||||
this.options.appPath = this.options.appPath || 'src/scripts';
|
||||
@@ -93,3 +93,11 @@ Generator.prototype.generateSourceAndTest = function (appTemplate, testTemplate,
|
||||
this.testTemplate(testTemplate, path.join(targetDirectory, this._.capitalizeFile(this.name)));
|
||||
this.stylesTemplate(stylesTemplate, path.join(this._.capitalizeFile(this.name)));
|
||||
};
|
||||
|
||||
Generator.prototype.generateAction = function() {
|
||||
this.appTemplate('Action', path.join('actions', this._.capitalizeFile(this.name) + 'ActionCreators'));
|
||||
}
|
||||
|
||||
Generator.prototype.generateStore = function() {
|
||||
this.appTemplate('Store', path.join('stores', this._.capitalizeFile(this.name) + 'Store'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user