valibot icon indicating copy to clipboard operation
valibot copied to clipboard

Schemas generation from Typescript Type aliases

Open stovv opened this issue 1 year ago • 1 comments

Hey! What about automatically generating schemas from typescript? I think it would be very handy for big projects to generate initial schemas at the beginning of the valibot journey 😄

Example

// exists type
type SomeFormsValues = {
    name: string;
    lastName: string;
    age: number;
}

// generated type
const SomeFormsValuesSchema = object( {
    name: string();
    lastName: string();
    age: number();
});

my idea demo: https://github.com/stovv/valibot-ts-codegen

stovv avatar Oct 26 '23 17:10 stovv

Hi, I think thats similar to TypeBox-Workbench. I am interested in such a solution and it would be cool to add it as a tool to our website. Let's talk about it. If you are interested you can find me via fabianhiller on Discord.

fabian-hiller avatar Oct 26 '23 17:10 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