tools icon indicating copy to clipboard operation
tools copied to clipboard

📎 Use the workspace to define internal crate dependencies

Open ematipico opened this issue 1 year ago • 5 comments

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 various Cargo.toml, like this:
rome_js_syntax.workspace = true

ematipico avatar May 18 '23 09:05 ematipico

You may want to test your release script for this, cargo workspaces stopped working when I changed to this :-(

Boshen avatar May 18 '23 10:05 Boshen

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 :)

ematipico avatar May 18 '23 12:05 ematipico

I would like to try it

gautamprikshit1 avatar May 19 '23 08:05 gautamprikshit1

@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 avatar May 19 '23 09:05 ematipico

@ematipico I am having issues compiling it post changes.

gautamprikshit1 avatar May 20 '23 02:05 gautamprikshit1

That's been implemented

ematipico avatar May 31 '23 09:05 ematipico