From 62050ce9f686cdf1c16b783de6ef39a7a6b9701b Mon Sep 17 00:00:00 2001 From: Jordan Santell Date: Mon, 25 Mar 2024 14:16:58 -0700 Subject: [PATCH] chore: Fix potentially cyclic dependencies downstream: * Remove vestigial "getrandom" dependency * Remove "serde-deserialize" feature in "wasm-bindgen" * Make `noosphere_core::api::route` public --- Cargo.lock | 4 ---- Cargo.toml | 1 - rust/noosphere-core/Cargo.toml | 2 -- rust/noosphere-core/src/api/mod.rs | 1 + rust/noosphere-storage/Cargo.toml | 2 +- rust/noosphere-ucan/Cargo.toml | 4 ---- 6 files changed, 2 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 58146bdb5..4e7bfad92 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1579,10 +1579,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi", - "wasm-bindgen", ] [[package]] @@ -3342,7 +3340,6 @@ dependencies = [ "fastcdc", "futures", "futures-util", - "getrandom", "gloo-net", "http 1.1.0", "instant", @@ -3556,7 +3553,6 @@ dependencies = [ "cid", "ed25519-dalek", "futures", - "getrandom", "instant", "js-sys", "libipld-core", diff --git a/Cargo.toml b/Cargo.toml index e5307076e..5ee1e4f6d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,6 @@ ed25519-dalek = { version = "2" } fastcdc = { version = "3.1" } futures = { version = "^0.3.30" } futures-util = { version = "0.3" } -getrandom = { version = "~0.2", features = ["js"]} gloo-net = { version = "0.4" } gloo-timers = { version = "0.3", features = ["futures"] } ignore = { version = "0.4.20" } diff --git a/rust/noosphere-core/Cargo.toml b/rust/noosphere-core/Cargo.toml index 52ad26654..6bef116c6 100644 --- a/rust/noosphere-core/Cargo.toml +++ b/rust/noosphere-core/Cargo.toml @@ -73,8 +73,6 @@ tokio = { workspace = true, features = ["full"] } tracing-subscriber = { workspace = true } [target.'cfg(target_arch = "wasm32")'.dependencies] -# NOTE: This is needed so that rand can be included in WASM builds -getrandom = { workspace = true, features = ["js"] } gloo-net = { workspace = true } wasm-streams = { workspace = true } wasm-bindgen = { workspace = true } diff --git a/rust/noosphere-core/src/api/mod.rs b/rust/noosphere-core/src/api/mod.rs index 00d014e0c..ac4fe12ce 100644 --- a/rust/noosphere-core/src/api/mod.rs +++ b/rust/noosphere-core/src/api/mod.rs @@ -11,6 +11,7 @@ pub mod v0alpha2; pub use client::*; pub use data::*; +pub use route::*; // Re-export `http::StatusCode` here as our preferred `StatusCode` instance, // disambiguating from other crate's implementations. diff --git a/rust/noosphere-storage/Cargo.toml b/rust/noosphere-storage/Cargo.toml index e325fefb7..a0cedab4e 100644 --- a/rust/noosphere-storage/Cargo.toml +++ b/rust/noosphere-storage/Cargo.toml @@ -50,7 +50,7 @@ rocksdb = { version = "0.22.0", optional = true } [target.'cfg(target_arch = "wasm32")'.dependencies] tokio = { workspace = true, features = ["sync", "macros"] } -wasm-bindgen = { workspace = true, features = ["serde-serialize"] } +wasm-bindgen = { workspace = true } wasm-bindgen-futures = { workspace = true } serde-wasm-bindgen = { workspace = true } js-sys = { workspace = true } diff --git a/rust/noosphere-ucan/Cargo.toml b/rust/noosphere-ucan/Cargo.toml index 40d2c1322..dd99174e1 100644 --- a/rust/noosphere-ucan/Cargo.toml +++ b/rust/noosphere-ucan/Cargo.toml @@ -53,10 +53,6 @@ wasm-bindgen = { workspace = true, optional = true } wasm-bindgen-futures = { workspace = true, optional = true } js-sys = { workspace = true, optional = true } -[target.'cfg(target_arch = "wasm32")'.dependencies] -# NOTE: This is needed so that rand can be included in WASM builds -getrandom = { workspace = true, features = ["js"] } - [dev-dependencies] serde_ipld_dagcbor = { workspace = true } wasm-bindgen-test = { workspace = true }