diff --git a/Cargo.lock b/Cargo.lock index cbda72e..029c56e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,12 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "accesskit" -version = "0.14.0" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "6cf780eb737f2d4a49ffbd512324d53ad089070f813f7be7f99dbd5123a7f448" - [[package]] name = "actix-codec" version = "0.5.2" @@ -37,7 +31,7 @@ dependencies = [ "actix-web", "bitflags", "bytes", - "derive_more", + "derive_more 0.99.18", "futures-core", "http-range", "log", @@ -64,7 +58,7 @@ dependencies = [ "brotli", "bytes", "bytestring", - "derive_more", + "derive_more 0.99.18", "encoding_rs", "flate2", "futures-core", @@ -94,7 +88,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.89", + "syn 2.0.95", ] [[package]] @@ -180,7 +174,7 @@ dependencies = [ "bytestring", "cfg-if", "cookie", - "derive_more", + "derive_more 0.99.18", "encoding_rs", "futures-core", "futures-util", @@ -211,7 +205,7 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", ] [[package]] @@ -284,9 +278,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.20" +version = "0.2.21" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "45862d1c77f2228b9e10bc609d5bc203d86ebc9b87ad8d5d5167a6c9abf739d9" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "android_log-sys" @@ -296,12 +290,12 @@ checksum = "5ecc8056bf6ab9892dcd53216c83d1597487d7dacac16c8df6b877d127df9937" [[package]] name = "annotate-snippets" -version = "0.11.4" +version = "0.11.5" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "24e35ed54e5ea7997c14ed4c70ba043478db1112e98263b3b035907aa197d991" +checksum = "710e8eae58854cdc1790fcb56cca04d712a17be849eeb81da2a724bf4bae2bc4" dependencies = [ "anstyle", - "unicode-width 0.1.14", + "unicode-width 0.2.0", ] [[package]] @@ -355,9 +349,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.93" +version = "1.0.95" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "anymap2" @@ -380,6 +374,17 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "assert_type_match" +version = "0.1.1" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "f548ad2c4031f2902e3edc1f29c29e835829437de49562d8eb5dc5584d3a1043" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.95", +] + [[package]] name = "async-executor" version = "1.13.1" @@ -445,30 +450,18 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bevy" -version = "0.14.2" +version = "0.15.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "043c9ad4b6fc4ca52d779873a8ca792a4e37842d07fce95363c9e17e36a1d8a0" +checksum = "bb2a21c9f3306676077a88700bb8f354be779cf9caba9c21e94da9e696751af4" dependencies = [ "bevy_internal", ] -[[package]] -name = "bevy_a11y" -version = "0.14.2" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "ae1a976cb539d6a5a3ff579cdb78187a6bcfbffa7e8224ea28f23d8b983d9389" -dependencies = [ - "accesskit", - "bevy_app", - "bevy_derive", - "bevy_ecs", -] - [[package]] name = "bevy_app" -version = "0.14.2" +version = "0.15.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a5361d0f8a8677a5d0102cfe7321a7ecd2a8b9a4f887ce0dde1059311cf9cd42" +checksum = "454a8cfd134864dcdcba6ee56fb958531b981021bba6bb2037c9e3df6046603c" dependencies = [ "bevy_derive", "bevy_ecs", @@ -476,8 +469,9 @@ dependencies = [ "bevy_tasks", "bevy_utils", "console_error_panic_hook", + "ctrlc", + "derive_more 1.0.0", "downcast-rs", - "thiserror 1.0.69", "wasm-bindgen", "web-sys", ] @@ -490,6 +484,7 @@ dependencies = [ "actix-web", "anyhow", "cargo-generate", + "cc", "clap", "dialoguer", "fs_extra", @@ -498,15 +493,16 @@ dependencies = [ "semver", "serde", "serde_json", + "toml_edit", "wasm-opt", "webbrowser", ] [[package]] name = "bevy_core" -version = "0.14.2" +version = "0.15.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "de706862871a1fe99ea619bff2f99d73e43ad82f19ef866a9e19a14c957c8537" +checksum = "0ff28118f5ae3193f7f6cab30d4fd4246ba1802776910ab256dc7c20e8696381" dependencies = [ "bevy_app", "bevy_ecs", @@ -518,20 +514,20 @@ dependencies = [ [[package]] name = "bevy_derive" -version = "0.14.2" +version = "0.15.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "3fbfc33a4c6b80760bb8bf850a2cc65a1e031da62fd3ca8b552189104dc98514" +checksum = "b962df2a1bef274ae76ec75279eb6f8ef0ffd85b5e4c43433f5d08ba57b3d071" dependencies = [ "bevy_macro_utils", "quote", - "syn 2.0.89", + "syn 2.0.95", ] [[package]] name = "bevy_diagnostic" -version = "0.14.2" +version = "0.15.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "bebb154e0cc78e3bbfbfdb42fb502b14c1cd47e72f16e6d4228dfe6233ba6cbd" +checksum = "21fe41b22fdf47bf11f0a3ca3e61975b003e86fa44d87e070f2dc7e752dd99f5" dependencies = [ "bevy_app", "bevy_core", @@ -544,9 +540,9 @@ dependencies = [ [[package]] name = "bevy_ecs" -version = "0.14.2" +version = "0.15.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "9ee4222406637f3c8e3991a99788cfcde76097bf997c311f1b6297364057483f" +checksum = "b747210d7db09dfacc237707d4fd31c8b43d7744cd5e5829e2c4ca86b9e47baf" dependencies = [ "bevy_ecs_macros", "bevy_ptr", @@ -555,61 +551,64 @@ dependencies = [ "bevy_utils", "bitflags", "concurrent-queue", + "derive_more 1.0.0", + "disqualified", "fixedbitset 0.5.7", "nonmax", "petgraph", "serde", - "thiserror 1.0.69", + "smallvec", ] [[package]] name = "bevy_ecs_macros" -version = "0.14.2" +version = "0.15.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "36b573430b67aff7bde8292257494f39343401379bfbda64035ba4918bba7b20" +checksum = "0d36ba5874ee278d20f17b8934d2969f8fbab90f3ea3fcf8d3583814b3661ada" dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", ] [[package]] name = "bevy_hierarchy" -version = "0.14.2" +version = "0.15.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a88b912b37e1bc4dbb2aa40723199f74c8b06c4fbb6da0bb4585131df28ef66e" +checksum = "bd9aab2cd1684d30f2eedf953b6377a6416fd6b482f8145b6c05f4684bd60c3e" dependencies = [ "bevy_app", "bevy_core", "bevy_ecs", "bevy_reflect", "bevy_utils", + "disqualified", "smallvec", ] [[package]] name = "bevy_input" -version = "0.14.2" +version = "0.15.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "8dd3a54e67cc3ba17971de7b1a7e64eda84493c1e7bb6bfa11c6cf8ac124377b" +checksum = "a9bbf39c1d2d33350e03354a67bebee5c21973c5203b1456a9a4b90a5e6f8e75" dependencies = [ "bevy_app", + "bevy_core", "bevy_ecs", "bevy_math", "bevy_reflect", "bevy_utils", + "derive_more 1.0.0", "smol_str", - "thiserror 1.0.69", ] [[package]] name = "bevy_internal" -version = "0.14.2" +version = "0.15.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "45d435cac77c568f3aef65f786a5fee0e53c81950c5258182dd2c1d6cd6c4fec" +checksum = "fd7fc4db9a1793ee71f79abb15e7a8fcfe4e2081e5f18ed91b802bf6cf30e088" dependencies = [ - "bevy_a11y", "bevy_app", "bevy_core", "bevy_derive", @@ -625,7 +624,6 @@ dependencies = [ "bevy_time", "bevy_transform", "bevy_utils", - "bevy_window", ] [[package]] @@ -643,126 +641,132 @@ dependencies = [ [[package]] name = "bevy_log" -version = "0.14.2" +version = "0.15.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "67240c7596c8f0653e50fce35a60196516817449235193246599facba9002e02" +checksum = "774238dcf70a0ef4d82aa2860b24b1cffdd4633f3694d3bcbfbb05c4f17ae4fe" dependencies = [ "android_log-sys", "bevy_app", "bevy_ecs", "bevy_utils", "tracing-log", + "tracing-oslog", "tracing-subscriber", "tracing-wasm", ] [[package]] name = "bevy_macro_utils" -version = "0.14.2" +version = "0.15.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "bfc65e570012e64a21f3546df68591aaede8349e6174fb500071677f54f06630" +checksum = "9bdb3a681c24abace65bf18ed467ad8befbedb42468b32e459811bfdb01e506c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", "toml_edit", ] [[package]] name = "bevy_math" -version = "0.14.2" +version = "0.15.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "5421792749dda753ab3718e77d27bfce38443daf1850b836b97530b6245a4581" +checksum = "edec18d90e6bab27b5c6131ee03172ece75b7edd0abe4e482a26d6db906ec357" dependencies = [ "bevy_reflect", + "derive_more 1.0.0", "glam", + "itertools 0.13.0", "rand", + "rand_distr", "serde", "smallvec", - "thiserror 1.0.69", ] [[package]] name = "bevy_ptr" -version = "0.14.2" +version = "0.15.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "61baa1bdc1f4a7ac2c18217570a7cc04e1cd54d38456e91782f0371c79afe0a8" +checksum = "aa65df6a190b7dfc84d79f09cf02d47ae046fa86a613e202c31559e06d8d3710" [[package]] name = "bevy_reflect" -version = "0.14.2" +version = "0.15.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "2508785a4a5809f25a237eec4fee2c91a4dbcf81324b2bbc2d6c52629e603781" +checksum = "bab3264acc3b6f48bc23fbd09fdfea6e5d9b7bfec142e4f3333f532acf195bca" dependencies = [ + "assert_type_match", "bevy_ptr", "bevy_reflect_derive", "bevy_utils", + "derive_more 1.0.0", + "disqualified", "downcast-rs", "erased-serde", "glam", "serde", "smallvec", "smol_str", - "thiserror 1.0.69", ] [[package]] name = "bevy_reflect_derive" -version = "0.14.2" +version = "0.15.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "967d5da1882ec3bb3675353915d3da909cafac033cbf31e58727824a1ad2a288" +checksum = "42f83876a322130ab38a47d5dcf75258944bf76b3387d1acdb3750920fda63e2" dependencies = [ "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", "uuid", ] [[package]] name = "bevy_tasks" -version = "0.14.2" +version = "0.15.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "77865f310b1fc48fb05b7c4adbe76607ec01d0c14f8ab4caba4d714c86439946" +checksum = "5c28f2db2619203aa82342dbbe77e49aeea4f933212c0b7a1f285e94c4008e5b" dependencies = [ "async-executor", + "futures-channel", "futures-lite", + "pin-project", "wasm-bindgen-futures", ] [[package]] name = "bevy_time" -version = "0.14.2" +version = "0.15.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "f4e4d53ec32a1b16492396951d04de0d2d90e924bf9adcb8d1adacab5ab6c17c" +checksum = "bb3108ed1ef864bc40bc859ba4c9c3844213c7be3674f982203cf5d87c656848" dependencies = [ "bevy_app", "bevy_ecs", "bevy_reflect", "bevy_utils", "crossbeam-channel", - "thiserror 1.0.69", ] [[package]] name = "bevy_transform" -version = "0.14.2" +version = "0.15.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d5493dce84427d00a9266e8e4386d738a72ee8640423b62dfcecb6dfccbfe0d2" +checksum = "056fabcedbf0503417af69447d47a983e18c7cfb5e6b6728636be3ec285cbcfa" dependencies = [ "bevy_app", "bevy_ecs", "bevy_hierarchy", "bevy_math", "bevy_reflect", - "thiserror 1.0.69", + "derive_more 1.0.0", ] [[package]] name = "bevy_utils" -version = "0.14.2" +version = "0.15.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "ffb0ec333b5965771153bd746f92ffd8aeeb9d008a8620ffd9ed474859381a5e" +checksum = "4f01088c048960ea50ee847c3f668942ecf49ed26be12a1585a5e59b6a941d9a" dependencies = [ "ahash", "bevy_utils_proc_macros", @@ -775,29 +779,33 @@ dependencies = [ [[package]] name = "bevy_utils_proc_macros" -version = "0.14.2" +version = "0.15.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "38f1ab8f2f6f58439d260081d89a42b02690e5fdd64f814edc9417d33fcf2857" +checksum = "4a0c3244d543cc964545b7aa074f6fb18a915a7121cf3de5d7ed37a4aae8662d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", ] [[package]] -name = "bevy_window" -version = "0.14.2" +name = "bindgen" +version = "0.70.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "c89e88a20db64ea8204540afb4699295947c454738fd50293f7b32ab8be857a6" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" dependencies = [ - "bevy_a11y", - "bevy_app", - "bevy_ecs", - "bevy_math", - "bevy_reflect", - "bevy_utils", - "raw-window-handle", - "smol_str", + "bitflags", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.95", ] [[package]] @@ -847,9 +855,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.11.0" +version = "1.11.3" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "1a68f1f47cdf0ec8ee4b941b2eee2a80cb796db73118c0dd09ac63fbe405be22" +checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" dependencies = [ "memchr", "regex-automata 0.4.9", @@ -864,9 +872,9 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.20.0" +version = "1.21.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "8b37c88a63ffd85d15b406896cc343916d7cf57838a847b3a6f2ca5d39a5695a" +checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" [[package]] name = "byteorder" @@ -900,13 +908,14 @@ dependencies = [ [[package]] name = "cargo-generate" -version = "0.22.0" +version = "0.22.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "6a921a6f140ee9981c471b4ffdfc53372b8bc3fe417f83e87c124c6018ab6929" +checksum = "fd20c031c5650a045e60c7bc274aa2a20d32fd604b9265e760562ceda4bdbf26" dependencies = [ "anstyle", "anyhow", "auth-git2", + "cargo-util-schemas", "clap", "console", "dialoguer", @@ -934,7 +943,7 @@ dependencies = [ "semver", "serde", "tempfile", - "thiserror 1.0.69", + "thiserror 2.0.9", "time", "toml", "walkdir", @@ -949,6 +958,22 @@ dependencies = [ "serde", ] +[[package]] +name = "cargo-util-schemas" +version = "0.7.0" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "a7a7801ec3ee336018f3f0e66680c3681e5eb58d283e1fad2809531dda7f1ed1" +dependencies = [ + "semver", + "serde", + "serde-untagged", + "serde-value", + "thiserror 1.0.69", + "toml", + "unicode-xid", + "url", +] + [[package]] name = "cargo_metadata" version = "0.18.1" @@ -980,6 +1005,15 @@ version = "1.1.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -992,11 +1026,22 @@ version = "0.2.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clap" -version = "4.5.21" +version = "4.5.23" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" +checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" dependencies = [ "clap_builder", "clap_derive", @@ -1004,9 +1049,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.21" +version = "4.5.23" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" +checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" dependencies = [ "anstream", "anstyle", @@ -1024,20 +1069,20 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", ] [[package]] name = "clap_lex" -version = "0.7.3" +version = "0.7.4" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "clippy_utils" -version = "0.1.85" +version = "0.1.86" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "6f7bc44cade8ee3453cbb02297635ac506c6ea9eda9e5ed85c7eee8649f56bbc" +checksum = "8af2d96f902b34d144749decfdcb15187980e511e840c33801fb977a3dd9bad7" dependencies = [ "arrayvec", "itertools 0.12.1", @@ -1090,12 +1135,12 @@ checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "colored" -version = "2.1.0" +version = "2.2.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" +checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" dependencies = [ "lazy_static", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -1125,15 +1170,15 @@ dependencies = [ [[package]] name = "console" -version = "0.15.8" +version = "0.15.10" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b" dependencies = [ "encode_unicode", - "lazy_static", "libc", - "unicode-width 0.1.14", - "windows-sys 0.52.0", + "once_cell", + "unicode-width 0.2.0", + "windows-sys 0.59.0", ] [[package]] @@ -1235,18 +1280,18 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.13" +version = "0.5.14" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +checksum = "06ba6d68e24814cb8de6bb986db8222d3a027d15872cabc0d18817bc3c0e4471" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.6" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -1263,9 +1308,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" @@ -1283,6 +1328,16 @@ dependencies = [ "typenum", ] +[[package]] +name = "ctrlc" +version = "3.4.5" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "90eeab0aa92f3f9b4e87f258c72b139c207d251f9cbc1080a0086b86a8870dd3" +dependencies = [ + "nix", + "windows-sys 0.59.0", +] + [[package]] name = "cvt" version = "0.1.2" @@ -1317,7 +1372,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.89", + "syn 2.0.95", ] [[package]] @@ -1330,7 +1385,7 @@ dependencies = [ "codespan-reporting", "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", ] [[package]] @@ -1348,7 +1403,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.89", + "syn 2.0.95", ] [[package]] @@ -1370,7 +1425,28 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.89", + "syn 2.0.95", +] + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.95", + "unicode-xid", ] [[package]] @@ -1425,9 +1501,15 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", ] +[[package]] +name = "disqualified" +version = "1.0.0" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "c9c272297e804878a2a4b707cfcfc6d2328b5bb936944613b4fdf2b9269afdfd" + [[package]] name = "doc-comment" version = "0.3.3" @@ -1448,9 +1530,9 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "encode_unicode" -version = "0.3.6" +version = "1.0.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] name = "encoding_rs" @@ -1463,9 +1545,9 @@ dependencies = [ [[package]] name = "env_filter" -version = "0.1.2" +version = "0.1.3" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" +checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" dependencies = [ "log", "regex", @@ -1473,9 +1555,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.5" +version = "0.11.6" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" +checksum = "dcaee3d8e3cfc3fd92428d477bc97fc29ec8716d180c0d74c643bb26166660e0" dependencies = [ "anstream", "anstyle", @@ -1528,9 +1610,9 @@ checksum = "a2a2b11eda1d40935b26cf18f6833c526845ae8c41e58d09af6adeb6f0269183" [[package]] name = "fastrand" -version = "2.2.0" +version = "2.3.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fixedbitset" @@ -1551,7 +1633,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", - "miniz_oxide 0.8.0", + "miniz_oxide 0.8.2", ] [[package]] @@ -1592,9 +1674,9 @@ dependencies = [ [[package]] name = "fs-err" -version = "2.11.0" +version = "3.0.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +checksum = "8bb60e7409f34ef959985bc9d9c5ee8f5db24ee46ed9775850548021710f807f" dependencies = [ "autocfg", ] @@ -1771,19 +1853,19 @@ dependencies = [ "bstr", "gix-path", "libc", - "thiserror 2.0.3", + "thiserror 2.0.9", ] [[package]] name = "gix-date" -version = "0.9.2" +version = "0.9.3" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "691142b1a34d18e8ed6e6114bc1a2736516c5ad60ef3aa9bd1b694886e3ca92d" +checksum = "c57c477b645ee248b173bb1176b52dd528872f12c50375801a58aaf5ae91113f" dependencies = [ "bstr", "itoa", "jiff", - "thiserror 2.0.3", + "thiserror 2.0.9", ] [[package]] @@ -1874,7 +1956,7 @@ dependencies = [ "gix-trace", "home", "once_cell", - "thiserror 2.0.3", + "thiserror 2.0.9", ] [[package]] @@ -1946,20 +2028,26 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "cd520d09f9f585b34b32aba1d0b36ada89ab7fefb54a8ca3fe37fc482a750937" dependencies = [ "bstr", - "thiserror 2.0.3", + "thiserror 2.0.9", ] [[package]] name = "glam" -version = "0.27.0" +version = "0.29.2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "9e05e7e6723e3455f4818c7b26e855439f7546cf617ef669d1adedb8669e5cb9" +checksum = "dc46dd3ec48fdd8e693a98d2b8bafae273a2d54c1de02a2a7e3d57d501f39677" dependencies = [ "bytemuck", "rand", "serde", ] +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + [[package]] name = "globset" version = "0.4.15" @@ -2003,7 +2091,7 @@ dependencies = [ "fnv", "futures-core", "futures-sink", - "http 1.1.0", + "http 1.2.0", "indexmap", "slab", "tokio", @@ -2040,19 +2128,13 @@ version = "0.5.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - [[package]] name = "home" -version = "0.5.9" +version = "0.5.11" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2068,9 +2150,9 @@ dependencies = [ [[package]] name = "http" -version = "1.1.0" +version = "1.2.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -2084,7 +2166,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.1.0", + "http 1.2.0", ] [[package]] @@ -2095,7 +2177,7 @@ checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", "futures-util", - "http 1.1.0", + "http 1.2.0", "http-body", "pin-project-lite", ] @@ -2126,15 +2208,15 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "1.5.1" +version = "1.5.2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" dependencies = [ "bytes", "futures-channel", "futures-util", "h2 0.4.7", - "http 1.1.0", + "http 1.2.0", "http-body", "httparse", "itoa", @@ -2146,12 +2228,12 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.3" +version = "0.27.5" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" dependencies = [ "futures-util", - "http 1.1.0", + "http 1.2.0", "hyper", "hyper-util", "rustls", @@ -2186,7 +2268,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.1.0", + "http 1.2.0", "http-body", "hyper", "pin-project-lite", @@ -2311,7 +2393,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", ] [[package]] @@ -2353,9 +2435,9 @@ dependencies = [ [[package]] name = "impl-more" -version = "0.1.8" +version = "0.1.9" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "aae21c3177a27788957044151cc2800043d127acaa460a47ebb9b84dfa2c6aa0" +checksum = "e8a5a9a0ff0086c7a148acb942baaabeadf9504d10400b5a05645853729b9cd2" [[package]] name = "indenter" @@ -2365,9 +2447,9 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown 0.15.2", @@ -2434,11 +2516,15 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jiff" -version = "0.1.14" +version = "0.1.21" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "b9d9d414fc817d3e3d62b2598616733f76c4cc74fbac96069674739b881295c8" +checksum = "ed0ce60560149333a8e41ca7dc78799c47c5fd435e2bc18faf6a054382eec037" dependencies = [ "jiff-tzdb-platform", + "log", + "portable-atomic", + "portable-atomic-util", + "serde", "windows-sys 0.59.0", ] @@ -2490,10 +2576,11 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.72" +version = "0.3.76" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -2527,9 +2614,9 @@ checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760" [[package]] name = "libc" -version = "0.2.167" +version = "0.2.169" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libgit2-sys" @@ -2545,6 +2632,22 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "libloading" +version = "0.8.6" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +dependencies = [ + "cfg-if", + "windows-targets 0.52.6", +] + +[[package]] +name = "libm" +version = "0.2.11" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + [[package]] name = "libredox" version = "0.1.3" @@ -2635,7 +2738,7 @@ checksum = "3b51f1d220e3fa869e24cfd75915efe3164bd09bb11b3165db3f37f57bf673e3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", ] [[package]] @@ -2732,6 +2835,12 @@ dependencies = [ "unicase", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.7.4" @@ -2743,20 +2852,19 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.2" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" dependencies = [ "adler2", ] [[package]] name = "mio" -version = "1.0.2" +version = "1.0.3" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "hermit-abi", "libc", "log", "wasi", @@ -2807,6 +2915,16 @@ dependencies = [ "libc", ] +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "nonmax" version = "0.5.5" @@ -2845,6 +2963,7 @@ source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -2901,6 +3020,9 @@ name = "once_cell" version = "1.20.2" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +dependencies = [ + "portable-atomic", +] [[package]] name = "openssl" @@ -2925,7 +3047,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", ] [[package]] @@ -2952,6 +3074,15 @@ version = "0.2.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "ordered-float" +version = "2.10.1" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" +dependencies = [ + "num-traits", +] + [[package]] name = "overload" version = "0.1.1" @@ -3034,20 +3165,20 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.14" +version = "2.7.15" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" +checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", - "thiserror 1.0.69", + "thiserror 2.0.9", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.14" +version = "2.7.15" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d214365f632b123a47fd913301e14c946c61d1c183ee245fa76eb752e59a02dd" +checksum = "816518421cfc6887a0d62bf441b6ffb4536fcc926395a69e1a85852d4363f57e" dependencies = [ "pest", "pest_generator", @@ -3055,22 +3186,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.14" +version = "2.7.15" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "eb55586734301717aea2ac313f50b2eb8f60d2fc3dc01d190eefa2e625f60c4e" +checksum = "7d1396fd3a870fc7838768d171b4616d5c91f6cc25e377b673d714567d99377b" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", ] [[package]] name = "pest_meta" -version = "2.7.14" +version = "2.7.15" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "b75da2a70cf4d9cb76833c990ac9cd3923c9a8905a8929789ce347c84564d03d" +checksum = "e1e58089ea25d717bfd31fb534e4f3afcc2cc569c70de3e239778991ea3b7dea" dependencies = [ "once_cell", "pest", @@ -3087,6 +3218,26 @@ dependencies = [ "indexmap", ] +[[package]] +name = "pin-project" +version = "1.1.7" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.7" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.95", +] + [[package]] name = "pin-project-lite" version = "0.2.15" @@ -3111,6 +3262,15 @@ version = "1.10.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +[[package]] +name = "portable-atomic-util" +version = "0.2.4" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" +dependencies = [ + "portable-atomic", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -3136,6 +3296,16 @@ dependencies = [ "pad", ] +[[package]] +name = "prettyplease" +version = "0.2.27" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "483f8c21f64f3ea09fe0f30f5d48c3e8eefe5dac9129f0075f76593b4c1da705" +dependencies = [ + "proc-macro2", + "syn 2.0.95", +] + [[package]] name = "proc-macro2" version = "1.0.92" @@ -3153,9 +3323,9 @@ checksum = "744a264d26b88a6a7e37cbad97953fa233b94d585236310bcbc88474b4092d79" [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -3191,16 +3361,20 @@ dependencies = [ ] [[package]] -name = "raw-window-handle" -version = "0.6.2" +name = "rand_distr" +version = "0.4.3" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" +checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" +dependencies = [ + "num-traits", + "rand", +] [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.8" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ "bitflags", ] @@ -3218,9 +3392,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.6" +version = "1.11.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -3282,9 +3456,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.9" +version = "0.12.12" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" +checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" dependencies = [ "base64", "bytes", @@ -3293,7 +3467,7 @@ dependencies = [ "futures-core", "futures-util", "h2 0.4.7", - "http 1.1.0", + "http 1.2.0", "http-body", "http-body-util", "hyper", @@ -3316,6 +3490,7 @@ dependencies = [ "system-configuration", "tokio", "tokio-native-tls", + "tower", "tower-service", "url", "wasm-bindgen", @@ -3326,9 +3501,9 @@ dependencies = [ [[package]] name = "rhai" -version = "1.19.0" +version = "1.20.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "61797318be89b1a268a018a92a7657096d83f3ecb31418b9e9c16dcbb043b702" +checksum = "d0277a46f29fe3b3eb10821ca2c65a4751b686b6c84422aae31695ba167b0fbc" dependencies = [ "ahash", "bitflags", @@ -3349,7 +3524,7 @@ checksum = "a5a11a05ee1ce44058fa3d5961d05194fdbe3ad6b40f904af764d81b86450e6b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", ] [[package]] @@ -3373,6 +3548,12 @@ version = "0.1.24" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc_apfloat" version = "0.2.2+llvm-462a31f5a5ab" @@ -3406,22 +3587,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.41" +version = "0.38.42" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "rustls" -version = "0.23.19" +version = "0.23.20" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" +checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" dependencies = [ "once_cell", "rustls-pki-types", @@ -3441,9 +3622,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.10.0" +version = "1.10.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" [[package]] name = "rustls-webpki" @@ -3523,9 +3704,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.1" +version = "2.13.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" +checksum = "1863fd3768cd83c56a7f60faa4dc0d403f1b6df0a38c3c25f44b7894e45370d5" dependencies = [ "core-foundation-sys", "libc", @@ -3533,38 +3714,59 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.24" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.215" +version = "1.0.217" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] +[[package]] +name = "serde-untagged" +version = "0.1.6" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "2676ba99bd82f75cae5cbd2c8eda6fa0b8760f18978ea840e980dd5567b5c5b6" +dependencies = [ + "erased-serde", + "serde", + "typeid", +] + +[[package]] +name = "serde-value" +version = "0.7.0" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "f3a1a3341211875ef120e117ea7fd5228530ae7e7036a779fdc9117be6b3282c" +dependencies = [ + "ordered-float", + "serde", +] + [[package]] name = "serde_derive" -version = "1.0.215" +version = "1.0.217" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", ] [[package]] name = "serde_json" -version = "1.0.133" +version = "1.0.134" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" dependencies = [ "itoa", "memchr", @@ -3768,9 +3970,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.89" +version = "2.0.95" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" +checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" dependencies = [ "proc-macro2", "quote", @@ -3794,7 +3996,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", ] [[package]] @@ -3820,14 +4022,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.10.1" +version = "3.13.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3851,9 +4054,9 @@ dependencies = [ [[package]] name = "terminal_size" -version = "0.4.0" +version = "0.4.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "4f599bd7ca042cfdf8f4512b277c02ba102247820f9d9d4a9f521f496751a6ef" +checksum = "5352447f921fda68cf61b4101566c0bdb5104eff6804d0678e5227580ab6a4e9" dependencies = [ "rustix", "windows-sys 0.59.0", @@ -3876,11 +4079,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.3" +version = "2.0.9" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" +checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" dependencies = [ - "thiserror-impl 2.0.3", + "thiserror-impl 2.0.9", ] [[package]] @@ -3891,18 +4094,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", ] [[package]] name = "thiserror-impl" -version = "2.0.3" +version = "2.0.9" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" +checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", ] [[package]] @@ -3917,9 +4120,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.36" +version = "0.3.37" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" dependencies = [ "deranged", "itoa", @@ -3938,9 +4141,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.19" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" dependencies = [ "num-conv", "time-core", @@ -3967,9 +4170,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.8.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" dependencies = [ "tinyvec_macros", ] @@ -3982,9 +4185,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.41.1" +version = "1.42.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "bytes", @@ -4009,20 +4212,19 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.0" +version = "0.26.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ "rustls", - "rustls-pki-types", "tokio", ] [[package]] name = "tokio-util" -version = "0.7.12" +version = "0.7.13" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" dependencies = [ "bytes", "futures-core", @@ -4066,6 +4268,27 @@ dependencies = [ "winnow", ] +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "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" @@ -4092,7 +4315,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", ] [[package]] @@ -4107,9 +4330,9 @@ dependencies = [ [[package]] name = "tracing-error" -version = "0.2.0" +version = "0.2.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e" +checksum = "8b1581020d7a273442f5b45074a6a57d5757ad0a47dac0e9f0bd57b81936f3db" dependencies = [ "tracing", "tracing-subscriber", @@ -4126,11 +4349,26 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "tracing-oslog" +version = "0.2.0" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "528bdd1f0e27b5dd9a4ededf154e824b0532731e4af73bb531de46276e0aab1e" +dependencies = [ + "bindgen", + "cc", + "cfg-if", + "once_cell", + "parking_lot", + "tracing-core", + "tracing-subscriber", +] + [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -4207,9 +4445,9 @@ dependencies = [ [[package]] name = "unicase" -version = "2.8.0" +version = "2.8.1" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-bom" @@ -4250,6 +4488,12 @@ version = "0.2.0" source = "registry+/~https://github.com/rust-lang/crates.io-index" checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+/~https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + [[package]] name = "untrusted" version = "0.9.0" @@ -4345,9 +4589,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.95" +version = "0.2.99" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if", "once_cell", @@ -4356,36 +4600,36 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.95" +version = "0.2.99" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.45" +version = "0.4.49" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" +checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.95" +version = "0.2.99" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4393,22 +4637,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.95" +version = "0.2.99" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.95" +version = "0.2.99" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "wasm-opt" @@ -4452,9 +4696,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.72" +version = "0.3.76" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" +checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" dependencies = [ "js-sys", "wasm-bindgen", @@ -4765,9 +5009,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.20" +version = "0.6.22" source = "registry+/~https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "39281189af81c07ec09db316b302a3e67bf9bd7cbf6c820b50e35fee9c2fa980" dependencies = [ "memchr", ] @@ -4804,7 +5048,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", "synstructure", ] @@ -4826,7 +5070,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", ] [[package]] @@ -4846,7 +5090,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", "synstructure", ] @@ -4875,7 +5119,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.95", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 737a967..2f8a33a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,8 +48,16 @@ actix-web = "4.9.0" # Opening the app in the browser webbrowser = "1.0.2" +# Parsing the Cargo manifest +toml_edit = "0.22.22" + # Copying directories fs_extra = "1.3.0" # Optimizing Wasm binaries wasm-opt = { version = "0.116.1", optional = true } + +[build-dependencies] +# We don't use `cc` directly, but our dependency `wasm-opt-sys` fails to compile on Windows when using a newer version. +# This can be removed when /~https://github.com/rust-lang/cc-rs/issues/1324 is fixed. +cc = "=1.2.2" diff --git a/README.md b/README.md index 15f21d0..0506cab 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,7 @@ A prototype [Bevy] CLI tool intended to streamline common tasks when working on - Project generation from a template - [A custom, Bevy-specific linter](bevy_lint/README.md) -- Out-of-the-box support for bundling projects into WebAssembly -- An HTTP server for testing these WASM bundles +- Out-of-the-box support for building and running your Bevy app in the browser If you need assistance or want to help, reach out to the [`bevy_cli` working group channel] in the [Bevy Discord]. @@ -15,6 +14,73 @@ If you need assistance or want to help, reach out to the [`bevy_cli` working gro [`bevy_cli` working group channel]: https://discord.com/channels/691052431525675048/1278871953721262090 [Bevy Discord]: https://discord.gg/bevy +## Installation + +At this point, the CLI is not published as a package yet and needs to be installed via git: + +```cli +cargo install --git /~https://github.com/TheBevyFlock/bevy_cli --locked bevy_cli +``` + +## Bevy web apps + +The CLI makes it easy to build and run web apps made with Bevy, using `bevy build web` and `bevy run web`. +It takes care of compiling the app to Wasm, creating JavaScript bindings and serving it on a local web server to test it out. +Necessary tools will also be installed automatically. + +> [!NOTE] +> +> The arguments you know from `cargo` (like `--release`) must be placed before the `web` subcommand, while the web-specific options (like `--open`) must be placed afterwards, e.g. +> +> ```cli +> bevy run --release web --open +> ``` + +### Running in the browser + +Use the `bevy run web` command to run your app in the browser. +The app will be automatically served on a local web server, use the `--open` flag to automatically open it in the browser. + +The server will provide a default `index.html` serving as entrypoint for your app. +It features a loading screen and some other utilities. +If you want to customize it, simply create a `web/index.html` file to override the default behavior. +Other files in the `web` folder will also be included in your application. + +### Creating web bundles + +To deploy your app on a web server, it's often necessary to bundle the binary, assets and web files into a single folder. +Using `bevy build web --bundle`, the CLI can create this bundle for you automatically. +It will be available in the `target/bevy_web` folder, see the command's output for the full file path. + +### Compilation profiles + +Web apps have different needs than native builds when it comes to compilation. +For example, binary size is a lot more important for web apps, as it has a big influence on the loading times. + +The Bevy CLI provides custom `web` and `web-release` compilation profiles, which are optimized for web apps. +They are used by default for the web sub-commands (depending on the `--release` flag). + +The profiles can be customized as usual in `Cargo.toml`: + +```toml +[profile.web-release] +inherits = "release" +opt-level = "z" +``` + +Alternatively, you can change the profile entirely, e.g. `bevy run --profile=foo web`. + +### Usage in CI + +The CLI may include interactive prompts if parts of the required tooling is not installed on the system. +These prompts will break your pipeline if they are triggered in CI. + +To avoid this problem, use the `--yes` flag to automatically confirm the prompts: + +```cli +bevy build --yes web +``` + ## License The Bevy CLI is licensed under either of diff --git a/bevy_lint/Cargo.toml b/bevy_lint/Cargo.toml index c43040f..735c8ed 100644 --- a/bevy_lint/Cargo.toml +++ b/bevy_lint/Cargo.toml @@ -28,7 +28,7 @@ harness = false # Contains a series of useful utilities when writing lints. The version is chosen to work with the # currently pinned nightly Rust version. When the Rust version changes, this too needs to be # updated! -clippy_utils = "=0.1.85" +clippy_utils = "=0.1.86" # Easy error propagation and contexts. anyhow = "1.0.86" @@ -41,7 +41,7 @@ toml_edit = { version = "0.22.22", default-features = false, features = [ [dev-dependencies] # Used when running UI tests. -bevy = { version = "0.14.2", default-features = false } +bevy = { version = "0.15.0", default-features = false } # Used to deserialize `--message-format=json` messages from Cargo. serde = { version = "1.0.210", features = ["derive"] } diff --git a/bevy_lint/README.md b/bevy_lint/README.md index 3b6477b..48d8f5f 100644 --- a/bevy_lint/README.md +++ b/bevy_lint/README.md @@ -154,7 +154,7 @@ There are several other ways to toggle lints, but they have varying levels of su |`bevy_lint` Version|Rust Version|Rustup Toolchain|Bevy Version| |-|-|-|-| -|0.2.0-dev|1.84.0|`nightly-2024-11-28`|0.14| +|0.2.0-dev|1.84.0|`nightly-2025-01-09`|0.15| |0.1.0|1.84.0|`nightly-2024-11-14`|0.14| The Rust version in the above table specifies what [version of the Rust language](/~https://github.com/rust-lang/rust/releases) can be compiled with `bevy_lint`. Code written for a later version of Rust may not compile. (This is not usually an issue, though, because `bevy_lint`'s Rust version is kept 1 to 2 releases ahead of stable Rust.) diff --git a/bevy_lint/docs/README.md b/bevy_lint/docs/README.md index debfd44..e61e7be 100644 --- a/bevy_lint/docs/README.md +++ b/bevy_lint/docs/README.md @@ -7,6 +7,7 @@ Thanks for your interest in contributing to `bevy_lint`! Please feel free to ski - [Setting up your Editor](how-to/editor.md) - [How to Work with Types](how-to/types.md) - [How to Release `bevy_lint`](how-to/release.md) + - [Bump to a Newer Version of Rust](how-to/bump-rust.md) - [Reference](reference/) - [Explanations](explanations/) diff --git a/bevy_lint/docs/how-to/bump-rust.md b/bevy_lint/docs/how-to/bump-rust.md new file mode 100644 index 0000000..da6d303 --- /dev/null +++ b/bevy_lint/docs/how-to/bump-rust.md @@ -0,0 +1,34 @@ +# How to Bump to a Newer Version of Rust + +`bevy_lint` matches nightly Rust versions with `clippy_utils`. A new version of `clippy_utils` is released with each version of Rust, which `bevy_lint` should keep up to date with. + +1. Go to [`clippy_utils`'s page on crates.io](https://crates.io/crates/clippy_utils) and find the nightly toolchain it requires. For example: + + > This crate is only guaranteed to build with this nightly toolchain: + > + > ``` + > nightly-2025-01-09 + > ``` + +2. Change the `channel` field in [`rust-toolchain.toml`](../../../rust-toolchain.toml) to the version specified by `clippy_utils`. +3. Update the [compatibility table in `README.md`](../../README.md#compatibility) for the latest `-dev` version. +4. Increase the version of `clippy_utils` in [`Cargo.toml`](../../Cargo.toml) to the latest version. + +Once you've finished upgrading the Rust toolchain and `clippy_utils`, there are a few extra steps that can verify `bevy_lint` still functions the same. + +1. Read over the [release notes](/~https://github.com/rust-lang/rust/releases) for potentially breaking changes. +2. Skim through [diff.rs for `clippy_utils`](https://diff.rs/clippy_utils) to see if anything the linter uses may have changed. + - `clippy_utils` doesn't provide a user-facing changelog, unfortunately. You may find the [Git history](/~https://github.com/rust-lang/rust-clippy/commits/master/clippy_utils) useful, though! +3. Verify you've installed the latest pinned Rust toolchain. If you use Rustup, it should be automatically installed the first time you run `rustc` or `cargo` in the workspace. + + ```shell + rustc --version + ``` + +4. Test that the linter still compiles and passes all tests. + + ```shell + cargo clean + cargo build + cargo test + ``` diff --git a/bevy_lint/src/bin/driver.rs b/bevy_lint/src/bin/driver.rs index f989f65..6afabf5 100644 --- a/bevy_lint/src/bin/driver.rs +++ b/bevy_lint/src/bin/driver.rs @@ -39,7 +39,9 @@ fn main() -> ExitCode { args.remove(0); // Call the compiler with our custom callback. - RunCompiler::new(&args, &mut BevyLintCallback).run() + RunCompiler::new(&args, &mut BevyLintCallback).run(); + + Ok(()) }); // We truncate the `i32` to a `u8`. `catch_with_exit_code()` currently only returns 1 or 0, so diff --git a/bevy_lint/src/lint.rs b/bevy_lint/src/lint.rs index 0702478..3b8bfcf 100644 --- a/bevy_lint/src/lint.rs +++ b/bevy_lint/src/lint.rs @@ -28,6 +28,32 @@ pub struct LintGroup { pub level: Level, } +/// Creates a new [`BevyLint`]. +/// +/// # Example +/// +/// ```ignore +/// declare_bevy_lint! { +/// // This lint will be named `bevy::lint_name`. +/// pub LINT_NAME, +/// // See the `groups` module for the available names. +/// LINT_GROUP, +/// // The description printed by `bevy_lint_driver rustc -W help`, and sometimes also used in +/// // diagnostic messages. +/// "short description of lint", +/// +/// // The following are optional fields, and may be excluded. They all default to false. +/// // +/// // Whether to report this lint, even if it is inside the expansion of an external macro. +/// @report_in_external_macro = true, +/// // Whether to only run this macro for the crate root. This should be enabled for lint +/// // passes that only override `check_crate()`. +/// @crate_level_only = false, +/// // The compiler can sometimes skip lint passes that are guaranteed not to run. This can +/// // disable that behavior. +/// @eval_always = true, +/// } +/// ``` #[macro_export] #[doc(hidden)] macro_rules! declare_bevy_lint { @@ -35,7 +61,10 @@ macro_rules! declare_bevy_lint { $(#[$attr:meta])* $vis:vis $name:ident, $group:ident, - $desc:expr$(,)? + $desc:expr, + $(@report_in_external_macro = $report_in_external_macro:expr,)? + $(@crate_level_only = $crate_level_only:expr,)? + $(@eval_always = $eval_always:expr,)? } => { /// Click me for more information. /// @@ -49,16 +78,24 @@ macro_rules! declare_bevy_lint { $(#[$attr])* $vis static $name: &$crate::lint::BevyLint = &$crate::lint::BevyLint { lint: &::rustc_lint::Lint { + // Fields that are always configured by macro. name: concat!("bevy::", stringify!($name)), default_level: $crate::groups::$group.level, desc: $desc, + + // Fields that cannot be configured. edition_lint_opts: None, - report_in_external_macro: false, future_incompatible: None, - is_externally_loaded: true, feature_gate: None, - crate_level_only: false, - eval_always: false, + is_externally_loaded: true, + + // Fields that may sometimes be configured by macro. These all default to false in + // `Lint::default_fields_for_macro()`, but may be overridden to true. + $(report_in_external_macro: $report_in_external_macro,)? + $(crate_level_only: $crate_level_only,)? + $(eval_always: $eval_always,)? + + ..::rustc_lint::Lint::default_fields_for_macro() }, group: &$crate::groups::$group, }; diff --git a/bevy_lint/src/lints/missing_reflect.rs b/bevy_lint/src/lints/missing_reflect.rs index abed060..a3c7aa2 100644 --- a/bevy_lint/src/lints/missing_reflect.rs +++ b/bevy_lint/src/lints/missing_reflect.rs @@ -47,6 +47,8 @@ declare_bevy_lint! { pub MISSING_REFLECT, RESTRICTION, "defined a component, resource, or event without a `Reflect` implementation", + // We only override `check_crate()`. + @crate_level_only = true, } declare_lint_pass! { diff --git a/bevy_lint/src/lints/panicking_methods.rs b/bevy_lint/src/lints/panicking_methods.rs index c15bfb6..bdc2525 100644 --- a/bevy_lint/src/lints/panicking_methods.rs +++ b/bevy_lint/src/lints/panicking_methods.rs @@ -91,13 +91,13 @@ use rustc_span::{Span, Symbol}; declare_bevy_lint! { pub PANICKING_QUERY_METHODS, RESTRICTION, - "called a `Query` or `QueryState` method that can panic when a non-panicking alternative exists" + "called a `Query` or `QueryState` method that can panic when a non-panicking alternative exists", } declare_bevy_lint! { pub PANICKING_WORLD_METHODS, RESTRICTION, - "called a `World` method that can panic when a non-panicking alternative exists" + "called a `World` method that can panic when a non-panicking alternative exists", } declare_lint_pass! { diff --git a/bevy_lint/src/lints/zst_query.rs b/bevy_lint/src/lints/zst_query.rs index 4741f37..2ed90f5 100644 --- a/bevy_lint/src/lints/zst_query.rs +++ b/bevy_lint/src/lints/zst_query.rs @@ -51,7 +51,7 @@ use rustc_session::declare_lint_pass; declare_bevy_lint! { pub ZST_QUERY, RESTRICTION, - "query for a zero-sized type" + "query for a zero-sized type", } declare_lint_pass! { diff --git a/bevy_lint/src/paths.rs b/bevy_lint/src/paths.rs index b277b27..54b0e6e 100644 --- a/bevy_lint/src/paths.rs +++ b/bevy_lint/src/paths.rs @@ -13,9 +13,8 @@ pub const DEFERRED: [&str; 4] = ["bevy_ecs", "system", "system_param", "Deferred pub const DEFERRED_WORLD: [&str; 4] = ["bevy_ecs", "world", "deferred_world", "DeferredWorld"]; pub const ENTITY_COMMANDS: [&str; 4] = ["bevy_ecs", "system", "commands", "EntityCommands"]; pub const ENTITY_MUT: [&str; 4] = ["bevy_ecs", "world", "entity_ref", "EntityMut"]; -// Note that this moves to `bevy_ecs::event::base::Event` in 0.15. -pub const EVENT: [&str; 3] = ["bevy_ecs", "event", "Event"]; -pub const EVENTS: [&str; 3] = ["bevy_ecs", "event", "Events"]; +pub const EVENT: [&str; 4] = ["bevy_ecs", "event", "base", "Event"]; +pub const EVENTS: [&str; 4] = ["bevy_ecs", "event", "collections", "Events"]; pub const FILTERED_ENTITY_MUT: [&str; 4] = ["bevy_ecs", "world", "entity_ref", "FilteredEntityMut"]; pub const MUT: [&str; 3] = ["bevy_ecs", "change_detection", "Mut"]; pub const MUT_UNTYPED: [&str; 3] = ["bevy_ecs", "change_detection", "MutUntyped"]; diff --git a/bevy_lint/tests/ui/borrowed_reborrowable/entity_commands.stderr b/bevy_lint/tests/ui/borrowed_reborrowable/entity_commands.stderr index cc3ce96..89aa9e4 100644 --- a/bevy_lint/tests/ui/borrowed_reborrowable/entity_commands.stderr +++ b/bevy_lint/tests/ui/borrowed_reborrowable/entity_commands.stderr @@ -2,7 +2,7 @@ error: parameter takes `&mut EntityCommands` instead of a re-borrowed `EntityCom --> tests/ui/borrowed_reborrowable/entity_commands.rs:17:22 | 17 | fn mutable_reference(_param: &mut EntityCommands) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `EntityCommands` instead: `mut _param: bevy::bevy_ecs::system::EntityCommands<'_>` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `EntityCommands` instead: `mut _param: bevy::prelude::EntityCommands<'_>` | note: the lint level is defined here --> tests/ui/borrowed_reborrowable/entity_commands.rs:5:9 @@ -14,7 +14,7 @@ error: parameter takes `&mut EntityCommands` instead of a re-borrowed `EntityCom --> tests/ui/borrowed_reborrowable/entity_commands.rs:23:33 | 23 | fn mutable_reference_return<'a>(_param: &'a mut EntityCommands) -> usize { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `EntityCommands` instead: `mut _param: bevy::bevy_ecs::system::EntityCommands<'_>` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `EntityCommands` instead: `mut _param: bevy::prelude::EntityCommands<'_>` error: aborting due to 2 previous errors diff --git a/bevy_lint/tests/ui/missing_reflect/impl.rs b/bevy_lint/tests/ui/missing_reflect/impl.rs index c1553c1..da314f2 100644 --- a/bevy_lint/tests/ui/missing_reflect/impl.rs +++ b/bevy_lint/tests/ui/missing_reflect/impl.rs @@ -37,4 +37,6 @@ impl Component for MyEvent { } //~v NOTE: `Event` implemented here -impl Event for MyEvent {} +impl Event for MyEvent { + type Traversal = (); +} diff --git a/bevy_lint/tests/ui/missing_reflect/impl.stderr b/bevy_lint/tests/ui/missing_reflect/impl.stderr index 1a76109..870ff62 100644 --- a/bevy_lint/tests/ui/missing_reflect/impl.stderr +++ b/bevy_lint/tests/ui/missing_reflect/impl.stderr @@ -7,8 +7,10 @@ error: defined an event without a `Reflect` implementation note: `Event` implemented here --> tests/ui/missing_reflect/impl.rs:40:1 | -40 | impl Event for MyEvent {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^ +40 | / impl Event for MyEvent { +41 | | type Traversal = (); +42 | | } + | |_^ note: the lint level is defined here --> tests/ui/missing_reflect/impl.rs:8:9 | diff --git a/bevy_lint/tests/ui/missing_reflect/impl_ref.rs b/bevy_lint/tests/ui/missing_reflect/impl_ref.rs index abe6a22..5ad6e93 100644 --- a/bevy_lint/tests/ui/missing_reflect/impl_ref.rs +++ b/bevy_lint/tests/ui/missing_reflect/impl_ref.rs @@ -42,4 +42,6 @@ impl Component for &'static &'static &'static MyEvent { } //~v NOTE: `Event` implemented here -impl Event for &'static &'static &'static MyEvent {} +impl Event for &'static &'static &'static MyEvent { + type Traversal = (); +} diff --git a/bevy_lint/tests/ui/missing_reflect/impl_ref.stderr b/bevy_lint/tests/ui/missing_reflect/impl_ref.stderr index cba4a96..6aba666 100644 --- a/bevy_lint/tests/ui/missing_reflect/impl_ref.stderr +++ b/bevy_lint/tests/ui/missing_reflect/impl_ref.stderr @@ -7,8 +7,10 @@ error: defined an event without a `Reflect` implementation note: `Event` implemented here --> tests/ui/missing_reflect/impl_ref.rs:45:1 | -45 | impl Event for &'static &'static &'static MyEvent {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +45 | / impl Event for &'static &'static &'static MyEvent { +46 | | type Traversal = (); +47 | | } + | |_^ note: the lint level is defined here --> tests/ui/missing_reflect/impl_ref.rs:13:9 | diff --git a/bevy_lint/tests/ui/panicking_methods/world.rs b/bevy_lint/tests/ui/panicking_methods/world.rs index ab7dae4..e19af6d 100644 --- a/bevy_lint/tests/ui/panicking_methods/world.rs +++ b/bevy_lint/tests/ui/panicking_methods/world.rs @@ -28,10 +28,12 @@ fn main() { //~^ ERROR: called a `World` method that can panic when a non-panicking alternative exists //~| HELP: use `world.get_entity_mut(bob)` + #[expect(deprecated, reason = "While this method is deprecated, we should still check for it while it exists.")] world.many_entities([bob]); //~^ ERROR: called a `World` method that can panic when a non-panicking alternative exists //~| HELP: use `world.get_many_entities([bob])` + #[expect(deprecated, reason = "While this method is deprecated, we should still check for it while it exists.")] world.many_entities_mut([bob]); //~^ ERROR: called a `World` method that can panic when a non-panicking alternative exists //~| HELP: use `world.get_many_entities_mut([bob])` diff --git a/bevy_lint/tests/ui/panicking_methods/world.stderr b/bevy_lint/tests/ui/panicking_methods/world.stderr index 17baae9..8a672d3 100644 --- a/bevy_lint/tests/ui/panicking_methods/world.stderr +++ b/bevy_lint/tests/ui/panicking_methods/world.stderr @@ -20,73 +20,73 @@ error: called a `World` method that can panic when a non-panicking alternative e = help: use `world.get_entity_mut(bob)` and handle the `Option` or `Result` error: called a `World` method that can panic when a non-panicking alternative exists - --> tests/ui/panicking_methods/world.rs:31:11 + --> tests/ui/panicking_methods/world.rs:32:11 | -31 | world.many_entities([bob]); +32 | world.many_entities([bob]); | ^^^^^^^^^^^^^^^^^^^^ | = help: use `world.get_many_entities([bob])` and handle the `Option` or `Result` error: called a `World` method that can panic when a non-panicking alternative exists - --> tests/ui/panicking_methods/world.rs:35:11 + --> tests/ui/panicking_methods/world.rs:37:11 | -35 | world.many_entities_mut([bob]); +37 | world.many_entities_mut([bob]); | ^^^^^^^^^^^^^^^^^^^^^^^^ | = help: use `world.get_many_entities_mut([bob])` and handle the `Option` or `Result` error: called a `World` method that can panic when a non-panicking alternative exists - --> tests/ui/panicking_methods/world.rs:39:11 + --> tests/ui/panicking_methods/world.rs:41:11 | -39 | world.resource::(); +41 | world.resource::(); | ^^^^^^^^^^^^^^^^^^^^^ | = help: use `world.get_resource::()` and handle the `Option` or `Result` error: called a `World` method that can panic when a non-panicking alternative exists - --> tests/ui/panicking_methods/world.rs:43:11 + --> tests/ui/panicking_methods/world.rs:45:11 | -43 | world.resource_mut::(); +45 | world.resource_mut::(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: use `world.get_resource_mut::()` and handle the `Option` or `Result` error: called a `World` method that can panic when a non-panicking alternative exists - --> tests/ui/panicking_methods/world.rs:47:11 + --> tests/ui/panicking_methods/world.rs:49:11 | -47 | world.resource_ref::(); +49 | world.resource_ref::(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: use `world.get_resource_ref::()` and handle the `Option` or `Result` error: called a `World` method that can panic when a non-panicking alternative exists - --> tests/ui/panicking_methods/world.rs:51:11 + --> tests/ui/panicking_methods/world.rs:53:11 | -51 | world.non_send_resource::(); +53 | world.non_send_resource::(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: use `world.get_non_send_resource::()` and handle the `Option` or `Result` error: called a `World` method that can panic when a non-panicking alternative exists - --> tests/ui/panicking_methods/world.rs:55:11 + --> tests/ui/panicking_methods/world.rs:57:11 | -55 | world.non_send_resource_mut::(); +57 | world.non_send_resource_mut::(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: use `world.get_non_send_resource_mut::()` and handle the `Option` or `Result` error: called a `World` method that can panic when a non-panicking alternative exists - --> tests/ui/panicking_methods/world.rs:59:11 + --> tests/ui/panicking_methods/world.rs:61:11 | -59 | world.run_schedule(Update); +61 | world.run_schedule(Update); | ^^^^^^^^^^^^^^^^^^^^ | = help: use `world.try_run_schedule(Update)` and handle the `Option` or `Result` error: called a `World` method that can panic when a non-panicking alternative exists - --> tests/ui/panicking_methods/world.rs:63:11 + --> tests/ui/panicking_methods/world.rs:65:11 | -63 | world.schedule_scope(Update, |_world, _schedule| {}); +65 | world.schedule_scope(Update, |_world, _schedule| {}); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: use `world.try_schedule_scope(Update, |_world, _schedule| {})` and handle the `Option` or `Result` diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 94b224b..2b5c347 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -4,6 +4,6 @@ [toolchain] # Writing custom lints requires using nightly Rust. We pin to a specific version of nightly version # so that builds are reproducible. -channel = "nightly-2024-11-28" +channel = "nightly-2025-01-09" # These components are required to use `rustc` crates. components = ["rustc-dev", "llvm-tools-preview"] diff --git a/src/build/args.rs b/src/build/args.rs index a769862..cbd83f9 100644 --- a/src/build/args.rs +++ b/src/build/args.rs @@ -31,7 +31,7 @@ impl BuildArgs { /// The profile used to compile the app. pub(crate) fn profile(&self) -> &str { - self.cargo_args.compilation_args.profile() + self.cargo_args.compilation_args.profile(self.is_web()) } /// The targeted platform. diff --git a/src/build/mod.rs b/src/build/mod.rs index 83e93ba..201bd4e 100644 --- a/src/build/mod.rs +++ b/src/build/mod.rs @@ -3,7 +3,10 @@ use args::BuildSubcommands; use crate::{ external_cli::{cargo, rustup, wasm_bindgen, CommandHelpers}, run::select_run_binary, - web::bundle::{create_web_bundle, PackedBundle, WebBundle}, + web::{ + bundle::{create_web_bundle, PackedBundle, WebBundle}, + profiles::configure_default_web_profiles, + }, }; pub use self::args::BuildArgs; @@ -11,17 +14,12 @@ pub use self::args::BuildArgs; mod args; pub fn build(args: &BuildArgs) -> anyhow::Result<()> { - let cargo_args = args.cargo_args_builder(); + let mut cargo_args = args.cargo_args_builder(); if let Some(BuildSubcommands::Web(web_args)) = &args.subcommand { ensure_web_setup(args.skip_prompts)?; let metadata = cargo::metadata::metadata_with_args(["--no-deps"])?; - - println!("Compiling to WebAssembly..."); - cargo::build::command().args(cargo_args).ensure_status()?; - - println!("Bundling JavaScript bindings..."); let bin_target = select_run_binary( &metadata, args.cargo_args.package_args.package.as_deref(), @@ -30,6 +28,13 @@ pub fn build(args: &BuildArgs) -> anyhow::Result<()> { args.target().as_deref(), args.profile(), )?; + + cargo_args = cargo_args.append(configure_default_web_profiles(&metadata)?); + + println!("Compiling to WebAssembly..."); + cargo::build::command().args(cargo_args).ensure_status()?; + + println!("Bundling JavaScript bindings..."); wasm_bindgen::bundle(&bin_target)?; #[cfg(feature = "wasm-opt")] diff --git a/src/external_cli/cargo/metadata.rs b/src/external_cli/cargo/metadata.rs index 9b800e6..e53559a 100644 --- a/src/external_cli/cargo/metadata.rs +++ b/src/external_cli/cargo/metadata.rs @@ -45,15 +45,16 @@ pub struct Metadata { /// List of members of the workspace. /// /// Each entry is the Package ID for the package. - pub workspace_members: Option>, + pub workspace_members: Vec, /// List of default members of the workspace. /// /// Each entry is the Package ID for the package. - pub workspace_default_members: Option>, + pub workspace_default_members: Vec, /// The absolute path to the build directory where Cargo places its output. pub target_directory: PathBuf, /// The absolute path to the root of the workspace. - pub workspace_root: Option, + /// This will be the root of the package if no workspace is used. + pub workspace_root: PathBuf, } #[derive(Debug, Deserialize)] diff --git a/src/external_cli/cargo/mod.rs b/src/external_cli/cargo/mod.rs index a128864..ae1a8e2 100644 --- a/src/external_cli/cargo/mod.rs +++ b/src/external_cli/cargo/mod.rs @@ -70,13 +70,19 @@ impl CargoCompilationArgs { /// The profile used to compile the app. /// /// This is determined by the `--release` and `--profile` arguments. - pub(crate) fn profile(&self) -> &str { - if self.is_release { - "release" - } else if let Some(profile) = &self.profile { + pub(crate) fn profile(&self, is_web: bool) -> &str { + if let Some(profile) = &self.profile { profile + } else if is_web { + if self.is_release { + "web-release" + } else { + "web" + } + } else if self.is_release { + "release" } else { - "debug" + "dev" } } @@ -97,8 +103,7 @@ impl CargoCompilationArgs { }; ArgBuilder::new() - .add_flag_if("--release", self.is_release) - .add_opt_value("--profile", &self.profile) + .add_with_value("--profile", self.profile(is_web)) .add_opt_value("--jobs", &self.jobs.map(|jobs| jobs.to_string())) .add_flag_if("--keep-going", self.is_keep_going) .add_opt_value("--target", &target) diff --git a/src/lint.rs b/src/lint.rs index c2f7a82..3b174ba 100644 --- a/src/lint.rs +++ b/src/lint.rs @@ -42,7 +42,7 @@ pub fn find_bevy_lint() -> anyhow::Result { } else { ensure!( bevy_lint_path.exists(), - "`bevy_lint` could not be found at {}. Please follow the instructions at to install it.", + "`bevy_lint` could not be found at {}. Please follow the instructions at to install it.", bevy_lint_path.display(), ); } diff --git a/src/run/args.rs b/src/run/args.rs index ac0d935..e2ea24d 100644 --- a/src/run/args.rs +++ b/src/run/args.rs @@ -31,7 +31,7 @@ impl RunArgs { /// The profile used to compile the app. pub(crate) fn profile(&self) -> &str { - self.cargo_args.compilation_args.profile() + self.cargo_args.compilation_args.profile(self.is_web()) } /// The targeted platform. diff --git a/src/run/mod.rs b/src/run/mod.rs index cc10711..917d649 100644 --- a/src/run/mod.rs +++ b/src/run/mod.rs @@ -9,7 +9,10 @@ use crate::{ cargo::{self, metadata::Metadata}, wasm_bindgen, CommandHelpers, }, - web::bundle::{create_web_bundle, PackedBundle, WebBundle}, + web::{ + bundle::{create_web_bundle, PackedBundle, WebBundle}, + profiles::configure_default_web_profiles, + }, }; pub use self::args::RunArgs; @@ -18,18 +21,12 @@ mod args; mod serve; pub fn run(args: &RunArgs) -> anyhow::Result<()> { - let cargo_args = args.cargo_args_builder(); + let mut cargo_args = args.cargo_args_builder(); if let Some(RunSubcommands::Web(web_args)) = &args.subcommand { ensure_web_setup(args.skip_prompts)?; let metadata = cargo::metadata::metadata_with_args(["--no-deps"])?; - - // If targeting the web, run a web server with the WASM build - println!("Compiling to WebAssembly..."); - cargo::build::command().args(cargo_args).ensure_status()?; - - println!("Bundling JavaScript bindings..."); let bin_target = select_run_binary( &metadata, args.cargo_args.package_args.package.as_deref(), @@ -38,6 +35,14 @@ pub fn run(args: &RunArgs) -> anyhow::Result<()> { args.target().as_deref(), args.profile(), )?; + + cargo_args = cargo_args.append(configure_default_web_profiles(&metadata)?); + + // If targeting the web, run a web server with the WASM build + println!("Compiling to WebAssembly..."); + cargo::build::command().args(cargo_args).ensure_status()?; + + println!("Bundling JavaScript bindings..."); wasm_bindgen::bundle(&bin_target)?; #[cfg(feature = "wasm-opt")] @@ -183,32 +188,101 @@ pub(crate) fn select_run_binary( anyhow::bail!( "Found multiple `default_run` definitions, I don't know which one to pick!" ); - } else { - let default_run = default_runs[0]; - bins.iter() - .find(|bin| bin.name == *default_run) - .ok_or_else(|| { - anyhow::anyhow!("Didn't find `default_run` binary {default_run}") - })? } + + let default_run = default_runs[0]; + bins.iter() + .find(|bin| bin.name == *default_run) + .ok_or_else(|| anyhow::anyhow!("Didn't find `default_run` binary {default_run}"))? } }; // Assemble the path where the binary will be put - let mut artifact_directory = metadata.target_directory.clone(); + let artifact_directory = get_artifact_directory( + metadata.target_directory.clone(), + compile_target, + compile_profile, + is_example, + ); + + Ok(BinTarget { + bin_name: target.name.clone(), + artifact_directory, + }) +} + +/// Determine the path to the directory which contains the compilation artifacts. +fn get_artifact_directory( + target_directory: impl Into, + target: Option<&str>, + profile: &str, + is_example: bool, +) -> PathBuf { + let mut artifact_directory = target_directory.into(); - if let Some(target) = compile_target { + if let Some(target) = target { artifact_directory.push(target); } - artifact_directory.push(compile_profile); + if profile == "dev" { + // For some reason, the dev profile has a debug folder instead + artifact_directory.push("debug"); + } else { + artifact_directory.push(profile); + } if is_example { artifact_directory.push("examples"); } - Ok(BinTarget { - bin_name: target.name.clone(), - artifact_directory, - }) + artifact_directory +} + +#[cfg(test)] +mod tests { + use super::*; + use std::path::Path; + + #[test] + fn test_artifact_directory_dev_native() { + let actual = get_artifact_directory(Path::new("/target"), None, "dev", false); + assert_eq!(actual, Path::new("/target/debug")); + } + + #[test] + fn test_artifact_directory_release_native() { + let actual = get_artifact_directory(Path::new("/target"), None, "release", false); + assert_eq!(actual, Path::new("/target/release")); + } + + #[test] + fn test_artifact_directory_dev_native_example() { + let actual = get_artifact_directory(Path::new("/target"), None, "dev", true); + assert_eq!(actual, Path::new("/target/debug/examples")); + } + + #[test] + fn test_artifact_directory_dev_web() { + let actual = get_artifact_directory( + Path::new("/target"), + Some("wasm32-unknown-unknown"), + "web", + false, + ); + assert_eq!(actual, Path::new("/target/wasm32-unknown-unknown/web")); + } + + #[test] + fn test_artifact_directory_release_web() { + let actual = get_artifact_directory( + Path::new("/target"), + Some("wasm32-unknown-unknown"), + "web-release", + false, + ); + assert_eq!( + actual, + Path::new("/target/wasm32-unknown-unknown/web-release") + ); + } } diff --git a/src/web/mod.rs b/src/web/mod.rs index d4e3500..a374dc4 100644 --- a/src/web/mod.rs +++ b/src/web/mod.rs @@ -1,5 +1,6 @@ //! Utilities for building and running the app in the browser. pub(crate) mod bundle; +pub(crate) mod profiles; #[cfg(feature = "wasm-opt")] pub(crate) mod wasm_opt; diff --git a/src/web/profiles.rs b/src/web/profiles.rs new file mode 100644 index 0000000..dc68be0 --- /dev/null +++ b/src/web/profiles.rs @@ -0,0 +1,104 @@ +use std::{collections::HashMap, fs}; + +use anyhow::Context as _; +use toml_edit::DocumentMut; + +use crate::external_cli::{arg_builder::ArgBuilder, cargo::metadata::Metadata}; + +/// Create `--config` args to configure the default profiles to use when compiling for the web. +pub(crate) fn configure_default_web_profiles(metadata: &Metadata) -> anyhow::Result { + let manifest = fs::read_to_string(metadata.workspace_root.join("Cargo.toml")) + .context("failed to read workspace manifest")? + .parse::() + .context("failed to parse workspace manifest")?; + + let mut args = ArgBuilder::new(); + + if !is_profile_defined_in_manifest(&manifest, "web") { + args = args.append(configure_web_profile()); + } + + if !is_profile_defined_in_manifest(&manifest, "web-release") { + args = args.append(configure_web_release_profile()); + } + + Ok(args) +} + +fn is_profile_defined_in_manifest(manifest: &DocumentMut, profile: &str) -> bool { + manifest + .get("profile") + .is_some_and(|profiles| profiles.get(profile).is_some()) +} + +/// Configure the default profile for web debug builds. +/// +/// It is optimized for fast iteration speeds. +fn configure_web_profile() -> ArgBuilder { + configure_profile("web", "dev", HashMap::new()) +} + +/// Configure the default profile for web release builds. +/// +/// It is optimized both for run time performance and loading times. +fn configure_web_release_profile() -> ArgBuilder { + let config = HashMap::from_iter([ + // Optimize for size, greatly reducing loading times + ("opt-level", "s"), + // Remove debug information, reducing file size further + ("strip", "debuginfo"), + ]); + configure_profile("web-release", "release", config) +} + +/// Create `--config` args for `cargo` to configure a new compilation profile. +/// +/// Equivalent to a `Cargo.toml` like this: +/// +/// ```toml +/// [profile.{profile}] +/// inherits = "{inherits}" +/// # config +/// key = "value" +/// ``` +fn configure_profile(profile: &str, inherits: &str, config: HashMap<&str, &str>) -> ArgBuilder { + let mut args = ArgBuilder::new().add_with_value( + "--config", + format!(r#"profile.{profile}.inherits="{inherits}""#), + ); + + for (key, value) in config { + args = args.add_with_value("--config", format!(r#"profile.{profile}.{key}="{value}""#)); + } + + args +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn should_detect_defined_profile() { + let manifest = r#" + [profile.web] + inherits = "dev" + "# + .parse() + .unwrap(); + + assert!(is_profile_defined_in_manifest(&manifest, "web")); + } + + #[test] + fn should_detect_missing_profile() { + let manifest = r#" + [profile.foo] + inherits = "dev" + "# + .parse() + .unwrap(); + + assert!(!is_profile_defined_in_manifest(&manifest, "web")); + } +}