-
Notifications
You must be signed in to change notification settings - Fork 634
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
feat(cli/unstable): support stderr on spinner #6350
base: main
Are you sure you want to change the base?
Conversation
6c03bf3
to
de7990d
Compare
de7990d
to
942e538
Compare
942e538
to
49c8663
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6350 +/- ##
==========================================
+ Coverage 96.33% 96.34% +0.01%
==========================================
Files 552 552
Lines 41938 41940 +2
Branches 6354 6355 +1
==========================================
+ Hits 40399 40406 +7
+ Misses 1499 1494 -5
Partials 40 40 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable addition to me.
Can you also add an example of passing Deno.stderr
in Spinner class jsdoc?
@kt3k - Updated example. I'm curious if you have an opinions or there is a standard name to use for the Also any thoughts on making this the default vs stdout? From my perspective there aren't many or any downsides and only upsides to having this as the default. I've noticed other libraries already conform to the pattern of using |
I don't think there's standard name for it, but how about
That sounds reasonable to me. Let's continue on that change after this one. |
Related to #5495
Adds support to the
@std/cli/unstable_spinner
to write tostderr
instead of the defaultstdout
.The current Spinner is unusable when piping to another command (e.g.
deno_cli | less
for paging). and will cause garbled data to the pipe/console. Usingstderr
is the standard approach for informational text since by default it is not passed along to the piped commands stdin.NOTE: I personally would be happy to make this the default. I'm curious if folks would be open to this considering it's currently unstable.
An alternative could be to check if the terminal is interactive or not and change the default based on this.