-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Experiment with Zod #47
base: main
Are you sure you want to change the base?
Conversation
scotttrinh
commented
Jul 12, 2023
- Moves the validation, parsing, and transforming of options into Zod.
- Keeps the defined class to allow consumers of this type to get inline editor docs.
- Some minor project-setup related things, I'll make some comments about this inline.
@@ -2,7 +2,7 @@ root = true | |||
|
|||
[*] | |||
charset = utf-8 | |||
end_of_line = crlf | |||
end_of_line = lf |
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 was causing prettier to rewrite the file I was working on to replace the existing \n
with \n\r
. Apologies for the tooling churn here, feel free to tell me to revert! Otherwise, I can contribute a small whitespace PR that normalizes on crlf
.
settings: | ||
autoInstallPeers: true | ||
excludeLinksFromLockfile: false | ||
|
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.
My version of pnpm (8.3.1) rewrote this file slightly differently. Is there a specific version of pnpm you're using locally so it doesn't do so much rewriting?
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.
Mine is 8.6.7
I'm not sure if it's significant
|
||
const EdgeOptionsPublishApiSchema = z.object({ | ||
clientId: z.string({ | ||
required_error: getErrorMessage(`No client ID is provided. ${messageObtain}`) |
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.
I left these messages as is, but Zod provides the path
to the issue as part of it's error structure, so you can consider just leaning on that.