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
Ensure a non-zero exit status code when build has errors #1451
Conversation
init() returns a Promise, and hence, would need to be awaited for, which is not possible top-level. Went for the `catch` as it's nicer than wrapping the try/catch in another async function, so we could await init().
@SleeplessByte any idea on how we could add tests around |
It's possible to call the bin/xxx programmatically. Might be worth it. I wouldn't do it for now; because RS7 is pretty complex :( |
Yeah that make sense. I guess I was mostly wondering of ways to provide the executable with the mocks and whatnot (templates). I guess that's the same conclusion than you've arrived at in #1383 (comment). |
(You got merge permissions btw) |
Haha I do! Do you feel like this warrant a 7.4.1 release ? |
If you need it, sure. But I think you also run a local copy right? |
I run a local copy for development but we do run the one from NPM when building during deploys. I can take care of making a release PR if you'd like (unclear to me exactly what the steps are), and then there would only be the tags to push to NPM or something ? |
@SleeplessByte any thoughts on this ? I don't think I can push a release myself but probably can make a PR for it (although, I'm not sure of what command to run for this). |
I forgot about this! You can create the release PR if you'd like, I'll merge and deploy then. I'll document which commands I run to release at some point. 85 hour work weeks coming to an end in about 1 month, then I can focus on getting some sponsorships for React Static and build v8. |
Thats a lot of work hours -- take care of yourself too! I'll open a PR for a release. |
Description
Ensure
init()
always return aPromise
. This prevents the issue described in #1260.Since
init()
returns aPromise
, it would need to be awaited for. However, we can'tawait
at the top-level, so we would have needed to wrap thetry/catch
in anasync
function for it to work, like so:Example of awaiting:
This just seem overly complex, so I went for the
catch
as it's nicer than wrapping thetry/catch
.Changes/Tasks
Changed code
yarn build
with an error thrown, exit status is 1.yarn build
with no error thrown, exit status is 0.yarn react-static
logs the usage info, exit status is 0, no error loggedI have not added tests yet, would love some, will look into it!
Motivation and Context
Closes/Fixes #1450
Types of changes
Checklist: