diff --git a/Cargo.lock b/Cargo.lock index 6ec02e3..81c370d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -42,30 +42,15 @@ dependencies = [ [[package]] name = "annotate-snippets" -version = "0.12.13" +version = "0.12.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74fc7650eedcb2fee505aad48491529e408f0e854c2d9f63eb86c1361b9b3f93" +checksum = "92570a3f9c98e7e84df84b71d0965ac99b1871fcd75a3773a3bd1bad13f64cf7" dependencies = [ "anstyle", "memchr", "unicode-width", ] -[[package]] -name = "anstream" -version = "0.6.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" -dependencies = [ - "anstyle", - "anstyle-parse 0.2.7", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - [[package]] name = "anstream" version = "1.0.0" @@ -73,7 +58,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" dependencies = [ "anstyle", - "anstyle-parse 1.0.0", + "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", @@ -87,15 +72,6 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" -[[package]] -name = "anstyle-parse" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" -dependencies = [ - "utf8parse", -] - [[package]] name = "anstyle-parse" version = "1.0.0" @@ -187,9 +163,9 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.39.0" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa7e52a4c5c547c741610a2c6f123f3881e409b714cd27e6798ef020c514f0a" +checksum = "83a25cf98105baa966497416dbd42565ce3a8cf8dbfd59803ec9ad46f3126399" dependencies = [ "cc", "cmake", @@ -267,9 +243,9 @@ dependencies = [ [[package]] name = "cargo-generate" -version = "0.23.7" +version = "0.23.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6ecf1e81816c3dbe016101d21a198ec0f4a55bb04173ff9d3071ebb626f2cc1" +checksum = "0c3b0a106ac22b8fcd7dee8fb5b21c9276564866d954244324a7bdd346ebdb68" dependencies = [ "anstyle", "anyhow", @@ -293,7 +269,7 @@ dependencies = [ "liquid-lib", "log", "names", - "paste", + "pastey", "regex", "remove_dir_all", "rhai", @@ -349,9 +325,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.57" +version = "1.2.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a0dd1ca384932ff3641c8718a02769f1698e7563dc6974ffd03346116310423" +checksum = "b7a4d3ec6524d28a329fc53654bbadc9bdd7b0431f5d65f1a56ffb28a1ee5283" dependencies = [ "find-msvc-tools", "jobserver", @@ -393,7 +369,7 @@ version = "4.5.61" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2071365c5c56eae7d77414029dde2f4f4ba151cf68d5a3261c9a40de428ace93" dependencies = [ - "anstream 1.0.0", + "anstream", "anstyle", "clap_lex", "strsim", @@ -437,15 +413,15 @@ dependencies = [ "tar", "tempfile", "tokio", - "toml 1.0.7+spec-1.1.0", + "toml 1.1.2+spec-1.1.0", "toml_edit", ] [[package]] name = "cmake" -version = "0.1.57" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75443c44cd6b379beb8c5b45d85d0773baf31cce901fe7bb252f4eff3008ef7d" +checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678" dependencies = [ "cc", ] @@ -693,9 +669,9 @@ dependencies = [ [[package]] name = "env_filter" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a1c3cc8e57274ec99de65301228b537f1e4eedc1b8e0f9411c6caac8ae7308f" +checksum = "32e90c2accc4b07a8456ea0debdc2e7587bdd890680d71173a15d4ae604f6eef" dependencies = [ "log", "regex", @@ -703,11 +679,11 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.9" +version = "0.11.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2daee4ea451f429a58296525ddf28b45a3b64f1acf6587e2067437bb11e218d" +checksum = "0621c04f2196ac3f488dd583365b9c09be011a4ab8b9f37248ffcc8f6198b56a" dependencies = [ - "anstream 0.6.21", + "anstream", "anstyle", "env_filter", "jiff", @@ -753,9 +729,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.3.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" [[package]] name = "filetime" @@ -807,9 +783,9 @@ dependencies = [ [[package]] name = "fs-err" -version = "3.1.3" +version = "3.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ad492b2cf1d89d568a43508ab24f98501fe03f2f31c01e1d0fe7366a71745d2" +checksum = "baf68cef89750956493a66a10f512b9e58d9db21f2a573c079c0bdf1207a54a7" dependencies = [ "autocfg", ] @@ -949,9 +925,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.35.6" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "987a51a7e66db6ef4dc030418eb2a42af6b913a79edd8670766122d8af3ba59e" +checksum = "636ca0d7bf8f7ad8ba84a5dda8312c8944b275be09d88b072e08f57d3e47c1e8" dependencies = [ "bstr", "gix-date", @@ -963,9 +939,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.46.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfb898c5b695fd4acfc3c0ab638525a65545d47706064dcf7b5ead6cdb136c0" +checksum = "9419284839421488b5ab9b9b88386bdc1e159a986c08e17ffa3e9a5cd2b139f5" dependencies = [ "bstr", "gix-config-value", @@ -975,7 +951,6 @@ dependencies = [ "gix-ref", "gix-sec", "memchr", - "once_cell", "smallvec", "thiserror 2.0.18", "unicode-bom", @@ -997,9 +972,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.10.7" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "661245d045aa7c16ba4244daaabd823c562c3e45f1f25b816be2c57ee09f2171" +checksum = "c0a1259955c76335c9d1a8c511811b10dbc800ffeeca3daea1e0aadd0c98f6b7" dependencies = [ "bstr", "itoa", @@ -1010,9 +985,9 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.43.1" +version = "0.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd1543cd9b8abcbcebaa1a666a5c168ee2cda4dea50d3961ee0e6d1c42f81e5b" +checksum = "dfa64593d1586135102307fb57fb3a9d3868b6b1f45a4da1352cce5070f8916a" dependencies = [ "gix-path", "gix-trace", @@ -1024,9 +999,9 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.16.1" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a4d90307d064fa7230e0f87b03231be28f8ba63b913fc15346f489519d0c304" +checksum = "3f1ecd896258cdc5ccd94d18386d17906b8de265ad2ecf68e3bea6b007f6a28f" dependencies = [ "bstr", "fastrand", @@ -1038,9 +1013,9 @@ dependencies = [ [[package]] name = "gix-glob" -version = "0.21.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b947db8366823e7a750c254f6bb29e27e17f27e457bf336ba79b32423db62cd5" +checksum = "74254992150b0a88fdb3ad47635ab649512dff2cbbefca7916bb459894fc9d56" dependencies = [ "bitflags 2.11.0", "bstr", @@ -1050,9 +1025,9 @@ dependencies = [ [[package]] name = "gix-hash" -version = "0.19.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "251fad79796a731a2a7664d9ea95ee29a9e99474de2769e152238d4fdb69d50e" +checksum = "826036a9bee95945b0be1e2394c64cd4289916c34a639818f8fd5153906985c1" dependencies = [ "faster-hex", "gix-features", @@ -1062,20 +1037,20 @@ dependencies = [ [[package]] name = "gix-hashtable" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c35300b54896153e55d53f4180460931ccd69b7e8d2f6b9d6401122cdedc4f07" +checksum = "a27d4a3ea9640da504a2657fef3419c517fd71f1767ad8935298bcc805edd195" dependencies = [ "gix-hash", - "hashbrown 0.15.5", + "hashbrown 0.16.1", "parking_lot", ] [[package]] name = "gix-lock" -version = "18.0.0" +version = "19.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9fa71da90365668a621e184eb5b979904471af1b3b09b943a84bc50e8ad42ed" +checksum = "729d7857429a66023bc0c29d60fa21d0d6ae8862f33c1937ba89e0f74dd5c67f" dependencies = [ "gix-tempfile", "gix-utils", @@ -1084,9 +1059,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.50.2" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d69ce108ab67b65fbd4fb7e1331502429d78baeb2eee10008bdef55765397c07" +checksum = "84743d1091c501a56f00d7f4c595cb30f20fcef6503b32ac0a1ff3817efd7b5d" dependencies = [ "bstr", "gix-actor", @@ -1117,9 +1092,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.53.1" +version = "0.55.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b966f578079a42f4a51413b17bce476544cca1cf605753466669082f94721758" +checksum = "e51330a32f173c8e831731dfef8e93a748c23c057f4b028841f222564cad84cb" dependencies = [ "gix-actor", "gix-features", @@ -1150,13 +1125,12 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "18.0.0" +version = "19.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "666c0041bcdedf5fa05e9bef663c897debab24b7dc1741605742412d1d47da57" +checksum = "e265fc6b54e57693232a79d84038381ebfda7b1a3b1b8a9320d4d5fe6e820086" dependencies = [ "gix-fs", "libc", - "once_cell", "parking_lot", "tempfile", ] @@ -1309,9 +1283,9 @@ checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "hyper" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" +checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca" dependencies = [ "atomic-waker", "bytes", @@ -1323,7 +1297,6 @@ dependencies = [ "httparse", "itoa", "pin-project-lite", - "pin-utils", "smallvec", "tokio", "want", @@ -1372,12 +1345,13 @@ dependencies = [ [[package]] name = "icu_collections" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" dependencies = [ "displaydoc", "potential_utf", + "utf8_iter", "yoke", "zerofrom", "zerovec", @@ -1385,9 +1359,9 @@ dependencies = [ [[package]] name = "icu_locale_core" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" dependencies = [ "displaydoc", "litemap", @@ -1398,9 +1372,9 @@ dependencies = [ [[package]] name = "icu_normalizer" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" dependencies = [ "icu_collections", "icu_normalizer_data", @@ -1412,15 +1386,15 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" [[package]] name = "icu_properties" -version = "2.1.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" dependencies = [ "icu_collections", "icu_locale_core", @@ -1432,15 +1406,15 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "2.1.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" [[package]] name = "icu_provider" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" dependencies = [ "displaydoc", "icu_locale_core", @@ -1496,9 +1470,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.13.0" +version = "2.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +checksum = "45a8a2b9cb3e0b0c1803dbb0758ffac5de2f425b23c28f518faabd9d805342ff" dependencies = [ "equivalent", "hashbrown 0.16.1", @@ -1556,9 +1530,9 @@ checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" [[package]] name = "iri-string" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8e7418f59cc01c88316161279a7f665217ae316b388e58a0d10e29f54f1e5eb" +checksum = "25e659a4bb38e810ebc252e53b5814ff908a8c58c2a9ce2fae1bbec24cbf4e20" dependencies = [ "memchr", "serde", @@ -1682,10 +1656,12 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.91" +version = "0.3.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c" +checksum = "2e04e2ef80ce82e13552136fabeef8a5ed1f985a96805761cbb9a2c34e7664d9" dependencies = [ + "cfg-if", + "futures-util", "once_cell", "wasm-bindgen", ] @@ -1728,9 +1704,9 @@ checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" [[package]] name = "libc" -version = "0.2.183" +version = "0.2.184" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" +checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af" [[package]] name = "libgit2-sys" @@ -1748,9 +1724,9 @@ dependencies = [ [[package]] name = "libredox" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1744e39d1d6a9948f4f388969627434e31128196de472883b39f148769bfe30a" +checksum = "7ddbf48fd451246b1f8c2610bd3b4ac0cc6e149d89832867093ab69a17194f08" dependencies = [ "bitflags 2.11.0", "libc", @@ -1774,9 +1750,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.25" +version = "1.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52f4c29e2a68ac30c9087e1b772dc9f44a2b66ed44edf2266cf2be9b03dafc1" +checksum = "fc3a226e576f50782b3305c5ccf458698f92798987f551c6a02efe8276721e22" dependencies = [ "cc", "libc", @@ -1846,9 +1822,9 @@ dependencies = [ [[package]] name = "litemap" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" [[package]] name = "lock_api" @@ -1904,9 +1880,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" +checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" dependencies = [ "libc", "log", @@ -1993,9 +1969,9 @@ dependencies = [ [[package]] name = "num-conv" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050" +checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" [[package]] name = "num-traits" @@ -2084,10 +2060,10 @@ dependencies = [ ] [[package]] -name = "paste" -version = "1.0.15" +name = "pastey" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +checksum = "b867cad97c0791bbd3aaa6472142568c6c9e8f71937e98379f584cfb0cf35bec" [[package]] name = "percent-encoding" @@ -2144,12 +2120,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - [[package]] name = "pkg-config" version = "0.3.32" @@ -2179,9 +2149,9 @@ dependencies = [ [[package]] name = "potential_utf" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" dependencies = [ "zerovec", ] @@ -2521,9 +2491,9 @@ dependencies = [ [[package]] name = "rustc-hash" -version = "2.1.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" [[package]] name = "rustix" @@ -2639,9 +2609,9 @@ dependencies = [ [[package]] name = "saphyr-parser-bw" -version = "0.0.610" +version = "0.0.611" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d643f5e972f17219245b82f038c22cd3c74320bb17c6e8f7e8537de268b1bc6" +checksum = "67dec0c833db75dc98957956b303fe447ffc5eb13f2325ef4c2350f7f3aa69e3" dependencies = [ "arraydeque", "smallvec", @@ -2688,9 +2658,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" dependencies = [ "serde", "serde_core", @@ -2708,9 +2678,9 @@ dependencies = [ [[package]] name = "serde-saphyr" -version = "0.0.22" +version = "0.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "546b4da4f679832602a8f8ab8ddc10b6b1d2e1a13b4f9dddcaee499436fa06ad" +checksum = "09fbdfe7a27a1b1633dfc0c4c8e65940b8d819c5ddb9cca48ebc3223b00c8b14" dependencies = [ "ahash", "annotate-snippets", @@ -2783,9 +2753,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "1.0.4" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776" +checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" dependencies = [ "serde_core", ] @@ -2836,9 +2806,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "simd-adler32" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2" +checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" [[package]] name = "slab" @@ -2985,12 +2955,12 @@ dependencies = [ [[package]] name = "terminal_size" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b8cb979cb11c32ce1603f8137b22262a9d131aaa5c37b5678025f22b8becd0" +checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874" dependencies = [ "rustix", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -3081,9 +3051,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" dependencies = [ "displaydoc", "zerovec", @@ -3106,9 +3076,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.50.0" +version = "1.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27ad5e34374e03cfffefc301becb44e9dc3c17584f414349ebe29ed26661822d" +checksum = "2bd1c4c0fc4a7ab90fc15ef6daaa3ec3b893f004f915f2392557ed23237820cd" dependencies = [ "bytes", "libc", @@ -3158,17 +3128,17 @@ dependencies = [ [[package]] name = "toml" -version = "1.0.7+spec-1.1.0" +version = "1.1.2+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd28d57d8a6f6e458bc0b8784f8fdcc4b99a437936056fa122cb234f18656a96" +checksum = "81f3d15e84cbcd896376e6730314d59fb5a87f31e4b038454184435cd57defee" dependencies = [ "indexmap", "serde_core", "serde_spanned", - "toml_datetime 1.0.1+spec-1.1.0", + "toml_datetime 1.1.1+spec-1.1.0", "toml_parser", "toml_writer", - "winnow 1.0.0", + "winnow 1.0.1", ] [[package]] @@ -3182,40 +3152,40 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "1.0.1+spec-1.1.0" +version = "1.1.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b320e741db58cac564e26c607d3cc1fdc4a88fd36c879568c07856ed83ff3e9" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" dependencies = [ "serde_core", ] [[package]] name = "toml_edit" -version = "0.25.5+spec-1.1.0" +version = "0.25.10+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca1a40644a28bce036923f6a431df0b34236949d111cc07cb6dca830c9ef2e1" +checksum = "a82418ca169e235e6c399a84e395ab6debeb3bc90edc959bf0f48647c6a32d1b" dependencies = [ "indexmap", - "toml_datetime 1.0.1+spec-1.1.0", + "toml_datetime 1.1.1+spec-1.1.0", "toml_parser", "toml_writer", - "winnow 1.0.0", + "winnow 1.0.1", ] [[package]] name = "toml_parser" -version = "1.0.10+spec-1.1.0" +version = "1.1.2+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7df25b4befd31c4816df190124375d5a20c6b6921e2cad937316de3fccd63420" +checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" dependencies = [ - "winnow 1.0.0", + "winnow 1.0.1", ] [[package]] name = "toml_writer" -version = "1.0.7+spec-1.1.0" +version = "1.1.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f17aaa1c6e3dc22b1da4b6bba97d066e354c7945cac2f7852d4e4e7ca7a6b56d" +checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" [[package]] name = "tower" @@ -3328,9 +3298,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.12.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" +checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" [[package]] name = "unicode-width" @@ -3437,9 +3407,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.114" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" +checksum = "0551fc1bb415591e3372d0bc4780db7e587d84e2a7e79da121051c5c4b89d0b0" dependencies = [ "cfg-if", "once_cell", @@ -3450,23 +3420,19 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.64" +version = "0.4.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9c5522b3a28661442748e09d40924dfb9ca614b21c00d3fd135720e48b67db8" +checksum = "03623de6905b7206edd0a75f69f747f134b7f0a2323392d664448bf2d3c5d87e" dependencies = [ - "cfg-if", - "futures-util", "js-sys", - "once_cell", "wasm-bindgen", - "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.114" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6" +checksum = "7fbdf9a35adf44786aecd5ff89b4563a90325f9da0923236f6104e603c7e86be" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3474,9 +3440,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.114" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3" +checksum = "dca9693ef2bab6d4e6707234500350d8dad079eb508dca05530c85dc3a529ff2" dependencies = [ "bumpalo", "proc-macro2", @@ -3487,9 +3453,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.114" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16" +checksum = "39129a682a6d2d841b6c429d0c51e5cb0ed1a03829d8b3d1e69a011e62cb3d3b" dependencies = [ "unicode-ident", ] @@ -3530,9 +3496,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.91" +version = "0.3.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854ba17bb104abfb26ba36da9729addc7ce7f06f5c0f90f3c391f8461cca21f9" +checksum = "cd70027e39b12f0849461e08ffc50b9cd7688d942c1c8e3c7b22273236b4dd0a" dependencies = [ "js-sys", "wasm-bindgen", @@ -3865,9 +3831,9 @@ dependencies = [ [[package]] name = "winnow" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a90e88e4667264a994d34e6d1ab2d26d398dcdca8b7f52bec8668957517fc7d8" +checksum = "09dac053f1cd375980747450bfc7250c264eaae0583872e845c0c7cd578872b5" dependencies = [ "memchr", ] @@ -3962,9 +3928,9 @@ dependencies = [ [[package]] name = "writeable" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" [[package]] name = "xattr" @@ -3978,9 +3944,9 @@ dependencies = [ [[package]] name = "yoke" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" +checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" dependencies = [ "stable_deref_trait", "yoke-derive", @@ -3989,9 +3955,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" dependencies = [ "proc-macro2", "quote", @@ -4001,18 +3967,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.47" +version = "0.8.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbb2a062be311f2ba113ce66f697a4dc589f85e78a4aea276200804cea0ed87" +checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.47" +version = "0.8.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e8bc7269b54418e7aeeef514aa68f8690b8c0489a06b0136e5f57c4c5ccab89" +checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" dependencies = [ "proc-macro2", "quote", @@ -4021,18 +3987,18 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" dependencies = [ "proc-macro2", "quote", @@ -4048,9 +4014,9 @@ checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" [[package]] name = "zerotrie" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" dependencies = [ "displaydoc", "yoke", @@ -4059,9 +4025,9 @@ dependencies = [ [[package]] name = "zerovec" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" dependencies = [ "yoke", "zerofrom", @@ -4070,9 +4036,9 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index bab49c0..e34e855 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,17 +17,17 @@ module-parser = { path = "crates/module-parser" } anyhow = { version = "1.0" } clap = { version = "4.5", features = ["derive"] } -cargo-generate = { version = "0.23.7" } +cargo-generate = { version = "0.23.8" } cargo_metadata = { version = "0.23.1" } liquid = { version = "~0.26" } # align with cargo-generate serde = { version = "1.0", features = ["derive"] } -serde-saphyr = { version = "0.0.22" } +serde-saphyr = { version = "0.0.23" } serde_json = { version = "1.0" } -toml = { version = "1.0.7", features = ["serde"] } -toml_edit = "0.25.5" +toml = { version = "1.1.2", features = ["serde"] } +toml_edit = "0.25.10" notify = { version = "8.2", features = ["serde"] } reqwest = { version = "0.13", features = ["json"] } diff --git a/SKILLS.md b/SKILLS.md index b993eae..c77ab2e 100644 --- a/SKILLS.md +++ b/SKILLS.md @@ -62,9 +62,11 @@ cyberfabric ## Shared Argument Patterns -- **[`-p, --path `]** Workspace root path. Defaults to `.` in most commands that work on a workspace. -- **[`-c, --config `]** Config file path. This is required anywhere `PathConfigArgs` is used because there is no - default. +- **[`-p, --path `]** Optional workspace path. When provided to `config ...`, `build`, and `run` commands, the CLI + immediately changes the current working directory to this directory. Relative config paths and generated project + locations then resolve from that directory. When omitted, the current working directory is left unchanged. +- **[`-c, --config `]** Config file path. This is required for `config ...`, `build`, and `run` commands because + there is no default. - **[`--name `]** For `build` and `run`, overrides the generated server project and binary name that would otherwise default to the config filename stem. - **[`-v, --verbose`]** Usually enables more logging or richer output. @@ -205,7 +207,7 @@ cyberfabric config mod list -c [-p ] [--system] [--verbose] [--re Arguments: - **[`-c, --config `]** Required config file path -- **[`-p, --path `]** Workspace root, defaults to `.` +- **[`-p, --path `]** Optional workspace directory - **[`-s, --system`]** Also print built-in system registry modules - **[`-v, --verbose`]** Print full metadata - **[`--registry `]** Registry used only for verbose system lookups, defaults to `crates.io` @@ -214,6 +216,8 @@ Behavior: - **[discovers local modules]** Scans the workspace for module crates - **[loads configured modules]** Reads enabled modules from the config file +- **[path activation]** If `-p/--path` is provided, the CLI first changes the current working directory there before + resolving `-c/--config` - **[marks enabled locals]** Shows when a workspace module is enabled in config - **[shows missing locals]** Shows when a configured module is not present in the workspace - **[optional crates.io fetch]** If both `--system` and `--verbose` are used, the CLI fetches registry metadata and @@ -266,7 +270,7 @@ Arguments: - **[``]** Module name in the config - **[`-c, --config `]** Required config file path -- **[`-p, --path `]** Workspace root, defaults to `.` +- **[`-p, --path `]** Optional workspace directory - **[`--package `]** Override metadata package name - **[`--module-version `]** Override metadata version - **[`--default-features `]** Persist Cargo `default_features` @@ -276,6 +280,8 @@ Arguments: Behavior: - **[upsert]** Creates or updates `modules.` +- **[path activation]** If `-p/--path` is provided, Clap changes the current working directory while parsing that value, + before `-c/--config` is resolved - **[local-first discovery]** Tries to discover module metadata from the workspace - **[remote module support]** If the module is not local, you must provide both `--package` and `--module-version` - **[portable metadata]** Local filesystem paths are intentionally not persisted into config metadata @@ -313,6 +319,8 @@ cyberfabric config mod rm -c [-p ] Behavior: +- **[path activation]** If `-p/--path` is provided, Clap changes the current working directory while parsing that value, + before `-c/--config` is resolved - **[strict removal]** Fails if the module is not present in config Example: @@ -353,6 +361,8 @@ Shared DB flags: Rules: +- **[path activation]** If `-p/--path` is provided, each subcommand changes the current working directory while Clap is + parsing that value, before `-c/--config` is resolved - **[payload required]** `add` and `edit` require at least one DB-related field - **[module must exist]** `add` requires the module already exist in config and recommends `config mod add` first - **[edit requires existing DB config]** `edit` fails if no module DB config exists yet @@ -396,6 +406,8 @@ cyberfabric config db rm -c [-p ] Behavior: +- **[path activation]** If `-p/--path` is provided, each subcommand changes the current working directory while Clap is + parsing that value, before `-c/--config` is resolved - **[server name]** Stored under `database.servers.` - **[add is upsert]** `add` creates or patches an existing server entry - **[edit is strict]** `edit` requires the server to already exist @@ -545,13 +557,13 @@ Generate a server project under `.cyberfabric//` and run it. Synopsis: ```bash -cyberfabric run -c [-p ] [--name ] [--watch] [--otel] [--release] [--clean] +cargo cyberfabric run -c [-p ] [--name ] [--watch] [--otel] [--release] [--clean] ``` Arguments: - **[`-c, --config `]** Required config file path -- **[`-p, --path `]** Workspace root, defaults to `.` +- **[`-p, --path `]** Optional workspace directory - **[`--name `]** Override the generated server project and binary name; defaults to the config filename stem - **[`-w, --watch`]** Re-run when watched inputs change - **[`--otel`]** Pass Cargo feature `otel` @@ -562,6 +574,8 @@ Behavior: - **[name resolution]** Uses the config filename stem by default, so `config/quickstart.yml` generates under `.cyberfabric/quickstart/`; `--name` overrides that default +- **[path activation]** If `-p/--path` is provided, Clap changes the current working directory while parsing that value, + before `-c/--config` is resolved and `.cyberfabric//` is generated - **[generates server structure]** Writes `.cyberfabric//Cargo.toml`, `.cyberfabric//.cargo/config.toml`, and `.cyberfabric//src/main.rs` - **[loads config dependencies]** Builds dependencies from the config and local module metadata @@ -572,19 +586,19 @@ Behavior: Examples: ```bash -cyberfabric run -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml +cargo cyberfabric run -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml ``` ```bash -cyberfabric run -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml --watch +cargo cyberfabric run -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml --watch ``` ```bash -cyberfabric run -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml --otel --release --clean +cargo cyberfabric run -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml --otel --release --clean ``` ```bash -cyberfabric run -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml --name demo-server +cargo cyberfabric run -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml --name demo-server ``` ### `build` @@ -600,7 +614,7 @@ cyberfabric build -c [-p ] [--name ] [--otel] [--release] [ Arguments: - **[`-c, --config `]** Required config file path -- **[`-p, --path `]** Workspace root, defaults to `.` +- **[`-p, --path `]** Optional workspace directory - **[`--name `]** Override the generated server project and binary name; defaults to the config filename stem - **[`--otel`]** Pass Cargo feature `otel` - **[`-r, --release`]** Use release mode @@ -611,6 +625,8 @@ Behavior: - **[generates before build]** Recreates the generated server project before invoking Cargo - **[name resolution]** Uses the config filename stem by default, so `config/quickstart.yml` builds from `.cyberfabric/quickstart/`; `--name` overrides that default +- **[path activation]** If `-p/--path` is provided, Clap changes the current working directory while parsing that value, + before `-c/--config` is resolved and `.cyberfabric//` is generated - **[builds inside `.cyberfabric/`]** Executes `cargo build` in the generated directory Examples: @@ -679,7 +695,7 @@ Current status: cyberfabric mod init /tmp/cf-demo cyberfabric mod add background-worker -p /tmp/cf-demo cyberfabric config mod add background-worker -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml -cyberfabric run -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml +cargo cyberfabric run -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml ``` ### Add a module and wire a shared DB server @@ -689,7 +705,7 @@ cyberfabric mod add api-db-handler -p /tmp/cf-demo cyberfabric config db add primary -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml --engine postgres --host localhost --port 5432 --user app --password '${DB_PASSWORD}' --dbname appdb cyberfabric config mod add api-db-handler -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml cyberfabric config mod db add api-db-handler -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml --server primary -cyberfabric run -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml --watch +cargo cyberfabric run -p /tmp/cf-demo -c /tmp/cf-demo/config/quickstart.yml --watch ``` ### Inspect source for a dependency @@ -712,21 +728,21 @@ cyberfabric docs --verbose tokio::sync ```bash cyberfabric mod init -cyberfabric mod add -p +cyberfabric mod add [-p ] -cyberfabric config mod list -p -c -cyberfabric config mod add -p -c -cyberfabric config mod rm -p -c -cyberfabric config mod db add -p -c ... -cyberfabric config mod db edit -p -c ... -cyberfabric config mod db rm -p -c +cyberfabric config mod list [-p ] -c +cyberfabric config mod add [-p ] -c +cyberfabric config mod rm [-p ] -c +cyberfabric config mod db add [-p ] -c ... +cyberfabric config mod db edit [-p ] -c ... +cyberfabric config mod db rm [-p ] -c -cyberfabric config db add -p -c ... -cyberfabric config db edit -p -c ... -cyberfabric config db rm -p -c +cyberfabric config db add [-p ] -c ... +cyberfabric config db edit [-p ] -c ... +cyberfabric config db rm [-p ] -c cyberfabric docs [-p ] [--version ] [--clean] [] cyberfabric tools --all -cyberfabric run -p -c [--name ] [--watch] -cyberfabric build -p -c [--name ] +cyberfabric run [-p ] -c [--name ] [--watch] +cyberfabric build [-p ] -c [--name ] ``` diff --git a/crates/cli/src/build/mod.rs b/crates/cli/src/build/mod.rs index 4b73d8d..b5908fc 100644 --- a/crates/cli/src/build/mod.rs +++ b/crates/cli/src/build/mod.rs @@ -10,13 +10,12 @@ pub struct BuildArgs { impl BuildArgs { pub fn run(&self) -> anyhow::Result<()> { - let (path, config_path, project_name) = - self.build_run_args.resolve_workspace_and_config()?; + let (config_path, project_name) = self.build_run_args.resolve_config_and_name()?; - let dependencies = common::get_config(&path, &config_path)?.create_dependencies()?; - common::generate_server_structure(&path, &project_name, &config_path, &dependencies)?; + let dependencies = common::get_config(&config_path)?.create_dependencies()?; + common::generate_server_structure(&project_name, &config_path, &dependencies)?; - let cargo_dir = common::generated_project_dir(&path, &project_name); + let cargo_dir = common::generated_project_dir(&project_name)?; let status = common::cargo_command( "build", &cargo_dir, diff --git a/crates/cli/src/common.rs b/crates/cli/src/common.rs index 9e5ae52..ccd15fb 100644 --- a/crates/cli/src/common.rs +++ b/crates/cli/src/common.rs @@ -6,6 +6,7 @@ use module_parser::{ get_dependencies, get_module_name_from_crate, }; use std::collections::{BTreeSet, HashMap}; +use std::env; use std::fmt::{self, Display}; use std::fs; use std::path::{Path, PathBuf}; @@ -15,25 +16,36 @@ use std::sync::LazyLock; #[derive(Args)] pub struct PathConfigArgs { /// Path to the module workspace root - #[arg(short = 'p', long, default_value = ".")] - pub path: PathBuf, + #[arg(short = 'p', long, value_parser = parse_and_chdir)] + pub path: Option, /// Path to the config file #[arg(short = 'c', long)] pub config: PathBuf, } +fn parse_and_chdir(s: &str) -> Result { + let path = PathBuf::from(s); + + if !path.is_dir() { + return Err(format!("not a directory: {}", path.display())); + } + + env::set_current_dir(&path) + .map_err(|e| format!("failed to change directory to {}: {e}", path.display()))?; + + Ok(path) +} + impl PathConfigArgs { pub fn resolve_config(&self) -> anyhow::Result { self.config .canonicalize() .context("can't canonicalize config") } +} - pub fn resolve_path(&self) -> anyhow::Result { - self.path - .canonicalize() - .context("can't canonicalize workspace path") - } +pub fn workspace_root() -> anyhow::Result { + env::current_dir().context("can't determine current working directory") } #[derive(Args)] @@ -76,15 +88,14 @@ impl Display for Registry { } impl BuildRunArgs { - pub fn resolve_workspace_and_config(&self) -> anyhow::Result<(PathBuf, PathBuf, String)> { - let path = self.path_config.resolve_path()?; + pub fn resolve_config_and_name(&self) -> anyhow::Result<(PathBuf, String)> { let config_path = self.path_config.resolve_config()?; let project_name = resolve_generated_project_name(&config_path, self.name.as_deref())?; if self.clean { - remove_from_file_structure(&path, &project_name, "Cargo.lock")?; + remove_from_file_structure(&project_name, "Cargo.lock")?; } - Ok((path, config_path, project_name)) + Ok((config_path, project_name)) } } @@ -150,9 +161,9 @@ pub fn cargo_command(subcommand: &str, path: &Path, otel: bool, release: bool) - cmd } -pub fn get_config(path: &Path, config_path: &Path) -> anyhow::Result { +pub fn get_config(config_path: &Path) -> anyhow::Result { let mut config = get_config_from_path(config_path)?; - let mut members = get_module_name_from_crate(&path.to_path_buf())?; + let mut members = get_module_name_from_crate()?; config.modules.iter_mut().for_each(|module| { if let Some(module_metadata) = members.remove(module.0.as_str()) { @@ -214,8 +225,9 @@ static CARGO_DEPS: LazyLock> = LazyLock::new(|| { res }); -fn create_required_deps(path: &Path) -> anyhow::Result { - let mut deps = get_dependencies(path, &CARGO_DEPS)?; +fn create_required_deps() -> anyhow::Result { + let workspace_path = workspace_root()?; + let mut deps = get_dependencies(&workspace_path, &CARGO_DEPS)?; if let Some(modkit) = deps.get_mut("modkit") { modkit.features.insert("bootstrap".to_owned()); } else { @@ -244,13 +256,12 @@ fn create_required_deps(path: &Path) -> anyhow::Result { } pub fn generate_server_structure( - path: &Path, project_name: &str, config_path: &Path, current_dependencies: &CargoTomlDependencies, ) -> anyhow::Result<()> { let mut dependencies = current_dependencies.clone(); - dependencies.extend(create_required_deps(path)?); + dependencies.extend(create_required_deps()?); let cargo_toml = CargoToml { package: Package { name: project_name.to_owned(), @@ -266,10 +277,9 @@ pub fn generate_server_structure( .build()? .parse(CARGO_SERVER_MAIN)?; - create_file_structure(path, project_name, "Cargo.toml", &cargo_toml_str)?; - create_file_structure(path, project_name, ".cargo/config.toml", CARGO_CONFIG_TOML)?; + create_file_structure(project_name, "Cargo.toml", &cargo_toml_str)?; + create_file_structure(project_name, ".cargo/config.toml", CARGO_CONFIG_TOML)?; create_file_structure( - path, project_name, "src/main.rs", &main_template.render(&prepare_cargo_server_main( @@ -281,18 +291,17 @@ pub fn generate_server_structure( Ok(()) } -pub fn generated_project_dir(path: &Path, project_name: &str) -> PathBuf { - PathBuf::from(path).join(BASE_PATH).join(project_name) +pub fn generated_project_dir(project_name: &str) -> anyhow::Result { + Ok(workspace_root()?.join(BASE_PATH).join(project_name)) } fn create_file_structure( - path: &Path, project_name: &str, relative_path: &str, contents: &str, ) -> anyhow::Result<()> { use std::io::Write; - let path = generated_project_dir(path, project_name).join(relative_path); + let path = generated_project_dir(project_name)?.join(relative_path); fs::create_dir_all( path.parent().context( "this should be unreachable, the parent for the file structure always exists", @@ -309,12 +318,8 @@ fn create_file_structure( .context("can't write to file") } -fn remove_from_file_structure( - path: &Path, - project_name: &str, - relative_path: &str, -) -> anyhow::Result<()> { - let path = generated_project_dir(path, project_name).join(relative_path); +fn remove_from_file_structure(project_name: &str, relative_path: &str) -> anyhow::Result<()> { + let path = generated_project_dir(project_name)?.join(relative_path); if path.exists() { fs::remove_file(path).context("can't remove file")?; } diff --git a/crates/cli/src/config/modules/add.rs b/crates/cli/src/config/modules/add.rs index c14704c..9946d4f 100644 --- a/crates/cli/src/config/modules/add.rs +++ b/crates/cli/src/config/modules/add.rs @@ -1,6 +1,4 @@ -use super::{ - ModulesContext, load_config, resolve_modules_context, save_config, validate_module_name, -}; +use super::{load_config, resolve_modules_context, save_config, validate_module_name}; use crate::common::PathConfigArgs; use crate::config::app_config::AppConfig; use anyhow::{Context, bail}; @@ -37,7 +35,7 @@ impl AddArgs { let context = resolve_modules_context(&self.path_config)?; let mut config = load_config(&context.config_path)?; - let local_modules = discover_local_modules(&context, self)?; + let local_modules = discover_local_modules(self)?; let metadata = build_required_metadata(self, local_modules.get(&self.module))?; upsert_module_config(&mut config, self, metadata); @@ -108,22 +106,16 @@ fn merge_module_metadata( } } -fn discover_local_modules( - context: &ModulesContext, - args: &AddArgs, -) -> anyhow::Result> { - match get_module_name_from_crate(&context.workspace_path) { +fn discover_local_modules(args: &AddArgs) -> anyhow::Result> { + match get_module_name_from_crate() { Ok(modules) => Ok(modules), Err(_) if args.package.is_some() && args.module_version.is_some() => { // Allow remote module additions even if the provided -p path is not a Cargo workspace. Ok(HashMap::new()) } Err(err) => Err(err).with_context(|| { - format!( - "failed to discover local modules at {}. \ - if this is a remote module, provide both --package and --module-version", - context.workspace_path.display() - ) + "failed to discover local modules. if this is a remote module, provide both \ + --package and --module-version" }), } } @@ -195,7 +187,7 @@ mod tests { fn build_required_metadata_uses_local_package_and_version() { let args = AddArgs { path_config: PathConfigArgs { - path: PathBuf::from("."), + path: Some(PathBuf::from(".")), config: PathBuf::from("."), }, module: "demo".to_owned(), @@ -227,7 +219,7 @@ mod tests { fn build_required_metadata_requires_remote_package() { let args = AddArgs { path_config: PathConfigArgs { - path: PathBuf::from("."), + path: Some(PathBuf::from(".")), config: PathBuf::from("."), }, module: "demo".to_owned(), @@ -251,7 +243,7 @@ mod tests { fn build_required_metadata_requires_remote_version() { let args = AddArgs { path_config: PathConfigArgs { - path: PathBuf::from("."), + path: Some(PathBuf::from(".")), config: PathBuf::from("."), }, module: "demo".to_owned(), @@ -275,7 +267,7 @@ mod tests { fn build_required_metadata_accepts_remote_with_package_and_version() { let args = AddArgs { path_config: PathConfigArgs { - path: PathBuf::from("."), + path: Some(PathBuf::from(".")), config: PathBuf::from("."), }, module: "demo".to_owned(), @@ -312,7 +304,7 @@ mod tests { let args = AddArgs { path_config: PathConfigArgs { - path: PathBuf::from("."), + path: Some(PathBuf::from(".")), config: PathBuf::from("."), }, module: "demo".to_owned(), diff --git a/crates/cli/src/config/modules/list.rs b/crates/cli/src/config/modules/list.rs index 6e5007d..d7c4587 100644 --- a/crates/cli/src/config/modules/list.rs +++ b/crates/cli/src/config/modules/list.rs @@ -13,7 +13,7 @@ use serde::Deserialize; use std::collections::{BTreeMap, BTreeSet, HashMap}; use std::fmt::Display; use std::io::{Cursor, Read}; -use std::path::{Path, PathBuf}; +use std::path::Path; use std::time::Duration; #[derive(Args)] @@ -37,7 +37,7 @@ pub struct ListArgs { impl ListArgs { pub(super) fn run(&self) -> anyhow::Result<()> { let context = resolve_modules_context(&self.path_config)?; - let local_modules = discover_workspace_modules(&context.workspace_path)?; + let local_modules = get_module_name_from_crate()?; let config = load_config(&context.config_path)?; let enabled_modules: BTreeSet<_> = config.modules.keys().map(String::as_str).collect(); @@ -67,7 +67,7 @@ impl ListArgs { } println!(); - println!("Workspace modules ({}):", context.workspace_path.display()); + println!("Workspace modules:"); if local_modules.is_empty() { println!(" (none)"); } else { @@ -115,18 +115,6 @@ impl ListArgs { } } -fn discover_workspace_modules( - workspace_path: &Path, -) -> anyhow::Result> { - let workspace_buf = PathBuf::from(workspace_path); - get_module_name_from_crate(&workspace_buf).with_context(|| { - format!( - "failed to discover workspace modules at {}", - workspace_path.display() - ) - }) -} - fn print_local_metadata(module: &ConfigModule) { print_metadata(&module.metadata); } diff --git a/crates/cli/src/config/modules/mod.rs b/crates/cli/src/config/modules/mod.rs index 14b36c2..ac7a982 100644 --- a/crates/cli/src/config/modules/mod.rs +++ b/crates/cli/src/config/modules/mod.rs @@ -96,7 +96,6 @@ pub enum ModulesCommand { } pub(super) struct ModulesContext { - workspace_path: PathBuf, config_path: PathBuf, } @@ -115,7 +114,6 @@ pub(super) fn resolve_modules_context( path_config: &PathConfigArgs, ) -> anyhow::Result { Ok(ModulesContext { - workspace_path: path_config.resolve_path()?, config_path: path_config.resolve_config()?, }) } diff --git a/crates/cli/src/run/mod.rs b/crates/cli/src/run/mod.rs index a016e89..37700df 100644 --- a/crates/cli/src/run/mod.rs +++ b/crates/cli/src/run/mod.rs @@ -15,9 +15,9 @@ pub struct RunArgs { impl RunArgs { pub fn run(&self) -> anyhow::Result<()> { - let (path, config_path, project_name) = self.br_args.resolve_workspace_and_config()?; + let (config_path, project_name) = self.br_args.resolve_config_and_name()?; - let rl = run_loop::RunLoop::new(path, config_path, project_name); + let rl = run_loop::RunLoop::new(config_path, project_name); run_loop::OTEL.store(self.br_args.otel, std::sync::atomic::Ordering::Relaxed); run_loop::RELEASE.store(self.br_args.release, std::sync::atomic::Ordering::Relaxed); diff --git a/crates/cli/src/run/run_loop.rs b/crates/cli/src/run/run_loop.rs index 518b4e3..94bb4f4 100644 --- a/crates/cli/src/run/run_loop.rs +++ b/crates/cli/src/run/run_loop.rs @@ -14,7 +14,6 @@ pub(super) enum RunSignal { } pub(super) struct RunLoop { - path: PathBuf, config_path: PathBuf, project_name: String, } @@ -23,25 +22,19 @@ pub(super) static OTEL: AtomicBool = AtomicBool::new(false); pub(super) static RELEASE: AtomicBool = AtomicBool::new(false); impl RunLoop { - pub(super) const fn new(path: PathBuf, config_path: PathBuf, project_name: String) -> Self { + pub(super) const fn new(config_path: PathBuf, project_name: String) -> Self { Self { - path, config_path, project_name, } } pub(super) fn run(&self, watch: bool) -> anyhow::Result { - let dependencies = - common::get_config(&self.path, &self.config_path)?.create_dependencies()?; - common::generate_server_structure( - &self.path, - &self.project_name, - &self.config_path, - &dependencies, - )?; + let workspace_path = common::workspace_root()?; + let dependencies = common::get_config(&self.config_path)?.create_dependencies()?; + common::generate_server_structure(&self.project_name, &self.config_path, &dependencies)?; - let cargo_dir = common::generated_project_dir(&self.path, &self.project_name); + let cargo_dir = common::generated_project_dir(&self.project_name)?; if !watch { let status = cargo_run(&cargo_dir) @@ -76,18 +69,19 @@ impl RunLoop { .config_path .parent() .context("config path has no parent directory")?; - let workspace_manifest = self.path.join("Cargo.toml"); + let workspace_manifest = workspace_path.join("Cargo.toml"); watcher .watch(config_parent, RecursiveMode::NonRecursive) .context("failed to watch config directory")?; - if config_parent != self.path.as_path() { + if config_parent != workspace_path.as_path() { watcher - .watch(&self.path, RecursiveMode::NonRecursive) + .watch(&workspace_path, RecursiveMode::NonRecursive) .context("failed to watch workspace directory")?; } // Watch dependency paths that have `path` set - let mut watched_paths = watch_dependency_paths(&dependencies, &mut watcher, &self.path); + let mut watched_paths = + watch_dependency_paths(&dependencies, &mut watcher, &workspace_path); let mut current_deps = dependencies; // Event loop - runs until the watcher channel closes @@ -115,13 +109,12 @@ impl RunLoop { ); if is_config_change || is_workspace_manifest_change { - match common::get_config(&self.path, &self.config_path) + match common::get_config(&self.config_path) .and_then(module_parser::Config::create_dependencies) { Ok(new_deps) => { if new_deps != current_deps { if let Err(e) = common::generate_server_structure( - &self.path, &self.project_name, &self.config_path, &new_deps, @@ -129,7 +122,7 @@ impl RunLoop { eprintln!("failed to regenerate server structure: {e}"); } else { // Reconcile watched dependency paths - let new_watched = collect_dep_paths(&new_deps, &self.path); + let new_watched = collect_dep_paths(&new_deps, &workspace_path); for old in watched_paths.difference(&new_watched) { if let Err(err) = watcher.unwatch(old) { eprintln!("failed to unwatch {}: {err}", old.display()); diff --git a/crates/module-parser/src/metadata.rs b/crates/module-parser/src/metadata.rs index 3723324..309c9a5 100644 --- a/crates/module-parser/src/metadata.rs +++ b/crates/module-parser/src/metadata.rs @@ -22,9 +22,8 @@ pub struct ResolvedMetadataPath { pub source: String, } -pub fn get_module_name_from_crate(path: &PathBuf) -> anyhow::Result> { +pub fn get_module_name_from_crate() -> anyhow::Result> { let res = cargo_metadata::MetadataCommand::new() - .current_dir(path) .no_deps() .exec() .context("failed to run cargo metadata")?;