From 42f02712a0e6fa81aa281ab21bd14abd5ba85ae2 Mon Sep 17 00:00:00 2001 From: Jakob Heuser Date: Mon, 5 Oct 2026 20:23:33 -0700 Subject: [PATCH] fix(wizard): colour the install summary with chalk and drop picocolors --- .changeset/summary-uses-chalk.md | 5 +++++ packages/cli/package.json | 1 - packages/cli/src/wizard/steps/summary.ts | 19 ++++++++++++------- pnpm-lock.yaml | 3 --- 4 files changed, 17 insertions(+), 11 deletions(-) create mode 100644 .changeset/summary-uses-chalk.md diff --git a/.changeset/summary-uses-chalk.md b/.changeset/summary-uses-chalk.md new file mode 100644 index 00000000..6d7fc3c6 --- /dev/null +++ b/.changeset/summary-uses-chalk.md @@ -0,0 +1,5 @@ +--- +"@taskless/cli": patch +--- + +The install summary shown by `taskless init` now decides whether to colour its output the same way the rest of the CLI does, rather than running its own detection that could disagree (for example, colouring output when `TERM` is unset while the rest of the CLI prints plain text). `picocolors` is no longer a dependency. diff --git a/packages/cli/package.json b/packages/cli/package.json index 51f6afdf..6cb784b3 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -61,7 +61,6 @@ "citty": "^0.1.6", "jose": "^6.2.2", "openapi-fetch": "^0.17.0", - "picocolors": "^1.1.1", "posthog-node": "^5.28.11", "smol-toml": "^1.6.1", "sprintf-js": "^1.1.3", diff --git a/packages/cli/src/wizard/steps/summary.ts b/packages/cli/src/wizard/steps/summary.ts index 5687864a..4d63d242 100644 --- a/packages/cli/src/wizard/steps/summary.ts +++ b/packages/cli/src/wizard/steps/summary.ts @@ -1,5 +1,10 @@ import { confirm, log } from "@clack/prompts"; -import pc from "picocolors"; +import chalk from "chalk"; + +// Sets `chalk.level` from the real terminal on import. This module renders +// colour, so it establishes that itself rather than inheriting it from +// whichever caller happened to load `wizard/intro.ts` first. +import "../../util/color"; import type { InstallDiff } from "../../install/state"; import { ask } from "../ask"; @@ -18,22 +23,22 @@ export async function renderSummaryAndConfirm( if (!hasAnyChange && entry.unchanged.skills.length === 0) continue; - lines.push(pc.bold(entry.target)); + lines.push(chalk.bold(entry.target)); for (const skill of entry.additions.skills) { - lines.push(` ${pc.green("+")} skill ${skill}`); + lines.push(` ${chalk.green("+")} skill ${skill}`); } for (const command of entry.additions.commands) { - lines.push(` ${pc.green("+")} command ${command}`); + lines.push(` ${chalk.green("+")} command ${command}`); } for (const skill of entry.removals.skills) { - lines.push(` ${pc.red("-")} skill ${skill}`); + lines.push(` ${chalk.red("-")} skill ${skill}`); } for (const command of entry.removals.commands) { - lines.push(` ${pc.red("-")} command ${command}`); + lines.push(` ${chalk.red("-")} command ${command}`); } if (entry.unchanged.skills.length > 0) { lines.push( - ` ${pc.dim("·")} ${pc.dim( + ` ${chalk.dim("·")} ${chalk.dim( `${entry.unchanged.skills.length} skill(s) unchanged` )}` ); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 93c7feeb..67578bc3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -92,9 +92,6 @@ importers: openapi-fetch: specifier: ^0.17.0 version: 0.17.0 - picocolors: - specifier: ^1.1.1 - version: 1.1.1 posthog-node: specifier: ^5.28.11 version: 5.28.11