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

feat: add ts-rs mapping to our jrpc #915

Merged
merged 1 commit into from
Jan 29, 2024
Merged

Conversation

Cifko
Copy link
Contributor

@Cifko Cifko commented Jan 24, 2024

Description

The ts-rs crate is very helpful but it has some downsides (bugs).
If you want to generate new mappings. You have to run test with feature ts without integration test : cargo test --workspace --exclude integration_tests export_bindings --features ts. This will run only the ts-rs exporting. But there is a catch, some of the structs are export to wrong directory (dan_layer\bindigs). You have to manually move them to the /bindings folder. Don't forget to run prettier afterwards.
Probably not all settings are exported to typescript correctly. We will fix once we start replacing the anys in the webui projects.

Motivation and Context

It seems like you can change the export_to path to get it into the right directory. But then the ts-rs will panic (because the are expecting that each struct is on the same level.... Maybe in the future version it will work.

Breaking Changes

  • None
  • Requires data directory to be deleted
  • Other - Please specify

Copy link

github-actions bot commented Jan 24, 2024

Test Results (CI)

447 tests  +249   447 ✅ +249   2h 13m 57s ⏱️ + 6m 29s
 57 suites +  4     0 💤 ±  0 
  2 files   ±  0     0 ❌ ±  0 

Results for commit df7a9b2. ± Comparison against base commit 0062fcc.

♻️ This comment has been updated with latest results.

@sdbondi
Copy link
Member

sdbondi commented Jan 25, 2024

Nice - perhaps we can add a node package for these bindings and add a command to build them?

Then we can include that package in the web UIs

@Cifko Cifko force-pushed the ts-rs branch 5 times, most recently from 1ab2582 to 575cf77 Compare January 25, 2024 18:22
stringhandler
stringhandler previously approved these changes Jan 26, 2024
Copy link
Contributor

@stringhandler stringhandler left a comment

Choose a reason for hiding this comment

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

utACK

Copy link
Member

@sdbondi sdbondi left a comment

Choose a reason for hiding this comment

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

utACK

@sdbondi sdbondi added this pull request to the merge queue Jan 29, 2024
Merged via the queue into tari-project:development with commit 7772efa Jan 29, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants