Skip to content

isCancel runtime export regression in @clack/prompts #470

@kallal79

Description

@kallal79

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';

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Needs triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions