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!: update ora stream output #274

Merged
merged 1 commit into from
Nov 2, 2024

Conversation

Yoon-Hae-Min
Copy link
Contributor

What is Different

test code

const { spawn } = require("child_process");

const run = () => {
  const command = "yarn";
  const args = ["gen:example"];

  const childProcess = spawn(command, args);

  childProcess.stdout.on("data", (data) => {
    console.log(`stdout: ${data}`);
  });

  childProcess.stderr.on("data", (data) => {
    console.error(`stderr: ${data}`);
  });

  childProcess.on("close", (code) => {
    if (code !== 0) {
      console.error(`Command finished with code ${code}`);
    } else {
      console.log("Command finished successfully");
    }
  });

  childProcess.on("error", (error) => {
    console.error(`Execution error: ${error}`);
  });
};

run();

Before

image

After

image

Why

In the previous execution method, the yarn gen:example command mistakenly routed validation messages to the standard error stream (stderr). Despite these messages being part of normal feedback rather than errors, this misrouting could confuse users. In this update, such messages are correctly routed to the standard output stream (stdout), ensuring that general process information is accurately conveyed to the user.

@Yoon-Hae-Min Yoon-Hae-Min changed the title fix: upldate ora stream output fix: update ora stream output Oct 22, 2024
@tvillaren
Copy link
Collaborator

Hey @Yoon-Hae-Min,

Thanks for your PR, non-error shoud indeed go to stdout.

I believe this would be a breaking change in ts-to-zod I/O as some people might rely on checking stderr in their pipeline, and we would need to release this into a new major.
As other breaking changes are needed ( breaking This issue introduces a breaking change that would go into a new Major version ), maybe now would be the time to implement and create a new major.

WDYT @fabien0102 & @schiller-manuel ?

@tvillaren tvillaren changed the title fix: update ora stream output fix!: update ora stream output Oct 30, 2024
@tvillaren tvillaren added the breaking This issue introduces a breaking change that would go into a new Major version label Nov 1, 2024
@tvillaren tvillaren changed the base branch from main to release-v4 November 1, 2024 22:53
@tvillaren tvillaren merged commit 954e004 into fabien0102:release-v4 Nov 2, 2024
0 of 2 checks passed
@tvillaren tvillaren mentioned this pull request Nov 2, 2024
tvillaren pushed a commit that referenced this pull request Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This issue introduces a breaking change that would go into a new Major version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants