Skip to content

LTRAC-911: ref(cli) - Standardize interactive prompts on @inquirer/prompts#3054

Merged
jorgemoya merged 2 commits into
alphafrom
jorgemoya/ltrac-911-standardize-prompt-library-across-the-consolidated-catalyst
Jun 22, 2026
Merged

LTRAC-911: ref(cli) - Standardize interactive prompts on @inquirer/prompts#3054
jorgemoya merged 2 commits into
alphafrom
jorgemoya/ltrac-911-standardize-prompt-library-across-the-consolidated-catalyst

Conversation

@jorgemoya

Copy link
Copy Markdown
Contributor

Linear: LTRAC-911
Part of LTRAC-138 — consolidating create-catalyst into the catalyst CLI (Phase 3.1).

Stacked on #3051 (catalyst channel link). Base is that branch so the diff shows only the prompt-standardization changes; re-target to alpha once #3051 merges.

What/Why?

The consolidated CLI mixed two prompt libraries — often in the same file (login.ts, create.ts, commerce-hosting.ts each used both). This standardizes all interactive prompts on @inquirer/prompts; consola is kept for logging only.

Why inquirer over consola: consola.prompt only supports text/confirm/select/multiselectno masked input, but login collects the access token via password({ mask: true }). Standardizing on consola would have leaked the token in plaintext. inquirer also gives inline validate (now used for the ≤4 additional locales and project-name validation) and theming (create's locale picker).

Changes

  • Converted every consola.prompt(...) → inquirer: confirm / input / select / checkbox.
    • confirm({ message, default }), input({ message }), select({ message, choices: [{ name, value, description }] }), checkbox(...).
    • Source: login.ts, channel-site-flow.ts, commerce-hosting.ts, commands/{create,channel,project,deploy}.ts.
  • create's additional-locales picker is now an inquirer checkbox with a validate (≤4) — removes the old as unknown as string[] cast + recursion-on-overflow hack. UX improvement (inline re-prompt instead of a warning + restart).
  • Channel pickers now use the channel id directly as the choice value (number), dropping String()/Number() round-trips.
  • Specs updated to mock @inquirer/prompts instead of spying on consola.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 full pnpm test (320 tests) all pass in packages/catalyst. Verified masked token entry in login is 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/prompts was 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).

@changeset-bot

changeset-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: eb38881

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
catalyst Ready Ready Preview, Comment Jun 22, 2026 7:21pm

Request Review

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Bundle Size Report

Comparing against baseline from 94c503e (2026-06-22).

Metric Baseline Current Delta
Total JS 435.4 kB 434.5 kB -0.9 kB (-0.2%)

Per-Route First Load JS

Route Baseline Current Delta
/(default)/(auth)/change-password/page 318.8 kB 317.5 kB -1.3 kB (-0.4%)
/(default)/(auth)/login/forgot-password/page 318 kB 316.7 kB -1.3 kB (-0.4%)
/(default)/(auth)/login/page 318.4 kB 317.2 kB -1.2 kB (-0.4%)
/(default)/(auth)/register/page 354.6 kB 353.3 kB -1.3 kB (-0.4%)
/(default)/(faceted)/brand/[slug]/page 330.5 kB 329.2 kB -1.3 kB (-0.4%)
/(default)/(faceted)/category/[slug]/page 339 kB 337.6 kB -1.4 kB (-0.4%)
/(default)/(faceted)/search/page 330.5 kB 329.2 kB -1.3 kB (-0.4%)
/(default)/[...rest]/page 313.5 kB 312.3 kB -1.2 kB (-0.4%)
/(default)/account/addresses/page 358 kB 356.7 kB -1.3 kB (-0.4%)
/(default)/account/orders/[id]/page 321.6 kB 320.4 kB -1.2 kB (-0.4%)
/(default)/account/orders/page 322.6 kB 321.3 kB -1.3 kB (-0.4%)
/(default)/account/settings/page 329.2 kB 327.9 kB -1.3 kB (-0.4%)
/(default)/account/wishlists/[id]/page 336.4 kB 335.3 kB -1.1 kB (-0.3%)
/(default)/account/wishlists/page 331.5 kB 330.3 kB -1.2 kB (-0.4%)
/(default)/blog/[blogId]/page 313.5 kB 312.3 kB -1.2 kB (-0.4%)
/(default)/blog/page 314.5 kB 313.3 kB -1.2 kB (-0.4%)
/(default)/cart/page 334.3 kB 333.1 kB -1.2 kB (-0.4%)
/(default)/compare/page 325.7 kB 324.4 kB -1.3 kB (-0.4%)
/(default)/gift-certificates/balance/page 317.5 kB 316.2 kB -1.3 kB (-0.4%)
/(default)/gift-certificates/page 313.5 kB 312.3 kB -1.2 kB (-0.4%)
/(default)/gift-certificates/purchase/page 357.1 kB 355.8 kB -1.3 kB (-0.4%)
/(default)/page 330.7 kB 329.4 kB -1.3 kB (-0.4%)
/(default)/product/[slug]/page 385.4 kB 384.2 kB -1.2 kB (-0.3%)
/(default)/webpages/[id]/contact/page 355.5 kB 354.2 kB -1.3 kB (-0.4%)
/(default)/webpages/[id]/normal/page 321.6 kB 320.4 kB -1.2 kB (-0.4%)
/(default)/wishlist/[token]/page 326.3 kB 325.2 kB -1.1 kB (-0.3%)
/maintenance/page 307.1 kB 306.4 kB -0.7 kB (-0.2%)

