From 1bde47660d7c2c8eab9fb805a01ece0597dedccc Mon Sep 17 00:00:00 2001 From: Hinton Date: Thu, 14 Mar 2024 12:24:56 +0100 Subject: [PATCH] Extract shared information to workspace and link metadata --- Cargo.toml | 19 ++++++++++++++++++- crates/bitwarden-api-api/Cargo.toml | 14 ++++++++------ crates/bitwarden-api-identity/Cargo.toml | 14 ++++++++------ crates/bitwarden-c/Cargo.toml | 10 ++++++++-- crates/bitwarden-cli/Cargo.toml | 10 ++++++++-- crates/bitwarden-crypto/Cargo.toml | 15 ++++++++------- crates/bitwarden-exporters/Cargo.toml | 17 +++++++++-------- crates/bitwarden-generators/Cargo.toml | 17 +++++++++-------- crates/bitwarden-json/Cargo.toml | 14 ++++++++------ crates/bitwarden-napi/Cargo.toml | 18 +++++++++++------- crates/bitwarden-py/Cargo.toml | 11 +++++++++-- crates/bitwarden-uniffi/Cargo.toml | 18 ++++++++++-------- crates/bitwarden-wasm/Cargo.toml | 11 +++++++++-- crates/bitwarden/Cargo.toml | 23 ++++++++++++----------- crates/bw/Cargo.toml | 15 ++++++++------- crates/bws/Cargo.toml | 15 ++++++++------- crates/memory-testing/Cargo.toml | 11 +++++++++-- crates/sdk-schemas/Cargo.toml | 11 +++++++++-- crates/uniffi-bindgen/Cargo.toml | 11 +++++++++-- 19 files changed, 178 insertions(+), 96 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 125aac2a8..96dece43b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 diff --git a/crates/bitwarden-api-api/Cargo.toml b/crates/bitwarden-api-api/Cargo.toml index 5b8b0c773..427b4bd97 100644 --- a/crates/bitwarden-api-api/Cargo.toml +++ b/crates/bitwarden-api-api/Cargo.toml @@ -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" diff --git a/crates/bitwarden-api-identity/Cargo.toml b/crates/bitwarden-api-identity/Cargo.toml index 4f4b46732..7f09cfdb8 100644 --- a/crates/bitwarden-api-identity/Cargo.toml +++ b/crates/bitwarden-api-identity/Cargo.toml @@ -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" diff --git a/crates/bitwarden-c/Cargo.toml b/crates/bitwarden-c/Cargo.toml index 211a482e9..e3f966ee1 100644 --- a/crates/bitwarden-c/Cargo.toml +++ b/crates/bitwarden-c/Cargo.toml @@ -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"] diff --git a/crates/bitwarden-cli/Cargo.toml b/crates/bitwarden-cli/Cargo.toml index 0c32ce556..de5a4f9fc 100644 --- a/crates/bitwarden-cli/Cargo.toml +++ b/crates/bitwarden-cli/Cargo.toml @@ -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"] } diff --git a/crates/bitwarden-crypto/Cargo.toml b/crates/bitwarden-crypto/Cargo.toml index 54a9f760e..51b1d77b2 100644 --- a/crates/bitwarden-crypto/Cargo.toml +++ b/crates/bitwarden-crypto/Cargo.toml @@ -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 = [] diff --git a/crates/bitwarden-exporters/Cargo.toml b/crates/bitwarden-exporters/Cargo.toml index 40316437f..0607369d0 100644 --- a/crates/bitwarden-exporters/Cargo.toml +++ b/crates/bitwarden-exporters/Cargo.toml @@ -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", diff --git a/crates/bitwarden-generators/Cargo.toml b/crates/bitwarden-generators/Cargo.toml index 8f06de664..ae1698d0c 100644 --- a/crates/bitwarden-generators/Cargo.toml +++ b/crates/bitwarden-generators/Cargo.toml @@ -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", diff --git a/crates/bitwarden-json/Cargo.toml b/crates/bitwarden-json/Cargo.toml index 5949ce8cf..e0f0f9070 100644 --- a/crates/bitwarden-json/Cargo.toml +++ b/crates/bitwarden-json/Cargo.toml @@ -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 diff --git a/crates/bitwarden-napi/Cargo.toml b/crates/bitwarden-napi/Cargo.toml index 296f5f45f..c87eaf3d7 100644 --- a/crates/bitwarden-napi/Cargo.toml +++ b/crates/bitwarden-napi/Cargo.toml @@ -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"] @@ -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" diff --git a/crates/bitwarden-py/Cargo.toml b/crates/bitwarden-py/Cargo.toml index f954b0a20..f66a0c11f 100644 --- a/crates/bitwarden-py/Cargo.toml +++ b/crates/bitwarden-py/Cargo.toml @@ -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" diff --git a/crates/bitwarden-uniffi/Cargo.toml b/crates/bitwarden-uniffi/Cargo.toml index eb316ceca..25b2d8f07 100644 --- a/crates/bitwarden-uniffi/Cargo.toml +++ b/crates/bitwarden-uniffi/Cargo.toml @@ -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 @@ -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"] } diff --git a/crates/bitwarden-wasm/Cargo.toml b/crates/bitwarden-wasm/Cargo.toml index 547ea25ff..a688f12b6 100644 --- a/crates/bitwarden-wasm/Cargo.toml +++ b/crates/bitwarden-wasm/Cargo.toml @@ -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"] diff --git a/crates/bitwarden/Cargo.toml b/crates/bitwarden/Cargo.toml index 9950a788a..04fcf62b5 100644 --- a/crates/bitwarden/Cargo.toml +++ b/crates/bitwarden/Cargo.toml @@ -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"] @@ -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", diff --git a/crates/bw/Cargo.toml b/crates/bw/Cargo.toml index 3d2762ac3..4545546db 100644 --- a/crates/bw/Cargo.toml +++ b/crates/bw/Cargo.toml @@ -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"] } diff --git a/crates/bws/Cargo.toml b/crates/bws/Cargo.toml index 9dc6cb355..4b1e0a5c5 100644 --- a/crates/bws/Cargo.toml +++ b/crates/bws/Cargo.toml @@ -1,18 +1,19 @@ [package] name = "bws" version = "0.4.0" -edition = "2021" -rust-version = "1.71" -authors = ["Bitwarden Inc"] -license-file = "LICENSE" -repository = "https://github.com/bitwarden/sdk" -homepage = "https://bitwarden.com" description = """ Bitwarden Secrets Manager CLI """ -keywords = ["bitwarden", "secrets-manager", "cli"] +keywords = ["bitwarden", "secrets manager", "cli"] exclude = ["Dockerfile*", "entitlements.plist"] +authors.workspace = true +edition.workspace = true +rust-version.workspace = true +homepage.workspace = true +repository.workspace = true +license-file.workspace = true + [dependencies] bat = { version = "0.24.0", features = [ "regex-onig", diff --git a/crates/memory-testing/Cargo.toml b/crates/memory-testing/Cargo.toml index c1ecbbf54..120fcaad1 100644 --- a/crates/memory-testing/Cargo.toml +++ b/crates/memory-testing/Cargo.toml @@ -1,11 +1,18 @@ [package] name = "memory-testing" version = "0.1.0" -edition = "2021" 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 + [dependencies] -bitwarden-crypto = { path = "../bitwarden-crypto", version = "=0.1.0" } +bitwarden-crypto = { workspace = true } comfy-table = "7.1.0" hex = "0.4.3" serde = "1.0.196" diff --git a/crates/sdk-schemas/Cargo.toml b/crates/sdk-schemas/Cargo.toml index dda54e86a..6b5ba3c6c 100644 --- a/crates/sdk-schemas/Cargo.toml +++ b/crates/sdk-schemas/Cargo.toml @@ -1,8 +1,15 @@ [package] name = "sdk-schemas" 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 [features] internal = [ diff --git a/crates/uniffi-bindgen/Cargo.toml b/crates/uniffi-bindgen/Cargo.toml index 9809eeb72..5ef3977bc 100644 --- a/crates/uniffi-bindgen/Cargo.toml +++ b/crates/uniffi-bindgen/Cargo.toml @@ -1,8 +1,15 @@ [package] name = "uniffi-bindgen" 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 [[bin]] # This can be whatever name makes sense for your project, but the rest of this tutorial assumes uniffi-bindgen.