Inquirer.js

A collection of common interactive command line user interfaces.

MIT License

Downloads
263.1M
Stars
19.4K
Committers
229

Bot releases are hidden (Show)

Inquirer.js -

Published by SBoudrias about 1 year ago

  • Review how force exit events are handled to make sure we restore the cursor properly.
  • Various dependencies bump (including TS 5.2.2)
Inquirer.js -

Published by SBoudrias about 1 year ago

Major rewrite of the core to rely on node's async hooks for better isolation of each prompts. Relying on this means each prompt context is fully isolated (previously it would rely on the module level context.)

We expect this update to be transparent to most. Though some custom event handlers within useEffect could stop working. If you find any issues there, first please let us know - there might be thing to improve internally to make it transparent. The manual fix will likely be to explicitly define events callback as an AsyncResource.

Let us know how this works for you!

Inquirer.js -

Published by SBoudrias about 1 year ago

  • Fix bug where a setState call triggered from useEffect might re-render the screen with the previous state.
Inquirer.js -

Published by SBoudrias about 1 year ago

  • Bugfix: Fix a dependency who became ESM only
Inquirer.js -

Published by SBoudrias about 1 year ago

  • Modified lodash imports to help with tree-shaking
  • Replace unmaintained through dependency (only affect users of the old bottom bar)
Inquirer.js -

Published by SBoudrias about 1 year ago

Bugfix: Cursor position now reflected properly when using arrow keys.

Inquirer.js -

Published by SBoudrias about 1 year ago

Bugfix: Cursor position now reflected properly when using arrow keys.

Inquirer.js -

Published by SBoudrias about 1 year ago

  • Bugfix (and insuing refactor) of how the cursor position is maintained and handled when changing outside of a render cycle. This caused bugs with all underlying prompts where the user input text. This fix should be transparent for all users; but it is a large change so warranted a minor bump.
Inquirer.js -

Published by SBoudrias over 1 year ago

  • Breaking: Paginator is deprecated in favour of the usePagination hook. This hook will always properly reflect the width of the output stream.
Inquirer.js -

Published by SBoudrias over 1 year ago

  • Breaking: Includes new major version of @inquirer/core.
  • Bug fix: on Select & Checkbox prompt where it could happen the choice list wasn't matching the terminal width.
Inquirer.js -

Published by SBoudrias over 1 year ago

  • Choice list max width should always match the terminal width
Inquirer.js -

Published by SBoudrias over 1 year ago

  • Choice list max width should always match the terminal width
Inquirer.js -

Published by SBoudrias over 1 year ago

Fix bug where Common.js Typescript types definition were broken (should have no impact on ESM users)

Inquirer.js -

Published by SBoudrias over 1 year ago

  • New getFullOutput() utility that'll return a raw string of everything that was written to the output stream
  • Ignore cursor hide/show ANSI code from raw output (keeping those made it harder to test raw output where those cleaning code would always be the only result due to how inquirer clean state.)
Inquirer.js -

Published by SBoudrias over 1 year ago

  • Fix bug where multiple prompts were allowed to run at the same time (and thus leak state)
  • Fix bug where a failed prompt state could leak to subsequent runs of other prompts
Inquirer.js -

Published by SBoudrias over 1 year ago

Inquirer.js -

Published by SBoudrias over 1 year ago

  • When setting a state (useState), it'll only re-renders if the value changed.
  • When setting multiple states at once, we'll only trigger one re-renders if it happens inside a hook callback (previously each state change triggered one re-render.)

If you're setting multiple state in a callback from an async function (like setTimeout or a network call), those will not be merged in a single re-renders. For those case, you're better using a state object holding all values to reduce the amount of re-renders. Open to discuss this in #1251

Inquirer.js -

Published by SBoudrias over 1 year ago

Now exposes the waitForUserInput option. Setting it to false will automatically launch the editor.

Be careful using this option as this mean the user will not have read the question/instruction before reaching the editor.

Inquirer.js -

Published by SBoudrias over 1 year ago

useEffect now pass the active Readline instance to the effect callback. e.g useEffect((readline) => ...

Inquirer.js -

Published by SBoudrias over 1 year ago

Major refactor of the core to allow multiple features:

  1. Prompt function now return cancelable promise (e.g input(...).cancel())
  2. Reduced amount of writes to the readline (should now be ~1 per render cycle)
  3. Make sure to restore the cursor on force exit.