这是indexloc提供的服务,不要输入任何密码
Skip to content

feat: add automatic types generation #703

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

Merged
merged 24 commits into from
Apr 20, 2025
Merged

Conversation

Valerioageno
Copy link
Member

@Valerioageno Valerioageno commented Apr 4, 2025

Checklist

Related issue

Fixes #463

Overview

This feature adds the support for automatically types generation. By just #[derive(...)] the Type trait, the struct or enum will be automatically translated to a typescript type and it will be available from the "tuono/types" module

How to QA locally

For the best QA experience, run the command RUST_LOG=tuono=trace t dev

What features are exposed?

Checkout the new documentation page for all the details tuono-labs/tuono-documentation#89

Does this feature cover all the possible user usages?

No. This feature covers most of the user needs but doesn't implement complex cases. Since it is very hard to know beforehand what are all the users' needs (and implementing variants is quite straightforward) I consider this PR ready enough for starting using it.

@Valerioageno Valerioageno self-assigned this Apr 4, 2025
@github-actions github-actions bot added the rust Requires rust knowledge label Apr 4, 2025
@github-actions github-actions bot added the typescript Requires typescript knowledge label Apr 4, 2025
@github-actions github-actions bot added the CI/CD label Apr 4, 2025
@Valerioageno Valerioageno marked this pull request as ready for review April 4, 2025 17:13
@Valerioageno Valerioageno requested a review from marcalexiei April 5, 2025 09:13
Copy link
Contributor

@jacobhq jacobhq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very impressive. Just a few minor tweaks, and questions on nesting...

@Valerioageno
Copy link
Member Author

Valerioageno commented Apr 14, 2025

@marcalexiei and @jacobhq, I consider this feature ready for review. It will definitely need to be extended in the future to support all the possible cases, but as starting point should cover most of the user usages.

Let me know what you think about it, and please try it on your local env to see if you find any "awkwardness" that I might have miss. Thanks!

@Valerioageno Valerioageno merged commit bc44492 into main Apr 20, 2025
28 checks passed
@Valerioageno Valerioageno deleted the automatic-types-generation branch April 20, 2025 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/CD rust Requires rust knowledge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature request]: generate typescript types from react structs
3 participants