···8181 } catch (error) {
8282 // Handle errors but continue if not cancelled
8383 if (!processSpinner.isCancelled) {
8484- p.note(`Error processing ${language}: ${error.message}`, 'Error');
8484+ p.note(`Error processing ${language}: ${(error as Error).message}`, 'Error');
8585 }
8686 }
8787 }
···134134 }
135135 } catch (error) {
136136 if (!finalSpinner.isCancelled) {
137137- finalSpinner.stop(`Error during ${action}: ${error.message}`);
137137+ finalSpinner.stop(`Error during ${action}: ${(error as Error).message}`);
138138 }
139139 }
140140 }
+2-2
examples/basic/text-validation.ts
···99 message: 'Enter your name (letters and spaces only)',
1010 initialValue: 'John123', // Invalid initial value with numbers
1111 validate: (value) => {
1212- if (!/^[a-zA-Z\s]+$/.test(value)) return 'Name can only contain letters and spaces';
1212+ if (!value || !/^[a-zA-Z\s]+$/.test(value)) return 'Name can only contain letters and spaces';
1313 return undefined;
1414 },
1515 });
···2525 message: 'Enter another name (letters and spaces only)',
2626 initialValue: 'John Doe', // Valid initial value
2727 validate: (value) => {
2828- if (!/^[a-zA-Z\s]+$/.test(value)) return 'Name can only contain letters and spaces';
2828+ if (!value || !/^[a-zA-Z\s]+$/.test(value)) return 'Name can only contain letters and spaces';
2929 return undefined;
3030 },
3131 });
···11+MIT License
22+33+Copyright (c) Bombshell Maintainers
44+55+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66+77+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
88+99+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+18
packages/jsx/README.md
···11+# `@clack/jsx`
22+33+This package contains JSX support for clack, allowing you to define your
44+prompts declaratively.
55+66+Each `Prompt` can be rendered as if it were a component:
77+88+```tsx
99+import {Confirm} from '@clack/jsx';
1010+1111+const p = (<Confirm message="yes?"></Confirm>);
1212+1313+const name = await p;
1414+1515+if (isCancel(name)) {
1616+ process.exit(0);
1717+}
1818+```
···11+MIT License
22+33+Copyright (c) Bombshell Maintainers
44+55+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66+77+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
88+99+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+3
packages/test-utils/README.md
···11+# `@clack/test-utils`
22+33+A bunch of useful test utiltiies for use inside clack.