-
Notifications
You must be signed in to change notification settings - Fork 2.7k
refactor: replace chalk with smaller alternative #5983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Great! |
Hi @webdiscus , quick heads up: we just encounter one issue in our deployment process after the last pm2 release. It seems like Rolling back to: |
Hello @cristianst, probably the issue is in the "old" |
Fixes Unitech#5984 Fixes Unitech#5983 (comment) Also adds integrity hashes. Created by running the following command: rm bun.lock package-lock.json && npm install --package-lock-only && bun install --lockfile-only
@cristianst, I can't reproduce the issue with Here is the repo test-pm2-deploy-docker to test Note The exact same PM2 version (6.0.6) is installed both locally and in the Docker container. Info
Which version of Node.js is currently installed? "engines": {
"node": ">=16.0.0"
}, Do you use NVM to manage Node.js versions? |
Thanks for verifying, @webdiscus. I'm afraid we're still using an older version of Node (10.x). I know, it's pretty outdated… we're already working on it. That said, despite the old Node version, In fact, there's already a PR addressing this: #5985. Pretty sure this might solve the issue. |
@cristianst, @jeremyschlatter, @Unitech Breakdown of the error
|
I was skeptical that this was the cause, but indeed it is. A simple way to verify is to compare the output of these commands:
You can see among the warnings in the first command:
Presumably this is the cause of the regression, as [email protected] only node >=8: "engines": {
"node": ">=8"
}, Though you can also see in the warnings that a bunch of other stuff is listed as unsupported on Node 10, too. Namely |
The minor version upgrade from 6.0.5 to 6.0.6 should not require a Node.js version change |
Hello,
I'm the author of Ansis, a smaller and faster alternative to Chalk.
Ansis is a dual package that supports both CommonJS and ESM, while Chalk v5 is ESM only.
Ansis is Chalk-compatible, so migrating requires minimal code changes.
For example:
This PR intentionally keeps the variable name
chalk
unchanged (i.e.,chalk.red()
instead ofansis.red()
) to demonstrate that only minimal changes are needed, typically just the import and occasional spelling updates likegrey
->gray
.If you'd prefer a full rename to, e.g.,
ansis.red()
, I'm happy to update the variable name throughout the codebase as well.