From 4925bc0dd80111757e1bc8480e58c086f76b7137 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Thu, 14 Nov 2024 12:01:20 -0800 Subject: [PATCH] deps: Audit 11/13 (#1719) * Update deps. * Update tsconfig. * Update commands. * Update proto. * Update tracing fields. * Fix windows. * Fix type. --- .github/workflows/rust.yml | 2 +- CHANGELOG.md | 6 + Cargo.lock | 543 ++++++++++++------ Cargo.toml | 32 +- .../action-graph/src/action_graph_builder.rs | 10 +- crates/affected/src/affected_tracker.rs | 25 +- crates/app/Cargo.toml | 4 +- crates/app/src/app_error.rs | 4 - crates/app/src/commands/bin.rs | 5 +- crates/app/src/commands/check.rs | 4 +- crates/app/src/commands/ci.rs | 18 +- crates/app/src/commands/clean.rs | 2 +- crates/app/src/commands/completions.rs | 7 +- crates/app/src/commands/docker/file.rs | 2 +- crates/app/src/commands/docker/prune.rs | 10 +- crates/app/src/commands/docker/scaffold.rs | 14 +- crates/app/src/commands/docker/setup.rs | 2 +- crates/app/src/commands/ext.rs | 2 +- crates/app/src/commands/generate.rs | 4 +- crates/app/src/commands/graph/action.rs | 6 +- crates/app/src/commands/graph/project.rs | 6 +- crates/app/src/commands/graph/task.rs | 6 +- crates/app/src/commands/graph/utils.rs | 4 +- crates/app/src/commands/init/bun.rs | 5 +- crates/app/src/commands/init/mod.rs | 17 +- crates/app/src/commands/init/node.rs | 11 +- crates/app/src/commands/init/rust.rs | 7 +- crates/app/src/commands/init/typescript.rs | 5 +- .../src/commands/migrate/from_package_json.rs | 2 +- .../src/commands/migrate/from_turborepo.rs | 2 +- crates/app/src/commands/migrate/mod.rs | 2 +- crates/app/src/commands/node/run_script.rs | 2 +- crates/app/src/commands/project.rs | 4 +- crates/app/src/commands/query.rs | 10 +- crates/app/src/commands/run.rs | 6 +- crates/app/src/commands/setup.rs | 2 +- crates/app/src/commands/syncs/codeowners.rs | 2 +- .../app/src/commands/syncs/config_schemas.rs | 2 +- crates/app/src/commands/syncs/hooks.rs | 4 +- crates/app/src/commands/syncs/projects.rs | 2 +- crates/app/src/commands/task.rs | 4 +- crates/app/src/commands/teardown.rs | 2 +- crates/app/src/commands/templates.rs | 2 +- crates/app/src/commands/upgrade.rs | 4 +- crates/app/src/queries/hash.rs | 6 +- crates/app/src/queries/hash_diff.rs | 3 +- crates/app/src/queries/projects.rs | 3 +- crates/app/src/queries/tasks.rs | 3 +- crates/app/src/queries/touched_files.rs | 7 +- crates/app/src/session.rs | 30 +- crates/app/src/systems/analyze.rs | 16 +- crates/app/src/systems/execute.rs | 6 +- crates/app/src/systems/startup.rs | 15 +- crates/cli/src/main.rs | 38 +- crates/codeowners/src/codeowners_generator.rs | 2 +- crates/common/src/consts.rs | 2 +- crates/config/Cargo.toml | 2 +- .../src/extension_registry.rs | 2 +- crates/plugin/src/host.rs | 4 +- crates/project-builder/src/project_builder.rs | 15 +- crates/project-graph/Cargo.toml | 3 +- crates/query/Cargo.toml | 4 +- crates/task-builder/src/tasks_builder.rs | 36 +- crates/task-expander/src/task_expander.rs | 18 +- crates/task-graph/Cargo.toml | 2 - crates/task-hasher/src/task_hasher.rs | 2 +- crates/task-runner/src/command_builder.rs | 8 +- crates/task-runner/src/command_executor.rs | 14 +- crates/task-runner/src/output_archiver.rs | 8 +- crates/task-runner/src/output_hydrater.rs | 8 +- crates/task-runner/src/task_runner.rs | 70 +-- .../toolchain-plugin/src/toolchain_plugin.rs | 4 +- .../src/toolchain_registry.rs | 2 +- crates/workspace-graph/src/query_projects.rs | 2 +- crates/workspace-graph/src/query_tasks.rs | 2 +- crates/workspace/src/projects_locator.rs | 2 +- crates/workspace/src/workspace_builder.rs | 4 +- legacy/node/platform/Cargo.toml | 2 - legacy/rust/lang/Cargo.toml | 2 +- legacy/typescript/lang/Cargo.toml | 2 +- legacy/typescript/lang/src/tsconfig.rs | 8 +- legacy/typescript/lang/tests/tsconfig_test.rs | 22 +- .../typescript/platform/src/sync_project.rs | 14 +- 83 files changed, 701 insertions(+), 507 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 111211253ce..326753da80f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -90,7 +90,7 @@ jobs: with: auto-install: true cache: ${{ runner.os == 'Linux' }} - proto-version: '0.42.0' # Keep in sync + proto-version: '0.42.1' # Keep in sync - uses: mozilla-actions/sccache-action@v0.0.5 if: ${{ vars.ENABLE_SCCACHE == 'true' }} - name: Checking coverage status diff --git a/CHANGELOG.md b/CHANGELOG.md index 369d1c3d746..3e82de68c7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,12 +23,18 @@ - Added 7 new token variables: `$arch`, `$os`, `$osFamily`, `$vcsBranch`, `$vcsRepository`, `$vcsRevision`, `$workingDir` - Added a `rust.binstallVersion` setting to `.moon/toolchain.yml`. +- Updated Pkl configurations to support `read()` for environment variables. #### 🐞 Fixes - Fixed `moon project-graph ` not including all dependencies/dependents. It was only showing direct relationships. +#### ⚙️ Internal + +- Updated dependencies. +- Updated proto to v0.42.1 (from 0.42.0). + ## 1.29.4 #### 🚀 Updates diff --git a/Cargo.lock b/Cargo.lock index 9a539d74d49..df6b832adfd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -322,7 +322,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -385,7 +385,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -538,9 +538,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "bzip2" @@ -565,9 +565,9 @@ dependencies = [ [[package]] name = "cached" -version = "0.53.1" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4d73155ae6b28cf5de4cfc29aeb02b8a1c6dab883cb015d15cd514e42766846" +checksum = "9718806c4a2fe9e8a56fd736f97b340dd10ed1be8ed733ed50449f351dc33cae" dependencies = [ "ahash", "cached_proc_macro", @@ -587,7 +587,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -663,13 +663,13 @@ dependencies = [ [[package]] name = "cargo-lock" -version = "9.0.0" +version = "10.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e11c675378efb449ed3ce8de78d75d0d80542fc98487c26aba28eb3b82feac72" +checksum = "6469776d007022d505bbcc2be726f5f096174ae76d710ebc609eb3029a45b551" dependencies = [ "semver", "serde", - "toml 0.7.8", + "toml", "url", ] @@ -680,7 +680,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88da5a13c620b4ca0078845707ea9c3faf11edbc3ffd8497d11d686211cd1ac0" dependencies = [ "serde", - "toml 0.8.19", + "toml", ] [[package]] @@ -705,9 +705,9 @@ dependencies = [ "quote", "serde", "serde_json", - "syn 2.0.86", + "syn 2.0.87", "tempfile", - "toml 0.8.19", + "toml", ] [[package]] @@ -790,9 +790,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.20" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" +checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" dependencies = [ "clap_builder", "clap_derive", @@ -800,9 +800,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.20" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" +checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" dependencies = [ "anstream", "anstyle", @@ -813,18 +813,18 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.36" +version = "4.5.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86bc73de94bc81e52f3bebec71bc4463e9748f7a59166663e32044669577b0e2" +checksum = "d9647a559c112175f17cf724dc72d3645680a883c58481332779192b0d8e7a01" dependencies = [ "clap", ] [[package]] name = "clap_complete_nushell" -version = "4.5.3" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fe32110e006bccf720f8c9af3fee1ba7db290c724eab61544e1d3295be3a40e" +checksum = "315902e790cc6e5ddd20cbd313c1d0d49db77f191e149f96397230fb82a17677" dependencies = [ "clap", "clap_complete", @@ -839,7 +839,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -1222,7 +1222,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -1233,7 +1233,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -1253,7 +1253,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -1375,7 +1375,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -1508,7 +1508,7 @@ dependencies = [ "serde", "serde_json", "sha2", - "toml 0.8.19", + "toml", "tracing", "tracing-subscriber", "ureq", @@ -1545,7 +1545,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -1582,7 +1582,7 @@ checksum = "b3a225e26f498571c273e095d9c2437acb0fd5d6ef3cb88d284d7e2d037d4d10" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -1688,9 +1688,9 @@ dependencies = [ [[package]] name = "fs4" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec6fcfb3c0c1d71612528825042261419d5dade9678c39a781e05b63677d9b32" +checksum = "e871a4cfa68bb224863b53149d973df1ac8d1ed2fa1d1bfc37ac1bb65dd37207" dependencies = [ "rustix", "windows-sys 0.52.0", @@ -1765,7 +1765,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -1852,7 +1852,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -2262,6 +2262,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "id-arena" version = "2.2.1" @@ -2276,12 +2394,23 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] @@ -2598,6 +2727,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "lock_api" version = "0.4.12" @@ -2652,7 +2787,7 @@ dependencies = [ "manyhow-macros", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -2739,7 +2874,7 @@ checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -3751,7 +3886,6 @@ dependencies = [ "petgraph", "rustc-hash 2.0.0", "scc", - "serde", "starbase_events", "starbase_sandbox", "starbase_utils", @@ -3953,8 +4087,6 @@ dependencies = [ "moon_task_expander", "petgraph", "rustc-hash 2.0.0", - "serde", - "starbase_utils", "thiserror", "tracing", ] @@ -4410,7 +4542,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -4529,9 +4661,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdbef9d1d47087a895abd220ed25eb4ad973a5e26f6a4367b038c25e28dfc2d9" +checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" dependencies = [ "memchr", "thiserror", @@ -4540,9 +4672,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d3a6e3394ec80feb3b6393c725571754c6188490265c61aaf260810d6b95aa0" +checksum = "d214365f632b123a47fd913301e14c946c61d1c183ee245fa76eb752e59a02dd" dependencies = [ "pest", "pest_generator", @@ -4550,22 +4682,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94429506bde1ca69d1b5601962c73f4172ab4726571a59ea95931218cb0e930e" +checksum = "eb55586734301717aea2ac313f50b2eb8f60d2fc3dc01d190eefa2e625f60c4e" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] name = "pest_meta" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac8a071862e93690b6e34e9a5fb8e33ff3734473ac0245b27232222c4906a33f" +checksum = "b75da2a70cf4d9cb76833c990ac9cd3923c9a8905a8929789ce347c84564d03d" dependencies = [ "once_cell", "pest", @@ -4769,7 +4901,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.22.22", + "toml_edit", ] [[package]] @@ -4785,9 +4917,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -4812,14 +4944,14 @@ dependencies = [ "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] name = "proto_core" -version = "0.43.4" +version = "0.43.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b79ece66f9b8bc349bcf8b87250f8d4de171649f2a1016ed4bd6829f15713bf6" +checksum = "febd80c3f5b8e51a8ba76f383a3ab40554f7984413d348c5a28d1d9496f1deed" dependencies = [ "convert_case", "indexmap", @@ -5194,9 +5326,9 @@ dependencies = [ [[package]] name = "rpkl" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bbd66164dbd6690de3ca1ecbd7a600d84af5fe1717683832510bf7ef6a6140" +checksum = "90d4fb97471646d778a76c8009623e1303898fdf9f4ba9f404b02a0217b7dfb1" dependencies = [ "dunce", "rmp-serde", @@ -5357,9 +5489,9 @@ dependencies = [ [[package]] name = "schematic" -version = "0.17.5" +version = "0.17.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9803bd9e6cccb1cc9cec6943f34ba93aa6cf7b6f183ee20a43457934dbc2b686" +checksum = "b13cc48a6f0f9cdb16cfa88f7a104e1e77483b03e154b0de40c68af41462d0db" dependencies = [ "garde", "indexmap", @@ -5376,28 +5508,28 @@ dependencies = [ "serde_yaml", "starbase_styles", "thiserror", - "toml 0.8.19", + "toml", "tracing", ] [[package]] name = "schematic_macros" -version = "0.17.3" +version = "0.17.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "641ca4c08e2735689cbc88901b755a806cbdb328a5dbddcd9176ec6de2ce59b0" +checksum = "5336c468775c5083eaa2958608f68937c491686a079d108e246345f370623f9a" dependencies = [ "convert_case", "darling", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] name = "schematic_types" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baae6c4555fd2a9cad6b1675fde90c8c3eff3772a1053b251d6ff0d547852e1f" +checksum = "768ff9d8765442119bfb73b7808607f76f75fb2987932637d43b144d6ad5e3fe" dependencies = [ "indexmap", "rpkl", @@ -5405,7 +5537,7 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "toml 0.8.19", + "toml", "url", ] @@ -5455,22 +5587,22 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -5542,9 +5674,9 @@ dependencies = [ [[package]] name = "serial_test" -version = "3.1.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b4b487fe2acf240a021cf57c6b2b4903b1e78ca0ecd862a71b71d2a51fed77d" +checksum = "1b258109f244e1d6891bf1053a55d63a5cd4f8f4c30cf9a1280989f80e7a1fa9" dependencies = [ "futures", "log", @@ -5556,13 +5688,13 @@ dependencies = [ [[package]] name = "serial_test_derive" -version = "3.1.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67" +checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -5733,9 +5865,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "starbase" -version = "0.8.4" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b96991015da0d20598917ba69d8bf25a0209a9fa763b12c81e5d948f5c7b483f" +checksum = "b1b55189276998800e553d329ab7218e1a81688661901268a0cad0b774d6d70d" dependencies = [ "async-trait", "chrono", @@ -5750,9 +5882,9 @@ dependencies = [ [[package]] name = "starbase_archive" -version = "0.8.7" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ef6774ceaab5ff89017f475aa2b1db19998de5cc4df719ea65f1d5ba9b754e6" +checksum = "ddcd0a8668af71ac7aaec90d5c75237d48f7cfc2b68f0ca06cafc683e2ab584c" dependencies = [ "binstall-tar", "bzip2", @@ -5770,9 +5902,9 @@ dependencies = [ [[package]] name = "starbase_events" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fa8f177e746e4ad83f45c5c232e8dbdd63bbad74b603fea49ab7afdd79832a" +checksum = "6e256909ca832861297b98e64b13d6bc7786885efd0e3831f4d67f278a7dea32" dependencies = [ "async-trait", "miette", @@ -5782,21 +5914,21 @@ dependencies = [ [[package]] name = "starbase_macros" -version = "0.7.5" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c27886f95de94ee99af3c3f8fb3dd6e4d0bd12f02ff445a9ba32226ccb64ac40" +checksum = "445834e628a648079bc1b651be9fb592cbf5894ac170b27c2350cb09414daa0d" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] name = "starbase_sandbox" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42da00b3ca0f2fe52e18416ed5b2d44c82e85351bcf797431aa1da5af903ee7c" +checksum = "00380c6d481a26cd65866100980aabc75b6ad3425ea7fe5b741fdf3ada9d7674" dependencies = [ "assert_cmd", "assert_fs", @@ -5809,9 +5941,9 @@ dependencies = [ [[package]] name = "starbase_shell" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfcf49fdd3aa2a87175defb63325540f61346fc28e03bbbbdf56eff96025252f" +checksum = "bb4ddfe965972d15e1b12fd0650c5bcfa0219b0c20bce763b66ffd88b75e6733" dependencies = [ "regex", "sysinfo", @@ -5821,9 +5953,9 @@ dependencies = [ [[package]] name = "starbase_styles" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49d8a8222c97b23595fe393ac35d62b88942bdc7e89c8c88736d9ea2c986dbae" +checksum = "358d0e98dc524ef2b838e9e70367c899d5ef8629f4efb44add57d92da6e75a8f" dependencies = [ "dirs 5.0.1", "miette", @@ -5834,9 +5966,9 @@ dependencies = [ [[package]] name = "starbase_utils" -version = "0.8.10" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302be829660e306e56225a20224b1ddcce97baae9c34a62742e8ac7d122f6508" +checksum = "92724184aae5faf89b2ded8ac247e24cb0720f3eb5ec163509fb6994cdfa6f9d" dependencies = [ "dirs 5.0.1", "ec4rs", @@ -5851,7 +5983,7 @@ dependencies = [ "starbase_styles", "thiserror", "tokio", - "toml 0.8.19", + "toml", "tracing", "url", "wax", @@ -5901,7 +6033,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -5944,9 +6076,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.86" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89275301d38033efb81a6e60e3497e734dfcc62571f2854bf4b16690398824c" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -5962,6 +6094,17 @@ dependencies = [ "futures-core", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "sysinfo" version = "0.32.0" @@ -6125,22 +6268,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d171f59dbaa811dbbb1aee1e73db92ec2b122911a48e1390dfe327a821ddede" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b08be0f17bd307950653ce45db00cd31200d82b624b36e181337d9c7d92765b5" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -6174,6 +6317,16 @@ dependencies = [ "log", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -6191,9 +6344,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.41.0" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", @@ -6216,7 +6369,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -6253,18 +6406,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "toml" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit 0.19.15", -] - [[package]] name = "toml" version = "0.8.19" @@ -6274,7 +6415,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.22", + "toml_edit", ] [[package]] @@ -6286,19 +6427,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.22.22" @@ -6309,7 +6437,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.20", + "winnow", ] [[package]] @@ -6338,7 +6466,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -6405,9 +6533,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "typescript_tsconfig_json" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1d5b1128c003f391971a6a78feac2b6dc4453054a228c3385ba4905e6c99947" +checksum = "9901b6b03c576f11b614000e04b5416649faf695a2ccb236ef3b76518533331f" dependencies = [ "clean-path", "indexmap", @@ -6481,12 +6609,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - [[package]] name = "unicode-id" version = "0.3.5" @@ -6505,15 +6627,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" -[[package]] -name = "unicode-normalization" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" -dependencies = [ - "tinyvec", -] - [[package]] name = "unicode-segmentation" version = "1.12.0" @@ -6563,9 +6676,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.2" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" dependencies = [ "form_urlencoded", "idna", @@ -6573,6 +6686,18 @@ dependencies = [ "serde", ] +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -6761,7 +6886,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", "wasm-bindgen-shared", ] @@ -6795,7 +6920,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6942,7 +7067,7 @@ dependencies = [ "serde", "serde_derive", "sha2", - "toml 0.8.19", + "toml", "windows-sys 0.52.0", "zstd", ] @@ -6956,7 +7081,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser", @@ -7086,7 +7211,7 @@ checksum = "a2bde986038b819bc43a21fef0610aeb47aabfe3ea09ca3533a7b81023b84ec6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -7220,7 +7345,7 @@ dependencies = [ "proc-macro2", "quote", "shellexpand", - "syn 2.0.86", + "syn 2.0.87", "witx", ] @@ -7232,7 +7357,7 @@ checksum = "f8f8feabe94ce6f07d62669d1acf469e0d3249f786562b4263dff3537a4e77ae" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", "wiggle-generate", ] @@ -7323,7 +7448,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -7334,7 +7459,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", ] [[package]] @@ -7524,15 +7649,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - [[package]] name = "winnow" version = "0.6.20" @@ -7582,6 +7698,18 @@ dependencies = [ "wast 35.0.2", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "xattr" version = "1.3.1" @@ -7618,6 +7746,30 @@ dependencies = [ "thiserror", ] +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -7636,7 +7788,28 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.86", + "syn 2.0.87", +] + +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", ] [[package]] @@ -7645,6 +7818,28 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "zip" version = "2.2.0" diff --git a/Cargo.toml b/Cargo.toml index 15e591b2e28..1245a698907 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,15 +19,15 @@ default-members = ["crates/cli"] [workspace.dependencies] async-recursion = "1.1.1" async-trait = "0.1.83" -cached = "0.53.1" +cached = "0.54.0" chrono = { version = "0.4.38", features = ["serde"] } cd_env = "0.2.0" ci_env = "0.3.0" -clap = { version = "4.5.20", default-features = false, features = [ +clap = { version = "4.5.21", default-features = false, features = [ "std", "error-context", ] } -clap_complete = "4.5.36" +clap_complete = "4.5.38" compact_str = { version = "0.8.0", default-features = false, features = [ "serde", ] } @@ -45,37 +45,37 @@ regex = { version = "1.11.0", default-features = false, features = [ "std", "perf", ] } -reqwest = { version = "0.12.8", default-features = false, features = [ +reqwest = { version = "0.12.9", default-features = false, features = [ "rustls-tls-native-roots", # We don't use openssl but its required for musl builds "native-tls-vendored", ] } rustc-hash = "2.0.0" scc = "2.2.4" -schematic = { version = "0.17.5", default-features = false, features = [ +schematic = { version = "0.17.6", default-features = false, features = [ "schema", ] } -serial_test = "3.1.1" +serial_test = "3.2.0" semver = "1.0.23" -serde = { version = "1.0.210", features = ["derive"] } +serde = { version = "1.0.215", features = ["derive"] } serde_json = "1.0.128" serde_yaml = "0.9.34" -starbase = { version = "0.8.4" } -starbase_archive = { version = "0.8.7", default-features = false, features = [ +starbase = { version = "0.9.4" } +starbase_archive = { version = "0.8.9", default-features = false, features = [ "miette", "tar-gz", ] } -starbase_events = "0.6.3" -starbase_sandbox = "0.7.4" -starbase_shell = "0.5.8" +starbase_events = "0.6.4" +starbase_sandbox = "0.7.6" +starbase_shell = "0.5.10" starbase_styles = { version = "0.4.4", features = ["relative-path"] } -starbase_utils = { version = "0.8.10", default-features = false, features = [ +starbase_utils = { version = "0.8.12", default-features = false, features = [ "editor-config", "miette", ] } tera = { version = "1.20.0", features = ["preserve_order"] } thiserror = "1.0.64" -tokio = { version = "1.41.0", default-features = false, features = [ +tokio = { version = "1.41.1", default-features = false, features = [ "macros", "process", "rt-multi-thread", @@ -86,12 +86,12 @@ tokio = { version = "1.41.0", default-features = false, features = [ ] } tokio-util = "0.7.12" tracing = "0.1.40" -uuid = { version = "1.10.0", features = ["v4"] } +uuid = { version = "1.11.0", features = ["v4"] } # proto/plugin related extism = "=1.8.0" extism-pdk = "1.3.0" -proto_core = "0.43.4" +proto_core = "0.43.5" proto_installer = "0.7.1" system_env = "0.6.1" version_spec = "0.7.0" diff --git a/crates/action-graph/src/action_graph_builder.rs b/crates/action-graph/src/action_graph_builder.rs index f5a95b51663..fc09ce3a008 100644 --- a/crates/action-graph/src/action_graph_builder.rs +++ b/crates/action-graph/src/action_graph_builder.rs @@ -268,7 +268,7 @@ impl<'app> ActionGraphBuilder<'app> { self.passthrough_targets.insert(task.target.clone()); debug!( - task = task.target.as_str(), + task_target = task.target.as_str(), "Not running task {} because {} is false", color::label(&task.target.id), color::property("runInCI"), @@ -279,7 +279,7 @@ impl<'app> ActionGraphBuilder<'app> { if reqs.dependents { if let Some(affected) = &mut self.affected { trace!( - task = task.target.as_str(), + task_target = task.target.as_str(), "But will run all dependent tasks if affected" ); @@ -297,7 +297,7 @@ impl<'app> ActionGraphBuilder<'app> { // These tasks shouldn't actually run, so filter them out if self.passthrough_targets.contains(&task.target) { trace!( - task = task.target.as_str(), + task_target = task.target.as_str(), "Not adding task {} to graph because it has been marked as passthrough", color::label(&task.target.id), ); @@ -366,8 +366,8 @@ impl<'app> ActionGraphBuilder<'app> { // And we also need to create edges for task dependencies if !task.deps.is_empty() { trace!( - task = task.target.as_str(), - deps = ?task.deps.iter().map(|d| d.target.as_str()).collect::>(), + task_target = task.target.as_str(), + dep_targets = ?task.deps.iter().map(|d| d.target.as_str()).collect::>(), "Linking dependencies for task", ); diff --git a/crates/affected/src/affected_tracker.rs b/crates/affected/src/affected_tracker.rs index 0c51cd043c3..b5d1ace41a8 100644 --- a/crates/affected/src/affected_tracker.rs +++ b/crates/affected/src/affected_tracker.rs @@ -270,7 +270,7 @@ impl<'app> AffectedTracker<'app> { pub fn track_tasks_by_target(&mut self, targets: &[Target]) -> miette::Result<()> { debug!( - targets = ?targets.iter().map(|target| target.as_str()).collect::>(), + task_targets = ?targets.iter().map(|target| target.as_str()).collect::>(), "Tracking tasks by target and marking any affected", ); @@ -322,7 +322,10 @@ impl<'app> AffectedTracker<'app> { return Ok(()); } - trace!(target = task.target.as_str(), "Marking task as affected"); + trace!( + task_target = task.target.as_str(), + "Marking task as affected" + ); self.tasks .entry(task.target.clone()) @@ -345,7 +348,7 @@ impl<'app> AffectedTracker<'app> { fn track_task_dependencies(&mut self, task: &Task, depth: u16) -> miette::Result<()> { if self.task_upstream == UpstreamScope::None { trace!( - target = task.target.as_str(), + task_target = task.target.as_str(), "Not tracking task dependencies as upstream scope is none" ); @@ -355,12 +358,12 @@ impl<'app> AffectedTracker<'app> { if depth == 0 { if self.task_upstream == UpstreamScope::Direct { trace!( - target = task.target.as_str(), + task_target = task.target.as_str(), "Tracking direct task dependencies" ); } else { trace!( - target = task.target.as_str(), + task_target = task.target.as_str(), "Tracking deep task dependencies" ); } @@ -387,7 +390,7 @@ impl<'app> AffectedTracker<'app> { fn track_task_dependents(&mut self, task: &Task, depth: u16) -> miette::Result<()> { if self.task_downstream == DownstreamScope::None { trace!( - target = task.target.as_str(), + task_target = task.target.as_str(), "Not tracking dependents as downstream scope is none" ); @@ -396,9 +399,15 @@ impl<'app> AffectedTracker<'app> { if depth == 0 { if self.task_downstream == DownstreamScope::Direct { - trace!(target = task.target.as_str(), "Tracking direct dependents"); + trace!( + task_target = task.target.as_str(), + "Tracking direct dependents" + ); } else { - trace!(target = task.target.as_str(), "Tracking deep dependents"); + trace!( + task_target = task.target.as_str(), + "Tracking deep dependents" + ); } } diff --git a/crates/app/Cargo.toml b/crates/app/Cargo.toml index 39428f9d7b4..30b70a2387c 100644 --- a/crates/app/Cargo.toml +++ b/crates/app/Cargo.toml @@ -35,7 +35,7 @@ moon_workspace = { path = "../workspace" } moon_workspace_graph = { path = "../workspace-graph" } async-recursion = { workspace = true } async-trait = { workspace = true } -bytes = "1.7.2" +bytes = "1.8.0" ci_env = { workspace = true } clap = { workspace = true, features = [ "color", @@ -47,7 +47,7 @@ clap = { workspace = true, features = [ "wrap_help", ] } clap_complete = { workspace = true } -clap_complete_nushell = "4.5.3" +clap_complete_nushell = "4.5.4" diff = "0.1.13" miette = { workspace = true } once_cell = { workspace = true } diff --git a/crates/app/src/app_error.rs b/crates/app/src/app_error.rs index ed3663e5e8b..a47265462b3 100644 --- a/crates/app/src/app_error.rs +++ b/crates/app/src/app_error.rs @@ -4,10 +4,6 @@ use miette::Diagnostic; use moon_common::{consts, Id, Style, Stylize}; use thiserror::Error; -#[derive(Debug, Diagnostic, Error)] -#[error("Exit with code")] -pub struct ExitCode(pub i32); - #[derive(Error, Debug, Diagnostic)] pub enum AppError { #[diagnostic(code(app::ci::no_shallow))] diff --git a/crates/app/src/commands/bin.rs b/crates/app/src/commands/bin.rs index 90983abb13b..9d49f356363 100644 --- a/crates/app/src/commands/bin.rs +++ b/crates/app/src/commands/bin.rs @@ -1,4 +1,3 @@ -use crate::app_error::ExitCode; use crate::session::CliSession; use clap::Args; use miette::IntoDiagnostic; @@ -32,8 +31,8 @@ pub async fn bin(session: CliSession, args: BinArgs) -> AppResult { .into_diagnostic()?; if !result.success() { - return Err(ExitCode(result.code().unwrap_or(1)).into()); + return Ok(Some(result.code().unwrap_or(1) as u8)); } - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/check.rs b/crates/app/src/commands/check.rs index e35275d343e..6a36ab8c6a9 100644 --- a/crates/app/src/commands/check.rs +++ b/crates/app/src/commands/check.rs @@ -79,7 +79,5 @@ pub async fn check(session: CliSession, args: CheckArgs) -> AppResult { }, &targets, ) - .await?; - - Ok(()) + .await } diff --git a/crates/app/src/commands/ci.rs b/crates/app/src/commands/ci.rs index 337d8fabffe..8a9ec4594c8 100644 --- a/crates/app/src/commands/ci.rs +++ b/crates/app/src/commands/ci.rs @@ -1,4 +1,4 @@ -use crate::app_error::{AppError, ExitCode}; +use crate::app_error::AppError; use crate::components::run_action_pipeline; use crate::queries::touched_files::{query_touched_files, QueryTouchedFilesOptions}; use crate::session::CliSession; @@ -88,7 +88,7 @@ async fn gather_touched_files( console: &mut CiConsole, session: &CliSession, args: &CiArgs, -) -> AppResult> { +) -> miette::Result> { console.print_header("Gathering touched files")?; let mut base = args.base.clone(); @@ -144,7 +144,7 @@ async fn gather_potential_targets( console: &mut CiConsole, workspace_graph: &WorkspaceGraph, args: &CiArgs, -) -> AppResult { +) -> miette::Result { console.print_header("Gathering potential targets")?; let mut targets = vec![]; @@ -171,7 +171,7 @@ fn distribute_targets_across_jobs( console: &mut CiConsole, args: &CiArgs, targets: TargetList, -) -> AppResult { +) -> miette::Result { if args.job.is_none() || args.job_total.is_none() { return Ok(targets); } @@ -209,7 +209,7 @@ async fn generate_action_graph( workspace_graph: &WorkspaceGraph, targets: &TargetList, touched_files: &FxHashSet, -) -> AppResult<(ActionGraph, ActionContext)> { +) -> miette::Result<(ActionGraph, ActionContext)> { console.print_header("Generating action graph")?; let mut action_graph_builder = session.build_action_graph(workspace_graph).await?; @@ -257,7 +257,7 @@ pub async fn ci(session: CliSession, args: CiArgs) -> AppResult { if targets.is_empty() { console.write_line(color::invalid("No tasks to run"))?; - return Ok(()); + return Ok(None); } let targets = distribute_targets_across_jobs(&mut console, &args, targets)?; @@ -273,7 +273,7 @@ pub async fn ci(session: CliSession, args: CiArgs) -> AppResult { if action_graph.is_empty() { console.write_line(color::invalid("No tasks affected based on touched files"))?; - return Ok(()); + return Ok(None); } // Process all tasks in the graph @@ -292,8 +292,8 @@ pub async fn ci(session: CliSession, args: CiArgs) -> AppResult { }); if failed { - return Err(ExitCode(1).into()); + return Ok(Some(1)); } - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/clean.rs b/crates/app/src/commands/clean.rs index 4f8a6a5e287..0c98793e428 100644 --- a/crates/app/src/commands/clean.rs +++ b/crates/app/src/commands/clean.rs @@ -23,5 +23,5 @@ pub async fn clean(session: CliSession, args: CleanArgs) -> AppResult { true, ); - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/completions.rs b/crates/app/src/commands/completions.rs index 5545dfb4863..f0aada8555c 100644 --- a/crates/app/src/commands/completions.rs +++ b/crates/app/src/commands/completions.rs @@ -6,7 +6,6 @@ use clap_complete_nushell::Nushell; use miette::IntoDiagnostic; use starbase::AppResult; use starbase_shell::ShellType; -use std::process; use tracing::instrument; #[derive(Args, Clone, Debug)] @@ -36,16 +35,16 @@ pub async fn completions(session: CliSession, args: CompletionsArgs) -> AppResul ShellType::Nu => { generate(Nushell, &mut app, "moon", &mut stdio); - return Ok(()); + return Ok(None); } unsupported => { eprintln!("{unsupported} does not currently support completions"); - process::exit(1); + return Ok(Some(1)); } }; generate(clap_shell, &mut app, "moon", &mut stdio); - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/docker/file.rs b/crates/app/src/commands/docker/file.rs index 478d9f85eb7..b3ec7fab9e0 100644 --- a/crates/app/src/commands/docker/file.rs +++ b/crates/app/src/commands/docker/file.rs @@ -172,7 +172,7 @@ pub async fn file(session: CliSession, args: DockerFileArgs) -> AppResult { color::rel_path(project.source.join(out)) ))?; - Ok(()) + Ok(None) } fn get_base_image_from_platform(platform: &PlatformType) -> &str { diff --git a/crates/app/src/commands/docker/prune.rs b/crates/app/src/commands/docker/prune.rs index ec6839e8e3c..4f540f4aff5 100644 --- a/crates/app/src/commands/docker/prune.rs +++ b/crates/app/src/commands/docker/prune.rs @@ -62,7 +62,7 @@ pub async fn prune_bun( .await?; } - Ok(()) + Ok(None) } #[instrument(skip_all)] @@ -76,7 +76,7 @@ pub async fn prune_deno( deno.install_focused_dependencies(&(), &[], true).await?; } - Ok(()) + Ok(None) } #[instrument(skip_all)] @@ -129,7 +129,7 @@ pub async fn prune_node( .await?; } - Ok(()) + Ok(None) } // This assumes that the project was built in --release mode. Is this correct? @@ -155,7 +155,7 @@ pub async fn prune_rust(_rust: &RustTool, session: &CliSession) -> AppResult { } } - Ok(()) + Ok(None) } #[instrument(skip_all)] @@ -240,5 +240,5 @@ pub async fn prune(session: CliSession) -> AppResult { } } - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/docker/scaffold.rs b/crates/app/src/commands/docker/scaffold.rs index e0e2a01557b..fd01d8ba29b 100644 --- a/crates/app/src/commands/docker/scaffold.rs +++ b/crates/app/src/commands/docker/scaffold.rs @@ -49,7 +49,7 @@ fn copy_files>(list: &[T], source: &Path, dest: &Path) -> AppResul } } - Ok(()) + Ok(None) } fn create_files>(list: &[T], dest: &Path) -> AppResult { @@ -70,7 +70,7 @@ fn create_files>(list: &[T], dest: &Path) -> AppResult { fs::write_file(dest.join(file), data.as_bytes())?; } - Ok(()) + Ok(None) } #[instrument(skip(session, project_graph))] @@ -166,7 +166,7 @@ async fn scaffold_workspace( copy_files(&files_to_copy, source, dest)?; create_files(&files_to_create, dest)?; - Ok(()) + Ok(None) }; // Copy each project and mimic the folder structure @@ -268,7 +268,7 @@ async fn scaffold_workspace( )?; } - Ok(()) + Ok(None) } #[instrument(skip(session, project_graph, manifest))] @@ -334,7 +334,7 @@ async fn scaffold_sources_project( } } - Ok(()) + Ok(None) } #[instrument(skip(session, project_graph))] @@ -405,7 +405,7 @@ async fn scaffold_sources( true, )?; - Ok(()) + Ok(None) } pub fn check_docker_ignore(workspace_root: &Path) -> miette::Result<()> { @@ -481,5 +481,5 @@ pub async fn scaffold(session: CliSession, args: DockerScaffoldArgs) -> AppResul ) .await?; - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/docker/setup.rs b/crates/app/src/commands/docker/setup.rs index 3a55f8291a9..bcdbabf7b0a 100644 --- a/crates/app/src/commands/docker/setup.rs +++ b/crates/app/src/commands/docker/setup.rs @@ -35,5 +35,5 @@ pub async fn setup(session: CliSession) -> AppResult { ) .await?; - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/ext.rs b/crates/app/src/commands/ext.rs index b0b038848fb..82c9e93b19b 100644 --- a/crates/app/src/commands/ext.rs +++ b/crates/app/src/commands/ext.rs @@ -33,5 +33,5 @@ pub async fn ext(session: CliSession, args: ExtArgs) -> AppResult { .execute(args.passthrough, extensions.create_context()) .await?; - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/generate.rs b/crates/app/src/commands/generate.rs index 0a5c4129adc..591ac184483 100644 --- a/crates/app/src/commands/generate.rs +++ b/crates/app/src/commands/generate.rs @@ -31,7 +31,7 @@ pub async fn generate(session: CliSession, args: GenerateArgs) -> AppResult { color::path(template.root) ))?; - return Ok(()); + return Ok(None); } if args.dry_run { @@ -184,5 +184,5 @@ pub async fn generate(session: CliSession, args: GenerateArgs) -> AppResult { console.write_newline()?; console.flush()?; - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/graph/action.rs b/crates/app/src/commands/graph/action.rs index cb605bbed85..93f10fe3bc7 100644 --- a/crates/app/src/commands/graph/action.rs +++ b/crates/app/src/commands/graph/action.rs @@ -53,7 +53,7 @@ pub async fn action_graph(session: CliSession, args: ActionGraphArgs) -> AppResu if args.dot { println!("{}", action_graph.to_dot()); - return Ok(()); + return Ok(None); } let graph_info = action_graph_repr(&action_graph).await; @@ -61,7 +61,7 @@ pub async fn action_graph(session: CliSession, args: ActionGraphArgs) -> AppResu if args.json { println!("{}", json::format(&graph_info, false)?); - return Ok(()); + return Ok(None); } let (server, mut tera) = setup_server().await?; @@ -74,5 +74,5 @@ pub async fn action_graph(session: CliSession, args: ActionGraphArgs) -> AppResu respond_to_request(req, &mut tera, &graph_info, "Action graph".to_owned())?; } - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/graph/project.rs b/crates/app/src/commands/graph/project.rs index baa1b01b6d0..4a28dc8cba4 100644 --- a/crates/app/src/commands/graph/project.rs +++ b/crates/app/src/commands/graph/project.rs @@ -37,13 +37,13 @@ pub async fn project_graph(session: CliSession, args: ProjectGraphArgs) -> AppRe if args.dot { println!("{}", project_graph.to_dot()); - return Ok(()); + return Ok(None); } if args.json { println!("{}", project_graph.to_json()?); - return Ok(()); + return Ok(None); } let graph_info = project_graph_repr(&project_graph).await; @@ -57,5 +57,5 @@ pub async fn project_graph(session: CliSession, args: ProjectGraphArgs) -> AppRe respond_to_request(req, &mut tera, &graph_info, "Project graph".to_owned())?; } - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/graph/task.rs b/crates/app/src/commands/graph/task.rs index f91f99ad6b5..c25420ab5f8 100644 --- a/crates/app/src/commands/graph/task.rs +++ b/crates/app/src/commands/graph/task.rs @@ -37,13 +37,13 @@ pub async fn task_graph(session: CliSession, args: TaskGraphArgs) -> AppResult { if args.dot { println!("{}", task_graph.to_dot()); - return Ok(()); + return Ok(None); } if args.json { println!("{}", task_graph.to_json()?); - return Ok(()); + return Ok(None); } let graph_info = task_graph_repr(&task_graph).await; @@ -57,5 +57,5 @@ pub async fn task_graph(session: CliSession, args: TaskGraphArgs) -> AppResult { respond_to_request(req, &mut tera, &graph_info, "Task graph".to_owned())?; } - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/graph/utils.rs b/crates/app/src/commands/graph/utils.rs index 13cbc73bc33..2bb32a1666c 100644 --- a/crates/app/src/commands/graph/utils.rs +++ b/crates/app/src/commands/graph/utils.rs @@ -22,7 +22,7 @@ pub struct RenderContext { pub js_url: String, } -pub async fn setup_server() -> AppResult<(Server, Tera)> { +pub async fn setup_server() -> miette::Result<(Server, Tera)> { let port = match env::var("MOON_PORT") { Ok(p) => p.parse::().unwrap(), Err(..) => 8000, @@ -132,7 +132,7 @@ pub fn respond_to_request( req.respond(response).unwrap_or_default(); - Ok(()) + Ok(None) } // Use the local version of the JS file when in development mode otherwise the CDN URL. diff --git a/crates/app/src/commands/init/bun.rs b/crates/app/src/commands/init/bun.rs index ea9e0e5ce6b..8236b600ac1 100644 --- a/crates/app/src/commands/init/bun.rs +++ b/crates/app/src/commands/init/bun.rs @@ -5,13 +5,12 @@ use dialoguer::Confirm; use miette::IntoDiagnostic; use moon_config::load_toolchain_bun_config_template; use moon_console::Console; -use starbase::AppResult; use starbase_styles::color; use std::path::Path; use tera::{Context, Tera}; use tracing::instrument; -pub fn render_template(context: Context) -> AppResult { +pub fn render_template(context: Context) -> miette::Result { Tera::one_off(load_toolchain_bun_config_template(), &context, false).into_diagnostic() } @@ -21,7 +20,7 @@ pub async fn init_bun( options: &InitOptions, theme: &ColorfulTheme, console: &Console, -) -> AppResult { +) -> miette::Result { if !options.yes { console.out.print_header("Bun")?; diff --git a/crates/app/src/commands/init/mod.rs b/crates/app/src/commands/init/mod.rs index ab6fbe45c10..1d107366c61 100644 --- a/crates/app/src/commands/init/mod.rs +++ b/crates/app/src/commands/init/mod.rs @@ -4,7 +4,6 @@ mod prompts; mod rust; mod typescript; -use crate::app_error::ExitCode; use crate::helpers::create_theme; use crate::session::CliSession; use bun::init_bun; @@ -58,11 +57,11 @@ pub struct InitArgs { yes: bool, } -fn render_toolchain_template(context: &Context) -> AppResult { +fn render_toolchain_template(context: &Context) -> miette::Result { Tera::one_off(load_toolchain_config_template(), context, false).into_diagnostic() } -fn render_workspace_template(context: &Context) -> AppResult { +fn render_workspace_template(context: &Context) -> miette::Result { Tera::one_off(load_workspace_config_template(), context, false).into_diagnostic() } @@ -98,7 +97,7 @@ fn verify_dest_dir( dest_dir: &Path, options: &InitOptions, theme: &ColorfulTheme, -) -> AppResult> { +) -> miette::Result> { if options.yes || Confirm::with_theme(theme) .with_prompt(format!("Initialize moon into {}?", color::path(dest_dir))) @@ -140,7 +139,7 @@ pub async fn init_tool( color::shell("moon init") ))?; - return Err(ExitCode(1).into()); + return Ok(Some(1)); } let tool_config = match tool { @@ -167,7 +166,7 @@ pub async fn init_tool( .out .write_line("Toolchain config has successfully been updated")?; - Ok(()) + Ok(None) } #[instrument(skip_all)] @@ -192,12 +191,12 @@ pub async fn init(session: CliSession, args: InitArgs) -> AppResult { if let Some(tool) = &args.tool { init_tool(&dest_dir, tool, &options, &theme, &session).await?; - return Ok(()); + return Ok(None); } // Extract template variables if verify_dest_dir(&dest_dir, &options, &theme)?.is_none() { - return Ok(()); + return Ok(None); } let git = Git::load(&dest_dir, "master", &[])?; @@ -259,7 +258,7 @@ pub async fn init(session: CliSession, args: InitArgs) -> AppResult { stdout.write_newline()?; - Ok(()) + Ok(None) } #[cfg(test)] diff --git a/crates/app/src/commands/init/node.rs b/crates/app/src/commands/init/node.rs index 12caf2254ab..d7d18396c3f 100644 --- a/crates/app/src/commands/init/node.rs +++ b/crates/app/src/commands/init/node.rs @@ -7,20 +7,19 @@ use moon_config::load_toolchain_node_config_template; use moon_console::Console; use moon_lang::{is_using_dependency_manager, is_using_version_manager}; use moon_node_lang::PackageJsonCache; -use starbase::AppResult; use starbase_styles::color; use starbase_utils::fs; use std::path::Path; use tera::{Context, Tera}; use tracing::instrument; -pub fn render_template(context: Context) -> AppResult { +pub fn render_template(context: Context) -> miette::Result { Tera::one_off(load_toolchain_node_config_template(), &context, false).into_diagnostic() } /// Detect the Node.js version from local configuration files, /// otherwise fallback to the configuration default. -fn detect_node_version(dest_dir: &Path) -> AppResult { +fn detect_node_version(dest_dir: &Path) -> miette::Result { Ok(if is_using_version_manager(dest_dir, ".nvmrc") { fully_qualify_version(fs::read_file(dest_dir.join(".nvmrc"))?.trim()) } else if is_using_version_manager(dest_dir, ".node-version") { @@ -30,7 +29,7 @@ fn detect_node_version(dest_dir: &Path) -> AppResult { }) } -fn detect_node_version_manager(dest_dir: &Path) -> AppResult { +fn detect_node_version_manager(dest_dir: &Path) -> miette::Result { Ok(if is_using_version_manager(dest_dir, ".nvmrc") { "nvm".to_owned() } else if is_using_version_manager(dest_dir, ".node-version") { @@ -46,7 +45,7 @@ fn detect_package_manager( dest_dir: &Path, options: &InitOptions, theme: &ColorfulTheme, -) -> AppResult<(String, String)> { +) -> miette::Result<(String, String)> { let mut pm_type = String::new(); let mut pm_version = String::new(); @@ -113,7 +112,7 @@ pub async fn init_node( options: &InitOptions, theme: &ColorfulTheme, console: &Console, -) -> AppResult { +) -> miette::Result { if !options.yes { console.out.print_header("Node")?; diff --git a/crates/app/src/commands/init/rust.rs b/crates/app/src/commands/init/rust.rs index 7c37fde3ae3..2cc71be66cb 100644 --- a/crates/app/src/commands/init/rust.rs +++ b/crates/app/src/commands/init/rust.rs @@ -5,17 +5,16 @@ use miette::IntoDiagnostic; use moon_config::load_toolchain_rust_config_template; use moon_console::Console; use moon_rust_lang::toolchain_toml::ToolchainTomlCache; -use starbase::AppResult; use starbase_styles::color; use std::path::Path; use tera::{Context, Tera}; use tracing::instrument; -fn render_template(context: Context) -> AppResult { +fn render_template(context: Context) -> miette::Result { Tera::one_off(load_toolchain_rust_config_template(), &context, false).into_diagnostic() } -fn detect_rust_version(dest_dir: &Path) -> AppResult { +fn detect_rust_version(dest_dir: &Path) -> miette::Result { if let Some(toolchain_toml) = ToolchainTomlCache::read(dest_dir)? { if let Some(version) = toolchain_toml.toolchain.channel { let rust_version = if version == "stable" @@ -41,7 +40,7 @@ pub async fn init_rust( options: &InitOptions, theme: &ColorfulTheme, console: &Console, -) -> AppResult { +) -> miette::Result { if !options.yes { console.out.print_header("Rust")?; diff --git a/crates/app/src/commands/init/typescript.rs b/crates/app/src/commands/init/typescript.rs index b9e7c1096be..0907d2552d7 100644 --- a/crates/app/src/commands/init/typescript.rs +++ b/crates/app/src/commands/init/typescript.rs @@ -5,13 +5,12 @@ use miette::IntoDiagnostic; use moon_config::load_toolchain_typescript_config_template; use moon_console::Console; use moon_typescript_lang::TsConfigJsonCache; -use starbase::AppResult; use starbase_styles::color; use std::path::Path; use tera::{Context, Tera}; use tracing::instrument; -pub fn render_template(context: Context) -> AppResult { +pub fn render_template(context: Context) -> miette::Result { Tera::one_off(load_toolchain_typescript_config_template(), &context, false).into_diagnostic() } @@ -21,7 +20,7 @@ pub async fn init_typescript( options: &InitOptions, theme: &ColorfulTheme, console: &Console, -) -> AppResult { +) -> miette::Result { if !options.yes { console.out.print_header("TypeScript")?; diff --git a/crates/app/src/commands/migrate/from_package_json.rs b/crates/app/src/commands/migrate/from_package_json.rs index a5a0305712c..9e5f0dce2ed 100644 --- a/crates/app/src/commands/migrate/from_package_json.rs +++ b/crates/app/src/commands/migrate/from_package_json.rs @@ -109,5 +109,5 @@ pub async fn from_package_json(session: CliSession, args: FromPackageJsonArgs) - yaml::write_file_with_config(project.root.join(&config_names[0]), &partial_config)?; - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/migrate/from_turborepo.rs b/crates/app/src/commands/migrate/from_turborepo.rs index 8208477f642..9d9aeba3c71 100644 --- a/crates/app/src/commands/migrate/from_turborepo.rs +++ b/crates/app/src/commands/migrate/from_turborepo.rs @@ -8,5 +8,5 @@ pub async fn from_turborepo() -> AppResult { color::shell("moon ext migrate-turborepo") ); - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/migrate/mod.rs b/crates/app/src/commands/migrate/mod.rs index 05199de524f..e299db2943d 100644 --- a/crates/app/src/commands/migrate/mod.rs +++ b/crates/app/src/commands/migrate/mod.rs @@ -40,5 +40,5 @@ pub async fn check_dirty_repo(session: &CliSession) -> AppResult { )); } - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/node/run_script.rs b/crates/app/src/commands/node/run_script.rs index 191c994cd0f..8bc9abbcae8 100644 --- a/crates/app/src/commands/node/run_script.rs +++ b/crates/app/src/commands/node/run_script.rs @@ -58,5 +58,5 @@ pub async fn run_script(session: CliSession, args: RunScriptArgs) -> AppResult { command.create_async().exec_stream_output().await?; - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/project.rs b/crates/app/src/commands/project.rs index 3b216148b67..5a3a4ff020d 100644 --- a/crates/app/src/commands/project.rs +++ b/crates/app/src/commands/project.rs @@ -26,7 +26,7 @@ pub async fn project(session: CliSession, args: ProjectArgs) -> AppResult { if args.json { console.write_line(json::format(&project, true)?)?; - return Ok(()); + return Ok(None); } console.print_header(&project.id)?; @@ -165,5 +165,5 @@ pub async fn project(session: CliSession, args: ProjectArgs) -> AppResult { console.write_newline()?; console.flush()?; - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/query.rs b/crates/app/src/commands/query.rs index 997c7c3b793..f4806c1856b 100644 --- a/crates/app/src/commands/query.rs +++ b/crates/app/src/commands/query.rs @@ -76,7 +76,7 @@ pub async fn hash(session: CliSession, args: QueryHashArgs) -> AppResult { console.out.write_line(result.1)?; - Ok(()) + Ok(None) } #[derive(Args, Clone, Debug)] @@ -145,7 +145,7 @@ pub async fn hash_diff(session: CliSession, args: QueryHashDiffArgs) -> AppResul } } - Ok(()) + Ok(None) } #[derive(Args, Clone, Debug)] @@ -291,7 +291,7 @@ pub async fn projects(session: CliSession, args: QueryProjectsArgs) -> AppResult )?; } - Ok(()) + Ok(None) } #[derive(Args, Clone, Debug)] @@ -425,7 +425,7 @@ pub async fn tasks(session: CliSession, args: QueryTasksArgs) -> AppResult { } } - Ok(()) + Ok(None) } #[derive(Args, Clone, Debug)] @@ -482,5 +482,5 @@ pub async fn touched_files(session: CliSession, args: QueryTouchedFilesArgs) -> console.out.write_line(files.join("\n"))?; } - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/run.rs b/crates/app/src/commands/run.rs index 5444665164e..9c293864c61 100644 --- a/crates/app/src/commands/run.rs +++ b/crates/app/src/commands/run.rs @@ -204,7 +204,7 @@ pub async fn run_target( .write_line(format!("Using query {}", color::shell(query_input)))?; } - return Ok(()); + return Ok(None); } // Process all tasks in the graph @@ -219,12 +219,12 @@ pub async fn run_target( ) .await?; - Ok(()) + Ok(None) } #[instrument(skip_all)] pub async fn run(session: CliSession, args: RunArgs) -> AppResult { run_target(&session, &args, &args.targets).await?; - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/setup.rs b/crates/app/src/commands/setup.rs index 7844f5cbb53..c3730346777 100644 --- a/crates/app/src/commands/setup.rs +++ b/crates/app/src/commands/setup.rs @@ -12,5 +12,5 @@ pub async fn setup(session: CliSession) -> AppResult { done("Setup complete", true); - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/syncs/codeowners.rs b/crates/app/src/commands/syncs/codeowners.rs index 0963006b475..046d95f5762 100644 --- a/crates/app/src/commands/syncs/codeowners.rs +++ b/crates/app/src/commands/syncs/codeowners.rs @@ -51,5 +51,5 @@ pub async fn sync(session: CliSession, args: SyncCodeownersArgs) -> AppResult { ); } - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/syncs/config_schemas.rs b/crates/app/src/commands/syncs/config_schemas.rs index 41a0536571c..2b5afed4532 100644 --- a/crates/app/src/commands/syncs/config_schemas.rs +++ b/crates/app/src/commands/syncs/config_schemas.rs @@ -21,5 +21,5 @@ pub async fn sync(session: CliSession, args: SyncConfigSchemasArgs) -> AppResult done("Successfully generated schemas", true); - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/syncs/hooks.rs b/crates/app/src/commands/syncs/hooks.rs index f7f786f05e0..b32036ca04c 100644 --- a/crates/app/src/commands/syncs/hooks.rs +++ b/crates/app/src/commands/syncs/hooks.rs @@ -27,7 +27,7 @@ pub async fn sync(session: CliSession, args: SyncHooksArgs) -> AppResult { color::url("https://moonrepo.dev/docs/guides/vcs-hooks") ); - return Ok(()); + return Ok(None); } let done = create_progress_bar(format!( @@ -54,5 +54,5 @@ pub async fn sync(session: CliSession, args: SyncHooksArgs) -> AppResult { done("Did not sync hooks".into(), true); } - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/syncs/projects.rs b/crates/app/src/commands/syncs/projects.rs index ca3ea9ee6ee..fab0e53fb67 100644 --- a/crates/app/src/commands/syncs/projects.rs +++ b/crates/app/src/commands/syncs/projects.rs @@ -29,5 +29,5 @@ pub async fn sync(session: CliSession) -> AppResult { true, ); - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/task.rs b/crates/app/src/commands/task.rs index 08b9bf8d13e..908389c709b 100644 --- a/crates/app/src/commands/task.rs +++ b/crates/app/src/commands/task.rs @@ -31,7 +31,7 @@ pub async fn task(session: CliSession, args: TaskArgs) -> AppResult { if args.json { console.write_line(json::format(&task, true)?)?; - return Ok(()); + return Ok(None); } console.print_header(&args.target.id)?; @@ -170,5 +170,5 @@ pub async fn task(session: CliSession, args: TaskArgs) -> AppResult { console.write_newline()?; console.flush()?; - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/teardown.rs b/crates/app/src/commands/teardown.rs index f9a25321568..4804c61c511 100644 --- a/crates/app/src/commands/teardown.rs +++ b/crates/app/src/commands/teardown.rs @@ -13,5 +13,5 @@ pub async fn teardown() -> AppResult { done("Teardown complete", true); - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/templates.rs b/crates/app/src/commands/templates.rs index c35bb97869c..fe13044ac14 100644 --- a/crates/app/src/commands/templates.rs +++ b/crates/app/src/commands/templates.rs @@ -14,5 +14,5 @@ pub async fn templates(session: CliSession) -> AppResult { templates_command(generator, &session.console).await?; - Ok(()) + Ok(None) } diff --git a/crates/app/src/commands/upgrade.rs b/crates/app/src/commands/upgrade.rs index 37cc26155d6..e34e4a37abe 100644 --- a/crates/app/src/commands/upgrade.rs +++ b/crates/app/src/commands/upgrade.rs @@ -38,7 +38,7 @@ pub async fn upgrade(session: CliSession) -> AppResult { Ok(Some(result)) if result.update_available => result.remote_version, Ok(_) => { println!("You're already on the latest version of moon!"); - return Ok(()); + return Ok(None); } Err(err) => { error!("Failed to get current version of moon from remote: {err}"); @@ -126,5 +126,5 @@ pub async fn upgrade(session: CliSession) -> AppResult { true, ); - Ok(()) + Ok(None) } diff --git a/crates/app/src/queries/hash.rs b/crates/app/src/queries/hash.rs index d8135b786ac..bc245b0f97f 100644 --- a/crates/app/src/queries/hash.rs +++ b/crates/app/src/queries/hash.rs @@ -1,11 +1,13 @@ use crate::app_error::AppError; use moon_cache::CacheEngine; -use starbase::AppResult; use starbase_styles::color; use starbase_utils::{fs, json}; use tracing::debug; -pub async fn query_hash(cache_engine: &CacheEngine, hash: &str) -> AppResult<(String, String)> { +pub async fn query_hash( + cache_engine: &CacheEngine, + hash: &str, +) -> miette::Result<(String, String)> { debug!("Querying for hash manifest with {}", color::hash(hash)); for file in fs::read_dir(&cache_engine.hash.hashes_dir)? { diff --git a/crates/app/src/queries/hash_diff.rs b/crates/app/src/queries/hash_diff.rs index f77295a8709..c3c77064415 100644 --- a/crates/app/src/queries/hash_diff.rs +++ b/crates/app/src/queries/hash_diff.rs @@ -1,7 +1,6 @@ use super::hash::query_hash; use moon_cache::CacheEngine; use serde::{Deserialize, Serialize}; -use starbase::AppResult; use tracing::debug; #[derive(Clone, Default, Deserialize, Serialize)] @@ -18,7 +17,7 @@ pub async fn query_hash_diff( cache_engine: &CacheEngine, base_left: &str, base_right: &str, -) -> AppResult { +) -> miette::Result { debug!("Diffing hashes"); let (left_hash, left) = query_hash(cache_engine, base_left).await?; diff --git a/crates/app/src/queries/projects.rs b/crates/app/src/queries/projects.rs index b4429317bc7..858e369b652 100644 --- a/crates/app/src/queries/projects.rs +++ b/crates/app/src/queries/projects.rs @@ -3,7 +3,6 @@ use moon_affected::Affected; use moon_project::Project; use moon_workspace_graph::WorkspaceGraph; use serde::{Deserialize, Serialize}; -use starbase::AppResult; use std::sync::Arc; use tracing::debug; @@ -119,7 +118,7 @@ fn load_with_regex( pub async fn query_projects( workspace_graph: &WorkspaceGraph, options: &QueryProjectsOptions, -) -> AppResult>> { +) -> miette::Result>> { debug!("Querying for projects"); let mut projects = if let Some(query) = &options.query { diff --git a/crates/app/src/queries/tasks.rs b/crates/app/src/queries/tasks.rs index 17aa420b282..7a2fb6faf6e 100644 --- a/crates/app/src/queries/tasks.rs +++ b/crates/app/src/queries/tasks.rs @@ -4,7 +4,6 @@ use moon_common::Id; use moon_task::Task; use moon_workspace_graph::WorkspaceGraph; use serde::{Deserialize, Serialize}; -use starbase::AppResult; use std::{collections::BTreeMap, sync::Arc}; use tracing::debug; @@ -95,7 +94,7 @@ fn load_with_regex( pub async fn query_tasks( workspace_graph: &WorkspaceGraph, options: &QueryTasksOptions, -) -> AppResult>> { +) -> miette::Result>> { debug!("Querying for tasks"); let mut tasks = if let Some(query) = &options.query { diff --git a/crates/app/src/queries/touched_files.rs b/crates/app/src/queries/touched_files.rs index e546b6fa5ab..912f4852eba 100644 --- a/crates/app/src/queries/touched_files.rs +++ b/crates/app/src/queries/touched_files.rs @@ -4,7 +4,6 @@ use moon_common::path::{standardize_separators, WorkspaceRelativePathBuf}; use moon_vcs::{BoxedVcs, TouchedStatus}; use rustc_hash::FxHashSet; use serde::{Deserialize, Serialize}; -use starbase::AppResult; use starbase_styles::color; use starbase_utils::json; use std::env; @@ -53,7 +52,7 @@ macro_rules! check_shallow { pub async fn query_touched_files( vcs: &BoxedVcs, options: &QueryTouchedFilesOptions, -) -> AppResult { +) -> miette::Result { debug!("Querying for touched files"); let default_branch = vcs.get_default_branch().await?; @@ -154,7 +153,9 @@ pub async fn query_touched_files( }) } -pub async fn load_touched_files(vcs: &BoxedVcs) -> AppResult> { +pub async fn load_touched_files( + vcs: &BoxedVcs, +) -> miette::Result> { let mut buffer = String::new(); // Only read piped data when stdin is not a TTY, diff --git a/crates/app/src/session.rs b/crates/app/src/session.rs index 44df7a8ddf9..7c03b4c5ee1 100644 --- a/crates/app/src/session.rs +++ b/crates/app/src/session.rs @@ -90,11 +90,11 @@ impl CliSession { pub async fn build_action_graph<'graph>( &self, workspace_graph: &'graph WorkspaceGraph, - ) -> AppResult> { + ) -> miette::Result> { ActionGraphBuilder::new(workspace_graph) } - pub fn get_app_context(&self) -> AppResult> { + pub fn get_app_context(&self) -> miette::Result> { Ok(Arc::new(AppContext { cli_version: self.cli_version.clone(), cache_engine: self.get_cache_engine()?, @@ -107,7 +107,7 @@ impl CliSession { })) } - pub fn get_cache_engine(&self) -> AppResult> { + pub fn get_cache_engine(&self) -> miette::Result> { let item = self .cache_engine .get_or_try_init(|| CacheEngine::new(&self.workspace_root).map(Arc::new))?; @@ -115,11 +115,11 @@ impl CliSession { Ok(Arc::clone(item)) } - pub fn get_console(&self) -> AppResult> { + pub fn get_console(&self) -> miette::Result> { Ok(Arc::new(self.console.clone())) } - pub async fn get_extension_registry(&self) -> AppResult> { + pub async fn get_extension_registry(&self) -> miette::Result> { let workspace_graph = self.get_workspace_graph().await?; let item = self.extension_registry.get_or_init(|| { @@ -140,7 +140,7 @@ impl CliSession { Ok(Arc::clone(item)) } - pub async fn get_project_graph(&self) -> AppResult> { + pub async fn get_project_graph(&self) -> miette::Result> { if self.project_graph.get().is_none() { self.load_workspace_graph().await?; } @@ -148,7 +148,7 @@ impl CliSession { Ok(self.project_graph.get().map(Arc::clone).unwrap()) } - pub async fn get_task_graph(&self) -> AppResult> { + pub async fn get_task_graph(&self) -> miette::Result> { if self.task_graph.get().is_none() { self.load_workspace_graph().await?; } @@ -156,7 +156,7 @@ impl CliSession { Ok(self.task_graph.get().map(Arc::clone).unwrap()) } - pub async fn get_toolchain_registry(&self) -> AppResult> { + pub async fn get_toolchain_registry(&self) -> miette::Result> { let workspace_graph = self.get_workspace_graph().await?; let item = self.toolchain_registry.get_or_init(|| { @@ -177,7 +177,7 @@ impl CliSession { Ok(Arc::clone(item)) } - pub fn get_vcs_adapter(&self) -> AppResult> { + pub fn get_vcs_adapter(&self) -> miette::Result> { let item = self.vcs_adapter.get_or_try_init(|| { let config = &self.workspace_config.vcs; let git = Git::load( @@ -192,7 +192,7 @@ impl CliSession { Ok(Arc::clone(item)) } - pub async fn get_workspace_graph(&self) -> AppResult { + pub async fn get_workspace_graph(&self) -> miette::Result { let projects = self.get_project_graph().await?; let tasks = self.get_task_graph().await?; @@ -217,7 +217,7 @@ impl CliSession { ) } - async fn load_workspace_graph(&self) -> AppResult<()> { + async fn load_workspace_graph(&self) -> miette::Result<()> { let cache_engine = self.get_cache_engine()?; let context = create_workspace_graph_context(self).await?; let builder = WorkspaceBuilder::new_with_cache(context, &cache_engine).await?; @@ -280,7 +280,7 @@ impl AppSession for CliSession { self.moonbase = startup::signin_to_moonbase(&vcs).await?; } - Ok(()) + Ok(None) } /// Analyze the current state and install/registery necessary functionality. @@ -309,7 +309,7 @@ impl AppSession for CliSession { } } - Ok(()) + Ok(None) } async fn execute(&mut self) -> AppResult { @@ -330,13 +330,13 @@ impl AppSession for CliSession { .await?; } - Ok(()) + Ok(None) } async fn shutdown(&mut self) -> AppResult { self.console.close()?; - Ok(()) + Ok(None) } } diff --git a/crates/app/src/systems/analyze.rs b/crates/app/src/systems/analyze.rs index 391105d4faa..a8d331231e6 100644 --- a/crates/app/src/systems/analyze.rs +++ b/crates/app/src/systems/analyze.rs @@ -30,7 +30,7 @@ pub fn validate_version_constraint(constraint: &VersionReq, version: &Version) - .into()); } - Ok(()) + Ok(None) } #[instrument] @@ -39,7 +39,7 @@ pub fn check_pkl_install() -> AppResult { return Err(AppError::PklRequired.into()); } - Ok(()) + Ok(None) } #[instrument(skip_all)] @@ -66,7 +66,7 @@ pub async fn install_proto( // This causes a ton of issues when running the test suite, // so just avoid it and assume proto exists! if install_dir.exists() || is_test_env() || !toolchain_config.should_install_proto() { - return Ok(()); + return Ok(None); } debug!("Installing proto"); @@ -88,7 +88,7 @@ pub async fn install_proto( bin_name ); - return Ok(()); + return Ok(None); } else { return Err(ProtoError::InternetConnectionRequired.into()); } @@ -112,7 +112,7 @@ pub async fn install_proto( debug!("Successfully installed proto!"); - Ok(()) + Ok(None) } #[instrument(skip_all)] @@ -194,14 +194,14 @@ pub async fn register_platforms( )), ); - Ok(()) + Ok(None) } #[instrument(skip(registry))] pub async fn load_toolchain(registry: Arc) -> AppResult { // This isn't an action but we should also support skipping here! if should_skip_action("MOON_SKIP_SETUP_TOOLCHAIN").is_some() { - return Ok(()); + return Ok(None); } registry.load_all().await?; @@ -210,5 +210,5 @@ pub async fn load_toolchain(registry: Arc) -> AppResult { platform.setup_toolchain().await?; } - Ok(()) + Ok(None) } diff --git a/crates/app/src/systems/execute.rs b/crates/app/src/systems/execute.rs index a2965884b57..d21bd92f047 100644 --- a/crates/app/src/systems/execute.rs +++ b/crates/app/src/systems/execute.rs @@ -14,13 +14,13 @@ pub async fn check_for_new_version( manifest_url: &str, ) -> AppResult { if is_test_env() || is_formatted_output() { - return Ok(()); + return Ok(None); } match Launchpad::check_version(cache_engine, moon_env, false, manifest_url).await { Ok(Some(result)) => { if !result.update_available { - return Ok(()); + return Ok(None); } console.out.print_checkpoint( @@ -53,5 +53,5 @@ pub async fn check_for_new_version( _ => {} }; - Ok(()) + Ok(None) } diff --git a/crates/app/src/systems/startup.rs b/crates/app/src/systems/startup.rs index 9923eefcbcc..5cb5152c1df 100644 --- a/crates/app/src/systems/startup.rs +++ b/crates/app/src/systems/startup.rs @@ -6,7 +6,6 @@ use moon_config::{ConfigLoader, InheritedTasksManager, ToolchainConfig, Workspac use moon_env::MoonEnvironment; use moon_vcs::BoxedVcs; use proto_core::ProtoEnvironment; -use starbase::AppResult; use starbase_styles::color; use starbase_utils::{dirs, fs}; use std::env; @@ -30,7 +29,7 @@ where /// Recursively attempt to find the workspace root by locating the ".moon" /// configuration folder, starting from the current working directory. #[instrument] -pub fn find_workspace_root(working_dir: &Path) -> AppResult { +pub fn find_workspace_root(working_dir: &Path) -> miette::Result { debug!( working_dir = ?working_dir, "Attempting to find workspace root from current working directory", @@ -77,7 +76,7 @@ pub fn find_workspace_root(working_dir: &Path) -> AppResult { pub fn detect_moon_environment( working_dir: &Path, workspace_root: &Path, -) -> AppResult> { +) -> miette::Result> { let mut env = MoonEnvironment::new()?; env.working_dir = working_dir.to_path_buf(); env.workspace_root = workspace_root.to_path_buf(); @@ -90,7 +89,7 @@ pub fn detect_moon_environment( pub fn detect_proto_environment( working_dir: &Path, _workspace_root: &Path, -) -> AppResult> { +) -> miette::Result> { let mut env = ProtoEnvironment::new()?; env.cwd = working_dir.to_path_buf(); @@ -103,7 +102,7 @@ pub fn detect_proto_environment( pub async fn load_workspace_config( config_loader: ConfigLoader, workspace_root: &Path, -) -> AppResult> { +) -> miette::Result> { let config_name = config_loader.get_debug_label("workspace", true); debug!("Loading {} (required)", color::file(&config_name)); @@ -129,7 +128,7 @@ pub async fn load_toolchain_config( proto_env: Arc, workspace_root: &Path, working_dir: &Path, -) -> AppResult> { +) -> miette::Result> { debug!( "Attempting to load {} (optional)", color::file(config_loader.get_debug_label("toolchain", true)) @@ -155,7 +154,7 @@ pub async fn load_toolchain_config( pub async fn load_tasks_configs( config_loader: ConfigLoader, workspace_root: &Path, -) -> AppResult> { +) -> miette::Result> { debug!( "Attempting to load {} and {} (optional)", color::file(config_loader.get_debug_label("tasks", true)), @@ -177,7 +176,7 @@ pub async fn load_tasks_configs( } #[instrument(skip_all)] -pub async fn signin_to_moonbase(vcs: &BoxedVcs) -> AppResult>> { +pub async fn signin_to_moonbase(vcs: &BoxedVcs) -> miette::Result>> { if vcs.is_enabled() && env::var("MOONBASE_REPO_SLUG").is_err() { if let Ok(slug) = vcs.get_repository_slug().await { env::set_var("MOONBASE_REPO_SLUG", slug.as_str()); diff --git a/crates/cli/src/main.rs b/crates/cli/src/main.rs index 266f68f8bef..77b1e588803 100644 --- a/crates/cli/src/main.rs +++ b/crates/cli/src/main.rs @@ -8,14 +8,14 @@ use moon_app::commands::migrate::MigrateCommands; use moon_app::commands::node::NodeCommands; use moon_app::commands::query::QueryCommands; use moon_app::commands::sync::SyncCommands; -use moon_app::{commands, systems::bootstrap, Cli, CliSession, Commands, ExitCode}; +use moon_app::{commands, systems::bootstrap, Cli, CliSession, Commands}; use starbase::diagnostics::IntoDiagnostic; use starbase::tracing::TracingOptions; use starbase::{App, MainResult}; use starbase_styles::color; use starbase_utils::{dirs, string_vec}; use std::env; -use std::process::{exit, Command}; +use std::process::{Command, ExitCode}; use tracing::debug; #[global_allocator] @@ -42,21 +42,21 @@ fn get_tracing_modules() -> Vec { } #[cfg(unix)] -fn exec_local_bin(mut command: Command) -> std::io::Result<()> { +fn exec_local_bin(mut command: Command) -> std::io::Result { use std::os::unix::process::CommandExt; Err(command.exec()) } #[cfg(windows)] -fn exec_local_bin(mut command: Command) -> std::io::Result<()> { +fn exec_local_bin(mut command: Command) -> std::io::Result { let result = command.spawn()?.wait()?; if !result.success() { - exit(result.code().unwrap_or(1)); + return Ok(result.code().unwrap_or(1) as u8); } - Ok(()) + Ok(0) } #[tokio::main] @@ -108,13 +108,15 @@ async fn main() -> MainResult { command.args(&args[start_index..]); command.current_dir(current_dir); - return exec_local_bin(command).into_diagnostic(); + let exit_code = exec_local_bin(command).into_diagnostic()?; + + return Ok(ExitCode::from(exit_code)); } } } // Otherwise just run the CLI - let result = app + let exit_code = app .run(CliSession::new(cli, version), |session| async { match session.cli.command.clone() { Commands::ActionGraph(args) => { @@ -190,23 +192,7 @@ async fn main() -> MainResult { Commands::Upgrade => commands::upgrade::upgrade(session).await, } }) - .await; - - if let Err(error) = result { - // Rust crashes with a broken pipe error by default, - // so we unfortunately need to work around it with this hack! - // https://github.com/rust-lang/rust/issues/46016 - // if error.to_string().to_lowercase().contains("broken pipe") { - // exit(0); - // } - - // If we received a custom exit code, use it - if let Some(ExitCode(code)) = error.downcast_ref::() { - exit(*code); - } - - return Err(error); - } + .await?; - Ok(()) + Ok(ExitCode::from(exit_code)) } diff --git a/crates/codeowners/src/codeowners_generator.rs b/crates/codeowners/src/codeowners_generator.rs index 2dac95b52f1..3e009c42dbb 100644 --- a/crates/codeowners/src/codeowners_generator.rs +++ b/crates/codeowners/src/codeowners_generator.rs @@ -47,7 +47,7 @@ impl CodeownersGenerator { return Ok(()); } - trace!(project = id, source, "Adding project entries"); + trace!(project_id = id, source, "Adding project entries"); self.write("")?; diff --git a/crates/common/src/consts.rs b/crates/common/src/consts.rs index ff48540ea3d..ffdd87d6402 100644 --- a/crates/common/src/consts.rs +++ b/crates/common/src/consts.rs @@ -6,4 +6,4 @@ pub const BIN_NAME: &str = "moon"; pub const CONFIG_DIRNAME: &str = ".moon"; -pub const PROTO_CLI_VERSION: &str = "0.42.0"; +pub const PROTO_CLI_VERSION: &str = "0.42.1"; diff --git a/crates/config/Cargo.toml b/crates/config/Cargo.toml index fb83d96b2c6..623851ef541 100644 --- a/crates/config/Cargo.toml +++ b/crates/config/Cargo.toml @@ -18,7 +18,7 @@ indexmap = { workspace = true } miette = { workspace = true } once_cell = { workspace = true } regex = { workspace = true } -rpkl = "0.3.4" +rpkl = "0.3.5" rustc-hash = { workspace = true } schematic = { workspace = true, features = [ "config", diff --git a/crates/extension-plugin/src/extension_registry.rs b/crates/extension-plugin/src/extension_registry.rs index 4d0b60783b2..6d5d032a79d 100644 --- a/crates/extension-plugin/src/extension_registry.rs +++ b/crates/extension-plugin/src/extension_registry.rs @@ -41,7 +41,7 @@ impl ExtensionRegistry { let value = serialize_config(config.config.iter())?; trace!( - id = id.as_str(), + extension_id = id.as_str(), config = %value, "Storing moon extension configuration", ); diff --git a/crates/plugin/src/host.rs b/crates/plugin/src/host.rs index 781973f69e5..0b1e9a69e4a 100644 --- a/crates/plugin/src/host.rs +++ b/crates/plugin/src/host.rs @@ -102,7 +102,7 @@ fn load_task( trace!( plugin = &uuid, - target = target.as_str(), + task_target = target.as_str(), "Calling host function {}", color::label("load_task"), ); @@ -119,7 +119,7 @@ fn load_task( trace!( plugin = &uuid, - target = target.as_str(), + task_target = target.as_str(), "Called host function {}", color::label("load_task"), ); diff --git a/crates/project-builder/src/project_builder.rs b/crates/project-builder/src/project_builder.rs index ebe129c82cb..987ae464726 100644 --- a/crates/project-builder/src/project_builder.rs +++ b/crates/project-builder/src/project_builder.rs @@ -226,7 +226,10 @@ impl<'app> ProjectBuilder<'app> { ) -> miette::Result> { let mut deps = FxHashMap::default(); - trace!(id = self.id.as_str(), "Building project dependencies"); + trace!( + project_id = self.id.as_str(), + "Building project dependencies" + ); if let Some(local) = &self.local_config { for dep_on in &local.depends_on { @@ -256,8 +259,8 @@ impl<'app> ProjectBuilder<'app> { trace!( project_id = self.id.as_str(), - dep = dep_id.as_str(), - task = task_config.target.as_str(), + dep_id = dep_id.as_str(), + task_target = task_config.target.as_str(), "Marking arbitrary project as an implicit dependency because of a task dependency" ); @@ -281,7 +284,7 @@ impl<'app> ProjectBuilder<'app> { if !deps.is_empty() { trace!( project_id = self.id.as_str(), - deps = ?deps.keys().map(|k| k.as_str()).collect::>(), + dep_ids = ?deps.keys().map(|k| k.as_str()).collect::>(), "Depends on {} projects", deps.len(), ); @@ -295,7 +298,7 @@ impl<'app> ProjectBuilder<'app> { let mut file_inputs = BTreeMap::default(); let project_source = &self.source; - trace!(id = self.id.as_str(), "Building file groups"); + trace!(project_id = self.id.as_str(), "Building file groups"); // Inherit global first if let Some(global) = &self.global_config { @@ -338,7 +341,7 @@ impl<'app> ProjectBuilder<'app> { #[instrument(skip_all)] async fn build_tasks(&mut self) -> miette::Result> { - trace!(id = self.id.as_str(), "Building tasks"); + trace!(project_id = self.id.as_str(), "Building tasks"); let mut tasks_builder = TasksBuilder::new( self.id, diff --git a/crates/project-graph/Cargo.toml b/crates/project-graph/Cargo.toml index 8137c931d67..26fca8ab07d 100644 --- a/crates/project-graph/Cargo.toml +++ b/crates/project-graph/Cargo.toml @@ -19,8 +19,6 @@ miette = { workspace = true } petgraph = { workspace = true } rustc-hash = { workspace = true } scc = { workspace = true } -serde = { workspace = true, features = ["rc"] } -starbase_utils = { workspace = true, features = ["json"] } thiserror = { workspace = true } tracing = { workspace = true } @@ -31,6 +29,7 @@ moon_query = { path = "../query" } moon_workspace = { path = "../workspace" } starbase_events = { workspace = true } starbase_sandbox = { workspace = true } +starbase_utils = { workspace = true, features = ["json"] } tokio = { workspace = true } [lints] diff --git a/crates/query/Cargo.toml b/crates/query/Cargo.toml index e16d393e935..2eb9ffb50e5 100644 --- a/crates/query/Cargo.toml +++ b/crates/query/Cargo.toml @@ -12,8 +12,8 @@ publish = false moon_common = { path = "../common" } moon_config = { path = "../config" } miette = { workspace = true } -pest = "2.7.13" -pest_derive = "2.7.13" +pest = "2.7.14" +pest_derive = "2.7.14" starbase_utils = { workspace = true, features = ["glob"] } thiserror = { workspace = true } tracing = { workspace = true } diff --git a/crates/task-builder/src/tasks_builder.rs b/crates/task-builder/src/tasks_builder.rs index 0773240d500..15f32b98bc4 100644 --- a/crates/task-builder/src/tasks_builder.rs +++ b/crates/task-builder/src/tasks_builder.rs @@ -136,7 +136,7 @@ impl<'proj> TasksBuilder<'proj> { trace!( project_id = self.project_id.as_str(), - tasks = ?global_config.tasks.keys().map(|k| k.as_str()).collect::>(), + task_ids = ?global_config.tasks.keys().map(|k| k.as_str()).collect::>(), "Filtering global tasks", ); @@ -149,14 +149,14 @@ impl<'proj> TasksBuilder<'proj> { if !include_all { if include_set.is_empty() { trace!( - target = target.as_str(), + task_target = target.as_str(), "Not inheriting any global tasks, empty include filter", ); break; } else if !include_set.contains(task_id) { trace!( - target = target.as_str(), + task_target = target.as_str(), "Not inheriting global task {}, not included", color::id(task_id) ); @@ -169,7 +169,7 @@ impl<'proj> TasksBuilder<'proj> { // ["a"] = Exclude "a" if !exclude.is_empty() && exclude.contains(&task_id) { trace!( - target = target.as_str(), + task_target = target.as_str(), "Not inheriting global task {}, excluded", color::id(task_id) ); @@ -179,7 +179,7 @@ impl<'proj> TasksBuilder<'proj> { let task_key = if let Some(renamed_task_id) = rename.get(task_id) { trace!( - target = target.as_str(), + task_target = target.as_str(), "Inheriting global task {} and renaming to {}", color::id(task_id), color::id(renamed_task_id) @@ -188,7 +188,7 @@ impl<'proj> TasksBuilder<'proj> { renamed_task_id } else { trace!( - target = target.as_str(), + task_target = target.as_str(), "Inheriting global task {}", color::id(task_id), ); @@ -215,7 +215,7 @@ impl<'proj> TasksBuilder<'proj> { trace!( project_id = self.project_id.as_str(), - tasks = ?local_config.tasks.keys().map(|k| k.as_str()).collect::>(), + task_ids = ?local_config.tasks.keys().map(|k| k.as_str()).collect::>(), "Loading local tasks", ); @@ -244,7 +244,7 @@ impl<'proj> TasksBuilder<'proj> { let target = Target::new(self.project_id, id)?; trace!( - target = target.as_str(), + task_target = target.as_str(), "Building task {}", color::id(id.as_str()) ); @@ -285,7 +285,7 @@ impl<'proj> TasksBuilder<'proj> { if is_local { trace!( - target = target.as_str(), + task_target = target.as_str(), "Marking task as local (using server preset)" ); @@ -398,21 +398,21 @@ impl<'proj> TasksBuilder<'proj> { if configured_inputs == 0 { if has_configured_inputs { trace!( - target = target.as_str(), + task_target = target.as_str(), "Task has explicitly disabled inputs", ); task.metadata.empty_inputs = true; } else if self.context.monorepo && task.metadata.root_level { trace!( - target = target.as_str(), + task_target = target.as_str(), "Task is a root-level project in a monorepo, defaulting to no inputs", ); task.metadata.empty_inputs = true; } else { trace!( - target = target.as_str(), + task_target = target.as_str(), "No inputs configured, defaulting to {} (from project)", color::file("**/*"), ); @@ -496,7 +496,7 @@ impl<'proj> TasksBuilder<'proj> { // If an arg contains a glob, we must run in a shell for expansion to work if task.args.iter().any(|arg| is_glob_like(arg)) { trace!( - target = target.as_str(), + task_target = target.as_str(), "Task has a glob-like argument, wrapping in a shell so glob expansion works", ); @@ -509,7 +509,7 @@ impl<'proj> TasksBuilder<'proj> { if !for_current_system { trace!( - target = target.as_str(), + task_target = target.as_str(), os_list = ?os_list.iter().map(|os| os.to_string()).collect::>(), "Task has been marked for another operating system, disabling command/script", ); @@ -675,8 +675,8 @@ impl<'proj> TasksBuilder<'proj> { if !global_deps.is_empty() { trace!( - target = target.as_str(), - deps = ?global_deps.iter().map(|d| d.target.as_str()).collect::>(), + task_target = target.as_str(), + dep_targets = ?global_deps.iter().map(|d| d.target.as_str()).collect::>(), "Inheriting global implicit deps", ); } @@ -707,7 +707,7 @@ impl<'proj> TasksBuilder<'proj> { if !global_inputs.is_empty() { trace!( - target = target.as_str(), + task_target = target.as_str(), inputs = ?global_inputs.iter().map(|d| d.as_str()).collect::>(), "Inheriting global implicit inputs", ); @@ -725,7 +725,7 @@ impl<'proj> TasksBuilder<'proj> { if !env.is_empty() { trace!( - target = target.as_str(), + task_target = target.as_str(), env_vars = ?self.project_env, "Inheriting project env vars", ); diff --git a/crates/task-expander/src/task_expander.rs b/crates/task-expander/src/task_expander.rs index 305c189c803..20352fe43f6 100644 --- a/crates/task-expander/src/task_expander.rs +++ b/crates/task-expander/src/task_expander.rs @@ -31,7 +31,7 @@ impl<'graph> TaskExpander<'graph> { let mut task = task.to_owned(); debug!( - target = task.target.as_str(), + task_target = task.target.as_str(), "Expanding task {}", color::label(&task.target) ); @@ -57,7 +57,7 @@ impl<'graph> TaskExpander<'graph> { #[instrument(skip_all)] pub fn expand_command(&mut self, task: &mut Task) -> miette::Result<()> { trace!( - target = task.target.as_str(), + task_target = task.target.as_str(), command = &task.command, "Expanding tokens and variables in command" ); @@ -70,7 +70,7 @@ impl<'graph> TaskExpander<'graph> { #[instrument(skip_all)] pub fn expand_script(&mut self, task: &mut Task) -> miette::Result<()> { trace!( - target = task.target.as_str(), + task_target = task.target.as_str(), script = task.script.as_ref(), "Expanding tokens and variables in script" ); @@ -87,7 +87,7 @@ impl<'graph> TaskExpander<'graph> { } trace!( - target = task.target.as_str(), + task_target = task.target.as_str(), args = ?task.args, "Expanding tokens and variables in args", ); @@ -104,7 +104,7 @@ impl<'graph> TaskExpander<'graph> { } trace!( - target = task.target.as_str(), + task_target = task.target.as_str(), deps = ?task.deps.iter().map(|d| d.target.as_str()).collect::>(), "Expanding tokens and variables in deps args and env", ); @@ -133,7 +133,7 @@ impl<'graph> TaskExpander<'graph> { #[instrument(skip_all)] pub fn expand_env(&mut self, task: &mut Task) -> miette::Result<()> { trace!( - target = task.target.as_str(), + task_target = task.target.as_str(), env = ?task.env, "Expanding environment variables" ); @@ -151,7 +151,7 @@ impl<'graph> TaskExpander<'graph> { .collect::>(); trace!( - target = task.target.as_str(), + task_target = task.target.as_str(), env_files = ?env_paths, "Loading environment variables from .env files", ); @@ -196,7 +196,7 @@ impl<'graph> TaskExpander<'graph> { } trace!( - target = task.target.as_str(), + task_target = task.target.as_str(), inputs = ?task.inputs.iter().map(|d| d.as_str()).collect::>(), "Expanding inputs into file system paths" ); @@ -218,7 +218,7 @@ impl<'graph> TaskExpander<'graph> { } trace!( - target = task.target.as_str(), + task_target = task.target.as_str(), outputs = ?task.outputs.iter().map(|d| d.as_str()).collect::>(), "Expanding outputs into file system paths" ); diff --git a/crates/task-graph/Cargo.toml b/crates/task-graph/Cargo.toml index db58ff2d6e8..354414165db 100644 --- a/crates/task-graph/Cargo.toml +++ b/crates/task-graph/Cargo.toml @@ -19,8 +19,6 @@ moon_task_expander = { path = "../task-expander" } miette = { workspace = true } petgraph = { workspace = true } rustc-hash = { workspace = true } -serde = { workspace = true } -starbase_utils = { workspace = true, features = ["json"] } thiserror = { workspace = true } tracing = { workspace = true } diff --git a/crates/task-hasher/src/task_hasher.rs b/crates/task-hasher/src/task_hasher.rs index 4995632a3ba..60605115f81 100644 --- a/crates/task-hasher/src/task_hasher.rs +++ b/crates/task-hasher/src/task_hasher.rs @@ -219,7 +219,7 @@ impl<'task> TaskHasher<'task> { if !path.is_file() { warn!( "Attempted to hash input {} but only files can be hashed, try using a glob instead", - color::rel_path(&rel_path), + color::rel_path(&rel_path), ); continue; diff --git a/crates/task-runner/src/command_builder.rs b/crates/task-runner/src/command_builder.rs index 9aee93aac48..d133d2f2c2d 100644 --- a/crates/task-runner/src/command_builder.rs +++ b/crates/task-runner/src/command_builder.rs @@ -75,7 +75,7 @@ impl<'task> CommandBuilder<'task> { } debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), command = self.command.bin.to_str(), working_dir = ?self.working_dir, "Creating task command to execute", @@ -102,7 +102,7 @@ impl<'task> CommandBuilder<'task> { if let ActionNode::RunTask(inner) = &self.node { if !inner.args.is_empty() { trace!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), args = ?inner.args, "Inheriting args from dependent task" ); @@ -116,7 +116,7 @@ impl<'task> CommandBuilder<'task> { && !context.passthrough_args.is_empty() { trace!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), args = ?context.passthrough_args, "Inheriting args passed through the command line" ); @@ -131,7 +131,7 @@ impl<'task> CommandBuilder<'task> { if let ActionNode::RunTask(inner) = &self.node { if !inner.env.is_empty() { trace!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), env = ?inner.env, "Inheriting env from dependent task" ); diff --git a/crates/task-runner/src/command_executor.rs b/crates/task-runner/src/command_executor.rs index 5f91925732e..21a7b25efd4 100644 --- a/crates/task-runner/src/command_executor.rs +++ b/crates/task-runner/src/command_executor.rs @@ -92,7 +92,7 @@ impl<'task> CommandExecutor<'task> { report_item.attempt_current = self.attempt_index; debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), command = self.command.bin.to_str(), "Running task (attempt {} of {})", self.attempt_index, @@ -155,7 +155,7 @@ impl<'task> CommandExecutor<'task> { is_success = output.status.success(); debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), command = self.command.bin.to_str(), exit_code = output.status.code(), "Ran task, checking conditions", @@ -164,7 +164,7 @@ impl<'task> CommandExecutor<'task> { attempt.finish_from_output(output); } else { debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), command = self.command.bin.to_str(), "Task timed out", ); @@ -184,7 +184,7 @@ impl<'task> CommandExecutor<'task> { // Successful execution, so break the loop if is_success { debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), "Task was successful, proceeding to next step", ); @@ -194,7 +194,7 @@ impl<'task> CommandExecutor<'task> { // Unsuccessful execution (maybe flaky), attempt again else if self.attempt_index < self.attempt_total { debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), "Task was unsuccessful, attempting again", ); @@ -204,7 +204,7 @@ impl<'task> CommandExecutor<'task> { // We've hit our max attempts, so break else { debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), "Task was unsuccessful, failing as we hit our max attempts", ); @@ -215,7 +215,7 @@ impl<'task> CommandExecutor<'task> { // Process unexpectedly crashed Err(error) => { debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), command = self.command.bin.to_str(), "Failed to run task, an unexpected error occurred", ); diff --git a/crates/task-runner/src/output_archiver.rs b/crates/task-runner/src/output_archiver.rs index 66c21d83bbd..c75f5ab01fe 100644 --- a/crates/task-runner/src/output_archiver.rs +++ b/crates/task-runner/src/output_archiver.rs @@ -40,7 +40,7 @@ impl<'task> OutputArchiver<'task> { if !archive_file.exists() { if !self.app.cache_engine.is_writable() { debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), hash, "Cache is not writable, skipping output archiving" ); @@ -48,7 +48,7 @@ impl<'task> OutputArchiver<'task> { } debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), hash, "Archiving task outputs from project" ); @@ -135,7 +135,7 @@ impl<'task> OutputArchiver<'task> { #[instrument(skip(self))] pub fn create_local_archive(&self, hash: &str, archive_file: &Path) -> miette::Result<()> { debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), hash, archive_file = ?archive_file, "Creating archive file" ); @@ -165,7 +165,7 @@ impl<'task> OutputArchiver<'task> { // Pack the archive if let Err(error) = archive.pack(TarPacker::new_gz) { warn!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), hash, archive_file = ?archive_file, "Failed to package outputs into archive: {}", diff --git a/crates/task-runner/src/output_hydrater.rs b/crates/task-runner/src/output_hydrater.rs index 6d1f36ce808..4eed21eface 100644 --- a/crates/task-runner/src/output_hydrater.rs +++ b/crates/task-runner/src/output_hydrater.rs @@ -33,7 +33,7 @@ impl<'task> OutputHydrater<'task> { if self.app.cache_engine.is_readable() { debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), hash, "Hydrating cached outputs into project" ); @@ -51,7 +51,7 @@ impl<'task> OutputHydrater<'task> { } } else { debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), hash, "Cache is not readable, skipping output hydration" ); } @@ -62,7 +62,7 @@ impl<'task> OutputHydrater<'task> { #[instrument(skip(self))] pub fn unpack_local_archive(&self, hash: &str, archive_file: &Path) -> miette::Result { debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), hash, archive_file = ?archive_file, "Unpacking archive into project" ); @@ -81,7 +81,7 @@ impl<'task> OutputHydrater<'task> { // Unpack the archive if let Err(error) = archive.unpack(TarUnpacker::new_gz) { warn!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), hash, archive_file = ?archive_file, "Failed to hydrate outputs from archive: {}", diff --git a/crates/task-runner/src/task_runner.rs b/crates/task-runner/src/task_runner.rs index 0d25da1ee64..831715f2354 100644 --- a/crates/task-runner/src/task_runner.rs +++ b/crates/task-runner/src/task_runner.rs @@ -50,7 +50,7 @@ impl<'task> TaskRunner<'task> { task: &'task Task, ) -> miette::Result { debug!( - task = task.target.as_str(), + task_target = task.target.as_str(), "Creating a task runner for target" ); @@ -102,7 +102,7 @@ impl<'task> TaskRunner<'task> { // If cache is enabled, then generate a hash and manage outputs if self.is_cache_enabled() { debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), "Caching is enabled for task, will generate a hash and manage outputs" ); @@ -125,7 +125,7 @@ impl<'task> TaskRunner<'task> { } debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), "Caching is disabled for task, will not generate a hash, and will attempt to run a command as normal" ); @@ -202,7 +202,7 @@ impl<'task> TaskRunner<'task> { let cache_engine = &self.app.cache_engine; debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), hash, "Checking if task has been cached using hash" ); @@ -217,7 +217,7 @@ impl<'task> TaskRunner<'task> { if let Some(duration) = cache_lifetime { if is_stale(self.cache.data.last_run_time, duration) { debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), hash, "Cache skip, a lifetime has been configured and the last run is stale, continuing run" ); @@ -240,7 +240,7 @@ impl<'task> TaskRunner<'task> { } debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), hash, "Hash matches previous run, reusing existing outputs" ); @@ -249,7 +249,7 @@ impl<'task> TaskRunner<'task> { if !cache_engine.is_readable() { debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), hash, "Cache is not readable, continuing run" ); @@ -262,7 +262,7 @@ impl<'task> TaskRunner<'task> { // If the previous run was a failure, avoid hydrating if self.cache.data.exit_code > 0 { debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), hash, "Previous run failed, avoiding hydration" ); @@ -283,7 +283,7 @@ impl<'task> TaskRunner<'task> { if let Some(duration) = cache_lifetime { if fs::is_stale(&archive_file, false, duration, SystemTime::now())?.is_some() { debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), hash, archive_file = ?archive_file, "Cache skip in local cache, a lifetime has been configured and the archive is stale, continuing run" @@ -294,7 +294,7 @@ impl<'task> TaskRunner<'task> { } debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), hash, archive_file = ?archive_file, "Cache hit in local cache, will reuse existing archive" @@ -308,7 +308,7 @@ impl<'task> TaskRunner<'task> { if let Some(moonbase) = Moonbase::session() { if let Some((artifact, _)) = moonbase.read_artifact(hash).await? { debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), hash, artifact_id = artifact.id, "Cache hit in remote cache, will attempt to download the archive" @@ -319,7 +319,7 @@ impl<'task> TaskRunner<'task> { } debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), hash, "Cache miss, continuing run" ); @@ -345,8 +345,8 @@ impl<'task> TaskRunner<'task> { } debug!( - task = self.task.target.as_str(), - dependency = dep.target.as_str(), + task_target = self.task.target.as_str(), + dependency_target = dep.target.as_str(), "Task dependency has failed or has been skipped, skipping this task", ); @@ -370,7 +370,7 @@ impl<'task> TaskRunner<'task> { node: &ActionNode, ) -> miette::Result { debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), "Generating a unique hash for this task" ); @@ -379,7 +379,7 @@ impl<'task> TaskRunner<'task> { // Hash common fields trace!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), "Including common task related fields in the hash" ); @@ -421,7 +421,7 @@ impl<'task> TaskRunner<'task> { // Hash platform fields trace!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), platform = ?self.task.platform, "Including toolchain specific fields in the hash" ); @@ -444,7 +444,7 @@ impl<'task> TaskRunner<'task> { self.operations.push(operation); debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), hash = &hash, "Generated a unique hash" ); @@ -466,7 +466,7 @@ impl<'task> TaskRunner<'task> { } debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), "Building and executing the task command" ); @@ -482,8 +482,8 @@ impl<'task> TaskRunner<'task> { let result = if let Some(mutex_name) = &self.task.options.mutex { let mut operation = Operation::mutex_acquisition(); - debug!( - task = self.task.target.as_str(), + trace!( + task_target = self.task.target.as_str(), mutex = mutex_name, "Waiting to acquire task mutex lock" ); @@ -491,8 +491,8 @@ impl<'task> TaskRunner<'task> { let mutex = context.get_or_create_mutex(mutex_name); let _guard = mutex.lock().await; - debug!( - task = self.task.target.as_str(), + trace!( + task_target = self.task.target.as_str(), mutex = mutex_name, "Acquired task mutex lock" ); @@ -544,7 +544,7 @@ impl<'task> TaskRunner<'task> { #[instrument(skip_all)] pub fn skip(&mut self, context: &ActionContext) -> miette::Result<()> { - debug!(task = self.task.target.as_str(), "Skipping task"); + debug!(task_target = self.task.target.as_str(), "Skipping task"); self.operations.push(Operation::new_finished( OperationMeta::TaskExecution(Default::default()), @@ -559,7 +559,7 @@ impl<'task> TaskRunner<'task> { #[instrument(skip(self, context))] pub fn skip_no_op(&mut self, context: &ActionContext) -> miette::Result<()> { debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), "Skipping task as its a no-operation" ); @@ -581,14 +581,14 @@ impl<'task> TaskRunner<'task> { let mut operation = Operation::archive_creation(); debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), "Running cache archiving operation" ); let archived = match self.archiver.archive(hash).await? { Some(archive_file) => { debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), archive_file = ?archive_file, "Ran cache archiving operation" ); @@ -598,7 +598,10 @@ impl<'task> TaskRunner<'task> { true } None => { - debug!(task = self.task.target.as_str(), "Nothing to archive"); + debug!( + task_target = self.task.target.as_str(), + "Nothing to archive" + ); operation.finish(ActionStatus::Skipped); @@ -616,13 +619,16 @@ impl<'task> TaskRunner<'task> { let mut operation = Operation::output_hydration(); debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), "Running cache hydration operation" ); // Not cached let Some(from) = self.is_cached(hash).await? else { - debug!(task = self.task.target.as_str(), "Nothing to hydrate"); + debug!( + task_target = self.task.target.as_str(), + "Nothing to hydrate" + ); operation.finish(ActionStatus::Skipped); @@ -633,7 +639,7 @@ impl<'task> TaskRunner<'task> { // Did not hydrate if !self.hydrater.hydrate(hash, from).await? { - debug!(task = self.task.target.as_str(), "Did not hydrate"); + debug!(task_target = self.task.target.as_str(), "Did not hydrate"); operation.finish(ActionStatus::Invalid); @@ -644,7 +650,7 @@ impl<'task> TaskRunner<'task> { // Did hydrate debug!( - task = self.task.target.as_str(), + task_target = self.task.target.as_str(), "Ran cache hydration operation" ); diff --git a/crates/toolchain-plugin/src/toolchain_plugin.rs b/crates/toolchain-plugin/src/toolchain_plugin.rs index ea48a26b851..4c8c581d41f 100644 --- a/crates/toolchain-plugin/src/toolchain_plugin.rs +++ b/crates/toolchain-plugin/src/toolchain_plugin.rs @@ -29,7 +29,7 @@ impl ToolchainPlugin { return Ok(None); } - debug!(toolchain = self.id.as_str(), "Syncing workspace"); + debug!(toolchain_id = self.id.as_str(), "Syncing workspace"); let output: SyncWorkspaceOutput = self .plugin @@ -50,7 +50,7 @@ impl ToolchainPlugin { // return Ok(()); // } - // debug!(toolchain = self.id.as_str(), "Syncing project"); + // debug!(toolchain_id = self.id.as_str(), "Syncing project"); // self.plugin // .call_func_without_output( diff --git a/crates/toolchain-plugin/src/toolchain_registry.rs b/crates/toolchain-plugin/src/toolchain_registry.rs index c4a4d4e310e..aeabcefdab5 100644 --- a/crates/toolchain-plugin/src/toolchain_registry.rs +++ b/crates/toolchain-plugin/src/toolchain_registry.rs @@ -49,7 +49,7 @@ impl ToolchainRegistry { let value = serialize_config(config.config.iter())?; trace!( - id = id.as_str(), + toolchain_id = id.as_str(), config = %value, "Storing moon toolchain configuration", ); diff --git a/crates/workspace-graph/src/query_projects.rs b/crates/workspace-graph/src/query_projects.rs index 8561dd107b9..cab1f29c771 100644 --- a/crates/workspace-graph/src/query_projects.rs +++ b/crates/workspace-graph/src/query_projects.rs @@ -52,7 +52,7 @@ impl WorkspaceGraph { project_ids.sort(); debug!( - projects = ?project_ids + project_ids = ?project_ids .iter() .map(|id| id.as_str()) .collect::>(), diff --git a/crates/workspace-graph/src/query_tasks.rs b/crates/workspace-graph/src/query_tasks.rs index e4bd605b1bd..350a4e01250 100644 --- a/crates/workspace-graph/src/query_tasks.rs +++ b/crates/workspace-graph/src/query_tasks.rs @@ -52,7 +52,7 @@ impl WorkspaceGraph { targets.sort(); debug!( - tasks = ?targets + task_targets = ?targets .iter() .map(|target| target.as_str()) .collect::>(), diff --git a/crates/workspace/src/projects_locator.rs b/crates/workspace/src/projects_locator.rs index 049bea202ea..a0a2561f3ba 100644 --- a/crates/workspace/src/projects_locator.rs +++ b/crates/workspace/src/projects_locator.rs @@ -112,7 +112,7 @@ where if id.starts_with(".") { debug!( - id = id.as_str(), + project_id = id.as_str(), source = source.as_str(), "Received a project for a hidden folder. These are not supported through globs, but can be mapped explicitly with project sources!" ); diff --git a/crates/workspace/src/workspace_builder.rs b/crates/workspace/src/workspace_builder.rs index 1f0f86ce049..b08bb320447 100644 --- a/crates/workspace/src/workspace_builder.rs +++ b/crates/workspace/src/workspace_builder.rs @@ -475,7 +475,7 @@ impl<'app> WorkspaceBuilder<'app> { // Not loaded, resolve the task trace!( - target = target.as_str(), + task_target = target.as_str(), "Task does not exist in the task graph, attempting to load", ); @@ -507,7 +507,7 @@ impl<'app> WorkspaceBuilder<'app> { for dep_config in &mut task.deps { if cycle.contains(&dep_config.target) { debug!( - target = target.as_str(), + task_target = target.as_str(), dependency_target = dep_config.target.as_str(), "Encountered a dependency cycle (from task); will disconnect nodes to avoid recursion", ); diff --git a/legacy/node/platform/Cargo.toml b/legacy/node/platform/Cargo.toml index da4d18ed8ef..e5df0d4292f 100644 --- a/legacy/node/platform/Cargo.toml +++ b/legacy/node/platform/Cargo.toml @@ -32,7 +32,5 @@ starbase_styles = { workspace = true } starbase_utils = { workspace = true, features = ["glob"] } tracing = { workspace = true } -[dev-dependencies] - [lints] workspace = true diff --git a/legacy/rust/lang/Cargo.toml b/legacy/rust/lang/Cargo.toml index dbc291f7068..bf8ce265ad5 100644 --- a/legacy/rust/lang/Cargo.toml +++ b/legacy/rust/lang/Cargo.toml @@ -8,7 +8,7 @@ publish = false moon_lang = { path = "../../core/lang" } moon_logger = { path = "../../core/logger" } cached = { workspace = true } -cargo-lock = "9.0.0" +cargo-lock = "10.0.1" cargo_toml = "0.20.5" miette = { workspace = true } rustc-hash = { workspace = true } diff --git a/legacy/typescript/lang/Cargo.toml b/legacy/typescript/lang/Cargo.toml index 1c061da3fbb..4b4f349df10 100644 --- a/legacy/typescript/lang/Cargo.toml +++ b/legacy/typescript/lang/Cargo.toml @@ -13,7 +13,7 @@ miette = { workspace = true } serde_json = { workspace = true, features = ["preserve_order"] } starbase_styles = { workspace = true } starbase_utils = { workspace = true, features = ["json"] } -typescript_tsconfig_json = { version = "0.2.0", features = ["serialize"] } +typescript_tsconfig_json = { version = "0.3.0", features = ["serialize"] } [dev-dependencies] moon_test_utils = { path = "../../core/test-utils" } diff --git a/legacy/typescript/lang/src/tsconfig.rs b/legacy/typescript/lang/src/tsconfig.rs index e1c4be513dd..8bfac2da8c5 100644 --- a/legacy/typescript/lang/src/tsconfig.rs +++ b/legacy/typescript/lang/src/tsconfig.rs @@ -197,7 +197,13 @@ fn write_preserved_json(path: &Path, tsconfig: &TsConfigJsonCache) -> miette::Re } if let Some(paths) = &options.paths { - data[field]["paths"] = JsonValue::from_iter(paths.to_owned()); + data[field]["paths"] = + JsonValue::from_iter(paths.iter().map(|(key, value)| { + ( + key.to_owned(), + value.iter().map(|v| v.to_string()).collect::>(), + ) + })); } } else if let Some(root) = data.as_object_mut() { root.remove(field); diff --git a/legacy/typescript/lang/tests/tsconfig_test.rs b/legacy/typescript/lang/tests/tsconfig_test.rs index 5ccbc02e7b5..d7c642849b7 100644 --- a/legacy/typescript/lang/tests/tsconfig_test.rs +++ b/legacy/typescript/lang/tests/tsconfig_test.rs @@ -377,7 +377,7 @@ mod update_compiler_options { let updated = tsc.update_compiler_option_paths(CompilerOptionsPathsMap::from_iter([( "alias".into(), - string_vec!["index.ts"], + vec![PathOrGlob::from("index.ts")], )])); assert!(updated); @@ -391,7 +391,7 @@ mod update_compiler_options { .unwrap() .get("alias") .unwrap(), - string_vec!["index.ts"] + vec![PathOrGlob::from("index.ts")] ); } @@ -400,9 +400,9 @@ mod update_compiler_options { let mut tsc = TsConfigJsonCache::default(); let updated = tsc.update_compiler_option_paths(CompilerOptionsPathsMap::from_iter([ - ("one".into(), string_vec!["one.ts"]), - ("two".into(), string_vec!["two.ts"]), - ("three".into(), string_vec!["three.ts"]), + ("one".into(), vec![PathOrGlob::from("one.ts")]), + ("two".into(), vec![PathOrGlob::from("two.ts")]), + ("three".into(), vec![PathOrGlob::from("three.ts")]), ])); assert!(updated); @@ -426,7 +426,7 @@ mod update_compiler_options { compiler_options: Some(CompilerOptions { paths: Some(CompilerOptionsPathsMap::from_iter([( "alias".into(), - string_vec!["old.ts"], + vec![PathOrGlob::from("old.ts")], )])), ..Default::default() }), @@ -437,7 +437,7 @@ mod update_compiler_options { let updated = tsc.update_compiler_option_paths(CompilerOptionsPathsMap::from_iter([( "alias".into(), - string_vec!["new.ts"], + vec![PathOrGlob::from("new.ts")], )])); assert!(updated); @@ -451,7 +451,7 @@ mod update_compiler_options { .unwrap() .get("alias") .unwrap(), - string_vec!["new.ts"] + vec![PathOrGlob::from("new.ts")] ); } @@ -462,7 +462,7 @@ mod update_compiler_options { compiler_options: Some(CompilerOptions { paths: Some(CompilerOptionsPathsMap::from_iter([( "alias".into(), - string_vec!["./src", "./other"], + vec![PathOrGlob::from("./src"), PathOrGlob::from("./other")], )])), ..Default::default() }), @@ -473,14 +473,14 @@ mod update_compiler_options { let updated = tsc.update_compiler_option_paths(CompilerOptionsPathsMap::from_iter([( "alias".into(), - string_vec!["./src", "./other"], + vec![PathOrGlob::from("./src"), PathOrGlob::from("./other")], )])); assert!(!updated); let updated = tsc.update_compiler_option_paths(CompilerOptionsPathsMap::from_iter([( "alias".into(), - string_vec!["./other", "./src"], + vec![PathOrGlob::from("./other"), PathOrGlob::from("./src")], )])); assert!(!updated); diff --git a/legacy/typescript/platform/src/sync_project.rs b/legacy/typescript/platform/src/sync_project.rs index 2467f9d626a..70b74daaa78 100644 --- a/legacy/typescript/platform/src/sync_project.rs +++ b/legacy/typescript/platform/src/sync_project.rs @@ -216,10 +216,12 @@ impl<'app> TypeScriptSyncer<'app> { if abs_ref.join(index).exists() { tsconfig_compiler_paths.insert( dep_package_name.clone(), - vec![to_relative_virtual_string( - abs_ref.join(index), - &self.project.root, - )?], + vec![PathOrGlob::from( + to_relative_virtual_string( + abs_ref.join(index), + &self.project.root, + )?, + )], ); break; @@ -228,14 +230,14 @@ impl<'app> TypeScriptSyncer<'app> { tsconfig_compiler_paths.insert( format!("{dep_package_name}/*"), - vec![to_relative_virtual_string( + vec![PathOrGlob::from(to_relative_virtual_string( abs_ref.join(if abs_ref.join("src").exists() { "src/*" } else { "*" }), &self.project.root, - )?], + )?)], ); } }