UNPKG

generator-zionapps

Version:

Angular 9 Code Generator

46 lines (42 loc) 1.12 kB
'use strict'; const Generator = require('yeoman-generator'); 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 || {}; } prompting() { const prompts = [ { type: 'list', name: 'action', message: 'What NgRx generator do you want to run?', choices: [ { name: 'Store', value: 'store' }, { name: 'Sub Store', value: 'sub-store' }, { name: 'Sub Store - One Signal (In Progress)', value: 'sub-store-one-signal' }, { name: 'Quit', value: 'quit' } ] } ]; return this.prompt(prompts).then(props => { if (props.action !== 'quit') { this.composeWith(require.resolve('./' + props.action), { props: { ...this.props, ...props } }); } }); } };