Incremental migration
Move from chalk to roundel/chalk with one import, then to semantic tokens a file at a time, with both reading the same policy throughout.
Step one: the import
- import chalk from 'chalk';
+ import chalk from 'roundel/chalk';roundel/chalk passes chalk 6.0.0's own suite, so every call keeps its output. What changes is
underneath: the level now comes from the policy, so NO_COLOR is honoured and --no-color
beats an ambient FORCE_COLOR (Compatibility).
npx burgee migrate --dry-run lists every import it would rewrite, and npx burgee migrate
rewrites them (Migrate).
Step two: meanings, a file at a time
- import chalk from 'roundel/chalk';
- console.error(chalk.red(`missing ${chalk.bold('--name')}`));
+ import { error, flag } from 'roundel/tokens';
+ console.error(error(`missing ${flag('--name')}`));Tokens are plain until the program calls fly() once at startup; add that before the first
file moves. From then on both styles read the same policy, so a file on roundel/chalk and a
file on tokens never disagree about whether this terminal gets colour.
Step three: drop chalk
npm uninstall chalk
npm ls chalknpm ls shows what still pulls chalk in transitively. An overrides entry pointing chalk at
roundel would resolve to the package root, not to roundel/chalk, so it cannot move those
copies; they move when the packages that depend on chalk do.
A theme for light terminals
Declare the background your users read on, let roundel pick the brand shade that reads on it, and check the result before it ships.
roundel
Every export of roundel, with its signature and doc comment: channels, luminance, contrast, reportTheme, AA, AAA and 27 more, plus 17 types.