Skip to content

Commit

Permalink
Extract shared information to workspace and link metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Hinton committed Mar 14, 2024
1 parent 07a4ceb commit 1bde476
Show file tree
Hide file tree
Showing 19 changed files with 178 additions and 96 deletions.
19 changes: 18 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
[workspace]
resolver = "2"

members = ["crates/*"]

[workspace.package]
# Global settings for all crates should be defined here
authors = ["Bitwarden Inc"]
edition = "2021"
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-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
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
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
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 = ["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
14 changes: 8 additions & 6 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"]
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 Down
18 changes: 11 additions & 7 deletions crates/bitwarden-napi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
[package]
name = "bitwarden-napi"
version = "0.3.1"
authors = ["Bitwarden Inc"]
license-file = "LICENSE"
repository = "https://github.com/bitwarden/sdk"
homepage = "https://bitwarden.com"
description = """
N-API bindings for the Bitwarden Secrets Manager SDK
"""
keywords = ["bitwarden", "secrets manager"]
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 = ["cdylib", "rlib"]
Expand All @@ -21,7 +23,9 @@ log = "0.4.20"
napi = { version = "2", features = ["async"] }
napi-derive = "2"

bitwarden-json = { path = "../bitwarden-json", version = "0.3.0", features = ["secrets"] }
bitwarden-json = { path = "../bitwarden-json", version = "0.3.0", features = [
"secrets",
] }

[build-dependencies]
napi-build = "2.1.0"
Expand Down
11 changes: 9 additions & 2 deletions crates/bitwarden-py/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
[package]
name = "bitwarden-py"
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
keywords.workspace = true

[lib]
name = "bitwarden_py"
Expand Down
18 changes: 10 additions & 8 deletions crates/bitwarden-uniffi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
[package]
name = "bitwarden-uniffi"
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

[features]
docs = ["dep:schemars"] # Docs
Expand All @@ -22,12 +28,8 @@ schemars = { version = ">=0.8, <0.9", optional = true }
uniffi = "=0.26.1"

bitwarden = { path = "../bitwarden", features = ["mobile", "internal"] }
bitwarden-crypto = { path = "../bitwarden-crypto", version = "=0.1.0", features = [
"mobile",
] }
bitwarden-generators = { path = "../bitwarden-generators", version = "=0.1.0", features = [
"mobile",
] }
bitwarden-crypto = { workspace = true, features = ["mobile"] }
bitwarden-generators = { workspace = true, features = ["mobile"] }

[build-dependencies]
uniffi = { version = "=0.26.1", features = ["build"] }
11 changes: 9 additions & 2 deletions crates/bitwarden-wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
[package]
name = "bitwarden-wasm"
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
keywords.workspace = true

[lib]
crate-type = ["cdylib"]
Expand Down
23 changes: 12 additions & 11 deletions crates/bitwarden/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
[package]
name = "bitwarden"
version = "0.4.0"
authors = ["Bitwarden Inc"]
license-file = "LICENSE"
repository = "https://github.com/bitwarden/sdk"
homepage = "https://bitwarden.com"
description = """
Bitwarden Secrets Manager SDK
"""
keywords = ["bitwarden", "secrets-manager"]
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

[features]
default = ["secrets"]
Expand All @@ -28,11 +29,11 @@ wasm-bindgen = ["chrono/wasmbind"]

[dependencies]
base64 = ">=0.21.2, <0.22"
bitwarden-api-api = { path = "../bitwarden-api-api", version = "=0.2.3" }
bitwarden-api-identity = { path = "../bitwarden-api-identity", version = "=0.2.3" }
bitwarden-crypto = { path = "../bitwarden-crypto", version = "=0.1.0" }
bitwarden-exporters = { path = "../bitwarden-exporters", version = "0.1.0" }
bitwarden-generators = { path = "../bitwarden-generators", version = "0.1.0" }
bitwarden-api-api = { workspace = true }
bitwarden-api-identity = { workspace = true }
bitwarden-crypto = { workspace = true }
bitwarden-exporters = { workspace = true }
bitwarden-generators = { workspace = true }
chrono = { version = ">=0.4.26, <0.5", features = [
"clock",
"serde",
Expand Down
15 changes: 8 additions & 7 deletions crates/bw/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
[package]
name = "bw"
version = "0.0.2"
edition = "2021"
rust-version = "1.71"
authors = ["Bitwarden Inc"]
license-file = "LICENSE"
repository = "https://github.com/bitwarden/sdk"
homepage = "https://bitwarden.com"
description = """
Bitwarden Password Manager CLI
"""
keywords = ["bitwarden", "password-manager", "cli"]
keywords = ["bitwarden", "password manager", "cli"]

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

[dependencies]
clap = { version = "4.5.1", features = ["derive", "env"] }
Expand Down
Loading

0 comments on commit 1bde476

Please sign in to comment.