From 273cad51c26b27d4572712654bffaf5dfac4c0d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20HOUZ=C3=89?= Date: Mon, 24 Aug 2026 01:49:42 +0200 Subject: [PATCH 1/2] Remove picocolors, add native util.styleText facade (src/style.ts) - Add src/style.ts as the sole call site for node:util's styleText, mirroring the render/terminal.ts convention for Bun-native APIs. - Add src/style.d.ts ambient augmentation: @types/node 25.2.3 does not yet declare styleText, though Bun 1.4 implements it at runtime. - Migrate all 9 files importing picocolors directly (render.ts, render/highlight.ts, render/summary.ts, render/team-pick.ts, tui.ts, upgrade.ts, api.ts, github-code-search.ts) plus test fixtures. - Nested style compositions (e.g. pc.bold(pc.yellow(x))) are converted to style.style([...], x) using styleText's native array-of-formats support, verified byte-identical to picocolors via golden-master tests in src/style.test.ts (bold/dim share the same SGR reset code, so naive chaining is not always safe for composed styles). - Remove picocolors from package.json dependencies. - Update AGENTS.md and .github/skills/documentation.md conventions. Closes #193 --- .github/skills/documentation.md | 2 +- AGENTS.md | 6 +- bun.lock | 1 - github-code-search.ts | 47 +++---- package.json | 3 +- src/api.ts | 8 +- src/render.ts | 132 ++++++++++--------- src/render/highlight.test.ts | 32 ++--- src/render/highlight.ts | 216 ++++++++++++++++---------------- src/render/summary.ts | 6 +- src/render/team-pick.test.ts | 2 +- src/render/team-pick.ts | 15 +-- src/render/terminal.test.ts | 16 +-- src/style.d.ts | 63 ++++++++++ src/style.test.ts | 110 ++++++++++++++++ src/style.ts | 41 ++++++ src/test-setup.ts | 7 +- src/tui.ts | 4 +- src/upgrade.ts | 4 +- 19 files changed, 474 insertions(+), 241 deletions(-) create mode 100644 src/style.d.ts create mode 100644 src/style.test.ts create mode 100644 src/style.ts diff --git a/.github/skills/documentation.md b/.github/skills/documentation.md index e0c1578..f2b3eb3 100644 --- a/.github/skills/documentation.md +++ b/.github/skills/documentation.md @@ -29,7 +29,7 @@ Custom components live in `docs/.vitepress/theme/`: 1. Locate the `.vue` file above. 2. Follow the existing scoped `