From b7ef02e7c318b8888158e83841e20388dca0a8b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Thu, 15 Jan 2026 09:09:37 +0800 Subject: [PATCH] =?UTF-8?q?feat(color-module):=20=E6=9B=B4=E6=96=B0=20getr?= =?UTF-8?q?andom=20=E4=BE=9D=E8=B5=96=E7=89=88=E6=9C=AC=E5=B9=B6=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E6=9E=84=E5=BB=BA=E8=84=9A=E6=9C=AC=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=20RUSTFLAGS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- color-module/.cargo/config.toml | 5 +++++ color-module/Cargo.toml | 10 +++++++--- color-module/build | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 color-module/.cargo/config.toml diff --git a/color-module/.cargo/config.toml b/color-module/.cargo/config.toml new file mode 100644 index 0000000..98a10ae --- /dev/null +++ b/color-module/.cargo/config.toml @@ -0,0 +1,5 @@ +[build] +rustflags = ["--cfg", "getrandom_backend=\"wasm_js\""] + +[target.wasm32-unknown-unknown] +rustflags = ["--cfg", "getrandom_backend=\"wasm_js\""] diff --git a/color-module/Cargo.toml b/color-module/Cargo.toml index 51e2a8d..ad026a3 100644 --- a/color-module/Cargo.toml +++ b/color-module/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["cdylib"] [dependencies] color-name = "1.1.0" enum-iterator = "2.1.0" -getrandom = { version = "0.3.3", features = ["wasm_js"] } +getrandom = { version = "0.3.4", features = ["wasm_js"] } internment = { version = "0.8.6", features = ["arc"] } linked-hash-map = { version = "0.5.6", features = ["serde", "serde_impl"] } linked_hash_set = { version = "0.1.5", features = ["serde"] } @@ -22,8 +22,12 @@ serde_repr = "0.1.20" strum = { version = "0.27.1", features = ["derive", "strum_macros"] } strum_macros = "0.27.1" thiserror = "2.0.12" -wasm-bindgen = { version = "0.2.99", features = ["serde", "serde_json", "serde-serialize"] } -web-sys = {version = "0.3.77", features = ["console", "Window"]} +wasm-bindgen = { version = "0.2.99", features = [ + "serde", + "serde_json", + "serde-serialize", +] } +web-sys = { version = "0.3.77", features = ["console", "Window"] } [dev-dependencies] wasm-bindgen-test = "0.3.49" diff --git a/color-module/build b/color-module/build index 8cf31e1..adeb2cf 100755 --- a/color-module/build +++ b/color-module/build @@ -1,2 +1,2 @@ #!/bin/bash -RUSTFLAGS='--cfg getrandom_backend="wasm_js"' wasm-pack build --release --target web -d ../color_functions +wasm-pack build --release --target web -d ../color_functions