tools
tools copied to clipboard
📎 Use the workspace to define internal crate dependencies
Description
At the moment, in our workspace, we have internal crates that depend on others like this:
https://github.com/rome/tools/blob/1837190357aaed1a489b0c201f2b834fa187beb8/crates/rome_js_parser/Cargo.toml#L14-L20
These lines are repeated across all the Cargo.toml
. This is not maintainable when we need to update the version numbers, for example.
We want to change this by doing the following:
- move all these definitions inside the main
Cargo.toml
, at the root of the workspace, below[workspace.dependencies]
[workspace.dependencies]
rome_js_syntax = { version = "0.0.1", path = "./crates/rome_js_syntax" }
- then, change all the occurrences of our internal
rome_
creates in the variousCargo.toml
, like this:
rome_js_syntax.workspace = true
You may want to test your release script for this, cargo workspaces
stopped working when I changed to this :-(
You may want to test your release script for this,
cargo workspaces
stopped working when I changed to this :-(
Fortunately, as for now, crates are published manually, and we don't use cargo workspaces
at the moment :)
I would like to try it
@gautamprikshit1 Thank you! Go ahead! Feel free to start with one crate or all of them. If there's something that's not clear, feel free to ask
@ematipico I am having issues compiling it post changes.
That's been implemented