Skip to content

Commit 1fefce5

Browse files
committed
Merge branch 'main' into autocomplete-wrapperisms
2 parents 635dd1a + 9fd94e2 commit 1fefce5

26 files changed

+434
-166
lines changed

.changeset/great-lies-dance.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@clack/prompts": patch
3+
---
4+
5+
fix(note): hard wrap text to column limit

.changeset/kind-yaks-clean.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@clack/prompts": patch
3+
"@clack/core": patch
4+
---
5+
6+
Add missing nullish checks around values.

.changeset/lucky-dragons-think.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@clack/prompts": patch
3+
---
4+
5+
fix(note, box): handle CJK correctly

.changeset/three-ideas-refuse.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@clack/prompts": patch
3+
---
4+
5+
refactor(progress): remove unnecessary return statement in start function

.changeset/tough-crews-flow.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@clack/prompts": patch
3+
"@clack/core": patch
4+
---
5+
6+
Allow custom writables as output stream.

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ charset = utf-8
77
trim_trailing_whitespace = true
88
insert_final_newline = true
99

10-
[*.yml]
10+
[*.{yml,json,yaml}]
1111
indent_style = space
1212
indent_size = 2

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ The `examples/` directory contains sample projects that demonstrate how to use C
200200
pnpm lint
201201

202202
# Verify type correctness
203-
pnpm type-check
203+
pnpm types
204204

205205
# Run tests
206206
pnpm test

examples/basic/text-validation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ async function main() {
99
message: 'Enter your name (letters and spaces only)',
1010
initialValue: 'John123', // Invalid initial value with numbers
1111
validate: (value) => {
12-
if (!/^[a-zA-Z\s]+$/.test(value)) return 'Name can only contain letters and spaces';
12+
if (!value || !/^[a-zA-Z\s]+$/.test(value)) return 'Name can only contain letters and spaces';
1313
return undefined;
1414
},
1515
});
@@ -25,7 +25,7 @@ async function main() {
2525
message: 'Enter another name (letters and spaces only)',
2626
initialValue: 'John Doe', // Valid initial value
2727
validate: (value) => {
28-
if (!/^[a-zA-Z\s]+$/.test(value)) return 'Name can only contain letters and spaces';
28+
if (!value || !/^[a-zA-Z\s]+$/.test(value)) return 'Name can only contain letters and spaces';
2929
return undefined;
3030
},
3131
});

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"dev": "pnpm --filter @example/changesets run start",
1010
"format": "biome check --write",
1111
"lint": "biome lint --write --unsafe",
12-
"types": "biome lint --write --unsafe",
12+
"types": "tsc --noEmit",
1313
"deps": "pnpm exec knip --production",
1414
"test": "pnpm --color -r run test",
1515
"pretest": "pnpm run build"

packages/core/src/prompts/multi-select.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ export default class MultiSelectPrompt<T extends { value: any }> extends Prompt<
2121
}
2222

2323
private toggleInvert() {
24-
const notSelected = this.options.filter((v) => !this.value.includes(v.value));
24+
const value = this.value;
25+
if (!value) {
26+
return;
27+
}
28+
const notSelected = this.options.filter((v) => !value.includes(v.value));
2529
this.value = notSelected.map((v) => v.value);
2630
}
2731

0 commit comments

Comments
 (0)