-
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(js): check that project's package.json exists before attempting to read its contents #10650
fix(js): check that project's package.json exists before attempting to read its contents #10650
Conversation
…ing to read its contents ISSUES CLOSED: nrwl#10649
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
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.
This looks good, thanks for the contribution 🎉.
I left a few comments, after those are fixed we should be able to merge this.
…nt to bound function
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.
Hey @adriangroch! Sorry, I shouldn't have reviewed this so late at night evidently 😅. We should move the fileExists check inside of the updatePackageJson function s.t. the correct package.json still gets generated inside the dist folder.
I'd recommend moving it there, and doing something like:
const packageJson = fileExists(pathToPackageJson) ? readJson(pathToPackageJson) : {name: context.projectName}
This will also fix the same issue for @nrwl/js:swc.
…unction ISSUES CLOSED: nrwl#10649
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. |
ISSUES CLOSED: #10649
Current Behavior
Building a node application using
@nrwl/js:tsc
as the executor without a package.json within the applications folder causes an error to be thrown as the executor attempts to read the contents file that does not exist.Expected Behavior
An error is not thrown as we now check that the file exists before attempting to update it.
Related Issue(s)
Fixes #10649