Skip to content

fix(wizard): colour the install summary with chalk and drop picocolors - #458

Merged
theCodeDrift merged 1 commit into
mainfrom
worktree-449---can-we
Oct 6, 2026
Merged

theCodeDrift merged 1 commit into
mainfrom
worktree-449---can-we

Conversation

@theCodeDrift

Copy link
Copy Markdown
Member

The install summary in src/wizard/steps/summary.ts was the only module colouring output with picocolors; everything else uses chalk, whose level src/util/color.ts sets from the terminal the CLI is actually running in. picocolors runs its own detection, which colours output whenever stdout is a TTY and TERM isn't dumb, or whenever CI is set. util/color.ts returns level 0 for an unset TERM or a non-TTY, so the summary could print colour while the rest of the CLI printed plain text.

  • summary.ts now uses chalk.bold/green/red/dim (the issue didn't mention dim, which was also in use), and imports ../../util/color directly, matching intro.ts and reload-notice.ts, so the level is set without relying on another module having loaded first.
  • picocolors is removed from packages/cli/package.json. It remains in the lockfile only through dev tooling (@changesets/cli), not the CLI.
  • Patch changeset added.

pnpm typecheck, pnpm lint (including pnpm cli check), and the CLI test suite (114 files, 2014 tests) pass locally.

Fixes #449

@theCodeDrift

Copy link
Copy Markdown
Member Author

@claude /review

@claude

claude Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Claude finished @theCodeDrift's task in 48s —— View job


Review mode: incremental — read 0 prior review thread(s) before reviewing.

.prior-review.json contained no review threads, review summaries, or prior top-level comments (just the @claude /review trigger itself) — this is the first review of this PR.

  • Read .prior-review.json
  • Fetch PR diff and metadata (gh pr diff, gh pr view)
  • Review changed files for correctness, security, performance, test adequacy, clarity
  • Check for inline issues to post
  • Post final summary

Assessment

This is a clean, minimal, well-scoped fix. I reviewed all 4 changed files and the whole of packages/cli/src/util/color.ts and packages/cli/src/wizard/intro.ts for comparison.

  • summary.ts: the pc → chalk swap is a faithful 1:1 mapping (bold/green/red/dim), and import "../../util/color" is placed exactly as in wizard/intro.ts, so chalk.level is set from the real terminal regardless of import order. Confirmed there are no other picocolors/pc. references left anywhere under packages/cli/src.
  • package.json / pnpm-lock.yaml: picocolors is removed cleanly as a direct dependency; chalk (^5.6.2) is already present in package.json, so no new dependency was needed.
  • Changeset: present, correctly scoped as patch (consistent with the 0.y.z → additions/fixes are patch guidance), and accurately describes the user-visible behavior change.
  • Tests: no existing test asserts on the specific color library's output for renderSummaryAndConfirm/buildRemovalConfirmMessage (checked wizard-steps.test.ts), so this swap doesn't risk breaking coverage, though it also means there's no regression test that would catch a reintroduction of a second color-detection path. Given the small, mechanical nature of the fix and that the pattern now matches intro.ts/reload-notice.ts, I don't think a new test is required here.

No new findings. Nothing carried over from a prior review since none exists.

@theCodeDrift

Copy link
Copy Markdown
Member Author

Re: @claude — "Claude finished @theCodeDrift's task in 48s… This is a clean, minimal, well-scoped fix."
#458 (comment)

Thanks — no findings to address. Agreed that a test pinning the colour library would be guarding tool choice rather than behaviour, so none was added.

— AI Coding Agent

@theCodeDrift
theCodeDrift merged commit 057683c into main Oct 6, 2026
8 checks passed
@theCodeDrift
theCodeDrift deleted the worktree-449---can-we branch October 6, 2026 04:24
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.

Replace picocolors with chalk in the wizard summary

1 participant