From f9cdb994de50f96ed12c2253d8f9f6be8b05516d Mon Sep 17 00:00:00 2001 From: Sam Greenbury <50113363+sgreenbury@users.noreply.github.com> Date: Tue, 28 Jan 2025 13:43:16 +0000 Subject: [PATCH] Fix trustchain path dependency versions (#224) * Adds versions to trustchain crate path deps * Adds trustchain deps as workspace deps * Revises features in trustchain crate --- Cargo.toml | 22 ++++++++++++++-------- crates/trustchain-api/Cargo.toml | 4 ++-- crates/trustchain-ffi/Cargo.toml | 8 ++++---- crates/trustchain-http/Cargo.toml | 6 +++--- crates/trustchain-ion/Cargo.toml | 2 +- src/lib.rs | 1 + 6 files changed, 25 insertions(+), 18 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c033c9a0..6a9a23a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,16 +72,22 @@ toml = "0.7.2" tower = "0.4" tracing = "0.1" tracing-subscriber = "0.3" - -[dependencies] trustchain-api = { path = "crates/trustchain-api", version = "0.1.0" } trustchain-core = { path = "crates/trustchain-core", version = "0.2.0" } -trustchain-ffi = { path = "crates/trustchain-ffi", version = "0.1.0", optional = true } -trustchain-http = { path = "crates/trustchain-http", version = "0.1.0", optional = true } -trustchain-ion = { path = "crates/trustchain-ion", version = "0.2.0", optional = true } +trustchain-ffi = { path = "crates/trustchain-ffi", version = "0.1.0" } +trustchain-http = { path = "crates/trustchain-http", version = "0.1.0" } +trustchain-ion = { path = "crates/trustchain-ion", version = "0.2.0" } + +[dependencies] +trustchain-api = { workspace = true, optional = true } +trustchain-core = { workspace = true } +trustchain-ffi = { workspace = true, optional = true } +trustchain-http = { workspace = true, optional = true } +trustchain-ion = { workspace = true, optional = true } [features] -default = [] -http = ["dep:trustchain-http"] +default = ["api", "ion"] +http = ["api", "dep:trustchain-http"] +api = ["ion", "dep:trustchain-api"] ion = ["dep:trustchain-ion"] -ffi = ["dep:trustchain-ffi"] +ffi = ["http", "dep:trustchain-ffi"] diff --git a/crates/trustchain-api/Cargo.toml b/crates/trustchain-api/Cargo.toml index 936ae8c8..af8e763e 100644 --- a/crates/trustchain-api/Cargo.toml +++ b/crates/trustchain-api/Cargo.toml @@ -18,8 +18,8 @@ hex = { workspace = true } serde_json = { workspace = true } sha2 = { workspace = true } ssi = { workspace = true, features = ["http-did", "secp256k1"] } -trustchain-core = { path = "../trustchain-core" } -trustchain-ion = { path = "../trustchain-ion" } +trustchain-core = { workspace = true } +trustchain-ion = { workspace = true } [dev-dependencies] tokio = { workspace = true, features = ["full"] } diff --git a/crates/trustchain-ffi/Cargo.toml b/crates/trustchain-ffi/Cargo.toml index 7f004b28..d79f3ff0 100644 --- a/crates/trustchain-ffi/Cargo.toml +++ b/crates/trustchain-ffi/Cargo.toml @@ -26,7 +26,7 @@ ssi = { workspace = true, features = ["http-did", "secp256k1"] } thiserror = { workspace = true } tokio = { workspace = true, features = ["rt-multi-thread"] } toml = { workspace = true } -trustchain-api = { path = "../trustchain-api" } -trustchain-core = { path = "../trustchain-core" } -trustchain-http = { path = "../trustchain-http" } -trustchain-ion = { path = "../trustchain-ion" } +trustchain-api = { workspace = true } +trustchain-core = { workspace = true } +trustchain-http = { workspace = true } +trustchain-ion = { workspace = true } diff --git a/crates/trustchain-http/Cargo.toml b/crates/trustchain-http/Cargo.toml index 993e82e0..6356108d 100644 --- a/crates/trustchain-http/Cargo.toml +++ b/crates/trustchain-http/Cargo.toml @@ -40,9 +40,9 @@ toml = { workspace = true } tower = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } -trustchain-api = { path = "../trustchain-api" } -trustchain-core = { path = "../trustchain-core" } -trustchain-ion = { path = "../trustchain-ion" } +trustchain-api = { workspace = true } +trustchain-core = { workspace = true } +trustchain-ion = { workspace = true } [dev-dependencies] axum-test-helper = { workspace = true } diff --git a/crates/trustchain-ion/Cargo.toml b/crates/trustchain-ion/Cargo.toml index 9f570cf6..87c2a5f7 100644 --- a/crates/trustchain-ion/Cargo.toml +++ b/crates/trustchain-ion/Cargo.toml @@ -34,7 +34,7 @@ ssi = { workspace = true, features = ["http-did", "secp256k1"] } thiserror = { workspace = true } tokio = { workspace = true, features = ["full"] } toml = { workspace = true } -trustchain-core = { path = "../trustchain-core" } +trustchain-core = { workspace = true } [dev-dependencies] glob = { workspace = true } diff --git a/src/lib.rs b/src/lib.rs index 4fcb6ad0..a1e3a56c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,6 @@ //! Trustchain reference implementation. +#[cfg(feature = "api")] pub use trustchain_api as api; pub use trustchain_core as core; #[cfg(feature = "ffi")]