fix(core): handle FORCE_COLOR=0 with picocolors#34520
Open
FrozenPandaz wants to merge 2 commits intomasterfrom
Open
fix(core): handle FORCE_COLOR=0 with picocolors#34520FrozenPandaz wants to merge 2 commits intomasterfrom
FrozenPandaz wants to merge 2 commits intomasterfrom
Conversation
picocolors treats FORCE_COLOR=0 as truthy, enabling colors instead of disabling them. This differs from chalk's behavior where FORCE_COLOR=0 means "disable colors." Convert FORCE_COLOR=0 to NO_COLOR=1 before picocolors initializes. Fixes #34387
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
View your CI Pipeline Execution ↗ for commit 2f19f1d
☁️ Nx Cloud last updated this comment at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Current Behavior
After migrating from chalk to picocolors (#34305),
FORCE_COLOR=0no longer disables colors. picocolors checks!!env.FORCE_COLOR, and since!!"0"istruein JavaScript, it treatsFORCE_COLOR=0as "enable colors."This breaks CI environments and tools like Homebrew that set
FORCE_COLOR=0to get plain text output.Expected Behavior
FORCE_COLOR=0should disable ANSI color output, matching the previous chalk behavior and the FORCE_COLOR spec.Related Issue(s)
Fixes #34387
Upstream issue filed: alexeyraspopov/picocolors#100