Skip to content

Releases: bombshell-dev/clack

@clack/prompts@0.10.0

05 Feb 05:33
fe1ee54
Compare
Choose a tag to compare

Minor Changes

  • 613179d: Adds a new indicator option to spinner, 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 as log, 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

09 Jan 04:24
4a925c8
Compare
Choose a tag to compare

Patch Changes

  • 8093f3c: Adds Error support to the validate 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

09 Jan 04:24
4a925c8
Compare
Choose a tag to compare

Patch Changes

  • 8093f3c: Adds Error support to the validate 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

19 Dec 20:28
258dd69
Compare
Choose a tag to compare

Minor Changes

  • a83d2f8: Adds a new updateSettings() function to support new global keybindings.

    updateSettings() accepts an aliases 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

  • f9f139d: Adapts spinner output for static CI environments
  • Updated dependencies [a83d2f8]
  • Updated dependencies [801246b]
  • Updated dependencies [a83d2f8]
  • Updated dependencies [51e12bc]
    • @clack/core@0.4.0

@clack/core@0.4.0

19 Dec 20:28
258dd69
Compare
Choose a tag to compare

Minor Changes

  • a83d2f8: Adds a new updateSettings() function to support new global keybindings.

    updateSettings() accepts an aliases 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

22 Nov 16:26
Compare
Choose a tag to compare

Patch Changes

  • Updated dependencies [4845f4f]
  • Updated dependencies [d7b2fb9]
    • @clack/core@0.3.5

@clack/prompts@0.8.1

15 Nov 02:35
fc9d529
Compare
Choose a tag to compare

Patch Changes

  • 360afeb: feat: adaptative max items

@clack/prompts@0.7.0

09 Aug 19:16
e08e7b5
Compare
Choose a tag to compare

Minor Changes

  • b27a701: add maxItems option to select prompt
  • 89371be: added a new method called spinner.message(msg: string)

Patch Changes

  • 52183c4: Fix spinner conflict with terminal on error between spinner.start() and spinner.stop()
  • ab51d29: Fixes cases where the note title length was miscalculated due to ansi characters
  • Updated dependencies [cd79076]
    • @clack/core@0.3.3

@clack/prompts@0.6.3

06 Mar 12:56
f44c104
Compare
Choose a tag to compare

Patch Changes

  • c96eda5: Enable hard line-wrapping behavior for long words without spaces
  • Updated dependencies [c96eda5]
    • @clack/core@0.3.2

@clack/prompts@0.6.2

05 Mar 20:29
Compare
Choose a tag to compare

Patch Changes

  • 58a1df1: Fix line duplication bug by automatically wrapping prompts to process.stdout.columns
  • Updated dependencies [58a1df1]
    • @clack/core@0.3.1