UNPKG

generator-zionapps

Version:

Angular 9 Code Generator

56 lines (51 loc) 1.44 kB
'use strict'; const Generator = require('yeoman-generator'); const packageJson = require('../../package.json'); module.exports = class extends Generator { // Arguments should be defined in the constructor constructor(args, opts) { super(args, opts); // Pass along props from a parent generator this.props = opts.props || {}; // Save version number and date for every usage this.props.zionAppsGeneratorBuildDate = new Date().toDateString(); this.props.zionAppsGeneratorVersion = packageJson.version; } prompting() { this.log('ZionUSA App Scaffolding'); const prompts = [ { type: 'list', name: 'action', message: 'Which type of generator do you want to run?', choices: [ { name: 'Angular v8', value: 'angular' }, { name: 'Ionic v3', value: 'ionic' }, { name: 'Java', value: 'java' }, { name: 'NgRx v8', value: 'ngrx' }, { name: 'Quit', value: 'quit' } ] } ]; return this.prompt(prompts).then(props => { if (props.action !== 'quit') { this.composeWith(require.resolve('./' + props.action), { props: { ...this.props, ...props } }); } }); } };