Skip to content

Conversation

@SBoudrias
Copy link
Owner

@SBoudrias SBoudrias commented Oct 28, 2025

Summary

This PR removes all deprecated code from the Inquirer.js codebase as part of preparing for the next major release.

Breaking Changes

This PR removes the following deprecated APIs:

  1. list prompt alias → Use select instead
  2. theme.helpMode property → Use theme.style.keysHelpTip(() => undefined) to hide help
  3. config.instructions property → Use theme.style.keysHelpTip(...) for custom help text
  4. cancel() method on prompt return types → Use AbortSignal in context options

Changes

Deprecated Items Removed (9 total)

  • packages/inquirer/src/index.ts:43 - Removed list alias
  • packages/search/src/index.ts:30 - Removed helpMode from SearchTheme
  • packages/search/src/index.ts:82 - Removed instructions from SearchConfig
  • packages/type/src/inquirer.ts:36 - Removed cancel() from Prompt type
  • packages/checkbox/src/index.ts:40 - Removed helpMode from CheckboxTheme
  • packages/checkbox/src/index.ts:100 - Removed instructions from CheckboxConfig
  • packages/select/src/index.ts:34 - Removed helpMode from SelectTheme
  • packages/select/src/index.ts:85 - Removed instructions from SelectConfig
  • packages/testing/src/index.ts:45 - Removed cancel() from render() return type

Files Modified

Source Code (6 files):

  • packages/inquirer/src/index.ts
  • packages/search/src/index.ts
  • packages/checkbox/src/index.ts
  • packages/select/src/index.ts
  • packages/type/src/inquirer.ts
  • packages/testing/src/index.ts

Test Files (5 files):

  • packages/checkbox/checkbox.test.ts - Updated tests + deleted 2 duplicate tests
  • packages/select/test/select.test.ts - Updated tests to use new APIs
  • packages/core/core.test.ts - Updated to use AbortController
  • packages/prompts/prompts.test.ts - Updated type tests
  • packages/search/search.test.ts - Updated tests to use new APIs

Documentation (3 files):

  • packages/select/README.md - Removed deprecated feature references
  • packages/search/README.md - Removed deprecated feature references
  • packages/checkbox/README.md - Removed deprecated feature references

Test Results

  • 276 of 277 tests passing (1 unrelated TTY test failure in non-TTY environment)
  • ✅ TypeScript compiles without errors
  • ✅ All linting passes (ESLint, Oxlint, Prettier)

Migration Guide

For users upgrading to this version:

// Before
inquirer.prompt([
  { type: 'list', ... }
]);

// After
inquirer.prompt([
  { type: 'select', ... }
]);
// Before
await select({
  message: 'Choose',
  choices: [...],
  instructions: false,
});
await select({
  message: 'Choose',
  choices: [...],
  theme: { helpMode: 'never' }
});

// After
await select({
  message: 'Choose',
  choices: [...],
  theme: {
    style: {
      keysHelpTip: () => undefined
    }
  }
});
// Before
const prompt = select({ message: 'Choose', choices: [...] });
prompt.cancel();

// After
const controller = new AbortController();
const prompt = select(
  { message: 'Choose', choices: [...] },
  { signal: controller.signal }
);
controller.abort();

BREAKING CHANGE: Removed all deprecated APIs:
- Removed `list` prompt alias (use `select` instead)
- Removed `helpMode` theme property (use `theme.style.keysHelpTip` instead)
- Removed `instructions` config property (use `theme.style.keysHelpTip` instead)
- Removed `cancel()` method on prompt return types (use AbortSignal instead)

This removes 9 deprecated items across 6 packages:
- packages/inquirer: Removed `list` alias
- packages/search: Removed `helpMode` and `instructions`
- packages/checkbox: Removed `helpMode` and `instructions`
- packages/select: Removed `helpMode` and `instructions`
- packages/type: Removed `cancel()` method
- packages/testing: Removed `cancel()` method

Also updated tests to use new APIs and removed deprecated feature
references from documentation.
@SBoudrias SBoudrias force-pushed the chore/rm-deprecated branch from faaf6cb to 211e27e Compare October 28, 2025 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants