ricokahler / sanity-codegen

Generate TypeScript types from your Sanity.io schemas
sanity-codegen-dev.vercel.app
MIT License
270 stars 19 forks source link

[v1] Feature request: Write folder for `output` if it doesn't exist #285

Closed madeleineostoja closed 1 year ago

madeleineostoja commented 1 year ago

If you specify a path that doesn't yet exist for output the codegen errors out saying the file doesn't exist. Ideally the tool should write that folder if it doesn't exist.

Use-case: I have a @types/generated folder that holds all auto generated types across a monorepo, and I want to write sanity types to one of those folders. Since they're generated types I gitignore that folder everywhere, and therefore codegen fails in CI without some hacky workarounds

ricokahler commented 1 year ago

i'd say this is bug. thanks for finding these!