Skip to content

Replace chalk with picocolors#958

Open
roli-lpci wants to merge 1 commit intohttp-party:masterfrom
roli-lpci:chore/replace-chalk-with-picocolors
Open

Replace chalk with picocolors#958
roli-lpci wants to merge 1 commit intohttp-party:masterfrom
roli-lpci:chore/replace-chalk-with-picocolors

Conversation

@roli-lpci
Copy link

Summary

  • Replace chalk (v4, 5 transitive deps) with picocolors (v1, zero deps)
  • Fix ReferenceError: colors is not defined in the --no-panic error handler
  • Fix TypeError: logger.warning is not a function in the WebSocket proxy check

Changes

bin/http-server

  • require('chalk')require('picocolors')
  • Fix undefined colors variable references (lines 115-118) that caused crashes
    in the --no-panic error handler — colors was never imported, should have
    been chalk (now pc)
  • Fix logger.warning() call — the logger object has no .warning() method;
    changed to logger.info() which is the available output method

package.json

  • Remove chalk ^4.1.2
  • Add picocolors ^1.1.1

All color methods used (red, cyan, yellow, green, magenta, bold)
have exact equivalents in picocolors. Both libraries respect NO_COLOR and
FORCE_COLOR environment variables.

Testing

Asserts:  528 pass  0 fail  528 of 528 complete
Suites:    41 pass  0 fail    41 of 41 complete

Addresses #949

- Swap chalk v4 for picocolors (14x smaller, zero dependencies)
- Fix ReferenceError: colors is not defined (lines 115-118)
  The nopanic error handler referenced `colors` instead of the
  imported `chalk` variable, causing a crash on fatal errors
- Fix TypeError: logger.warning is not a function (line 233)
  The websocket proxy warning used `logger.warning()` which does
  not exist on the logger object; changed to `logger.info()`

Addresses http-party#949

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant