From 3a95456917cdb86a1eb2706bd67d9ae71b1a992c Mon Sep 17 00:00:00 2001 From: Ren Amamiya Date: Tue, 28 Jul 2026 14:03:56 +0700 Subject: [PATCH] update web --- .gitignore | 4 +- Cargo.lock | 147 ++++++------ crates/chat/src/lib.rs | 2 +- crates/person/src/lib.rs | 8 +- desktop/src/main.rs | 6 +- web/Cargo.toml | 5 +- web/Makefile | 2 +- web/script/build-wasm.sh | 13 +- web/src/lib.rs | 84 +++++++ web/src/main.rs | 77 ------ web/www/deno.lock | 396 +++++++++++++++++++++++++++++++ web/{src => }/www/index.html | 0 web/{src => }/www/main.js | 0 web/{src => }/www/package.json | 0 web/{src => }/www/vite.config.js | 2 - 15 files changed, 575 insertions(+), 171 deletions(-) create mode 100644 web/src/lib.rs delete mode 100644 web/src/main.rs create mode 100644 web/www/deno.lock rename web/{src => }/www/index.html (100%) rename web/{src => }/www/main.js (100%) rename web/{src => }/www/package.json (100%) rename web/{src => }/www/vite.config.js (97%) diff --git a/.gitignore b/.gitignore index c966a11..668a60f 100644 --- a/.gitignore +++ b/.gitignore @@ -19,8 +19,8 @@ dist/ # Useless stuffs .DS_Store -# Added by goreleaser init: -.intentionally-empty-file.o .cargo/ vendor/ +wasm/ +node_modules/ diff --git a/Cargo.lock b/Cargo.lock index af45a01..38bb576 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -457,9 +457,9 @@ dependencies = [ [[package]] name = "async-utility" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a34a3b57207a7a1007832416c3e4862378c8451b4e8e093e436f48c2d3d2c151" +checksum = "188f83b9a198af8c336e505611edb00d6d2ac5c694241c5a4f9a12316938cfe9" dependencies = [ "futures-util", "gloo-timers", @@ -1228,7 +1228,7 @@ dependencies = [ [[package]] name = "collections" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "gpui_util", "indexmap", @@ -1395,12 +1395,10 @@ dependencies = [ "settings", "state", "theme", - "tokio", "tracing-wasm", "ui", - "universal-time 0.3.0 (git+https://github.com/shadowylab/universal-time)", + "universal-time 0.3.1 (git+https://github.com/shadowylab/universal-time)", "wasm-bindgen", - "web-time", "workspace", ] @@ -1712,7 +1710,7 @@ dependencies = [ [[package]] name = "derive_refineable" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "proc-macro2", "quote", @@ -2024,11 +2022,10 @@ dependencies = [ [[package]] name = "event-listener" -version = "5.4.1" +version = "5.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" +checksum = "5a23add41df1562121a9393cb065eab5146a1242410f23a644851e90cfd669d2" dependencies = [ - "concurrent-queue", "parking", "pin-project-lite", ] @@ -2608,7 +2605,7 @@ dependencies = [ [[package]] name = "gpui" version = "0.2.2" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "accesskit", "anyhow", @@ -2690,7 +2687,7 @@ dependencies = [ [[package]] name = "gpui_linux" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "accesskit", "accesskit_unix", @@ -2742,7 +2739,7 @@ dependencies = [ [[package]] name = "gpui_macos" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "accesskit", "accesskit_macos", @@ -2791,7 +2788,7 @@ dependencies = [ [[package]] name = "gpui_macros" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -2802,7 +2799,7 @@ dependencies = [ [[package]] name = "gpui_platform" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "console_error_panic_hook", "gpui", @@ -2815,7 +2812,7 @@ dependencies = [ [[package]] name = "gpui_shared_string" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "schemars", "serde", @@ -2825,7 +2822,7 @@ dependencies = [ [[package]] name = "gpui_tokio" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "anyhow", "gpui", @@ -2836,7 +2833,7 @@ dependencies = [ [[package]] name = "gpui_util" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "anyhow", "log", @@ -2846,7 +2843,7 @@ dependencies = [ [[package]] name = "gpui_web" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "anyhow", "console_error_panic_hook", @@ -2870,7 +2867,7 @@ dependencies = [ [[package]] name = "gpui_wgpu" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "anyhow", "bytemuck", @@ -2900,7 +2897,7 @@ dependencies = [ [[package]] name = "gpui_windows" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "accesskit", "accesskit_windows", @@ -3190,7 +3187,7 @@ dependencies = [ [[package]] name = "http_client" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "anyhow", "async-compression", @@ -3210,7 +3207,7 @@ dependencies = [ [[package]] name = "http_client_tls" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "rustls", "rustls-platform-verifier", @@ -4005,7 +4002,7 @@ dependencies = [ [[package]] name = "media" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "anyhow", "bindgen", @@ -4199,7 +4196,7 @@ checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" [[package]] name = "nostr" version = "0.45.0-alpha.6" -source = "git+https://github.com/rust-nostr/nostr#d331bed1394af5f88a4d71549c4812fdcc5d90e3" +source = "git+https://github.com/rust-nostr/nostr#f9ee89e9865d10a22b06cbc087bc50f1b73a6460" dependencies = [ "aes", "base64", @@ -4217,14 +4214,14 @@ dependencies = [ "serde", "serde_json", "unicode-normalization", - "universal-time 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "universal-time 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "url", ] [[package]] name = "nostr-blossom" version = "0.45.0-alpha.6" -source = "git+https://github.com/rust-nostr/nostr#d331bed1394af5f88a4d71549c4812fdcc5d90e3" +source = "git+https://github.com/rust-nostr/nostr#f9ee89e9865d10a22b06cbc087bc50f1b73a6460" dependencies = [ "base64", "nostr", @@ -4236,7 +4233,7 @@ dependencies = [ [[package]] name = "nostr-connect" version = "0.45.0-alpha.6" -source = "git+https://github.com/rust-nostr/nostr#d331bed1394af5f88a4d71549c4812fdcc5d90e3" +source = "git+https://github.com/rust-nostr/nostr#f9ee89e9865d10a22b06cbc087bc50f1b73a6460" dependencies = [ "async-utility", "futures-core", @@ -4250,7 +4247,7 @@ dependencies = [ [[package]] name = "nostr-database" version = "0.45.0-alpha.6" -source = "git+https://github.com/rust-nostr/nostr#d331bed1394af5f88a4d71549c4812fdcc5d90e3" +source = "git+https://github.com/rust-nostr/nostr#f9ee89e9865d10a22b06cbc087bc50f1b73a6460" dependencies = [ "btreecap", "flatbuffers", @@ -4261,7 +4258,7 @@ dependencies = [ [[package]] name = "nostr-gossip" version = "0.45.0-alpha.6" -source = "git+https://github.com/rust-nostr/nostr#d331bed1394af5f88a4d71549c4812fdcc5d90e3" +source = "git+https://github.com/rust-nostr/nostr#f9ee89e9865d10a22b06cbc087bc50f1b73a6460" dependencies = [ "nostr", "opaquerr", @@ -4270,7 +4267,7 @@ dependencies = [ [[package]] name = "nostr-gossip-memory" version = "0.45.0-alpha.6" -source = "git+https://github.com/rust-nostr/nostr#d331bed1394af5f88a4d71549c4812fdcc5d90e3" +source = "git+https://github.com/rust-nostr/nostr#f9ee89e9865d10a22b06cbc087bc50f1b73a6460" dependencies = [ "indexmap", "lru", @@ -4282,7 +4279,7 @@ dependencies = [ [[package]] name = "nostr-lmdb" version = "0.45.0-alpha.6" -source = "git+https://github.com/rust-nostr/nostr#d331bed1394af5f88a4d71549c4812fdcc5d90e3" +source = "git+https://github.com/rust-nostr/nostr#f9ee89e9865d10a22b06cbc087bc50f1b73a6460" dependencies = [ "async-utility", "flume 0.12.0", @@ -4296,7 +4293,7 @@ dependencies = [ [[package]] name = "nostr-memory" version = "0.45.0-alpha.6" -source = "git+https://github.com/rust-nostr/nostr#d331bed1394af5f88a4d71549c4812fdcc5d90e3" +source = "git+https://github.com/rust-nostr/nostr#f9ee89e9865d10a22b06cbc087bc50f1b73a6460" dependencies = [ "btreecap", "nostr", @@ -4307,7 +4304,7 @@ dependencies = [ [[package]] name = "nostr-sdk" version = "0.45.0-alpha.6" -source = "git+https://github.com/rust-nostr/nostr#d331bed1394af5f88a4d71549c4812fdcc5d90e3" +source = "git+https://github.com/rust-nostr/nostr#f9ee89e9865d10a22b06cbc087bc50f1b73a6460" dependencies = [ "async-utility", "async-wsocket", @@ -4322,7 +4319,7 @@ dependencies = [ "tokio", "tokio-stream", "tracing", - "universal-time 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "universal-time 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4908,7 +4905,7 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "perf" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "collections", "serde", @@ -5719,7 +5716,7 @@ dependencies = [ [[package]] name = "refineable" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "derive_refineable", ] @@ -5801,7 +5798,7 @@ dependencies = [ [[package]] name = "reqwest_client" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "anyhow", "bytes", @@ -6116,7 +6113,7 @@ dependencies = [ [[package]] name = "scheduler" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "async-task", "backtrace", @@ -6130,9 +6127,9 @@ dependencies = [ [[package]] name = "schemars" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc" +checksum = "687274d293b6cdc6e73e0fee520bf2049650090d7164f87672d212a3c530cf4a" dependencies = [ "dyn-clone", "indexmap", @@ -6144,14 +6141,14 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d115b50f4aaeea07e79c1912f645c7513d81715d0420f8bc77a18c6260b307f" +checksum = "d98c67716b46af2f0b8cf752abc930f6f9aecfbf671ecfb531db8a31dbe4e2ba" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.119", + "syn 3.0.3", ] [[package]] @@ -6214,7 +6211,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" dependencies = [ "secp256k1-sys", - "serde", ] [[package]] @@ -6307,13 +6303,13 @@ dependencies = [ [[package]] name = "serde_derive_internals" -version = "0.29.1" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +checksum = "f852137cce035d6a4df67ccce505ff6b3e9fd3a10e3e52b24dc71e650bb1a9bd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.3", ] [[package]] @@ -6740,7 +6736,7 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "sum_tree" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "heapless 0.9.3", "log", @@ -6751,34 +6747,35 @@ dependencies = [ [[package]] name = "sval" -version = "2.20.0" +version = "2.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb9efbae90f97301f4d25f3be63dfd99d6b7af9d088228a52ec960d649b2e7d" +checksum = "ba3a370f3cd0422964fd9a19b6516f048527738e6ec50b1b0ff79b460b468390" [[package]] name = "sval_buffer" -version = "2.20.0" +version = "2.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff5c0280ea0af40b3a1fd0b532680b5067482ffb81412ee66ec04b1d9952b49a" +checksum = "111e6e2dab25782acb41b281263f5f60d6f56a2ba0b3b076187ad23a1552544d" dependencies = [ "sval", "sval_ref", + "zerocopy", ] [[package]] name = "sval_dynamic" -version = "2.20.0" +version = "2.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b9067f2e68f58e110cf8019a268057e3791cf74b0fdb1b3c7c6e49104f44e6" +checksum = "590ac4ebd299740eac453162302a494e6d5b3be243feab8bf07d0d4331b6b2b3" dependencies = [ "sval", ] [[package]] name = "sval_fmt" -version = "2.20.0" +version = "2.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ebdbf0e4b175884aa587fcf551c16dabe245ea04235abdd8cbbd160b27ed5a" +checksum = "4b964d6d917267355d7f343c515b908586e5b4aeeada328738f703452f9412d6" dependencies = [ "itoa", "ryu", @@ -6787,9 +6784,9 @@ dependencies = [ [[package]] name = "sval_json" -version = "2.20.0" +version = "2.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e448d9fa216a6c16670b28d624fbbcf5c04e41eb187bd7c52e01222ffa72a12" +checksum = "dea35e4d6b997acc7dc4786ab782f6a6c5000efe4ae93a2db89cf350775fe5fe" dependencies = [ "itoa", "ryu", @@ -6798,9 +6795,9 @@ dependencies = [ [[package]] name = "sval_nested" -version = "2.20.0" +version = "2.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "021de5b5c26efd544c694cef9b8a9abe8633481bf3be1ea145a18a740818b291" +checksum = "a73195ebd4b3e5866db2e1b75f3f383657ad5abc600c646d69b4f064fee89154" dependencies = [ "sval", "sval_buffer", @@ -6809,18 +6806,18 @@ dependencies = [ [[package]] name = "sval_ref" -version = "2.20.0" +version = "2.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54ef5ffec8bc52ded04ee424ab8d959e25e64fd40a48a16d21f8991ce824c1bb" +checksum = "c0ef28df9d586bfd15115286651337cb5645f8c203160d22d2d1a20cf13c428c" dependencies = [ "sval", ] [[package]] name = "sval_serde" -version = "2.20.0" +version = "2.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b983833a8a2390f89ebcf9b9acd06883017014b4ffd72ee28e0c9de6852039f5" +checksum = "d72fbe6537e88878f10237bde71ae4a1b65b2bf54bdf274abc566fc696334c92" dependencies = [ "serde_core", "sval", @@ -7334,9 +7331,9 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.1.2+spec-1.1.0" +version = "1.1.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" dependencies = [ "winnow 1.0.4", ] @@ -7663,14 +7660,14 @@ dependencies = [ [[package]] name = "universal-time" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f942cacf37a673350e8f252dff4691fb8e525a5fff6e1f2c4b6c2f3b8349248d" +checksum = "47a939edecc3c5a7b83c02e5f6b3c31d2bc69eabcc9a87ab12c6d37ee6dbc856" [[package]] name = "universal-time" -version = "0.3.0" -source = "git+https://github.com/shadowylab/universal-time#44737e436b17fadfeb779961e93a0828c8276c14" +version = "0.3.1" +source = "git+https://github.com/shadowylab/universal-time#394cd158556e1162806f6066fe89c413c06f9421" [[package]] name = "untrusted" @@ -7739,7 +7736,7 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "util_macros" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "perf", "quote", @@ -9472,7 +9469,7 @@ dependencies = [ [[package]] name = "zlog" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "anyhow", "chrono", @@ -9489,7 +9486,7 @@ checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" [[package]] name = "ztracing" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" dependencies = [ "tracing", "tracing-subscriber", @@ -9500,7 +9497,7 @@ dependencies = [ [[package]] name = "ztracing_macro" version = "0.1.0" -source = "git+https://github.com/zed-industries/zed#1ca8f8396b08b0121a991c710e02c81ebe3016de" +source = "git+https://github.com/zed-industries/zed#a1510de54e99131f3c33c4fd86a8e71753cf08de" [[package]] name = "zune-core" diff --git a/crates/chat/src/lib.rs b/crates/chat/src/lib.rs index 3e46c05..78e9184 100644 --- a/crates/chat/src/lib.rs +++ b/crates/chat/src/lib.rs @@ -778,7 +778,7 @@ async fn try_unwrap_with( // Verify the sealed event let seal: Event = Event::from_json(seal)?; - seal.verify_with_ctx(&SECP256K1)?; + seal.verify()?; // Get the rumor event let rumor = signer diff --git a/crates/person/src/lib.rs b/crates/person/src/lib.rs index 94d7c63..f2ebd82 100644 --- a/crates/person/src/lib.rs +++ b/crates/person/src/lib.rs @@ -1,5 +1,5 @@ -use std::cell::RefCell; use std::collections::{HashMap, HashSet}; +use std::sync::RwLock; use std::time::Duration; use anyhow::{Error, anyhow}; @@ -35,7 +35,7 @@ pub struct PersonRegistry { persons: HashMap>, /// Set of public keys that have been seen - seen: RefCell>, + seen: RwLock>, /// Sender for requesting metadata sender: flume::Sender, @@ -102,7 +102,7 @@ impl PersonRegistry { Self { persons: HashMap::new(), - seen: RefCell::new(HashSet::new()), + seen: RwLock::new(HashSet::new()), sender: metadata_tx, tasks, } @@ -280,7 +280,7 @@ impl PersonRegistry { let public_key = *public_key; - if self.seen.borrow_mut().insert(public_key) { + if self.seen.write().unwrap().insert(public_key) { let sender = self.sender.clone(); // Spawn background task to request metadata diff --git a/desktop/src/main.rs b/desktop/src/main.rs index ff147c6..dd4083e 100644 --- a/desktop/src/main.rs +++ b/desktop/src/main.rs @@ -62,9 +62,6 @@ fn main() { // Open a window with default options cx.open_window(opts, |window, cx| { - // Bring the app to the foreground - cx.activate(true); - cx.new(|cx| { // Initialize components ui::init(cx); @@ -97,6 +94,9 @@ fn main() { }) }) .expect("Failed to open window. Please restart the application."); + + // Bring the app to the foreground + cx.activate(true); }); } diff --git a/web/Cargo.toml b/web/Cargo.toml index ca81120..9f43ef9 100644 --- a/web/Cargo.toml +++ b/web/Cargo.toml @@ -4,6 +4,9 @@ version.workspace = true edition.workspace = true publish.workspace = true +[lib] +crate-type = ["cdylib", "rlib"] + [dependencies] workspace = { path = "../crates/workspace" } assets = { path = "../crates/assets" } @@ -27,10 +30,8 @@ tracing-wasm = "0.2" console_log = "1.0" wasm-bindgen = "0.2" universal-time = { git = "https://github.com/shadowylab/universal-time" } -web-time = "1.1.0" [target.'cfg(target_arch = "wasm32")'.dependencies] getrandom_0_2 = { package = "getrandom", version = "0.2", features = ["js"] } getrandom_0_3 = { package = "getrandom", version = "0.3", features = ["wasm_js"] } getrandom_0_4 = { package = "getrandom", version = "0.4", features = ["wasm_js"] } -tokio = { version = "1", default-features = false, features = ["sync", "macros", "io-util", "rt", "time"] } diff --git a/web/Makefile b/web/Makefile index 0b2a314..df98c60 100644 --- a/web/Makefile +++ b/web/Makefile @@ -38,7 +38,7 @@ preview: ## Preview production build clean: ## Clean build artifacts @echo "Cleaning build artifacts..." @rm -rf www/dist - @rm -rf www/src/wasm/*.js www/src/wasm/*.wasm + @rm -rf www/wasm/*.js www/wasm/*.wasm @cargo clean watch-wasm: ## Watch Rust code changes and auto-rebuild WASM diff --git a/web/script/build-wasm.sh b/web/script/build-wasm.sh index 6eb507a..931a85a 100755 --- a/web/script/build-wasm.sh +++ b/web/script/build-wasm.sh @@ -38,7 +38,9 @@ fi # Step 1: Build WASM echo -e "${GREEN}Step 1: Building WASM...${NC}" cd "$PROJECT_ROOT" -cargo build --target wasm32-unknown-unknown $RELEASE_FLAG +export CARGO_TARGET_DIR="$PROJECT_ROOT/target" +RUSTFLAGS='-C target-feature=+atomics,+bulk-memory -C link-arg=--shared-memory -C link-arg=--max-memory=4294967296 -C link-arg=--import-memory -C link-arg=--export=__heap_base -C link-arg=--export=__wasm_init_tls -C link-arg=--export=__tls_size -C link-arg=--export=__tls_align -C link-arg=--export=__tls_base' \ + cargo build --target wasm32-unknown-unknown $RELEASE_FLAG # Determine the build directory if [[ "$RELEASE_FLAG" == "--release" ]]; then @@ -48,8 +50,7 @@ else fi # WASM file is in workspace target directory -WORKSPACE_ROOT="$PROJECT_ROOT/../.." -WASM_PATH="$WORKSPACE_ROOT/target/wasm32-unknown-unknown/$BUILD_MODE/coop_web.wasm" +WASM_PATH="$PROJECT_ROOT/target/wasm32-unknown-unknown/$BUILD_MODE/coop_web.wasm" # Check if WASM file exists if [[ ! -f "$WASM_PATH" ]]; then @@ -57,10 +58,14 @@ if [[ ! -f "$WASM_PATH" ]]; then exit 1 fi +# Step 1.5: Force shared memory (linker --shared-memory is not working) +echo -e "${GREEN}Step 1.5: Enabling shared memory...${NC}" +wasm-opt --enable-threads "$WASM_PATH" -o "$WASM_PATH" + # Step 2: Generate JavaScript bindings echo -e "${GREEN}Step 2: Generating JavaScript bindings...${NC}" wasm-bindgen "$WASM_PATH" \ - --out-dir "$PROJECT_ROOT/www/src/wasm" \ + --out-dir "$PROJECT_ROOT/www/wasm" \ --target web \ --no-typescript diff --git a/web/src/lib.rs b/web/src/lib.rs new file mode 100644 index 0000000..8c95556 --- /dev/null +++ b/web/src/lib.rs @@ -0,0 +1,84 @@ +use gpui::*; +use ui::{Root, v_flex}; +use universal_time::{ + Duration, Instant, MonotonicClock, SystemTime, WallClock, define_time_provider, +}; +use wasm_bindgen::prelude::*; + +struct CustomTimeProvider; + +impl WallClock for CustomTimeProvider { + fn system_time(&self) -> SystemTime { + SystemTime::from_unix_duration(Duration::from_secs(0)) + } +} + +impl MonotonicClock for CustomTimeProvider { + fn instant(&self) -> Instant { + Instant::from_ticks(Duration::from_secs(0)) + } +} + +define_time_provider!(CustomTimeProvider); + +#[wasm_bindgen] +pub fn run() -> Result<(), JsValue> { + console_error_panic_hook::set_once(); + + // Initialize logging to browser console + console_log::init_with_level(log::Level::Info).expect("Failed to initialize logger"); + + // Also initialize tracing for WASM + tracing_wasm::set_as_global_default(); + + #[cfg(target_family = "wasm")] + gpui_platform::web_init(); + #[cfg(not(target_family = "wasm"))] + let app = gpui_platform::application(); + #[cfg(target_family = "wasm")] + let app = { + let app = gpui_platform::single_threaded_web(); + // Temporary fix: intentionally leak the `Rc` to keep the application alive + struct WasmApplication(std::rc::Rc); + let wasm_app = unsafe { std::mem::transmute::(app) }; + std::mem::forget(wasm_app.0.clone()); + unsafe { std::mem::transmute::(wasm_app) } + }; + + app.run(|cx| { + // Initialize components + ui::init(cx); + + // Initialize theme registry + theme::init(cx); + + // Open the root window + cx.open_window(WindowOptions::default(), |window, cx| { + let view = cx.new(HelloWeb::new); + cx.new(|cx| Root::new(view.into(), window, cx)) + }) + .expect("Failed to open window. Please restart the application."); + + cx.activate(true); + }); + + Ok(()) +} + +struct HelloWeb {} + +impl HelloWeb { + fn new(_cx: &mut Context) -> Self { + Self {} + } +} + +impl Render for HelloWeb { + fn render(&mut self, _window: &mut Window, _cx: &mut Context) -> impl IntoElement { + v_flex() + .size_full() + .items_center() + .justify_center() + .child("Hello web") + } +} diff --git a/web/src/main.rs b/web/src/main.rs deleted file mode 100644 index 9918322..0000000 --- a/web/src/main.rs +++ /dev/null @@ -1,77 +0,0 @@ -use gpui::*; -use ui::Root; -use universal_time::{ - Duration, Instant, MonotonicClock, SystemTime, WallClock, define_time_provider, -}; -use wasm_bindgen::prelude::*; - -struct CustomTimeProvider; - -impl WallClock for CustomTimeProvider { - fn system_time(&self) -> SystemTime { - SystemTime::from_unix_duration(Duration::from_secs(0)) - } -} - -impl MonotonicClock for CustomTimeProvider { - fn instant(&self) -> Instant { - Instant::from_ticks(Duration::from_secs(0)) - } -} - -define_time_provider!(CustomTimeProvider); - -fn main() { - // Binary entry point, actual initialization happens in `run()` below, - // which is called explicitly from JavaScript after the WASM module loads. -} - -#[wasm_bindgen] -pub fn run() -> Result<(), JsValue> { - console_error_panic_hook::set_once(); - - // Initialize logging to browser console - console_log::init_with_level(log::Level::Info).expect("Failed to initialize logger"); - - // Also initialize tracing for WASM - tracing_wasm::set_as_global_default(); - - #[cfg(target_family = "wasm")] - gpui_platform::web_init(); - - gpui_platform::application().run(|cx| { - cx.open_window(WindowOptions::default(), |window, cx| { - cx.new(|cx| { - // Initialize components - ui::init(cx); - - // Initialize theme registry - theme::init(cx); - - // Initialize settings - settings::init(window, cx); - - // Initialize the nostr client - state::init(window, cx); - - // Initialize person registry - person::init(window, cx); - - // Initialize device signer - // - // NIP-4e: https://github.com/nostr-protocol/nips/blob/per-device-keys/4e.md - device::init(window, cx); - - // Initialize app registry - chat::init(window, cx); - - // Root Entity - Root::new(workspace::init(window, cx).into(), window, cx) - }) - }) - .expect("Failed to open window. Please restart the application."); - cx.activate(true); - }); - - Ok(()) -} diff --git a/web/www/deno.lock b/web/www/deno.lock new file mode 100644 index 0000000..8378c05 --- /dev/null +++ b/web/www/deno.lock @@ -0,0 +1,396 @@ +{ + "version": "5", + "specifiers": { + "npm:vite-plugin-static-copy@^3.2.0": "3.4.0_vite@8.1.5", + "npm:vite-plugin-wasm@^3.3.0": "3.6.0_vite@8.1.5", + "npm:vite@8": "8.1.5" + }, + "npm": { + "@emnapi/core@1.11.1": { + "integrity": "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==", + "dependencies": [ + "@emnapi/wasi-threads", + "tslib" + ] + }, + "@emnapi/runtime@1.11.1": { + "integrity": "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==", + "dependencies": [ + "tslib" + ] + }, + "@emnapi/wasi-threads@1.2.2": { + "integrity": "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==", + "dependencies": [ + "tslib" + ] + }, + "@napi-rs/wasm-runtime@1.1.6_@emnapi+core@1.11.1_@emnapi+runtime@1.11.1": { + "integrity": "sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==", + "dependencies": [ + "@emnapi/core", + "@emnapi/runtime", + "@tybys/wasm-util" + ] + }, + "@oxc-project/types@0.139.0": { + "integrity": "sha512-r9gHphtCs+1M7J0pw6Sn/hh/Wpa/iQrOOkrNAlVLF/gHq+/CJmHIWKKUUhdWjcD6CIa8idarspCsASiXCXvFUw==" + }, + "@rolldown/binding-android-arm64@1.1.5": { + "integrity": "sha512-lZg8fqIv2v7FF237bwMgzGZEJvGL79/s5knJ/i6FmsGF4XXlzccZ4jb+TrFIxtSSxFtIpdsgrPZeMk1I9AFcyQ==", + "os": ["android"], + "cpu": ["arm64"] + }, + "@rolldown/binding-darwin-arm64@1.1.5": { + "integrity": "sha512-51Bnx9pNiMRKSUNtBfySkNJ9vMU9Hh3I1ozDd6gyPPYzaXCfnptUcEZxXGYFn+ul2dtcMUiqGR1Yai2K10uoTw==", + "os": ["darwin"], + "cpu": ["arm64"] + }, + "@rolldown/binding-darwin-x64@1.1.5": { + "integrity": "sha512-Tm+gbfC0aHu1tBA/JvKQh32S0K6YgCHkiAF4/W6xX0K0RmNuc94VeK419dJoE65R5aRxmo+noZQSWrAMF6yb6g==", + "os": ["darwin"], + "cpu": ["x64"] + }, + "@rolldown/binding-freebsd-x64@1.1.5": { + "integrity": "sha512-JMzDKCCXq93YccG5gz3hvOs1oXRKAf0XYpfOS88e+wZrC8Iugj6j68867vrYZkvpDDpKn/KoKORThmchMpF6TA==", + "os": ["freebsd"], + "cpu": ["x64"] + }, + "@rolldown/binding-linux-arm-gnueabihf@1.1.5": { + "integrity": "sha512-uML21j2K5TfPGutKxub+M+nLjZIrWjXQ5Grx4lCe/nimTj9B4L63zHpjXLl4y0L3mcm2htEQIb06oCG/szerNw==", + "os": ["linux"], + "cpu": ["arm"] + }, + "@rolldown/binding-linux-arm64-gnu@1.1.5": { + "integrity": "sha512-navSiuTMogvnQoZoM/v+l3ZWo50/NTwSHSzheABx/RCnmUPaKwq9qSo4Br2OYRs21+Fz8uFqITZM3H4opOB0/Q==", + "os": ["linux"], + "cpu": ["arm64"] + }, + "@rolldown/binding-linux-arm64-musl@1.1.5": { + "integrity": "sha512-lAryqH7IteztmCXQXk0etKj4wBQ7Gx5S6LjKhsgp9zb8I5bsuvU/2llH1hDQcjsFeqIsovMVN339/8pUDDBXxA==", + "os": ["linux"], + "cpu": ["arm64"] + }, + "@rolldown/binding-linux-ppc64-gnu@1.1.5": { + "integrity": "sha512-fsK/sNBnxzBlL4O1JNrZakVQxPspqpED5dLtNsZS9oOKmtSpdNIzxH2kkol5HYTWJN47sE20ztMJPxfZ89qGOg==", + "os": ["linux"], + "cpu": ["ppc64"] + }, + "@rolldown/binding-linux-s390x-gnu@1.1.5": { + "integrity": "sha512-gLYb4BIadlfTOYT5gO503n8zQjXflgzpD0FcyKh0Mzx3rqCZKnHoJWV9xe1KXUJ5lx2JfcSHr/mhzS0PC/McAA==", + "os": ["linux"], + "cpu": ["s390x"] + }, + "@rolldown/binding-linux-x64-gnu@1.1.5": { + "integrity": "sha512-FjcpEKUyJygHgs1o50VYNvkt5+7Le/VEdYt0AkRpkL33MnyQfwr8l5mXwMmfmTbyMPr5vJLC+8/Gd9gXnwU1QQ==", + "os": ["linux"], + "cpu": ["x64"] + }, + "@rolldown/binding-linux-x64-musl@1.1.5": { + "integrity": "sha512-Me+PfPI2TMeOQk0gYWfLQZtTktrmzbr8cDboqX83XKc7UrgAi55gF+2dUkWdxd19n55Essp2yeca+O9N5rBxHg==", + "os": ["linux"], + "cpu": ["x64"] + }, + "@rolldown/binding-openharmony-arm64@1.1.5": { + "integrity": "sha512-yc5WrLzXks6zCQfn9Oxr8pORKyl/pF+QjHmW/Qx3qu0oyrrNC+y2JLTU1E2rcWYAmzlnqngWXHQjy51VzW70Vw==", + "os": ["openharmony"], + "cpu": ["arm64"] + }, + "@rolldown/binding-wasm32-wasi@1.1.5": { + "integrity": "sha512-VbQGPX2b4r48TAMIM2cjgluIM1HYutm4pcTEJsle7iEP7sB1dFqtPLBVbdLAZCxy1txCcPxf4QFf4v8uvltPqA==", + "dependencies": [ + "@emnapi/core", + "@emnapi/runtime", + "@napi-rs/wasm-runtime" + ], + "cpu": ["wasm32"] + }, + "@rolldown/binding-win32-arm64-msvc@1.1.5": { + "integrity": "sha512-gHv82k63z4qpV5+Q1y/12KrK0ltWBukVDI8nZcbT7Tt/ZlOIVwppazneq0F93oDxTo3IgAMEDIoQh3E2n6mVsw==", + "os": ["win32"], + "cpu": ["arm64"] + }, + "@rolldown/binding-win32-x64-msvc@1.1.5": { + "integrity": "sha512-tTZuDBPw85tEN5PQi1pnEBzDy0Z49HtScLAbD5t6hyeU92A95pRWaSMw1GZZi/RwgSgUIl0xrSlXIT/9QzvYSA==", + "os": ["win32"], + "cpu": ["x64"] + }, + "@rolldown/pluginutils@1.0.1": { + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==" + }, + "@tybys/wasm-util@0.10.3": { + "integrity": "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==", + "dependencies": [ + "tslib" + ] + }, + "anymatch@3.1.3": { + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dependencies": [ + "normalize-path", + "picomatch@2.3.2" + ] + }, + "binary-extensions@2.3.0": { + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==" + }, + "braces@3.0.3": { + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dependencies": [ + "fill-range" + ] + }, + "chokidar@3.6.0": { + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dependencies": [ + "anymatch", + "braces", + "glob-parent", + "is-binary-path", + "is-glob", + "normalize-path", + "readdirp" + ], + "optionalDependencies": [ + "fsevents" + ] + }, + "detect-libc@2.1.2": { + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==" + }, + "fdir@6.5.0_picomatch@4.0.5": { + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dependencies": [ + "picomatch@4.0.5" + ], + "optionalPeers": [ + "picomatch@4.0.5" + ] + }, + "fill-range@7.1.1": { + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dependencies": [ + "to-regex-range" + ] + }, + "fsevents@2.3.3": { + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "os": ["darwin"], + "scripts": true + }, + "glob-parent@5.1.2": { + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": [ + "is-glob" + ] + }, + "is-binary-path@2.1.0": { + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dependencies": [ + "binary-extensions" + ] + }, + "is-extglob@2.1.1": { + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" + }, + "is-glob@4.0.3": { + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": [ + "is-extglob" + ] + }, + "is-number@7.0.0": { + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "lightningcss-android-arm64@1.33.0": { + "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", + "os": ["android"], + "cpu": ["arm64"] + }, + "lightningcss-darwin-arm64@1.33.0": { + "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", + "os": ["darwin"], + "cpu": ["arm64"] + }, + "lightningcss-darwin-x64@1.33.0": { + "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", + "os": ["darwin"], + "cpu": ["x64"] + }, + "lightningcss-freebsd-x64@1.33.0": { + "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", + "os": ["freebsd"], + "cpu": ["x64"] + }, + "lightningcss-linux-arm-gnueabihf@1.33.0": { + "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", + "os": ["linux"], + "cpu": ["arm"] + }, + "lightningcss-linux-arm64-gnu@1.33.0": { + "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", + "os": ["linux"], + "cpu": ["arm64"] + }, + "lightningcss-linux-arm64-musl@1.33.0": { + "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", + "os": ["linux"], + "cpu": ["arm64"] + }, + "lightningcss-linux-x64-gnu@1.33.0": { + "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", + "os": ["linux"], + "cpu": ["x64"] + }, + "lightningcss-linux-x64-musl@1.33.0": { + "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", + "os": ["linux"], + "cpu": ["x64"] + }, + "lightningcss-win32-arm64-msvc@1.33.0": { + "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", + "os": ["win32"], + "cpu": ["arm64"] + }, + "lightningcss-win32-x64-msvc@1.33.0": { + "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", + "os": ["win32"], + "cpu": ["x64"] + }, + "lightningcss@1.33.0": { + "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", + "dependencies": [ + "detect-libc" + ], + "optionalDependencies": [ + "lightningcss-android-arm64", + "lightningcss-darwin-arm64", + "lightningcss-darwin-x64", + "lightningcss-freebsd-x64", + "lightningcss-linux-arm-gnueabihf", + "lightningcss-linux-arm64-gnu", + "lightningcss-linux-arm64-musl", + "lightningcss-linux-x64-gnu", + "lightningcss-linux-x64-musl", + "lightningcss-win32-arm64-msvc", + "lightningcss-win32-x64-msvc" + ] + }, + "nanoid@3.3.16": { + "integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==", + "bin": true + }, + "normalize-path@3.0.0": { + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + }, + "p-map@7.0.6": { + "integrity": "sha512-I4Prw6ivkd6p8PiYR1tXASOAOBzIJwu0TB7fqaX0c/8c3QAehNYmX57EijyGGGBt3c/BIowGwV03RVBtXvHEVg==" + }, + "picocolors@1.1.1": { + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" + }, + "picomatch@2.3.2": { + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==" + }, + "picomatch@4.0.5": { + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==" + }, + "postcss@8.5.23": { + "integrity": "sha512-g50586zr4bZmwFiTlflMu8E0bDTb5I5gertgwAKmsdUlTQIhZtunzUlD1WSzwcVWPoAVpsrA6vlfCD7oXvRwgg==", + "dependencies": [ + "nanoid", + "picocolors", + "source-map-js" + ] + }, + "readdirp@3.6.0": { + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dependencies": [ + "picomatch@2.3.2" + ] + }, + "rolldown@1.1.5": { + "integrity": "sha512-t9z29cJjXf/vxQ8dyhCSpt6H6aSwHTk8cT5I3iy6SMXuFpk5mB6PL6XfC8PCwrPTx93udwKUm9HRteAlTGBLiA==", + "dependencies": [ + "@oxc-project/types", + "@rolldown/pluginutils" + ], + "optionalDependencies": [ + "@rolldown/binding-android-arm64", + "@rolldown/binding-darwin-arm64", + "@rolldown/binding-darwin-x64", + "@rolldown/binding-freebsd-x64", + "@rolldown/binding-linux-arm-gnueabihf", + "@rolldown/binding-linux-arm64-gnu", + "@rolldown/binding-linux-arm64-musl", + "@rolldown/binding-linux-ppc64-gnu", + "@rolldown/binding-linux-s390x-gnu", + "@rolldown/binding-linux-x64-gnu", + "@rolldown/binding-linux-x64-musl", + "@rolldown/binding-openharmony-arm64", + "@rolldown/binding-wasm32-wasi", + "@rolldown/binding-win32-arm64-msvc", + "@rolldown/binding-win32-x64-msvc" + ], + "bin": true + }, + "source-map-js@1.2.1": { + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==" + }, + "tinyglobby@0.2.17": { + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dependencies": [ + "fdir", + "picomatch@4.0.5" + ] + }, + "to-regex-range@5.0.1": { + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": [ + "is-number" + ] + }, + "tslib@2.8.1": { + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" + }, + "vite-plugin-static-copy@3.4.0_vite@8.1.5": { + "integrity": "sha512-ekryzCw0ouAOE8tw4RvVL/dfqguXzumsV3FBKoKso4MQ1MUUrUXtl5RI4KpJQUNGqFEsg9kxl4EvDl02YtA9VQ==", + "dependencies": [ + "chokidar", + "p-map", + "picocolors", + "tinyglobby", + "vite" + ] + }, + "vite-plugin-wasm@3.6.0_vite@8.1.5": { + "integrity": "sha512-mL/QPziiIA4RAA6DkaZZzOstdwbW5jO4Vz7Zenj0wieKWBlNvIvX5L5ljum9lcUX0ShNfBgCNLKTjNkRVVqcsw==", + "dependencies": [ + "vite" + ] + }, + "vite@8.1.5": { + "integrity": "sha512-7ULLwsCdYx/nRyrpiEwvqb5TFHrMVZyBt+rg/OAXT7rgj/z+DtTDyKFeLAdDkubDVDKD8jOsndmy7m55XcfUsw==", + "dependencies": [ + "lightningcss", + "picomatch@4.0.5", + "postcss", + "rolldown", + "tinyglobby" + ], + "optionalDependencies": [ + "fsevents" + ], + "bin": true + } + }, + "workspace": { + "packageJson": { + "dependencies": [ + "npm:vite-plugin-static-copy@^3.2.0", + "npm:vite-plugin-wasm@^3.3.0", + "npm:vite@8" + ] + } + } +} diff --git a/web/src/www/index.html b/web/www/index.html similarity index 100% rename from web/src/www/index.html rename to web/www/index.html diff --git a/web/src/www/main.js b/web/www/main.js similarity index 100% rename from web/src/www/main.js rename to web/www/main.js diff --git a/web/src/www/package.json b/web/www/package.json similarity index 100% rename from web/src/www/package.json rename to web/www/package.json diff --git a/web/src/www/vite.config.js b/web/www/vite.config.js similarity index 97% rename from web/src/www/vite.config.js rename to web/www/vite.config.js index 34f3075..b5b0203 100644 --- a/web/src/www/vite.config.js +++ b/web/www/vite.config.js @@ -1,5 +1,4 @@ import { defineConfig } from "vite"; -import wasm from "vite-plugin-wasm"; import { viteStaticCopy } from "vite-plugin-static-copy"; import path from "path"; import { fileURLToPath } from "url"; @@ -8,7 +7,6 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)); export default defineConfig({ plugins: [ - wasm(), viteStaticCopy({ targets: [ {