Migrate rush-lib from deprecated inquirer to @inquirer/* modular packages#5775
Draft
Migrate rush-lib from deprecated inquirer to @inquirer/* modular packages#5775
inquirer to @inquirer/* modular packages#5775Conversation
Agent-Logs-Url: https://github.com/microsoft/rushstack/sessions/489f4c8b-19ff-4dd2-9198-b68f948590c4 Co-authored-by: dmichon-msft <[email protected]>
…ynamic imports Agent-Logs-Url: https://github.com/microsoft/rushstack/sessions/489f4c8b-19ff-4dd2-9198-b68f948590c4 Co-authored-by: dmichon-msft <[email protected]>
Agent-Logs-Url: https://github.com/microsoft/rushstack/sessions/489f4c8b-19ff-4dd2-9198-b68f948590c4 Co-authored-by: dmichon-msft <[email protected]>
Copilot created this pull request from a session on behalf of
dmichon-msft
April 16, 2026 00:37
View session
dmichon-msft
requested changes
Apr 16, 2026
| import type { Interface } from 'node:readline'; | ||
|
|
||
| // Modified from the choice list prompt in inquirer: | ||
| // https://github.com/SBoudrias/Inquirer.js/blob/inquirer%407.3.3/packages/inquirer/lib/prompts/list.js |
Contributor
There was a problem hiding this comment.
@copilot I had thought this prompt might do something special, but it sounds like the new @inquirer/search prompt is probably equivalent? In which case, go ahead and use that.
Contributor
Author
There was a problem hiding this comment.
Done in e74a019. SearchListPrompt.ts is deleted entirely — InteractiveUpgrader now calls @inquirer/search directly, passing a synchronous source function that filters the static project list by plain package name. @inquirer/core and figures are removed as direct dependencies.
Agent-Logs-Url: https://github.com/microsoft/rushstack/sessions/f1344299-0cfc-4f05-a56e-7808031c327e Co-authored-by: dmichon-msft <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Replaces the deprecated monolithic
inquirerpackage with the new@inquirer/*scoped packages, using only the specific prompt-type packages actually consumed. All packages useawait import()(dynamic import) rather than static imports because every@inquirer/*package ships ESM-only ("type": "module"), which would break the CJS Jest environment if statically required.Package changes (
libraries/rush-lib)@inquirer/search,@inquirer/select,@inquirer/input,@inquirer/confirm,@inquirer/checkboxinquirer,@types/inquirer,figuresnonbrowser-approved-packages.jsonupdated accordinglySearchListPrompt.ts— deletedThe custom searchable list prompt is replaced entirely by the off-the-shelf
@inquirer/searchprompt, which provides equivalent functionality.SearchListPrompt.tsis removed.InteractiveUpgrader.tsReplaced
new Prompt({ list: SearchListPrompt }).run([…])with a directawait search({…})call from@inquirer/search. A synchronoussourcefunction filters the static project list by plain package name; thenamefield remains ANSI-colored for display whileshortholds the plain name used for filtering and the answer summary.ChangeAction.tsReplaced
inquirer.createPromptModule()and thepromptModuleparameter threading through all private methods with inline dynamic imports at each call site. AllpromptModule: InquirerType.PromptModuleparameters removed.InteractiveUpgradeUI.tsReplaced
inquirer.prompt([{ type: 'checkbox', … }])with@inquirer/checkboxandnew inquirer.Separator()with@inquirer/checkbox's re-exportedSeparator. The@inquirer/checkboxmodule is dynamically imported at the top ofupgradeInteractive();unselectableandcreateChoiceshelpers are defined as closures inside it to close over the runtimeSeparatorclass.