-
-
Notifications
You must be signed in to change notification settings - Fork 581
Support generating types only #2255
Copy link
Copy link
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
Use case: We want all the runtime code checked into the repo, we want to be able to review this code for breakages.
But for types we feel like that's less necessary and can't generate at npm install time/in CI
You can kind of do it like this:
react_query: {
input: {
target: "./schema.json",
},
output: {
mode: "tags-split",
target: "generated/schema.ts",
schemas: "generated/types",
client: "react-query",
prettier: true,
},
},
},
types_only: {
input: {
target: "./schema.json",
},
output: {
mode: "tags-split",
schemas: "internal/generated/types",
target: "internal/generated/types/file.ts",
},
},
And then run the appropriate configs in scripts
The only issue this generates a default http client too, its not a deal breaker it just leads to un-used code
Happy to hear if there are better ways of achieving this, or suggestions on how to implement and i could look at PR, unless its not something orval is interested in
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested