-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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(release): parse NPM output for JSON to prevent JSON.parse from throwing #23112
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
You are applying this change (which I am a bit skeptical about, see the next paragraph) to the I imagine the npm CLI output is producing only JSON when |
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.
See comment
Yes, you are completely right, I meant to apply this regex to the stdout of the |
… fix/publish-output-parsing
Sorry for the delay @gutentag2012. I have been able to test out my suggestion above and sadly the npm publish output does not behave how I hoped. I was hoping that npm was going to be consistent around valid JSON output on at least one channel (stdout or stderr) but it does indeed mix the outputs on stdout. There's a few other things I wanted to cover in this area, so I have gone ahead and opened PR: #23850 This adds a (hopefully) more robust extraction method, actually prints the output of your lifecycle scripts (and unrelated to this modifies the version in the output in dry-mode, which is a long standing point of potential confusion that I wanted to address). Thanks so much for pointing me towards this issue and opening this PR to get the ball rolling, I appreciate it! |
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
closed #22925
Current Behavior
If the
npm publish
command is run and has any other console output than the JSON, e.g. output from aprepublishOnly
step, thepnpm release
command fails.Expected Behavior
It should be possible to have a
prepublishOnly
step without this command failing.Related Issue(s)
Fixes #22925