Skip to content

Commit

Permalink
Extract shared metadata to workspace and link (#661)
Browse files Browse the repository at this point in the history
- Extract shared metadata into the workspace `Cargo.toml` and link
packages to use it. This ensures we have a single point of truth and
will simplify updating.
- Added `publish = false` to all packages that are not published on
`crates.io` to prevent accidental publication.
- Remove duplicated license files
  • Loading branch information
Hinton authored Mar 15, 2024
1 parent dd440ba commit d2742c8
Show file tree
Hide file tree
Showing 29 changed files with 184 additions and 3,053 deletions.
21 changes: 20 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
[workspace]
resolver = "2"

members = ["crates/*"]

# Global settings for all crates should be defined here
[workspace.package]
authors = ["Bitwarden Inc"]
edition = "2021"
# Note: Changing rust-version should be considered a breaking change
rust-version = "1.71"
homepage = "https://bitwarden.com"
repository = "https://github.com/bitwarden/sdk"
license-file = "LICENSE"
keywords = ["bitwarden"]

# Define dependencies that are expected to be consistent across all crates
[workspace.dependencies]
bitwarden = { path = "crates/bitwarden", version = "0.4.0" }
bitwarden-api-api = { path = "crates/bitwarden-api-api", version = "0.2.3" }
bitwarden-api-identity = { path = "crates/bitwarden-api-identity", version = "=0.2.3" }
bitwarden-crypto = { path = "crates/bitwarden-crypto", version = "=0.1.0" }
bitwarden-exporters = { path = "crates/bitwarden-exporters", version = "=0.1.0" }
bitwarden-generators = { path = "crates/bitwarden-generators", version = "=0.1.0" }

# Compile all dependencies with some optimizations when building this crate on debug
# This slows down clean builds by about 50%, but the resulting binaries can be orders of magnitude faster
# As clean builds won't occur very often, this won't slow down the development process
Expand Down
14 changes: 8 additions & 6 deletions crates/bitwarden-api-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
[package]
name = "bitwarden-api-api"
version = "0.2.3"
authors = ["Bitwarden Inc"]
license-file = "LICENSE"
repository = "https://github.com/bitwarden/sdk"
homepage = "https://bitwarden.com"
description = """
Api bindings for the Bitwarden API.
"""
keywords = ["bitwarden"]
categories = ["api-bindings"]
edition = "2018"

authors.workspace = true
edition.workspace = true
rust-version.workspace = true
homepage.workspace = true
repository.workspace = true
license-file.workspace = true
keywords.workspace = true

[dependencies]
serde = ">=1.0.163, <2"
Expand Down
295 changes: 0 additions & 295 deletions crates/bitwarden-api-api/LICENSE

This file was deleted.

14 changes: 8 additions & 6 deletions crates/bitwarden-api-identity/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
[package]
name = "bitwarden-api-identity"
version = "0.2.3"
authors = ["Bitwarden Inc"]
license-file = "LICENSE"
repository = "https://github.com/bitwarden/sdk"
homepage = "https://bitwarden.com"
description = """
Api bindings for the Bitwarden Identity API.
"""
keywords = ["bitwarden"]
categories = ["api-bindings"]
edition = "2018"

authors.workspace = true
edition.workspace = true
rust-version.workspace = true
homepage.workspace = true
repository.workspace = true
license-file.workspace = true
keywords.workspace = true

[dependencies]
serde = ">=1.0.163, <2"
Expand Down
295 changes: 0 additions & 295 deletions crates/bitwarden-api-identity/LICENSE

This file was deleted.

10 changes: 8 additions & 2 deletions crates/bitwarden-c/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
[package]
name = "bitwarden-c"
version = "0.1.0"
edition = "2021"
rust-version = "1.71"
publish = false

authors.workspace = true
edition.workspace = true
rust-version.workspace = true
homepage.workspace = true
repository.workspace = true
license-file.workspace = true

[lib]
crate-type = ["lib", "staticlib", "cdylib"]
Expand Down
295 changes: 0 additions & 295 deletions crates/bitwarden-c/LICENSE

This file was deleted.

10 changes: 8 additions & 2 deletions crates/bitwarden-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
[package]
name = "bitwarden-cli"
version = "0.1.0"
edition = "2021"
rust-version = "1.71"

authors.workspace = true
edition.workspace = true
rust-version.workspace = true
homepage.workspace = true
repository.workspace = true
license-file.workspace = true
keywords.workspace = true

[dependencies]
clap = { version = "4.5.1", features = ["derive"] }
Expand Down
15 changes: 8 additions & 7 deletions crates/bitwarden-crypto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
[package]
name = "bitwarden-crypto"
version = "0.1.0"
authors = ["Bitwarden Inc"]
license-file = "LICENSE"
repository = "https://github.com/bitwarden/sdk"
homepage = "https://bitwarden.com"
description = """
Internal crate for the bitwarden crate. Do not use.
"""
keywords = ["bitwarden"]
edition = "2021"
rust-version = "1.71"

authors.workspace = true
edition.workspace = true
rust-version.workspace = true
homepage.workspace = true
repository.workspace = true
license-file.workspace = true
keywords.workspace = true

[features]
default = []
Expand Down
17 changes: 9 additions & 8 deletions crates/bitwarden-exporters/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
[package]
name = "bitwarden-exporters"
version = "0.1.0"
authors = ["Bitwarden Inc"]
license-file = "LICENSE"
repository = "https://github.com/bitwarden/sdk"
homepage = "https://bitwarden.com"
description = """
Internal crate for the bitwarden crate. Do not use.
"""
keywords = ["bitwarden"]
edition = "2021"
rust-version = "1.57"
exclude = ["/resources"]

authors.workspace = true
edition.workspace = true
rust-version.workspace = true
homepage.workspace = true
repository.workspace = true
license-file.workspace = true
keywords.workspace = true

[dependencies]
base64 = ">=0.21.2, <0.22"
bitwarden-crypto = { path = "../bitwarden-crypto", version = "=0.1.0" }
bitwarden-crypto = { workspace = true }
chrono = { version = ">=0.4.26, <0.5", features = [
"clock",
"serde",
Expand Down
17 changes: 9 additions & 8 deletions crates/bitwarden-generators/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
[package]
name = "bitwarden-generators"
version = "0.1.0"
authors = ["Bitwarden Inc"]
license-file = "LICENSE"
repository = "https://github.com/bitwarden/sdk"
homepage = "https://bitwarden.com"
description = """
Internal crate for the bitwarden crate. Do not use.
"""
keywords = ["bitwarden"]
edition = "2021"
rust-version = "1.71"

authors.workspace = true
edition.workspace = true
rust-version.workspace = true
homepage.workspace = true
repository.workspace = true
license-file.workspace = true
keywords.workspace = true

[features]
mobile = ["dep:uniffi"] # Mobile-specific features

[dependencies]
bitwarden-crypto = { path = "../bitwarden-crypto", version = "=0.1.0" }
bitwarden-crypto = { workspace = true }
rand = ">=0.8.5, <0.9"
reqwest = { version = ">=0.11, <0.12", features = [
"json",
Expand Down
18 changes: 10 additions & 8 deletions crates/bitwarden-json/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
[package]
name = "bitwarden-json"
version = "0.3.0"
authors = ["Bitwarden Inc"]
license-file = "LICENSE"
repository = "https://github.com/bitwarden/sdk"
homepage = "https://bitwarden.com"
description = """
JSON bindings for the Bitwarden Secret Manager SDK
"""
keywords = ["bitwarden", "secrets manager"]
keywords = ["bitwarden", "secrets-manager"]
categories = ["api-bindings"]
edition = "2021"
rust-version = "1.71"
publish = false

authors.workspace = true
edition.workspace = true
rust-version.workspace = true
homepage.workspace = true
repository.workspace = true
license-file.workspace = true

[features]
internal = ["bitwarden/internal"] # Internal testing methods
Expand All @@ -24,4 +26,4 @@ schemars = ">=0.8.12, <0.9"
serde = { version = ">=1.0, <2.0", features = ["derive"] }
serde_json = ">=1.0.96, <2.0"

bitwarden = { path = "../bitwarden" }
bitwarden = { workspace = true }
Loading

0 comments on commit d2742c8

Please sign in to comment.