Migrate ts-codegen to @hey-api/openapi-ts#367
Conversation
|
Important Review skippedMore than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review. 78 files out of 179 files are above the max files limit of 100. Please upgrade to Pro plan to get higher limits. You can disable this status message by setting the ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| { | ||
| name: '@hey-api/typescript', | ||
| enums: { | ||
| mode: 'typescript', |
There was a problem hiding this comment.
By default, enums would be created as types which would break a lot of our code.
Also, by default it uses the SCREAMING_SNAKE_CASE casing which would have required a lot more changes.
With the previous generator, only some types were using SCREAMING_SNAKE_CASE (eg. Event.type, etc)
|
@coderabbitai The gist of this PR was to change the code generator for the Typescript types definitions. There's no need to review the changes of the files removed at libs/types/models folder. |
|
Tip For best results, initiate chat on the files or code changes. @celdrake: Thank you for the clarification! I understand now - this PR migrates from
I'll skip reviewing the deleted files in the ✏️ Learnings added
|
017be91 to
6ff93a7
Compare
6ff93a7 to
e4f82c0
Compare
|
We'll review in the future if this is needed. Closing for now. |
The
openapi-typescript-codegenis now deprecated, the recommended alternative is@hey-api/openapi-tsI saw this when I was reviewing options for adding schema suggestions etc to the YAML editor. Seems like the "schema.gen.ts" that can be generated could be useful for this.
There are some differences in how the types are generated:
types.gen.ts, which is later renamed asindex.tsCustomInfo. I added a transformer that modifies the schema so it's generated correctly (as before).