generator-levi-9-angularjs-2
Version:
Yeoman generator for levi9 angularjs2 projects
43 lines (38 loc) • 1.33 kB
JavaScript
'use strict';
var yeoman = require('yeoman-generator');
var generatorUtils = require('../generatorUtils');
module.exports = yeoman.Base.extend({
constructor: function () {
yeoman.Base.apply(this, arguments);
this.argument('entity',
{
type: String,
required: true,
desc: 'It will be used for folder name, name of service, components and \'class\'' +
'Use kebab-case, camelCase or snake_case'
});
this.argument('path',
{
type: String,
defaults: '',
desc: 'Supports paths relative to /$root/src/app/$entity, defaults to /$root/src/app/$entity'
});
},
initializing: function () {
this.composeWith('levi-9-angularjs-2:component', {
arguments: [this.entity, generatorUtils.addPrefixToPath(this.path, this.entity)]
}, {
local: require.resolve('../component')
});
this.composeWith('levi-9-angularjs-2:service', {
arguments: [this.entity, generatorUtils.addPrefixToPath(this.path, this.entity)]
}, {
local: require.resolve('../service')
});
this.composeWith('levi-9-angularjs-2:class', {
arguments: [this.entity, generatorUtils.addPrefixToPath(this.path, this.entity)]
}, {
local: require.resolve('../class')
});
}
});