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

Fix color detection #1265

Merged
merged 3 commits into from
Mar 8, 2023
Merged

Fix color detection #1265

merged 3 commits into from
Mar 8, 2023

Conversation

iiroj
Copy link
Member

@iiroj iiroj commented Mar 6, 2023

Update dependencies and restore and chalk for improved color support detection. This should fix issues with Windows terminals multiplying or otherwise messing up the output.

Comment on lines 15 to 17
if (supportsColor.stdout) {
process.env.FORCE_COLOR = supportsColor.stdout.level.toString()
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the original detection logic from before version 13.0.0.

lib/figures.js Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Mar 6, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change

Comparison is base (f230c69) 100.00% compared to head (519bbfb) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1265   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           26        26           
  Lines          735       735           
  Branches       198       198           
=========================================
  Hits           735       735           
Impacted Files Coverage Δ
lib/figures.js 100.00% <100.00%> (ø)
lib/messages.js 100.00% <100.00%> (ø)
lib/resolveTaskFn.js 100.00% <100.00%> (ø)
lib/runAll.js 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@iiroj
Copy link
Member Author

iiroj commented Mar 6, 2023

Looks like chalk includes supports-color as an inline vendor module and also exports it, so we don't need to install both:

https://github.com/chalk/chalk/blob/a370f468a43999e4397094ff5c3d17aadcc4860e/source/index.js#L220-L223

@iiroj
Copy link
Member Author

iiroj commented Mar 8, 2023

Ping @okonet should we merge this?

@okonet
Copy link
Collaborator

okonet commented Mar 8, 2023

Lgtm!

@iiroj iiroj merged commit 0d843ce into master Mar 8, 2023
@iiroj iiroj deleted the fix-color-detection branch March 8, 2023 08:42
@iiroj
Copy link
Member Author

iiroj commented Mar 8, 2023

Looks like semantic-release also messed up by publishing 13.1.3 and 13.1.4 instead of 13.1.3-next.1 etc, so we will have to skip those two versions from the latest tag. 🙈

@okonet
Copy link
Collaborator

okonet commented Mar 8, 2023

Should we switch to changesets? I feel it is much more reliable and controllable.

@iiroj
Copy link
Member Author

iiroj commented Mar 8, 2023

It might be good, yes... I'm up for it but would need to spend some on it, unless you want to implement.

For now maybe I just create two empty fix: version bump only Pull Requests so we get 13.1.5 released?

@iiroj
Copy link
Member Author

iiroj commented Mar 8, 2023

Actually, a single feat: version bump only fixes this since semantic-release didn't even get to creating the versions in the repo.

@okonet
Copy link
Collaborator

okonet commented Mar 8, 2023

I can implement when I find some time. No pressure ;)

iiroj added a commit that referenced this pull request Mar 8, 2023
Changes in `semantic-release` seem to make it difficult to publish pre-releases
into `lint-staged@next`, so disable it for now. For more info, see the following PR:
#1265
iiroj added a commit that referenced this pull request Mar 9, 2023
Changes in `semantic-release` seem to make it difficult to publish pre-releases
into `lint-staged@next`, so disable it for now. For more info, see the following PR:
#1265
iiroj added a commit that referenced this pull request Mar 10, 2023
Changes in `semantic-release` seem to make it difficult to publish pre-releases
into `lint-staged@next`, so disable it for now. For more info, see the following PR:
#1265
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants