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

rustdoc typegen #217

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Draft

rustdoc typegen #217

wants to merge 14 commits into from

Conversation

StuartHarris
Copy link
Member

@StuartHarris StuartHarris commented Mar 9, 2024

This is an experiment to see whether we can use rustdoc's JSON output to generate foreign types (in TS, Swift and Kotlin) for crux shared libs.

The JSON has all the information we need, so potentially we can use it to list all the types that implement crux_core::App, find their associated types and follow them to their leaves, even crossing crate boundaries (e.g. to crux_http). After we have gathered the relevant type information, we'd need to generate the foreign types, including any serialisation / deserialisation code).

  • add a codegen subcommand to crux_cli
  • invoke cargo doc and generate JSON output
  • deserialise the output into rustdoc-types
  • gather the relevant type information
  • generate foreign types
  • generate serialisation and deserialisation code

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

Successfully merging this pull request may close these issues.

None yet

1 participant