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

Fixed browser support #42

Merged
merged 2 commits into from
Sep 30, 2020
Merged

Conversation

tinchoz49
Copy link
Contributor

@tinchoz49 tinchoz49 commented Sep 29, 2020

Hey @lukeed how are you?

Every bundler like browserify, parcel and webpack is using a shim of process that doesn't have stdout implemented.

So when I try to use kleur in the browser it throws an error that process.stdout is undefined.

With this minor change we can have support for the browser too.

@codecov-commenter
Copy link

codecov-commenter commented Sep 29, 2020

Codecov Report

Merging #42 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #42   +/-   ##
=======================================
  Coverage   98.77%   98.77%           
=======================================
  Files           2        2           
  Lines         163      163           
  Branches       29       28    -1     
=======================================
  Hits          161      161           
  Misses          1        1           
  Partials        1        1           
Impacted Files Coverage Δ
colors.mjs 98.11% <100.00%> (ø)
index.mjs 99.09% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2cc92dd...431c13b. Read the comment docs.

@lukeed
Copy link
Owner

lukeed commented Sep 29, 2020

Hey :) Can we change these to isTTY = process.stdout && process.stdout.isTTY or does that still break with the polyfills?

@tinchoz49
Copy link
Contributor Author

Of course that will work too :)

@tinchoz49
Copy link
Contributor Author

done

Copy link
Owner

@lukeed lukeed left a comment

Choose a reason for hiding this comment

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

Cool, thanks!

@lukeed lukeed merged commit 01963cc into lukeed:master Sep 30, 2020
lukeed added a commit to lukeed/uvu that referenced this pull request Nov 9, 2020
* Stricter isNode check

* fix: include `process.stdout` for `isNode` check

related: lukeed/kleur#42

Co-authored-by: Luke Edwards <luke.edwards05@gmail.com>
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.

3 participants