pksunkara/cargo-workspaces

Expose functionality as part of a library

mainrs opened this issue · 2 comments

I am working on tools for conventional commits and automated publishing for the Rust ecosystem. One of the parts involves working with workspaces and versioning the crates in them.

I basically derive the correct next semver version based on the git history. It would be great if I could hook into cargo-workspaces and call a method like set_next_version("krate_name", Semver::Minor) for example to bump the minor part of the version of the krate_name crate.

cargo-workspaces seems to be a binary only (main.rs). But splitting it up into a library and a binary inside the bin folder would allow for both use cases to exist at the same time.

Would you be happy to accept a PR that does the refactoring? I can see that the interest to write it yourself isn't there as you probably don't need it as a library :)

If you are against it, please let me know why! I personally don't see any shortcomings. It does increase maintenance cost I guess, but I'd be happy to step in and help out on that part as I would rely on it heavily anyway! :)

Can you describe what exactly you are trying to achieve? I am not sure if you even need this.

Are you asking for the this and related functions to be part of a lib so that it can be used by others? If yes, I would welcome a PR and would love help maintaining it.