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

Export createSupportsColor function from supports-color #600

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lukekarrys
Copy link

@lukekarrys lukekarrys commented Jun 14, 2023

I have a use for this function when using chalk. It would be nice if I could grab this function without needing to install supports-color, especially since it is vendored by chalk.

Edit: this also updates xo to the latest version to fix a crash when linting. Tests should hopefully pass on this PR now.

@codecov
Copy link

codecov bot commented Jun 14, 2023

Codecov Report

Merging #600 (2fb79c8) into main (a370f46) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #600   +/-   ##
=======================================
  Coverage   99.61%   99.61%           
=======================================
  Files           8        8           
  Lines         517      518    +1     
=======================================
+ Hits          515      516    +1     
  Misses          2        2           
Impacted Files Coverage Δ
source/index.js 99.11% <100.00%> (+<0.01%) ⬆️

@lmf-git
Copy link

lmf-git commented Nov 8, 2023

@lukekarrys what is your use/what would be gained and what's the drawback? I'd guess 100 bytes...?

@lukekarrys
Copy link
Author

I hadn't even thought of the bytes. I see pros/cons for merging this as:

Cons:

  • Maintenance burden, including needing to figure out semver for chalk if supports-color has breaking changes

Pros:

  • Users only need to install and keep up to date 1 package
  • Guarantee that version of supports-color is the same between chalk and one consumed by user

This is a very trivial change, and I don't mind if it's not merged. It would get used in my project, but I'm also fine using supports-color as well.

@lmf-git
Copy link

lmf-git commented Nov 8, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants