refactor: replace chalk with smaller alternative#5983
refactor: replace chalk with smaller alternative#5983Unitech merged 1 commit intoUnitech:developmentfrom
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 chalk@3.0.0 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
chalkunchanged (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.