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: bindgen crate #1425

Merged
merged 30 commits into from
Jan 18, 2024
Merged

feat: bindgen crate #1425

merged 30 commits into from
Jan 18, 2024

Conversation

glihm
Copy link
Collaborator

@glihm glihm commented Jan 12, 2024

This PR adds the dojo-bindgen crate where plugins will be managed for auto-generated code on the top of cainome.

Currently, we're proposed built-in plugins, that are written in rust, and may be updated by the community and maintainers.

In a second phase, the PluginManager will also expose some plugins to be called using stdin in the same fashion as protobuf to allow endless extension by users without having to push their code on dojo repo.

@codecov-commenter
Copy link

codecov-commenter commented Jan 12, 2024

Codecov Report

Attention: 174 lines in your changes are missing coverage. Please review.

Comparison is base (87599f9) 67.62% compared to head (c3ab37c) 67.08%.

Files Patch % Lines
crates/dojo-bindgen/src/lib.rs 0.00% 119 Missing ⚠️
crates/sozo/src/commands/build.rs 0.00% 23 Missing ⚠️
crates/dojo-bindgen/src/plugins/typescript/mod.rs 0.00% 15 Missing ⚠️
crates/dojo-bindgen/src/plugins/unity/mod.rs 0.00% 15 Missing ⚠️
crates/dojo-bindgen/src/error.rs 0.00% 1 Missing ⚠️
crates/dojo-bindgen/src/plugins/mod.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1425      +/-   ##
==========================================
- Coverage   67.62%   67.08%   -0.55%     
==========================================
  Files         218      223       +5     
  Lines       21060    21235     +175     
==========================================
+ Hits        14242    14245       +3     
- Misses       6818     6990     +172     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@glihm glihm marked this pull request as ready for review January 16, 2024 04:07
@glihm
Copy link
Collaborator Author

glihm commented Jan 16, 2024

For testing I'm thinking about using a build.rs to use sozo that is available in the devcontainer to avoid sozo required for a crate that's actually used inside sozo.


// Spawn and move project is not built at the time this lib is being tested.
// Need plain artifacts to simplify or use `sozo` from env (available as we're in the devcontainer).
// #[cfg(test)]
Copy link
Contributor

Choose a reason for hiding this comment

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

If you include dojo-dev-utils with the build-examples feature it should build these for you

dojo-test-utils = { path = "../dojo-test-utils", features = [ "build-examples" ] }

Copy link
Collaborator Author

@glihm glihm Jan 16, 2024

Choose a reason for hiding this comment

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

Thanks for pointing this out again. For any reason I was thinking that I had a cyclic dependency like I had last time working with this, but dojo-test-utils is based on dojo-lang and not sozo...

Thank you again sensei 🙏.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The stack overflow error on windows seems to be related to this new dependency I added. I'll investigate the possible cause because we normally don't run the build again if the target is not empty.
Will also check what scarb did to solve that, in order to see if their modifications/solutions can apply for us too.

I commented out the tests. I don't like to do that but is to keep track of the working tests at the same location.
The idea is to move forward, as nasr already have great stuff working on that, to make it public and keep improving this bindgen.

@glihm glihm requested a review from tarrencev January 17, 2024 05:30
@tarrencev tarrencev merged commit 79278a6 into dojoengine:main Jan 18, 2024
10 checks passed
@glihm glihm deleted the feat/bindgen branch February 17, 2024 20:50
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.

3 participants