refactor: migrate all prompts from inquirer to @inquirer/prompts - #8551
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (1)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. Your free on-demand review promotion remains active until October 9, 2026 at 6:00 PM UTC. 📝 SummarySummary by CodeRabbit
WalkthroughThe CLI replaces legacy Inquirer prompt calls with direct functions from Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Refactor Suggested reviewers: Merge Risk: ⚪ Minimal · up to The prompt dependency migration does not leave the manifest and lockfile out of sync, so the documented CI install workflow is not blocked. No concrete merge-blocking impact is established by the supplied context. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 45 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
commit: |
|
@coderabbitai review |
✅ Action performedReview finished.
|
ece6da4 to
7bc8e5d
Compare
Replace every inquirer.prompt call with the matching @inquirer/prompts function and drop inquirer, @types/inquirer and the direct @inquirer/search dependency. confirmPrompt no longer swallows errors, so Ctrl+C reaches the central ExitPromptError handling. The 'did you mean' suggestion prompts in the root command and in `recipes` now use an AbortSignal timeout instead of closing the prompt UI, which crashed the CLI with ERR_USE_AFTER_CLOSE whenever the user answered before the timeout. Tests that mocked inquirer.prompt now mock @inquirer/prompts, and the env/recipes prompt snapshots are updated for the new rendering.
7bc8e5d to
21a4a25
Compare
|
@coderabbitai review |
|
Summary
Stacked on #8549, so review that first. This PR moves every remaining prompt off
inquirer@8to@inquirer/promptsand removesinquirer,@types/inquirerand the direct@inquirer/searchdependency.rxjsandlodashdrop out of the install as a result.Install size (packed tarball,
--ignore-scripts, macOS arm64):main342 MB, this stack 288 MB (−16%), 65 fewer packages, about 7,700 fewer files.What changed
Details
- All 58 `inquirer.prompt` calls in 30 files now use `select`, `input`, `confirm` or `password`: - `filter` is applied to the returned value, because the new prompts don't support it. - Prompts that asked several questions at once now ask them one after another. - Each conversion keeps the original defaults and validators. - `confirmPrompt` no longer catches every error and exits 0. Ctrl+C now reaches the central handler added in #8549. - "Did you mean" (for mistyped commands and recipe names) works as before: answering yes runs the suggestion, and answering no or waiting 10 seconds exits with the usual hint. The 10-second timeout now uses the prompt's built-in `AbortSignal` support instead of force-closing inquirer's internal UI, which is what caused the crash described below. - Tests that mocked `inquirer.prompt` now mock `@inquirer/prompts`. The shared helper is `mockConfirm()` / `spyOnConfirm()`. - Updated snapshots: `env:list` ×2 and the recipes suggestion. Only escape codes changed.Behavior changes
ERR_USE_AFTER_CLOSE), because the timeout closed a prompt that was already closed. That no longer happens.mainexits 13 and printsWarning: Detected unsettled top-level await.false.✔instead of?, and active prompts show a key-hint line.