valibot icon indicating copy to clipboard operation
valibot copied to clipboard

feat: add a tool that could rewrite a Zod schema into a Valibot schema

Open kazizi55 opened this issue 1 year ago • 9 comments

If there is the codemod just like next.js codemod or storybook codemod, it would be so smooth to transfer from Zod to Valibot 😄

FYI https://github.com/fabian-hiller/valibot/pull/77#issuecomment-1741880644

kazizi55 avatar Nov 05 '23 14:11 kazizi55

If this request is approved, I will create a PR for this 😄

kazizi55 avatar Nov 05 '23 14:11 kazizi55

Yes, that is a great idea. Maybe somehow related to #229. I would be very interested in supporting that directly on our website as a developer tool. So you can copy and past.

fabian-hiller avatar Nov 05 '23 16:11 fabian-hiller

Thanks!

I would be very interested in supporting that directly on our website as a developer tool. So you can copy and past.

Sounds great 😄 I'm gonna work on it!

BTW, how about the codemod? The codemod would be also convenient, especially when a large amount of transition from Zod to Valibot, because all we have to do is to execute an command in CLI.

kazizi55 avatar Nov 05 '23 23:11 kazizi55

Yes, a codemod would be great. We can make it available via a CLI and as a tool on the website.

fabian-hiller avatar Nov 06 '23 13:11 fabian-hiller

Isn't this already available?

download13 avatar Nov 11 '23 23:11 download13

Yes it is but in my understanding it can only transform a TypeScript type to a schema and not a schema to another schema.

fabian-hiller avatar Nov 11 '23 23:11 fabian-hiller

@kazizi55 do you have experience creating code mods or should I reach out to the community to create one? Maybe we can have a look at one of the "zod-to-x" packages and change it to Valibot.

fabian-hiller avatar Jan 13 '24 17:01 fabian-hiller

@fabian-hiller Sorry for my late reply 🙏

do you have experience creating code mods or should I reach out to the community to create one?

Could you reach out the the community? Recently I've been busy and won't be able to take over for a while...

And I closed this draft PR: https://github.com/fabian-hiller/valibot/pull/268

kazizi55 avatar Jan 17 '24 22:01 kazizi55

No worries. I will reach out to the community.

fabian-hiller avatar Jan 17 '24 22:01 fabian-hiller

I'm still interested, but I don't think I'll be able to work on it in the next 6 months, so I'm closing this issue for now.

fabian-hiller avatar Jun 25 '24 13:06 fabian-hiller