-
Notifications
You must be signed in to change notification settings - Fork 418
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(cli): ensure output path for types exist before writing #6300
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
No changes to documentation |
Component Testing Report Updated Apr 9, 2024 10:59 PM (UTC)
|
@@ -1,3 +1,4 @@ | |||
{ | |||
"schema": "./working-schema.json" | |||
"schema": "./working-schema.json", | |||
"generates": "./out/types.ts" |
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.
we probably should have a test with a directory and one without a directory, but otherwise, 👍
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.
👍
Description
If the
generates
path in the typegen configuration points to a path that does not exist, it will crash with aENOENT: no such file or directory, open '<some-path>/<generates-path>'
error.This PR fixes this by running a recursive directory creation process before writing the output file.
What to review
Testing
Added a CLI test to reproduce - the
out
directory does not exist in the fixture, and thus should fail before this change and pass after this change.Notes for release
sanity typegen generate
would crash if the configured output path did not exist prior to running the command