diff --git a/.changeset/afraid-rabbits-grin.md b/.changeset/afraid-rabbits-grin.md deleted file mode 100644 index bb6b7eb1..00000000 --- a/.changeset/afraid-rabbits-grin.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": minor ---- - -This adds a custom filter function to autocompleteMultiselect. It could be used, for example, to support fuzzy searching logic. diff --git a/.changeset/afraid-socks-deny.md b/.changeset/afraid-socks-deny.md deleted file mode 100644 index 877fe634..00000000 --- a/.changeset/afraid-socks-deny.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -Fixes multiselect only shows hints on the first item in the options list. Now correctly shows hints for all selected options with hint property. diff --git a/.changeset/afraid-worms-help.md b/.changeset/afraid-worms-help.md deleted file mode 100644 index b34596ce..00000000 --- a/.changeset/afraid-worms-help.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@clack/core': patch ---- - -fix: export `*Options` types for prompts. diff --git a/.changeset/better-hotels-fall.md b/.changeset/better-hotels-fall.md deleted file mode 100644 index b12ce57f..00000000 --- a/.changeset/better-hotels-fall.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -Clamp scrolling windows to 5 rows. diff --git a/.changeset/bright-hornets-destroy.md b/.changeset/bright-hornets-destroy.md deleted file mode 100644 index b2c01bcd..00000000 --- a/.changeset/bright-hornets-destroy.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@clack/prompts": patch -"@clack/core": patch ---- - -Prevents placeholder from being used as input value in text prompts diff --git a/.changeset/brown-banks-play.md b/.changeset/brown-banks-play.md deleted file mode 100644 index cd14c657..00000000 --- a/.changeset/brown-banks-play.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -Fix placeholder rendering when using autocomplete. diff --git a/.changeset/busy-baths-work.md b/.changeset/busy-baths-work.md deleted file mode 100644 index 5debdede..00000000 --- a/.changeset/busy-baths-work.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -Fixes rendering of multi-line messages and options in select prompt. diff --git a/.changeset/calm-trains-camp.md b/.changeset/calm-trains-camp.md deleted file mode 100644 index ac80ee18..00000000 --- a/.changeset/calm-trains-camp.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@clack/prompts": minor -"@clack/core": minor ---- - -Prompts now have a `userInput` stored separately from their `value`. diff --git a/.changeset/chatty-islands-move.md b/.changeset/chatty-islands-move.md deleted file mode 100644 index bd7e1ac9..00000000 --- a/.changeset/chatty-islands-move.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -Add withGuide support to note prompt diff --git a/.changeset/crazy-ducks-shine.md b/.changeset/crazy-ducks-shine.md deleted file mode 100644 index 101bd876..00000000 --- a/.changeset/crazy-ducks-shine.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": minor ---- - -feat: add styleFrame option for spinner diff --git a/.changeset/cruel-hairs-swim.md b/.changeset/cruel-hairs-swim.md deleted file mode 100644 index d3292200..00000000 --- a/.changeset/cruel-hairs-swim.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -Fix spinner clearing too many lines upwards when non-wrapping. diff --git a/.changeset/curvy-seals-sit.md b/.changeset/curvy-seals-sit.md deleted file mode 100644 index 69ce6dae..00000000 --- a/.changeset/curvy-seals-sit.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@clack/prompts": minor -"@clack/core": minor ---- - -Adds suggestion and path prompts diff --git a/.changeset/dirty-areas-sin.md b/.changeset/dirty-areas-sin.md deleted file mode 100644 index 3d40032f..00000000 --- a/.changeset/dirty-areas-sin.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -Change styling of disabled multi-select options to have strikethrough. diff --git a/.changeset/dirty-papayas-happen.md b/.changeset/dirty-papayas-happen.md deleted file mode 100644 index 68c80675..00000000 --- a/.changeset/dirty-papayas-happen.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -Exposes a new `SpinnerResult` type to describe the return type of `spinner` diff --git a/.changeset/dull-singers-mate.md b/.changeset/dull-singers-mate.md deleted file mode 100644 index 026140d8..00000000 --- a/.changeset/dull-singers-mate.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -Wrap spinner output to allow for multi-line/wrapped messages. diff --git a/.changeset/early-maps-carry.md b/.changeset/early-maps-carry.md deleted file mode 100644 index 6a0053bf..00000000 --- a/.changeset/early-maps-carry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -Fix duplicated logs when scrolling through options with multiline messages by calculating `rowPadding` dynamically based on actual rendered lines instead of using a hardcoded value. diff --git a/.changeset/empty-buses-wonder.md b/.changeset/empty-buses-wonder.md deleted file mode 100644 index 4d053539..00000000 --- a/.changeset/empty-buses-wonder.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": minor ---- - -Adds `format` option to the note prompt to allow formatting of individual lines diff --git a/.changeset/evil-rats-turn.md b/.changeset/evil-rats-turn.md deleted file mode 100644 index ae5cdef9..00000000 --- a/.changeset/evil-rats-turn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -Strip destructive ANSI codes from task log messages. diff --git a/.changeset/famous-turkeys-burn.md b/.changeset/famous-turkeys-burn.md deleted file mode 100644 index 4705b7ea..00000000 --- a/.changeset/famous-turkeys-burn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": minor ---- - -Added new `taskLog` prompt for log output which is cleared on success diff --git a/.changeset/fine-swans-retire.md b/.changeset/fine-swans-retire.md deleted file mode 100644 index 22753dc6..00000000 --- a/.changeset/fine-swans-retire.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -Add support for wrapped messages in multi line prompts diff --git a/.changeset/five-chairs-poke.md b/.changeset/five-chairs-poke.md deleted file mode 100644 index babddf46..00000000 --- a/.changeset/five-chairs-poke.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -"@clack/prompts": minor -"@clack/core": minor ---- - -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. - -```ts -// 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 -}); -``` diff --git a/.changeset/floppy-laws-tan.md b/.changeset/floppy-laws-tan.md deleted file mode 100644 index 36141724..00000000 --- a/.changeset/floppy-laws-tan.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -fix note component overflow bug diff --git a/.changeset/free-wasps-decide.md b/.changeset/free-wasps-decide.md deleted file mode 100644 index d133735e..00000000 --- a/.changeset/free-wasps-decide.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@clack/prompts": patch -"@clack/core": patch ---- - -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. diff --git a/.changeset/giant-dryers-serve.md b/.changeset/giant-dryers-serve.md deleted file mode 100644 index 2c63955a..00000000 --- a/.changeset/giant-dryers-serve.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@clack/prompts": patch -"@clack/core": patch ---- - -Removed all trailing space in prompt output and fixed various padding rendering bugs. diff --git a/.changeset/great-lies-dance.md b/.changeset/great-lies-dance.md deleted file mode 100644 index 977047e2..00000000 --- a/.changeset/great-lies-dance.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -fix(note): hard wrap text to column limit diff --git a/.changeset/happy-parents-explain.md b/.changeset/happy-parents-explain.md deleted file mode 100644 index 16eb459d..00000000 --- a/.changeset/happy-parents-explain.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": minor ---- - -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. diff --git a/.changeset/healthy-candles-admire.md b/.changeset/healthy-candles-admire.md deleted file mode 100644 index 3b006c1f..00000000 --- a/.changeset/healthy-candles-admire.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -Updates all prompts to accept a custom `output` and `input` stream diff --git a/.changeset/healthy-kings-play.md b/.changeset/healthy-kings-play.md deleted file mode 100644 index 661ac059..00000000 --- a/.changeset/healthy-kings-play.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -Use a default import for picocolors to avoid run time errors in some environments. diff --git a/.changeset/honest-singers-cough.md b/.changeset/honest-singers-cough.md deleted file mode 100644 index a64c8178..00000000 --- a/.changeset/honest-singers-cough.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -Messages passed to the `stop` method of a spinner no longer have dots stripped. diff --git a/.changeset/hot-turkeys-knock.md b/.changeset/hot-turkeys-knock.md deleted file mode 100644 index 0c86eb91..00000000 --- a/.changeset/hot-turkeys-knock.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/core": patch ---- - -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. diff --git a/.changeset/itchy-coins-cry.md b/.changeset/itchy-coins-cry.md deleted file mode 100644 index 5e158684..00000000 --- a/.changeset/itchy-coins-cry.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@clack/prompts": patch -"@clack/core": patch ---- - -Allow disabled options in multi-select and select prompts. diff --git a/.changeset/kind-yaks-clean.md b/.changeset/kind-yaks-clean.md deleted file mode 100644 index ded1c4d4..00000000 --- a/.changeset/kind-yaks-clean.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@clack/prompts": patch -"@clack/core": patch ---- - -Add missing nullish checks around values. diff --git a/.changeset/late-squids-obey.md b/.changeset/late-squids-obey.md deleted file mode 100644 index 1ab23d67..00000000 --- a/.changeset/late-squids-obey.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@clack/prompts": minor -"@clack/core": minor ---- - -Support wrapping autocomplete and select prompts. diff --git a/.changeset/legal-bags-tie.md b/.changeset/legal-bags-tie.md deleted file mode 100644 index 6fc5ecbe..00000000 --- a/.changeset/legal-bags-tie.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"@clack/prompts": major -"@clack/core": major ---- - -The package is now distributed as ESM-only. In `v0` releases, the package was dual-published as CJS and ESM. - -For existing CJS projects using Node v20+, please see Node's guide on [Loading ECMAScript modules using `require()`](https://nodejs.org/docs/latest-v20.x/api/modules.html#loading-ecmascript-modules-using-require). diff --git a/.changeset/lemon-monkeys-help.md b/.changeset/lemon-monkeys-help.md deleted file mode 100644 index 007c2d0c..00000000 --- a/.changeset/lemon-monkeys-help.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/core": patch ---- - -Fix "TTY initialization failed: uv_tty_init returned EBADF (bad file descriptor)" error happening on Windows for non-tty terminals. diff --git a/.changeset/light-waves-jog.md b/.changeset/light-waves-jog.md deleted file mode 100644 index 6b348787..00000000 --- a/.changeset/light-waves-jog.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@clack/prompts": patch -"@clack/core": patch ---- - -Switched from wrap-ansi to fast-wrap-ansi diff --git a/.changeset/little-ghosts-retire.md b/.changeset/little-ghosts-retire.md deleted file mode 100644 index 61a5c4c6..00000000 --- a/.changeset/little-ghosts-retire.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/core": patch ---- - -Support short terminal windows when re-rendering by accounting for off-screen lines diff --git a/.changeset/long-friends-smile.md b/.changeset/long-friends-smile.md deleted file mode 100644 index c7aafd20..00000000 --- a/.changeset/long-friends-smile.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -Fixes missing guide when rendering empty log lines. diff --git a/.changeset/loose-days-hug.md b/.changeset/loose-days-hug.md deleted file mode 100644 index d19105cc..00000000 --- a/.changeset/loose-days-hug.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -Add `clear` method to spinner for stopping and clearing. diff --git a/.changeset/lucky-dragons-think.md b/.changeset/lucky-dragons-think.md deleted file mode 100644 index ffb40962..00000000 --- a/.changeset/lucky-dragons-think.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -fix(note, box): handle CJK correctly diff --git a/.changeset/mean-mice-train.md b/.changeset/mean-mice-train.md deleted file mode 100644 index ca71562d..00000000 --- a/.changeset/mean-mice-train.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/core": patch ---- - -Validates initial values immediately when using text prompts with initialValue and validate props. diff --git a/.changeset/mean-turkeys-help.md b/.changeset/mean-turkeys-help.md deleted file mode 100644 index 3dfe5bda..00000000 --- a/.changeset/mean-turkeys-help.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@clack/prompts": patch -"@clack/core": patch ---- - -Changes `placeholder` to be a visual hint rather than a tabbable value. diff --git a/.changeset/mean-years-remain.md b/.changeset/mean-years-remain.md deleted file mode 100644 index ca384735..00000000 --- a/.changeset/mean-years-remain.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": minor ---- - -Add support for signals in prompts, allowing them to be aborted. diff --git a/.changeset/moody-baboons-greet.md b/.changeset/moody-baboons-greet.md deleted file mode 100644 index d263de97..00000000 --- a/.changeset/moody-baboons-greet.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/core": patch ---- - -Set initial values of auto complete prompt to first option when multiple is false. diff --git a/.changeset/nasty-parrots-laugh.md b/.changeset/nasty-parrots-laugh.md deleted file mode 100644 index 1e428d80..00000000 --- a/.changeset/nasty-parrots-laugh.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@clack/prompts": minor -"@clack/core": minor ---- - -Adds `AutocompletePrompt` to core with comprehensive tests and implement both `autocomplete` and `autocomplete-multiselect` components in prompts package. diff --git a/.changeset/odd-bikes-nail.md b/.changeset/odd-bikes-nail.md deleted file mode 100644 index 349e6ede..00000000 --- a/.changeset/odd-bikes-nail.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -"@clack/prompts": minor ---- - -Updates the API for stopping spinners and progress bars to be clearer - -Previously, both the spinner and progress bar components used a single `stop` method that accepted a code to indicate success, cancellation, or error. This update separates these into distinct methods: `stop()`, `cancel()`, and `error()`: - -```diff -const spinner = prompts.spinner(); -spinner.start(); - -// Cancelling a spinner -- spinner.stop(undefined, 1); -+ spinner.cancel(); - -// Stopping with an error -- spinner.stop(undefined, 2); -+ spinner.error(); -``` - -As before, you can pass a message to each method to customize the output displayed: - -```js -spinner.cancel("Operation cancelled by user"); -progressBar.error("An error occurred during processing"); -``` diff --git a/.changeset/orange-deers-battle.md b/.changeset/orange-deers-battle.md deleted file mode 100644 index 8bd05bb3..00000000 --- a/.changeset/orange-deers-battle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": minor ---- - -Adds support for detecting spinner cancellation via CTRL+C. This allows for graceful handling of user interruptions during long-running operations. diff --git a/.changeset/plenty-snakes-ring.md b/.changeset/plenty-snakes-ring.md deleted file mode 100644 index ca27a8bc..00000000 --- a/.changeset/plenty-snakes-ring.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -Fixes wrapping of cancelled and success messages of select prompt diff --git a/.changeset/pre.json b/.changeset/pre.json deleted file mode 100644 index 0be93fb5..00000000 --- a/.changeset/pre.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "mode": "pre", - "tag": "alpha", - "initialVersions": { - "@example/basic": "0.0.0", - "@example/changesets": "0.0.0", - "@clack/core": "0.4.1", - "@clack/prompts": "0.10.0" - }, - "changesets": [ - "afraid-rabbits-grin", - "afraid-socks-deny", - "afraid-worms-help", - "better-hotels-fall", - "bright-hornets-destroy", - "brown-banks-play", - "busy-baths-work", - "calm-trains-camp", - "chatty-islands-move", - "crazy-ducks-shine", - "cruel-hairs-swim", - "curvy-seals-sit", - "dirty-areas-sin", - "dirty-papayas-happen", - "dull-singers-mate", - "early-maps-carry", - "empty-buses-wonder", - "evil-rats-turn", - "famous-turkeys-burn", - "fine-swans-retire", - "five-chairs-poke", - "floppy-laws-tan", - "free-wasps-decide", - "giant-dryers-serve", - "great-lies-dance", - "happy-parents-explain", - "healthy-candles-admire", - "healthy-kings-play", - "honest-singers-cough", - "hot-turkeys-knock", - "itchy-coins-cry", - "kind-yaks-clean", - "late-squids-obey", - "legal-bags-tie", - "lemon-monkeys-help", - "light-waves-jog", - "little-ghosts-retire", - "long-friends-smile", - "loose-days-hug", - "lucky-dragons-think", - "mean-mice-train", - "mean-turkeys-help", - "mean-years-remain", - "moody-baboons-greet", - "nasty-parrots-laugh", - "odd-bikes-nail", - "orange-deers-battle", - "plenty-snakes-ring", - "rich-plants-call", - "sharp-lemons-build", - "short-squids-battle", - "short-taxis-cross", - "shy-ideas-shout", - "silent-news-share", - "slimy-roses-own", - "solid-goats-shop", - "strong-ravens-greet", - "sweet-deers-smell", - "sweet-garlics-win", - "tall-cows-fold", - "tall-keys-allow", - "tasty-candies-tie", - "thin-socks-travel", - "three-boxes-follow", - "three-ideas-refuse", - "tough-crews-flow", - "upset-showers-grow", - "violet-hornets-turn" - ] -} diff --git a/.changeset/rich-plants-call.md b/.changeset/rich-plants-call.md deleted file mode 100644 index cdffa94d..00000000 --- a/.changeset/rich-plants-call.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -chore: use more accurate type to replace any in group select diff --git a/.changeset/sharp-lemons-build.md b/.changeset/sharp-lemons-build.md deleted file mode 100644 index 8b951c78..00000000 --- a/.changeset/sharp-lemons-build.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": minor ---- - -Using the `group` method, task logs can now have groups which themselves can have scrolling windows of logs. diff --git a/.changeset/short-squids-battle.md b/.changeset/short-squids-battle.md deleted file mode 100644 index c9ccf73d..00000000 --- a/.changeset/short-squids-battle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -Handle `stop` calls on spinners which have not yet been started. diff --git a/.changeset/short-taxis-cross.md b/.changeset/short-taxis-cross.md deleted file mode 100644 index 6365d449..00000000 --- a/.changeset/short-taxis-cross.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@clack/prompts": minor -"@clack/core": minor ---- - -Remove `suggestion` prompt and change `path` prompt to be an autocomplete prompt. diff --git a/.changeset/shy-ideas-shout.md b/.changeset/shy-ideas-shout.md deleted file mode 100644 index 3ebae9b1..00000000 --- a/.changeset/shy-ideas-shout.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": minor ---- - -Added new `box` prompt for rendering boxed text, similar a note. diff --git a/.changeset/silent-news-share.md b/.changeset/silent-news-share.md deleted file mode 100644 index 9b9b2b79..00000000 --- a/.changeset/silent-news-share.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -fix: add missing guide line in autocomplete-multiselect diff --git a/.changeset/slimy-roses-own.md b/.changeset/slimy-roses-own.md deleted file mode 100644 index e5a8985a..00000000 --- a/.changeset/slimy-roses-own.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": minor ---- - -Adds new `progress` prompt to display a progess-bar diff --git a/.changeset/solid-goats-shop.md b/.changeset/solid-goats-shop.md deleted file mode 100644 index eb1987d6..00000000 --- a/.changeset/solid-goats-shop.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@clack/prompts": minor -"@clack/core": minor ---- - -Add `clearOnError` option to password prompt to automatically clear input when validation fails diff --git a/.changeset/strong-ravens-greet.md b/.changeset/strong-ravens-greet.md deleted file mode 100644 index 23d6677f..00000000 --- a/.changeset/strong-ravens-greet.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": minor ---- - -Add a `required` option to autocomplete multiselect. diff --git a/.changeset/sweet-deers-smell.md b/.changeset/sweet-deers-smell.md deleted file mode 100644 index f043873c..00000000 --- a/.changeset/sweet-deers-smell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/core": patch ---- - -Avoid passing initial values to core when using auto complete prompt diff --git a/.changeset/sweet-garlics-win.md b/.changeset/sweet-garlics-win.md deleted file mode 100644 index d83fbf4c..00000000 --- a/.changeset/sweet-garlics-win.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -fix: fix autocomplete bar color when validate diff --git a/.changeset/tall-cows-fold.md b/.changeset/tall-cows-fold.md deleted file mode 100644 index 8b0abf5f..00000000 --- a/.changeset/tall-cows-fold.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -Fix spinner's dots behavior with custom frames diff --git a/.changeset/tall-keys-allow.md b/.changeset/tall-keys-allow.md deleted file mode 100644 index 5d5566ce..00000000 --- a/.changeset/tall-keys-allow.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@clack/prompts": patch -"@clack/core": patch ---- - -Add a new `withGuide` option to all prompts to disable the default clack border diff --git a/.changeset/tasty-candies-tie.md b/.changeset/tasty-candies-tie.md deleted file mode 100644 index 22f98c7f..00000000 --- a/.changeset/tasty-candies-tie.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -Show symbol when withGuide is true for log messages diff --git a/.changeset/thin-socks-travel.md b/.changeset/thin-socks-travel.md deleted file mode 100644 index 89e23f09..00000000 --- a/.changeset/thin-socks-travel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": minor ---- - -Added support for custom frames in spinner prompt diff --git a/.changeset/three-boxes-follow.md b/.changeset/three-boxes-follow.md deleted file mode 100644 index 13c02b76..00000000 --- a/.changeset/three-boxes-follow.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@clack/prompts": patch -"@clack/core": patch ---- - -select-key: Fixed wrapping and added new `caseSensitive` option diff --git a/.changeset/three-ideas-refuse.md b/.changeset/three-ideas-refuse.md deleted file mode 100644 index f98176e7..00000000 --- a/.changeset/three-ideas-refuse.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -refactor(progress): remove unnecessary return statement in start function diff --git a/.changeset/tough-crews-flow.md b/.changeset/tough-crews-flow.md deleted file mode 100644 index 4cd23292..00000000 --- a/.changeset/tough-crews-flow.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@clack/prompts": patch -"@clack/core": patch ---- - -Allow custom writables as output stream. diff --git a/.changeset/upset-showers-grow.md b/.changeset/upset-showers-grow.md deleted file mode 100644 index ca50c0a1..00000000 --- a/.changeset/upset-showers-grow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/core": patch ---- - -add invert selection for multiselect prompt diff --git a/.changeset/violet-hornets-turn.md b/.changeset/violet-hornets-turn.md deleted file mode 100644 index f3ef7cf9..00000000 --- a/.changeset/violet-hornets-turn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@clack/prompts": patch ---- - -Update key binding text to show tab/space when navigating, and tab otherwise. diff --git a/.github/assets/clack-dark.gif b/.github/assets/clack-dark.gif deleted file mode 100644 index f93e0f59..00000000 Binary files a/.github/assets/clack-dark.gif and /dev/null differ diff --git a/.github/assets/clack-light.gif b/.github/assets/clack-light.gif deleted file mode 100644 index 770b670f..00000000 Binary files a/.github/assets/clack-light.gif and /dev/null differ diff --git a/.github/assets/clack-logs.png b/.github/assets/clack-logs.png deleted file mode 100644 index 9ff45a8c..00000000 Binary files a/.github/assets/clack-logs.png and /dev/null differ diff --git a/.github/assets/clack.gif b/.github/assets/clack.gif deleted file mode 100644 index f95a9f9f..00000000 Binary files a/.github/assets/clack.gif and /dev/null differ diff --git a/.github/assets/clack.png b/.github/assets/clack.png new file mode 100644 index 00000000..fe202058 Binary files /dev/null and b/.github/assets/clack.png differ diff --git a/README.md b/README.md index c17c698f..f8afcef4 100644 --- a/README.md +++ b/README.md @@ -2,26 +2,15 @@
- - - Clack logo - + Clack logo
-

