Changelog
All notable changes to @mongez/copper are documented here. The format follows Keep a Changelog and this project follows Semantic Versioning.
[2.1.2] — Docs lead with chaining
Changed
- Reframed README, colors SKILL.md, recipes SKILL.md, utilities SKILL.md, and llms-full.txt so chaining (
colors.red.bold(x)) is the primary call style in every example. Composition (colors.red(colors.bold(x))) is documented as an alternative with one explicit use case — runtime-decided color names viacolors[name](x)typed byColorName. - No code changes; chains and composition still produce identical ANSI output.
[2.1.1] — CI matrix fix
Changed
- Dropped Node 18 from the CI matrix (Node 18 reached EOL on April 30, 2025, and
vitest@3transitive dependencies fail to install cleanly there). Matrix is now Node 20 + Node 22 on Ubuntu, plus Node 20 on Windows.
[2.1.0] — Chainable colors
Added
- Chalk-style chaining on every color and modifier —
colors.red.bold("hi")is now equivalent tocolors.red(colors.bold("hi")). Both produce identical ANSI output. Chains compose lazily and are stateless:const danger = colors.red.bold.underline;is a plain callable formatter you can store, pass, and reuse. - Exported
ChainFormattertype — the recursiveFormatter & { [K in ColorName]: ChainFormatter }shape that powers chaining. - Exported
COLOR_NAMEStuple — the single source of truth forColorName. - 6 new vitest cases covering chain composition, multi-step chains, independence, disabled-instance chains, and meta-key isolation. Total: 44 tests.
Changed
ColorNameis now derived from theCOLOR_NAMESconst tuple instead of fromkeyof Colors(which was self-referential). The resulting union is identical to v2.0.0.- Dropped
@vitest/coverage-v8dev dep and thetest:coveragescript — it pulled a postinstall that broke on Node 18 CI.yarn teststill produces the same suite output; add coverage back on a per-project basis.
Fixed
bgIndigoBrightclose sequence was\x1b[39m(fg reset) instead of\x1b[49m(bg reset). Background reset now correctly emits CSI 49.
[2.0.0] — Major rewrite
Breaking changes
- Renamed
colors.brown2,colors.brown2Bright,colors.bgBrown2,colors.bgBrown2Bright→brown,brownBright,bgBrown,bgBrownBright. The2suffix was leftover scaffolding; the new names match what the v1 README documented. - Renamed
colors.limeGreen,colors.limeGreenBright,colors.bgLimeGreen,colors.bgLimeGreenBright→lime,limeBright,bgLime,bgLimeBright. Same reason. displayLoadingBar(iter, delay)now returns{ promise, stop }instead ofvoid. v1 had no way to cancel the interval. Prefer the newprogress({ total })API.displayThreeDotsAnimation(iter, delay)now returns aSpinnerHandle. v1 ran forever with no stop hook. Prefer the newspinner({ text }).start()API.FORCE_COLOR=0andFORCE_COLOR=falsenow disable colors (v1 enabled colors as long as the variable was defined).ttyis loaded lazily — importing@mongez/copperin a browser bundle no longer crashes.
Added
spinner— animated single-line spinner withstart/update/stop/succeed/fail/warn/infofinalizers. TTY-aware fallback for CI / piped output. Interval isunref’d.progress— known-total progress bar withtick/update/done/stopand template tokens (:bar:current:total:percent:elapsed:eta).log+createLogger— themed CLI logger withdebug/info/success/warn/error, level filtering, per-level theme overrides, custom output stream, and Error stack serialization.box— Unicode / ASCII bordered text with single / double / round / bold / ascii styles, padding, margin, alignment, and border color. ANSI-aware width measurement so colored content aligns correctly.link— OSC-8 clickable terminal hyperlink withtext (url)ortext-onlyfallback.stripAnsi— remove every ANSI escape including OSC-8 hyperlinks.symbols—tick/cross/info/warning/arrow/pointer/ellipsis/bullet/lineand Braille spinner frames, with ASCII fallbacks on legacy Windowscmd.exe.detectColorSupport()— re-evaluate color support against the current env/argv (in addition to the cachedisColorSupportedboolean).- Exported types:
Colors,ColorName,Formatter,BoxStyle,BoxOptions,SpinnerHandle,SpinnerOptions,ProgressHandle,ProgressOptions,LogLevel,Logger,LoggerOptions,SymbolName. - 38 vitest cases covering colors, support detection, strip-ansi, link, box, log, spinner, and progress.
- CI matrix on Node 18 / 20 / 22 on Ubuntu and Node 20 on Windows.
- Per-feature skill docs under
skills/(overview, colors, spinner, progress, log, box, utilities, recipes) plusllms.txtandllms-full.txtfor AI agent consumption.
Changed
createColors(enabled)now returns a type-recoverable object exported asColors. The factory is re-exposed on every instance (colors.createColors(false)).- Color-support detection has a new priority order documented in the overview skill and README.
[1.0.1] — Initial release
colorsobject with the 20+ palette (under v1 names —brown2*,limeGreen*).createColors(enabled)factory.isColorSupportedflag.displayLoadingBaranddisplayThreeDotsAnimationlegacy animations.