How to use the yeoman-generator.Base function in yeoman-generator

To help you get started, we’ve selected a few yeoman-generator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mwaylabs / generator-m-ionic / generators / filter / index.js View on Github external
'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);
github cmelion / generator-ng2-webpack / generators / app / index.js View on Github external
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
github cybertk / generator-swift-framework / generators / contributing / index.js View on Github external
'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)
  }
})
github jedireza / generator-hapi-style / plugin / index.js View on Github external
constructor: function () {

        Generators.Base.apply(this, arguments);

        this.argument('pluginName', {
            type: String,
            desc: 'In module format. Ex: `hapi-plot-device`',
            required: true
        });
    },
    init: function () {
github societe-generale / react-loopback-generator / generators / client / index.js View on Github external
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 () {
github LeoColomb / generator-latex / chapter / index.js View on Github external
'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',
github GeekyAnts / reazy / src / reazy-generator / generators / mobile-app / index.js View on Github external
constructor: function() {
    generators.Base.apply(this, arguments);
  },
github kristw / yeoman-easily / lib / baseWithEasily.js View on Github external
extend(config) {
    return generator.Base.extend(Object.assign({
      initializing: function () {
        this.easily = new Easily(this);
      },

      configuring: function () {
        this.easily.savePropsToConfig();
      }
    }, config));
  }
};
github mranosa / generator-pageboy / generators / spec / index.js View on Github external
constructor: function() {
    yeoman.Base.apply(this, arguments);

    this.argument('name', {
      type: String,
      required: true
    });
  },
github groupe-sii / generator-webpack-angular / generators / app / index.js View on Github external
'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', {