Skip to content

Commit 1e4102c

Browse files
committed
fix: address review feedback on color palette
Remove turborepo references from JSDoc and test. Test now validates palette properties (no bg/white/grey/black/red colors) instead of asserting a specific color list.
1 parent 640a897 commit 1e4102c

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

lib/prefix-color-selector.spec.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,16 @@ describe('#ACCEPTABLE_CONSOLE_COLORS', () => {
181181
expect(PrefixColorSelector.ACCEPTABLE_CONSOLE_COLORS.length).toBeGreaterThan(1);
182182
});
183183

184-
it('uses the same colors and order as turborepo', () => {
185-
expect(PrefixColorSelector.ACCEPTABLE_CONSOLE_COLORS).toEqual([
186-
'cyan',
187-
'magenta',
188-
'green',
189-
'yellow',
190-
'blue',
191-
]);
184+
it('only includes colors that are visually distinct, semantically neutral, and lightweight', () => {
185+
const problematic = ['white', 'grey', 'black', 'red'];
186+
const colors = PrefixColorSelector.ACCEPTABLE_CONSOLE_COLORS;
187+
188+
for (const color of colors) {
189+
const lower = color.toLowerCase();
190+
expect(lower.startsWith('bg')).toBe(false);
191+
for (const bad of problematic) {
192+
expect(lower.startsWith(bad)).toBe(false);
193+
}
194+
}
192195
});
193196
});

lib/prefix-color-selector.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ export class PrefixColorSelector {
6666
/**
6767
* Colors used by `auto` selection and default cycling.
6868
*
69-
* Matches turborepo's palette: cyan, magenta, green, yellow, blue.
70-
* These are visually distinct on both dark and light terminal backgrounds
71-
* without carrying semantic meaning (unlike red → errors) or blending
72-
* into the default text color (unlike white/grey).
69+
* Each color is chosen to be visually distinct on both dark and light
70+
* terminal backgrounds, without carrying semantic meaning (e.g. red
71+
* implies errors) or blending into default text (e.g. white/grey).
72+
* Background colors are excluded to keep output lightweight.
7373
*
7474
* This list does NOT restrict manually specified colors — any valid Chalk
7575
* color name, hex value, or modifier can be passed via `--prefix-colors`.

0 commit comments

Comments
 (0)