patch-package icon indicating copy to clipboard operation
patch-package copied to clipboard

chore: replace chalk with picocolors

Open roli-lpci opened this issue 9 months ago • 1 comments

Summary

  • Replace chalk (136KB + deps) with picocolors (3.8KB, zero deps) for terminal color output
  • All chained style calls converted to function composition (e.g. chalk.red.bold(x) → pc.red(pc.bold(x)))
  • chalk.grey mapped to pc.gray, chalk.blueBright mapped to pc.blueBright

Changes

  • package.json: swap chalk dep for picocolors
  • src/applyPatches.ts: replace chalk usage (heaviest file — error messages, warnings, status output)
  • src/createIssue.ts: replace chalk.bold
  • src/detectPackageManager.ts: replace chalk error formatting
  • src/index.ts: replace chalk in help text
  • src/makePatch.ts: replace chalk progress indicators and error messages
  • src/makeRegExp.ts: replace chalk error formatting
  • src/patch/read.ts: replace chalk error formatting
  • src/rebase.ts: replace chalk status and error messages
  • src/stateFile.ts: replace chalk info messages

Testing

  • TypeScript compilation: zero errors
  • Unit tests: all passing (467 tests across 9 suites)
  • Integration tests: pre-existing failure unrelated to this change (same on master)

Addresses #499

roli-lpci avatar Feb 26 '26 19:02 roli-lpci

@ds300 LGTM

james-pre avatar Apr 28 '26 19:04 james-pre