-
Notifications
You must be signed in to change notification settings - Fork 17
Migrate ts-codegen to @hey-api/openapi-ts #367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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).