Short summary
- A mixed
type + value re-export in packages/prompts/src/index.ts can cause some TypeScript emitters/bundlers to drop runtime exports (e.g. isCancel). This breaks consumers following the docs/examples.
Reproduction (minimal)
import { isCancel, text } from '@clack/prompts';
// depending on toolchain, `isCancel` may be undefined or throw at runtime
Impact
- Blocks "Getting Started" examples and any consumer relying on
isCancel from @clack/prompts.
- High user friction; likely to break downstream CLIs and automation.
Fix (implemented locally)
- Split the mixed export into a
type-only export and a separate value export:
- export type { ClackSettings } from '@clack/core';
- export { isCancel, settings, updateSettings } from '@clack/core';
PoC (observed result)
typeof isCancel => function
typeof settings => object
typeof updateSettings => function
Patch (exact change applied)
- export { type ClackSettings, isCancel, settings, updateSettings } from '@clack/core';
+ export type { ClackSettings } from '@clack/core';
+ export { isCancel, settings, updateSettings } from '@clack/core';
Short summary
type+ value re-export inpackages/prompts/src/index.tscan cause some TypeScript emitters/bundlers to drop runtime exports (e.g.isCancel). This breaks consumers following the docs/examples.Reproduction (minimal)
Impact
isCancelfrom@clack/prompts.Fix (implemented locally)
type-only export and a separate value export:PoC (observed result)
typeof isCancel => functiontypeof settings => objecttypeof updateSettings => functionPatch (exact change applied)