Skip to content
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

Generate types on build #166

Closed
boul2gom opened this issue Aug 18, 2023 · 2 comments
Closed

Generate types on build #166

boul2gom opened this issue Aug 18, 2023 · 2 comments

Comments

@boul2gom
Copy link

Hi 👋
There is a way to generate types on build, or when wanted, through build.rs please ? Because actually, the only way is to call cargo test in build.rs, ans its run every tests, including integration testing. Maybe a `ts_rs::export_types()`` can be useful to call, instead of using tests.
Thanks a lot

@NyxCode
Copy link
Collaborator

NyxCode commented Aug 18, 2023

I think cargo test export_bindings should do what you want.
Sadly, having one function to export all types is not currently feasible. It is possible, but currently only with workarounds to get around incremental compilation.

@dessalines
Copy link
Contributor

cargo test export_bindings should be added to the readme as the main way to generate these bindings. Lots of projects have tests that can take a long time to run, and it was hard to find this answer.

dessalines added a commit to dessalines/ts-rs that referenced this issue Nov 2, 2024
This should be the main way to export bindings, as many projects have tests that can take a long time to run.

Context Aleph-Alpha#166
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants