[READ-ONLY] Mirror of https://github.com/bombshell-dev/clack. Effortlessly build beautiful command-line apps bomb.sh/docs/clack/basics/getting-started/
cli command-line command-line-app node prompt prompts
5

Configure Feed

Select the types of activity you want to include in your feed.

[ci] release (#214)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>

authored by

github-actions[bot]
github-actions[bot]
Nate Moore
and committed by
GitHub
(Dec 19, 2024, 2:27 PM -0600) 258dd69a 132002cb

+130 -91
-25
.changeset/kind-llamas-beam.md
··· 1 - --- 2 - "@clack/prompts": minor 3 - "@clack/core": minor 4 - --- 5 - 6 - Adds a new `updateSettings()` function to support new global keybindings. 7 - 8 - `updateSettings()` accepts an `aliases` object that maps custom keys to an action (`up | down | left | right | space | enter | cancel`). 9 - 10 - ```ts 11 - import { updateSettings } from "@clack/prompts"; 12 - 13 - // Support custom keybindings 14 - updateSettings({ 15 - aliases: { 16 - w: "up", 17 - a: "left", 18 - s: "down", 19 - d: "right", 20 - }, 21 - }); 22 - ``` 23 - 24 - > [!WARNING] 25 - > In order to enforce consistent, user-friendly defaults across the ecosystem, `updateSettings` does not support disabling Clack's default keybindings.
-38
.changeset/lucky-maps-beam.md
··· 1 - --- 2 - "@clack/core": minor 3 - "@clack/prompts": minor 4 - --- 5 - 6 - Adds a new `signal` option to support programmatic prompt cancellation with an [abort controller](https://kettanaito.com/blog/dont-sleep-on-abort-controller). 7 - 8 - One example use case is automatically cancelling a prompt after a timeout. 9 - 10 - ```ts 11 - const shouldContinue = await confirm({ 12 - message: 'This message will self destruct in 5 seconds', 13 - signal: AbortSignal.timeout(5000), 14 - }); 15 - ``` 16 - 17 - Another use case is racing a long running task with a manual prompt. 18 - 19 - ```ts 20 - const abortController = new AbortController() 21 - 22 - const projectType = await Promise.race([ 23 - detectProjectType({ 24 - signal: abortController.signal 25 - }), 26 - select({ 27 - message: 'Pick a project type.', 28 - options: [ 29 - { value: 'ts', label: 'TypeScript' }, 30 - { value: 'js', label: 'JavaScript' }, 31 - { value: 'coffee', label: 'CoffeeScript', hint: 'oh no'}, 32 - ], 33 - signal: abortController.signal, 34 - }) 35 - ]) 36 - 37 - abortController.abort() 38 - ```
-14
.changeset/quiet-actors-wink.md
··· 1 - --- 2 - "@clack/prompts": minor 3 - "@clack/core": minor 4 - --- 5 - 6 - Updates default keybindings to support Vim motion shortcuts and map the `escape` key to cancel (`ctrl+c`). 7 - 8 - | alias | action | 9 - |------- |-------- | 10 - | `k` | up | 11 - | `l` | right | 12 - | `j` | down | 13 - | `h` | left | 14 - | `esc` | cancel |
-5
.changeset/swift-jars-destroy.md
··· 1 - --- 2 - '@clack/core': patch 3 - --- 4 - 5 - Improves types for events and interaction states.
-5
.changeset/thin-moose-tease.md
··· 1 - --- 2 - '@clack/prompts': patch 3 - --- 4 - 5 - Adapts `spinner` output for static CI environments
+42
packages/core/CHANGELOG.md
··· 1 1 # @clack/core 2 2 3 + ## 0.4.0 4 + 5 + ### Minor Changes 6 + 7 + - a83d2f8: Adds a new `updateSettings()` function to support new global keybindings. 8 + 9 + `updateSettings()` accepts an `aliases` object that maps custom keys to an action (`up | down | left | right | space | enter | cancel`). 10 + 11 + ```ts 12 + import { updateSettings } from "@clack/core"; 13 + 14 + // Support custom keybindings 15 + updateSettings({ 16 + aliases: { 17 + w: "up", 18 + a: "left", 19 + s: "down", 20 + d: "right", 21 + }, 22 + }); 23 + ``` 24 + 25 + > [!WARNING] 26 + > In order to enforce consistent, user-friendly defaults across the ecosystem, `updateSettings` does not support disabling Clack's default keybindings. 27 + 28 + - 801246b: Adds a new `signal` option to support programmatic prompt cancellation with an [abort controller](https://kettanaito.com/blog/dont-sleep-on-abort-controller). 29 + 30 + 31 + - a83d2f8: Updates default keybindings to support Vim motion shortcuts and map the `escape` key to cancel (`ctrl+c`). 32 + 33 + | alias | action | 34 + | ----- | ------ | 35 + | `k` | up | 36 + | `l` | right | 37 + | `j` | down | 38 + | `h` | left | 39 + | `esc` | cancel | 40 + 41 + ### Patch Changes 42 + 43 + - 51e12bc: Improves types for events and interaction states. 44 + 3 45 ## 0.3.5 4 46 5 47 ### Patch Changes
+5 -2
packages/core/package.json
··· 1 1 { 2 2 "name": "@clack/core", 3 - "version": "0.3.5", 3 + "version": "0.4.0", 4 4 "type": "module", 5 5 "main": "./dist/index.cjs", 6 6 "module": "./dist/index.mjs", ··· 22 22 "url": "https://github.com/natemoo-re/clack/issues" 23 23 }, 24 24 "homepage": "https://github.com/natemoo-re/clack/tree/main/packages/core#readme", 25 - "files": ["dist", "CHANGELOG.md"], 25 + "files": [ 26 + "dist", 27 + "CHANGELOG.md" 28 + ], 26 29 "keywords": [ 27 30 "ask", 28 31 "clack",
+78
packages/prompts/CHANGELOG.md
··· 1 1 # @clack/prompts 2 2 3 + ## 0.9.0 4 + 5 + ### Minor Changes 6 + 7 + - a83d2f8: Adds a new `updateSettings()` function to support new global keybindings. 8 + 9 + `updateSettings()` accepts an `aliases` object that maps custom keys to an action (`up | down | left | right | space | enter | cancel`). 10 + 11 + ```ts 12 + import { updateSettings } from "@clack/prompts"; 13 + 14 + // Support custom keybindings 15 + updateSettings({ 16 + aliases: { 17 + w: "up", 18 + a: "left", 19 + s: "down", 20 + d: "right", 21 + }, 22 + }); 23 + ``` 24 + 25 + > [!WARNING] 26 + > In order to enforce consistent, user-friendly defaults across the ecosystem, `updateSettings` does not support disabling Clack's default keybindings. 27 + 28 + - 801246b: Adds a new `signal` option to support programmatic prompt cancellation with an [abort controller](https://kettanaito.com/blog/dont-sleep-on-abort-controller). 29 + 30 + One example use case is automatically cancelling a prompt after a timeout. 31 + 32 + ```ts 33 + const shouldContinue = await confirm({ 34 + message: "This message will self destruct in 5 seconds", 35 + signal: AbortSignal.timeout(5000), 36 + }); 37 + ``` 38 + 39 + Another use case is racing a long running task with a manual prompt. 40 + 41 + ```ts 42 + const abortController = new AbortController(); 43 + 44 + const projectType = await Promise.race([ 45 + detectProjectType({ 46 + signal: abortController.signal, 47 + }), 48 + select({ 49 + message: "Pick a project type.", 50 + options: [ 51 + { value: "ts", label: "TypeScript" }, 52 + { value: "js", label: "JavaScript" }, 53 + { value: "coffee", label: "CoffeeScript", hint: "oh no" }, 54 + ], 55 + signal: abortController.signal, 56 + }), 57 + ]); 58 + 59 + abortController.abort(); 60 + ``` 61 + 62 + - a83d2f8: Updates default keybindings to support Vim motion shortcuts and map the `escape` key to cancel (`ctrl+c`). 63 + 64 + | alias | action | 65 + | ----- | ------ | 66 + | `k` | up | 67 + | `l` | right | 68 + | `j` | down | 69 + | `h` | left | 70 + | `esc` | cancel | 71 + 72 + ### Patch Changes 73 + 74 + - f9f139d: Adapts `spinner` output for static CI environments 75 + - Updated dependencies [a83d2f8] 76 + - Updated dependencies [801246b] 77 + - Updated dependencies [a83d2f8] 78 + - Updated dependencies [51e12bc] 79 + - @clack/core@0.4.0 80 + 3 81 ## 0.8.2 4 82 5 83 ### Patch Changes
+5 -2
packages/prompts/package.json
··· 1 1 { 2 2 "name": "@clack/prompts", 3 - "version": "0.8.2", 3 + "version": "0.9.0", 4 4 "type": "module", 5 5 "main": "./dist/index.cjs", 6 6 "module": "./dist/index.mjs", ··· 22 22 "url": "https://github.com/natemoo-re/clack/issues" 23 23 }, 24 24 "homepage": "https://github.com/natemoo-re/clack/tree/main/packages/prompts#readme", 25 - "files": ["dist", "CHANGELOG.md"], 25 + "files": [ 26 + "dist", 27 + "CHANGELOG.md" 28 + ], 26 29 "author": { 27 30 "name": "Nate Moore", 28 31 "email": "nate@natemoo.re",