Add flux support including generators

This commit is contained in:
Justin Niessner
2015-03-25 22:42:02 -04:00
parent 3a94fb3fe6
commit 3cf4d739e3
10 changed files with 105 additions and 8 deletions
+12 -4
View File
@@ -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'));
}