Changed
render
is now emitted before the message is created.
Fixed
- don't get choices until prompt is called. this ensures that choices defined as a function won't be called early.
Changed
- no longer throws an error when question name is undefined
Added
- adds support for defining
prompt.question.default
as a function - adds support for defining
prompt.question.choices
as a function
Added
- adds initial support for
prompt.context
, an object that can be passed around at runtime to simplify rendering. Future releases will gradually improve context handling until we make a full transition to redux, or redux-like state. Throughout this process, special care will be taken to ensure that the API is the same until the transition to redux, at which time we'll fully document any API changes.
Added
.getDefault
method: to consistently get theoptions.default
on any prompt type: input, list, choices etc.
Potentially breaking changes
- Changes how the
actions
property is initialized. It's unlikely that this will break anyone's code, since it doesn't change any of the behavior or functionality, but a major bump seemed appropriate just in case.
Breaking changes
- converted hard-coded prototype-methods-as-listeners to [prompt-actions][]. This makes it much easier for custom prompts to change behavior without overriding entire prototype methods.
- 100% tests coverage
- various bugfixes and improvements in event handling
- ensures nested prompts are working correctly
- fixes
.getAnswer
to always work with.ask
or.run