diff --git a/.github/workflows/moon.yml b/.github/workflows/moon.yml index 4600b7dab3d..791e281dae2 100644 --- a/.github/workflows/moon.yml +++ b/.github/workflows/moon.yml @@ -7,8 +7,8 @@ on: paths: - .github/workflows/moon.yml - .moon/workspace.yml + - .moon/tasks.yml - .moon/toolchain.yml - - .moon/project.yml - crates/** - packages/** - website/** diff --git a/.moon/project.yml b/.moon/project.yml index 19ebb407693..28d1744b8e6 100644 --- a/.moon/project.yml +++ b/.moon/project.yml @@ -1,92 +1,2 @@ -$schema: '../website/static/schemas/global-project.json' - -fileGroups: - configs: - - '*.{js,json}' - sources: - - 'src/**/*' - - 'types/**/*' - tests: - - 'tests/**/*' - -tasks: - build: - command: - 'packemon build --addFiles --addExports --declaration --declarationConfig tsconfig.build.json' - env: - NODE_ENV: 'production' - inputs: - - '@globs(sources)' - - 'package.json' - - 'tsconfig.json' - - 'tsconfig.build.json' - - '/tsconfig.options.json' - outputs: - - 'cjs' - - 'dts' - - format: - command: 'prettier' - args: - - '--check' - - '--config' - - '@in(3)' - - '--ignore-path' - - '@in(2)' - - '--no-error-on-unmatched-pattern' - inputs: - - '@globs(sources)' - - '@globs(tests)' - - '/.prettierignore' - - '/prettier.config.js' - options: - affectedFiles: true - - lint: - command: 'eslint' - args: - - '--cache' - - '--cache-location' - - './.eslintcache' - - '--color' - - '--ext' - - '.js,.ts,.tsx' - - '--fix' - - '--ignore-path' - - '@in(5)' - - '--exit-on-fatal-error' - - '--no-error-on-unmatched-pattern' - - '--report-unused-disable-directives' - inputs: - - '@globs(sources)' - - '@globs(tests)' - - '*.js' - - '.eslintrc.js' - - 'tsconfig.json' - - '/.eslintignore' - - '/.eslintrc.js' - - '/tsconfig.eslint.json' - - '/tsconfig.options.json' - options: - affectedFiles: true - - test: - command: 'jest' - args: - - '--cache' - - '--color' - - '--preset' - - 'jest-preset-moon' - - '--passWithNoTests' - inputs: - - '@globs(sources)' - - '@globs(tests)' - - 'jest.config.js' - - typecheck: - command: 'tsc --build --verbose' - inputs: - - '@globs(sources)' - - '@globs(tests)' - - 'tsconfig.json' - - '/tsconfig.options.json' +# Temporary until v0.23 is released! +extends: './tasks.yml' diff --git a/.moon/tasks.yml b/.moon/tasks.yml new file mode 100644 index 00000000000..99d59a10679 --- /dev/null +++ b/.moon/tasks.yml @@ -0,0 +1,92 @@ +$schema: '../website/static/schemas/tasks.json' + +fileGroups: + configs: + - '*.{js,json}' + sources: + - 'src/**/*' + - 'types/**/*' + tests: + - 'tests/**/*' + +tasks: + build: + command: + 'packemon build --addFiles --addExports --declaration --declarationConfig tsconfig.build.json' + env: + NODE_ENV: 'production' + inputs: + - '@globs(sources)' + - 'package.json' + - 'tsconfig.json' + - 'tsconfig.build.json' + - '/tsconfig.options.json' + outputs: + - 'cjs' + - 'dts' + + format: + command: 'prettier' + args: + - '--check' + - '--config' + - '@in(3)' + - '--ignore-path' + - '@in(2)' + - '--no-error-on-unmatched-pattern' + inputs: + - '@globs(sources)' + - '@globs(tests)' + - '/.prettierignore' + - '/prettier.config.js' + options: + affectedFiles: true + + lint: + command: 'eslint' + args: + - '--cache' + - '--cache-location' + - './.eslintcache' + - '--color' + - '--ext' + - '.js,.ts,.tsx' + - '--fix' + - '--ignore-path' + - '@in(5)' + - '--exit-on-fatal-error' + - '--no-error-on-unmatched-pattern' + - '--report-unused-disable-directives' + inputs: + - '@globs(sources)' + - '@globs(tests)' + - '*.js' + - '.eslintrc.js' + - 'tsconfig.json' + - '/.eslintignore' + - '/.eslintrc.js' + - '/tsconfig.eslint.json' + - '/tsconfig.options.json' + options: + affectedFiles: true + + test: + command: 'jest' + args: + - '--cache' + - '--color' + - '--preset' + - 'jest-preset-moon' + - '--passWithNoTests' + inputs: + - '@globs(sources)' + - '@globs(tests)' + - 'jest.config.js' + + typecheck: + command: 'tsc --build --verbose' + inputs: + - '@globs(sources)' + - '@globs(tests)' + - 'tsconfig.json' + - '/tsconfig.options.json' diff --git a/.yarn/versions/8ea39e72.yml b/.yarn/versions/8ea39e72.yml index 28fac241db0..e0c5d27d447 100644 --- a/.yarn/versions/8ea39e72.yml +++ b/.yarn/versions/8ea39e72.yml @@ -1,9 +1,15 @@ releases: - "@moonrepo/cli": minor - "@moonrepo/core-linux-arm64-gnu": minor - "@moonrepo/core-linux-arm64-musl": minor - "@moonrepo/core-linux-x64-gnu": minor - "@moonrepo/core-linux-x64-musl": minor - "@moonrepo/core-macos-arm64": minor - "@moonrepo/core-macos-x64": minor - "@moonrepo/core-windows-x64-msvc": minor + '@moonrepo/cli': minor + '@moonrepo/core-linux-arm64-gnu': minor + '@moonrepo/core-linux-arm64-musl': minor + '@moonrepo/core-linux-x64-gnu': minor + '@moonrepo/core-linux-x64-musl': minor + '@moonrepo/core-macos-arm64': minor + '@moonrepo/core-macos-x64': minor + '@moonrepo/core-windows-x64-msvc': minor + '@moonrepo/types': patch + +declined: + - '@moonrepo/report' + - '@moonrepo/runtime' + - 'website' diff --git a/Cargo.lock b/Cargo.lock index fa6caf5e3e9..3f392fcca1b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -44,12 +44,6 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" -[[package]] -name = "anyhow" -version = "1.0.65" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602" - [[package]] name = "arrayvec" version = "0.7.2" @@ -62,6 +56,15 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" +[[package]] +name = "ascii-canvas" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" +dependencies = [ + "term", +] + [[package]] name = "assert-json-diff" version = "2.0.1" @@ -111,6 +114,125 @@ dependencies = [ "futures-core", ] +[[package]] +name = "async-executor" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17adb73da160dfb475c183343c8cccd80721ea5a605d3eb57125f0a7b7a92d0b" +dependencies = [ + "async-lock", + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "slab", +] + +[[package]] +name = "async-global-executor" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1b6f5d7df27bd294849f8eec66ecfc63d11814df7a4f5d74168a2394467b776" +dependencies = [ + "async-channel", + "async-executor", + "async-io", + "async-lock", + "blocking", + "futures-lite", + "once_cell", +] + +[[package]] +name = "async-io" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c374dda1ed3e7d8f0d9ba58715f924862c63eae6849c92d3a18e7fbde9e2794" +dependencies = [ + "async-lock", + "autocfg", + "concurrent-queue", + "futures-lite", + "libc", + "log", + "parking", + "polling", + "slab", + "socket2", + "waker-fn", + "windows-sys 0.42.0", +] + +[[package]] +name = "async-lock" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8101efe8695a6c17e02911402145357e718ac92d3ff88ae8419e84b1707b685" +dependencies = [ + "event-listener", + "futures-lite", +] + +[[package]] +name = "async-object-pool" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aeb901c30ebc2fc4ab46395bbfbdba9542c16559d853645d75190c3056caf3bc" +dependencies = [ + "async-std", +] + +[[package]] +name = "async-process" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6381ead98388605d0d9ff86371043b5aa922a3905824244de40dc263a14fcba4" +dependencies = [ + "async-io", + "async-lock", + "autocfg", + "blocking", + "cfg-if", + "event-listener", + "futures-lite", + "libc", + "signal-hook", + "windows-sys 0.42.0", +] + +[[package]] +name = "async-std" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" +dependencies = [ + "async-channel", + "async-global-executor", + "async-io", + "async-lock", + "async-process", + "crossbeam-utils", + "futures-channel", + "futures-core", + "futures-io", + "futures-lite", + "gloo-timers", + "kv-log-macro", + "log", + "memchr", + "once_cell", + "pin-project-lite", + "pin-utils", + "slab", + "wasm-bindgen-futures", +] + +[[package]] +name = "async-task" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" + [[package]] name = "async-trait" version = "0.1.61" @@ -137,6 +259,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "atomic-waker" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "debc29dde2e69f9e47506b525f639ed42300fc014a3e007832592448fa8e4599" + [[package]] name = "atty" version = "0.2.14" @@ -166,6 +294,32 @@ version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" +[[package]] +name = "basic-cookies" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb53b6b315f924c7f113b162e53b3901c05fc9966baf84d201dfcc7432a4bb38" +dependencies = [ + "lalrpop", + "lalrpop-util", + "regex", +] + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + [[package]] name = "bitflags" version = "1.3.2" @@ -181,6 +335,20 @@ dependencies = [ "generic-array", ] +[[package]] +name = "blocking" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c67b173a56acffd6d2326fb7ab938ba0b00a71480e14902b2591c87bc5741e8" +dependencies = [ + "async-channel", + "async-lock", + "async-task", + "atomic-waker", + "fastrand", + "futures-lite", +] + [[package]] name = "brownstone" version = "3.0.0" @@ -296,6 +464,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" +[[package]] +name = "castaway" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2698f953def977c68f935bb0dfa959375ad4638570e969e2f1e9f433cbf1af6" + [[package]] name = "cc" version = "1.0.73" @@ -643,6 +817,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + [[package]] name = "crypto-common" version = "0.1.3" @@ -663,6 +843,37 @@ dependencies = [ "syn", ] +[[package]] +name = "curl" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "509bd11746c7ac09ebd19f0b17782eae80aadee26237658a6b4808afb5c11a22" +dependencies = [ + "curl-sys", + "libc", + "openssl-probe", + "openssl-sys", + "schannel", + "socket2", + "winapi", +] + +[[package]] +name = "curl-sys" +version = "0.4.59+curl-7.86.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cfce34829f448b08f55b7db6d0009e23e2e86a34e8c2b366269bf5799b4a407" +dependencies = [ + "cc", + "libc", + "libnghttp2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", + "winapi", +] + [[package]] name = "darling" version = "0.14.2" @@ -710,25 +921,6 @@ dependencies = [ "parking_lot_core", ] -[[package]] -name = "deadpool" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "421fe0f90f2ab22016f32a9881be5134fdd71c65298917084b0c7477cbc3856e" -dependencies = [ - "async-trait", - "deadpool-runtime", - "num_cpus", - "retain_mut", - "tokio", -] - -[[package]] -name = "deadpool-runtime" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaa37046cc0f6c3cc6090fbdbf73ef0b8ef4cfcc37f6befc0020f63e8cf121e1" - [[package]] name = "deunicode" version = "0.4.3" @@ -778,6 +970,16 @@ dependencies = [ "dirs-sys", ] +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + [[package]] name = "dirs-sys" version = "0.3.7" @@ -789,6 +991,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + [[package]] name = "doc-comment" version = "0.3.3" @@ -825,6 +1038,15 @@ version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +[[package]] +name = "ena" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7402b94a93c24e742487327a7cd839dc9d36fec9de9fb25b09f2dae459f36c3" +dependencies = [ + "log", +] + [[package]] name = "encode_unicode" version = "0.3.6" @@ -886,7 +1108,7 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d68f517805463f3a896a9d29c1d6ff09d3579ded64a7201b4069f8f9c0d52fd" dependencies = [ - "rand 0.8.5", + "rand", ] [[package]] @@ -1075,12 +1297,6 @@ version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" -[[package]] -name = "futures-timer" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" - [[package]] name = "futures-util" version = "0.3.25" @@ -1109,17 +1325,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - [[package]] name = "getrandom" version = "0.2.7" @@ -1155,6 +1360,18 @@ dependencies = [ "walkdir", ] +[[package]] +name = "gloo-timers" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98c4a8d6391675c6b2ee1a6c8d06e8e2d03605c44cec1270675985a4c2a5500b" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + [[package]] name = "h2" version = "0.3.13" @@ -1247,27 +1464,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "http-types" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e9b187a72d63adbfba487f48095306ac823049cb504ee195541e91c7775f5ad" -dependencies = [ - "anyhow", - "async-channel", - "base64", - "futures-lite", - "http", - "infer", - "pin-project-lite", - "rand 0.7.3", - "serde", - "serde_json", - "serde_qs", - "serde_urlencoded", - "url", -] - [[package]] name = "httparse" version = "1.8.0" @@ -1280,6 +1476,34 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +[[package]] +name = "httpmock" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6b56b6265f15908780cbee987912c1e98dbca675361f748291605a8a3a1df09" +dependencies = [ + "assert-json-diff", + "async-object-pool", + "async-trait", + "base64", + "basic-cookies", + "crossbeam-utils", + "form_urlencoded", + "futures-util", + "hyper", + "isahc", + "lazy_static", + "levenshtein", + "log", + "regex", + "serde", + "serde_json", + "serde_regex", + "similar", + "tokio", + "url", +] + [[package]] name = "humansize" version = "1.1.1" @@ -1421,12 +1645,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "infer" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e9829a50b42bb782c1df523f78d332fe371b10c661e78b7a3c34b0198e9fac" - [[package]] name = "insta" version = "1.26.0" @@ -1483,6 +1701,33 @@ dependencies = [ "windows-sys 0.42.0", ] +[[package]] +name = "isahc" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "334e04b4d781f436dc315cb1e7515bd96826426345d498149e4bde36b67f8ee9" +dependencies = [ + "async-channel", + "castaway", + "crossbeam-utils", + "curl", + "curl-sys", + "encoding_rs", + "event-listener", + "futures-lite", + "http", + "log", + "mime", + "once_cell", + "polling", + "slab", + "sluice", + "tracing", + "tracing-futures", + "url", + "waker-fn", +] + [[package]] name = "itertools" version = "0.10.5" @@ -1528,6 +1773,47 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41ee439ee368ba4a77ac70d04f14015415af8600d6c894dc1f11bd79758c57d5" +[[package]] +name = "kv-log-macro" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +dependencies = [ + "log", +] + +[[package]] +name = "lalrpop" +version = "0.19.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b30455341b0e18f276fa64540aff54deafb54c589de6aca68659c63dd2d5d823" +dependencies = [ + "ascii-canvas", + "atty", + "bit-set", + "diff", + "ena", + "itertools", + "lalrpop-util", + "petgraph", + "pico-args", + "regex", + "regex-syntax", + "string_cache", + "term", + "tiny-keccak", + "unicode-xid", +] + +[[package]] +name = "lalrpop-util" +version = "0.19.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcf796c978e9b4d983414f4caedc9273aa33ee214c5b887bd55fde84c85d2dc4" +dependencies = [ + "regex", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -1575,6 +1861,12 @@ dependencies = [ "serde", ] +[[package]] +name = "levenshtein" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760" + [[package]] name = "libc" version = "0.2.133" @@ -1591,6 +1883,28 @@ dependencies = [ "libc", ] +[[package]] +name = "libnghttp2-sys" +version = "0.1.7+1.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57ed28aba195b38d5ff02b9170cbff627e336a20925e43b4945390401c5dc93f" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "libz-sys" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "linked-hash-map" version = "0.5.6" @@ -1626,6 +1940,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ "cfg-if", + "value-bag", ] [[package]] @@ -1785,7 +2100,7 @@ dependencies = [ "moon_logger", "moon_test_utils", "moon_utils", - "rand 0.8.5", + "rand", "rustc-hash", "tar", "thiserror", @@ -1823,6 +2138,7 @@ dependencies = [ "clap_lex 0.3.0", "console", "dialoguer", + "httpmock", "indicatif", "itertools", "lazy_static", @@ -1869,7 +2185,6 @@ dependencies = [ "tera", "tiny_http", "tokio", - "wiremock", ] [[package]] @@ -1877,6 +2192,7 @@ name = "moon_config" version = "0.1.0" dependencies = [ "figment", + "httpmock", "moon_constants", "moon_error", "moon_test_utils", @@ -2440,6 +2756,12 @@ dependencies = [ "tempfile", ] +[[package]] +name = "new_debug_unreachable" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" + [[package]] name = "nom" version = "7.1.1" @@ -2656,7 +2978,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" dependencies = [ "base64ct", - "rand_core 0.6.3", + "rand_core", "subtle", ] @@ -2766,7 +3088,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" dependencies = [ "phf_shared", - "rand 0.8.5", + "rand", ] [[package]] @@ -2779,6 +3101,32 @@ dependencies = [ "uncased", ] +[[package]] +name = "pico-args" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db8bcd96cb740d03149cbad5518db9fd87126a10ab519c011893b1754134c468" + +[[package]] +name = "pin-project" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "pin-project-lite" version = "0.2.9" @@ -2825,6 +3173,20 @@ dependencies = [ "plotters-backend", ] +[[package]] +name = "polling" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22122d5ec4f9fe1b3916419b76be1e80bcb93f618d071d2edf841b137b2a2bd6" +dependencies = [ + "autocfg", + "cfg-if", + "libc", + "log", + "wepoll-ffi", + "windows-sys 0.42.0", +] + [[package]] name = "pori" version = "0.0.0" @@ -2846,6 +3208,12 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + [[package]] name = "predicates" version = "2.1.5" @@ -2988,19 +3356,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - [[package]] name = "rand" version = "0.8.5" @@ -3008,18 +3363,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.3", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", + "rand_chacha", + "rand_core", ] [[package]] @@ -3029,16 +3374,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", + "rand_core", ] [[package]] @@ -3047,16 +3383,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ - "getrandom 0.2.7", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", + "getrandom", ] [[package]] @@ -3098,7 +3425,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.7", + "getrandom", "redox_syscall", "thiserror", ] @@ -3174,12 +3501,6 @@ dependencies = [ "winreg", ] -[[package]] -name = "retain_mut" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" - [[package]] name = "rustc-hash" version = "1.1.0" @@ -3361,14 +3682,13 @@ dependencies = [ ] [[package]] -name = "serde_qs" -version = "0.8.5" +name = "serde_regex" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7715380eec75f029a4ef7de39a9200e0a63823176b759d055b613f5a87df6a6" +checksum = "a8136f1a4ea815d7eac4101cfd0b16dc0cb5e1fe1b8609dfd728058656b7badf" dependencies = [ - "percent-encoding", + "regex", "serde", - "thiserror", ] [[package]] @@ -3449,6 +3769,16 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" +[[package]] +name = "signal-hook" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a253b5e89e2698464fc26b545c9edceb338e18a89effeeecfea192c3025be29d" +dependencies = [ + "libc", + "signal-hook-registry", +] + [[package]] name = "signal-hook-registry" version = "1.4.0" @@ -3460,9 +3790,9 @@ dependencies = [ [[package]] name = "similar" -version = "2.1.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e24979f63a11545f5f2c60141afe249d4f19f84581ea2138065e400941d83d3" +checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" [[package]] name = "siphasher" @@ -3485,6 +3815,17 @@ dependencies = [ "deunicode", ] +[[package]] +name = "sluice" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d7400c0eff44aa2fcb5e31a5f24ba9716ed90138769e4977a2ba6014ae63eb5" +dependencies = [ + "async-channel", + "futures-core", + "futures-io", +] + [[package]] name = "smallvec" version = "1.10.0" @@ -3501,6 +3842,19 @@ dependencies = [ "winapi", ] +[[package]] +name = "string_cache" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213494b7a2b503146286049378ce02b482200519accc31872ee8be91fa820a08" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot", + "phf_shared", + "precomputed-hash", +] + [[package]] name = "strsim" version = "0.10.0" @@ -3585,7 +3939,7 @@ dependencies = [ "percent-encoding", "pest", "pest_derive", - "rand 0.8.5", + "rand", "regex", "serde", "serde_json", @@ -3593,6 +3947,17 @@ dependencies = [ "unic-segment", ] +[[package]] +name = "term" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] + [[package]] name = "termcolor" version = "1.1.3" @@ -3682,6 +4047,15 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "tiny_http" version = "0.12.0" @@ -3797,10 +4171,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" dependencies = [ "cfg-if", + "log", "pin-project-lite", + "tracing-attributes", "tracing-core", ] +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tracing-core" version = "0.1.28" @@ -3810,6 +4197,16 @@ dependencies = [ "once_cell", ] +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + [[package]] name = "try-lock" version = "0.2.3" @@ -3950,7 +4347,6 @@ dependencies = [ "form_urlencoded", "idna 0.3.0", "percent-encoding", - "serde", ] [[package]] @@ -3959,7 +4355,7 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "422ee0de9031b5b948b97a8fc04e3aa35230001a722ddd27943e0be31564ce4c" dependencies = [ - "getrandom 0.2.7", + "getrandom", ] [[package]] @@ -4004,6 +4400,16 @@ dependencies = [ "syn", ] +[[package]] +name = "value-bag" +version = "1.0.0-alpha.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55" +dependencies = [ + "ctor", + "version_check", +] + [[package]] name = "vcpkg" version = "0.2.15" @@ -4052,12 +4458,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - [[package]] name = "wasi" version = "0.10.0+wasi-snapshot-preview1" @@ -4164,6 +4564,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "wepoll-ffi" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" +dependencies = [ + "cc", +] + [[package]] name = "winapi" version = "0.3.9" @@ -4304,28 +4713,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "wiremock" -version = "0.5.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12316b50eb725e22b2f6b9c4cbede5b7b89984274d113a7440c86e5c3fc6f99b" -dependencies = [ - "assert-json-diff", - "async-trait", - "base64", - "deadpool", - "futures", - "futures-timer", - "http-types", - "hyper", - "log", - "once_cell", - "regex", - "serde", - "serde_json", - "tokio", -] - [[package]] name = "xattr" version = "0.2.3" diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 901c30b271f..feafa25a11d 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -65,5 +65,5 @@ moon_archive = { path = "../core/archive" } moon_cache = { path = "../core/cache" } moon_notifier = { path = "../core/notifier" } moon_test_utils = { path = "../core/test-utils" } +httpmock = "0.6.7" serial_test = "0.10.0" -wiremock = "0.5.17" diff --git a/crates/cli/src/commands/init/mod.rs b/crates/cli/src/commands/init/mod.rs index e962fb309c9..6497859cafa 100644 --- a/crates/cli/src/commands/init/mod.rs +++ b/crates/cli/src/commands/init/mod.rs @@ -6,12 +6,10 @@ use clap::ValueEnum; use dialoguer::theme::ColorfulTheme; use dialoguer::Confirm; use moon_config::{ - load_global_project_config_template, load_toolchain_config_template, - load_workspace_config_template, + load_tasks_config_template, load_toolchain_config_template, load_workspace_config_template, }; use moon_constants::{ - CONFIG_DIRNAME, CONFIG_GLOBAL_PROJECT_FILENAME, CONFIG_TOOLCHAIN_FILENAME, - CONFIG_WORKSPACE_FILENAME, + CONFIG_DIRNAME, CONFIG_TASKS_FILENAME, CONFIG_TOOLCHAIN_FILENAME, CONFIG_WORKSPACE_FILENAME, }; use moon_logger::color; use moon_node_lang::NPM; @@ -199,8 +197,8 @@ pub async fn init( if !options.minimal { fs::write( - moon_dir.join(CONFIG_GLOBAL_PROJECT_FILENAME), - Tera::one_off(load_global_project_config_template(), &context, false)?, + moon_dir.join(CONFIG_TASKS_FILENAME), + Tera::one_off(load_tasks_config_template(), &context, false)?, )?; } diff --git a/crates/cli/src/commands/migrate/from_turborepo.rs b/crates/cli/src/commands/migrate/from_turborepo.rs index 5b55c672eef..236bc53772b 100644 --- a/crates/cli/src/commands/migrate/from_turborepo.rs +++ b/crates/cli/src/commands/migrate/from_turborepo.rs @@ -164,7 +164,7 @@ pub async fn from_turborepo(skip_touched_files_check: &bool) -> Result<(), AnyEr // Convert tasks second let mut has_warned_root_tasks = false; - let mut has_modified_global_project = false; + let mut has_modified_global_tasks = false; let mut modified_projects: FxHashMap<&PathBuf, ProjectConfig> = FxHashMap::default(); for (id, task) in turbo_json.pipeline { @@ -193,21 +193,21 @@ pub async fn from_turborepo(skip_touched_files_check: &bool) -> Result<(), AnyEr } (None, task_id) => { workspace - .projects_config + .tasks_config .tasks .insert(task_id.clone(), convert_task(task_id, task)); - has_modified_global_project = true; + has_modified_global_tasks = true; } } } - if has_modified_global_project { + if has_modified_global_tasks { yaml::write_with_config( workspace .root .join(constants::CONFIG_DIRNAME) - .join(constants::CONFIG_GLOBAL_PROJECT_FILENAME), - &workspace.projects_config, + .join(constants::CONFIG_TASKS_FILENAME), + &workspace.tasks_config, )?; } diff --git a/crates/cli/tests/bin_test.rs b/crates/cli/tests/bin_test.rs index c13a3599e7c..02cb7457adc 100644 --- a/crates/cli/tests/bin_test.rs +++ b/crates/cli/tests/bin_test.rs @@ -16,12 +16,12 @@ use moon_test_utils::{ #[test] fn invalid_tool() { - let (workspace_config, toolchain_config, projects_config) = get_cases_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_cases_fixture_configs(); let sandbox = create_sandbox_with_config( "cases", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -39,12 +39,12 @@ fn invalid_tool() { #[test] fn not_configured() { - let (workspace_config, toolchain_config, projects_config) = get_cases_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_cases_fixture_configs(); let sandbox = create_sandbox_with_config( "cases", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { diff --git a/crates/cli/tests/check_test.rs b/crates/cli/tests/check_test.rs index 53083d13ded..7c4ffcda692 100644 --- a/crates/cli/tests/check_test.rs +++ b/crates/cli/tests/check_test.rs @@ -3,13 +3,13 @@ use moon_test_utils::{ }; fn cases_sandbox() -> Sandbox { - let (workspace_config, toolchain_config, projects_config) = get_cases_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_cases_fixture_configs(); create_sandbox_with_config( "cases", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ) } diff --git a/crates/cli/tests/dep_graph_test.rs b/crates/cli/tests/dep_graph_test.rs index 5c0cfb390ce..e77ef5fc958 100644 --- a/crates/cli/tests/dep_graph_test.rs +++ b/crates/cli/tests/dep_graph_test.rs @@ -5,13 +5,13 @@ use moon_test_utils::{ #[test] fn all_by_default() { - let (workspace_config, toolchain_config, projects_config) = get_tasks_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_tasks_fixture_configs(); let sandbox = create_sandbox_with_config( "tasks", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -26,13 +26,13 @@ fn all_by_default() { #[test] fn focused_by_target() { - let (workspace_config, toolchain_config, projects_config) = get_tasks_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_tasks_fixture_configs(); let sandbox = create_sandbox_with_config( "tasks", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -44,13 +44,13 @@ fn focused_by_target() { #[test] fn includes_dependencies_when_focused() { - let (workspace_config, toolchain_config, projects_config) = get_tasks_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_tasks_fixture_configs(); let sandbox = create_sandbox_with_config( "tasks", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -62,13 +62,13 @@ fn includes_dependencies_when_focused() { #[test] fn includes_dependents_when_focused() { - let (workspace_config, toolchain_config, projects_config) = get_tasks_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_tasks_fixture_configs(); let sandbox = create_sandbox_with_config( "tasks", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -80,13 +80,13 @@ fn includes_dependents_when_focused() { #[test] fn outputs_json() { - let (workspace_config, toolchain_config, projects_config) = get_tasks_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_tasks_fixture_configs(); let sandbox = create_sandbox_with_config( "tasks", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -101,14 +101,14 @@ mod aliases { #[test] fn can_focus_using_an_alias() { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_project_graph_aliases_fixture_configs(); let sandbox = create_sandbox_with_config( "project-graph/aliases", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -120,14 +120,14 @@ mod aliases { #[test] fn resolves_aliases_in_task_deps() { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_project_graph_aliases_fixture_configs(); let sandbox = create_sandbox_with_config( "project-graph/aliases", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { diff --git a/crates/cli/tests/docker_test.rs b/crates/cli/tests/docker_test.rs index 850d91928b0..d8932ff68f1 100644 --- a/crates/cli/tests/docker_test.rs +++ b/crates/cli/tests/docker_test.rs @@ -23,13 +23,13 @@ mod scaffold_workspace { #[test] fn copies_all_manifests() { - let (workspace_config, toolchain_config, projects_config) = get_node_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_node_fixture_configs(); let sandbox = create_sandbox_with_config( "node", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); sandbox.run_moon(|cmd| { @@ -46,13 +46,13 @@ mod scaffold_workspace { #[test] fn copies_moon_configs() { - let (workspace_config, toolchain_config, projects_config) = get_node_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_node_fixture_configs(); let sandbox = create_sandbox_with_config( "node", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); sandbox.run_moon(|cmd| { @@ -61,20 +61,20 @@ mod scaffold_workspace { let docker = sandbox.path().join(".moon/docker/workspace"); - assert!(docker.join(".moon/project.yml").exists()); + assert!(docker.join(".moon/tasks.yml").exists()); assert!(docker.join(".moon/toolchain.yml").exists()); assert!(docker.join(".moon/workspace.yml").exists()); } #[test] fn copies_node_postinstalls() { - let (workspace_config, toolchain_config, projects_config) = get_node_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_node_fixture_configs(); let sandbox = create_sandbox_with_config( "node", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); sandbox.run_moon(|cmd| { @@ -89,14 +89,14 @@ mod scaffold_workspace { #[test] fn copies_npm_files() { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_node_depman_fixture_configs("npm"); let sandbox = create_sandbox_with_config( "node-npm", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); sandbox.run_moon(|cmd| { @@ -110,14 +110,14 @@ mod scaffold_workspace { #[test] fn copies_pnpm_files() { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_node_depman_fixture_configs("pnpm"); let sandbox = create_sandbox_with_config( "node-pnpm", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); sandbox.run_moon(|cmd| { @@ -132,14 +132,14 @@ mod scaffold_workspace { #[test] fn copies_yarn_files() { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_node_depman_fixture_configs("yarn"); let sandbox = create_sandbox_with_config( "node-yarn", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); sandbox.run_moon(|cmd| { @@ -154,14 +154,14 @@ mod scaffold_workspace { #[test] fn copies_yarn1_files() { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_node_depman_fixture_configs("yarn1"); let sandbox = create_sandbox_with_config( "node-yarn1", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); sandbox.run_moon(|cmd| { @@ -179,13 +179,13 @@ mod scaffold_sources { #[test] fn copies_project_and_deps() { - let (workspace_config, toolchain_config, projects_config) = get_projects_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); let sandbox = create_sandbox_with_config( "projects", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); sandbox.run_moon(|cmd| { @@ -205,13 +205,13 @@ mod scaffold_sources { #[test] fn copies_multiple_projects() { - let (workspace_config, toolchain_config, projects_config) = get_projects_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); let sandbox = create_sandbox_with_config( "projects", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); sandbox.run_moon(|cmd| { @@ -230,13 +230,13 @@ mod scaffold_sources { #[test] fn can_include_more_files() { - let (workspace_config, toolchain_config, projects_config) = get_cases_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_cases_fixture_configs(); let sandbox = create_sandbox_with_config( "cases", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); sandbox.run_moon(|cmd| { @@ -266,13 +266,13 @@ mod prune { #[test] fn errors_missing_manifest() { - let (workspace_config, toolchain_config, projects_config) = get_node_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_node_fixture_configs(); let sandbox = create_sandbox_with_config( "node", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -291,14 +291,14 @@ mod prune_node { #[test] fn focuses_for_npm() { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_node_depman_fixture_configs("npm"); let sandbox = create_sandbox_with_config( "node-npm", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); write_manifest(sandbox.path(), "other"); @@ -323,14 +323,14 @@ mod prune_node { #[test] fn focuses_for_pnpm() { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_node_depman_fixture_configs("pnpm"); let sandbox = create_sandbox_with_config( "node-pnpm", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); write_manifest(sandbox.path(), "other"); @@ -353,14 +353,14 @@ mod prune_node { #[test] fn focuses_for_yarn() { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_node_depman_fixture_configs("yarn"); let sandbox = create_sandbox_with_config( "node-yarn", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); write_manifest(sandbox.path(), "other"); @@ -383,14 +383,14 @@ mod prune_node { #[test] fn focuses_for_yarn1() { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_node_depman_fixture_configs("yarn1"); let sandbox = create_sandbox_with_config( "node-yarn1", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); write_manifest(sandbox.path(), "other"); diff --git a/crates/cli/tests/init_test.rs b/crates/cli/tests/init_test.rs index 000b5e7b83a..5a29fab5af7 100644 --- a/crates/cli/tests/init_test.rs +++ b/crates/cli/tests/init_test.rs @@ -1,4 +1,4 @@ -use moon_constants::{CONFIG_GLOBAL_PROJECT_FILENAME, CONFIG_WORKSPACE_FILENAME}; +use moon_constants::{CONFIG_TASKS_FILENAME, CONFIG_WORKSPACE_FILENAME}; use moon_test_utils::{create_sandbox, predicates::prelude::*}; use std::fs; @@ -7,7 +7,7 @@ fn creates_files_in_dest() { let sandbox = create_sandbox("init-sandbox"); let root = sandbox.path().to_path_buf(); let workspace_config = root.join(".moon").join(CONFIG_WORKSPACE_FILENAME); - let project_config = root.join(".moon").join(CONFIG_GLOBAL_PROJECT_FILENAME); + let project_config = root.join(".moon").join(CONFIG_TASKS_FILENAME); let gitignore = root.join(".gitignore"); assert!(!workspace_config.exists()); @@ -31,7 +31,7 @@ fn creates_files_in_dest() { fn doesnt_create_project_config_when_minimal() { let sandbox = create_sandbox("init-sandbox"); let root = sandbox.path().to_path_buf(); - let project_config = root.join(".moon").join(CONFIG_GLOBAL_PROJECT_FILENAME); + let project_config = root.join(".moon").join(CONFIG_TASKS_FILENAME); assert!(!project_config.exists()); @@ -64,14 +64,14 @@ fn creates_project_config_from_template() { let root = sandbox.path().to_path_buf(); let project_config = root .join(".moon") - .join(moon_constants::CONFIG_GLOBAL_PROJECT_FILENAME); + .join(moon_constants::CONFIG_TASKS_FILENAME); sandbox.run_moon(|cmd| { cmd.arg("init").arg("--yes").arg(root); }); assert!( - predicate::str::contains("https://moonrepo.dev/schemas/global-project.json") + predicate::str::contains("https://moonrepo.dev/schemas/tasks.json") .eval(&fs::read_to_string(project_config).unwrap()) ); } diff --git a/crates/cli/tests/migrate_test.rs b/crates/cli/tests/migrate_test.rs index 81ef6a2556c..8169961999d 100644 --- a/crates/cli/tests/migrate_test.rs +++ b/crates/cli/tests/migrate_test.rs @@ -145,9 +145,7 @@ mod from_turborepo { config.runner.implicit_inputs, string_vec![ "package.json", - "/.moon/project.yml", - "/.moon/toolchain.yml", - "/.moon/workspace.yml", + "/.moon/*.yml", "package.json", "*.json", "$FOO", @@ -194,7 +192,7 @@ mod from_turborepo { assert.success(); - assert_snapshot!(fs::read_to_string(sandbox.path().join(".moon/project.yml")).unwrap()); + assert_snapshot!(fs::read_to_string(sandbox.path().join(".moon/tasks.yml")).unwrap()); } #[test] diff --git a/crates/cli/tests/node_test.rs b/crates/cli/tests/node_test.rs index c2b28c766f9..b2dee06fc4e 100644 --- a/crates/cli/tests/node_test.rs +++ b/crates/cli/tests/node_test.rs @@ -10,14 +10,14 @@ mod run_script { #[test] #[serial] fn errors_if_no_project() { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_node_depman_fixture_configs("npm"); let sandbox = create_sandbox_with_config( "node-npm", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -32,14 +32,14 @@ mod run_script { #[test] #[serial] fn errors_for_unknown_script() { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_node_depman_fixture_configs("npm"); let sandbox = create_sandbox_with_config( "node-npm", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -54,14 +54,14 @@ mod run_script { #[test] #[serial] fn runs_with_project_option() { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_node_depman_fixture_configs("npm"); let sandbox = create_sandbox_with_config( "node-npm", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -74,14 +74,14 @@ mod run_script { #[test] #[serial] fn runs_with_env_var() { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_node_depman_fixture_configs("npm"); let sandbox = create_sandbox_with_config( "node-npm", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -95,14 +95,14 @@ mod run_script { #[test] #[serial] fn works_with_pnpm() { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_node_depman_fixture_configs("pnpm"); let sandbox = create_sandbox_with_config( "node-pnpm", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -115,14 +115,14 @@ mod run_script { #[test] #[serial] fn works_with_yarn() { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_node_depman_fixture_configs("yarn"); let sandbox = create_sandbox_with_config( "node-yarn", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -135,14 +135,14 @@ mod run_script { #[test] #[serial] fn works_with_yarn1() { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_node_depman_fixture_configs("yarn1"); let sandbox = create_sandbox_with_config( "node-yarn1", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { diff --git a/crates/cli/tests/project_graph_test.rs b/crates/cli/tests/project_graph_test.rs index f48f46faa59..d8d2281ff78 100644 --- a/crates/cli/tests/project_graph_test.rs +++ b/crates/cli/tests/project_graph_test.rs @@ -16,13 +16,13 @@ fn no_projects() { #[test] fn many_projects() { - let (workspace_config, toolchain_config, projects_config) = get_projects_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); let sandbox = create_sandbox_with_config( "projects", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -34,13 +34,13 @@ fn many_projects() { #[test] fn single_project_with_dependencies() { - let (workspace_config, toolchain_config, projects_config) = get_projects_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); let sandbox = create_sandbox_with_config( "projects", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -52,13 +52,13 @@ fn single_project_with_dependencies() { #[test] fn single_project_no_dependencies() { - let (workspace_config, toolchain_config, projects_config) = get_projects_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); let sandbox = create_sandbox_with_config( "projects", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -70,13 +70,13 @@ fn single_project_no_dependencies() { #[test] fn outputs_json() { - let (workspace_config, toolchain_config, projects_config) = get_projects_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); let sandbox = create_sandbox_with_config( "projects", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -91,14 +91,14 @@ mod aliases { #[test] fn uses_ids_in_graph() { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_project_graph_aliases_fixture_configs(); let sandbox = create_sandbox_with_config( "project-graph/aliases", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -110,14 +110,14 @@ mod aliases { #[test] fn can_focus_using_an_alias() { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_project_graph_aliases_fixture_configs(); let sandbox = create_sandbox_with_config( "project-graph/aliases", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -129,14 +129,14 @@ mod aliases { #[test] fn resolves_aliases_in_depends_on() { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_project_graph_aliases_fixture_configs(); let sandbox = create_sandbox_with_config( "project-graph/aliases", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { diff --git a/crates/cli/tests/project_test.rs b/crates/cli/tests/project_test.rs index a1ffcff49bd..7d37c350ae6 100644 --- a/crates/cli/tests/project_test.rs +++ b/crates/cli/tests/project_test.rs @@ -5,13 +5,13 @@ use moon_test_utils::{ #[test] fn unknown_project() { - let (workspace_config, toolchain_config, projects_config) = get_projects_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); let sandbox = create_sandbox_with_config( "projects", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -25,13 +25,13 @@ fn unknown_project() { #[test] fn empty_config() { - let (workspace_config, toolchain_config, projects_config) = get_projects_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); let sandbox = create_sandbox_with_config( "projects", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -43,13 +43,13 @@ fn empty_config() { #[test] fn no_config() { - let (workspace_config, toolchain_config, projects_config) = get_projects_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); let sandbox = create_sandbox_with_config( "projects", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -62,13 +62,13 @@ fn no_config() { #[test] fn basic_config() { // with dependsOn and fileGroups - let (workspace_config, toolchain_config, projects_config) = get_projects_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); let sandbox = create_sandbox_with_config( "projects", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -81,13 +81,13 @@ fn basic_config() { #[test] fn advanced_config() { // with project metadata - let (workspace_config, toolchain_config, projects_config) = get_projects_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); let sandbox = create_sandbox_with_config( "projects", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -100,13 +100,13 @@ fn advanced_config() { #[test] fn depends_on_paths() { // shows dependsOn paths when they exist - let (workspace_config, toolchain_config, projects_config) = get_projects_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); let sandbox = create_sandbox_with_config( "projects", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -118,13 +118,13 @@ fn depends_on_paths() { #[test] fn with_tasks() { - let (workspace_config, toolchain_config, projects_config) = get_projects_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); let sandbox = create_sandbox_with_config( "projects", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -136,13 +136,13 @@ fn with_tasks() { #[test] fn root_level() { - let (workspace_config, toolchain_config, projects_config) = get_cases_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_cases_fixture_configs(); let sandbox = create_sandbox_with_config( "cases", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { diff --git a/crates/cli/tests/query_test.rs b/crates/cli/tests/query_test.rs index f5218e81ccd..f6ff62593f7 100644 --- a/crates/cli/tests/query_test.rs +++ b/crates/cli/tests/query_test.rs @@ -35,13 +35,13 @@ mod projects { #[test] fn returns_all_by_default() { - let (workspace_config, toolchain_config, projects_config) = get_projects_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); let sandbox = create_sandbox_with_config( "projects", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -71,13 +71,13 @@ mod projects { #[test] fn can_filter_by_affected() { - let (workspace_config, toolchain_config, projects_config) = get_projects_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); let sandbox = create_sandbox_with_config( "projects", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); sandbox.enable_git(); @@ -96,13 +96,13 @@ mod projects { #[test] fn can_filter_by_affected_via_stdin() { - let (workspace_config, toolchain_config, projects_config) = get_projects_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); let sandbox = create_sandbox_with_config( "projects", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); sandbox.enable_git(); @@ -132,13 +132,13 @@ mod projects { #[test] fn can_filter_by_id() { - let (workspace_config, toolchain_config, projects_config) = get_projects_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); let sandbox = create_sandbox_with_config( "projects", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -154,13 +154,13 @@ mod projects { #[test] fn can_filter_by_source() { - let (workspace_config, toolchain_config, projects_config) = get_projects_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); let sandbox = create_sandbox_with_config( "projects", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -178,13 +178,13 @@ mod projects { #[test] fn can_filter_by_tasks() { - let (workspace_config, toolchain_config, projects_config) = get_projects_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); let sandbox = create_sandbox_with_config( "projects", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -200,13 +200,13 @@ mod projects { #[test] fn can_filter_by_language() { - let (workspace_config, toolchain_config, projects_config) = get_projects_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); let sandbox = create_sandbox_with_config( "projects", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -224,13 +224,13 @@ mod projects { #[test] fn can_filter_by_type() { - let (workspace_config, toolchain_config, projects_config) = get_projects_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_projects_fixture_configs(); let sandbox = create_sandbox_with_config( "projects", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { @@ -250,13 +250,13 @@ mod touched_files { #[test] fn can_change_options() { - let (workspace_config, toolchain_config, projects_config) = get_cases_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_cases_fixture_configs(); let sandbox = create_sandbox_with_config( "cases", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); sandbox.enable_git(); @@ -278,13 +278,13 @@ mod touched_files { #[test] fn can_supply_multi_status() { - let (workspace_config, toolchain_config, projects_config) = get_cases_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_cases_fixture_configs(); let sandbox = create_sandbox_with_config( "cases", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); sandbox.enable_git(); diff --git a/crates/cli/tests/run_node_test.rs b/crates/cli/tests/run_node_test.rs index 9ab37ac4f67..cb5339dd03a 100644 --- a/crates/cli/tests/run_node_test.rs +++ b/crates/cli/tests/run_node_test.rs @@ -7,13 +7,13 @@ use moon_utils::string_vec; use std::fs::read_to_string; fn node_sandbox() -> Sandbox { - let (workspace_config, toolchain_config, projects_config) = get_node_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_node_fixture_configs(); let sandbox = create_sandbox_with_config( "node", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); sandbox.enable_git(); @@ -24,7 +24,7 @@ fn node_sandbox_with_config(callback: C) -> Sandbox where C: FnOnce(&mut NodeConfig), { - let (workspace_config, mut toolchain_config, projects_config) = get_node_fixture_configs(); + let (workspace_config, mut toolchain_config, tasks_config) = get_node_fixture_configs(); if let Some(node_config) = &mut toolchain_config.node { callback(node_config); @@ -34,7 +34,7 @@ where "node", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); sandbox.enable_git(); @@ -42,14 +42,14 @@ where } fn depman_sandbox(depman: &str) -> Sandbox { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_node_depman_fixture_configs(depman); let sandbox = create_sandbox_with_config( format!("node-{}", depman), Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); sandbox.enable_git(); @@ -60,8 +60,7 @@ fn typescript_sandbox(callback: C) -> Sandbox where C: FnOnce(&mut TypeScriptConfig), { - let (workspace_config, mut toolchain_config, projects_config) = - get_typescript_fixture_configs(); + let (workspace_config, mut toolchain_config, tasks_config) = get_typescript_fixture_configs(); if let Some(ts_config) = &mut toolchain_config.typescript { callback(ts_config); @@ -71,7 +70,7 @@ where "typescript", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); sandbox.enable_git(); @@ -412,14 +411,13 @@ mod install_deps { #[test] fn installs_deps_into_each_project_when_not_using_workspaces() { - let (workspace_config, toolchain_config, projects_config) = - get_typescript_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_typescript_fixture_configs(); let sandbox = create_sandbox_with_config( "node-non-workspaces", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); sandbox.enable_git(); @@ -997,14 +995,14 @@ mod aliases { #[test] fn runs_via_package_name() { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_project_graph_aliases_fixture_configs(); let sandbox = create_sandbox_with_config( "project-graph/aliases", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let assert = sandbox.run_moon(|cmd| { diff --git a/crates/cli/tests/run_test.rs b/crates/cli/tests/run_test.rs index 90c153719ac..cb55845b447 100644 --- a/crates/cli/tests/run_test.rs +++ b/crates/cli/tests/run_test.rs @@ -9,13 +9,13 @@ use std::fs; use std::path::Path; fn cases_sandbox() -> Sandbox { - let (workspace_config, toolchain_config, projects_config) = get_cases_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_cases_fixture_configs(); create_sandbox_with_config( "cases", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ) } @@ -23,7 +23,7 @@ fn cases_sandbox_with_config(callback: C) -> Sandbox where C: FnOnce(&mut WorkspaceConfig), { - let (mut workspace_config, toolchain_config, projects_config) = get_cases_fixture_configs(); + let (mut workspace_config, toolchain_config, tasks_config) = get_cases_fixture_configs(); callback(&mut workspace_config); @@ -31,7 +31,7 @@ where "cases", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ) } @@ -148,10 +148,10 @@ mod configs { } #[test] - fn bubbles_up_invalid_global_project_config() { + fn bubbles_up_invalid_tasks_config() { let sandbox = cases_sandbox(); - sandbox.create_file(".moon/project.yml", "tasks: 123"); + sandbox.create_file(".moon/tasks.yml", "tasks: 123"); let assert = sandbox.run_moon(|cmd| { cmd.arg("run").arg("base:noop"); diff --git a/crates/cli/tests/run_webhooks_test.rs b/crates/cli/tests/run_webhooks_test.rs index a478d911d8a..1cefa8c261c 100644 --- a/crates/cli/tests/run_webhooks_test.rs +++ b/crates/cli/tests/run_webhooks_test.rs @@ -1,11 +1,9 @@ +use httpmock::prelude::*; use moon_config::NotifierConfig; -use moon_notifier::WebhookPayload; use moon_test_utils::{create_sandbox_with_config, get_node_fixture_configs, Sandbox}; -use wiremock::matchers::{method, path}; -use wiremock::{Mock, MockServer, ResponseTemplate}; fn sandbox(uri: String) -> Sandbox { - let (mut workspace_config, toolchain_config, projects_config) = get_node_fixture_configs(); + let (mut workspace_config, toolchain_config, tasks_config) = get_node_fixture_configs(); workspace_config.notifier = NotifierConfig { webhook_url: Some(format!("{}/webhook", uri)), @@ -15,7 +13,7 @@ fn sandbox(uri: String) -> Sandbox { "node", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); sandbox.enable_git(); @@ -24,36 +22,34 @@ fn sandbox(uri: String) -> Sandbox { #[tokio::test] async fn sends_webhooks() { - let server = MockServer::start().await; + let server = MockServer::start(); - Mock::given(method("POST")) - .and(path("/webhook")) - .respond_with(ResponseTemplate::new(200)) - .expect(19) - .mount(&server) - .await; + let mock = server.mock(|when, then| { + when.method(POST).path("/webhook"); + then.status(200); + }); - let sandbox = sandbox(server.uri()); + let sandbox = sandbox(server.url("")); let assert = sandbox.run_moon(|cmd| { cmd.arg("run").arg("node:cjs"); }); + mock.assert_hits(19); + assert.success(); } #[tokio::test] async fn sends_webhooks_for_cache_events() { - let server = MockServer::start().await; + let server = MockServer::start(); - Mock::given(method("POST")) - .and(path("/webhook")) - .respond_with(ResponseTemplate::new(200)) - .expect(37) - .mount(&server) - .await; + let mock = server.mock(|when, then| { + when.method(POST).path("/webhook"); + then.status(200); + }); - let sandbox = sandbox(server.uri()); + let sandbox = sandbox(server.url("")); sandbox.run_moon(|cmd| { cmd.arg("run").arg("node:cjs"); @@ -64,54 +60,46 @@ async fn sends_webhooks_for_cache_events() { cmd.arg("run").arg("node:cjs"); }); + mock.assert_hits(37); + assert.success(); } #[tokio::test] async fn doesnt_send_webhooks_if_first_fails() { - let server = MockServer::start().await; + let server = MockServer::start(); - Mock::given(method("POST")) - .and(path("/webhook")) - .respond_with(ResponseTemplate::new(500)) - .expect(1) - .mount(&server) - .await; + let mock = server.mock(|when, then| { + when.method(POST).path("/webhook"); + then.status(500); + }); - let sandbox = sandbox(server.uri()); + let sandbox = sandbox(server.url("")); sandbox.run_moon(|cmd| { cmd.arg("run").arg("node:cjs"); }); + + mock.assert_hits(1); } #[tokio::test] async fn all_webhooks_have_same_uuid() { - let server = MockServer::start().await; + let server = MockServer::start(); + + let mock = server.mock(|when, then| { + when.method(POST) + .path("/webhook") + .json_body_partial(r#"{"uuid":"XXXX-XXXX-XXXX-XXXX"}"#); - Mock::given(method("POST")) - .and(path("/webhook")) - .respond_with(ResponseTemplate::new(200)) - .mount(&server) - .await; + then.status(200); + }); - let sandbox = sandbox(server.uri()); + let sandbox = sandbox(server.url("")); sandbox.run_moon(|cmd| { cmd.arg("run").arg("node:cjs"); }); - let received_requests = server.received_requests().await.unwrap(); - let mut uuid = None; - - for request in received_requests { - let payload: WebhookPayload = - serde_json::from_str(&String::from_utf8(request.body).unwrap()).unwrap(); - - if uuid.is_none() { - uuid = Some(payload.uuid); - } else { - assert_eq!(&payload.uuid, uuid.as_ref().unwrap()); - } - } + mock.assert_hits(19); } diff --git a/crates/cli/tests/setup_teardown_test.rs b/crates/cli/tests/setup_teardown_test.rs index 2e6a8c7af24..c2c0af9ce40 100644 --- a/crates/cli/tests/setup_teardown_test.rs +++ b/crates/cli/tests/setup_teardown_test.rs @@ -17,13 +17,13 @@ fn sets_up_and_tears_down() { assert!(!node_dir.exists()); - let (workspace_config, toolchain_config, projects_config) = get_cases_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_cases_fixture_configs(); let sandbox = create_sandbox_with_config( "cases", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let setup = sandbox.run_moon(|cmd| { diff --git a/crates/cli/tests/snapshots/migrate_test__from_turborepo__converts_global_tasks.snap b/crates/cli/tests/snapshots/migrate_test__from_turborepo__converts_global_tasks.snap index b1626fb48f8..cb093f408ad 100644 --- a/crates/cli/tests/snapshots/migrate_test__from_turborepo__converts_global_tasks.snap +++ b/crates/cli/tests/snapshots/migrate_test__from_turborepo__converts_global_tasks.snap @@ -1,6 +1,6 @@ --- source: crates/cli/tests/migrate_test.rs -expression: "fs::read_to_string(sandbox.path().join(\".moon/project.yml\")).unwrap()" +expression: "fs::read_to_string(sandbox.path().join(\".moon/tasks.yml\")).unwrap()" --- tasks: build: diff --git a/crates/cli/tests/snapshots/misc_test__fails_on_version_constraint.snap b/crates/cli/tests/snapshots/misc_test__fails_on_version_constraint.snap new file mode 100644 index 00000000000..3f7b7a40885 --- /dev/null +++ b/crates/cli/tests/snapshots/misc_test__fails_on_version_constraint.snap @@ -0,0 +1,11 @@ +--- +source: crates/cli/tests/misc_test.rs +expression: assert.output() +--- + + ERROR + +Invalid moon version, unable to proceed. Found 0.22.0, expected >=1000.0.0. + + + diff --git a/crates/cli/tests/snapshots/run_test__configs__bubbles_up_invalid_global_project_config.snap b/crates/cli/tests/snapshots/run_test__configs__bubbles_up_invalid_global_project_config.snap index 42690871ee9..469b6c56c6a 100644 --- a/crates/cli/tests/snapshots/run_test__configs__bubbles_up_invalid_global_project_config.snap +++ b/crates/cli/tests/snapshots/run_test__configs__bubbles_up_invalid_global_project_config.snap @@ -4,11 +4,11 @@ assertion_line: 131 expression: "standardize_separators(get_path_safe_output(&assert,\n &PathBuf::from(\"./fake/path\")))" --- - ERROR + ERROR -Failed to validate .moon/project.yml configuration file. +Failed to validate .moon/tasks.yml configuration file. - â–ª invalid type: found unsigned int `123`, expected a map for key "globalProject.tasks" in .moon/project.yml YAML Extended file + â–ª invalid type: found unsigned int `123`, expected a map for key "tasks.tasks" in .moon/tasks.yml YAML Extended file diff --git a/crates/cli/tests/snapshots/run_test__configs__bubbles_up_invalid_tasks_config.snap b/crates/cli/tests/snapshots/run_test__configs__bubbles_up_invalid_tasks_config.snap new file mode 100644 index 00000000000..a67de1e9edd --- /dev/null +++ b/crates/cli/tests/snapshots/run_test__configs__bubbles_up_invalid_tasks_config.snap @@ -0,0 +1,13 @@ +--- +source: crates/cli/tests/run_test.rs +expression: assert.output_standardized() +--- + + ERROR + +Failed to validate .moon/tasks.yml configuration file. + + â–ª invalid type: found unsigned int `123`, expected a map for key "inheritedTasks.tasks" in .moon/tasks.yml YAML Extended file + + + diff --git a/crates/cli/tests/snapshots/run_test__dependencies__changes_primary_hash_if_deps_hash_changes.snap b/crates/cli/tests/snapshots/run_test__dependencies__changes_primary_hash_if_deps_hash_changes.snap index fac89d65cf3..79f764a7f9c 100644 --- a/crates/cli/tests/snapshots/run_test__dependencies__changes_primary_hash_if_deps_hash_changes.snap +++ b/crates/cli/tests/snapshots/run_test__dependencies__changes_primary_hash_if_deps_hash_changes.snap @@ -3,8 +3,8 @@ source: crates/cli/tests/run_test.rs expression: "[h1, h2, extract_hash_from_run(sandbox.path(), \"outputs:asDep\"),\n extract_hash_from_run(sandbox.path(), \"outputs:withDeps\")]" --- [ - "5f61896f43e0b676f285fde3abf2b6e7a475c5a826cdcc9482a96cc07341d425", - "58aaf7b50ee147e1bfb91e0226052fb3dc84de9af2bbcd8b3d39537648b7500e", - "745f35db4501d9ea16898b5b9dbc77762ae6e5497d97045608c19a1299784890", - "8f3b8ac6ab04a2702c07b062c43d1c9bca2a663b6ffb7fa43410a4fc84dfdfe0", + "2ce54baa95c2525be44a445c5f220f97804c896863fcccc380558cd3100ec65f", + "84c5ce1694fc9439a96726a4a27e85211f45f225399746e23e1b7456dabb2b15", + "f32ffc3423ec9025b0f1f0164da6af01303224ead628161c62434eab047ad15e", + "45e352b9de558381164cea5085204ff2fd919f34d11ae8c11ed20ed41b47f834", ] diff --git a/crates/cli/tests/snapshots/run_test__dependencies__generates_unique_hashes_for_each_target.snap b/crates/cli/tests/snapshots/run_test__dependencies__generates_unique_hashes_for_each_target.snap index e4d8085c7e3..fb3bc1894bb 100644 --- a/crates/cli/tests/snapshots/run_test__dependencies__generates_unique_hashes_for_each_target.snap +++ b/crates/cli/tests/snapshots/run_test__dependencies__generates_unique_hashes_for_each_target.snap @@ -3,6 +3,6 @@ source: crates/cli/tests/run_test.rs expression: "[extract_hash_from_run(sandbox.path(), \"outputs:asDep\"),\n extract_hash_from_run(sandbox.path(), \"outputs:withDeps\")]" --- [ - "5f61896f43e0b676f285fde3abf2b6e7a475c5a826cdcc9482a96cc07341d425", - "58aaf7b50ee147e1bfb91e0226052fb3dc84de9af2bbcd8b3d39537648b7500e", + "2ce54baa95c2525be44a445c5f220f97804c896863fcccc380558cd3100ec65f", + "84c5ce1694fc9439a96726a4a27e85211f45f225399746e23e1b7456dabb2b15", ] diff --git a/crates/cli/tests/snapshots/run_test__output_styles__hash.snap b/crates/cli/tests/snapshots/run_test__output_styles__hash.snap index 6a3e1385512..7399825f4ce 100644 --- a/crates/cli/tests/snapshots/run_test__output_styles__hash.snap +++ b/crates/cli/tests/snapshots/run_test__output_styles__hash.snap @@ -10,6 +10,6 @@ expression: assert.output() Tasks: 2 completed Time: 100ms -4e508044ecb686c44910b5ade5c9d075c1ad838f8854fbefcdca7e2bd0364cc5 +0a9d8fca7a43a9437bcd010ff9d41c02bbe31bb9acd9e00d6dcc11a31edbb7cf diff --git a/crates/core/action-pipeline/benches/pipeline_benchmark.rs b/crates/core/action-pipeline/benches/pipeline_benchmark.rs index a5528631a6b..76ed30e724e 100644 --- a/crates/core/action-pipeline/benches/pipeline_benchmark.rs +++ b/crates/core/action-pipeline/benches/pipeline_benchmark.rs @@ -34,13 +34,13 @@ fn generate_dep_graph(workspace: &Workspace, project_graph: &ProjectGraph) -> De } pub fn pipeline_benchmark(c: &mut Criterion) { - let (workspace_config, toolchain_config, projects_config) = get_cases_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_cases_fixture_configs(); let sandbox = create_sandbox_with_config( "cases", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); c.bench_function("pipeline", |b| { diff --git a/crates/core/config/Cargo.toml b/crates/core/config/Cargo.toml index 102b746fb70..caf14a0caf7 100644 --- a/crates/core/config/Cargo.toml +++ b/crates/core/config/Cargo.toml @@ -29,3 +29,4 @@ validator = { version = "0.16.0", features = ["derive"] } [dev-dependencies] moon_test_utils = { path = "../test-utils" } +httpmock = "0.6.7" diff --git a/crates/core/config/src/helpers.rs b/crates/core/config/src/helpers.rs index d3f593221c7..9211524cb83 100644 --- a/crates/core/config/src/helpers.rs +++ b/crates/core/config/src/helpers.rs @@ -49,7 +49,7 @@ pub fn gather_extended_sources>( } // For https, download the config and store it in the temp cache - if config.starts_with("https") { + if config.starts_with("https") || config.contains("127.0.0.1") { config_path = download_and_cache_config(&config)?; } else if config.starts_with("http") { return Err(ConfigError::UnsupportedHttps(config)); diff --git a/crates/core/config/src/lib.rs b/crates/core/config/src/lib.rs index 021d847ff46..baa552ff1ca 100644 --- a/crates/core/config/src/lib.rs +++ b/crates/core/config/src/lib.rs @@ -1,6 +1,7 @@ mod errors; mod helpers; mod project; +mod tasks; mod template; mod toolchain; mod types; @@ -12,6 +13,7 @@ pub use errors::{ }; pub use moon_constants::*; pub use project::*; +pub use tasks::*; pub use template::*; pub use toolchain::*; pub use types::*; @@ -34,14 +36,10 @@ pub fn load_toolchain_typescript_config_template() -> &'static str { include_str!("../templates/toolchain_typescript.yml") } -pub fn load_global_project_config_template() -> &'static str { - include_str!("../templates/global_project.yml") +pub fn load_tasks_config_template() -> &'static str { + include_str!("../templates/tasks.yml") } -// pub fn load_project_config_template() -> &'static str { -// include_str!("../templates/project.yml") -// } - pub fn load_template_config_template() -> &'static str { include_str!("../templates/template.yml") } diff --git a/crates/core/config/src/main.rs b/crates/core/config/src/main.rs index fdc3fa3a651..3daa1aeab93 100644 --- a/crates/core/config/src/main.rs +++ b/crates/core/config/src/main.rs @@ -1,6 +1,6 @@ use moon_config::{ - GlobalProjectConfig, ProjectConfig, TemplateConfig, TemplateFrontmatterConfig, ToolchainConfig, - WorkspaceConfig, + InheritedTasksConfig, ProjectConfig, TemplateConfig, TemplateFrontmatterConfig, + ToolchainConfig, WorkspaceConfig, }; use schemars::schema_for; use std::fs; @@ -8,7 +8,7 @@ use std::fs; fn main() { // Generate JSON schemas derived from our structs let project_schema = schema_for!(ProjectConfig); - let global_project_schema = schema_for!(GlobalProjectConfig); + let tasks_schema = schema_for!(InheritedTasksConfig); let template_schema = schema_for!(TemplateConfig); let template_frontmatter_schema = schema_for!(TemplateFrontmatterConfig); let toolchain_schema = schema_for!(ToolchainConfig); @@ -21,8 +21,8 @@ fn main() { .unwrap(); fs::write( - "website/static/schemas/global-project.json", - serde_json::to_string_pretty(&global_project_schema).unwrap(), + "website/static/schemas/tasks.json", + serde_json::to_string_pretty(&tasks_schema).unwrap(), ) .unwrap(); diff --git a/crates/core/config/src/project/mod.rs b/crates/core/config/src/project/mod.rs index be163ab367e..213ab30d395 100644 --- a/crates/core/config/src/project/mod.rs +++ b/crates/core/config/src/project/mod.rs @@ -1,5 +1,4 @@ mod dep; -mod global_config; mod language_platform; mod local_config; mod task; @@ -8,7 +7,6 @@ mod toolchain; mod workspace; pub use dep::*; -pub use global_config::*; pub use language_platform::*; pub use local_config::*; pub use task::*; diff --git a/crates/core/config/src/project/global_config.rs b/crates/core/config/src/tasks/config.rs similarity index 79% rename from crates/core/config/src/project/global_config.rs rename to crates/core/config/src/tasks/config.rs index 81ba9fa8114..c57d8c0ddd1 100644 --- a/crates/core/config/src/project/global_config.rs +++ b/crates/core/config/src/tasks/config.rs @@ -1,10 +1,10 @@ -// .moon/project.yml +// .moon/tasks.yml use crate::errors::{ create_validation_error, map_validation_errors_to_figment_errors, ConfigError, }; use crate::helpers::gather_extended_sources; -use crate::project::task::TaskConfig; +use crate::project::TaskConfig; use crate::types::FileGroups; use crate::validators::{is_default, validate_extends, validate_id}; use figment::{ @@ -42,12 +42,11 @@ fn validate_tasks(map: &BTreeMap) -> Result<(), ValidationEr Ok(()) } -/// Docs: https://moonrepo.dev/docs/config/global-project +/// Docs: https://moonrepo.dev/docs/config/tasks #[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize, Validate)] #[schemars(default)] -// We use serde(default) because extended configs may not have defined these fields #[serde(default, rename_all = "camelCase")] -pub struct GlobalProjectConfig { +pub struct InheritedTasksConfig { #[serde(skip_serializing_if = "Option::is_none")] #[validate(custom = "validate_extends")] pub extends: Option, @@ -66,14 +65,14 @@ pub struct GlobalProjectConfig { pub schema: String, } -impl GlobalProjectConfig { - pub fn load(path: PathBuf) -> Result { - let profile_name = "globalProject"; - let mut config = GlobalProjectConfig::default(); +impl InheritedTasksConfig { + pub fn load(path: PathBuf) -> Result { + let profile_name = "inheritedTasks"; + let mut config = InheritedTasksConfig::default(); for source in gather_extended_sources(path)? { let figment = Figment::from(YamlExtended::file(source).profile(profile_name)); - let extended_config = GlobalProjectConfig::load_config(figment.select(profile_name))?; + let extended_config = InheritedTasksConfig::load_config(figment.select(profile_name))?; // Figment does not merge hash maps but replaces entirely, // so we need to manually handle this here! @@ -89,8 +88,8 @@ impl GlobalProjectConfig { Ok(config) } - fn load_config(figment: Figment) -> Result { - let config: GlobalProjectConfig = figment.extract()?; + fn load_config(figment: Figment) -> Result { + let config: InheritedTasksConfig = figment.extract()?; if let Err(errors) = config.validate() { return Err(ConfigError::FailedValidation( diff --git a/crates/core/config/src/tasks/mod.rs b/crates/core/config/src/tasks/mod.rs new file mode 100644 index 00000000000..aa4926f4396 --- /dev/null +++ b/crates/core/config/src/tasks/mod.rs @@ -0,0 +1,3 @@ +mod config; + +pub use config::*; diff --git a/crates/core/config/src/validators.rs b/crates/core/config/src/validators.rs index da6fdbe1333..2062d5eaab8 100644 --- a/crates/core/config/src/validators.rs +++ b/crates/core/config/src/validators.rs @@ -141,7 +141,7 @@ pub fn validate_url, V: AsRef>( )); } - if https_only && !value.starts_with("https://") { + if https_only && !value.starts_with("https://") && !value.contains("127.0.0.1") { return Err(create_validation_error( "invalid_https_url", key, diff --git a/crates/core/config/src/workspace/runner.rs b/crates/core/config/src/workspace/runner.rs index b7106390dfc..f4f44f13277 100644 --- a/crates/core/config/src/workspace/runner.rs +++ b/crates/core/config/src/workspace/runner.rs @@ -78,9 +78,7 @@ impl Default for RunnerConfig { // When a project changes "package.json", // When root config changes - "/.moon/project.yml", - "/.moon/toolchain.yml", - "/.moon/workspace.yml", + "/.moon/*.yml", ], inherit_colors_for_piped_tasks: true, log_running_command: false, diff --git a/crates/core/config/templates/project.yml b/crates/core/config/templates/project.yml index 43b772abaf5..e922b847d85 100644 --- a/crates/core/config/templates/project.yml +++ b/crates/core/config/templates/project.yml @@ -37,9 +37,9 @@ project: dependsOn: [] # File groups are a mechanism for grouping similar types of files within -# a project using file glob patterns. View `.moon/project.yml` for more info. +# a project using file glob patterns. View `.moon/tasks.yml` for more info. fileGroups: {} # A task is an action that is ran within the context of a project, and -# wraps around an npm or system command. View `.moon/project.yml` for more info. +# wraps around an npm or system command. View `.moon/tasks.yml` for more info. tasks: {} diff --git a/crates/core/config/templates/global_project.yml b/crates/core/config/templates/tasks.yml similarity index 94% rename from crates/core/config/templates/global_project.yml rename to crates/core/config/templates/tasks.yml index e3911fc7ed3..52157490341 100644 --- a/crates/core/config/templates/global_project.yml +++ b/crates/core/config/templates/tasks.yml @@ -1,8 +1,8 @@ -# https://moonrepo.dev/docs/config/global-project -$schema: 'https://moonrepo.dev/schemas/global-project.json' +# https://moonrepo.dev/docs/config/tasks +$schema: 'https://moonrepo.dev/schemas/tasks.json' # Extend and inherit an external configuration file. Must be a valid HTTPS URL or file system path. -# extends: './shared/project.yml' +# extends: './shared/tasks.yml' # File groups are a mechanism for grouping similar types of files within a project # using file glob patterns. These groups are then used by tasks to calculate functionality like diff --git a/crates/core/config/tests/global_project_test.rs b/crates/core/config/tests/global_tasks_test.rs similarity index 82% rename from crates/core/config/tests/global_project_test.rs rename to crates/core/config/tests/global_tasks_test.rs index 9286cdf0ce9..36090fdd54b 100644 --- a/crates/core/config/tests/global_project_test.rs +++ b/crates/core/config/tests/global_tasks_test.rs @@ -1,13 +1,14 @@ -use moon_config::{ConfigError, GlobalProjectConfig, TaskCommandArgs}; -use moon_constants::CONFIG_GLOBAL_PROJECT_FILENAME; +use httpmock::prelude::*; +use moon_config::{ConfigError, InheritedTasksConfig, TaskCommandArgs}; +use moon_constants::CONFIG_TASKS_FILENAME; use moon_test_utils::get_fixtures_path; use moon_utils::string_vec; use rustc_hash::FxHashMap; use std::collections::BTreeMap; use std::path::Path; -fn load_jailed_config(root: &Path) -> Result { - match GlobalProjectConfig::load(root.join(CONFIG_GLOBAL_PROJECT_FILENAME)) { +fn load_jailed_config(root: &Path) -> Result { + match InheritedTasksConfig::load(root.join(CONFIG_TASKS_FILENAME)) { Ok(cfg) => Ok(cfg), Err(error) => Err(match error { ConfigError::FailedValidation(errors) => errors.first().unwrap().to_owned(), @@ -21,7 +22,7 @@ fn load_jailed_config(root: &Path) -> Result (Workspace, ProjectGraph, Sandbox) { }), ..ToolchainConfig::default() }; - let projects_config = GlobalProjectConfig { + let tasks_config = InheritedTasksConfig { file_groups: FxHashMap::from_iter([ ("sources".to_owned(), string_vec!["src/**/*", "types/**/*"]), ("tests".to_owned(), string_vec!["tests/**/*"]), ]), - ..GlobalProjectConfig::default() + ..InheritedTasksConfig::default() }; let sandbox = create_sandbox_with_config( "projects", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let mut workspace = load_workspace_from(sandbox.path()).await.unwrap(); @@ -87,16 +87,16 @@ async fn create_tasks_project_graph() -> (Workspace, ProjectGraph, Sandbox) { }), ..ToolchainConfig::default() }; - let projects_config = GlobalProjectConfig { + let tasks_config = InheritedTasksConfig { file_groups: FxHashMap::from_iter([("sources".to_owned(), vec!["src/**/*".to_owned()])]), - ..GlobalProjectConfig::default() + ..InheritedTasksConfig::default() }; let sandbox = create_sandbox_with_config( "tasks", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let mut workspace = load_workspace_from(sandbox.path()).await.unwrap(); diff --git a/crates/core/notifier/src/webhooks.rs b/crates/core/notifier/src/webhooks.rs index 1c6da76d3d9..e53800a0a4b 100644 --- a/crates/core/notifier/src/webhooks.rs +++ b/crates/core/notifier/src/webhooks.rs @@ -56,8 +56,12 @@ impl WebhooksSubscriber { enabled: true, environment: get_pipeline_environment(), requests: vec![], + uuid: if url.contains("127.0.0.1") { + "XXXX-XXXX-XXXX-XXXX".into() + } else { + Uuid::new_v4().to_string() + }, url, - uuid: Uuid::new_v4().to_string(), } } } diff --git a/crates/core/project-graph/benches/project_graph_benchmark.rs b/crates/core/project-graph/benches/project_graph_benchmark.rs index 9a69b4dd2d8..ab49bec554e 100644 --- a/crates/core/project-graph/benches/project_graph_benchmark.rs +++ b/crates/core/project-graph/benches/project_graph_benchmark.rs @@ -3,13 +3,13 @@ use moon::{generate_project_graph, load_workspace_from}; use moon_test_utils::{create_sandbox_with_config, get_cases_fixture_configs}; pub fn get_benchmark(c: &mut Criterion) { - let (workspace_config, toolchain_config, projects_config) = get_cases_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_cases_fixture_configs(); let sandbox = create_sandbox_with_config( "cases", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); c.bench_function("project_graph_get", |b| { @@ -26,13 +26,13 @@ pub fn get_benchmark(c: &mut Criterion) { } pub fn get_all_benchmark(c: &mut Criterion) { - let (workspace_config, toolchain_config, projects_config) = get_cases_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_cases_fixture_configs(); let sandbox = create_sandbox_with_config( "cases", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); c.bench_function("project_graph_get_all", |b| { diff --git a/crates/core/project-graph/src/project_builder.rs b/crates/core/project-graph/src/project_builder.rs index 24613269bf2..3dba62d8e0e 100644 --- a/crates/core/project-graph/src/project_builder.rs +++ b/crates/core/project-graph/src/project_builder.rs @@ -96,7 +96,7 @@ impl<'ws> ProjectGraphBuilder<'ws> { id, source, &self.workspace.root, - &self.workspace.projects_config, + &self.workspace.tasks_config, )?; // Collect all aliases for the current project ID diff --git a/crates/core/project-graph/tests/project_graph_test.rs b/crates/core/project-graph/tests/project_graph_test.rs index 5c87d226125..eae718c80a8 100644 --- a/crates/core/project-graph/tests/project_graph_test.rs +++ b/crates/core/project-graph/tests/project_graph_test.rs @@ -9,14 +9,14 @@ use moon_utils::string_vec; use rustc_hash::FxHashMap; async fn get_aliases_graph() -> (ProjectGraph, Sandbox) { - let (workspace_config, toolchain_config, projects_config) = + let (workspace_config, toolchain_config, tasks_config) = get_project_graph_aliases_fixture_configs(); let sandbox = create_sandbox_with_config( "project-graph/aliases", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let mut workspace = load_workspace_from(sandbox.path()).await.unwrap(); diff --git a/crates/core/project-graph/tests/projects_test.rs b/crates/core/project-graph/tests/projects_test.rs index d55c3ecee9d..b497eaec916 100644 --- a/crates/core/project-graph/tests/projects_test.rs +++ b/crates/core/project-graph/tests/projects_test.rs @@ -3,7 +3,7 @@ use moon::{generate_project_graph, load_workspace_from}; use moon_config::{ - GlobalProjectConfig, PlatformType, TaskCommandArgs, TaskConfig, TaskOptionsConfig, + InheritedTasksConfig, PlatformType, TaskCommandArgs, TaskConfig, TaskOptionsConfig, WorkspaceConfig, WorkspaceProjects, }; use moon_project::Project; @@ -21,7 +21,7 @@ async fn tasks_sandbox() -> (Sandbox, ProjectGraph) { async fn tasks_sandbox_with_config(callback: C) -> (Sandbox, ProjectGraph) where - C: FnOnce(&mut WorkspaceConfig, &mut GlobalProjectConfig), + C: FnOnce(&mut WorkspaceConfig, &mut InheritedTasksConfig), { tasks_sandbox_internal(callback, |_| {}).await } @@ -35,18 +35,18 @@ where async fn tasks_sandbox_internal(cfg_callback: C, box_callback: S) -> (Sandbox, ProjectGraph) where - C: FnOnce(&mut WorkspaceConfig, &mut GlobalProjectConfig), + C: FnOnce(&mut WorkspaceConfig, &mut InheritedTasksConfig), S: FnOnce(&Sandbox), { - let (mut workspace_config, toolchain_config, mut projects_config) = get_tasks_fixture_configs(); + let (mut workspace_config, toolchain_config, mut tasks_config) = get_tasks_fixture_configs(); - cfg_callback(&mut workspace_config, &mut projects_config); + cfg_callback(&mut workspace_config, &mut tasks_config); let sandbox = create_sandbox_with_config( "tasks", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); box_callback(&sandbox); @@ -178,8 +178,8 @@ mod task_inheritance { #[tokio::test] async fn replace() { - let (_sandbox, project_graph) = tasks_sandbox_with_config(|_, projects_config| { - projects_config + let (_sandbox, project_graph) = tasks_sandbox_with_config(|_, tasks_config| { + tasks_config .tasks .insert("standard".into(), stub_global_task_config()); }) @@ -193,21 +193,15 @@ mod task_inheritance { assert_eq!(task.env, FxHashMap::from_iter([("KEY".into(), "b".into())])); assert_eq!( task.inputs, - string_vec![ - "b.*", - "package.json", - "/.moon/project.yml", - "/.moon/toolchain.yml", - "/.moon/workspace.yml", - ] + string_vec!["b.*", "package.json", "/.moon/*.yml",] ); assert_eq!(task.outputs, string_vec!["b.ts"]); } #[tokio::test] async fn append() { - let (_sandbox, project_graph) = tasks_sandbox_with_config(|_, projects_config| { - projects_config + let (_sandbox, project_graph) = tasks_sandbox_with_config(|_, tasks_config| { + tasks_config .tasks .insert("standard".into(), stub_global_task_config()); }) @@ -227,22 +221,15 @@ mod task_inheritance { ); assert_eq!( task.inputs, - string_vec![ - "a.*", - "b.*", - "package.json", - "/.moon/project.yml", - "/.moon/toolchain.yml", - "/.moon/workspace.yml", - ] + string_vec!["a.*", "b.*", "package.json", "/.moon/*.yml",] ); assert_eq!(task.outputs, string_vec!["a.ts", "b.ts"]); } #[tokio::test] async fn prepend() { - let (_sandbox, project_graph) = tasks_sandbox_with_config(|_, projects_config| { - projects_config + let (_sandbox, project_graph) = tasks_sandbox_with_config(|_, tasks_config| { + tasks_config .tasks .insert("standard".into(), stub_global_task_config()); }) @@ -262,22 +249,15 @@ mod task_inheritance { ); assert_eq!( task.inputs, - string_vec![ - "b.*", - "a.*", - "package.json", - "/.moon/project.yml", - "/.moon/toolchain.yml", - "/.moon/workspace.yml", - ] + string_vec!["b.*", "a.*", "package.json", "/.moon/*.yml",] ); assert_eq!(task.outputs, string_vec!["b.ts", "a.ts"]); } #[tokio::test] async fn all() { - let (_sandbox, project_graph) = tasks_sandbox_with_config(|_, projects_config| { - projects_config + let (_sandbox, project_graph) = tasks_sandbox_with_config(|_, tasks_config| { + tasks_config .tasks .insert("standard".into(), stub_global_task_config()); }) @@ -294,13 +274,7 @@ mod task_inheritance { ); assert_eq!( task.inputs, - string_vec![ - "b.*", - "package.json", - "/.moon/project.yml", - "/.moon/toolchain.yml", - "/.moon/workspace.yml", - ] + string_vec!["b.*", "package.json", "/.moon/*.yml",] ); assert_eq!(task.outputs, string_vec!["a.ts", "b.ts"]); } @@ -316,7 +290,7 @@ mod task_inheritance { ..WorkspaceConfig::default() }; - let projects_config = GlobalProjectConfig { + let tasks_config = InheritedTasksConfig { tasks: BTreeMap::from_iter([ ( "a".to_owned(), @@ -343,14 +317,14 @@ mod task_inheritance { }, ), ]), - ..GlobalProjectConfig::default() + ..InheritedTasksConfig::default() }; let sandbox = create_sandbox_with_config( "task-inheritance", Some(&workspace_config), None, - Some(&projects_config), + Some(&tasks_config), ); let mut workspace = load_workspace_from(sandbox.path()).await.unwrap(); @@ -984,6 +958,7 @@ mod task_expansion { assert_eq!( task.input_globs, FxHashSet::from_iter([ + glob::normalize(sandbox.path().join(".moon/*.yml")).unwrap(), glob::normalize(project.root.join("**/*.{ts,tsx}")).unwrap(), glob::normalize(project.root.join("*.js")).unwrap() ]), @@ -993,9 +968,6 @@ mod task_expansion { FxHashSet::from_iter(task.input_paths.iter().map(PathBuf::from)); let b: FxHashSet = FxHashSet::from_iter( vec![ - sandbox.path().join(".moon/workspace.yml"), - sandbox.path().join(".moon/toolchain.yml"), - sandbox.path().join(".moon/project.yml"), sandbox.path().join("package.json"), project.root.join("package.json"), project.root.join("file.ts"), @@ -1095,7 +1067,7 @@ mod detection { ..WorkspaceConfig::default() }; - let projects_config = GlobalProjectConfig { + let tasks_config = InheritedTasksConfig { tasks: BTreeMap::from_iter([( "command".to_owned(), TaskConfig { @@ -1103,14 +1075,14 @@ mod detection { ..TaskConfig::default() }, )]), - ..GlobalProjectConfig::default() + ..InheritedTasksConfig::default() }; let sandbox = create_sandbox_with_config( "project-graph/langs", Some(&workspace_config), None, - Some(&projects_config), + Some(&tasks_config), ); let mut workspace = load_workspace_from(sandbox.path()).await.unwrap(); diff --git a/crates/core/project-graph/tests/token_resolver_test.rs b/crates/core/project-graph/tests/token_resolver_test.rs index 39ffe6fa975..d63cd942dd1 100644 --- a/crates/core/project-graph/tests/token_resolver_test.rs +++ b/crates/core/project-graph/tests/token_resolver_test.rs @@ -1,5 +1,5 @@ use moon_config::PlatformType; -use moon_config::{GlobalProjectConfig, ProjectLanguage, ProjectType, TaskConfig}; +use moon_config::{InheritedTasksConfig, ProjectLanguage, ProjectType, TaskConfig}; use moon_project::Project; use moon_project_graph::{TokenContext, TokenResolver}; use moon_target::Target; @@ -58,7 +58,7 @@ fn create_project(workspace_root: &Path) -> Project { "project", "files-and-dirs", workspace_root, - &GlobalProjectConfig::default(), + &InheritedTasksConfig::default(), ) .unwrap(); project.file_groups = create_file_groups(); diff --git a/crates/core/project/src/project.rs b/crates/core/project/src/project.rs index a12f2457379..722e10b6327 100644 --- a/crates/core/project/src/project.rs +++ b/crates/core/project/src/project.rs @@ -1,7 +1,7 @@ use crate::errors::ProjectError; use moon_config::{ format_error_line, format_figment_errors, ConfigError, DependencyConfig, DependencyScope, - FilePath, GlobalProjectConfig, ProjectConfig, ProjectDependsOn, ProjectID, ProjectLanguage, + FilePath, InheritedTasksConfig, ProjectConfig, ProjectDependsOn, ProjectID, ProjectLanguage, ProjectType, TaskID, }; use moon_constants::CONFIG_PROJECT_FILENAME; @@ -55,7 +55,7 @@ fn load_project_config( fn create_file_groups_from_config( log_target: &str, config: &ProjectConfig, - global_config: &GlobalProjectConfig, + global_config: &InheritedTasksConfig, ) -> FileGroupsMap { let mut file_groups = FxHashMap::::default(); @@ -124,7 +124,7 @@ fn create_tasks_from_config( log_target: &str, project_id: &str, project_config: &ProjectConfig, - global_config: &GlobalProjectConfig, + global_config: &InheritedTasksConfig, ) -> Result { let mut tasks = BTreeMap::::new(); @@ -327,7 +327,7 @@ impl Project { id: &str, source: &str, workspace_root: &Path, - global_config: &GlobalProjectConfig, + global_config: &InheritedTasksConfig, ) -> Result { let log_target = format!("moon:project:{}", id); diff --git a/crates/core/project/tests/project_test.rs b/crates/core/project/tests/project_test.rs index 4a91ab75c35..31b8d5e78b8 100644 --- a/crates/core/project/tests/project_test.rs +++ b/crates/core/project/tests/project_test.rs @@ -1,5 +1,5 @@ use moon_config::{ - GlobalProjectConfig, ProjectConfig, ProjectDependsOn, ProjectLanguage, ProjectMetadataConfig, + InheritedTasksConfig, ProjectConfig, ProjectDependsOn, ProjectLanguage, ProjectMetadataConfig, ProjectType, }; use moon_project::Project; @@ -16,8 +16,8 @@ fn mock_file_groups() -> FxHashMap { )]) } -fn mock_global_project_config() -> GlobalProjectConfig { - GlobalProjectConfig { +fn mock_tasks_config() -> InheritedTasksConfig { + InheritedTasksConfig { extends: None, file_groups: FxHashMap::from_iter([("sources".into(), string_vec!["src/**/*"])]), tasks: BTreeMap::new(), @@ -32,7 +32,7 @@ fn doesnt_exist() { "missing", "projects/missing", &get_fixtures_root(), - &mock_global_project_config(), + &mock_tasks_config(), ) .unwrap(); } @@ -44,7 +44,7 @@ fn no_config() { "no-config", "projects/no-config", &workspace_root, - &mock_global_project_config(), + &mock_tasks_config(), ) .unwrap(); @@ -68,7 +68,7 @@ fn empty_config() { "empty-config", "projects/empty-config", &workspace_root, - &mock_global_project_config(), + &mock_tasks_config(), ) .unwrap(); @@ -93,7 +93,7 @@ fn basic_config() { "basic", "projects/basic", &workspace_root, - &mock_global_project_config(), + &mock_tasks_config(), ) .unwrap(); let project_root = workspace_root.join("projects/basic"); @@ -131,7 +131,7 @@ fn advanced_config() { "advanced", "projects/advanced", &workspace_root, - &mock_global_project_config(), + &mock_tasks_config(), ) .unwrap(); diff --git a/crates/core/test-utils/src/configs.rs b/crates/core/test-utils/src/configs.rs index a464dda9ca4..b02afbc5e7d 100644 --- a/crates/core/test-utils/src/configs.rs +++ b/crates/core/test-utils/src/configs.rs @@ -1,5 +1,5 @@ use moon_config::{ - GlobalProjectConfig, NodeConfig, NodePackageManager, NodeProjectAliasFormat, NpmConfig, + InheritedTasksConfig, NodeConfig, NodePackageManager, NodeProjectAliasFormat, NpmConfig, PnpmConfig, TaskCommandArgs, TaskConfig, ToolchainConfig, TypeScriptConfig, WorkspaceConfig, WorkspaceProjects, YarnConfig, }; @@ -28,7 +28,7 @@ pub fn get_default_toolchain() -> ToolchainConfig { } } -pub fn get_cases_fixture_configs() -> (WorkspaceConfig, ToolchainConfig, GlobalProjectConfig) { +pub fn get_cases_fixture_configs() -> (WorkspaceConfig, ToolchainConfig, InheritedTasksConfig) { let workspace_config = WorkspaceConfig { projects: WorkspaceProjects::Sources(FxHashMap::from_iter([ ("root".to_owned(), ".".to_owned()), @@ -55,7 +55,7 @@ pub fn get_cases_fixture_configs() -> (WorkspaceConfig, ToolchainConfig, GlobalP let toolchain_config = get_default_toolchain(); - let projects_config = GlobalProjectConfig { + let tasks_config = InheritedTasksConfig { tasks: BTreeMap::from_iter([( "noop".to_owned(), TaskConfig { @@ -63,13 +63,13 @@ pub fn get_cases_fixture_configs() -> (WorkspaceConfig, ToolchainConfig, GlobalP ..TaskConfig::default() }, )]), - ..GlobalProjectConfig::default() + ..InheritedTasksConfig::default() }; - (workspace_config, toolchain_config, projects_config) + (workspace_config, toolchain_config, tasks_config) } -pub fn get_projects_fixture_configs() -> (WorkspaceConfig, ToolchainConfig, GlobalProjectConfig) { +pub fn get_projects_fixture_configs() -> (WorkspaceConfig, ToolchainConfig, InheritedTasksConfig) { let workspace_config = WorkspaceConfig { projects: WorkspaceProjects::Sources(FxHashMap::from_iter([ ("advanced".to_owned(), "advanced".to_owned()), @@ -88,7 +88,7 @@ pub fn get_projects_fixture_configs() -> (WorkspaceConfig, ToolchainConfig, Glob let toolchain_config = get_default_toolchain(); - let projects_config = GlobalProjectConfig { + let tasks_config = InheritedTasksConfig { file_groups: FxHashMap::from_iter([ ( "sources".into(), @@ -96,14 +96,14 @@ pub fn get_projects_fixture_configs() -> (WorkspaceConfig, ToolchainConfig, Glob ), ("tests".into(), vec!["tests/**/*".into()]), ]), - ..GlobalProjectConfig::default() + ..InheritedTasksConfig::default() }; - (workspace_config, toolchain_config, projects_config) + (workspace_config, toolchain_config, tasks_config) } pub fn get_project_graph_aliases_fixture_configs( -) -> (WorkspaceConfig, ToolchainConfig, GlobalProjectConfig) { +) -> (WorkspaceConfig, ToolchainConfig, InheritedTasksConfig) { let workspace_config = WorkspaceConfig { projects: WorkspaceProjects::Sources(FxHashMap::from_iter([ ("explicit".to_owned(), "explicit".to_owned()), @@ -132,12 +132,12 @@ pub fn get_project_graph_aliases_fixture_configs( ..ToolchainConfig::default() }; - let projects_config = GlobalProjectConfig::default(); + let tasks_config = InheritedTasksConfig::default(); - (workspace_config, toolchain_config, projects_config) + (workspace_config, toolchain_config, tasks_config) } -pub fn get_tasks_fixture_configs() -> (WorkspaceConfig, ToolchainConfig, GlobalProjectConfig) { +pub fn get_tasks_fixture_configs() -> (WorkspaceConfig, ToolchainConfig, InheritedTasksConfig) { let workspace_config = WorkspaceConfig { projects: WorkspaceProjects::Sources(FxHashMap::from_iter([ ("basic".to_owned(), "basic".to_owned()), @@ -170,7 +170,7 @@ pub fn get_tasks_fixture_configs() -> (WorkspaceConfig, ToolchainConfig, GlobalP let toolchain_config = get_default_toolchain(); - let projects_config = GlobalProjectConfig { + let tasks_config = InheritedTasksConfig { file_groups: FxHashMap::from_iter([ ( "static".into(), @@ -224,15 +224,15 @@ pub fn get_tasks_fixture_configs() -> (WorkspaceConfig, ToolchainConfig, GlobalP }, ), ]), - ..GlobalProjectConfig::default() + ..InheritedTasksConfig::default() }; - (workspace_config, toolchain_config, projects_config) + (workspace_config, toolchain_config, tasks_config) } // NODE.JS -pub fn get_node_fixture_configs() -> (WorkspaceConfig, ToolchainConfig, GlobalProjectConfig) { +pub fn get_node_fixture_configs() -> (WorkspaceConfig, ToolchainConfig, InheritedTasksConfig) { let workspace_config = WorkspaceConfig { projects: WorkspaceProjects::Sources(FxHashMap::from_iter([ ("node".to_owned(), "base".to_owned()), @@ -254,7 +254,7 @@ pub fn get_node_fixture_configs() -> (WorkspaceConfig, ToolchainConfig, GlobalPr let toolchain_config = get_default_toolchain(); - let projects_config = GlobalProjectConfig { + let tasks_config = InheritedTasksConfig { tasks: BTreeMap::from_iter([ ( "version".to_owned(), @@ -272,16 +272,16 @@ pub fn get_node_fixture_configs() -> (WorkspaceConfig, ToolchainConfig, GlobalPr }, ), ]), - ..GlobalProjectConfig::default() + ..InheritedTasksConfig::default() }; - (workspace_config, toolchain_config, projects_config) + (workspace_config, toolchain_config, tasks_config) } pub fn get_node_depman_fixture_configs( depman: &str, -) -> (WorkspaceConfig, ToolchainConfig, GlobalProjectConfig) { - let (mut workspace_config, mut toolchain_config, projects_config) = get_node_fixture_configs(); +) -> (WorkspaceConfig, ToolchainConfig, InheritedTasksConfig) { + let (mut workspace_config, mut toolchain_config, tasks_config) = get_node_fixture_configs(); workspace_config.projects = WorkspaceProjects::Sources(FxHashMap::from_iter([ (depman.to_owned(), "base".to_owned()), @@ -321,11 +321,12 @@ pub fn get_node_depman_fixture_configs( } } - (workspace_config, toolchain_config, projects_config) + (workspace_config, toolchain_config, tasks_config) } -pub fn get_typescript_fixture_configs() -> (WorkspaceConfig, ToolchainConfig, GlobalProjectConfig) { - let (mut workspace_config, mut toolchain_config, projects_config) = get_node_fixture_configs(); +pub fn get_typescript_fixture_configs() -> (WorkspaceConfig, ToolchainConfig, InheritedTasksConfig) +{ + let (mut workspace_config, mut toolchain_config, tasks_config) = get_node_fixture_configs(); workspace_config.projects = WorkspaceProjects::Globs(vec!["*".into()]); @@ -334,5 +335,5 @@ pub fn get_typescript_fixture_configs() -> (WorkspaceConfig, ToolchainConfig, Gl ts_config.sync_project_references = true; } - (workspace_config, toolchain_config, projects_config) + (workspace_config, toolchain_config, tasks_config) } diff --git a/crates/core/test-utils/src/sandbox.rs b/crates/core/test-utils/src/sandbox.rs index 7ce33b53ba4..03be41e6075 100644 --- a/crates/core/test-utils/src/sandbox.rs +++ b/crates/core/test-utils/src/sandbox.rs @@ -3,7 +3,7 @@ use crate::get_fixtures_path; use assert_cmd::Command; use assert_fs::prelude::*; pub use assert_fs::TempDir; -use moon_config::{GlobalProjectConfig, ToolchainConfig, WorkspaceConfig}; +use moon_config::{InheritedTasksConfig, ToolchainConfig, WorkspaceConfig}; use std::fs; use std::path::Path; use std::process::Command as StdCommand; @@ -29,8 +29,8 @@ impl Sandbox { pub fn debug_configs(&self) -> &Self { for cfg in [ ".moon/workspace.yml", + ".moon/tasks.yml", ".moon/toolchain.yml", - ".moon/project.yml", ] { let path = self.path().join(cfg); @@ -132,7 +132,7 @@ pub fn create_sandbox_with_config>( fixture: T, workspace_config: Option<&WorkspaceConfig>, toolchain_config: Option<&ToolchainConfig>, - projects_config: Option<&GlobalProjectConfig>, + tasks_config: Option<&InheritedTasksConfig>, ) -> Sandbox { let sandbox = create_sandbox(fixture); @@ -156,8 +156,8 @@ pub fn create_sandbox_with_config>( .unwrap(), ); - if let Some(config) = projects_config { - sandbox.create_file(".moon/project.yml", serde_yaml::to_string(&config).unwrap()); + if let Some(config) = tasks_config { + sandbox.create_file(".moon/tasks.yml", serde_yaml::to_string(&config).unwrap()); } sandbox diff --git a/crates/core/workspace/src/errors.rs b/crates/core/workspace/src/errors.rs index ce84b12f0c6..d1d47a40d4b 100644 --- a/crates/core/workspace/src/errors.rs +++ b/crates/core/workspace/src/errors.rs @@ -39,9 +39,9 @@ pub enum WorkspaceError { #[error( "Failed to validate {}/{} configuration file.\n\n{0}", constants::CONFIG_DIRNAME, - constants::CONFIG_GLOBAL_PROJECT_FILENAME + constants::CONFIG_TASKS_FILENAME )] - InvalidGlobalProjectConfigFile(String), + InvalidTasksConfigFile(String), #[error("Invalid moon version, unable to proceed. Found {0}, expected {1}.")] InvalidMoonVersion(String, String), diff --git a/crates/core/workspace/src/workspace.rs b/crates/core/workspace/src/workspace.rs index adf4fa45ee5..cc8dd6c5eb4 100644 --- a/crates/core/workspace/src/workspace.rs +++ b/crates/core/workspace/src/workspace.rs @@ -1,7 +1,7 @@ use crate::errors::WorkspaceError; use moon_cache::CacheEngine; use moon_config::{ - format_error_line, format_figment_errors, ConfigError, GlobalProjectConfig, ToolchainConfig, + format_error_line, format_figment_errors, ConfigError, InheritedTasksConfig, ToolchainConfig, WorkspaceConfig, CONFIG_DIRNAME, }; use moon_constants as constants; @@ -36,11 +36,16 @@ fn find_workspace_root>(current_dir: P) -> Option { .map(|dir| dir.parent().unwrap().to_path_buf()) } -// .moon/project.yml -fn load_global_project_config(root_dir: &Path) -> Result { +// .moon/tasks.yml +fn load_tasks_config(root_dir: &Path) -> Result { + let old_config_path = root_dir.join(constants::CONFIG_DIRNAME).join("project.yml"); let config_path = root_dir .join(constants::CONFIG_DIRNAME) - .join(constants::CONFIG_GLOBAL_PROJECT_FILENAME); + .join(constants::CONFIG_TASKS_FILENAME); + + if old_config_path.exists() && !config_path.exists() { + fs::rename(&old_config_path, &config_path)?; + } trace!( target: LOG_TARGET, @@ -48,18 +53,18 @@ fn load_global_project_config(root_dir: &Path) -> Result Ok(cfg), - Err(errors) => Err(WorkspaceError::InvalidGlobalProjectConfigFile( + Err(errors) => Err(WorkspaceError::InvalidTasksConfigFile( if let ConfigError::FailedValidation(valids) = errors { format_figment_errors(valids) } else { @@ -145,15 +150,15 @@ pub struct Workspace { /// Registered platforms derived from toolchain configuration. pub platforms: PlatformManager, - /// Global project configuration loaded from ".moon/project.yml". - pub projects_config: GlobalProjectConfig, - /// The root of the workspace that contains the ".moon" config folder. pub root: PathBuf, /// When logged in, the auth token and IDs for making API requests. pub session: Option, + /// Global tasks configuration loaded from ".moon/tasks.yml". + pub tasks_config: InheritedTasksConfig, + /// Toolchain configuration loaded from ".moon/toolchain.yml". pub toolchain_config: ToolchainConfig, @@ -188,7 +193,7 @@ impl Workspace { // Load configs let config = load_workspace_config(&root_dir)?; let toolchain_config = load_toolchain_config(&root_dir)?; - let projects_config = load_global_project_config(&root_dir)?; + let tasks_config = load_tasks_config(&root_dir)?; if let Some(constraint) = &config.version_constraint { if let Ok(current_version) = env::var("MOON_VERSION") { @@ -215,9 +220,9 @@ impl Workspace { cache, config, platforms: PlatformManager::default(), - projects_config, root: root_dir, session: None, + tasks_config, toolchain_config, vcs, working_dir: working_dir.to_owned(), diff --git a/crates/node/platform/tests/project_aliases_test.rs b/crates/node/platform/tests/project_aliases_test.rs index c9fbeeb0508..db2bd73744e 100644 --- a/crates/node/platform/tests/project_aliases_test.rs +++ b/crates/node/platform/tests/project_aliases_test.rs @@ -10,7 +10,7 @@ async fn get_aliases_graph(callback: C) -> (ProjectGraph, Sandbox) where C: FnOnce(&mut NodeConfig), { - let (workspace_config, mut toolchain_config, projects_config) = + let (workspace_config, mut toolchain_config, tasks_config) = get_project_graph_aliases_fixture_configs(); if let Some(node_config) = &mut toolchain_config.node { @@ -21,7 +21,7 @@ where "project-graph/aliases", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let mut workspace = load_workspace_from(sandbox.path()).await.unwrap(); diff --git a/crates/node/platform/tests/sync_project_test.rs b/crates/node/platform/tests/sync_project_test.rs index 9a3f8fc3d3a..a1a2e64165d 100644 --- a/crates/node/platform/tests/sync_project_test.rs +++ b/crates/node/platform/tests/sync_project_test.rs @@ -1,4 +1,4 @@ -use moon_config::{GlobalProjectConfig, TypeScriptConfig}; +use moon_config::{InheritedTasksConfig, TypeScriptConfig}; use moon_node_platform::actions::create_missing_tsconfig; use moon_project::Project; use moon_test_utils::{create_sandbox_with_config, get_node_fixture_configs}; @@ -10,19 +10,19 @@ mod missing_tsconfig { #[test] fn creates_tsconfig() { - let (workspace_config, toolchain_config, projects_config) = get_node_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_node_fixture_configs(); let sandbox = create_sandbox_with_config( "node", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let project = Project::new( "deps-a", "deps-a", sandbox.path(), - &GlobalProjectConfig::default(), + &InheritedTasksConfig::default(), ) .unwrap(); @@ -45,19 +45,19 @@ mod missing_tsconfig { #[test] fn creates_tsconfig_with_custom_settings() { - let (workspace_config, toolchain_config, projects_config) = get_node_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_node_fixture_configs(); let sandbox = create_sandbox_with_config( "node", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let project = Project::new( "deps-a", "deps-a", sandbox.path(), - &GlobalProjectConfig::default(), + &InheritedTasksConfig::default(), ) .unwrap(); @@ -88,19 +88,19 @@ mod missing_tsconfig { #[test] fn doesnt_create_if_a_config_exists() { - let (workspace_config, toolchain_config, projects_config) = get_node_fixture_configs(); + let (workspace_config, toolchain_config, tasks_config) = get_node_fixture_configs(); let sandbox = create_sandbox_with_config( "node", Some(&workspace_config), Some(&toolchain_config), - Some(&projects_config), + Some(&tasks_config), ); let project = Project::new( "deps-b", "deps-b", sandbox.path(), - &GlobalProjectConfig::default(), + &InheritedTasksConfig::default(), ) .unwrap(); diff --git a/packages/types/src/project-config.ts b/packages/types/src/project-config.ts index 2cf53712b26..16437f86f82 100644 --- a/packages/types/src/project-config.ts +++ b/packages/types/src/project-config.ts @@ -89,7 +89,7 @@ export interface ProjectConfig { workspace: ProjectWorkspaceConfig; } -export interface GlobalProjectConfig { +export interface InheritedTasksConfig { extends: string | null; fileGroups: Record; tasks: Record; diff --git a/tests/fixtures/config-extends/.moon/project.yml b/tests/fixtures/config-extends/.moon/tasks.yml similarity index 100% rename from tests/fixtures/config-extends/.moon/project.yml rename to tests/fixtures/config-extends/.moon/tasks.yml diff --git a/website/docs/commands/migrate/from-turborepo.mdx b/website/docs/commands/migrate/from-turborepo.mdx index 56d908559e9..ed43b47eaea 100644 --- a/website/docs/commands/migrate/from-turborepo.mdx +++ b/website/docs/commands/migrate/from-turborepo.mdx @@ -6,8 +6,8 @@ sidebar_label: from-turborepo Use the `moon migrate from-turborepo` command to migrate a Turborepo powered repository to moon. This process will convert the root `turbo.json` file to moon applicable configuration files: -- Migrates `pipeline` global tasks to [`.moon/project.yml`](../../config/global-project#tasks) and - project scoped tasks to [`moon.yml`](../../config/project#tasks). +- Migrates `pipeline` global tasks to [`.moon/tasks.yml`](../../config/tasks#tasks) and project + scoped tasks to [`moon.yml`](../../config/project#tasks). - Migrates `globalDependencies` and `globalEnv` to [`.moon/workspace.yml`](../../config/workspace#implicitinputs) (via `runner.implicitInputs`). diff --git a/website/docs/concepts/file-group.mdx b/website/docs/concepts/file-group.mdx index 061b2177f11..6157353235f 100644 --- a/website/docs/concepts/file-group.mdx +++ b/website/docs/concepts/file-group.mdx @@ -10,7 +10,7 @@ deterministic builds, and more. ## Configuration File groups can be configured per project through [`moon.yml`](../config/project), or for all -projects through [`.moon/project.yml`](../config/global-project). +projects through [`.moon/tasks.yml`](../config/tasks). ## Inheritance and merging @@ -23,7 +23,7 @@ _override_ file groups defined at the workspace-level. For example, say we want `sources` file group because our source folder is named "lib" and not "src", we would define our file groups as followed. -```yaml title=".moon/project.yml" +```yaml title=".moon/tasks.yml" fileGroups: sources: - 'src/**/*' diff --git a/website/docs/concepts/project.mdx b/website/docs/concepts/project.mdx index d0d5095580b..695d5bc35b0 100644 --- a/website/docs/concepts/project.mdx +++ b/website/docs/concepts/project.mdx @@ -50,4 +50,4 @@ and in turn, a dependency graph for executing [tasks](./task). Project dependenc ## Configuration Projects can be configured with an optional [`moon.yml`](../config/project) in the project root, or -through the optional [`.moon/project.yml`](../config/global-project) which applies to all projects. +through the optional [`.moon/tasks.yml`](../config/tasks) which applies to all projects. diff --git a/website/docs/concepts/target.mdx b/website/docs/concepts/target.mdx index db7902610ff..21dbc60a5ca 100644 --- a/website/docs/concepts/target.mdx +++ b/website/docs/concepts/target.mdx @@ -78,9 +78,9 @@ tasks: When referring to another task within the current project, you can utilize the `~` scope, or emit the `~:` prefix altogether, which will be expanded to the current project's name. This is useful for situations where the name is unknown, for example, when configuring -[`.moon/project.yml`](../config/global-project). Or if you just want a shortcut! +[`.moon/tasks.yml`](../config/tasks). Or if you just want a shortcut! -```yaml title=".moon/project.yml" +```yaml title=".moon/tasks.yml" # Configured as tasks: lint: diff --git a/website/docs/concepts/task.mdx b/website/docs/concepts/task.mdx index b3c731c3828..b49d3b7b342 100644 --- a/website/docs/concepts/task.mdx +++ b/website/docs/concepts/task.mdx @@ -28,7 +28,7 @@ Tasks are categorized into 1 of the following types based on their configured pa ## Configuration Tasks can be configured per project through [`moon.yml`](../config/project), or for all projects -through [`.moon/project.yml`](../config/global-project). +through [`.moon/tasks.yml`](../config/tasks). ## Inheritance @@ -36,15 +36,15 @@ Unlike other build systems that require the same tasks to be repeatedly defined moon uses an inheritance model where tasks are defined once at the top-level, and are then inherited by _all_ projects. -Top-level tasks (also known as global tasks) are defined in -[`.moon/project.yml`](../config/global-project), and are inherited by default. However, projects are -able to include, exclude, or rename inherited tasks using the -[`workspace.inheritedTasks`](../config/project#inheritedtasks) in [`moon.yml`](../config/project). +Top-level tasks (also known as global tasks) are defined in [`.moon/tasks.yml`](../config/tasks), +and are inherited by default. However, projects are able to include, exclude, or rename inherited +tasks using the [`workspace.inheritedTasks`](../config/project#inheritedtasks) in +[`moon.yml`](../config/project). ### Merge strategies -When a [global task](../config/global-project#tasks) and [local task](../config/project#tasks) of -the same name exist, they are merged into a single task. To accomplish this, one of many +When a [global task](../config/tasks#tasks) and [local task](../config/project#tasks) of the same +name exist, they are merged into a single task. To accomplish this, one of many [merge strategies](../config/project#options) can be used. Merging is applied to the parameters [`args`](../config/project#args), diff --git a/website/docs/config/project.mdx b/website/docs/config/project.mdx index 97647445264..9ec5ebf7125 100644 --- a/website/docs/config/project.mdx +++ b/website/docs/config/project.mdx @@ -160,12 +160,12 @@ Defines [file groups](../concepts/file-group) to be used by local tasks. By defa _is not required_ for the following reasons: - File groups are an optional feature, and are designed for advanced use cases. -- File groups defined in [`.moon/project.yml`](./global-project) will be inherited by all projects. +- File groups defined in [`.moon/tasks.yml`](./tasks) will be inherited by all projects. When defined this setting requires a map, where the key is the file group name, and the value is a list of [globs or paths](../concepts/file-pattern). Globs and paths are [relative to a project](../concepts/file-pattern#project-relative) (even when defined -[globally](./global-project)). +[globally](./tasks)). ```yaml title="moon.yml" fileGroups: @@ -259,7 +259,7 @@ For interoperability reasons, the following command names have special handling. The `args` field is a collection of _additional_ arguments to pass to the command line when executing the task. This field exists purely to provide arguments for -[inherited tasks](./global-project#tasks). +[inherited tasks](./tasks#tasks). This setting can be defined using a string, or an array of strings. We suggest using arrays when dealing with many args, or the args string cannot be parsed easily. @@ -690,7 +690,7 @@ toolchain: -Provides a layer of control when inheriting tasks from [`.moon/project.yml`](./global-project). +Provides a layer of control when inheriting tasks from [`.moon/tasks.yml`](./tasks). #### `exclude` diff --git a/website/docs/config/global-project.mdx b/website/docs/config/tasks.mdx similarity index 75% rename from website/docs/config/global-project.mdx rename to website/docs/config/tasks.mdx index feb5d25e2e4..1eec007f687 100644 --- a/website/docs/config/global-project.mdx +++ b/website/docs/config/tasks.mdx @@ -1,28 +1,28 @@ --- -title: .moon/project.yml +title: .moon/tasks.yml --- import HeadingApiLink from '@site/src/components/Docs/HeadingApiLink'; import VersionLabel from '@site/src/components/Docs/VersionLabel'; -The `.moon/project.yml` file configures file groups and tasks that are inherited by _every_ project -in the workspace. Projects can override or merge with these settings within their respective -[`moon.yml`](./project). This file is _optional_. +The `.moon/tasks.yml` file (formerly `.moon/project.yml`) configures file groups and tasks that are +inherited by _every_ project in the workspace. Projects can override or merge with these settings +within their respective [`moon.yml`](./project). This file is _optional_. -```yaml title=".moon/project.yml" -$schema: 'https://moonrepo.dev/schemas/global-project.json' +```yaml title=".moon/tasks.yml" +$schema: 'https://moonrepo.dev/schemas/tasks.json' ``` ## `extends` - + -Defines an external `.moon/project.yml` to extend and inherit settings from. Perfect for reusability +Defines an external `.moon/tasks.yml` to extend and inherit settings from. Perfect for reusability and sharing configuration across repositories and projects. When defined, this setting must be an HTTPS URL _or_ relative file system path that points to a valid YAML document! -```yaml title=".moon/project.yml" {1} -extends: 'https://raw.githubusercontent.com/organization/repository/master/.moon/project.yml' +```yaml title=".moon/tasks.yml" {1} +extends: 'https://raw.githubusercontent.com/organization/repository/master/.moon/tasks.yml' ``` :::caution @@ -35,7 +35,7 @@ values _are not_ deep merged! ## `fileGroups` - + > For more information on file group configuration, refer to the > [`fileGroups`](./project#filegroups) section in the [`moon.yml`](./project) doc. @@ -44,7 +44,7 @@ Defines [file groups](../concepts/file-group) that will be inherited by all proj enables enforcement of organizational patterns and file locations. For example, encourage all projects to place source files in a `src` folder, and all test files in `tests`. -```yaml title=".moon/project.yml" +```yaml title=".moon/tasks.yml" fileGroups: configs: - '*.config.{js,cjs,mjs}' @@ -67,7 +67,7 @@ fileGroups: ## `tasks` - + > For more information on task configuration, refer to the [`tasks`](./project#tasks) section in the > [`moon.yml`](./project) doc. @@ -79,7 +79,7 @@ the amount of boilerplate that _every_ project would require, this setting offer define tasks that are inherited by all projects within the workspace, but can also be overridden per project. -```yaml title=".moon/project.yml" +```yaml title=".moon/tasks.yml" tasks: format: command: 'prettier --check .' diff --git a/website/docs/config/toolchain.mdx b/website/docs/config/toolchain.mdx index 5a4a427359e..a61be918d26 100644 --- a/website/docs/config/toolchain.mdx +++ b/website/docs/config/toolchain.mdx @@ -234,7 +234,7 @@ This requires the [project's language](./project#language) to be "javascript" or - Script names will be converted to kebab-case, and will become the task ID. - Pre, post, and life cycle hooks are ignored. -- Tasks defined in `.moon/project.yml` or `moon.yml` take precedence over scripts of the same name. +- Tasks defined in `.moon/tasks.yml` or `moon.yml` take precedence over scripts of the same name. To verify inferred tasks, run [`moon project `](../commands/project) (pass `--json` to view raw config and options). Tasks that are inferred will have their command and args set to diff --git a/website/docs/config/workspace.mdx b/website/docs/config/workspace.mdx index 5a46b9fdfa9..f86b4cd1969 100644 --- a/website/docs/config/workspace.mdx +++ b/website/docs/config/workspace.mdx @@ -218,7 +218,7 @@ supported and encouraged. runner: implicitInputs: - 'package.json' - - '/.moon/project.yml' + - '/.moon/tasks.yml' - '/.moon/toolchain.yml' - '/.moon/workspace.yml' ``` diff --git a/website/docs/create-project.mdx b/website/docs/create-project.mdx index 99b11edfa4e..28a023b7b30 100644 --- a/website/docs/create-project.mdx +++ b/website/docs/create-project.mdx @@ -51,9 +51,9 @@ import AliasesNode from './__partials__/create-project/node/aliases.mdx'; A project can be configured in 1 of 2 ways: -- Through the [`.moon/project.yml`](./config/global-project) config file, which defines file groups - and tasks that are inherited by _all_ projects within the workspace. Perfect for standardizing - common tasks like linting, typechecking, and code formatting. +- Through the [`.moon/tasks.yml`](./config/tasks) config file, which defines file groups and tasks + that are inherited by _all_ projects within the workspace. Perfect for standardizing common tasks + like linting, typechecking, and code formatting. - Through the [`moon.yml`](./config/project) config file, found at the root of each project, which defines files groups, tasks, dependencies, and more that are unique to that project. @@ -108,7 +108,7 @@ tasks: -```yaml title=".moon/project.yml" +```yaml title=".moon/tasks.yml" tasks: format: command: 'prettier --check .' @@ -168,10 +168,10 @@ project: icon: 'project-config-global', label: ( - Configure .moon/project.yml further + Configure .moon/tasks.yml further ), - url: './config/global-project', + url: './config/tasks', }, { icon: 'project-config', diff --git a/website/docs/create-task.mdx b/website/docs/create-task.mdx index a335b303dbd..f2041a0c1f6 100644 --- a/website/docs/create-task.mdx +++ b/website/docs/create-task.mdx @@ -12,7 +12,7 @@ The primary focus of moon is a build system, and for it to operate in any capaci tasks to run. In moon, a task is a binary or system command that is ran as a child process within the context of a project (is the current working directory). Tasks are defined per project with [`moon.yml`](./config/project), or inherited by all projects with -[`.moon/project.yml`](./config/global-project), but can also be inferred from a language's ecosystem +[`.moon/tasks.yml`](./config/tasks), but can also be inferred from a language's ecosystem ([we'll talk about this later](./migrate-to-moon)). :::tip @@ -220,10 +220,10 @@ encourage certain file structures for consuming projects! icon: 'project-config-global', label: ( - Configure .moon/project.yml further + Configure .moon/tasks.yml further ), - url: './config/global-project', + url: './config/tasks', }, { icon: 'project-config', diff --git a/website/docs/guides/examples/eslint.mdx b/website/docs/guides/examples/eslint.mdx index 4d6d82f3909..62910c984ab 100644 --- a/website/docs/guides/examples/eslint.mdx +++ b/website/docs/guides/examples/eslint.mdx @@ -6,7 +6,7 @@ sidebar_label: ESLint import AddDepsTabs from '@site/src/components/AddDepsTabs'; import HeadingApiLink from '@site/src/components/Docs/HeadingApiLink'; - + In this guide, you'll learn how to integrate [ESLint](https://eslint.org/) into moon. @@ -17,10 +17,10 @@ the entire repository. ## Setup -Since linting is a universal workflow, add a `lint` task to -[`.moon/project.yml`](../../config/global-project) with the following parameters. +Since linting is a universal workflow, add a `lint` task to [`.moon/tasks.yml`](../../config/tasks) +with the following parameters. -```yaml title=".moon/project.yml" +```yaml title=".moon/tasks.yml" tasks: lint: command: @@ -85,7 +85,7 @@ Create a `tsconfig.eslint.json` in your repository root, extend your shared comp Append the following inputs to your `lint` task. -```yaml title=".moon/project.yml" +```yaml title=".moon/tasks.yml" tasks: lint: # ... diff --git a/website/docs/guides/examples/jest.mdx b/website/docs/guides/examples/jest.mdx index 7eec5ba59a2..c6b551f792b 100644 --- a/website/docs/guides/examples/jest.mdx +++ b/website/docs/guides/examples/jest.mdx @@ -6,7 +6,7 @@ sidebar_label: Jest import AddDepsTabs from '@site/src/components/AddDepsTabs'; import HeadingApiLink from '@site/src/components/Docs/HeadingApiLink'; - + In this guide, you'll learn how to integrate [Jest](https://jestjs.io/) into moon. @@ -17,10 +17,10 @@ repository. ## Setup -Since testing is a universal workflow, add a `test` task to -[`.moon/project.yml`](../../config/global-project) with the following parameters. +Since testing is a universal workflow, add a `test` task to [`.moon/tasks.yml`](../../config/tasks) +with the following parameters. -```yaml title=".moon/project.yml" +```yaml title=".moon/tasks.yml" tasks: test: command: diff --git a/website/docs/guides/examples/packemon.mdx b/website/docs/guides/examples/packemon.mdx index 1e19af7c91f..f8682144df6 100644 --- a/website/docs/guides/examples/packemon.mdx +++ b/website/docs/guides/examples/packemon.mdx @@ -8,7 +8,7 @@ import TabItem from '@theme/TabItem'; import AddDepsTabs from '@site/src/components/AddDepsTabs'; import HeadingApiLink from '@site/src/components/Docs/HeadingApiLink'; - + In this guide, you'll learn how to integrate [Packemon](https://packemon.dev/) into moon. Packemon is a tool for properly building npm packages for distribution, it does this by providing the @@ -29,8 +29,8 @@ repository. Package building does not apply to every project, only packages, so where you place the build task is up to you. The following patterns are suggested: -- A `buildPackage` task in [`.moon/project.yml`](../../config/global-project), which can be - inherited by package based projects. +- A `buildPackage` task in [`.moon/tasks.yml`](../../config/tasks), which can be inherited by + package based projects. - A `build` task in each [`moon.yml`](../../config/project). -```yaml title=".moon/project.yml" +```yaml title=".moon/tasks.yml" buildPackage: command: - 'packemon' diff --git a/website/docs/guides/examples/prettier.mdx b/website/docs/guides/examples/prettier.mdx index 598c43c7919..7cb496adcb5 100644 --- a/website/docs/guides/examples/prettier.mdx +++ b/website/docs/guides/examples/prettier.mdx @@ -6,7 +6,7 @@ sidebar_label: Prettier import AddDepsTabs from '@site/src/components/AddDepsTabs'; import HeadingApiLink from '@site/src/components/Docs/HeadingApiLink'; - + In this guide, you'll learn how to integrate [Prettier](https://prettier.io/) into moon. @@ -18,9 +18,9 @@ repository. ## Setup Since code formatting is a universal workflow, add a `format` task to -[`.moon/project.yml`](../../config/global-project) with the following parameters. +[`.moon/tasks.yml`](../../config/tasks) with the following parameters. -```yaml title=".moon/project.yml" +```yaml title=".moon/tasks.yml" tasks: format: command: diff --git a/website/docs/guides/examples/typescript.mdx b/website/docs/guides/examples/typescript.mdx index c11a934c3e8..7a8d307ded8 100644 --- a/website/docs/guides/examples/typescript.mdx +++ b/website/docs/guides/examples/typescript.mdx @@ -6,7 +6,7 @@ sidebar_label: TypeScript import AddDepsTabs from '@site/src/components/AddDepsTabs'; import HeadingApiLink from '@site/src/components/Docs/HeadingApiLink'; - + In this guide, you'll learn how to integrate [TypeScript](https://eslint.org/) into moon. We'll be using [project references](../javascript/typescript-project-refs), as it ensures that only affected @@ -20,9 +20,9 @@ using the same version across the entire repository. ## Setup Since typechecking is a universal workflow, add a `typecheck` task to -[`.moon/project.yml`](../../config/global-project) with the following parameters. +[`.moon/tasks.yml`](../../config/tasks) with the following parameters. -```yaml title=".moon/project.yml" +```yaml title=".moon/tasks.yml" tasks: typecheck: command: diff --git a/website/docs/guides/root-project.mdx b/website/docs/guides/root-project.mdx index 78c364fe64d..b0bba2986d5 100644 --- a/website/docs/guides/root-project.mdx +++ b/website/docs/guides/root-project.mdx @@ -59,8 +59,8 @@ tasks: ### Inherited tasks Because a root project is still a project in the workspace, it will inherit all tasks defined in -[`.moon/project.yml`](../config/global-project), which may be not what you want. To mitigate this, -you can exclude some or all of these tasks in the root config with +[`.moon/tasks.yml`](../config/tasks), which may be not what you want. To mitigate this, you can +exclude some or all of these tasks in the root config with [`workspace.inheritedTasks`](../config/project#inheritedtasks). ```yaml title="moon.yml" diff --git a/website/docs/guides/sharing-config.mdx b/website/docs/guides/sharing-config.mdx index 054e039687e..7ea25eeb0c9 100644 --- a/website/docs/guides/sharing-config.mdx +++ b/website/docs/guides/sharing-config.mdx @@ -9,14 +9,14 @@ the maintenance burden while ensuring a similar developer experience. To help streamline this process, moon provides an `extends` setting in both [`.moon/workspace.yml`](../config/workspace#extends), [`.moon/toolchain.yml`](../config/toolchain#extends), and -[`.moon/project.yml`](../config/global-project#extends). This setting requires a HTTPS URL _or_ -relative file system path that points to a valid YAML document for the configuration in question. +[`.moon/tasks.yml`](../config/tasks#extends). This setting requires a HTTPS URL _or_ relative file +system path that points to a valid YAML document for the configuration in question. A great way to share configuration is by using GitHub's "raw file view", as demonstrated below using our very own [examples repository](https://github.com/moonrepo/examples). -```yaml title=".moon/project.yml" -extends: 'https://raw.githubusercontent.com/moonrepo/examples/master/.moon/project.yml' +```yaml title=".moon/tasks.yml" +extends: 'https://raw.githubusercontent.com/moonrepo/examples/master/.moon/tasks.yml' ``` ## Versioning @@ -43,6 +43,6 @@ configuration through a branch, tag, commit, or sha. Since these are a reference are relatively safe. ```diff --extends: 'https://raw.githubusercontent.com/moonrepo/examples/master/.moon/project.yml' -+extends: 'https://raw.githubusercontent.com/moonrepo/examples/c3f10160bcd16b48b8d4d21b208bb50f6b09bd96/.moon/project.yml' +-extends: 'https://raw.githubusercontent.com/moonrepo/examples/master/.moon/tasks.yml' ++extends: 'https://raw.githubusercontent.com/moonrepo/examples/c3f10160bcd16b48b8d4d21b208bb50f6b09bd96/.moon/tasks.yml' ``` diff --git a/website/docs/setup-workspace.mdx b/website/docs/setup-workspace.mdx index 474fa4fe9a5..df64c98c5f3 100644 --- a/website/docs/setup-workspace.mdx +++ b/website/docs/setup-workspace.mdx @@ -29,8 +29,8 @@ $ moon init When executed, the following operations will be applied. - Creates a `.moon` folder with associated [`.moon/workspace.yml`](./config/workspace), - [`.moon/toolchain.yml`](./config/toolchain), and [`.moon/project.yml`](./config/global-project) - configuration files. + [`.moon/toolchain.yml`](./config/toolchain), and [`.moon/tasks.yml`](./config/tasks) configuration + files. - Appends necessary ignore patterns to the relative `.gitignore`. - Infers languages and dependency managers to register in the toolchain. - Infers the version control system from the environment. diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index fd60ba3af95..549ad15ba10 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -212,6 +212,21 @@ const config = { }), plugins: [ + [ + '@docusaurus/plugin-client-redirects', + { + redirects: [ + { + from: '/docs/config/global-project', + to: '/docs/config/tasks', + }, + { + from: '/docs/config/inherited-tasks', + to: '/docs/config/tasks', + }, + ], + }, + ], [ 'docusaurus-plugin-typedoc-api', { diff --git a/website/package.json b/website/package.json index ae7f4e969ed..d027cae9f80 100644 --- a/website/package.json +++ b/website/package.json @@ -15,6 +15,7 @@ }, "dependencies": { "@docusaurus/core": "^2.2.0", + "@docusaurus/plugin-client-redirects": "^2.2.0", "@docusaurus/preset-classic": "^2.2.0", "@docusaurus/theme-common": "^2.2.0", "@fortawesome/fontawesome-svg-core": "^6.2.1", diff --git a/website/sidebars.js b/website/sidebars.js index fdae2aca8c3..86e767b1574 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -47,7 +47,7 @@ const sidebars = { items: [ 'config/workspace', 'config/toolchain', - 'config/global-project', + 'config/tasks', 'config/project', 'config/template', ], diff --git a/website/src/components/ComparisonTable.tsx b/website/src/components/ComparisonTable.tsx index e149c9447b4..fc8027825ce 100644 --- a/website/src/components/ComparisonTable.tsx +++ b/website/src/components/ComparisonTable.tsx @@ -216,7 +216,7 @@ const tasksRows: Comparison[] = [ { feature: 'Can define tasks globally', support: { - moon: [SUPPORTED, 'with `.moon/project.yml`'], + moon: [SUPPORTED, 'with `.moon/tasks.yml`'], }, }, { diff --git a/website/static/schemas/project.json b/website/static/schemas/project.json index daba1eca4c1..88894042e4a 100644 --- a/website/static/schemas/project.json +++ b/website/static/schemas/project.json @@ -5,14 +5,12 @@ "type": "object", "properties": { "dependsOn": { - "default": [], "type": "array", "items": { "$ref": "#/definitions/ProjectDependsOn" } }, "fileGroups": { - "default": {}, "type": "object", "additionalProperties": { "type": "array", @@ -22,15 +20,9 @@ } }, "language": { - "default": "unknown", - "allOf": [ - { - "$ref": "#/definitions/ProjectLanguage" - } - ] + "$ref": "#/definitions/ProjectLanguage" }, "project": { - "default": null, "anyOf": [ { "$ref": "#/definitions/ProjectMetadataConfig" @@ -41,44 +33,19 @@ ] }, "tasks": { - "default": {}, "type": "object", "additionalProperties": { "$ref": "#/definitions/TaskConfig" } }, "toolchain": { - "default": { - "node": null, - "typescript": true - }, - "allOf": [ - { - "$ref": "#/definitions/ProjectToolchainConfig" - } - ] + "$ref": "#/definitions/ProjectToolchainConfig" }, "type": { - "default": "unknown", - "allOf": [ - { - "$ref": "#/definitions/ProjectType" - } - ] + "$ref": "#/definitions/ProjectType" }, "workspace": { - "default": { - "inheritedTasks": { - "exclude": null, - "include": null, - "rename": null - } - }, - "allOf": [ - { - "$ref": "#/definitions/ProjectWorkspaceConfig" - } - ] + "$ref": "#/definitions/ProjectWorkspaceConfig" } }, "definitions": { @@ -143,30 +110,38 @@ "ProjectMetadataConfig": { "type": "object", "required": [ - "channel", - "description", - "maintainers", - "name", - "owner" + "description" ], "properties": { "channel": { - "type": "string" + "type": [ + "string", + "null" + ] }, "description": { "type": "string" }, "maintainers": { - "type": "array", + "type": [ + "array", + "null" + ], "items": { "type": "string" } }, "name": { - "type": "string" + "type": [ + "string", + "null" + ] }, "owner": { - "type": "string" + "type": [ + "string", + "null" + ] } } }, @@ -174,7 +149,6 @@ "type": "object", "properties": { "node": { - "default": null, "anyOf": [ { "$ref": "#/definitions/ProjectToolchainNodeConfig" @@ -185,7 +159,6 @@ ] }, "typescript": { - "default": true, "type": "boolean" } } @@ -194,7 +167,6 @@ "type": "object", "properties": { "version": { - "default": null, "type": [ "string", "null" @@ -215,16 +187,7 @@ "type": "object", "properties": { "inheritedTasks": { - "default": { - "exclude": null, - "include": null, - "rename": null - }, - "allOf": [ - { - "$ref": "#/definitions/ProjectWorkspaceInheritedTasksConfig" - } - ] + "$ref": "#/definitions/ProjectWorkspaceInheritedTasksConfig" } } }, @@ -232,7 +195,6 @@ "type": "object", "properties": { "exclude": { - "default": null, "type": [ "array", "null" @@ -242,7 +204,6 @@ } }, "include": { - "default": null, "type": [ "array", "null" @@ -252,7 +213,6 @@ } }, "rename": { - "default": null, "type": [ "object", "null" @@ -280,7 +240,6 @@ "type": "object", "properties": { "args": { - "default": null, "anyOf": [ { "$ref": "#/definitions/TaskCommandArgs" @@ -291,7 +250,6 @@ ] }, "command": { - "default": null, "anyOf": [ { "$ref": "#/definitions/TaskCommandArgs" @@ -302,7 +260,6 @@ ] }, "deps": { - "default": null, "type": [ "array", "null" @@ -312,7 +269,6 @@ } }, "env": { - "default": null, "type": [ "object", "null" @@ -322,7 +278,6 @@ } }, "inputs": { - "default": null, "type": [ "array", "null" @@ -332,33 +287,12 @@ } }, "local": { - "default": false, "type": "boolean" }, "options": { - "default": { - "affectedFiles": null, - "cache": null, - "envFile": null, - "mergeArgs": null, - "mergeDeps": null, - "mergeEnv": null, - "mergeInputs": null, - "mergeOutputs": null, - "outputStyle": null, - "retryCount": null, - "runDepsInParallel": null, - "runInCI": null, - "runFromWorkspaceRoot": null - }, - "allOf": [ - { - "$ref": "#/definitions/TaskOptionsConfig" - } - ] + "$ref": "#/definitions/TaskOptionsConfig" }, "outputs": { - "default": null, "type": [ "array", "null" @@ -368,12 +302,7 @@ } }, "platform": { - "default": "unknown", - "allOf": [ - { - "$ref": "#/definitions/PlatformType" - } - ] + "$ref": "#/definitions/PlatformType" } } }, @@ -409,7 +338,6 @@ "type": "object", "properties": { "affectedFiles": { - "default": null, "anyOf": [ { "$ref": "#/definitions/TaskOptionAffectedFilesConfig" @@ -420,14 +348,12 @@ ] }, "cache": { - "default": null, "type": [ "boolean", "null" ] }, "envFile": { - "default": null, "anyOf": [ { "$ref": "#/definitions/TaskOptionEnvFileConfig" @@ -438,7 +364,6 @@ ] }, "mergeArgs": { - "default": null, "anyOf": [ { "$ref": "#/definitions/TaskMergeStrategy" @@ -449,7 +374,6 @@ ] }, "mergeDeps": { - "default": null, "anyOf": [ { "$ref": "#/definitions/TaskMergeStrategy" @@ -460,7 +384,6 @@ ] }, "mergeEnv": { - "default": null, "anyOf": [ { "$ref": "#/definitions/TaskMergeStrategy" @@ -471,7 +394,6 @@ ] }, "mergeInputs": { - "default": null, "anyOf": [ { "$ref": "#/definitions/TaskMergeStrategy" @@ -482,7 +404,6 @@ ] }, "mergeOutputs": { - "default": null, "anyOf": [ { "$ref": "#/definitions/TaskMergeStrategy" @@ -493,7 +414,6 @@ ] }, "outputStyle": { - "default": null, "anyOf": [ { "$ref": "#/definitions/TaskOutputStyle" @@ -504,7 +424,6 @@ ] }, "retryCount": { - "default": null, "type": [ "integer", "null" @@ -513,21 +432,18 @@ "minimum": 0.0 }, "runDepsInParallel": { - "default": null, "type": [ "boolean", "null" ] }, "runFromWorkspaceRoot": { - "default": null, "type": [ "boolean", "null" ] }, "runInCI": { - "default": null, "type": [ "boolean", "null" diff --git a/website/static/schemas/global-project.json b/website/static/schemas/tasks.json similarity index 78% rename from website/static/schemas/global-project.json rename to website/static/schemas/tasks.json index 9dbed886838..f99b78a66c4 100644 --- a/website/static/schemas/global-project.json +++ b/website/static/schemas/tasks.json @@ -1,7 +1,7 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "GlobalProjectConfig", - "description": "Docs: https://moonrepo.dev/docs/config/global-project", + "title": "InheritedTasksConfig", + "description": "Docs: https://moonrepo.dev/docs/config/tasks", "type": "object", "properties": { "extends": { @@ -11,7 +11,6 @@ ] }, "fileGroups": { - "default": {}, "type": "object", "additionalProperties": { "type": "array", @@ -21,7 +20,6 @@ } }, "tasks": { - "default": {}, "type": "object", "additionalProperties": { "$ref": "#/definitions/TaskConfig" @@ -54,7 +52,6 @@ "type": "object", "properties": { "args": { - "default": null, "anyOf": [ { "$ref": "#/definitions/TaskCommandArgs" @@ -65,7 +62,6 @@ ] }, "command": { - "default": null, "anyOf": [ { "$ref": "#/definitions/TaskCommandArgs" @@ -76,7 +72,6 @@ ] }, "deps": { - "default": null, "type": [ "array", "null" @@ -86,7 +81,6 @@ } }, "env": { - "default": null, "type": [ "object", "null" @@ -96,7 +90,6 @@ } }, "inputs": { - "default": null, "type": [ "array", "null" @@ -106,33 +99,12 @@ } }, "local": { - "default": false, "type": "boolean" }, "options": { - "default": { - "affectedFiles": null, - "cache": null, - "envFile": null, - "mergeArgs": null, - "mergeDeps": null, - "mergeEnv": null, - "mergeInputs": null, - "mergeOutputs": null, - "outputStyle": null, - "retryCount": null, - "runDepsInParallel": null, - "runInCI": null, - "runFromWorkspaceRoot": null - }, - "allOf": [ - { - "$ref": "#/definitions/TaskOptionsConfig" - } - ] + "$ref": "#/definitions/TaskOptionsConfig" }, "outputs": { - "default": null, "type": [ "array", "null" @@ -142,12 +114,7 @@ } }, "platform": { - "default": "unknown", - "allOf": [ - { - "$ref": "#/definitions/PlatformType" - } - ] + "$ref": "#/definitions/PlatformType" } } }, @@ -183,7 +150,6 @@ "type": "object", "properties": { "affectedFiles": { - "default": null, "anyOf": [ { "$ref": "#/definitions/TaskOptionAffectedFilesConfig" @@ -194,14 +160,12 @@ ] }, "cache": { - "default": null, "type": [ "boolean", "null" ] }, "envFile": { - "default": null, "anyOf": [ { "$ref": "#/definitions/TaskOptionEnvFileConfig" @@ -212,7 +176,6 @@ ] }, "mergeArgs": { - "default": null, "anyOf": [ { "$ref": "#/definitions/TaskMergeStrategy" @@ -223,7 +186,6 @@ ] }, "mergeDeps": { - "default": null, "anyOf": [ { "$ref": "#/definitions/TaskMergeStrategy" @@ -234,7 +196,6 @@ ] }, "mergeEnv": { - "default": null, "anyOf": [ { "$ref": "#/definitions/TaskMergeStrategy" @@ -245,7 +206,6 @@ ] }, "mergeInputs": { - "default": null, "anyOf": [ { "$ref": "#/definitions/TaskMergeStrategy" @@ -256,7 +216,6 @@ ] }, "mergeOutputs": { - "default": null, "anyOf": [ { "$ref": "#/definitions/TaskMergeStrategy" @@ -267,7 +226,6 @@ ] }, "outputStyle": { - "default": null, "anyOf": [ { "$ref": "#/definitions/TaskOutputStyle" @@ -278,7 +236,6 @@ ] }, "retryCount": { - "default": null, "type": [ "integer", "null" @@ -287,21 +244,18 @@ "minimum": 0.0 }, "runDepsInParallel": { - "default": null, "type": [ "boolean", "null" ] }, "runFromWorkspaceRoot": { - "default": null, "type": [ "boolean", "null" ] }, "runInCI": { - "default": null, "type": [ "boolean", "null" diff --git a/website/static/schemas/toolchain.json b/website/static/schemas/toolchain.json index 26e30b75419..6208860d1fc 100644 --- a/website/static/schemas/toolchain.json +++ b/website/static/schemas/toolchain.json @@ -11,7 +11,6 @@ ] }, "node": { - "default": null, "anyOf": [ { "$ref": "#/definitions/NodeConfig" @@ -22,7 +21,6 @@ ] }, "typescript": { - "default": null, "anyOf": [ { "$ref": "#/definitions/TypeScriptConfig" @@ -38,11 +36,9 @@ "type": "object", "properties": { "addEnginesConstraint": { - "default": true, "type": "boolean" }, "aliasPackageNames": { - "default": null, "anyOf": [ { "$ref": "#/definitions/NodeProjectAliasFormat" @@ -53,48 +49,27 @@ ] }, "binExecArgs": { - "default": [], "type": "array", "items": { "type": "string" } }, "dedupeOnLockfileChange": { - "default": true, "type": "boolean" }, "dependencyVersionFormat": { - "default": "workspace-caret", - "allOf": [ - { - "$ref": "#/definitions/NodeVersionFormat" - } - ] + "$ref": "#/definitions/NodeVersionFormat" }, "inferTasksFromScripts": { - "default": false, "type": "boolean" }, "npm": { - "default": { - "version": "8.19.2" - }, - "allOf": [ - { - "$ref": "#/definitions/NpmConfig" - } - ] + "$ref": "#/definitions/NpmConfig" }, "packageManager": { - "default": "npm", - "allOf": [ - { - "$ref": "#/definitions/NodePackageManager" - } - ] + "$ref": "#/definitions/NodePackageManager" }, "pnpm": { - "default": null, "anyOf": [ { "$ref": "#/definitions/PnpmConfig" @@ -105,11 +80,9 @@ ] }, "syncProjectWorkspaceDependencies": { - "default": true, "type": "boolean" }, "syncVersionManagerConfig": { - "default": null, "anyOf": [ { "$ref": "#/definitions/NodeVersionManager" @@ -127,7 +100,6 @@ ] }, "yarn": { - "default": null, "anyOf": [ { "$ref": "#/definitions/YarnConfig" @@ -199,7 +171,6 @@ "type": "object", "properties": { "createMissingConfig": { - "default": true, "type": "boolean" }, "projectConfigFileName": { @@ -215,15 +186,12 @@ "type": "string" }, "routeOutDirToCache": { - "default": false, "type": "boolean" }, "syncProjectReferences": { - "default": true, "type": "boolean" }, "syncProjectReferencesToPaths": { - "default": false, "type": "boolean" } } diff --git a/website/static/schemas/workspace.json b/website/static/schemas/workspace.json index f5298cb34f1..7a8b8fbd9e6 100644 --- a/website/static/schemas/workspace.json +++ b/website/static/schemas/workspace.json @@ -11,78 +11,27 @@ ] }, "generator": { - "default": { - "templates": [ - "./templates" - ] - }, - "allOf": [ - { - "$ref": "#/definitions/GeneratorConfig" - } - ] + "$ref": "#/definitions/GeneratorConfig" }, "hasher": { - "default": { - "optimization": "accuracy" - }, - "allOf": [ - { - "$ref": "#/definitions/HasherConfig" - } - ] + "$ref": "#/definitions/HasherConfig" }, "notifier": { - "default": { - "webhookUrl": null - }, - "allOf": [ - { - "$ref": "#/definitions/NotifierConfig" - } - ] + "$ref": "#/definitions/NotifierConfig" }, "projects": { - "default": {}, - "allOf": [ - { - "$ref": "#/definitions/WorkspaceProjects" - } - ] + "$ref": "#/definitions/WorkspaceProjects" }, "runner": { - "default": { - "archivableTargets": [], - "cacheLifetime": "7 days", - "implicitDeps": [], - "implicitInputs": [ - "package.json", - "/.moon/project.yml", - "/.moon/toolchain.yml", - "/.moon/workspace.yml" - ], - "inheritColorsForPipedTasks": true, - "logRunningCommand": false - }, - "allOf": [ - { - "$ref": "#/definitions/RunnerConfig" - } - ] + "$ref": "#/definitions/RunnerConfig" }, "vcs": { - "default": { - "defaultBranch": "master", - "manager": "git", - "remoteCandidates": [ - "origin", - "upstream" - ] - }, - "allOf": [ - { - "$ref": "#/definitions/VcsConfig" - } + "$ref": "#/definitions/VcsConfig" + }, + "versionConstraint": { + "type": [ + "string", + "null" ] } }, @@ -105,12 +54,7 @@ "type": "object", "properties": { "optimization": { - "default": "accuracy", - "allOf": [ - { - "$ref": "#/definitions/HasherOptimization" - } - ] + "$ref": "#/definitions/HasherOptimization" } } }, @@ -125,7 +69,6 @@ "type": "object", "properties": { "webhookUrl": { - "default": null, "type": [ "string", "null" @@ -137,7 +80,6 @@ "type": "object", "properties": { "archivableTargets": { - "default": [], "type": "array", "items": { "type": "string" @@ -148,7 +90,6 @@ "type": "string" }, "implicitDeps": { - "default": [], "type": "array", "items": { "type": "string" @@ -157,7 +98,7 @@ "implicitInputs": { "default": [ "package.json", - "/.moon/project.yml", + "/.moon/tasks.yml", "/.moon/toolchain.yml", "/.moon/workspace.yml" ], @@ -167,11 +108,9 @@ } }, "inheritColorsForPipedTasks": { - "default": true, "type": "boolean" }, "logRunningCommand": { - "default": false, "type": "boolean" } } @@ -184,12 +123,7 @@ "type": "string" }, "manager": { - "default": "git", - "allOf": [ - { - "$ref": "#/definitions/VcsManager" - } - ] + "$ref": "#/definitions/VcsManager" }, "remoteCandidates": { "default": [ diff --git a/yarn.lock b/yarn.lock index fdbed62555f..9af4a5ad302 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2125,6 +2125,26 @@ __metadata: languageName: node linkType: hard +"@docusaurus/plugin-client-redirects@npm:^2.2.0": + version: 2.2.0 + resolution: "@docusaurus/plugin-client-redirects@npm:2.2.0" + dependencies: + "@docusaurus/core": 2.2.0 + "@docusaurus/logger": 2.2.0 + "@docusaurus/utils": 2.2.0 + "@docusaurus/utils-common": 2.2.0 + "@docusaurus/utils-validation": 2.2.0 + eta: ^1.12.3 + fs-extra: ^10.1.0 + lodash: ^4.17.21 + tslib: ^2.4.0 + peerDependencies: + react: ^16.8.4 || ^17.0.0 + react-dom: ^16.8.4 || ^17.0.0 + checksum: dfe7804af8f621a04840223b7726d3cc7d4a6a68930ecedebeff718fbe0dedfcfc0d8e69fb49bcfb5ec797acb84d5119a9385c39d37676328f1b6a3b99ca6232 + languageName: node + linkType: hard + "@docusaurus/plugin-content-blog@npm:2.2.0": version: 2.2.0 resolution: "@docusaurus/plugin-content-blog@npm:2.2.0" @@ -16082,6 +16102,7 @@ __metadata: dependencies: "@docusaurus/core": ^2.2.0 "@docusaurus/module-type-aliases": ^2.2.0 + "@docusaurus/plugin-client-redirects": ^2.2.0 "@docusaurus/preset-classic": ^2.2.0 "@docusaurus/theme-common": ^2.2.0 "@fortawesome/fontawesome-svg-core": ^6.2.1