Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
var yeoman = require('yeoman-generator');
var utils = require('../../utils/utils.js');
module.exports = yeoman.Base.extend({
initializing: function () {
// arguments
this.argument('name', {
required: true,
type: String,
desc: 'The subgenerator name'
});
this.argument('module', { type: String, required: false });
this.moduleName = utils.checkModule(this.module);
this.moduleFolder = utils.moduleFolder(this.moduleName);
this.filterName = this.name;
this.fileName = utils.fileName(this.filterName);
constructor: function() {
generators.Base.apply(this, arguments);
// applying mixins
mixinLodash.extend(this);
mixinBeautify.extend(this);
mixinFile.extend(this);
mixinNotifier.extend(this);
mixinInspector.extend(this);
// Registering file transforms
this.mixins.beautifyJson();
this.appname = this.appname || path.basename(process.cwd());
this.appname = this.mixins.dasherize(this.appname);
//******* arguments ***********
// To access arguments later use this.argumentName
'use strict'
var generators = require('yeoman-generator')
module.exports = generators.Base.extend({
constructor: function () {
generators.Base.apply(this, arguments)
this.option('projectName', {
type: String,
required: true,
desc: 'Project name'
})
},
initializing: function () {
this.fs.copyTpl(this.templatePath('CONTRIBUTING.md'), this.destinationPath('CONTRIBUTING.md'), this.options)
}
})
constructor: function () {
Generators.Base.apply(this, arguments);
this.argument('pluginName', {
type: String,
desc: 'In module format. Ex: `hapi-plot-device`',
required: true
});
},
init: function () {
const generators = require('yeoman-generator');
const _ = require('lodash');
const fs = require('fs');
const path = require('path');
module.exports = generators.Base.extend({
constructor: function () {
generators.Base.apply(this, arguments);
},
installAssets: function () {
Promise.all([
'client/assets/favicon.png',
].map(file => {
return this.fs.copy(
this.templatePath(file),
this.destinationPath(file)
);
}));
},
installLanguageTemplate: function () {
'use strict';
var htmlWiring = require('html-wiring');
var mkdirp = require('mkdirp');
module.exports = require('yeoman-generator').Base.extend({
init: function () {
if (this.options.chapterName) {
this.chapterName = this.options.chapterName;
} else if (arguments[1]) {
this.chapterName = arguments[1];
} else {
this._askFor();
}
},
_askFor: function () {
var done = this.async();
var prompts = [{
name: 'chapterNum',
message: 'Chapter number',
constructor: function() {
generators.Base.apply(this, arguments);
},
extend(config) {
return generator.Base.extend(Object.assign({
initializing: function () {
this.easily = new Easily(this);
},
configuring: function () {
this.easily.savePropsToConfig();
}
}, config));
}
};
constructor: function() {
yeoman.Base.apply(this, arguments);
this.argument('name', {
type: String,
required: true
});
},
'use strict';
const _ = require('underscore.string');
const path = require('path');
const Base = require('yeoman-generator').Base;
const yosay = require('yosay');
const chalk = require('chalk');
const prompt = require('./prompt');
const write = require('./write');
const pkg = require('../../package.json');
module.exports = class AppGenerator extends Base {
/**
* Constructor.
*/
constructor (...args) {
super(...args);
this.argument('appname', {