diff --git a/.gitignore b/.gitignore index 1e89c72..d61eec0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ +dist target -static -result .direnv diff --git a/Cargo.lock b/Cargo.lock index 8de20f1..5ee90f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -162,26 +162,6 @@ dependencies = [ "libc", ] -[[package]] -name = "anes" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" - -[[package]] -name = "anstyle" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" - -[[package]] -name = "app" -version = "0.1.0" -dependencies = [ - "avian2d", - "bevy", -] - [[package]] name = "approx" version = "0.5.1" @@ -191,12 +171,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "arbitrary-chunks" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ad8689a486416c401ea15715a4694de30054248ec627edbf31f49cb64ee4086" - [[package]] name = "arboard" version = "3.6.1" @@ -365,96 +339,6 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" -[[package]] -name = "avian2d" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "375fa2f2b6d042bda24d6b2ecea01ef1d7c8b7b3eed5c730d3409df4778588c9" -dependencies = [ - "approx", - "arrayvec", - "avian_derive", - "bevy", - "bevy_heavy", - "bevy_math", - "bevy_transform_interpolation", - "bitflags 2.13.2", - "derive_more", - "disqualified", - "glam_matrix_extras", - "itertools 0.15.0", - "obvhs", - "parry2d", - "parry2d-f64", - "smallvec", - "thiserror 2.0.21", - "thread_local", -] - -[[package]] -name = "avian_derive" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b95522267606c85f77ba40b55735583618f7a48e873be71a934f71dd5519ce86" -dependencies = [ - "proc-macro-error3", - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "axum" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b698c5f9a010f6573133b09e0de5408834d0c82f8d7475a89fc1867a71cd90" -dependencies = [ - "axum-core", - "bytes", - "form_urlencoded", - "futures-util", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-util", - "itoa", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "serde_core", - "serde_json", - "serde_path_to_error", - "serde_urlencoded", - "sync_wrapper", - "tokio", - "tower", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "axum-core" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" -dependencies = [ - "bytes", - "futures-core", - "http", - "http-body", - "http-body-util", - "mime", - "pin-project-lite", - "sync_wrapper", - "tower-layer", - "tower-service", - "tracing", -] - [[package]] name = "bevy" version = "0.19.1" @@ -949,17 +833,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "bevy_heavy" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afbd898e2c06dfba5854db187a3daece1eaf655c8fc385604bbe5b9304ed3f9b" -dependencies = [ - "bevy_math", - "bevy_reflect", - "glam_matrix_extras", -] - [[package]] name = "bevy_image" version = "0.19.1" @@ -1176,8 +1049,8 @@ dependencies = [ "arrayvec", "bevy_reflect", "derive_more", - "glam 0.32.1", - "itertools 0.14.0", + "glam", + "itertools", "libm", "rand", "rand_distr", @@ -1206,7 +1079,7 @@ dependencies = [ "bytemuck", "derive_more", "encase", - "glam 0.32.1", + "glam", "half", "hexasphere", "thiserror 2.0.21", @@ -1355,7 +1228,7 @@ dependencies = [ "downcast-rs 2.0.2", "erased-serde", "foldhash 0.2.0", - "glam 0.32.1", + "glam", "indexmap", "inventory", "petgraph", @@ -1417,10 +1290,10 @@ dependencies = [ "derive_more", "downcast-rs 2.0.2", "encase", - "glam 0.32.1", + "glam", "image", "indexmap", - "itertools 0.14.0", + "itertools", "js-sys", "naga", "nonmax", @@ -1667,15 +1540,6 @@ dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "bevy_transform_interpolation" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea40784f1c6a3f61333064ea1d1c7663ef677c1ce46b5ca148c46c4a62c27e62" -dependencies = [ - "bevy", -] - [[package]] name = "bevy_ui" version = "0.19.1" @@ -1902,16 +1766,6 @@ dependencies = [ "cpufeatures", ] -[[package]] -name = "block-pseudorand" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2097358495d244a0643746f4d13eedba4608137008cf9dec54e53a3b700115a6" -dependencies = [ - "chiapos-chacha8", - "nanorand", -] - [[package]] name = "block2" version = "0.5.1" @@ -2013,12 +1867,6 @@ dependencies = [ "wayland-client", ] -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - [[package]] name = "cc" version = "1.5.1" @@ -2043,67 +1891,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" -[[package]] -name = "chiapos-chacha8" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33f8be573a85f6c2bc1b8e43834c07e32f95e489b914bf856c0549c3c269cd0a" -dependencies = [ - "rayon", -] - -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clap" -version = "4.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa8876b300ab35ba921adea3dfd70157a46249b33f95c9084ae5709785478946" -dependencies = [ - "clap_builder", -] - -[[package]] -name = "clap_builder" -version = "4.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0797fb7aeb1406c84efac526901f7ec3ead2124f946b494e72879d4b54704d" -dependencies = [ - "anstyle", - "clap_lex", -] - -[[package]] -name = "clap_lex" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c133bc6a41be0d194c306b5506d15e6feeea7b1d6604bd3f8310dfb2ca96486" - [[package]] name = "clipboard-win" version = "5.4.1" @@ -2277,42 +2064,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "criterion" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" -dependencies = [ - "anes", - "cast", - "ciborium", - "clap", - "criterion-plot", - "is-terminal", - "itertools 0.10.5", - "num-traits", - "once_cell", - "oorandom", - "plotters", - "rayon", - "regex", - "serde", - "serde_derive", - "serde_json", - "tinytemplate", - "walkdir", -] - -[[package]] -name = "criterion-plot" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" -dependencies = [ - "cast", - "itertools 0.10.5", -] - [[package]] name = "critical-section" version = "1.2.0" @@ -2328,25 +2079,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "crossbeam-deque" -version = "0.8.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d" -dependencies = [ - "crossbeam-utils", -] - [[package]] name = "crossbeam-queue" version = "0.3.14" @@ -2491,15 +2223,6 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34" -[[package]] -name = "ena" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabffdaee24bd1bf95c5ef7cec31260444317e72ea56c4c91750e8b7ee58d5f1" -dependencies = [ - "log", -] - [[package]] name = "encase" version = "0.12.1" @@ -2708,15 +2431,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" -[[package]] -name = "form_urlencoded" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" -dependencies = [ - "percent-encoding", -] - [[package]] name = "futures-channel" version = "0.3.34" @@ -2762,12 +2476,6 @@ dependencies = [ "syn 3.0.6", ] -[[package]] -name = "futures-sink" -version = "0.3.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d" - [[package]] name = "futures-task" version = "0.3.34" @@ -2871,7 +2579,6 @@ version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f70749695b063ecbf6b62949ccccde2e733ec3ecbbd71d467dca4e5c6c97cca0" dependencies = [ - "approx", "bytemuck", "encase", "libm", @@ -2879,37 +2586,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "glam" -version = "0.33.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928452f9c953e142b2f0973e4bd5f34445fcaa8069556ea97a3c9d34d15a4cf8" -dependencies = [ - "bytemuck", -] - -[[package]] -name = "glam_matrix_extras" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db060a7f23a5666ccbe9c770cd0e0e419b2eb94c86a7c8bfd091bacf8b4926cd" -dependencies = [ - "bevy_reflect", - "glam 0.32.1", -] - -[[package]] -name = "glamx" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59157a5886a9c68eb694df59254f7c9419c5648fc6ca1b728601a8baecc0dfcd" -dependencies = [ - "approx", - "glam 0.32.1", - "num-traits", - "simba", -] - [[package]] name = "glow" version = "0.17.0" @@ -3071,7 +2747,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "177ea6330876de4ef08e184f827b98acc037614a4ce409902c5b0d53a9c2e951" dependencies = [ "constgebra", - "glam 0.32.1", + "glam", "tinyvec", ] @@ -3081,92 +2757,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" -[[package]] -name = "http" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" -dependencies = [ - "bytes", - "itoa", -] - -[[package]] -name = "http-body" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c" -dependencies = [ - "bytes", - "http", -] - -[[package]] -name = "http-body-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23169fe34a5fbcdd3f3862e78fb9b6fccd5f02a6dc6f732547005d45631ce71c" -dependencies = [ - "bytes", - "futures-core", - "http", - "http-body", - "pin-project-lite", -] - -[[package]] -name = "http-range-header" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9171a2ea8a68358193d15dd5d70c1c10a2afc3e7e4c5bc92bc9f025cebd7359c" - -[[package]] -name = "httparse" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "hyper" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b501faa50e7a26c3d3560ca625132f4078a17771f4810baf70475ae48cbe43" -dependencies = [ - "atomic-waker", - "bytes", - "futures-channel", - "futures-core", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", -] - -[[package]] -name = "hyper-util" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc03d96684f9226b8a787cdb71488417b53ab5ea8fdb1dac946cb9431cc8bff" -dependencies = [ - "bytes", - "http", - "http-body", - "hyper", - "pin-project-lite", - "tokio", - "tower-service", -] - [[package]] name = "icu_collections" version = "2.3.0" @@ -3349,26 +2939,6 @@ dependencies = [ "rustversion", ] -[[package]] -name = "is-terminal" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.61.2", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.14.0" @@ -3378,21 +2948,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b4baf93f58d4425749ca49a51c50ebab072c5df6994d08fed93541c331481dc" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" - [[package]] name = "jni" version = "0.22.4" @@ -3593,12 +3148,6 @@ dependencies = [ "regex-automata", ] -[[package]] -name = "matchit" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" - [[package]] name = "memchr" version = "2.8.3" @@ -3614,22 +3163,6 @@ dependencies = [ "libc", ] -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "mime_guess" -version = "2.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" -dependencies = [ - "mime", - "unicase", -] - [[package]] name = "miniz_oxide" version = "0.8.9" @@ -3650,17 +3183,6 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "mio" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b18443e9c262bfe8fa82f51666e2642c53393f7e5c27b3e1aeab922cff5b9d8" -dependencies = [ - "libc", - "wasi", - "windows-sys 0.61.2", -] - [[package]] name = "moxcms" version = "0.8.1" @@ -3715,12 +3237,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "nanorand" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729eb334247daa1803e0a094d0a5c55711b85571179f5ec6e53eccfdf7008958" - [[package]] name = "ndk" version = "0.9.0" @@ -3796,26 +3312,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -4154,20 +3650,6 @@ dependencies = [ "objc2-foundation 0.2.2", ] -[[package]] -name = "obvhs" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf590a9310ba69b2340562d39f0c9bddd3677130bfd24a5df22941552e791bac" -dependencies = [ - "bytemuck", - "glam 0.33.10", - "half", - "log", - "rdst", - "static_assertions", -] - [[package]] name = "offset-allocator" version = "0.2.0" @@ -4184,12 +3666,6 @@ version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" -[[package]] -name = "oorandom" -version = "11.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" - [[package]] name = "orbclient" version = "0.3.55" @@ -4290,72 +3766,6 @@ dependencies = [ "icu_properties", ] -[[package]] -name = "parry2d" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64f0ec92e9560ebd24cbdd071e19e07a96df6a6d4970d8719cc898c7dfdc359a" -dependencies = [ - "approx", - "arrayvec", - "bitflags 2.13.2", - "downcast-rs 2.0.2", - "either", - "ena", - "foldhash 0.2.0", - "glamx", - "hashbrown 0.16.1", - "log", - "num-derive", - "num-traits", - "ordered-float", - "rayon", - "simba", - "slab", - "smallvec", - "spade", - "thiserror 2.0.21", -] - -[[package]] -name = "parry2d-f64" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9445ae064bfaad3ef13354d2f9a4a5b6e01bbbad770a18aafd38662501b289cb" -dependencies = [ - "approx", - "arrayvec", - "bitflags 2.13.2", - "downcast-rs 2.0.2", - "either", - "ena", - "foldhash 0.2.0", - "glamx", - "hashbrown 0.16.1", - "log", - "num-derive", - "num-traits", - "ordered-float", - "rayon", - "simba", - "slab", - "smallvec", - "spade", - "thiserror 2.0.21", -] - -[[package]] -name = "partition" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "947f833aaa585cf12b8ec7c0476c98784c49f33b861376ffc84ed92adebf2aba" - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - [[package]] name = "percent-encoding" version = "2.3.2" @@ -4424,34 +3834,6 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" -[[package]] -name = "plotters" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aeb6f403d7a4911efb1e33402027fc44f29b5bf6def3effcc22d7bb75f2b747" -dependencies = [ - "num-traits", - "plotters-backend", - "plotters-svg", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "plotters-backend" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df42e13c12958a16b3f7f4386b9ab1f3e7933914ecea48da7139435263a4172a" - -[[package]] -name = "plotters-svg" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51bae2ac328883f7acdfea3d66a7c35751187f870bc81f94563733a154d7a670" -dependencies = [ - "plotters-backend", -] - [[package]] name = "png" version = "0.18.1" @@ -4529,28 +3911,6 @@ dependencies = [ "toml_edit", ] -[[package]] -name = "proc-macro-error-attr3" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e564d14133360e1ae169ffde5da25881b5fa47261665b8e5713c212c27799da" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "proc-macro-error3" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0d4471b3436c22106b21913b1dda531558918ae9b7ec55d58aa84b43552233" -dependencies = [ - "proc-macro-error-attr3", - "proc-macro2", - "quote", - "syn 3.0.6", -] - [[package]] name = "proc-macro2" version = "1.0.107" @@ -4658,40 +4018,6 @@ dependencies = [ "objc2-quartz-core 0.3.2", ] -[[package]] -name = "rayon" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "rdst" -version = "0.20.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e7970b4e577b76a96d5e56b5f6662b66d1a4e1f5bb026ee118fc31b373c2752" -dependencies = [ - "arbitrary-chunks", - "block-pseudorand", - "criterion", - "partition", - "tikv-jemallocator", - "voracious_radix_sort", -] - [[package]] name = "read-fonts" version = "0.39.2" @@ -4781,12 +4107,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" -[[package]] -name = "robust" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e27ee8bb91ca0adcf0ecb116293afa12d393f9c2b9b9cd54d33e8078fe19839" - [[package]] name = "ron" version = "0.12.2" @@ -4848,21 +4168,6 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" -[[package]] -name = "ryu" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" - -[[package]] -name = "safe_arch" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323" -dependencies = [ - "bytemuck", -] - [[package]] name = "same-file" version = "1.0.6" @@ -4939,51 +4244,6 @@ dependencies = [ "syn 3.0.6", ] -[[package]] -name = "serde_json" -version = "1.0.151" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" -dependencies = [ - "itoa", - "memchr", - "serde", - "serde_core", - "zmij", -] - -[[package]] -name = "serde_path_to_error" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" -dependencies = [ - "itoa", - "serde", - "serde_core", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "server" -version = "0.1.0" -dependencies = [ - "axum", - "tokio", - "tower-http", -] - [[package]] name = "sharded-slab" version = "0.1.7" @@ -4999,29 +4259,6 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" -[[package]] -name = "signal-hook-registry" -version = "1.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" -dependencies = [ - "errno", - "libc", -] - -[[package]] -name = "simba" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c99284beb21666094ba2b75bbceda012e610f5479dfcc2d6e2426f53197ffd95" -dependencies = [ - "approx", - "num-complex", - "num-traits", - "paste", - "wide", -] - [[package]] name = "simd-adler32" version = "0.3.10" @@ -5119,28 +4356,6 @@ dependencies = [ "serde", ] -[[package]] -name = "socket2" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" -dependencies = [ - "libc", - "windows-sys 0.61.2", -] - -[[package]] -name = "spade" -version = "2.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9699399fd9349b00b184f5635b074f9ec93afffef30c853f8c875b32c0f8c7fa" -dependencies = [ - "hashbrown 0.16.1", - "num-traits", - "robust", - "smallvec", -] - [[package]] name = "spin" version = "0.10.1" @@ -5225,12 +4440,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "sync_wrapper" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" - [[package]] name = "synstructure" version = "0.14.0" @@ -5335,26 +4544,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "tikv-jemalloc-sys" -version = "0.5.4+5.3.0-patched" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9402443cb8fd499b6f327e40565234ff34dbda27460c5b47db0db77443dd85d1" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "tikv-jemallocator" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965fe0c26be5c56c94e38ba547249074803efd52adfb66de62107d95aab3eaca" -dependencies = [ - "libc", - "tikv-jemalloc-sys", -] - [[package]] name = "tiny-skia" version = "0.11.4" @@ -5391,16 +4580,6 @@ dependencies = [ "zerovec", ] -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - [[package]] name = "tinyvec" version = "1.13.3" @@ -5413,39 +4592,7 @@ version = "1.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed" dependencies = [ - "bytes", - "libc", - "mio", - "parking_lot", "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", - "windows-sys 0.61.2", -] - -[[package]] -name = "tokio-macros" -version = "2.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e" -dependencies = [ - "proc-macro2", - "quote", - "syn 3.0.6", -] - -[[package]] -name = "tokio-util" -version = "0.7.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "494815d09bf52b5548659851081238f0ca39ff638363907596da739561c62c52" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", ] [[package]] @@ -5478,66 +4625,12 @@ dependencies = [ "winnow", ] -[[package]] -name = "tower" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" -dependencies = [ - "futures-core", - "futures-util", - "pin-project-lite", - "sync_wrapper", - "tokio", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-http" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08a05a66a4fdd61cbbe0a1d755ffe0ca6aba159dd4820936a0ff8a8278245b9c" -dependencies = [ - "bitflags 2.13.2", - "bytes", - "futures-core", - "futures-util", - "http", - "http-body", - "http-body-util", - "http-range-header", - "httpdate", - "mime", - "mime_guess", - "percent-encoding", - "pin-project-lite", - "tokio", - "tokio-util", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" - -[[package]] -name = "tower-service" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" - [[package]] name = "tracing" version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ - "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -5645,12 +4738,6 @@ version = "1.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "214ca0b2191785cbc06209b9ca1861e048e39b5ba33574b3cedd58363d5bb5f6" -[[package]] -name = "unicase" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" - [[package]] name = "unicode-ident" version = "1.0.26" @@ -5722,15 +4809,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" -[[package]] -name = "voracious_radix_sort" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "446e7ffcb6c27a71d05af7e51ef2ee5b71c48424b122a832f2439651e1914899" -dependencies = [ - "rayon", -] - [[package]] name = "walkdir" version = "2.5.0" @@ -5741,12 +4819,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "wasi" -version = "0.11.1+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" - [[package]] name = "wasip2" version = "1.0.4+wasi-0.2.12" @@ -5959,6 +5031,13 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "website" +version = "0.1.0" +dependencies = [ + "bevy", +] + [[package]] name = "wgpu" version = "29.0.4" @@ -6126,16 +5205,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "wide" -version = "0.7.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5da8ecb62bcd8ec8b7ea19f69a51275e91299be594ea5cc6ef7819e16cd03" -dependencies = [ - "bytemuck", - "safe_arch", -] - [[package]] name = "winapi" version = "0.3.9" @@ -6511,9 +5580,9 @@ checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" [[package]] name = "wl-clipboard-rs" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9651471a32e87d96ef3a127715382b2d11cc7c8bb9822ded8a7cc94072eb0a3" +checksum = "4d7888ccd4896447b2d14d3a9350a85df2aeb6f181e2e7a31349d104ac46cac1" dependencies = [ "libc", "log", @@ -6712,9 +5781,3 @@ name = "zlib-rs" version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b268e58e7c693d7c271f93ffc4ba3b380412554231c85bf61ca7af91042a4112" - -[[package]] -name = "zmij" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/Cargo.toml b/Cargo.toml index b6296f5..6994992 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,10 @@ -[workspace] - members = ["app", "server"] - resolver = "3" +[package] + edition = "2024" + name = "website" + version = "0.1.0" + +[dependencies] + bevy = { version = "0.19", default-features = false, features = ["2d"] } [profile.dev.package."*"] opt-level = 3 diff --git a/Dockerfile b/Dockerfile index e5eddc3..24d960f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,70 @@ -FROM rust:1 AS builder -WORKDIR /usr/src/website -COPY . . +# syntax=docker/dockerfile:1 + +ARG RUST_VERSION=1.98.1 + +# ---- Base: Rust toolchain + build tools ---- +FROM rust:${RUST_VERSION}-slim-bookworm AS chef +WORKDIR /app RUN apt-get update \ - && apt-get install -y --no-install-recommends binaryen brotli yq \ + && apt-get install -y --no-install-recommends curl ca-certificates \ && rm -rf /var/lib/apt/lists/* -RUN rustup target add wasm32-unknown-unknown -RUN VERSION="$(tomlq -r '.package[] | select(.name == "wasm-bindgen") | .version' Cargo.lock)" \ - && cargo install wasm-bindgen-cli --version "$VERSION" +# Install the toolchain declared in rust-toolchain.toml (incl. wasm32 target) in its own layer +COPY rust-toolchain.toml . +RUN rustup show active-toolchain || rustup toolchain install -RUN ./build-wasm.sh release -RUN cargo build --release -p server +# Prebuilt binaries via cargo-binstall; wasm-bindgen-cli must match the version in Cargo.lock +RUN curl -L --proto '=https' --tlsv1.2 -sSf \ + https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash \ + && cargo binstall -y --locked cargo-chef trunk -FROM debian:trixie-slim -RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/* -COPY --from=builder /usr/src/website/target/release/server /usr/local/bin/server -COPY --from=builder /usr/src/website/static /app/static +# ---- Planner: compute the dependency recipe ---- +FROM chef AS planner +COPY . . +RUN cargo chef prepare --recipe-path recipe.json -WORKDIR /app -EXPOSE 3000 -HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \ - CMD curl -f http://localhost:3000/health || exit 1 +# ---- Builder: cook deps (cached), then build the site with trunk ---- +FROM chef AS builder +COPY --from=planner /app/recipe.json recipe.json +# Must match the flags trunk passes to cargo (see web/index.html) to reuse the cache +RUN cargo chef cook --release --target wasm32-unknown-unknown --no-default-features \ + --recipe-path recipe.json -CMD ["server"] +COPY . . +RUN mkdir -p assets +RUN --mount=type=cache,target=/root/.cache/trunk \ + trunk build --release --locked + +# ---- Runtime: static files served by nginx ---- +FROM nginx:1.29-alpine AS runtime + +COPY <<'EOF' /etc/nginx/conf.d/default.conf +server { + listen 80; + server_name _; + root /usr/share/nginx/html; + index index.html; + + gzip on; + gzip_types application/wasm application/javascript text/css; + + # Bevy expects real 404s for missing assets (Trunk.toml: no_spa = true) + location / { + try_files $uri $uri/ =404; + } + + location ~* \.(wasm|js|css)$ { + add_header Cache-Control "public, max-age=31536000, immutable"; + try_files $uri =404; + } + + location = /index.html { + add_header Cache-Control "no-cache"; + } +} +EOF + +COPY --from=builder /app/dist /usr/share/nginx/html + +EXPOSE 80 diff --git a/Trunk.toml b/Trunk.toml new file mode 100644 index 0000000..03276d1 --- /dev/null +++ b/Trunk.toml @@ -0,0 +1,9 @@ +[build] + dist = "dist" + target = "web/index.html" + +[serve] + # Required in order to receive 404s for missing assets, which is what Bevy expects. + no_spa = true + # Open a browser tab once the initial build is complete. + open = true diff --git a/app/.cargo/config.toml b/app/.cargo/config.toml deleted file mode 100644 index f4e8c00..0000000 --- a/app/.cargo/config.toml +++ /dev/null @@ -1,2 +0,0 @@ -[build] -target = "wasm32-unknown-unknown" diff --git a/app/Cargo.toml b/app/Cargo.toml deleted file mode 100644 index cbc8686..0000000 --- a/app/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] - edition = "2024" - name = "app" - version = "0.1.0" - -[dependencies] - avian2d = "0.7" - bevy = { version = "0.19", default-features = false, features = ["2d"] } diff --git a/app/src/main.rs b/app/src/main.rs deleted file mode 100644 index 3ff8460..0000000 --- a/app/src/main.rs +++ /dev/null @@ -1,176 +0,0 @@ -use avian2d::prelude::*; -use bevy::{ - input::common_conditions::input_just_pressed, - prelude::*, - window::{PrimaryWindow, WindowResized}, -}; - -fn main() { - App::new() - .insert_resource(ClearColor(Color::srgb_u8(26, 26, 46))) - .add_plugins(( - DefaultPlugins.set(WindowPlugin { - primary_window: Some(Window { - fit_canvas_to_parent: true, - prevent_default_event_handling: false, - canvas: Some("#bevy-canvas".into()), - ..default() - }), - ..default() - }), - PhysicsPlugins::default(), - )) - .insert_resource(Time::::default().with_relative_speed(5.0)) - .insert_resource(DefaultRestitution( - Restitution::PERFECTLY_ELASTIC.with_combine_rule(CoefficientCombine::Max), - )) - .add_systems(Startup, setup) - .add_systems( - Update, - ( - update_screen_edges, - spawn_ball.run_if(input_just_pressed(MouseButton::Left)), - ), - ) - .run(); -} - -#[derive(Component, Clone, Copy)] -enum ScreenEdge { - Top, - Bottom, - Left, - Right, -} - -fn setup( - mut commands: Commands, - mut meshes: ResMut>, - mut materials: ResMut>, - window: Query<&Window, With>, -) { - commands.spawn(Camera2d); - - if let Ok(window) = window.single() { - spawn_screen_edges(&mut commands, &mut meshes, &mut materials, window.size()); - } -} - -#[derive(Component, Clone, Copy)] -struct Ball; - -fn spawn_ball( - mouse_button: Res>, - window: Single<&Window, With>, - camera_query: Single<(&Camera, &GlobalTransform)>, - time: Res