Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

📎 Use the workspace to define internal crate dependencies #4510

Closed
ematipico opened this issue May 18, 2023 · 6 comments
Closed

📎 Use the workspace to define internal crate dependencies #4510

ematipico opened this issue May 18, 2023 · 6 comments
Assignees
Labels
A-Tooling Area: our own build, development, and release tooling good first issue Good for newcomers Help wanted Help would be really appreciated I-Easy Implementation: easy task, usually a good fit for new contributors task A task, an action that needs to be performed
Milestone

Comments

@ematipico
Copy link
Contributor

ematipico commented May 18, 2023

Description

At the moment, in our workspace, we have internal crates that depend on others like this:

rome_console = { version = "0.0.1", path = "../rome_console" }
rome_diagnostics = { version = "0.0.1", path = "../rome_diagnostics" }
rome_js_syntax = { version = "0.0.2", path = "../rome_js_syntax" }
rome_js_factory = { version = "0.0.2", path = "../rome_js_factory" }
rome_js_unicode_table = { version = "0.0.1", path = "../rome_js_unicode_table" }
rome_rowan = { version = "0.0.1", path = "../rome_rowan" }
rome_parser = { version = "0.0.1", path = "../rome_parser" }

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 ematipico added good first issue Good for newcomers Help wanted Help would be really appreciated task A task, an action that needs to be performed A-Tooling Area: our own build, development, and release tooling labels May 18, 2023
@ematipico ematipico added this to the v12.2.0 milestone May 18, 2023
@ematipico ematipico added the I-Easy Implementation: easy task, usually a good fit for new contributors label May 18, 2023
@Boshen
Copy link
Contributor

Boshen commented May 18, 2023

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

@ematipico
Copy link
Contributor Author

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

@gautamprikshit1
Copy link
Contributor

I would like to try it

@ematipico
Copy link
Contributor Author

@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

@gautamprikshit1
Copy link
Contributor

@ematipico I am having issues compiling it post changes.

@ematipico
Copy link
Contributor Author

That's been implemented

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Tooling Area: our own build, development, and release tooling good first issue Good for newcomers Help wanted Help would be really appreciated I-Easy Implementation: easy task, usually a good fit for new contributors task A task, an action that needs to be performed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants