Reenable Specta integration
This fixes the commented out Specta integration resolving the TODO comment.
It might be worth moving the type exporting code into the startup of the application if possible when doing a debug build so that you don't need to run cargo test ... to generate the bindings but I don't know enough about Graphite's setup to know where is best. I also suppose any Rust running in wasm would not be a good place for that as it won't have filesystem access so a better place may not exist.
TODO:
- [ ] Decide on approach
- [ ] Fix the errors with linter (we can do that from the Specta side)
Part of #1148
Thank you for writing the library and helping us restore this! I'm eager to do the refactor which replaces messages.ts with these generated bindings.
Back to reviewing this now! Could you please help me understand the purpose of pnpm-lock.yaml, bindings_from_node.ts, and export.js?
I also removed the pnpm-lock.yaml. It was just from me using pnpm instead of npm.
It might be worth moving the type exporting code into the startup of the application if possible when doing a debug build so that you don't need to run
cargo test ...to generate the bindings but I don't know enough about Graphite's setup to know where is best.
We can build the specta types in a build.rs eliminating the need to run cargo test which is pretty obscure and would probably lead to issues down the line
Be aware that will require either:
- Running nested cargo builds which is not supported due to the lock on the cargo directory, or
- Splitting all of your types into a different crate than the one with the
build.rsso it can import the types as a build dependency.
* Splitting all of your types into a different crate than the one with the `build.rs` so it can import the types as a build dependency.
Yeah, was thinking that we could put the build script in the frontend editor-wasm projects which uses the editor crate as its dependency. We thus have access to all types and have them in a separate crate
That sounds great!
We just need to reexport the specta types static global from the editor so we can consume in then the wasm crate but that is easy to do