Skip to content

Releases: bombshell-dev/clack

@clack/prompts@1.0.0-alpha.1

03 Jun 19:07
aece083
Compare
Choose a tag to compare
Pre-release

Minor Changes

  • 7bc3301: Prompts now have a userInput stored separately from their value.
  • 2837845: Adds suggestion and path prompts
  • 9e5bc6c: Add support for signals in prompts, allowing them to be aborted.
  • df4eea1: Remove suggestion prompt and change path prompt to be an autocomplete prompt.
  • 9bd8072: Add a required option to autocomplete multiselect.

Patch Changes

  • bfe0dd3: Prevents placeholder from being used as input value in text prompts
  • 94fee2a: Changes placeholder to be a visual hint rather than a tabbable value.
  • Updated dependencies [bfe0dd3]
  • Updated dependencies [7bc3301]
  • Updated dependencies [2837845]
  • Updated dependencies [34f52fe]
  • Updated dependencies [94fee2a]
  • Updated dependencies [4f6b3c2]
  • Updated dependencies [df4eea1]
  • Updated dependencies [8ead5d3]
    • @clack/core@1.0.0-alpha.1

@clack/prompts@0.11.0

22 May 14:35
737f172
Compare
Choose a tag to compare

Minor Changes

  • 07ca32d: Reverted a change where placeholders were being set as values on return.

Patch Changes

  • Updated dependencies [07ca32d]
    • @clack/core@0.5.0

@clack/core@0.5.0

22 May 14:35
737f172
Compare
Choose a tag to compare

Minor Changes

  • 07ca32d: Reverted a change where placeholders were being set as values on return.

@clack/prompts@1.0.0-alpha.0

09 May 01:33
ac7ca01
Compare
Choose a tag to compare
Pre-release

Major Changes

Minor Changes

  • 99c3530: Adds format option to the note prompt to allow formatting of individual lines

  • 0aaee4c: Added new taskLog prompt for log output which is cleared on success

  • 729bbb6: Add support for customizable spinner cancel and error messages. Users can now customize these messages either per spinner instance or globally via the updateSettings function to support multilingual CLIs.

    This update also improves the architecture by exposing the core settings to the prompts package, enabling more consistent default message handling across the codebase.

    // Per-instance customization
    const spinner = prompts.spinner({
      cancelMessage: "Operación cancelada", // "Operation cancelled" in Spanish
      errorMessage: "Se produjo un error", // "An error occurred" in Spanish
    });
    
    // Global customization via updateSettings
    prompts.updateSettings({
      messages: {
        cancel: "Operación cancelada", // "Operation cancelled" in Spanish
        error: "Se produjo un error", // "An error occurred" in Spanish
      },
    });
    
    // Settings can now be accessed directly
    console.log(prompts.settings.messages.cancel); // "Operación cancelada"
    
    // Direct options take priority over global settings
    const spinner = prompts.spinner({
      cancelMessage: "Cancelled", // This will be used instead of the global setting
    });
  • 44df9af: Adds a new groupSpacing option to grouped multi-select prompts. If set to an integer greater than 0, it will add that number of new lines between each group.

  • f2c2b89: Adds AutocompletePrompt to core with comprehensive tests and implement both autocomplete and autocomplete-multiselect components in prompts package.

  • c45b9fb: Adds support for detecting spinner cancellation via CTRL+C. This allows for graceful handling of user interruptions during long-running operations.

  • 9a09318: Adds new progress prompt to display a progess-bar

  • 19558b9: Added support for custom frames in spinner prompt

Patch Changes

  • 46dc0a4: Fixes multiselect only shows hints on the first item in the options list. Now correctly shows hints for all selected options with hint property.
  • 17342d2: Exposes a new SpinnerResult type to describe the return type of spinner
  • 6868c1c: Adds a new selectableGroups boolean to the group multi-select prompt. Using selectableGroups: false will disable the ability to select a top-level group, but still allow every child to be selected individually.
  • 7a556ad: Updates all prompts to accept a custom output and input stream
  • 7cc8a55: Messages passed to the stop method of a spinner no longer have dots stripped.
  • 2048eb1: Fix spinner's dots behavior with custom frames
  • Updated dependencies [729bbb6]
  • Updated dependencies [6868c1c]
  • Updated dependencies [a4f5034]
  • Updated dependencies [c713fd5]
  • Updated dependencies [a36292b]
  • Updated dependencies [f2c2b89]
    • @clack/core@1.0.0-alpha.0

@clack/prompts@0.10.1

08 Apr 02:54
5de191f
Compare
Choose a tag to compare

Patch Changes

  • 11a5dc1: Fixes multiselect only shows hints on the first item in the options list. Now correctly shows hints for all selected options with hint property.
  • 30aa7ed: Adds a new selectableGroups boolean to the group multi-select prompt. Using selectableGroups: false will disable the ability to select a top-level group, but still allow every child to be selected individually.
  • Updated dependencies [30aa7ed]
  • Updated dependencies [5dfce8a]
  • Updated dependencies [f574297]
    • @clack/core@0.4.2

@clack/core@0.4.2

08 Apr 02:53
5de191f
Compare
Choose a tag to compare

Patch Changes

  • 30aa7ed: Adds a new selectableGroups boolean to the group multi-select prompt. Using selectableGroups: false will disable the ability to select a top-level group, but still allow every child to be selected individually.
  • 5dfce8a: Fixes an edge case for placeholder values. Previously, when pressing enter on an empty prompt, placeholder values would be ignored. Now, placeholder values are treated as the prompt value.
  • f574297: Fix "TTY initialization failed: uv_tty_init returned EBADF (bad file descriptor)" error happening on Windows for non-tty terminals.

@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