Threshold: 5% increase. Routes with ⚠️ exceed the threshold.

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Unlighthouse Performance Comparison — Vercel

Comparing PR preview deployment Unlighthouse scores vs production Unlighthouse scores.

Summary Score

Aggregate score across all categories as reported by Unlighthouse.

Prod Desktop Prod Mobile Preview Desktop Preview Mobile
Score 90 93 92 95

Category Scores

Category Prod Desktop Prod Mobile Preview Desktop Preview Mobile
Performance 70 88 74 84
Accessibility 95 98 95 92
Best Practices 100 100 100 100
SEO 100 88 100 100

Core Web Vitals

Metric Prod Desktop Prod Mobile Preview Desktop Preview Mobile
LCP 4.9 s 3.9 s 3.5 s 4.5 s
CLS 0.039 0 0.001 0
FCP 1.2 s 1.2 s 1.1 s 1.1 s
TBT 0 ms 10 ms 0 ms 10 ms
Max Potential FID 50 ms 60 ms 60 ms 80 ms
Time to Interactive 4.9 s 3.9 s 6.1 s 4.7 s

Full Unlighthouse report →

@jorgemoya jorgemoya marked this pull request as ready for review June 17, 2026 21:35
@jorgemoya jorgemoya requested a review from a team as a code owner June 17, 2026 21:35
@chanceaclark

Copy link
Copy Markdown
Contributor

🍹 Can you build the CLI locally and provide a proof of life here for all the CLI commands that changed?

Base automatically changed from jorgemoya/ltrac-908-add-catalyst-channel-connect-to-bootstrap-envlocal-from-a to alpha June 22, 2026 16:53
@jorgemoya

jorgemoya commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Proof of life:

~/dev/catalyst/core on  jorgemoya/ltrac-911-standardize-prompt-library-across-the-consolidated-catalyst [?] took 4s
❯ node ../packages/catalyst/dist/cli.js channel link --api-host api.staging.zone --cli-api-origin https://cxm-stg.bigcommerceapp.com
◢ @bigcommerce/catalyst v1.0.0-alpha.5                                                                                                                 1:49:39 PM

? Which channel would you like to link?
❯ My Catalyst Storefront
  Test Store
Catalyst

jorgemoya and others added 2 commits June 22, 2026 14:00
…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>
@jorgemoya jorgemoya force-pushed the jorgemoya/ltrac-911-standardize-prompt-library-across-the-consolidated-catalyst branch from 71fea65 to eb38881 Compare June 22, 2026 19:20
@jorgemoya jorgemoya merged commit 520f90e into alpha Jun 22, 2026
22 checks passed
@jorgemoya jorgemoya deleted the jorgemoya/ltrac-911-standardize-prompt-library-across-the-consolidated-catalyst branch June 22, 2026 19:38
jorgemoya added a commit that referenced this pull request Jun 22, 2026
…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>
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