From fbaf826a9d057af1ff996bd0db1d331b82684eb1 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Mon, 26 May 2025 05:33:51 -0400 Subject: [PATCH] Only enable `js` feature of `uuid` crate for wasm crates (#18152) --- Cargo.lock | 2 ++ Cargo.toml | 3 +-- crates/ruff_wasm/Cargo.toml | 2 ++ crates/ty_wasm/Cargo.toml | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 44e8e2bf51..bab299de64 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3081,6 +3081,7 @@ dependencies = [ "ruff_workspace", "serde", "serde-wasm-bindgen", + "uuid", "wasm-bindgen", "wasm-bindgen-test", ] @@ -4071,6 +4072,7 @@ dependencies = [ "ty_ide", "ty_project", "ty_python_semantic", + "uuid", "wasm-bindgen", "wasm-bindgen-test", ] diff --git a/Cargo.toml b/Cargo.toml index f2a9343875..80f7825dc0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -179,7 +179,6 @@ uuid = { version = "1.6.1", features = [ "v4", "fast-rng", "macro-diagnostics", - "js", ] } walkdir = { version = "2.3.2" } wasm-bindgen = { version = "0.2.92" } @@ -188,7 +187,7 @@ wild = { version = "2" } zip = { version = "0.6.6", default-features = false } [workspace.metadata.cargo-shear] -ignored = ["getrandom", "ruff_options_metadata"] +ignored = ["getrandom", "ruff_options_metadata", "uuid"] [workspace.lints.rust] diff --git a/crates/ruff_wasm/Cargo.toml b/crates/ruff_wasm/Cargo.toml index b0c8fff39f..4325835cc6 100644 --- a/crates/ruff_wasm/Cargo.toml +++ b/crates/ruff_wasm/Cargo.toml @@ -41,6 +41,8 @@ getrandom = { workspace = true, features = ["wasm_js"] } serde = { workspace = true } serde-wasm-bindgen = { workspace = true } wasm-bindgen = { workspace = true } +# Not a direct dependency but required to compile for Wasm. +uuid = { workspace = true, features = ["js"] } [dev-dependencies] wasm-bindgen-test = { workspace = true } diff --git a/crates/ty_wasm/Cargo.toml b/crates/ty_wasm/Cargo.toml index 3c96fa77e8..42dfb66118 100644 --- a/crates/ty_wasm/Cargo.toml +++ b/crates/ty_wasm/Cargo.toml @@ -40,6 +40,8 @@ log = { workspace = true } # See https://docs.rs/getrandom/latest/getrandom/#webassembly-support getrandom = { workspace = true, features = ["wasm_js"] } serde-wasm-bindgen = { workspace = true } +# Not a direct dependency but required to compile for Wasm. +uuid = { workspace = true, features = ["js"] } wasm-bindgen = { workspace = true }