Releases: bombshell-dev/clack
@clack/prompts@0.10.0
Minor Changes
-
613179d: Adds a new
indicator
option tospinner
, which supports the original"dots"
loading animation or a new"timer"
loading animation.import * as p from "@clack/prompts"; const spin = p.spinner({ indicator: "timer" }); spin.start("Loading"); await sleep(3000); spin.stop("Loaded");
-
a38b2bc: Adds
stream
API which provides the same methods aslog
, but for iterable (even async) message streams. This is particularly useful for AI responses which are dynamically generated by LLMs.import * as p from "@clack/prompts"; await p.stream.step( (async function* () { yield* generateLLMResponse(question); })() );
@clack/prompts@0.9.1
Patch Changes
- 8093f3c: Adds
Error
support to thevalidate
function - 98925e3: Exports the
Option
type and improves JSDocannotations - 1904e57: Replace custom utility for stripping ANSI control sequences with Node's built-in
stripVTControlCharacters
utility. - Updated dependencies [8093f3c]
- Updated dependencies [e5ba09a]
- Updated dependencies [8cba8e3]
- @clack/core@0.4.1
@clack/core@0.4.1
Patch Changes
- 8093f3c: Adds
Error
support to thevalidate
function - e5ba09a: Fixes a cursor display bug in terminals that do not support the "hidden" escape sequence. See Issue #127.
- 8cba8e3: Fixes a rendering bug with cursor positions for
TextPrompt
@clack/prompts@0.9.0
Minor Changes
-
a83d2f8: Adds a new
updateSettings()
function to support new global keybindings.updateSettings()
accepts analiases
object that maps custom keys to an action (up | down | left | right | space | enter | cancel
).import { updateSettings } from "@clack/prompts"; // Support custom keybindings updateSettings({ aliases: { w: "up", a: "left", s: "down", d: "right", }, });
Warning
In order to enforce consistent, user-friendly defaults across the ecosystem, updateSettings
does not support disabling Clack's default keybindings.
-
801246b: Adds a new
signal
option to support programmatic prompt cancellation with an abort controller.One example use case is automatically cancelling a prompt after a timeout.
const shouldContinue = await confirm({ message: "This message will self destruct in 5 seconds", signal: AbortSignal.timeout(5000), });
Another use case is racing a long running task with a manual prompt.
const abortController = new AbortController(); const projectType = await Promise.race([ detectProjectType({ signal: abortController.signal, }), select({ message: "Pick a project type.", options: [ { value: "ts", label: "TypeScript" }, { value: "js", label: "JavaScript" }, { value: "coffee", label: "CoffeeScript", hint: "oh no" }, ], signal: abortController.signal, }), ]); abortController.abort();
-
a83d2f8: Updates default keybindings to support Vim motion shortcuts and map the
escape
key to cancel (ctrl+c
).alias action k
up l
right j
down h
left esc
cancel
Patch Changes
@clack/core@0.4.0
Minor Changes
-
a83d2f8: Adds a new
updateSettings()
function to support new global keybindings.updateSettings()
accepts analiases
object that maps custom keys to an action (up | down | left | right | space | enter | cancel
).import { updateSettings } from "@clack/core"; // Support custom keybindings updateSettings({ aliases: { w: "up", a: "left", s: "down", d: "right", }, });
Warning
In order to enforce consistent, user-friendly defaults across the ecosystem, updateSettings
does not support disabling Clack's default keybindings.
-
801246b: Adds a new
signal
option to support programmatic prompt cancellation with an abort controller. -
a83d2f8: Updates default keybindings to support Vim motion shortcuts and map the
escape
key to cancel (ctrl+c
).alias action k
up l
right j
down h
left esc
cancel
Patch Changes
- 51e12bc: Improves types for events and interaction states.
@clack/prompts@0.8.2
@clack/prompts@0.8.1
Patch Changes
- 360afeb: feat: adaptative max items