chore: Remove all deprecated code #1873
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
listprompt alias → Useselectinsteadtheme.helpModeproperty → Usetheme.style.keysHelpTip(() => undefined)to hide helpconfig.instructionsproperty → Usetheme.style.keysHelpTip(...)for custom help textcancel()method on prompt return types → UseAbortSignalin context optionsChanges
Deprecated Items Removed (9 total)
packages/inquirer/src/index.ts:43- Removedlistaliaspackages/search/src/index.ts:30- RemovedhelpModefrom SearchThemepackages/search/src/index.ts:82- Removedinstructionsfrom SearchConfigpackages/type/src/inquirer.ts:36- Removedcancel()from Prompt typepackages/checkbox/src/index.ts:40- RemovedhelpModefrom CheckboxThemepackages/checkbox/src/index.ts:100- Removedinstructionsfrom CheckboxConfigpackages/select/src/index.ts:34- RemovedhelpModefrom SelectThemepackages/select/src/index.ts:85- Removedinstructionsfrom SelectConfigpackages/testing/src/index.ts:45- Removedcancel()from render() return typeFiles Modified
Source Code (6 files):
packages/inquirer/src/index.tspackages/search/src/index.tspackages/checkbox/src/index.tspackages/select/src/index.tspackages/type/src/inquirer.tspackages/testing/src/index.tsTest Files (5 files):
packages/checkbox/checkbox.test.ts- Updated tests + deleted 2 duplicate testspackages/select/test/select.test.ts- Updated tests to use new APIspackages/core/core.test.ts- Updated to use AbortControllerpackages/prompts/prompts.test.ts- Updated type testspackages/search/search.test.ts- Updated tests to use new APIsDocumentation (3 files):
packages/select/README.md- Removed deprecated feature referencespackages/search/README.md- Removed deprecated feature referencespackages/checkbox/README.md- Removed deprecated feature referencesTest Results
Migration Guide
For users upgrading to this version: