Skip to content

Commit 053c962

Browse files
[ci] release
1 parent 801246b commit 053c962

File tree

7 files changed

+97
-52
lines changed

7 files changed

+97
-52
lines changed

.changeset/lucky-maps-beam.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

.changeset/swift-jars-destroy.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/thin-moose-tease.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/core/CHANGELOG.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,47 @@
11
# @clack/core
22

3+
## 0.4.0
4+
5+
### Minor Changes
6+
7+
- 801246b: Adds a new `signal` option to support programmatic prompt cancellation with an [abort controller](https://kettanaito.com/blog/dont-sleep-on-abort-controller).
8+
9+
One example use case is automatically cancelling a prompt after a timeout.
10+
11+
```ts
12+
const shouldContinue = await confirm({
13+
message: "This message will self destruct in 5 seconds",
14+
signal: AbortSignal.timeout(5000),
15+
});
16+
```
17+
18+
Another use case is racing a long running task with a manual prompt.
19+
20+
```ts
21+
const abortController = new AbortController();
22+
23+
const projectType = await Promise.race([
24+
detectProjectType({
25+
signal: abortController.signal,
26+
}),
27+
select({
28+
message: "Pick a project type.",
29+
options: [
30+
{ value: "ts", label: "TypeScript" },
31+
{ value: "js", label: "JavaScript" },
32+
{ value: "coffee", label: "CoffeeScript", hint: "oh no" },
33+
],
34+
signal: abortController.signal,
35+
}),
36+
]);
37+
38+
abortController.abort();
39+
```
40+
41+
### Patch Changes
42+
43+
- 51e12bc: Improves types for events and interaction states.
44+
345
## 0.3.5
446

547
### Patch Changes

packages/core/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@clack/core",
3-
"version": "0.3.5",
3+
"version": "0.4.0",
44
"type": "module",
55
"main": "./dist/index.cjs",
66
"module": "./dist/index.mjs",
@@ -22,7 +22,10 @@
2222
"url": "https://github.com/natemoo-re/clack/issues"
2323
},
2424
"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+
],
2629
"keywords": [
2730
"ask",
2831
"clack",

packages/prompts/CHANGELOG.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,50 @@
11
# @clack/prompts
22

3+
## 0.9.0
4+
5+
### Minor Changes
6+
7+
- 801246b: Adds a new `signal` option to support programmatic prompt cancellation with an [abort controller](https://kettanaito.com/blog/dont-sleep-on-abort-controller).
8+
9+
One example use case is automatically cancelling a prompt after a timeout.
10+
11+
```ts
12+
const shouldContinue = await confirm({
13+
message: "This message will self destruct in 5 seconds",
14+
signal: AbortSignal.timeout(5000),
15+
});
16+
```
17+
18+
Another use case is racing a long running task with a manual prompt.
19+
20+
```ts
21+
const abortController = new AbortController();
22+
23+
const projectType = await Promise.race([
24+
detectProjectType({
25+
signal: abortController.signal,
26+
}),
27+
select({
28+
message: "Pick a project type.",
29+
options: [
30+
{ value: "ts", label: "TypeScript" },
31+
{ value: "js", label: "JavaScript" },
32+
{ value: "coffee", label: "CoffeeScript", hint: "oh no" },
33+
],
34+
signal: abortController.signal,
35+
}),
36+
]);
37+
38+
abortController.abort();
39+
```
40+
41+
### Patch Changes
42+
43+
- f9f139d: Adapts `spinner` output for static CI environments
44+
- Updated dependencies [801246b]
45+
- Updated dependencies [51e12bc]
46+
- @clack/core@0.4.0
47+
348
## 0.8.2
449

550
### Patch Changes

packages/prompts/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@clack/prompts",
3-
"version": "0.8.2",
3+
"version": "0.9.0",
44
"type": "module",
55
"main": "./dist/index.cjs",
66
"module": "./dist/index.mjs",
@@ -22,7 +22,10 @@
2222
"url": "https://github.com/natemoo-re/clack/issues"
2323
},
2424
"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+
],
2629
"author": {
2730
"name": "Nate Moore",
2831
"email": "[email protected]",

0 commit comments

Comments
 (0)