You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Using Typegen across separate repositories (e.g. on for studio, one for the frontend) is difficult, as you can't mix local settings and those that are committed to the repository. The only configuration possibility at the moment is sanity-typegen.json.
Describe the solution you'd like
Configuration via CLI options and/or environment variables
Describe alternatives you've considered
I'm using an external script at the moment to gather the relevant options from constant, project and local settings, then resolve paths to be relative to the Sanity Studio root, write a temporary sanity-typegen.json, run typegen and clean up again afterwards. This is much more cumbersome than it has to be, though.
The text was updated successfully, but these errors were encountered:
👋 We have had internal discussions around moving sanity-typegen.json config into the sanity.config.ts, as a separate object. The config would look something similar to:
import{defineConfig}from'sanity'exportdefaultdefineConfig({
... // the rest of your configschemaExtract: {
...
},typegen: {generates: 'sanity.types.ts` // or process.env.TYPEGEN_OUTPUT || 'sanity.types.ts`
},})
Since this all being executed then during runtime it should work by reading options from the environment.
Is your feature request related to a problem? Please describe.
Using Typegen across separate repositories (e.g. on for studio, one for the frontend) is difficult, as you can't mix local settings and those that are committed to the repository. The only configuration possibility at the moment is
sanity-typegen.json
.Describe the solution you'd like
Configuration via CLI options and/or environment variables
Describe alternatives you've considered
I'm using an external script at the moment to gather the relevant options from constant, project and local settings, then resolve paths to be relative to the Sanity Studio root, write a temporary
sanity-typegen.json
, run typegen and clean up again afterwards. This is much more cumbersome than it has to be, though.The text was updated successfully, but these errors were encountered: