Skip to content

Releases: bombshell-dev/clack

@clack/[email protected]

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

@clack/[email protected]

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/[email protected]

22 Nov 16:26
Compare
Choose a tag to compare

Patch Changes

@clack/[email protected]

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

Patch Changes

  • 360afeb: feat: adaptative max items

@clack/[email protected]

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/[email protected]

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

Patch Changes

@clack/[email protected]

05 Mar 20:29
Compare
Choose a tag to compare

Patch Changes

@clack/[email protected]

26 Feb 22:37
5059386
Compare
Choose a tag to compare

Patch Changes

  • ca08fb6: Support complex value types for select, multiselect and groupMultiselect.

@clack/[email protected]

25 Feb 01:24
2be262b
Compare
Choose a tag to compare

Minor Changes

  • 8a4a12f: add groupMultiselect prompt
  • 165a1b3: Add log APIs. Supports log.info, log.success, log.warn, and log.error. For low-level control, log.message is also exposed.

Patch Changes

@clack/[email protected]

25 Feb 01:24
2be262b
Compare
Choose a tag to compare

Minor Changes

  • 8a4a12f: Add GroupMultiSelect prompt

Patch Changes

  • 8a4a12f: add groupMultiselect prompt