Effortlessly build beautiful command-line apps 🪄

+

stylish interactive prompts for JavaScript CLIs

-

@clack/core: unstyled, extensible primitives for CLIs

-

@clack/prompts: beautiful, ready-to-use CLI prompt components

+

@clack/prompts: opinionated, ready-to-use prompt components

-> [!WARNING] -> Clack's `main` branch is tracking the [`alpha` release line for `v1.0.0+`](https://github.com/bombshell-dev/clack/pull/250). To view the relatively stable `v0` line, please browse the [v0](https://github.com/bombshell-dev/clack/tree/v0) branch. +

@clack/core: headless, unstyled prompt primitives



-

@clack/prompts in action

- -
- -https://user-images.githubusercontent.com/7118177/219649990-7afcb64a-246d-4ad2-9767-325298959790.mp4 - -
+

Read the docs

diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index fa87fad7..d0c7793a 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,75 +1,6 @@ # @clack/core -## 1.0.0-alpha.8 - -### Patch Changes - -- 68dbf9b: select-key: Fixed wrapping and added new `caseSensitive` option - -## 1.0.0-alpha.7 - -### Patch Changes - -- 0718b07: fix: export `*Options` types for prompts. -- 4ba2d78: Support short terminal windows when re-rendering by accounting for off-screen lines -- acc4c3a: Add a new `withGuide` option to all prompts to disable the default clack border - -## 1.0.0-alpha.6 - -### Patch Changes - -- b103ad3: Allow disabled options in multi-select and select prompts. - -## 1.0.0-alpha.5 - -### Minor Changes - -- 55645c2: Support wrapping autocomplete and select prompts. - -### Patch Changes - -- 71b5029: Add missing nullish checks around values. -- 2310b43: Allow custom writables as output stream. - -## 1.0.0-alpha.4 - -### Patch Changes - -- d98e033: add invert selection for multiselect prompt - -## 1.0.0-alpha.3 - -### Minor Changes - -- 1604f97: Add `clearOnError` option to password prompt to automatically clear input when validation fails - -### Patch Changes - -- 1a45f93: Switched from wrap-ansi to fast-wrap-ansi - -## 1.0.0-alpha.2 - -### Patch Changes - -- 7df841d: Removed all trailing space in prompt output and fixed various padding rendering bugs. - -## 1.0.0-alpha.1 - -### Minor Changes - -- 7bc3301: Prompts now have a `userInput` stored separately from their `value`. -- 2837845: Adds suggestion and path prompts -- df4eea1: Remove `suggestion` prompt and change `path` prompt to be an autocomplete prompt. - -### Patch Changes - -- bfe0dd3: Prevents placeholder from being used as input value in text prompts -- 34f52fe: Validates initial values immediately when using text prompts with initialValue and validate props. -- 94fee2a: Changes `placeholder` to be a visual hint rather than a tabbable value. -- 4f6b3c2: Set initial values of auto complete prompt to first option when multiple is false. -- 8ead5d3: Avoid passing initial values to core when using auto complete prompt - -## 1.0.0-alpha.0 +## 1.0.0 ### Major Changes @@ -79,6 +10,8 @@ ### Minor Changes +- 7bc3301: Prompts now have a `userInput` stored separately from their `value`. +- 2837845: Adds suggestion and path prompts - 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. @@ -107,13 +40,31 @@ }); ``` +- 55645c2: Support wrapping autocomplete and select prompts. - f2c2b89: Adds `AutocompletePrompt` to core with comprehensive tests and implement both `autocomplete` and `autocomplete-multiselect` components in prompts package. +- df4eea1: Remove `suggestion` prompt and change `path` prompt to be an autocomplete prompt. +- 1604f97: Add `clearOnError` option to password prompt to automatically clear input when validation fails ### Patch Changes +- 0718b07: fix: export `*Options` types for prompts. +- bfe0dd3: Prevents placeholder from being used as input value in text prompts - 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. +- 7df841d: Removed all trailing space in prompt output and fixed various padding rendering bugs. - a4f5034: 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. +- b103ad3: Allow disabled options in multi-select and select prompts. +- 71b5029: Add missing nullish checks around values. - a36292b: Fix "TTY initialization failed: uv_tty_init returned EBADF (bad file descriptor)" error happening on Windows for non-tty terminals. +- 1a45f93: Switched from wrap-ansi to fast-wrap-ansi +- 4ba2d78: Support short terminal windows when re-rendering by accounting for off-screen lines +- 34f52fe: Validates initial values immediately when using text prompts with initialValue and validate props. +- 94fee2a: Changes `placeholder` to be a visual hint rather than a tabbable value. +- 4f6b3c2: Set initial values of auto complete prompt to first option when multiple is false. +- 8ead5d3: Avoid passing initial values to core when using auto complete prompt +- acc4c3a: Add a new `withGuide` option to all prompts to disable the default clack border +- 68dbf9b: select-key: Fixed wrapping and added new `caseSensitive` option +- 2310b43: Allow custom writables as output stream. +- d98e033: add invert selection for multiselect prompt ## 0.4.1 diff --git a/packages/core/package.json b/packages/core/package.json index fba19a86..54bbbd21 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@clack/core", - "version": "1.0.0-alpha.8", + "version": "1.0.0", "type": "module", "main": "./dist/index.mjs", "module": "./dist/index.mjs", diff --git a/packages/prompts/CHANGELOG.md b/packages/prompts/CHANGELOG.md index 21d31a0d..d10255ab 100644 --- a/packages/prompts/CHANGELOG.md +++ b/packages/prompts/CHANGELOG.md @@ -1,172 +1,6 @@ # @clack/prompts -## 1.0.0-alpha.10 - -### Minor Changes - -- 415410b: This adds a custom filter function to autocompleteMultiselect. It could be used, for example, to support fuzzy searching logic. - -### Patch Changes - -- 55eb280: Fix placeholder rendering when using autocomplete. -- 68dbf9b: select-key: Fixed wrapping and added new `caseSensitive` option -- Updated dependencies [68dbf9b] - - @clack/core@1.0.0-alpha.8 - -## 1.0.0-alpha.9 - -### Patch Changes - -- f952592: Fixes missing guide when rendering empty log lines. -- 372b526: Add `clear` method to spinner for stopping and clearing. - -## 1.0.0-alpha.8 - -### Patch Changes - -- 43aed55: Change styling of disabled multi-select options to have strikethrough. -- 2feaebb: Fix duplicated logs when scrolling through options with multiline messages by calculating `rowPadding` dynamically based on actual rendered lines instead of using a hardcoded value. -- 42adff8: fix: add missing guide line in autocomplete-multiselect -- 8e2e30a: fix: fix autocomplete bar color when validate -- 9b92161: Show symbol when withGuide is true for log messages - -## 1.0.0-alpha.7 - -### Minor Changes - -- 38019c7: Updates the API for stopping spinners and progress bars to be clearer - - Previously, both the spinner and progress bar components used a single `stop` method that accepted a code to indicate success, cancellation, or error. This update separates these into distinct methods: `stop()`, `cancel()`, and `error()`: - - ```diff - const spinner = prompts.spinner(); - spinner.start(); - - // Cancelling a spinner - - spinner.stop(undefined, 1); - + spinner.cancel(); - - // Stopping with an error - - spinner.stop(undefined, 2); - + spinner.error(); - ``` - - As before, you can pass a message to each method to customize the output displayed: - - ```js - spinner.cancel("Operation cancelled by user"); - progressBar.error("An error occurred during processing"); - ``` - -### Patch Changes - -- 4d1d83b: Fixes rendering of multi-line messages and options in select prompt. -- 6176ced: Add withGuide support to note prompt -- 69681ea: Strip destructive ANSI codes from task log messages. -- b0fa7d8: Add support for wrapped messages in multi line prompts -- 7530af0: Fixes wrapping of cancelled and success messages of select prompt -- acc4c3a: Add a new `withGuide` option to all prompts to disable the default clack border -- Updated dependencies [0718b07] -- Updated dependencies [4ba2d78] -- Updated dependencies [acc4c3a] - - @clack/core@1.0.0-alpha.7 - -## 1.0.0-alpha.6 - -### Minor Changes - -- 8409f2c: feat: add styleFrame option for spinner - -### Patch Changes - -- aea4573: Clamp scrolling windows to 5 rows. -- b103ad3: Allow disabled options in multi-select and select prompts. -- Updated dependencies [b103ad3] - - @clack/core@1.0.0-alpha.6 - -## 1.0.0-alpha.5 - -### Minor Changes - -- 55645c2: Support wrapping autocomplete and select prompts. - -### Patch Changes - -- 9999adf: fix note component overflow bug -- 2839c66: fix(note): hard wrap text to column limit -- 71b5029: Add missing nullish checks around values. -- d25f6d0: fix(note, box): handle CJK correctly -- 0b852e1: Handle `stop` calls on spinners which have not yet been started. -- 09e596c: refactor(progress): remove unnecessary return statement in start function -- 2310b43: Allow custom writables as output stream. -- Updated dependencies [71b5029] -- Updated dependencies [55645c2] -- Updated dependencies [2310b43] - - @clack/core@1.0.0-alpha.5 - -## 1.0.0-alpha.4 - -### Patch Changes - -- 7b009df: Fix spinner clearing too many lines upwards when non-wrapping. -- ae84dd0: Update key binding text to show tab/space when navigating, and tab otherwise. -- Updated dependencies [d98e033] - - @clack/core@1.0.0-alpha.4 - -## 1.0.0-alpha.3 - -### Minor Changes - -- 76fd17f: Added new `box` prompt for rendering boxed text, similar a note. -- 1604f97: Add `clearOnError` option to password prompt to automatically clear input when validation fails - -### Patch Changes - -- 1a45f93: Switched from wrap-ansi to fast-wrap-ansi -- 4c89dd7: chore: use more accurate type to replace any in group select -- Updated dependencies [1a45f93] -- Updated dependencies [1604f97] - - @clack/core@1.0.0-alpha.3 - -## 1.0.0-alpha.2 - -### Minor Changes - -- f10071e: Using the `group` method, task logs can now have groups which themselves can have scrolling windows of logs. - -### Patch Changes - -- 282b39e: Wrap spinner output to allow for multi-line/wrapped messages. -- 7df841d: Removed all trailing space in prompt output and fixed various padding rendering bugs. -- 17d3650: Use a default import for picocolors to avoid run time errors in some environments. -- Updated dependencies [7df841d] - - @clack/core@1.0.0-alpha.2 - -## 1.0.0-alpha.1 - -### 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 - -## 1.0.0-alpha.0 +## 1.0.0 ### Major Changes @@ -176,6 +10,10 @@ ### Minor Changes +- 415410b: This adds a custom filter function to autocompleteMultiselect. It could be used, for example, to support fuzzy searching logic. +- 7bc3301: Prompts now have a `userInput` stored separately from their `value`. +- 8409f2c: feat: add styleFrame option for spinner +- 2837845: Adds suggestion and path prompts - 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. @@ -207,26 +45,84 @@ ``` - 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. +- 55645c2: Support wrapping autocomplete and select prompts. +- 9e5bc6c: Add support for signals in prompts, allowing them to be aborted. - f2c2b89: Adds `AutocompletePrompt` to core with comprehensive tests and implement both `autocomplete` and `autocomplete-multiselect` components in prompts package. +- 38019c7: Updates the API for stopping spinners and progress bars to be clearer + + Previously, both the spinner and progress bar components used a single `stop` method that accepted a code to indicate success, cancellation, or error. This update separates these into distinct methods: `stop()`, `cancel()`, and `error()`: + + ```diff + const spinner = prompts.spinner(); + spinner.start(); + + // Cancelling a spinner + - spinner.stop(undefined, 1); + + spinner.cancel(); + + // Stopping with an error + - spinner.stop(undefined, 2); + + spinner.error(); + ``` + + As before, you can pass a message to each method to customize the output displayed: + + ```js + spinner.cancel("Operation cancelled by user"); + progressBar.error("An error occurred during processing"); + ``` + - c45b9fb: Adds support for detecting spinner cancellation via CTRL+C. This allows for graceful handling of user interruptions during long-running operations. +- f10071e: Using the `group` method, task logs can now have groups which themselves can have scrolling windows of logs. +- df4eea1: Remove `suggestion` prompt and change `path` prompt to be an autocomplete prompt. +- 76fd17f: Added new `box` prompt for rendering boxed text, similar a note. - 9a09318: Adds new `progress` prompt to display a progess-bar +- 1604f97: Add `clearOnError` option to password prompt to automatically clear input when validation fails +- 9bd8072: Add a `required` option to autocomplete multiselect. - 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. +- aea4573: Clamp scrolling windows to 5 rows. +- bfe0dd3: Prevents placeholder from being used as input value in text prompts +- 55eb280: Fix placeholder rendering when using autocomplete. +- 4d1d83b: Fixes rendering of multi-line messages and options in select prompt. +- 6176ced: Add withGuide support to note prompt +- 7b009df: Fix spinner clearing too many lines upwards when non-wrapping. +- 43aed55: Change styling of disabled multi-select options to have strikethrough. - 17342d2: Exposes a new `SpinnerResult` type to describe the return type of `spinner` +- 282b39e: Wrap spinner output to allow for multi-line/wrapped messages. +- 2feaebb: Fix duplicated logs when scrolling through options with multiline messages by calculating `rowPadding` dynamically based on actual rendered lines instead of using a hardcoded value. +- 69681ea: Strip destructive ANSI codes from task log messages. +- b0fa7d8: Add support for wrapped messages in multi line prompts +- 9999adf: fix note component overflow bug - 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. +- 7df841d: Removed all trailing space in prompt output and fixed various padding rendering bugs. +- 2839c66: fix(note): hard wrap text to column limit - 7a556ad: Updates all prompts to accept a custom `output` and `input` stream +- 17d3650: Use a default import for picocolors to avoid run time errors in some environments. - 7cc8a55: Messages passed to the `stop` method of a spinner no longer have dots stripped. +- b103ad3: Allow disabled options in multi-select and select prompts. +- 71b5029: Add missing nullish checks around values. +- 1a45f93: Switched from wrap-ansi to fast-wrap-ansi +- f952592: Fixes missing guide when rendering empty log lines. +- 372b526: Add `clear` method to spinner for stopping and clearing. +- d25f6d0: fix(note, box): handle CJK correctly +- 94fee2a: Changes `placeholder` to be a visual hint rather than a tabbable value. +- 7530af0: Fixes wrapping of cancelled and success messages of select prompt +- 4c89dd7: chore: use more accurate type to replace any in group select +- 0b852e1: Handle `stop` calls on spinners which have not yet been started. +- 42adff8: fix: add missing guide line in autocomplete-multiselect +- 8e2e30a: fix: fix autocomplete bar color when validate - 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 +- acc4c3a: Add a new `withGuide` option to all prompts to disable the default clack border +- 9b92161: Show symbol when withGuide is true for log messages +- 68dbf9b: select-key: Fixed wrapping and added new `caseSensitive` option +- 09e596c: refactor(progress): remove unnecessary return statement in start function +- 2310b43: Allow custom writables as output stream. +- ae84dd0: Update key binding text to show tab/space when navigating, and tab otherwise. +- Updated dependency on `@clack/core` to `1.0.0` ## 0.10.0 diff --git a/packages/prompts/package.json b/packages/prompts/package.json index 04ec51c1..e9ba61e2 100644 --- a/packages/prompts/package.json +++ b/packages/prompts/package.json @@ -1,6 +1,6 @@ { "name": "@clack/prompts", - "version": "1.0.0-alpha.10", + "version": "1.0.0", "type": "module", "main": "./dist/index.mjs", "module": "./dist/index.mjs",