Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"mean-years-remain",
"moody-baboons-greet",
"nasty-parrots-laugh",
"odd-bikes-nail",
"orange-deers-battle",
"rich-plants-call",
"sharp-lemons-build",
Expand Down
28 changes: 28 additions & 0 deletions packages/prompts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# @clack/prompts

## 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");
```

## 1.0.0-alpha.6

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/prompts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@clack/prompts",
"version": "1.0.0-alpha.6",
"version": "1.0.0-alpha.7",
"type": "module",
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
Expand Down
Loading