How to use the yeoman-generator.generators 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 groupsky / generator-android / app / index.js View on Github external
'API 19: Android 4.4.2 (KitKat'].map(function(name, value) {
  return {name: name, value: value};
});


var AndroidGenerator = module.exports = function AndroidGenerator(args, options, config) {
  yeoman.generators.Base.apply(this, arguments);

  this.on('end', function () {
    this.log("You're all setup. Fire up your favourite IDE and build that great app!");
  });

  this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json')));
};

util.inherits(AndroidGenerator, yeoman.generators.Base);

AndroidGenerator.prototype.askFor = function askFor() {
  var cb = this.async();

  // have Yeoman greet the user.
  console.log(this.yeoman);

  var prompts = [
  {
    name: 'applicationName',
    message: 'What is the name of your application?',
    default: 'My Awesomeness'
  },
  {
    name: 'packageName',
    message: 'What is the package name?',
github yamalight / generator-powder / filter / index.js View on Github external
'use strict';
var util = require('util');
var yeoman = require('yeoman-generator');


var FilterGenerator = yeoman.generators.NamedBase.extend({
    init: function() {
        console.log('You called the filter subgenerator with the argument ' + this.name + '.');
        this.camelizedName = this._.camelize(this.name);
    },

    files: function() {
        this.template('_filter.js', 'client/filters/' + this.camelizedName + '.js');

        // modify client-side directives file
        var path = 'client/filters.js';
        var file = this.readFileAsString(path);
        var directiveString = '    app.filter(\'' + this.camelizedName +
            'Filter\', require(\'./filters/' + this.camelizedName + '.js\'));';
        file = file.replace('};', directiveString + '\n};');
        this.write(path, file);
    }
github eddiemoore / generator-smarttv / app / index.js View on Github external
this.hookFor('test-framework', {
    as: 'app',
    options: {
      options: {
        'skip-install': options['skip-install-message'],
        'skip-message': options['skip-install']
      }
    }
  });

  this.options = options;

  this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json')));
};

util.inherits(SmartTVGenerator, yeoman.generators.Base);

SmartTVGenerator.prototype.askFor = function askFor() {
    var cb = this.async();

    // welcome message
    if (!this.options['skip-welcome-message']) {
        console.log(this.yeoman);
        //console.log(chalk.magenta('Out of the box I include jQuery, and a Gruntfile.js to build your app.'));
    }

    var prompts = [{
            type: 'checkbox',
            name: 'features',
            message: 'What more would you like?',
            choices: [{
                    name: 'Sass with Compass',
github larsonjj / generator-yeogurt / directive / index.js View on Github external
var DirectiveGenerator = module.exports = function DirectiveGenerator() {
  // By calling `NamedBase` here, we get the argument to the subgenerator call
  // as `this.name`.
  yeoman.generators.NamedBase.apply(this, arguments);

  var fileJSON = this.config.get('config');

  // options
  this.projectName = fileJSON.projectName;
  this.jsFramework = fileJSON.jsFramework;
  this.testFramework = fileJSON.testFramework;
  this.useTesting = fileJSON.useTesting;

};
github Hendrixer / generator-ng-express / app / index.js View on Github external
var hasOption = function (options, option) {
  if (options) {
    return options.indexOf(option) !== -1;
  } else {
    return false;
  }
};

var defaults = {
  depend: ["'ui.router'", "ngFx"],
  provides: ['$stateProvider']
};

var NgExpressGenerator = yeoman.generators.Base.extend({
  init: function () {
    this.pkg = require('../package.json');

    /* app specfics */
    this.name = 'myApp';
    this.version = '0.0.1';
    this.e2e = false;
    this.unit = false;

    /* css stuff */
    this.cssLint = false;
    this.cssPre = 'none';

    /* angular stuff */
    this.ngRoute = false;
    this.ngCookies = true;
github FamousArchives / generator-famous / app / index.js View on Github external
/*
    Inspired by https://github.com/assemble/generator-assemble/
    which is released under an MIT license
*/

'use strict';
var fs = require('fs');
var yeoman = require('yeoman-generator');
var chalk = require('chalk');
var shell = require('shelljs');
var updateNotifier = require('update-notifier');
var metrics = require('famous-metrics');
var _ = require('lodash');

var FamousGenerator = yeoman.generators.Base.extend({
  init: function () {
    // Test to see if they are using an old version
    var pkg = require('../package.json');
    var notifier = updateNotifier({
      packageName: pkg.name,
      packageVersion: pkg.version,
      updateCheckInterval: 1
    });
    
    // Function to replace .bowerrc after installation
    var updateBower = function () {
      var bowerRC = JSON.stringify({
        'directory': 'app/lib',
        'scripts': {
          'postinstall': 'grunt bowerRequirejs'
        }
github kelyvin / generator-gulp-express-webapp / generators / app / index.js View on Github external
'use strict';

var yeoman = require('yeoman-generator');
var chalk = require('chalk');
var yosay = require('yosay');
var wiredep = require('wiredep');
var mkdirp = require('mkdirp');
var _s = require('underscore.string');

module.exports = yeoman.generators.Base.extend({
    prompting: function() {
        var done = this.async();

        // Have Yeoman greet the user.
        this.log(yosay(
            'Welcome to the awesome ' + chalk.red('GulpExpressWeb') + ' generator!'
        ));

        this.log(chalk.magenta('Out of the box I include HTML5 Boilerplate, sass, an express server, and a gulpfile to build your app.'));

        var prompts = [{
            type: 'checkbox',
            name: 'features',
            message: 'What else would you like?',
            choices: [{
                name: 'Bootstrap',
github JedWatson / generator-react-component / app / index.js View on Github external
'use strict';

var _ = require('lodash');
var chalk = require('chalk');
var yeoman = require('yeoman-generator');

var ReactComponentGenerator = yeoman.generators.Base.extend({
	
	initializing: function() {
		this.pkg = require('../package.json');
	},
	
	prompting_init: function() {
		var done = this.async();
		
		this.log(
			'\n' + chalk.bold.underline('Welcome to the React Component generator') +
			'\n' +
			'\nWe\'re going to set up a new ' + chalk.bold('ReactJS') + ' Component, ready for development with' +
			'\n' + chalk.bold('gulp, browserify, live-reload') + ' and publishing to ' + chalk.bold('GitHub Pages') + '.' +
			'\n'
		);
github js-experiments / generator-react-app / app / index.js View on Github external
var ReactAppGenerator = module.exports = function ReactAppGenerator(args, options, config) {
  yeoman.generators.Base.apply(this, arguments);

  this.on('end', function () {
    //this.installDependencies({ skipInstall: options['skip-install'] });
	  this.installDependencies();
  });

  this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json')));
};