-
Notifications
You must be signed in to change notification settings - Fork 23
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: change stderr to stdout #70
Conversation
🦋 Changeset detectedLatest commit: 7cb0bf7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Can you describe the reason? |
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.
The use of stderr
for outputting information is intentional and by design.
Could you explain why you wish to switch to stdout
?
It seems that the current version of library is using the wrong stream for its messages. In our company, we rely on reading logs from stderr to detect issues and stop the build when something goes wrong. However, it feels odd to encounter "successful errors" in the error stream. shrug |
Messages like "Successfully compiled ${filename} with swc" looks as information of program execution. |
I recommend using exit code detection instead of relying on stderr to determine errors. This is because
What you cited is correct; for the SWC CLI, The "Successfully compiled" message, however, is a notification unrelated to the normal output and is expected to be emitted to |
"Successfully compiled" is displayed to the user and should not be piped to the next command, so it is reasonable to output it to stderr. This is an excellent CLI design guide, which I believe is worth referring to: https://clig.dev/ |
@magic-akari Thank you for attention and advice! We will try to use exit code! I think it can be closed. |
No description provided.