Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate user supplied options from yeoman default options #1732

Closed
desidia26 opened this issue Feb 26, 2020 · 1 comment
Closed

Separate user supplied options from yeoman default options #1732

desidia26 opened this issue Feb 26, 2020 · 1 comment

Comments

@desidia26
Copy link

Feature:
Currently to access user supplied options/options that the author of the generator defines, that author must reference the this.options object. This object contains what looks to be yeoman internal data such as

`

env: Environment {

_events: [Object: null prototype] { error: [Function] },

_eventsCount: 1,

_maxListeners: undefined,

arguments: [],

options: {},

adapter: TerminalAdapter { promptModule: [Function] },

store: Store {

  _generators: [Object],

  _meta: [Object],

  _packagesPaths: [Object],

  _packagesNS: [Array]

},

runLoop: Queue {

  queueNames: [Array],

  __queues__: [Object],

  _maxListeners: 0

},

sharedFs: Store {

  _events: [Object: null prototype] {},

  _eventsCount: 0,

  _maxListeners: 0

},

lookups: [ '.', 'generators', 'lib/generators' ],

aliases: [ [Object] ],

sharedOptions: { sharedData: {} }

`

It would be helpful to separate these from user/author defined options so that option validation could be done more easily.

Use case: I have a generator where I wish to check and see if the user has passed an argument that I don't account for, and notify them.

@desidia26
Copy link
Author

Closing, as I see this likely belongs against the generator repo. Apologies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant