LTRAC-911: ref(cli) - Standardize interactive prompts on @inquirer/prompts#3054
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bundle Size ReportComparing against baseline from
Per-Route First Load JS
|
Unlighthouse Performance Comparison — VercelComparing PR preview deployment Unlighthouse scores vs production Unlighthouse scores. Summary ScoreAggregate score across all categories as reported by Unlighthouse.
Category Scores
Core Web Vitals
|
|
🍹 Can you build the CLI locally and provide a proof of life here for all the CLI commands that changed? |
|
Proof of life: |
…ompts
Replace all `consola.prompt` usages with `@inquirer/prompts` (confirm/input/select/
checkbox) so the CLI uses one prompt library; consola is retained for logging
only. Converts create's locale multiselect to an inquirer `checkbox` with a
`validate` (drops the consola cast + recursion hack), and migrates the prompts in
login, channel link/update, project, deploy, channel-site-flow, and
commerce-hosting. Specs updated to mock `@inquirer/prompts`.
Chosen over consola because consola.prompt has no masked input (login's access
token uses `password({ mask: true })`), plus inquirer's validate/theming.
Stacked on #3051 (channel link).
Refs LTRAC-911
Co-Authored-By: Claude <noreply@anthropic.com>
…tput
Stray blank lines came from leading/trailing newlines and `consola.log('')`
calls, which the fancy reporter timestamps as their own log line. Collapse
multi-line "Next steps" output into a single `consola.log` call (one
timestamp, predictable spacing) and drop the manual blank-line separators
after prompts. `project list` now joins its project blocks into one log call
so each blank separator isn't timestamped.
Refs LTRAC-911
Co-Authored-By: Claude <noreply@anthropic.com>
71fea65 to
eb38881
Compare
…rompts` (#3054) * LTRAC-911: ref(cli) - Standardize interactive prompts on @inquirer/prompts Replace all `consola.prompt` usages with `@inquirer/prompts` (confirm/input/select/ checkbox) so the CLI uses one prompt library; consola is retained for logging only. Converts create's locale multiselect to an inquirer `checkbox` with a `validate` (drops the consola cast + recursion hack), and migrates the prompts in login, channel link/update, project, deploy, channel-site-flow, and commerce-hosting. Specs updated to mock `@inquirer/prompts`. Chosen over consola because consola.prompt has no masked input (login's access token uses `password({ mask: true })`), plus inquirer's validate/theming. Stacked on #3051 (channel link). Refs LTRAC-911 Co-Authored-By: Claude <noreply@anthropic.com> * LTRAC-911: style(cli) - Standardize spacing on prompts and command output Stray blank lines came from leading/trailing newlines and `consola.log('')` calls, which the fancy reporter timestamps as their own log line. Collapse multi-line "Next steps" output into a single `consola.log` call (one timestamp, predictable spacing) and drop the manual blank-line separators after prompts. `project list` now joins its project blocks into one log call so each blank separator isn't timestamped. Refs LTRAC-911 Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
Linear: LTRAC-911
Part of LTRAC-138 — consolidating
create-catalystinto thecatalystCLI (Phase 3.1).What/Why?
The consolidated CLI mixed two prompt libraries — often in the same file (
login.ts,create.ts,commerce-hosting.tseach used both). This standardizes all interactive prompts on@inquirer/prompts;consolais kept for logging only.Why inquirer over consola:
consola.promptonly supportstext/confirm/select/multiselect— no masked input, butlogincollects the access token viapassword({ mask: true }). Standardizing on consola would have leaked the token in plaintext. inquirer also gives inlinevalidate(now used for the ≤4 additional locales and project-name validation) and theming (create's locale picker).Changes
consola.prompt(...)→ inquirer:confirm/input/select/checkbox.confirm({ message, default }),input({ message }),select({ message, choices: [{ name, value, description }] }),checkbox(...).login.ts,channel-site-flow.ts,commerce-hosting.ts,commands/{create,channel,project,deploy}.ts.create's additional-locales picker is now an inquirercheckboxwith avalidate(≤4) — removes the oldas unknown as string[]cast + recursion-on-overflow hack. UX improvement (inline re-prompt instead of a warning + restart).value(number), droppingString()/Number()round-trips.@inquirer/promptsinstead of spying onconsola.prompt; assertions that inspected prompt args were retargeted to the inquirer calls (behavior assertions unchanged).After:
grep -rn "consola.prompt" src/cli→ empty.Testing
pnpm typecheck,pnpm lint, and the fullpnpm test(320 tests) all pass inpackages/catalyst. Verified masked token entry inloginis preserved.Notes
This standardizes the prompt library (the ticket's scope). Broader visual cohesion across prompts (inquirer) + logging (consola, ~340 calls) + spinners (yocto) is a separate, larger concern —
@clack/promptswas evaluated and deemed not worth a CLI-wide migration (it can't replace consola's logging, so it wouldn't remove the mix). A scoped follow-up could revisit clack for the interactive create/onboarding flows only.Migration
None — purely an internal prompt-library swap; user-facing prompt behavior is unchanged (the locale picker is slightly improved).