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

docs(api): Add api-common info on generating TypeScript bindings #3330

Merged
merged 1 commit into from Jun 28, 2023

Conversation

Kissaki
Copy link
Contributor

@Kissaki Kissaki commented Jun 24, 2023

PR #2827 added support for generating TypeScript bindings.

I could not find any information or docs on how to generate them though. The MR description merely mentions tests generating them, but they won't generate unless the full feature flag is used.

This change adds information that this is possible, how to do it, and where they are put to to the api_common crate README.md.


## Generate TypeScript bindings

TypeScript bindings (API types) can be generated by running `cargo test --features full`.
Copy link
Member

Choose a reason for hiding this comment

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

Mention that this needs to be done inside crates/api_common folder. Alternatively you can run cargo test -p lemmy_api_common --features full from root.

Copy link
Contributor Author

@Kissaki Kissaki Jun 26, 2023

Choose a reason for hiding this comment

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

This README is in the api_common folder. So I think that's implicitly clear and correct.

Documenting the folder and then stating that folder explicitly for actions seems redundant and - to me - confusing.

Copy link
Member

Choose a reason for hiding this comment

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

In that case make the command this to be more clear.

cd crates/api_common
cargo test ...

## Generate TypeScript bindings

TypeScript bindings (API types) can be generated by running `cargo test --features full`.
The ts files be generated into a `bindings` folder.
Copy link
Member

Choose a reason for hiding this comment

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

Output is in crates/api_common/bindings

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This README file is in crates/api_common. Referencing the bindings folder in it matches that path.

@Nutomic Nutomic merged commit 0f91759 into LemmyNet:main Jun 28, 2023
1 check passed
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

3 participants