Skip to content
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

Restore previous FORCE_COLOR=0 behavior #16362

Merged
merged 2 commits into from Mar 19, 2024

Conversation

nicolo-ribaudo
Copy link
Member

Q                       A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

See alexeyraspopov/picocolors#62 and jestjs/jest#14976 (comment). Until the last released we interpreted FORCE_COLOR=0 as disabling color. There is no consensus among tools about what FORCE_COLOR=0 does, but we should not change this behavior in a patch release.

@nicolo-ribaudo nicolo-ribaudo added i: regression PR: Bug Fix 🐛 A type of pull request used for our changelog categories labels Mar 19, 2024
@babel-bot
Copy link
Collaborator

babel-bot commented Mar 19, 2024

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/56549

@liuxingbaoyu
Copy link
Member

https://github.com/chalk/supports-color/
I'm not sure if it's worth using this package with Babel 7, there may be other edge cases where the differences exist.

@nicolo-ribaudo
Copy link
Member Author

Most of that complexity of that package comes from supporting multiple CLI flags (that we do not support) and detecting the level of color support.

I would just do the minimal changes done by this PR, and if we want to move to something more reliable we can switch to process.stdout.hasColors() (Node.js 10+). That is, unless somebody opens an issue.

@nicolo-ribaudo
Copy link
Member Author

Actually, it seems like the only difference is FORCE_COLOR=false. I'll add it to this PR.

@liuxingbaoyu
Copy link
Member

https://github.com/chalk/supports-color/blob/c214314a14bcb174b12b3014b2b0a8de375029ae/index.js#L126-L136
I'm guessing there will be differences in those too, but I think it's okay to wait for anyone to report it.

@nicolo-ribaudo nicolo-ribaudo merged commit f96d8a1 into babel:main Mar 19, 2024
50 checks passed
@nicolo-ribaudo nicolo-ribaudo deleted the restore-FORCE_COLOR=0 branch March 19, 2024 17:34
@nicolo-ribaudo
Copy link
Member Author

Releasing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i: regression PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants