diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 36a36cce..e68b83ce 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -49,6 +49,12 @@ jobs: with: sarif_file: clippy_result.sarif + - name: Install cargo-sort + run: cargo install cargo-sort --locked --git https://github.com/DevinR528/cargo-sort.git --rev f5047967021cbb1f822faddc355b3b07674305a1 + + - name: Cargo sort + run: cargo sort --workspace --check + - name: Set up Node uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 with: diff --git a/Cargo.toml b/Cargo.toml index f0764a06..7aa0485e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] resolver = "2" -members = ["crates/*", "bitwarden_license/*"] +members = ["bitwarden_license/*", "crates/*"] # Global settings for all crates should be defined here [workspace.package] diff --git a/crates/bitwarden-api-api/Cargo.toml b/crates/bitwarden-api-api/Cargo.toml index 43ec79ff..1c68a6cf 100644 --- a/crates/bitwarden-api-api/Cargo.toml +++ b/crates/bitwarden-api-api/Cargo.toml @@ -13,14 +13,14 @@ license-file.workspace = true keywords.workspace = true [dependencies] +reqwest = { workspace = true } serde = { workspace = true } +serde_json = { workspace = true } +serde_repr = { workspace = true } serde_with = { version = ">=3.8, <4", default-features = false, features = [ "base64", "std", "macros", ] } -serde_json = { workspace = true } -serde_repr = { workspace = true } url = ">=2.5, <3" uuid = { workspace = true } -reqwest = { workspace = true } diff --git a/crates/bitwarden-api-identity/Cargo.toml b/crates/bitwarden-api-identity/Cargo.toml index 9d4d81a0..02222545 100644 --- a/crates/bitwarden-api-identity/Cargo.toml +++ b/crates/bitwarden-api-identity/Cargo.toml @@ -13,14 +13,14 @@ license-file.workspace = true keywords.workspace = true [dependencies] +reqwest = { workspace = true } serde = { workspace = true } +serde_json = { workspace = true } +serde_repr = { workspace = true } serde_with = { version = ">=3.8, <4", default-features = false, features = [ "base64", "std", "macros", ] } -serde_json = { workspace = true } -serde_repr = { workspace = true } url = ">=2.5, <3" uuid = { workspace = true } -reqwest = { workspace = true } diff --git a/crates/bitwarden-core/Cargo.toml b/crates/bitwarden-core/Cargo.toml index fe1c6a1c..8f6338ad 100644 --- a/crates/bitwarden-core/Cargo.toml +++ b/crates/bitwarden-core/Cargo.toml @@ -16,14 +16,14 @@ license-file.workspace = true [features] internal = ["dep:zxcvbn"] no-memory-hardening = [ - "bitwarden-crypto/no-memory-hardening", + "bitwarden-crypto/no-memory-hardening" ] # Disable memory hardening features uniffi = ["bitwarden-crypto/uniffi", "dep:uniffi"] # Uniffi bindings secrets = [] # Secrets manager API wasm = [ "bitwarden-error/wasm", "dep:wasm-bindgen", - "dep:tsify-next", + "dep:tsify-next" ] # WASM support [dependencies] @@ -31,6 +31,7 @@ base64 = ">=0.22.1, <0.23" bitwarden-api-api = { workspace = true } bitwarden-api-identity = { workspace = true } bitwarden-crypto = { workspace = true } +bitwarden-error = { workspace = true } chrono = { workspace = true, features = ["std"] } # We don't use this directly (it's used by rand), but we need it here to enable WASM support getrandom = { version = ">=0.2.9, <0.3", features = ["js"] } @@ -46,14 +47,13 @@ serde_repr = { workspace = true } sha1 = ">=0.10.5, <0.11" sha2 = ">=0.10.6, <0.11" thiserror = { workspace = true } +tsify-next = { workspace = true, optional = true } uniffi = { workspace = true, optional = true, features = ["tokio"] } uuid = { workspace = true } validator = { workspace = true } wasm-bindgen = { workspace = true, optional = true } zeroize = { version = ">=1.7.0, <2.0", features = ["derive", "aarch64"] } zxcvbn = { version = ">=3.0.1, <4.0", optional = true } -tsify-next = { workspace = true, optional = true } -bitwarden-error = { workspace = true } [target.'cfg(not(target_arch="wasm32"))'.dependencies] # By default, we use rustls as the TLS stack and rust-platform-verifier to support user-installed root certificates diff --git a/crates/bitwarden-error-macro/Cargo.toml b/crates/bitwarden-error-macro/Cargo.toml index 2cdf79a5..c458ee1b 100644 --- a/crates/bitwarden-error-macro/Cargo.toml +++ b/crates/bitwarden-error-macro/Cargo.toml @@ -26,8 +26,8 @@ proc-macro = true [dev-dependencies] bitwarden-error.workspace = true +js-sys.workspace = true serde.workspace = true thiserror.workspace = true tsify-next.workspace = true -js-sys.workspace = true wasm-bindgen.workspace = true diff --git a/crates/bitwarden-error/Cargo.toml b/crates/bitwarden-error/Cargo.toml index 5c6aaa42..1f1f200c 100644 --- a/crates/bitwarden-error/Cargo.toml +++ b/crates/bitwarden-error/Cargo.toml @@ -14,7 +14,7 @@ wasm = [ "bitwarden-error-macro/wasm", "dep:js-sys", "dep:tsify-next", - "dep:wasm-bindgen", + "dep:wasm-bindgen" ] [dependencies] diff --git a/crates/bitwarden-send/Cargo.toml b/crates/bitwarden-send/Cargo.toml index 33c0b76c..7f8c9f15 100644 --- a/crates/bitwarden-send/Cargo.toml +++ b/crates/bitwarden-send/Cargo.toml @@ -17,7 +17,7 @@ keywords.workspace = true uniffi = [ "bitwarden-core/uniffi", "bitwarden-crypto/uniffi", - "dep:uniffi", + "dep:uniffi" ] # Uniffi bindings [dependencies] diff --git a/crates/bitwarden-vault/Cargo.toml b/crates/bitwarden-vault/Cargo.toml index 4481bb12..9c6f82c8 100644 --- a/crates/bitwarden-vault/Cargo.toml +++ b/crates/bitwarden-vault/Cargo.toml @@ -17,7 +17,7 @@ keywords.workspace = true uniffi = [ "bitwarden-core/uniffi", "bitwarden-crypto/uniffi", - "dep:uniffi", + "dep:uniffi" ] # Uniffi bindings wasm = ["dep:tsify-next", "dep:wasm-bindgen"] # WASM support @@ -27,8 +27,8 @@ bitwarden-api-api = { workspace = true } bitwarden-core = { workspace = true, features = ["internal"] } bitwarden-crypto = { workspace = true } chrono = { workspace = true } -rand = ">=0.8.5, <0.9" hmac = ">=0.12.1, <0.13" +rand = ">=0.8.5, <0.9" reqwest = { workspace = true } schemars = { workspace = true } serde = { workspace = true } @@ -37,9 +37,9 @@ serde_repr = { workspace = true } sha1 = ">=0.10.5, <0.11" sha2 = ">=0.10.6, <0.11" thiserror = { workspace = true } +tsify-next = { workspace = true, optional = true } uniffi = { version = "=0.28.3", optional = true } uuid = { workspace = true } -tsify-next = { workspace = true, optional = true } wasm-bindgen = { workspace = true, optional = true } [dev-dependencies] diff --git a/crates/bitwarden-wasm-internal/Cargo.toml b/crates/bitwarden-wasm-internal/Cargo.toml index a3c4f3ec..291305f0 100644 --- a/crates/bitwarden-wasm-internal/Cargo.toml +++ b/crates/bitwarden-wasm-internal/Cargo.toml @@ -18,8 +18,8 @@ crate-type = ["cdylib"] bitwarden-core = { workspace = true, features = ["wasm", "internal"] } bitwarden-crypto = { workspace = true, features = ["wasm"] } bitwarden-error = { version = "1.0.0", path = "../bitwarden-error" } -bitwarden-vault = { workspace = true, features = ["wasm"] } bitwarden-ssh = { workspace = true, features = ["wasm"] } +bitwarden-vault = { workspace = true, features = ["wasm"] } console_error_panic_hook = "0.1.7" console_log = { version = "1.0.0", features = ["color"] } js-sys = "0.3.68"