Skip to content

Restore previous FORCE_COLOR=0 behavior#16362

Merged
nicolo-ribaudo merged 2 commits intobabel:mainfrom
nicolo-ribaudo:restore-FORCE_COLOR=0
Mar 19, 2024
Merged

Restore previous FORCE_COLOR=0 behavior#16362
nicolo-ribaudo merged 2 commits intobabel:mainfrom
nicolo-ribaudo:restore-FORCE_COLOR=0

Conversation

@nicolo-ribaudo
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

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

@liuxingbaoyu
Copy link
Copy Markdown
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
@nicolo-ribaudo nicolo-ribaudo deleted the restore-FORCE_COLOR=0 branch March 19, 2024 17:34
@nicolo-ribaudo
Copy link
Copy Markdown
Member Author

Releasing

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jun 19, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

i: regression outdated A closed issue/PR that is archived due to age. Recommended to make a new issue 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.

4 participants