Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/summary-uses-chalk.md
Original file line number Diff line number Diff line change
@@ -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.
1 change: 0 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
19 changes: 12 additions & 7 deletions packages/cli/src/wizard/steps/summary.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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`
)}`
);
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading