Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make bolt-sidecar package a Cargo workspace #706

Open
thedevbirb opened this issue Jan 20, 2025 · 3 comments · May be fixed by #739
Open

Make bolt-sidecar package a Cargo workspace #706

thedevbirb opened this issue Jan 20, 2025 · 3 comments · May be fixed by #739
Labels
C: bolt-sidecar Component: bolt-sidecar T: chore Type: Chore

Comments

@thedevbirb
Copy link
Contributor

Currently the bolt-sidecar is one big crate. As the project is becoming more and more mature there are some components (like the primitives) that should become separate crates so that can be used by other projects as dependency.

For a guideline, every folder under bolt-sidecar/src could become a separate crate.

@thedevbirb thedevbirb added C: bolt-sidecar Component: bolt-sidecar D-good-first-issue Difficulty: a great choice to get started! T: chore Type: Chore labels Jan 20, 2025
@merklefruit merklefruit removed the D-good-first-issue Difficulty: a great choice to get started! label Jan 20, 2025
@mempirate
Copy link
Contributor

Would start with just bolt-common and bolt-primitives, i.e. the once we know would be used by other projects like registry, RPC etc.

@0ex-d
Copy link
Contributor

0ex-d commented Jan 24, 2025

What do you think of workspace dependency alias? I can work on this, incrementally move src/common -> crates/common.

[workspace.dependencies]
bolt-common = { path = "./crates/common" }
bolt-primitives = { path = "./crates/primitives" }

@0ex-d 0ex-d linked a pull request Jan 25, 2025 that will close this issue
@0ex-d
Copy link
Contributor

0ex-d commented Jan 25, 2025

Taking further look, here are some options, to support backward compatibility and other open PRs:

  1. Rename bolt-sidecar -> bolt-sidecar-legacy then make bolt-sidecar a workspace.
  2. Leave bolt-sidecar unchanged and create new workspace like bolt-sidecar-workspace.
  3. Gradually move packages in bolt-sidecar/src to bolt-sidecar/crates:
    a. most binaries/lib here depend on each other. (E.g bolt-common <- bolt-primitivies <- bolt-cypto <- bolt-state), might as well move all of them anyway.
    b. In Cargo.toml might have [package] and [workspace.package]

Legend:
<- : dependencies

These solutions may entail duplicated code for CI/CD.

Let me know your thoughts on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: bolt-sidecar Component: bolt-sidecar T: chore Type: Chore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants