Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Fix order of input precedence #8

Open
vweevers opened this issue Oct 26, 2015 · 1 comment
Open

Fix order of input precedence #8

vweevers opened this issue Oct 26, 2015 · 1 comment
Assignees
Milestone

Comments

@vweevers
Copy link
Collaborator

The current order of input precedence for nom:npm is, with later overriding the former:

  • defaults (hardcoded like license: "MIT" or external like npm and git config)
  • configuration (like copyrightHolder, things that can't be derived from anything else)
  • existing package.json
  • cached answers
  • answers
  • options (from cli or parent generator)

It should be:

  • defaults
  • configuration and cached answers (handle as one, bypass Yeoman's cache)
  • existing package.json
  • answers
  • options
@vweevers vweevers added this to the 2.0.0 milestone Oct 26, 2015
@vweevers vweevers self-assigned this Oct 26, 2015
@vweevers
Copy link
Collaborator Author

Putting a pin in this. @kessler we should discuss this sometime later. Because nom, bare-react and chrome-ninja all do roughly the same - like the above - without sharing code. Ideally I'd like to make a module that:

  • Does strict option parsing (Yeoman does not coerce values, for example)
  • Merges questions with options (specify an option to skip a question)
  • Or somehow allows to specify questions and options in one go (same default value, validation)
  • Has a long and short term memory (bare-react has this, so when used multiple times in a session - like chrome-ninja generating a popup app and option app - it will not ask twice whether you want ES6)

If done right, we could add additional features later (that every generator benefits from), like:

  • A defaults or skipAll flag. If you just want to change one thing, you could do: yo x --skip-all --name new-name.

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

No branches or pull requests

1 participant