Programmatic usage
Could you make stylance-cli functionality into library so i can put it inside build.rs ?
This way i can use any version (even from git) of stylance generator functionality without installing binary on system
I have nothing against supporting library usage of this lib so I'll consider adding this in the future.
I recommend checking out cargo-run-bin which is a nice tool for installing binaries per rust project instead of globally, it could serve as an alternative workaround for your issue. I have not tried it with stylance but have used it with other binary tools with success.
Yeah, simply publishing a second crate, probably stylance-cli, with a lib.rs that exports the run function is enough for me. I'm not even using it in build.rs, just a cargo xtask custom script
As you suggested I've split stylance-cli run function into lib.rs. This is released in v0.5.4.
When including as a dependency you should disable the default features so that it wont bring dependencies that are only needed for the binary (such as tokio).
Let me know if this worked out for you.
@basro im not sure im going to use rust frontend in near future because of ecosystem immaturity, but its really nice you managed to do lib extraction!!! Glad to see development is happening <3
I'll close this issue as completed.