-
-
Notifications
You must be signed in to change notification settings - Fork 51
feat: minimal implementation to support valibot #667
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
Conversation
@@ -81,6 +82,7 @@ | |||
"ts-dedent": "^2.2.0", | |||
"ts-jest": "29.1.4", | |||
"typescript": "5.4.5", | |||
"valibot": "0.31.0-rc.6", |
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.
valibot is planning big breaking changes to its API in v.0.31.0. Since the old API is no longer available, this PR uses the rc version to comply with the new API.
return `v.boolean()`; | ||
} | ||
console.warn('unhandled scalar name:', scalarName); | ||
return 'v.any()'; |
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.
Since no type errors occurred, definedNonNullAny
was implemented without using it.
@Code-Hex Sorry for the delay, please review at your convenience! |
What a great job @MH4GF !! |
CI is down, so I'll merge the main branch 🏃🏻♂️ |
// This function generates `[v.minLength(100), v.email()]` | ||
// NOTE: valibot's API is not a method chain, so it is prepared separately from buildApi. | ||
// |
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.
Oh, I understand 👍
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.
LGTM! Thank you so much!
This PR implements valibot support.
First of all, only the contents of example/zod/schemas.ts are supported, not all configurations. Even at this point, the use case for my project can be met, and I plan to begin production operation when it is released.
Should documentation still be added in its current condition? I would like to discuss this.
After merging this PR, I will implement the test which is a todo.