From 283e4048e5e34ae1381e73b54a2e62f9ba607f22 Mon Sep 17 00:00:00 2001 From: Nicholas Yang Date: Thu, 8 Dec 2022 17:44:06 -0500 Subject: [PATCH] feature(turborepo): Port rest of CLI (#2733) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Created two separate chains for executing commands: One that uses the parsed arguments from clap that are serialized to json, the other that still uses Cobra. Now to test to ensure that both do the same thing * Adjusted json serialization. Now debugging * Hooked up new CLI to commands * Fixing compile error * fixing lint error * Fixing more Go lint errors * Fixing lint errors * fixing up tests * Only using turbo state with link, login, and logout commands * Reverting changes * Removing more changes * Deleting code and fixing lints * Removed unlink command * Fixing bugs * Reverting more changes * fixed all tests * Refactored away duplicates using CLIConfigProvider interface * Lint fixes * Minor order tweak * Added error if command is not handled * PR feedback * Minor fixes. Adding --__test-run flag * Added workaround for subcommand help * Moved logic around to accomodate login/logout/link/unlink * Added some documentation, removed some printf * Adding more tests. * Hooked up link/login/unlink to --__test-run flag. Also added prysk tests for it. * Split up derive into multiple lines * Added comment explaining clap v3 in Cargo.toml * Ported daemon * Cleaning up code. Removed imports * Fix lints * Fixing lints * Ported prune to Rust CLI * Going all the way. Porting run to Rust CLI and upgrading back to clap v4 * Always gotta be testing * Always be testing. Always. Be. Testing. * Added tests for each singular flag. Now for combination tests * WIP: Hooking up Rust CLI to Go run logic * Disable color * Removed root inference from Go side * Fixing compile errors * Update cli/cmd/turbo/main.go Co-authored-by: Chris Olszewski * Patching up code for run * PR changes * Restored labeler * Restore og.tsx * Reverted run changes that somehow made it in here * Fix run * Update cli/internal/turbostate/turbostate.go Co-authored-by: Chris Olszewski * feat: polyfill `global` with `globalThis` (#2666) This PR changes the ecmascript chunk logic to polyfill `global` with `globalThis`. A more complex and less performant solution (but with the benefit of us knowing the runtime environment) would be to add an effect for simple identifier expressions. * delete IsYarn util (#2668) * feat(docs): new authors & consistent filesnames (#2680) * Added caveat to environment variables docs (#2703) Co-authored-by: Thomas Knickman * Fix publish workflow (#2681) * change from yarn to pnpm (#2686) Co-authored-by: Justin Ridgewell * Reverted workflow changes * Fixing tests. Added run args to base * Trying to fix tests * Rewrote some logic around run args handling * Fixing up tests by adding flags and fixing parsing bugs * Hooked up RepoState to Go code * Fixing e2e tests * Fixing e2e * Gotta build shim, not turbo in package.json * Patched integration test * Reverted Cargo.toml * Cargo.lock too * Fixing tests * Moving turbo binary to shim * Fixed tests and CI * Check for TURBO_BINARY_PATH * Ported shell completions to Rust * Fixed logic issue with TURBO_BINARY_PATH * Created .gitignore file with generated rust and header files * Second try on cleaning up generated files * More CI fixes * Realized we still need some inference * Removed files that are edited by run-examples.sh * Switched order of `cargo fmt --check` and `cargo clippy` because `cargo clippy` generates files needed for `cargo fmt --check`. * Cleaning up changes. * Fix one thing break another * Accept integration changes * Deleting more unused code * Test fixes * No longer need this line now that src/ffi.rs is gitignored * PR feedback * Update cli/internal/run/run.go Co-authored-by: Chris Olszewski * Fixing typo * Merged main * PR feedback * PR feedback * Merge main * Reverted workflow change * add build turbo GH action to use across workflows * use correct build target * Error on invalid unicode instead of lossy conversion * PR feedback * Squashed commit of the following: commit 096b8b8b357abe985e4116108af8a87aaba968cb Author: David Barrat Date: Mon Dec 5 15:29:41 2022 +0100 Docs: Add Authdog to Turbo Showcase page (#2921) [Authdog](https://www.authdog.com/) is an Identity and Access Management as a Service platform, built upon Serverless technologies (AWS Lambda, Vercel, Fastly and Cloudflare Workers). I started looking for alternatives to Nx, some times ago and experimented with Turbo, decided to migrate some projects to this tool, awesome stuff! commit e39d65eb5b97140fe6338dabfbd0ac3be2987d8f Author: Tobias Koppers Date: Mon Dec 5 15:23:40 2022 +0100 enable id reusing (#2895) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> commit 6b99818abd358ebb4fa3506b493e2fae34372d25 Author: Tobias Koppers Date: Mon Dec 5 15:22:53 2022 +0100 Reduce wrapper tasks by eagerly resolving Vcs (#2933) * resolve codegenerateable before calling it * eagerly resolve some constructors to avoid creating many wrapper tasks Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> commit ce4c445cd2c17021b4397c8e3cf93d91921146ef Author: Tobias Koppers Date: Mon Dec 5 15:22:32 2022 +0100 Share TaskInputs between task cache and task (#2923) Move bound task function into TaskState to allow unloading Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> commit e1bf5e2cde7ca2006c8a4c3455dec38e971aa3eb Author: Tobias Koppers Date: Mon Dec 5 14:32:24 2022 +0100 make sure that removing collectibles will cleanup helper entries (#2872) commit 532eff76326fb9237a450345b45073c1061e5a37 Author: Tobias Koppers Date: Mon Dec 5 13:27:22 2022 +0100 Reduce the number of Strings and wrapper tasks (#2834) * use Cow to avoid creating Strings for trait function names * trait calls avoid the resolve trait wrapper task when called on a resolved VC * eagerly resolve some Vc that would otherwise create a lot of wrapper tasks Depends on #2416 commit dc36fc41586e5763520b4a16d249cdd6779bc902 Author: Tobias Koppers Date: Mon Dec 5 11:00:10 2022 +0100 reduce number of allocations (#2833) VecDeque::new always allocates 7 elements commit 4f247be94b03f44765ac8bd334194545cd992b9b Author: Nathan Hammond Date: Mon Dec 5 15:39:15 2022 +0800 Upgrade to Next.js 13 (#2906) This gets our site updated to Next.js 13 and Nextra 2. As a bonus, this should help prevent some of the issues we're seeing in Sentry. commit 1e818068241c308cd3260bd83eba294d890a6151 Author: Tobias Koppers Date: Mon Dec 5 07:42:19 2022 +0100 shrink lists and sets that are stored in Tasks (#2873) Reduces memory usage by 14% commit cac79bbe35c5ee7d2bf14625bb709dff8010b8ad Author: Ahab Date: Sun Dec 4 13:23:26 2022 +0800 make lazy bundling for dynamic import more lazy (#2918) For example: ```js // index.js setTimeout(() => { import('./async.js').then(() => console.log('async.js loaded')) }, 1000) ``` ```js // async.js import './async.css'; console.log('async.js content') ``` For now the graph generated by above code will be like this: Screen Shot 2022-12-03 at 21 22 24 The `ChunkGroup_async` will be a async chunk group of `ChunkGroup_index`, pushed at [turbopack-core/src/chunk/mod.rs#L462](https://github.com/vercel/turbo/blob/b7bcfc312e41367e2ec7f5fb37a6ee88a6b6545a/crates/turbopack-core/src/chunk/mod.rs#L462), and it will have a reference between `ChunkGroup_index` and `ChunkGroup_async`, but `ChunkGroup_async` will also be a chunk group of `ChunkGroup_async-manifest-chunk` created at [turbopack-ecmascript/src/chunk/loader.rs#L165](https://github.com/vercel/turbo/blob/b7bcfc312e41367e2ec7f5fb37a6ee88a6b6545a/crates/turbopack-ecmascript/src/chunk/loader.rs#L165), and will have a reference between `ChunkGroup_async-manifest-chunk` and `ChunkGroup_async`. This leads to when the browser request '/_a8a837.js', turbopack will compile chunks in `ChunkGroup_index` ('/_a8a837.js'), `ChunkGroup_async-manifest-chunk` ('/src_async.js_manifest-chunk.js'), and also chunks in `ChunkGroup_async` ('/src_async.js', '/src_async.css'), because of the reference between `ChunkGroup_index` and `ChunkGroup_async`. But the expected behavior is only compile chunks in `ChunkGroup_index` and `ChunkGroup_async-manifest-chunk`, so this PR deleted the reference between `ChunkGroup_index` and `ChunkGroup_async`, makes the graph be like this: Screen Shot 2022-12-03 at 21 50 29 And makes chunks in `ChunkGroup_async` to be compiled only when the browser request '/src_async.js_manifest-chunk.js'. commit fd09f2e7cba7bcff030c1f10f31fc0155dd055fe Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sun Dec 4 03:26:37 2022 +0000 chore(deps): update dependency @types/node to v18.11.10 (#2928) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Thomas Knickman commit 429e91eae5c313556fe8cb0bde87ab521e28d7cf Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sat Dec 3 22:21:26 2022 -0500 chore(deps): update dependency @babel/core to v7.20.5 (#2919) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commit 6478d61585f414ec9fb6ec822d8c5c052156b690 Author: Tobias Koppers Date: Sat Dec 3 22:11:10 2022 +0100 update chromiumoxide (#2916) updating in hope that this fixes the random errors in test runs commit b7bcfc312e41367e2ec7f5fb37a6ee88a6b6545a Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Sat Dec 3 08:54:50 2022 +0000 chore(deps): update rust crate futures to 0.3.25 (#2915) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [futures](https://rust-lang.github.io/futures-rs) ([source](https://togithub.com/rust-lang/futures-rs)) | dev-dependencies | patch | `0.3.21` -> `0.3.25` | | [futures](https://rust-lang.github.io/futures-rs) ([source](https://togithub.com/rust-lang/futures-rs)) | dependencies | patch | `0.3.21` -> `0.3.25` | | [futures](https://rust-lang.github.io/futures-rs) ([source](https://togithub.com/rust-lang/futures-rs)) | dependencies | patch | `0.3.24` -> `0.3.25` | --- ### ⚠ Dependency Lookup Warnings ⚠ Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information. --- ### Release Notes
rust-lang/futures-rs ### [`v0.3.25`](https://togithub.com/rust-lang/futures-rs/blob/HEAD/CHANGELOG.md#​0325---2022-10-20) [Compare Source](https://togithub.com/rust-lang/futures-rs/compare/0.3.24...0.3.25) - Fix soundness issue in `join!` and `try_join!` macros ([#​2649](https://togithub.com/rust-lang/futures-rs/issues/2649)) - Implement `Clone` for `sink::Drain` ([#​2650](https://togithub.com/rust-lang/futures-rs/issues/2650)) ### [`v0.3.24`](https://togithub.com/rust-lang/futures-rs/blob/HEAD/CHANGELOG.md#​0324---2022-08-29) [Compare Source](https://togithub.com/rust-lang/futures-rs/compare/0.3.23...0.3.24) - Fix incorrect termination of `select_with_strategy` streams ([#​2635](https://togithub.com/rust-lang/futures-rs/issues/2635)) ### [`v0.3.23`](https://togithub.com/rust-lang/futures-rs/blob/HEAD/CHANGELOG.md#​0323---2022-08-14) [Compare Source](https://togithub.com/rust-lang/futures-rs/compare/0.3.22...0.3.23) - Work around MSRV increase due to a cargo bug. ### [`v0.3.22`](https://togithub.com/rust-lang/futures-rs/blob/HEAD/CHANGELOG.md#​0322---2022-08-14) [Compare Source](https://togithub.com/rust-lang/futures-rs/compare/0.3.21...0.3.22) - Fix `Sync` impl of `BiLockGuard` ([#​2570](https://togithub.com/rust-lang/futures-rs/issues/2570)) - Fix partial iteration in `FuturesUnordered` ([#​2574](https://togithub.com/rust-lang/futures-rs/issues/2574)) - Fix false detection of inner panics in `Shared` ([#​2576](https://togithub.com/rust-lang/futures-rs/issues/2576)) - Add `Mutex::lock_owned` and `Mutex::try_lock_owned` ([#​2571](https://togithub.com/rust-lang/futures-rs/issues/2571)) - Add `io::copy_buf_abortable` ([#​2507](https://togithub.com/rust-lang/futures-rs/issues/2507)) - Remove `Unpin` bound from `TryStreamExt::into_async_read` ([#​2599](https://togithub.com/rust-lang/futures-rs/issues/2599)) - Make `run_until_stalled` handle self-waking futures ([#​2593](https://togithub.com/rust-lang/futures-rs/issues/2593)) - Use `FuturesOrdered` in `try_join_all` ([#​2556](https://togithub.com/rust-lang/futures-rs/issues/2556)) - Fix orderings in `LocalPool` waker ([#​2608](https://togithub.com/rust-lang/futures-rs/issues/2608)) - Fix `stream::Chunk` adapters size hints ([#​2611](https://togithub.com/rust-lang/futures-rs/issues/2611)) - Add `push_front` and `push_back` to `FuturesOrdered` ([#​2591](https://togithub.com/rust-lang/futures-rs/issues/2591)) - Deprecate `FuturesOrdered::push` in favor of `FuturesOrdered::push_back` ([#​2591](https://togithub.com/rust-lang/futures-rs/issues/2591)) - Performance improvements ([#​2583](https://togithub.com/rust-lang/futures-rs/issues/2583), [#​2626](https://togithub.com/rust-lang/futures-rs/issues/2626)) - Documentation improvements ([#​2579](https://togithub.com/rust-lang/futures-rs/issues/2579), [#​2604](https://togithub.com/rust-lang/futures-rs/issues/2604), [#​2613](https://togithub.com/rust-lang/futures-rs/issues/2613))
--- ### Configuration 📅 **Schedule**: Branch creation - "after 10pm every weekday,before 5am every weekday,every weekend" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/vercel/turbo). commit 93222f2b22d43bd9c1d917350f810e5398ca9d49 Author: Anthony Shew Date: Fri Dec 2 16:36:55 2022 -0800 feat(docs): document topology outside of a task (#2879) * Docs for topology outside of a task Documentation for behavior in #2855! * Minor cleanup. * Some copy updates and add image. Co-authored-by: Thomas Knickman commit f8aaf81cb7c833f672001eb36d30d700e1cf6cc9 Author: Will Binns-Smith Date: Fri Dec 2 16:32:35 2022 -0800 Link to Turbopack's architecture.md from CONTRIBUTING.md (#2913) commit 07231701892cbca7b73e35bfb490f2514770628e Author: Thomas Knickman Date: Fri Dec 2 16:40:08 2022 -0500 feat(docs): add github (#2912) commit c69298c4a31516129bb62263f163a1da9c5614da Author: OJ Kwon <1210596+kwonoj@users.noreply.github.com> Date: Fri Dec 2 11:58:55 2022 -0800 build(cargo): update swc_core, dependencies to resolve circular deps (#2869) * build(cargo): bump up swc_core * build(cargo): unpin indexmap * build(cargo): update dependencies * style(cargo): adjust format commit 6965cb81ef5693b3e7a23e6a999be04d6590fad5 Author: Leah Date: Fri Dec 2 19:42:05 2022 +0100 set correct cwd for server renderer (#2886) commit 4a3cb941b42923883a665a54270c7b6fdd46034a Author: Leah Date: Fri Dec 2 18:27:02 2022 +0100 fix dynamic paths (#2884) commit eead9063968a3b8571e3ba2c7a897522f890e2fc Author: Nathan Hammond Date: Fri Dec 2 16:09:08 2022 +0800 Fix the missing links. (#2707) This PR does three things: 1. Prevents double redirects by setting the correct destination the first time. 2. Redirects URLs accidentally recreated in the new scope. 🤦‍♂️ 3. Removes a catch-all to trigger any additional missing links to appear. Changes are easy to review commit-by-commit. commit b8c0c3c74636fd4b0586951011919bc05e1f651d Author: Nathan Hammond Date: Fri Dec 2 14:37:03 2022 +0800 Update lint-staged behavior. (#2904) Before #2859: `eslint --quiet --fix` After #2859: `pnpm run lint --quiet --fix --` => `eslint . --ext js,jsx,ts,tsx --quiet --fix --` After this: `eslint --ext js,jsx,ts,tsx --quiet --fix --` Removes the sneaky `.`. commit 336ea22098ff8825e83baa2561d8ec0acf5b52af Author: Nathan Hammond Date: Fri Dec 2 08:33:21 2022 +0800 Add additional detailed warning message if no tasks were run. (#2778) This is a quality of life improvement output log so that you don't have to tease it out from the overall run summary and the situation is more-apparent. commit 9359c46a3663834aefb8df6479ac86a0668925a3 Author: Leah Date: Thu Dec 1 21:02:33 2022 +0100 simplify `next-binding` (#2899) commit 22c1440283ed4dfd1e310210108244c4c12d4c56 Author: Justin Ridgewell Date: Thu Dec 1 13:55:15 2022 -0500 Implement import.meta (#2816) I chose to have the `import.meta.url` to have the relative project path on disk. Webpack makes it the absolute system path, but that would make the JS output system dependent and I didn't like that. Vite doesn't bundle and uses the browser's behavior, which is the dev server path. I'm splitting this from the in-progress PR to implement `new URL(…, import.meta.url)` support. That requires a bunch of changes to the analysis code and a new FS content source, so it's taking longer to ship. Fixes WEB-137. commit 75a7d1ea450cdaa629920464b509f3098997ae06 Author: Thomas Knickman Date: Thu Dec 1 11:40:15 2022 -0500 fix(examples): cra pnpm fix (#2897) * Merged main * Reverting changes that snuck in * Fixing tests * Final fixes for tests * bump timeout on jobs that need to build turborepo * use prebuilt turbo for e2e tests * change when turbo is built * add turbo_tasks State (#2935) add mark_stateful() method to make tasks with state * @next/font [1/n] Add query structure to module requests (#2743) * Add query structure to module requests * Update crates/next-dev/src/lib.rs Co-authored-by: Justin Ridgewell Co-authored-by: Justin Ridgewell * add memory usage tracking (#2865) * @next/font [2/n] Apply next/font swc transform (#2742) * Check in next-font transform from Next.js repo * Use next-font transform * Run transform via custom rule * Place next/font transform behind cargo feature * Remove unused dependencies (#2934) * Remove unused dependencies * Add back lazy static as a dev dep * Add back bench dependencies * skip enabling corepack when building turborepo * Disabled corepack on other node setup action * explicitly disable corepack for examples * nvm * bump timemout for go unit * I am once again trying to get CI to work * force gnu compiler on windows * fix shim build script * fix lockfile * use gcc on windows instead of clang * fix shim * first pass at splitting out shim to library crate * change rust test workflow to not run turbo tests * replace module tests with integration tests * add readme and docs * normalize paths in integration test * Update crates/turborepo-lib/README.md Co-authored-by: Nicholas Yang * Fix Cargo.lock * fix clippy warnings * extend timeout for running examples * Set installed toolchain as default Co-authored-by: Chris Olszewski Co-authored-by: Florentin / 珞辰 Co-authored-by: Chris Olszewski Co-authored-by: Thomas Knickman Co-authored-by: Matt Pocock Co-authored-by: Mehul Kar Co-authored-by: Yota Hada Co-authored-by: Justin Ridgewell Co-authored-by: Tobias Koppers Co-authored-by: Will Binns-Smith Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../actions/build-debug-turborepo/action.yml | 43 + .github/workflows/build_rust.yml | 2 +- .github/workflows/pr-go-e2e-filtered.yml | 19 +- .../workflows/pr-go-integration-filtered.yml | 20 +- .github/workflows/pr-js-tests-filtered.yml | 16 +- .github/workflows/test.yml | 86 +- Cargo.lock | 1132 ++-- cli/.gitignore | 4 +- cli/Makefile | 31 +- cli/cmd/turbo/main.go | 16 +- cli/integration_tests/find_correct_turbo.t | 5 + cli/integration_tests/link.t | 2 +- cli/integration_tests/login.t | 2 +- cli/integration_tests/logout.t | 4 +- cli/integration_tests/no_args.t | 59 + cli/integration_tests/setup.sh | 3 +- cli/integration_tests/turbo_help.t | 349 +- cli/integration_tests/turbo_version.t | 2 - cli/integration_tests/unlink.t | 2 +- cli/internal/cmd/auth/logout.go | 4 +- cli/internal/cmd/auth/unlink.go | 4 +- cli/internal/cmd/info/bin.go | 36 - cli/internal/cmd/root.go | 126 +- cli/internal/cmd/root_test.go | 61 - cli/internal/cmdutil/cmdutil.go | 8 +- cli/internal/config/config_file.go | 6 + cli/internal/daemon/daemon.go | 134 +- cli/internal/daemon/lifecycle.go | 104 +- cli/internal/daemon/status.go | 41 +- cli/internal/fs/path.go | 13 +- cli/internal/login/link.go | 4 +- cli/internal/login/login.go | 4 +- .../packagemanager/packagemanager_test.go | 14 +- cli/internal/prune/prune.go | 86 +- cli/internal/run/run.go | 290 +- cli/internal/run/run_state.go | 7 +- cli/internal/run/run_test.go | 290 - cli/internal/runcache/runcache.go | 56 +- cli/internal/scope/scope.go | 24 +- cli/internal/turbostate/turbostate.go | 94 +- cli/internal/util/parse_concurrency.go | 28 +- cli/internal/util/parse_concurrency_test.go | 4 +- cli/libturbo.h | 82 - cli/package.json | 1 + cli/scripts/monorepo.ts | 5 +- crates/turborepo-lib/Cargo.toml | 22 + crates/turborepo-lib/README.md | 4 + .../turborepo-lib}/src/commands/bin.rs | 0 crates/turborepo-lib/src/commands/mod.rs | 286 + crates/turborepo-lib/src/lib.rs | 1058 ++++ .../turborepo-lib}/src/package_manager.rs | 2 +- examples/basic/package-lock.json | 4787 +++++++++++++++++ package.json | 1 + scripts/run-example.sh | 2 +- shim/.gitignore | 1 + shim/Cargo.toml | 7 +- shim/build.rs | 18 +- shim/src/commands/mod.rs | 1 - shim/src/ffi.rs | 53 - shim/src/main.rs | 817 +-- shim/tests/mod.rs | 96 - turbo.json | 13 +- turbow.js | 4 +- 63 files changed, 7597 insertions(+), 2898 deletions(-) create mode 100644 .github/actions/build-debug-turborepo/action.yml create mode 100644 cli/integration_tests/find_correct_turbo.t create mode 100644 cli/integration_tests/no_args.t delete mode 100644 cli/internal/cmd/info/bin.go delete mode 100644 cli/internal/cmd/root_test.go delete mode 100644 cli/libturbo.h create mode 100644 crates/turborepo-lib/Cargo.toml create mode 100644 crates/turborepo-lib/README.md rename {shim => crates/turborepo-lib}/src/commands/bin.rs (100%) create mode 100644 crates/turborepo-lib/src/commands/mod.rs create mode 100644 crates/turborepo-lib/src/lib.rs rename {shim => crates/turborepo-lib}/src/package_manager.rs (97%) create mode 100644 examples/basic/package-lock.json delete mode 100644 shim/src/commands/mod.rs delete mode 100644 shim/src/ffi.rs delete mode 100644 shim/tests/mod.rs diff --git a/.github/actions/build-debug-turborepo/action.yml b/.github/actions/build-debug-turborepo/action.yml new file mode 100644 index 0000000000000..3785b70fb53df --- /dev/null +++ b/.github/actions/build-debug-turborepo/action.yml @@ -0,0 +1,43 @@ +name: "Turborepo Build Debug" +description: "Builds debug version of turborepo" +inputs: + target: + description: "Compilation target" + required: true + github-token: + description: "GitHub token. You can pass secrets.GITHUB_TOKEN" + required: true +runs: + using: "composite" + steps: + - name: "Setup Node" + uses: ./.github/actions/setup-node + - name: "Setup Go" + uses: ./.github/actions/setup-go + with: + github-token: ${{ inputs.github-token }} + - name: "Setup Rust toolchain" + uses: actions-rs/toolchain@v1 + if: ${{ inputs.target != 'windows' }} + - name: "Set Windows default host to MingW" + if: ${{ inputs.target == 'windows' }} + shell: bash + run: rustup set default-host x86_64-pc-windows-gnu && rustup show + - name: "Setup Rust Cache" + uses: Swatinem/rust-cache@v2 + with: + key: debug-${{ inputs.target }} + - name: Build Turborepo + shell: bash + run: | + cd cli + make turbo + cd .. + - name: Strip Turborepo binary + shell: bash + run: strip target/debug/turbo.exe + if: ${{ inputs.target == 'windows' }} + - name: Strip Turborepo binary + shell: bash + run: strip target/debug/turbo + if: ${{ inputs.target != 'windows' }} diff --git a/.github/workflows/build_rust.yml b/.github/workflows/build_rust.yml index 58f6472c31c9a..e73369518ec47 100644 --- a/.github/workflows/build_rust.yml +++ b/.github/workflows/build_rust.yml @@ -180,7 +180,7 @@ jobs: path: cli/dist-windows-amd64 - name: Perform Release - run: cd cli && make publish-shim + run: cd cli && make publish-turbo env: GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/pr-go-e2e-filtered.yml b/.github/workflows/pr-go-e2e-filtered.yml index d7a193b3584ed..92b382f317c2f 100644 --- a/.github/workflows/pr-go-e2e-filtered.yml +++ b/.github/workflows/pr-go-e2e-filtered.yml @@ -17,19 +17,26 @@ on: jobs: test: - timeout-minutes: 15 - runs-on: ${{ matrix.os }} + timeout-minutes: 30 + runs-on: ${{ matrix.os.runner }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: + - name: ubuntu + runner: ubuntu-latest + - name: macos + runner: macos-latest + - name: windows + runner: windows-latest steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/setup-node - - uses: ./.github/actions/setup-go + - uses: ./.github/actions/build-debug-turborepo with: github-token: "${{ secrets.GITHUB_TOKEN }}" + target: ${{ matrix.os.name }} - name: E2E Tests - run: pnpm -- turbo run e2e --filter=cli + # Turbo has already been built in previous step, no need to rebuild + run: pnpm -- turbo-prebuilt run e2e-prebuilt --filter=cli diff --git a/.github/workflows/pr-go-integration-filtered.yml b/.github/workflows/pr-go-integration-filtered.yml index fa5ab8b052d02..072d744810104 100644 --- a/.github/workflows/pr-go-integration-filtered.yml +++ b/.github/workflows/pr-go-integration-filtered.yml @@ -17,27 +17,21 @@ on: jobs: test: - timeout-minutes: 15 - runs-on: ${{ matrix.os }} + timeout-minutes: 30 + runs-on: ${{ matrix.os.runner }} strategy: fail-fast: false matrix: - os: [ubuntu-latest] + os: + - name: ubuntu + runner: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/setup-node - - uses: ./.github/actions/setup-go + - uses: ./.github/actions/build-debug-turborepo with: github-token: "${{ secrets.GITHUB_TOKEN }}" - - - name: Setup rust - uses: actions-rs/toolchain@v1 - - - name: Setup rust cache - uses: Swatinem/rust-cache@v2 - with: - key: test + target: ${{ matrix.os.name }} - name: Cache Prysk id: cache-prysk diff --git a/.github/workflows/pr-js-tests-filtered.yml b/.github/workflows/pr-js-tests-filtered.yml index fc2201a665ebf..4f6e835afe5bc 100644 --- a/.github/workflows/pr-js-tests-filtered.yml +++ b/.github/workflows/pr-js-tests-filtered.yml @@ -18,11 +18,15 @@ on: jobs: test: timeout-minutes: 30 - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.os.runner }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + os: + - name: ubuntu + runner: ubuntu-latest + - name: macos + runner: macos-latest env: TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} TURBO_TEAM: ${{ secrets.TURBO_TEAM }} @@ -30,6 +34,10 @@ jobs: steps: - uses: actions/checkout@v3 + - uses: ./.github/actions/build-debug-turborepo + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + target: ${{ matrix.os.name }} - name: checkout # We want to fetch all of the commits in PR and the commit it's based on # If this isn't a PR, then this is a push and we check against the previous commit @@ -41,10 +49,6 @@ jobs: else git fetch --no-tags --prune --progress --depth=2 fi - - uses: ./.github/actions/setup-node - - uses: ./.github/actions/setup-go - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" # Note this runs nothing on push since event is push and not pull_request and ...[] matches nothing? # For push we should just do ..[HEAD^] diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3d38c2d428f95..ec53badaefeee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -167,18 +167,24 @@ jobs: name: Go Unit Tests needs: determine_jobs if: needs.determine_jobs.outputs.go == 'true' - timeout-minutes: 15 - runs-on: ${{ matrix.os }} + timeout-minutes: 30 + runs-on: ${{ matrix.os.runner }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: + - name: ubuntu + runner: ubuntu-latest + - name: macos + runner: macos-latest + - name: windows + runner: windows-latest steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/setup-node - - uses: ./.github/actions/setup-go + - uses: ./.github/actions/build-debug-turborepo with: + target: ${{ matrix.os.name }} github-token: "${{ secrets.GITHUB_TOKEN }}" - run: pnpm -- turbo run test --filter=cli --color @@ -187,35 +193,51 @@ jobs: name: Go Cli Examples needs: determine_jobs if: needs.determine_jobs.outputs.examples == 'true' - timeout-minutes: 15 + timeout-minutes: 30 strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + os: + - name: ubuntu + runner: ubuntu-latest + - name: macos + runner: macos-latest manager: [yarn, npm] example: [with-yarn, with-npm, non-monorepo] include: - - os: ubuntu-latest + - os: + name: ubuntu + runner: ubuntu-latest manager: pnpm example: basic - - os: macos-latest + - os: + name: macos + runner: macos-latest manager: pnpm example: basic - - os: ubuntu-latest + - os: + name: ubuntu + runner: ubuntu-latest manager: pnpm example: kitchen-sink - - os: macos-latest + - os: + name: macos + runner: macos-latest manager: pnpm example: kitchen-sink - - os: ubuntu-latest + - os: + name: ubuntu + runner: ubuntu-latest manager: pnpm example: with-svelte - - os: macos-latest + - os: + name: macos + runner: macos-latest manager: pnpm example: with-svelte - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.os.runner }} steps: # Used by scripts/check-examples.sh - name: Install Sponge @@ -230,9 +252,10 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Setup Go - uses: ./.github/actions/setup-go + - name: Build Turborepo + uses: ./.github/actions/build-debug-turborepo with: + target: ${{ matrix.os.name }} github-token: "${{ secrets.GITHUB_TOKEN }}" - name: Setup Pnpm @@ -245,6 +268,10 @@ jobs: run: | mkdir -p `pnpm store path` + - name: Disable corepack + shell: bash + run: corepack disable + - name: Setup Node.js uses: actions/setup-node@v2 with: @@ -325,18 +352,18 @@ jobs: - name: Install cargo rustfmt run: rustup component add rustfmt - - name: Run cargo fmt check - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --check - - name: Run cargo clippy uses: actions-rs/cargo@v1 with: command: clippy args: --workspace --all-targets + - name: Run cargo fmt check + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --check + - name: Count clippy warnings run: | count="0" @@ -432,11 +459,6 @@ jobs: - name: Setup Rust uses: actions-rs/toolchain@v1 - - name: Setup Go - uses: ./.github/actions/setup-go - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - name: Setup Node.js uses: ./.github/actions/setup-node @@ -456,7 +478,6 @@ jobs: - name: Prepare toolchain on Windows run: | pnpx node-gyp install - choco install protoc -y echo 'node-linker = "hoisted"' > crates/turbopack/tests/node-file-trace/.npmrc if: matrix.os.name == 'windows' @@ -484,7 +505,8 @@ jobs: timeout-minutes: 120 with: command: nextest - args: run --workspace --release --no-fail-fast + # We exclude turbo as it requires linking Go and all logic resides in turborepo-lib + args: run --workspace --release --no-fail-fast --exclude turbo rust_test_bench: needs: [determine_jobs, rust_prepare] @@ -579,6 +601,7 @@ jobs: uses: actions-rs/toolchain@v1 with: target: ${{ matrix.os.target }} + default: true - name: Install musl tools run: | @@ -895,10 +918,9 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - uses: ./.github/actions/setup-node - - - uses: ./.github/actions/setup-go + - uses: ./.github/actions/build-debug-turborepo with: + target: ubuntu github-token: "${{ secrets.GITHUB_TOKEN }}" - name: Format check diff --git a/Cargo.lock b/Cargo.lock index 01d35baf68d9d..96817cf3a8aaf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -41,18 +41,18 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.18" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ "memchr", ] [[package]] name = "android_system_properties" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7ed72e1635e121ca3e79420540282af22da58be50de153d36f81ddc6b83aa9e" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" dependencies = [ "libc", ] @@ -87,9 +87,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.65" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602" +checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" dependencies = [ "backtrace", ] @@ -133,9 +133,9 @@ dependencies = [ [[package]] name = "assert_cmd" -version = "2.0.6" +version = "2.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba45b8163c49ab5f972e59a8a5a03b6d2972619d486e19ec9fe744f7c2753d3c" +checksum = "fa3d466004a8b4cb1bc34044240a2fd29d17607e2e3bd613eb44fd48e8100da3" dependencies = [ "bstr 1.0.1", "doc-comment", @@ -153,10 +153,10 @@ checksum = "cf94863c5fdfee166d0907c44e5fee970123b2b7307046d35d1e671aa93afbba" dependencies = [ "darling 0.13.4", "pmutil", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", "swc_macros_common", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -299,9 +299,9 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -312,13 +312,13 @@ checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" [[package]] name = "async-trait" -version = "0.1.56" +version = "0.1.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716" +checksum = "31e6e93155431f3931513b243d371981bb2770112b370c82745a1d19d2f99364" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -347,7 +347,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi 0.3.9", ] @@ -366,9 +366,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7862e21c893d65a1650125d157eaeec691439379a1cee17ee49031b79236ada4" dependencies = [ "proc-macro-error", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -379,9 +379,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "axum" -version = "0.5.17" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acee9fd5073ab6b045a275b3e709c163dd36c90685219cb21804a147b58dba43" +checksum = "08b108ad2665fa3f6e6a517c3d80ec3e77d224c47d605167aefaa5d7ef97fa48" dependencies = [ "async-trait", "axum-core", @@ -391,15 +391,15 @@ dependencies = [ "http", "http-body", "hyper", - "itoa 1.0.3", + "itoa 1.0.4", "matchit", "memchr", "mime", "percent-encoding", "pin-project-lite", + "rustversion", "serde", "sync_wrapper", - "tokio", "tower", "tower-http", "tower-layer", @@ -408,9 +408,9 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.2.9" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e5939e02c56fecd5c017c37df4238c0a839fa76b7f97acdd7efb804fd181cc" +checksum = "79b8558f5a0581152dc94dcd289132a1d377494bdeafcd41869b3258e3e2ad92" dependencies = [ "async-trait", "bytes", @@ -418,6 +418,7 @@ dependencies = [ "http", "http-body", "mime", + "rustversion", "tower-layer", "tower-service", ] @@ -432,7 +433,7 @@ dependencies = [ "cc", "cfg-if 1.0.0", "libc", - "miniz_oxide", + "miniz_oxide 0.5.4", "object 0.29.0", "rustc-demangle", ] @@ -451,15 +452,9 @@ checksum = "d27c3610c36aee21ce8ac510e6224498de4228ad772a171ed65643a24693a5a8" [[package]] name = "base64" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" - -[[package]] -name = "base64" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "basic-cookies" @@ -494,12 +489,12 @@ dependencies = [ "lazycell", "log", "peeking_take_while", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", "regex", "rustc-hash", "shlex", - "syn 1.0.99", + "syn 1.0.105", "which", ] @@ -561,9 +556,9 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" dependencies = [ "generic-array", ] @@ -638,9 +633,9 @@ checksum = "832133bbabbbaa9fbdba793456a2827627a7d2b8fb96032fa1e7666d7895832b" [[package]] name = "bumpalo" -version = "3.10.0" +version = "3.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" [[package]] name = "bytecheck" @@ -658,9 +653,9 @@ version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13e576ebe98e605500b3c8041bb888e966653577172df6dd97398714eb30b9bf" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -671,9 +666,9 @@ checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c" [[package]] name = "bytemuck" -version = "1.12.1" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f5715e491b5a1598fc2bef5a606847b5dc1d48ea625bd3c02c00de8285591da" +checksum = "aaa3a8d9a1ca92e282c96a32d6511b695d7d994d1d102ba85d279f9b2756947f" [[package]] name = "byteorder" @@ -683,9 +678,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" [[package]] name = "cache-padded" @@ -695,25 +690,16 @@ checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" [[package]] name = "cargo-lock" -version = "8.0.2" +version = "8.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c4c54d47a4532db3494ef7332c257ab57b02750daae3250d49e01ee55201ce8" +checksum = "031718ddb8f78aa5def78a09e90defe30151d1f6c672f937af4dd916429ed996" dependencies = [ - "semver 1.0.13", + "semver 1.0.14", "serde", "toml", "url", ] -[[package]] -name = "cast" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c24dab4283a142afa2fdca129b80ad2c6284e073930f964c3a1293c225ee39a" -dependencies = [ - "rustc_version 0.4.0", -] - [[package]] name = "cast" version = "0.3.0" @@ -728,9 +714,9 @@ checksum = "a2698f953def977c68f935bb0dfa959375ad4638570e969e2f1e9f433cbf1af6" [[package]] name = "cc" -version = "1.0.73" +version = "1.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" [[package]] name = "cesu8" @@ -766,7 +752,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5506e432f602b1747e8a0d60ac6607c6977af4ee9720237764170305323e62" dependencies = [ "async-tungstenite", - "base64 0.13.0", + "base64", "cfg-if 1.0.0", "chromiumoxide_cdp", "chromiumoxide_types", @@ -806,7 +792,7 @@ dependencies = [ "either", "heck", "once_cell", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", "regex", "serde", @@ -833,7 +819,7 @@ dependencies = [ "js-sys", "num-integer", "num-traits", - "time 0.1.44", + "time 0.1.45", "wasm-bindgen", "winapi 0.3.9", ] @@ -868,87 +854,67 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" -dependencies = [ - "atty", - "bitflags", - "clap_derive 3.2.18", - "clap_lex 0.2.4", - "indexmap", - "once_cell", - "strsim", - "termcolor", - "textwrap 0.16.0", -] - -[[package]] -name = "clap" -version = "4.0.18" +version = "4.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335867764ed2de42325fafe6d18b8af74ba97ee0c590fa016f157535b42ab04b" +checksum = "4d63b9e9c07271b9957ad22c173bae2a4d9a81127680962039296abcd2f8251d" dependencies = [ - "atty", "bitflags", - "clap_derive 4.0.18", - "clap_lex 0.3.0", + "clap_derive", + "clap_lex", + "is-terminal", "once_cell", "strsim", "termcolor", ] [[package]] -name = "clap_derive" -version = "3.2.18" +name = "clap_complete" +version = "4.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" +checksum = "b7b3c9eae0de7bf8e3f904a5e40612b21fb2e2e566456d177809a48b892d24da" dependencies = [ - "heck", - "proc-macro-error", - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.99", + "clap 4.0.29", ] [[package]] name = "clap_derive" -version = "4.0.18" +version = "4.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16a1b0f6422af32d5da0c58e2703320f379216ee70198241c84173a8c5ac28f3" +checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" dependencies = [ "heck", "proc-macro-error", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] name = "clap_lex" -version = "0.2.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" dependencies = [ "os_str_bytes", ] [[package]] -name = "clap_lex" -version = "0.3.0" +name = "cmake" +version = "0.1.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" +checksum = "db34956e100b30725f2eb215f90d4871051239535632f84fea3bc92722c66b7c" dependencies = [ - "os_str_bytes", + "cc", ] [[package]] -name = "cmake" -version = "0.1.48" +name = "codespan-reporting" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" dependencies = [ - "cc", + "termcolor", + "unicode-width", ] [[package]] @@ -970,9 +936,9 @@ dependencies = [ [[package]] name = "combine" -version = "4.6.4" +version = "4.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a604e93b79d1808327a6fca85a6f2d69de66461e7620f5a4cbf5fb4d1d7c948" +checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" dependencies = [ "bytes", "memchr", @@ -980,9 +946,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "1.2.2" +version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" +checksum = "af4780a44ab5696ea9e28294517f1fffb421a83a25af521333c838635509db9c" dependencies = [ "cache-padded", ] @@ -1134,9 +1100,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" dependencies = [ "libc", ] @@ -1231,7 +1197,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b01d6de93b2b6c65e17c634a26653a29d107b3c98c607c765bf38d041531cd8f" dependencies = [ "atty", - "cast 0.3.0", + "cast", "clap 2.34.0", "criterion-plot", "csv", @@ -1254,11 +1220,11 @@ dependencies = [ [[package]] name = "criterion-plot" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d00996de9f2f7559f7f4dc286073197f83e92256a59ed395f9aac01fe717da57" +checksum = "2673cc8207403546f45f5fd319a974b1e6983ad1a3ee7e6041650013be041876" dependencies = [ - "cast 0.2.7", + "cast", "itertools", ] @@ -1285,26 +1251,24 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.10" +version = "0.9.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "045ebe27666471bb549370b4b0b3e51b07f56325befa4284db65fc89c02511b1" +checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" dependencies = [ "autocfg", "cfg-if 1.0.0", "crossbeam-utils", - "memoffset", - "once_cell", + "memoffset 0.7.1", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.11" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" dependencies = [ "cfg-if 1.0.0", - "once_cell", ] [[package]] @@ -1316,7 +1280,7 @@ dependencies = [ "bitflags", "crossterm_winapi", "libc", - "mio 0.8.4", + "mio 0.8.5", "parking_lot", "signal-hook", "signal-hook-mio", @@ -1372,12 +1336,12 @@ dependencies = [ [[package]] name = "ctor" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdffe87e1d521a10f9696f833fe502293ea446d7f256c06128293a4119bdf4cb" +checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" dependencies = [ "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -1417,6 +1381,50 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "cxx" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdf07d07d6531bfcdbe9b8b739b104610c6508dcc4d63b410585faf338241daf" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2eb5b96ecdc99f72657332953d4d9c50135af1bac34277801cc3937906ebd39" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2 1.0.47", + "quote 1.0.21", + "scratch", + "syn 1.0.105", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac040a39517fd1674e0f32177648334b0f4074625b5588a64519804ba0553b12" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1362b0ddcfc4eb0a1f57b68bd77dd99f0e826958a96abd0ae9bd092e114ffed6" +dependencies = [ + "proc-macro2 1.0.47", + "quote 1.0.21", + "syn 1.0.105", +] + [[package]] name = "darling" version = "0.13.4" @@ -1445,10 +1453,10 @@ checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", "strsim", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -1459,9 +1467,9 @@ checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -1472,7 +1480,7 @@ checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ "darling_core 0.13.4", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -1483,7 +1491,7 @@ checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" dependencies = [ "darling_core 0.14.2", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -1519,9 +1527,9 @@ checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" [[package]] name = "digest" -version = "0.10.3" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" dependencies = [ "block-buffer", "crypto-common", @@ -1537,15 +1545,6 @@ dependencies = [ "dirs-sys", ] -[[package]] -name = "dirs" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" -dependencies = [ - "dirs-sys", -] - [[package]] name = "dirs-next" version = "2.0.0" @@ -1601,12 +1600,9 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "dotenvy" -version = "0.15.5" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9155c8f4dc55c7470ae9da3f63c6785245093b3f6aeb0f5bf2e968efbba314" -dependencies = [ - "dirs", -] +checksum = "03d8c417d7a8cb362e0c37e5d815f5eb7c37f79ff93707329d5a194e42e54ca0" [[package]] name = "dwrote" @@ -1634,9 +1630,9 @@ checksum = "04cc9717c61d2908f50d16ebb5677c7e82ea2bdf7cb52f66b30fe079f3212e16" [[package]] name = "either" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "ena" @@ -1667,9 +1663,9 @@ dependencies = [ [[package]] name = "enum-iterator" -version = "1.2.0" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91a4ec26efacf4aeff80887a175a419493cb6f8b5480d26387eb0bd038976187" +checksum = "45a0ac4aeb3a18f92eaf09c6bb9b3ac30ff61ca95514fc58cbead1c9a6bf5401" dependencies = [ "enum-iterator-derive 1.1.0", ] @@ -1680,9 +1676,9 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c134c37760b27a871ba422106eedbb8247da973a09e82558bf26d619c882b159" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -1691,9 +1687,9 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "828de45d0ca18782232dfb8f3ea9cc428e8ced380eb26a520baaacfc70de39ce" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -1703,9 +1699,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b940da354ae81ef0926c5eaa428207b8f4f091d3956c891dfbd124162bed99" dependencies = [ "pmutil", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "swc_macros_common", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -1724,16 +1720,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03e7b551eba279bf0fa88b83a46330168c1560a52a94f5126f892f0b364ab3e0" dependencies = [ "darling 0.14.2", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] name = "erased-serde" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81d013529d5574a60caeda29e179e695125448e5de52e3874f7b4c1d7360e18e" +checksum = "54558e0ba96fbe24280072642eceb9d7d442e32c7ec0ea9e7ecd7b4ea2cf4e11" dependencies = [ "serde", ] @@ -1782,14 +1778,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94a7bbaa59354bc20dd75b67f23e2797b4490e9d6928203fb105c79e448c86c" +checksum = "4b9663d381d07ae25dc88dbdf27df458faa83a9b25336bcac83d5e452b5fc9d3" dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall", - "windows-sys 0.36.1", + "windows-sys 0.42.0", ] [[package]] @@ -1800,12 +1796,12 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.6.2", ] [[package]] @@ -1901,14 +1897,14 @@ dependencies = [ [[package]] name = "from_variant" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0951635027ca477be98f8774abd6f0345233439d63f307e47101acb40c7cc63d" +checksum = "f0981e470d2ab9f643df3921d54f1952ea100c39fdb6a3fdc820e20d2291df6c" dependencies = [ "pmutil", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "swc_macros_common", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -2021,9 +2017,9 @@ version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -2103,9 +2099,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -2121,9 +2117,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e45727250e75cc04ff2846a66397da8ef2b3db8e40e0cef4df67950a07621eb9" dependencies = [ "proc-macro-error", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -2167,9 +2163,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" +checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" dependencies = [ "bytes", "fnv", @@ -2224,11 +2220,11 @@ dependencies = [ [[package]] name = "hdrhistogram" -version = "7.5.0" +version = "7.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31672b7011be2c4f7456c4ddbcb40e7e9a4a9fad8efe49a6ebaf5f307d0109c0" +checksum = "7f19b9f54f7c7f55e31401bb647626ce0cf0f67b0004982ce815b3ee72a02aa8" dependencies = [ - "base64 0.13.0", + "base64", "byteorder", "flate2", "nom", @@ -2250,6 +2246,15 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + [[package]] name = "hex" version = "0.4.3" @@ -2264,7 +2269,7 @@ checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ "bytes", "fnv", - "itoa 1.0.3", + "itoa 1.0.4", ] [[package]] @@ -2286,9 +2291,9 @@ checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" [[package]] name = "httparse" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" @@ -2305,7 +2310,7 @@ dependencies = [ "assert-json-diff", "async-object-pool", "async-trait", - "base64 0.13.0", + "base64", "basic-cookies", "crossbeam-utils", "form_urlencoded", @@ -2332,9 +2337,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.20" +version = "0.14.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" +checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" dependencies = [ "bytes", "futures-channel", @@ -2345,7 +2350,7 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 1.0.3", + "itoa 1.0.4", "pin-project-lite", "socket2", "tokio", @@ -2381,9 +2386,9 @@ dependencies = [ [[package]] name = "hyper-tungstenite" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36692e7f740cd10fbe3f84f7cb7bfec2a71f929e72f97c19824d3f7f45aeec9b" +checksum = "d62004bcd4f6f85d9e2aa4206f1466ee67031f5ededcb6c6e62d48f9306ad879" dependencies = [ "hyper", "pin-project", @@ -2394,17 +2399,28 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.44" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf7d67cf4a22adc5be66e75ebdf769b3f2ea032041437a7061f97a63dad4b" +checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" dependencies = [ "android_system_properties", "core-foundation-sys", + "iana-time-zone-haiku", "js-sys", "wasm-bindgen", "winapi 0.3.9", ] +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -2429,9 +2445,9 @@ checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" [[package]] name = "image" -version = "0.24.3" +version = "0.24.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e30ca2ecf7666107ff827a8e481de6a132a9b687ed3bb20bb1c144a36c00964" +checksum = "69b7ea949b537b0fd0af141fff8c77690f2ce96f4f41f042ccb6c69c6c965945" dependencies = [ "bytemuck", "byteorder", @@ -2444,20 +2460,20 @@ dependencies = [ [[package]] name = "include_dir" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "482a2e29200b7eed25d7fdbd14423326760b7f6658d21a4cf12d55a50713c69f" +checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" dependencies = [ "include_dir_macros", ] [[package]] name = "include_dir_macros" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e074c19deab2501407c91ba1860fa3d6820bfde307db6d8cb851b55a10be89b" +checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", ] @@ -2557,9 +2573,21 @@ checksum = "1c068d4c6b922cd6284c609cfa6dec0e41615c9c5a1a4ba729a970d8daba05fb" dependencies = [ "Inflector", "pmutil", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", +] + +[[package]] +name = "is-terminal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927609f78c2913a6f6ac3c27a4fe87f43e2a35367c0c4b0f8265e8f49a104330" +dependencies = [ + "hermit-abi 0.2.6", + "io-lifetimes", + "rustix", + "windows-sys 0.42.0", ] [[package]] @@ -2612,9 +2640,9 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "itoa" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" [[package]] name = "jni" @@ -2638,15 +2666,15 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jpeg-decoder" -version = "0.2.6" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9478aa10f73e7528198d75109c8be5cd7d15fb530238040148d5f9a22d4c5b3b" +checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" [[package]] name = "js-sys" -version = "0.3.59" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" dependencies = [ "wasm-bindgen", ] @@ -2816,9 +2844,9 @@ checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" [[package]] name = "libloading" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ "cfg-if 1.0.0", "winapi 0.3.9", @@ -2862,6 +2890,15 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "link-cplusplus" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" +dependencies = [ + "cc", +] + [[package]] name = "linked-hash-map" version = "0.5.6" @@ -2912,7 +2949,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0fbfc88337168279f2e9ae06e157cfed4efd3316e14dc96ed074d4f2e6c5952" dependencies = [ "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -2957,15 +2994,15 @@ dependencies = [ [[package]] name = "matchit" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb" +checksum = "b87248edafb776e59e6ee64a79086f65890d3510f2c656c000bf2a7e8a0aea40" [[package]] name = "md4" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93a5f5240a3fa1cb324a28cb42b1934750a093d7ad200ba052deecf4aff7104b" +checksum = "7da5ac363534dce5fabf69949225e174fbf111a498bf0ff794c8ea1fba9f3dda" dependencies = [ "digest", ] @@ -2978,7 +3015,7 @@ checksum = "0c4bbd566f0dd80e0701ef5ca305e4404805eb37b95a6246ac1605acb71a6e9b" dependencies = [ "markdown", "serde", - "swc_core 0.44.4", + "swc_core 0.44.6", ] [[package]] @@ -3005,6 +3042,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + [[package]] name = "miette" version = "4.7.1" @@ -3020,7 +3066,7 @@ dependencies = [ "supports-hyperlinks", "supports-unicode", "terminal_size 0.1.17", - "textwrap 0.15.0", + "textwrap 0.15.2", "thiserror", "unicode-width", ] @@ -3031,9 +3077,9 @@ version = "4.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b5bc45b761bcf1b5e6e6c4128cd93b84c218721a8d9b894aa0aff4ed180174c" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -3089,9 +3135,18 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" +checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" +dependencies = [ + "adler", +] + +[[package]] +name = "miniz_oxide" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" dependencies = [ "adler", ] @@ -3117,14 +3172,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.36.1", + "windows-sys 0.42.0", ] [[package]] @@ -3200,9 +3255,9 @@ checksum = "39f3d8b02ef355898ea98f69082d9a183c8701c836942c2daf3e92364e88a0fa" dependencies = [ "convert_case", "napi-derive-backend", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -3213,10 +3268,10 @@ checksum = "6c35640513eb442fcbd1653a1c112fb6b2cc12b54d82f9c141f5859c721cab36" dependencies = [ "convert_case", "once_cell", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", "regex", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -3288,9 +3343,9 @@ checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" dependencies = [ "darling 0.13.4", "proc-macro-crate", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -3304,9 +3359,9 @@ dependencies = [ [[package]] name = "net2" -version = "0.2.37" +version = "0.2.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" +checksum = "74d0df99cfcd2530b2e694f6e17e7f37b8e26bb23983ac530c0c97408837c631" dependencies = [ "cfg-if 0.1.10", "libc", @@ -3321,9 +3376,12 @@ checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" [[package]] name = "newline-converter" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6f81c2b19eebbc4249b3ca6aff70ae05bf18d6a99b7cc63cf0248774e640565" +checksum = "1f71d09d5c87634207f894c6b31b6a2b2c64ea3bdcf71bd5599fdbbe1600c00f" +dependencies = [ + "unicode-segmentation", +] [[package]] name = "next-binding" @@ -3373,7 +3431,7 @@ version = "0.1.0" dependencies = [ "anyhow", "chromiumoxide", - "clap 4.0.18", + "clap 4.0.29", "console-subscriber", "criterion", "fs_extra", @@ -3421,15 +3479,15 @@ dependencies = [ [[package]] name = "nix" -version = "0.25.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e322c04a9e3440c327fca7b6c8a63e6890a32fa2ad689db972425f07e0d22abb" +checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" dependencies = [ "autocfg", "bitflags", "cfg-if 1.0.0", "libc", - "memoffset", + "memoffset 0.6.5", "pin-utils", ] @@ -3438,7 +3496,7 @@ name = "node-file-trace" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.0.18", + "clap 4.0.29", "console-subscriber", "serde", "serde_json", @@ -3502,6 +3560,16 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi 0.3.9", +] + [[package]] name = "num-bigint" version = "0.4.3" @@ -3546,11 +3614,11 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", ] @@ -3570,18 +3638,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", -] - -[[package]] -name = "num_threads" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" -dependencies = [ - "libc", + "syn 1.0.105", ] [[package]] @@ -3607,9 +3666,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" [[package]] name = "oorandom" @@ -3619,9 +3678,9 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "openssl" -version = "0.10.43" +version = "0.10.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020433887e44c27ff16365eaa2d380547a94544ad509aff6eb5b6e3e0b27b376" +checksum = "29d971fd5722fec23977260f6e81aa67d2f22cadbdc2aa049f1022d9a3be1566" dependencies = [ "bitflags", "cfg-if 1.0.0", @@ -3638,9 +3697,9 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -3651,9 +3710,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.78" +version = "0.9.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07d5c8cb6e57b3a3612064d7b18b117912b4ce70955c2504d4b741c9e244b132" +checksum = "5454462c0eced1e97f2ec09036abc8da362e66802f66fd20f86854d9d8cbcbc4" dependencies = [ "autocfg", "cc", @@ -3664,9 +3723,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.1.0" +version = "6.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21326818e99cfe6ce1e524c2a805c189a99b5ae555a35d19f9a284b427d86afa" +checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" [[package]] name = "output_vt100" @@ -3677,11 +3736,17 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "owo-colors" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "decf7381921fea4dcb2549c5667eda59b3ec297ab7e2b5fc33eac69d2e7da87b" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" [[package]] name = "papergrid" @@ -3714,15 +3779,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.3" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall", "smallvec", - "windows-sys 0.36.1", + "windows-sys 0.42.0", ] [[package]] @@ -3758,9 +3823,9 @@ dependencies = [ [[package]] name = "patricia_tree" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52c4b8ef84caee22395fa083b7d8ee9351e71cdf69a46c832528acdcac402117" +checksum = "d04fae9b4b7986e4aa4c7abc410737039eddfb030fb184dc63efc3708055612c" dependencies = [ "bitflags", ] @@ -3779,9 +3844,9 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pest" -version = "2.4.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc7bc69c062e492337d74d59b120c274fd3d261b6bf6d3207d499b4b379c41a" +checksum = "cc8bed3549e0f9b0a2a78bf7c0018237a2cdf085eecbbc048e52612438e4e9d0" dependencies = [ "thiserror", "ucd-trie", @@ -3789,9 +3854,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.4.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b75706b9642ebcb34dab3bc7750f811609a0eb1dd8b88c2d15bf628c1c65b2" +checksum = "cdc078600d06ff90d4ed238f0119d84ab5d43dbaad278b0e33a8820293b32344" dependencies = [ "pest", "pest_generator", @@ -3799,33 +3864,33 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.4.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f9272122f5979a6511a749af9db9bfc810393f63119970d7085fed1c4ea0db" +checksum = "28a1af60b1c4148bb269006a750cff8e2ea36aff34d2d96cf7be0b14d1bed23c" dependencies = [ "pest", "pest_meta", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] name = "pest_meta" -version = "2.4.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8717927f9b79515e565a64fe46c38b8cd0427e64c40680b14a7365ab09ac8d" +checksum = "fec8605d59fc2ae0c6c1aefc0c7c7a9769732017c0ce07f7a9cfffa7b4404f20" dependencies = [ "once_cell", "pest", - "sha1 0.10.4", + "sha1 0.10.5", ] [[package]] name = "petgraph" -version = "0.6.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" +checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" dependencies = [ "fixedbitset", "indexmap", @@ -3861,9 +3926,9 @@ dependencies = [ "phf_generator", "phf_shared", "proc-macro-hack", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -3883,22 +3948,22 @@ checksum = "db8bcd96cb740d03149cbad5518db9fd87126a10ab519c011893b1754134c468" [[package]] name = "pin-project" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78203e83c48cffbe01e4a2d35d566ca4de445d79a85372fc64e378bfc812a260" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "710faf75e1b33345361201d36d04e98ac1ed8909151a017ed384700836104c74" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -3915,9 +3980,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" [[package]] name = "plotters" @@ -3958,9 +4023,9 @@ dependencies = [ [[package]] name = "plotters-svg" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0918736323d1baff32ee0eade54984f6f201ad7e97d5cfb5d6ab4a358529615" +checksum = "f9a81d2759aae1dae668f783c308bc5c8ebd191ff4184aaa1b37f65a6ae5a56f" dependencies = [ "plotters-backend", ] @@ -3971,21 +4036,21 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3894e5d549cccbe44afecf72922f277f603cd4bb0219c8342631ef18fffbe004" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] name = "png" -version = "0.17.6" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0e7f4c94ec26ff209cee506314212639d6c91b80afb82984819fafce9df01c" +checksum = "5d708eaf860a19b19ce538740d2b4bdeeb8337fa53f7738455e706623ad5c638" dependencies = [ "bitflags", "crc32fast", "flate2", - "miniz_oxide", + "miniz_oxide 0.6.2", ] [[package]] @@ -4013,9 +4078,9 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "precomputed-hash" @@ -4025,9 +4090,9 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "predicates" -version = "2.1.2" +version = "2.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab68289ded120dcbf9d571afcf70163233229052aec9b08ab09532f698d0e1e6" +checksum = "f54fc5dc63ed3bbf19494623db4f3af16842c0d975818e469022d09e53f0aa05" dependencies = [ "difflib", "float-cmp", @@ -4039,15 +4104,15 @@ dependencies = [ [[package]] name = "predicates-core" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6e7125585d872860e9955ca571650b27a4979c5823084168c5ed5bbfb016b56" +checksum = "72f883590242d3c6fc5bf50299011695fa6590c2c70eac95ee1bdb9a733ad1a2" [[package]] name = "predicates-tree" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad3f7fa8d61e139cbc7c3edfebf3b6678883a53f5ffac65d1259329a93ee43a5" +checksum = "54ff541861505aabf6ea722d2131ee980b8276e10a1297b94e896dd8b621850d" dependencies = [ "predicates-core", "termtree", @@ -4065,7 +4130,7 @@ dependencies = [ "dashmap", "from_variant", "once_cell", - "semver 1.0.13", + "semver 1.0.14", "serde", "st-map", "tracing", @@ -4085,10 +4150,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.1.3" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" +checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" dependencies = [ + "once_cell", "thiserror", "toml", ] @@ -4100,9 +4166,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", "version_check", ] @@ -4112,7 +4178,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", "version_check", ] @@ -4134,18 +4200,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.43" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" dependencies = [ "unicode-ident", ] [[package]] name = "prost" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0841812012b2d4a6145fae9a6af1534873c32aa67fff26bd09f8fa42c83f95a" +checksum = "c0b18e655c21ff5ac2084a5ad0611e827b3f92badf79f4910b5a5c58f4d87ff0" dependencies = [ "bytes", "prost-derive", @@ -4159,9 +4225,9 @@ checksum = "164ae68b6587001ca506d3bf7f1000bfa248d0e1217b618108fba4ec1d0cc306" dependencies = [ "anyhow", "itertools", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -4189,9 +4255,9 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -4218,7 +4284,7 @@ version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", ] [[package]] @@ -4250,20 +4316,19 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom", ] [[package]] name = "rayon" -version = "1.5.3" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" +checksum = "1e060280438193c554f654141c9ea9417886713b7acd75974c85b18a69a88e0b" dependencies = [ - "autocfg", "crossbeam-deque", "either", "rayon-core", @@ -4271,9 +4336,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.9.3" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" +checksum = "cac410af5d00ab6884528b4ab69d1e8e146e8d471201800fa1b4524126de6ad3" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -4334,9 +4399,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.27" +version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] name = "region" @@ -4380,7 +4445,7 @@ version = "0.11.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" dependencies = [ - "base64 0.13.0", + "base64", "bytes", "encoding_rs", "futures-core", @@ -4452,9 +4517,9 @@ version = "0.7.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e289706df51226e84814bf6ba1a9e1013112ae29bc7a9878f73fce360520c403" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -4464,10 +4529,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d912f35156a3f99a66ee3e11ac2e0b3f34ac85a07e05263d05a7e2c8810d616f" dependencies = [ "cfg-if 1.0.0", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", "rustc_version 0.4.0", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -4478,7 +4543,7 @@ checksum = "b29d3117bce27ea307d1fb7ce12c64ba11b3fd04311a42d32bc5f0072e6e3d4d" dependencies = [ "quote 1.0.21", "rustc_version 0.4.0", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -4517,7 +4582,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.13", + "semver 1.0.14", ] [[package]] @@ -4579,9 +4644,9 @@ dependencies = [ [[package]] name = "scoped-tls" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "scopeguard" @@ -4589,6 +4654,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "scratch" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" + [[package]] name = "sct" version = "0.7.0" @@ -4648,9 +4719,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711" +checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" dependencies = [ "serde", ] @@ -4672,9 +4743,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.147" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" +checksum = "256b9932320c590e707b94576e3cc1f7c9024d0ee6612dfbcf1cb106cbe8e055" dependencies = [ "serde_derive", ] @@ -4711,23 +4782,23 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.147" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" +checksum = "b4eae9b04cbffdfd550eb462ed33bc6a1b68c935127d008b27444d08380f94e4" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] name = "serde_json" -version = "1.0.87" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" +checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" dependencies = [ "indexmap", - "itoa 1.0.3", + "itoa 1.0.4", "ryu", "serde", ] @@ -4760,7 +4831,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.3", + "itoa 1.0.4", "ryu", "serde", ] @@ -4799,9 +4870,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.4" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "006769ba83e921b3085caa8334186b00cf92b4cb1a6cf4632fbccc8eff5c7549" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -4816,9 +4887,9 @@ checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" [[package]] name = "sha2" -version = "0.10.2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -4857,7 +4928,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af" dependencies = [ "libc", - "mio 0.8.4", + "mio 0.8.5", "signal-hook", ] @@ -4872,9 +4943,9 @@ dependencies = [ [[package]] name = "similar" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ac7f900db32bf3fd12e0117dd3dc4da74bc52ebaac97f39668446d89694803" +checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" [[package]] name = "siphasher" @@ -4884,9 +4955,12 @@ checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" [[package]] name = "slab" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] [[package]] name = "sluice" @@ -4901,9 +4975,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "smawk" @@ -4913,9 +4987,9 @@ checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" [[package]] name = "socket2" -version = "0.4.4" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" dependencies = [ "libc", "winapi 0.3.9", @@ -4923,11 +4997,11 @@ dependencies = [ [[package]] name = "sourcemap" -version = "6.0.2" +version = "6.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ca89636b276071e7276488131f531dbf43ad1c19bc4bd5a04f6a0ce1ddc138" +checksum = "c46fdc1838ff49cf692226f5c2b0f5b7538f556863d0eca602984714667ac6e7" dependencies = [ - "base64 0.11.0", + "base64", "if_chain", "lazy_static", "regex", @@ -4975,9 +5049,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "752564de9cd8937fdbc1c55d47ac391758c352ab3755607cc391b659fe87d56b" dependencies = [ "pmutil", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -5006,11 +5080,11 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", "serde", "serde_derive", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -5020,13 +5094,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" dependencies = [ "base-x", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", "serde", "serde_derive", "serde_json", "sha1 0.6.1", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -5057,7 +5131,7 @@ checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" dependencies = [ "phf_generator", "phf_shared", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", ] @@ -5068,10 +5142,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "994453cd270ad0265796eb24abf5540091ed03e681c5f3c12bc33e4db33253e1" dependencies = [ "pmutil", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", "swc_macros_common", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -5122,9 +5196,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "supports-color" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4872ced36b91d47bae8a214a683fe54e7078875b399dfa251df346c9b547d1f9" +checksum = "8ba6faf2ca7ee42fdd458f4347ae0a9bd6bcc445ad7cb57ad82b383f18870d6f" dependencies = [ "atty", "is_ci", @@ -5156,7 +5230,7 @@ checksum = "19de5dc9d4fb108b8bd23362a09ae31a84b448468844c917342b8fe6a7fba975" dependencies = [ "ahash", "anyhow", - "base64 0.13.0", + "base64", "dashmap", "either", "indexmap", @@ -5205,7 +5279,7 @@ name = "swc-ast-explorer" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.0.18", + "clap 4.0.29", "owo-colors", "regex", "swc_core 0.45.4", @@ -5326,17 +5400,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb64bc03d90fd5c90d6ab917bb2b1d7fbd31957df39e31ea24a3f554b4372251" dependencies = [ "pmutil", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", "swc_macros_common", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] name = "swc_core" -version = "0.44.4" +version = "0.44.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0930f364c4cfff05d3dbda1afadc8bbf714905d0e7f1cc1c7599866e88e329fe" +checksum = "9593e3d1dca44da09b4601bdf74f2eb5ade8768a31656834036aa5d3754ba9c0" dependencies = [ "swc_atoms", "swc_common", @@ -5431,10 +5505,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe27425548d11afee43ddbe1d0cd882cb5e042f61b1503651dae2219c92333f5" dependencies = [ "pmutil", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", "swc_macros_common", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -5572,10 +5646,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0159c99f81f52e48fe692ef7af1b0990b45d3006b14c6629be0b1ffee1b23aea" dependencies = [ "pmutil", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", "swc_macros_common", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -5702,7 +5776,7 @@ dependencies = [ "indexmap", "once_cell", "preset_env_base", - "semver 1.0.13", + "semver 1.0.14", "serde", "serde_json", "st-map", @@ -5723,14 +5797,14 @@ checksum = "81d5d4d2e0f592011f6ee75775995e4605aec31d518bfb2f52619f75e25a637b" dependencies = [ "anyhow", "pmutil", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", "swc_atoms", "swc_common", "swc_ecma_ast", "swc_ecma_parser", "swc_macros_common", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -5836,10 +5910,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebf907935ec5492256b523ae7935a824d9fdc0368dcadc41375bad0dca91cd8b" dependencies = [ "pmutil", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", "swc_macros_common", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -5922,7 +5996,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "605af05b19558d1211834f0aae0c45cbcd2b18089395175f948bd1e7a2669739" dependencies = [ "ahash", - "base64 0.13.0", + "base64", "dashmap", "indexmap", "once_cell", @@ -5950,7 +6024,7 @@ checksum = "92b38d353a1b45949b2ce1451d6362fa429e5861cc74935a2728c5c18a82327e" dependencies = [ "ansi_term", "anyhow", - "base64 0.13.0", + "base64", "hex", "serde", "serde_json", @@ -6040,7 +6114,7 @@ version = "0.28.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d438e7d17d254b0dc74f407086e3dbcb76321fb7c41508c94dfc12f83c27a1d3" dependencies = [ - "base64 0.13.0", + "base64", "byteorder", "fxhash", "once_cell", @@ -6059,9 +6133,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c20468634668c2bbab581947bb8c75c97158d5a6959f4ba33df20983b20b4f6" dependencies = [ "pmutil", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -6109,9 +6183,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4be988307882648d9bc7c71a6a73322b7520ef0211e920489a98f8391d8caa2" dependencies = [ "pmutil", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -6203,9 +6277,9 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4795c8d23e0de62eef9cac0a20ae52429ee2ffc719768e838490f195b7d7267" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -6226,10 +6300,10 @@ checksum = "8fb1f3561674d84947694d41fb6d5737d19539222779baeac1b3a071a2b29428" dependencies = [ "Inflector", "pmutil", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", "swc_macros_common", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -6245,11 +6319,11 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.99" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" +checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", "unicode-ident", ] @@ -6280,9 +6354,9 @@ checksum = "beca1b4eaceb4f2755df858b88d9b9315b7ccfd1ffd0d7a48a52602301f01a57" dependencies = [ "heck", "proc-macro-error", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -6392,11 +6466,11 @@ dependencies = [ "glob", "once_cell", "pmutil", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", "regex", "relative-path", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -6410,39 +6484,33 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.15.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" +checksum = "b7b3e525a49ec206798b40326a44121291b530c963cfb01018f63e135bac543d" dependencies = [ "smawk", "unicode-linebreak", "unicode-width", ] -[[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - [[package]] name = "thiserror" -version = "1.0.32" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.32" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -6477,9 +6545,9 @@ dependencies = [ [[package]] name = "time" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" dependencies = [ "libc", "wasi 0.10.0+wasi-snapshot-preview1", @@ -6496,22 +6564,29 @@ dependencies = [ "libc", "standback", "stdweb", - "time-macros", + "time-macros 0.1.1", "version_check", "winapi 0.3.9", ] [[package]] name = "time" -version = "0.3.13" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db76ff9fa4b1458b3c7f077f3ff9887394058460d21e634355b273aaf11eea45" +checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" dependencies = [ - "itoa 1.0.3", - "libc", - "num_threads", + "itoa 1.0.4", + "serde", + "time-core", + "time-macros 0.2.6", ] +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + [[package]] name = "time-macros" version = "0.1.1" @@ -6522,6 +6597,15 @@ dependencies = [ "time-macros-impl", ] +[[package]] +name = "time-macros" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d967f99f534ca7e495c575c62638eebc2898a8c84c119b89e250477bc4ba16b2" +dependencies = [ + "time-core", +] + [[package]] name = "time-macros-impl" version = "0.1.2" @@ -6529,10 +6613,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd3c141a1b43194f3f56a1411225df8646c55781d5f26db825b3d98507eb482f" dependencies = [ "proc-macro-hack", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", "standback", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -6580,15 +6664,15 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.22.0" +version = "1.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76ce4a75fb488c605c54bf610f221cea8b0dafb53333c1a67e8ee199dcd2ae3" +checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" dependencies = [ "autocfg", "bytes", "libc", "memchr", - "mio 0.8.4", + "mio 0.8.5", "num_cpus", "parking_lot", "pin-project-lite", @@ -6596,7 +6680,7 @@ dependencies = [ "socket2", "tokio-macros", "tracing", - "winapi 0.3.9", + "windows-sys 0.42.0", ] [[package]] @@ -6611,13 +6695,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.8.0" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -6632,9 +6716,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.9" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9" +checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" dependencies = [ "futures-core", "pin-project-lite", @@ -6655,9 +6739,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" dependencies = [ "bytes", "futures-core", @@ -6678,14 +6762,14 @@ dependencies = [ [[package]] name = "tonic" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55b9af819e54b8f33d453655bef9b9acc171568fb49523078d0cc4e7484200ec" +checksum = "8f219fad3b929bef19b1f86fbc0358d35daed8f2cac972037ac0dc10bbb8d5fb" dependencies = [ "async-stream", "async-trait", "axum", - "base64 0.13.0", + "base64", "bytes", "futures-core", "futures-util", @@ -6730,9 +6814,9 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c530c8675c1dbf98facee631536fa116b5fb6382d7dd6dc1b118d970eafe3ba" +checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" dependencies = [ "bitflags", "bytes", @@ -6749,9 +6833,9 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "343bc9466d3fe6b0f960ef45960509f84480bf4fd96f92901afe7ff3df9d3a62" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" [[package]] name = "tower-service" @@ -6778,9 +6862,9 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -6816,12 +6900,12 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60db860322da191b40952ad9affe65ea23e7dd6a5c442c2c42865810c6ab8e6b" +checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" dependencies = [ - "ansi_term", "matchers", + "nu-ansi-term", "once_cell", "regex", "sharded-slab", @@ -6860,7 +6944,7 @@ version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e27992fd6a8c29ee7eef28fc78349aa244134e10ad447ce3b9f0ac0ed0fa4ce0" dependencies = [ - "base64 0.13.0", + "base64", "byteorder", "bytes", "http", @@ -6881,14 +6965,17 @@ dependencies = [ "assert_cmd", "bindgen", "build-target", - "clap 3.2.23", + "clap 4.0.29", + "clap_complete", "itertools", "predicates", + "pretty_assertions", "serde", "serde_json", "serde_yaml", "tiny-gradient", "turbo-updater", + "turborepo-lib", ] [[package]] @@ -6904,7 +6991,7 @@ version = "0.1.0" dependencies = [ "anyhow", "auto-hash-map", - "concurrent-queue 1.2.2", + "concurrent-queue 1.2.4", "dashmap", "erased-serde", "event-listener", @@ -6933,7 +7020,7 @@ dependencies = [ "anyhow", "cargo-lock", "glob", - "syn 1.0.99", + "syn 1.0.105", "turbo-tasks-macros-shared", ] @@ -6975,7 +7062,7 @@ dependencies = [ "auto-hash-map", "bitflags", "bytes", - "concurrent-queue 1.2.2", + "concurrent-queue 1.2.4", "criterion", "futures", "futures-retry", @@ -7013,9 +7100,9 @@ dependencies = [ "anyhow", "convert_case", "proc-macro-error", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", "turbo-tasks-macros-shared", ] @@ -7023,9 +7110,9 @@ dependencies = [ name = "turbo-tasks-macros-shared" version = "0.1.0" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -7034,7 +7121,7 @@ version = "0.1.0" dependencies = [ "anyhow", "auto-hash-map", - "concurrent-queue 1.2.2", + "concurrent-queue 1.2.4", "criterion", "dashmap", "lazy_static", @@ -7110,7 +7197,7 @@ name = "turbopack-cli-utils" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.0.18", + "clap 4.0.29", "crossterm", "owo-colors", "serde", @@ -7151,7 +7238,7 @@ name = "turbopack-create-test-app" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.0.18", + "clap 4.0.29", "indoc", "pathdiff", "serde_json", @@ -7339,6 +7426,24 @@ dependencies = [ "turbopack-env", ] +[[package]] +name = "turborepo-lib" +version = "0.1.0" +dependencies = [ + "anyhow", + "assert_cmd", + "clap 4.0.29", + "clap_complete", + "itertools", + "predicates", + "pretty_assertions", + "serde", + "serde_json", + "serde_yaml", + "tiny-gradient", + "turbo-updater", +] + [[package]] name = "twox-hash" version = "1.6.3" @@ -7358,9 +7463,9 @@ checksum = "0685c84d5d54d1c26f7d3eb96cd41550adb97baed141a761cf335d3d33bcd0ae" [[package]] name = "typenum" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "ucd-trie" @@ -7385,45 +7490,46 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-id" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69fe8d9274f490a36442acb4edfd0c4e473fdfc6a8b5cd32f28a0235761aedbe" +checksum = "d70b6494226b36008c8366c288d77190b3fad2eb4c10533139c1c1f461127f1a" [[package]] name = "unicode-ident" -version = "1.0.3" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" [[package]] name = "unicode-linebreak" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a52dcaab0c48d931f7cc8ef826fa51690a08e1ea55117ef26f89864f532383f" +checksum = "c5faade31a542b8b35855fff6e8def199853b2da8da256da52f52f1316ee3137" dependencies = [ + "hashbrown 0.12.3", "regex", ] [[package]] name = "unicode-normalization" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" +checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" [[package]] name = "unicode-width" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "unicode-xid" @@ -7450,7 +7556,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "152ff185ca29f7f487c51ca785b0f1d85970c4581f4cdd12ed499227890200f5" dependencies = [ "directories", - "semver 1.0.13", + "semver 1.0.14", "serde", "serde_json", "ureq", @@ -7462,7 +7568,7 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b97acb4c28a254fd7a4aeec976c46a7fa404eac4d7c134b30c75144846d7cb8f" dependencies = [ - "base64 0.13.0", + "base64", "chunked_transfer", "flate2", "log", @@ -7528,17 +7634,17 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vergen" -version = "7.4.0" +version = "7.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ffa80ed519f45995741e70664d4abcf147d2a47b8c7ea0a4aa495548ef9474f" +checksum = "447f9238a4553957277b3ee09d80babeae0811f1b3baefb093de1c0448437a37" dependencies = [ "anyhow", "cfg-if 1.0.0", - "enum-iterator 1.2.0", + "enum-iterator 1.1.3", "getset", "rustversion", "thiserror", - "time 0.3.13", + "time 0.3.17", ] [[package]] @@ -7564,7 +7670,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d257817081c7dffcdbab24b9e62d2def62e2ff7d00b1c20062551e6cccc145ff" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", ] @@ -7635,17 +7741,17 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.32" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa76fb221a1f8acddf5b54ace85912606980ad661ac7a503b4570ffd3a624dad" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -7669,9 +7775,9 @@ version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -7789,9 +7895,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00e50405cc2a2f74ff574584710a5f2c1d5c93744acce2ca0866084739284b51" dependencies = [ "proc-macro-error", - "proc-macro2 1.0.43", + "proc-macro2 1.0.47", "quote 1.0.21", - "syn 1.0.99", + "syn 1.0.105", ] [[package]] @@ -7935,7 +8041,7 @@ dependencies = [ "libc", "loupe", "mach", - "memoffset", + "memoffset 0.6.5", "more-asserts", "region", "rkyv", @@ -8006,9 +8112,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.58" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" dependencies = [ "js-sys", "wasm-bindgen", @@ -8064,13 +8170,13 @@ dependencies = [ [[package]] name = "which" -version = "4.2.5" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae" +checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b" dependencies = [ "either", - "lazy_static", "libc", + "once_cell", ] [[package]] @@ -8300,12 +8406,12 @@ dependencies = [ "anyhow", "cargo-lock", "chrono", - "clap 4.0.18", + "clap 4.0.29", "indexmap", "inquire", "owo-colors", "plotters", - "semver 1.0.13", + "semver 1.0.14", "serde", "serde_json", "tabled", diff --git a/cli/.gitignore b/cli/.gitignore index a4e03ab51ae1c..c6d73fb0698bf 100644 --- a/cli/.gitignore +++ b/cli/.gitignore @@ -17,4 +17,6 @@ integration_tests/**/*.t.err # Windows lib files turbo.h -turbo.lib \ No newline at end of file +turbo.lib +libturbo.a +libturbo.h \ No newline at end of file diff --git a/cli/Makefile b/cli/Makefile index 9fba6d0a7242c..93b2c045f2836 100644 --- a/cli/Makefile +++ b/cli/Makefile @@ -19,10 +19,7 @@ GO_FILES = $(shell find . -name "*.go") SRC_FILES = $(shell find . -name "*.go" | grep -v "_test.go") GENERATED_FILES = internal/turbodprotocol/turbod.pb.go internal/turbodprotocol/turbod_grpc.pb.go -turbo: $(GENERATED_FILES) $(SRC_FILES) go.mod - CGO_ENABLED=1 go build $(GO_FLAGS) ./cmd/turbo - -shim: libturbo.a +turbo: libturbo.a cargo build --manifest-path ../shim/Cargo.toml libturbo.a: $(GENERATED_FILES) $(SRC_FILES) go.mod @@ -81,6 +78,11 @@ corepack: e2e: corepack install turbo node -r esbuild-register scripts/e2e/e2e.ts +# Expects turbo to be built and up to date +# Only should be used by CI +e2e-prebuilt: corepack install + node -r esbuild-register scripts/e2e/e2e.ts + cmd/turbo/version.go: ../version.txt # Update this atomically to avoid issues with this being overwritten during use node -e 'console.log(`package main\n\nconst turboVersion = "$(TURBO_VERSION)"`)' > cmd/turbo/version.go.txt @@ -111,10 +113,6 @@ snapshot-turbo-cross: snapshot-turbo-darwin: goreleaser release --snapshot --rm-dist -f darwin-release.yml -.PHONY: snapshot-turbo -snapshot-turbo: clean - goreleaser release --snapshot --rm-dist -f combined-release.yml - .PHONY: snapshot-lib-turbo-darwin snapshot-lib-turbo-darwin: goreleaser release --snapshot --rm-dist -f darwin-lib.yml @@ -184,8 +182,8 @@ publish: clean build npm publish -ddd --tag $(TURBO_TAG) $(CLI_DIR)/../create-turbo-$(TURBO_VERSION).tgz npm publish -ddd --tag $(TURBO_TAG) $(CLI_DIR)/../turbo-codemod-$(TURBO_VERSION).tgz -.PHONY: snapshot-shim -snapshot-shim: +.PHONY: snapshot-turbo +snapshot-turbo: echo "Version: $(TURBO_VERSION)" echo "Tag: $(TURBO_TAG)" @@ -204,8 +202,8 @@ snapshot-shim: npm pack $(CLI_DIR)/../packages/turbo-codemod --pack-destination=$(CLI_DIR)/../ -.PHONY: publish-shim -publish-shim: +.PHONY: publish-turbo +publish-turbo: echo "Version: $(TURBO_VERSION)" echo "Tag: $(TURBO_TAG)" @@ -258,7 +256,10 @@ bench/turbo: demo/turbo turbo bench: bench/lerna bench/lage bench/nx bench/turbo -clean: clean-go clean-build clean-demo +clean: clean-go clean-build clean-demo clean-rust + +clean-rust: + cargo clean clean-build: rm -f turbo @@ -277,10 +278,10 @@ $(CRAM_ENV)/bin/prysk: $(CRAM_ENV)/bin/pip INTEGRATION_TEST_FILES = $(shell find integration_tests -name "*.t") -integration-tests: $(CRAM_ENV)/bin/prysk turbo $(INTEGRATION_TEST_FILES) corepack shim +integration-tests: $(CRAM_ENV)/bin/prysk turbo $(INTEGRATION_TEST_FILES) corepack turbo $(CRAM_ENV)/bin/prysk --shell=`which bash` $(INTEGRATION_TEST_FILES) -integration-tests-interactive: $(CRAM_ENV)/bin/prysk turbo $(INTEGRATION_TEST_FILES) corepack shim +integration-tests-interactive: $(CRAM_ENV)/bin/prysk turbo $(INTEGRATION_TEST_FILES) corepack turbo $(CRAM_ENV)/bin/prysk --shell=`which bash` -i $(INTEGRATION_TEST_FILES) # use target testbed- to set up the testbed directory diff --git a/cli/cmd/turbo/main.go b/cli/cmd/turbo/main.go index 2fa70b32d4b08..84f09b49d6fd6 100644 --- a/cli/cmd/turbo/main.go +++ b/cli/cmd/turbo/main.go @@ -5,26 +5,14 @@ import ( "encoding/json" "fmt" "os" - "unsafe" "github.com/vercel/turbo/cli/internal/cmd" "github.com/vercel/turbo/cli/internal/turbostate" ) func main() { - os.Exit(cmd.RunWithArgs(os.Args[1:], turboVersion)) -} - -//export nativeRunWithArgs -func nativeRunWithArgs(argc C.int, argv **C.char) C.uint { - arglen := int(argc) - args := make([]string, arglen) - for i, arg := range unsafe.Slice(argv, arglen) { - args[i] = C.GoString(arg) - } - - exitCode := cmd.RunWithArgs(args, turboVersion) - return C.uint(exitCode) + fmt.Printf("ERROR: Go binary cannot be used on its own. Please build as c-archive and use with Rust crate") + os.Exit(1) } //export nativeRunWithTurboState diff --git a/cli/integration_tests/find_correct_turbo.t b/cli/integration_tests/find_correct_turbo.t new file mode 100644 index 0000000000000..cc01945f10ffd --- /dev/null +++ b/cli/integration_tests/find_correct_turbo.t @@ -0,0 +1,5 @@ + $ . ${TESTDIR}/setup.sh + +Make sure exit code is 2 when no args are passed + $ CURR=$(${TURBO} --cwd ${TESTDIR}/../.. bin) + $ diff <(readlink -f ${TURBO}) <(readlink -f ${CURR}) diff --git a/cli/integration_tests/link.t b/cli/integration_tests/link.t index 718d4c64024dd..c25cd161f53c3 100644 --- a/cli/integration_tests/link.t +++ b/cli/integration_tests/link.t @@ -2,5 +2,5 @@ Setup $ . ${TESTDIR}/setup.sh Link Test Run - $ ${SHIM} link --__test-run + $ ${TURBO} link --__test-run Link test run successful \ No newline at end of file diff --git a/cli/integration_tests/login.t b/cli/integration_tests/login.t index 958dc83307a06..874737e7d8d04 100644 --- a/cli/integration_tests/login.t +++ b/cli/integration_tests/login.t @@ -2,5 +2,5 @@ Setup $ . ${TESTDIR}/setup.sh Login Test Run - $ ${SHIM} login --__test-run + $ ${TURBO} login --__test-run Login test run successful \ No newline at end of file diff --git a/cli/integration_tests/logout.t b/cli/integration_tests/logout.t index 2349a9336cc6a..fdf2d6f012a3c 100644 --- a/cli/integration_tests/logout.t +++ b/cli/integration_tests/logout.t @@ -3,10 +3,10 @@ Setup $ . ${TESTDIR}/logged_in.sh Logout while logged in - $ ${SHIM} logout + $ ${TURBO} logout >>> Logged out Logout while logged out - $ ${SHIM} logout + $ ${TURBO} logout >>> Logged out diff --git a/cli/integration_tests/no_args.t b/cli/integration_tests/no_args.t new file mode 100644 index 0000000000000..354f5aad6aa67 --- /dev/null +++ b/cli/integration_tests/no_args.t @@ -0,0 +1,59 @@ +Setup + $ . ${TESTDIR}/setup.sh + +Make sure exit code is 2 when no args are passed + $ ${TURBO} + The build system that makes ship happen + + Usage: turbo [OPTIONS] [COMMAND] + + Commands: + bin Get the path to the Turbo binary + completion Generate the autocompletion script for the specified shell + daemon Runs the Turborepo background daemon + link Link your local directory to a Vercel organization and enable remote caching + login Login to your Vercel account + logout Logout to your Vercel account + prune Prepare a subset of your monorepo + run Run tasks across projects in your monorepo + unlink Unlink the current directory from your Vercel organization and disable Remote Caching + + Options: + --version + --api Override the endpoint for API calls + --color Force color usage in the terminal + --cpu-profile Specify a file to save a cpu profile + --cwd The directory in which to run turbo + --heap Specify a file to save a pprof heap profile + --login Override the login endpoint + --no-color Suppress color usage in the terminal + --preflight When enabled, turbo will precede HTTP requests with an OPTIONS request for authorization + --team Set the team slug for API calls + --token Set the auth token for API calls + --trace Specify a file to save a pprof trace + -v, --verbosity verbosity + -h, --help Print help information + + Run Arguments: + --cache-dir Override the filesystem cache directory + --cache-workers Set the number of concurrent cache operations (default 10) [default: 10] + --concurrency Limit the concurrency of task execution. Use 1 for serial (i.e. one-at-a-time) execution + --continue Continue execution even if a task exits with an error or non-zero exit code. The default behavior is to bail + --dry-run [] [possible values: text, json] + --filter Use the given selector to specify package(s) to act as entry points. The syntax mirrors pnpm's syntax, and additional documentation and examples can be found in turbo's documentation https://turbo.build/repo/docs/reference/command-line-reference#--filter + --force Ignore the existing cache (to force execution) + --global-deps Specify glob of global filesystem dependencies to be hashed. Useful for .env and files + --graph [] Generate a graph of the task execution and output to a file when a filename is specified (.svg, .png, .jpg, .pdf, .json, .html). Outputs dot graph to stdout when if no filename is provided + --ignore Files to ignore when calculating changed files (i.e. --since). Supports globs + --include-dependencies Include the dependencies of tasks in execution + --no-cache Avoid saving task results to the cache. Useful for development/watch tasks + --no-daemon Run without using turbo's daemon process + --no-deps Exclude dependent task consumers from execution + --output-logs Set type of process output logging. Use "full" to show all output. Use "hash-only" to show only turbo-computed task hashes. Use "new-only" to show only new output with only hashes for cached tasks. Use "none" to hide process output. (default full) [default: full] [possible values: full, none, hash-only, new-only, errors-only] + --parallel Execute all tasks in parallel + --profile File to write turbo's performance profile output into. You can load the file up in chrome://tracing to see which parts of your build were slow + --remote-only Ignore the local filesystem cache for all tasks. Only allow reading and caching artifacts using the remote cache + --scope Specify package(s) to act as entry points for task execution. Supports globs + --since Limit/Set scope to changed packages since a mergebase. This uses the git diff ${target_branch}... mechanism to identify which packages have changed + --single-package Run turbo in single-package mode + [2] diff --git a/cli/integration_tests/setup.sh b/cli/integration_tests/setup.sh index 9348df374aa0d..2f7e82685401e 100644 --- a/cli/integration_tests/setup.sh +++ b/cli/integration_tests/setup.sh @@ -4,6 +4,5 @@ DIR=${TESTDIR} while [ $(basename $DIR) != "cli" ]; do DIR=$(dirname $DIR) done -TURBO=${DIR}/turbo -SHIM=${DIR}/../target/debug/turbo +TURBO=${DIR}/../target/debug/turbo VERSION=${DIR}/../version.txt diff --git a/cli/integration_tests/turbo_help.t b/cli/integration_tests/turbo_help.t index f0eee17512ab1..3d338dbe100b3 100644 --- a/cli/integration_tests/turbo_help.t +++ b/cli/integration_tests/turbo_help.t @@ -5,203 +5,204 @@ Test help flag $ ${TURBO} -h The build system that makes ship happen - Usage: - turbo [command] + Usage: turbo [OPTIONS] [COMMAND] - Available Commands: + Commands: bin Get the path to the Turbo binary completion Generate the autocompletion script for the specified shell daemon Runs the Turborepo background daemon - help Help about any command - prune Prepare a subset of your monorepo. + link Link your local directory to a Vercel organization and enable remote caching + login Login to your Vercel account + logout Logout to your Vercel account + prune Prepare a subset of your monorepo run Run tasks across projects in your monorepo - - Flags: - --api string Override the endpoint for API calls - --color Force color usage in the terminal - --cpuprofile string Specify a file to save a cpu profile - --cwd string The directory in which to run turbo - --heap string Specify a file to save a pprof heap profile - -h, --help help for turbo - --login string Override the login endpoint - --no-color Suppress color usage in the terminal - --preflight When enabled, turbo will precede HTTP requests with an OPTIONS request for authorization - --team string Set the team slug for API calls - --token string Set the auth token for API calls - --trace string Specify a file to save a pprof trace - -v, --verbosity count verbosity - --version version for turbo - - Use "turbo [command] --help" for more information about a command. + unlink Unlink the current directory from your Vercel organization and disable Remote Caching + + Options: + --version + --api Override the endpoint for API calls + --color Force color usage in the terminal + --cpu-profile Specify a file to save a cpu profile + --cwd The directory in which to run turbo + --heap Specify a file to save a pprof heap profile + --login Override the login endpoint + --no-color Suppress color usage in the terminal + --preflight When enabled, turbo will precede HTTP requests with an OPTIONS request for authorization + --team Set the team slug for API calls + --token Set the auth token for API calls + --trace Specify a file to save a pprof trace + -v, --verbosity verbosity + -h, --help Print help information + + Run Arguments: + --cache-dir Override the filesystem cache directory + --cache-workers Set the number of concurrent cache operations (default 10) [default: 10] + --concurrency Limit the concurrency of task execution. Use 1 for serial (i.e. one-at-a-time) execution + --continue Continue execution even if a task exits with an error or non-zero exit code. The default behavior is to bail + --dry-run [] [possible values: text, json] + --filter Use the given selector to specify package(s) to act as entry points. The syntax mirrors pnpm's syntax, and additional documentation and examples can be found in turbo's documentation https://turbo.build/repo/docs/reference/command-line-reference#--filter + --force Ignore the existing cache (to force execution) + --global-deps Specify glob of global filesystem dependencies to be hashed. Useful for .env and files + --graph [] Generate a graph of the task execution and output to a file when a filename is specified (.svg, .png, .jpg, .pdf, .json, .html). Outputs dot graph to stdout when if no filename is provided + --ignore Files to ignore when calculating changed files (i.e. --since). Supports globs + --include-dependencies Include the dependencies of tasks in execution + --no-cache Avoid saving task results to the cache. Useful for development/watch tasks + --no-daemon Run without using turbo's daemon process + --no-deps Exclude dependent task consumers from execution + --output-logs Set type of process output logging. Use "full" to show all output. Use "hash-only" to show only turbo-computed task hashes. Use "new-only" to show only new output with only hashes for cached tasks. Use "none" to hide process output. (default full) [default: full] [possible values: full, none, hash-only, new-only, errors-only] + --parallel Execute all tasks in parallel + --profile File to write turbo's performance profile output into. You can load the file up in chrome://tracing to see which parts of your build were slow + --remote-only Ignore the local filesystem cache for all tasks. Only allow reading and caching artifacts using the remote cache + --scope Specify package(s) to act as entry points for task execution. Supports globs + --since Limit/Set scope to changed packages since a mergebase. This uses the git diff ${target_branch}... mechanism to identify which packages have changed + --single-package Run turbo in single-package mode + + + + + $ ${TURBO} --help The build system that makes ship happen - Usage: - turbo [command] + Usage: turbo [OPTIONS] [COMMAND] - Available Commands: + Commands: bin Get the path to the Turbo binary completion Generate the autocompletion script for the specified shell daemon Runs the Turborepo background daemon - help Help about any command - prune Prepare a subset of your monorepo. + link Link your local directory to a Vercel organization and enable remote caching + login Login to your Vercel account + logout Logout to your Vercel account + prune Prepare a subset of your monorepo run Run tasks across projects in your monorepo - - Flags: - --api string Override the endpoint for API calls - --color Force color usage in the terminal - --cpuprofile string Specify a file to save a cpu profile - --cwd string The directory in which to run turbo - --heap string Specify a file to save a pprof heap profile - -h, --help help for turbo - --login string Override the login endpoint - --no-color Suppress color usage in the terminal - --preflight When enabled, turbo will precede HTTP requests with an OPTIONS request for authorization - --team string Set the team slug for API calls - --token string Set the auth token for API calls - --trace string Specify a file to save a pprof trace - -v, --verbosity count verbosity - --version version for turbo - - Use "turbo [command] --help" for more information about a command. - -Test help flag for shim - $ ${SHIM} -h - turbo - The build system that makes ship happen - - USAGE: - turbo [OPTIONS] [TASKS]... [SUBCOMMAND] - - ARGS: - ... - - OPTIONS: - --api Override the endpoint for API calls - --color Force color usage in the terminal - --cpu-profile Specify a file to save a cpu profile - --cwd The directory in which to run turbo - -h, --help - --heap Specify a file to save a pprof heap profile - --login Override the login endpoint - --no-color Suppress color usage in the terminal - --preflight When enabled, turbo will precede HTTP requests with an - OPTIONS request for authorization - --team Set the team slug for API calls - --token Set the auth token for API calls - --trace Specify a file to save a pprof trace - -v, --verbosity verbosity - --version - - SUBCOMMANDS: - bin Get the path to the Turbo binary - completion Generate the autocompletion script for the specified shell - daemon Runs the Turborepo background daemon - help Help about any command - link Link your local directory to a Vercel organization and enable remote caching - login Login to your Vercel account - logout Logout to your Vercel account - prune Prepare a subset of your monorepo - run Run tasks across projects in your monorepo - unlink Unlink the current directory from your Vercel organization and disable Remote - Caching - - + unlink Unlink the current directory from your Vercel organization and disable Remote Caching + + Options: + --version + --api Override the endpoint for API calls + --color Force color usage in the terminal + --cpu-profile Specify a file to save a cpu profile + --cwd The directory in which to run turbo + --heap Specify a file to save a pprof heap profile + --login Override the login endpoint + --no-color Suppress color usage in the terminal + --preflight When enabled, turbo will precede HTTP requests with an OPTIONS request for authorization + --team Set the team slug for API calls + --token Set the auth token for API calls + --trace Specify a file to save a pprof trace + -v, --verbosity verbosity + -h, --help Print help information + + Run Arguments: + --cache-dir Override the filesystem cache directory + --cache-workers Set the number of concurrent cache operations (default 10) [default: 10] + --concurrency Limit the concurrency of task execution. Use 1 for serial (i.e. one-at-a-time) execution + --continue Continue execution even if a task exits with an error or non-zero exit code. The default behavior is to bail + --dry-run [] [possible values: text, json] + --filter Use the given selector to specify package(s) to act as entry points. The syntax mirrors pnpm's syntax, and additional documentation and examples can be found in turbo's documentation https://turbo.build/repo/docs/reference/command-line-reference#--filter + --force Ignore the existing cache (to force execution) + --global-deps Specify glob of global filesystem dependencies to be hashed. Useful for .env and files + --graph [] Generate a graph of the task execution and output to a file when a filename is specified (.svg, .png, .jpg, .pdf, .json, .html). Outputs dot graph to stdout when if no filename is provided + --ignore Files to ignore when calculating changed files (i.e. --since). Supports globs + --include-dependencies Include the dependencies of tasks in execution + --no-cache Avoid saving task results to the cache. Useful for development/watch tasks + --no-daemon Run without using turbo's daemon process + --no-deps Exclude dependent task consumers from execution + --output-logs Set type of process output logging. Use "full" to show all output. Use "hash-only" to show only turbo-computed task hashes. Use "new-only" to show only new output with only hashes for cached tasks. Use "none" to hide process output. (default full) [default: full] [possible values: full, none, hash-only, new-only, errors-only] + --parallel Execute all tasks in parallel + --profile File to write turbo's performance profile output into. You can load the file up in chrome://tracing to see which parts of your build were slow + --remote-only Ignore the local filesystem cache for all tasks. Only allow reading and caching artifacts using the remote cache + --scope Specify package(s) to act as entry points for task execution. Supports globs + --since Limit/Set scope to changed packages since a mergebase. This uses the git diff ${target_branch}... mechanism to identify which packages have changed + --single-package Run turbo in single-package mode - - - - $ ${SHIM} --help - turbo - The build system that makes ship happen - - USAGE: - turbo [OPTIONS] [TASKS]... [SUBCOMMAND] - - ARGS: - ... - - OPTIONS: - --api Override the endpoint for API calls - --color Force color usage in the terminal - --cpu-profile Specify a file to save a cpu profile - --cwd The directory in which to run turbo - -h, --help - --heap Specify a file to save a pprof heap profile - --login Override the login endpoint - --no-color Suppress color usage in the terminal - --preflight When enabled, turbo will precede HTTP requests with an - OPTIONS request for authorization - --team Set the team slug for API calls - --token Set the auth token for API calls - --trace Specify a file to save a pprof trace - -v, --verbosity verbosity - --version - - SUBCOMMANDS: - bin Get the path to the Turbo binary - completion Generate the autocompletion script for the specified shell - daemon Runs the Turborepo background daemon - help Help about any command - link Link your local directory to a Vercel organization and enable remote caching - login Login to your Vercel account - logout Logout to your Vercel account - prune Prepare a subset of your monorepo - run Run tasks across projects in your monorepo - unlink Unlink the current directory from your Vercel organization and disable Remote - Caching - -Test help flag for shim's link command - $ ${SHIM} link -h - link +Test help flag for link command + $ ${TURBO} link -h Link your local directory to a Vercel organization and enable remote caching - USAGE: - link [OPTIONS] - - OPTIONS: - -h, --help - help for link - - --no-gitignore - Do not create or modify .gitignore (default false) + Usage: turbo link [OPTIONS] + + Options: + --no-gitignore Do not create or modify .gitignore (default false) + --version + --api Override the endpoint for API calls + --color Force color usage in the terminal + --cpu-profile Specify a file to save a cpu profile + --cwd The directory in which to run turbo + --heap Specify a file to save a pprof heap profile + --login Override the login endpoint + --no-color Suppress color usage in the terminal + --preflight When enabled, turbo will precede HTTP requests with an OPTIONS request for authorization + --team Set the team slug for API calls + --token Set the auth token for API calls + --trace Specify a file to save a pprof trace + -v, --verbosity verbosity + -h, --help Print help information -Test help flag for shim's unlink command - $ ${SHIM} unlink -h - unlink +Test help flag for unlink command + $ ${TURBO} unlink -h Unlink the current directory from your Vercel organization and disable Remote Caching - USAGE: - unlink - - OPTIONS: - -h, --help - Help flag + Usage: turbo unlink [OPTIONS] + + Options: + --version + --api Override the endpoint for API calls + --color Force color usage in the terminal + --cpu-profile Specify a file to save a cpu profile + --cwd The directory in which to run turbo + --heap Specify a file to save a pprof heap profile + --login Override the login endpoint + --no-color Suppress color usage in the terminal + --preflight When enabled, turbo will precede HTTP requests with an OPTIONS request for authorization + --team Set the team slug for API calls + --token Set the auth token for API calls + --trace Specify a file to save a pprof trace + -v, --verbosity verbosity + -h, --help Print help information -Test help flag for shim's login command - $ ${SHIM} login -h - login +Test help flag for login command + $ ${TURBO} login -h Login to your Vercel account - USAGE: - login [OPTIONS] - - OPTIONS: - -h, --help - Help flag - - --sso-team - + Usage: turbo login [OPTIONS] + + Options: + --sso-team + --version + --api Override the endpoint for API calls + --color Force color usage in the terminal + --cpu-profile Specify a file to save a cpu profile + --cwd The directory in which to run turbo + --heap Specify a file to save a pprof heap profile + --login Override the login endpoint + --no-color Suppress color usage in the terminal + --preflight When enabled, turbo will precede HTTP requests with an OPTIONS request for authorization + --team Set the team slug for API calls + --token Set the auth token for API calls + --trace Specify a file to save a pprof trace + -v, --verbosity verbosity + -h, --help Print help information -Test help flag for shim's logout command - $ ${SHIM} logout -h - logout +Test help flag for logout command + $ ${TURBO} logout -h Logout to your Vercel account - USAGE: - logout - - OPTIONS: - -h, --help - Help flag + Usage: turbo logout [OPTIONS] + + Options: + --version + --api Override the endpoint for API calls + --color Force color usage in the terminal + --cpu-profile Specify a file to save a cpu profile + --cwd The directory in which to run turbo + --heap Specify a file to save a pprof heap profile + --login Override the login endpoint + --no-color Suppress color usage in the terminal + --preflight When enabled, turbo will precede HTTP requests with an OPTIONS request for authorization + --team Set the team slug for API calls + --token Set the auth token for API calls + --trace Specify a file to save a pprof trace + -v, --verbosity verbosity + -h, --help Print help information diff --git a/cli/integration_tests/turbo_version.t b/cli/integration_tests/turbo_version.t index 973aef9e7766e..3905504d1f19a 100644 --- a/cli/integration_tests/turbo_version.t +++ b/cli/integration_tests/turbo_version.t @@ -4,7 +4,5 @@ Setup Test version matches that of version.txt $ diff <(head -n 1 ${VERSION}) <(${TURBO} --version) - $ diff <(head -n 1 ${VERSION}) <(${SHIM} --version) - TODO: resolve ambiguity $ ${TURBO} -v diff --git a/cli/integration_tests/unlink.t b/cli/integration_tests/unlink.t index 604c4e415cd95..dc1f2ffcf5565 100644 --- a/cli/integration_tests/unlink.t +++ b/cli/integration_tests/unlink.t @@ -2,5 +2,5 @@ Setup $ . ${TESTDIR}/setup.sh Unlink Test Run - $ ${SHIM} unlink --__test-run + $ ${TURBO} unlink --__test-run Unlink test run successful \ No newline at end of file diff --git a/cli/internal/cmd/auth/logout.go b/cli/internal/cmd/auth/logout.go index f514bfdb49f84..ee6f96c52f54c 100644 --- a/cli/internal/cmd/auth/logout.go +++ b/cli/internal/cmd/auth/logout.go @@ -8,8 +8,8 @@ import ( "github.com/vercel/turbo/cli/internal/util" ) -// RunLogout executes the `logout` command directly instead of via cobra. -func RunLogout(helper *cmdutil.Helper, args *turbostate.ParsedArgsFromRust) error { +// ExecuteLogout executes the `logout` command directly instead of via cobra. +func ExecuteLogout(helper *cmdutil.Helper, args *turbostate.ParsedArgsFromRust) error { base, err := helper.GetCmdBase(args) if err != nil { return err diff --git a/cli/internal/cmd/auth/unlink.go b/cli/internal/cmd/auth/unlink.go index c358a5afafb09..e7bc05afb197c 100644 --- a/cli/internal/cmd/auth/unlink.go +++ b/cli/internal/cmd/auth/unlink.go @@ -6,8 +6,8 @@ import ( "github.com/vercel/turbo/cli/internal/util" ) -// RunUnlink executes the `unlink` command directly instead of via cobra. -func RunUnlink(helper *cmdutil.Helper, args *turbostate.ParsedArgsFromRust) error { +// ExecuteUnlink executes the `unlink` command directly instead of via cobra. +func ExecuteUnlink(helper *cmdutil.Helper, args *turbostate.ParsedArgsFromRust) error { base, err := helper.GetCmdBase(args) if err != nil { return err diff --git a/cli/internal/cmd/info/bin.go b/cli/internal/cmd/info/bin.go deleted file mode 100644 index 59327e86e1ec0..0000000000000 --- a/cli/internal/cmd/info/bin.go +++ /dev/null @@ -1,36 +0,0 @@ -package info - -import ( - "os" - - "github.com/vercel/turbo/cli/internal/config" - - "github.com/vercel/turbo/cli/internal/cmdutil" - - "github.com/spf13/cobra" -) - -// BinCmd returns the Cobra bin command -func BinCmd(helper *cmdutil.Helper) *cobra.Command { - cmd := &cobra.Command{ - Use: "bin", - Short: "Get the path to the Turbo binary", - RunE: func(cmd *cobra.Command, args []string) error { - base, err := helper.GetCmdBase(config.FlagSet{FlagSet: cmd.Flags()}) - if err != nil { - return err - } - path, err := os.Executable() - if err != nil { - base.LogError("could not get path to turbo binary: %w", err) - return err - } - - base.UI.Output(path) - - return nil - }, - } - - return cmd -} diff --git a/cli/internal/cmd/root.go b/cli/internal/cmd/root.go index 8de3c33bdbd09..35cf707f31d09 100644 --- a/cli/internal/cmd/root.go +++ b/cli/internal/cmd/root.go @@ -8,13 +8,9 @@ import ( "runtime/pprof" "runtime/trace" - "github.com/vercel/turbo/cli/internal/config" - "github.com/pkg/errors" - "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/vercel/turbo/cli/internal/cmd/auth" - "github.com/vercel/turbo/cli/internal/cmd/info" "github.com/vercel/turbo/cli/internal/cmdutil" "github.com/vercel/turbo/cli/internal/daemon" "github.com/vercel/turbo/cli/internal/login" @@ -41,45 +37,6 @@ func (eo *execOpts) addFlags(flags *pflag.FlagSet) { flags.StringVar(&eo.traceFile, "trace", "", "Specify a file to save a pprof trace") } -// RunWithArgs runs turbo with the specified arguments. The arguments should not -// include the binary being invoked (e.g. "turbo"). -func RunWithArgs(args []string, turboVersion string) int { - util.InitPrintf() - // TODO: replace this with a context - signalWatcher := signals.NewWatcher() - helper := cmdutil.NewHelper(turboVersion) - root := getCmd(helper, signalWatcher) - resolvedArgs := resolveArgs(root, args) - flags := config.FlagSet{FlagSet: root.Flags()} - defer helper.Cleanup(flags) - root.SetArgs(resolvedArgs) - - doneCh := make(chan struct{}) - var execErr error - go func() { - execErr = root.Execute() - close(doneCh) - }() - - // Wait for either our command to finish, in which case we need to clean up, - // or to receive a signal, in which case the signal handler above does the cleanup - select { - case <-doneCh: - // We finished whatever task we were running - signalWatcher.Close() - exitErr := &process.ChildExit{} - if errors.As(execErr, &exitErr) { - return exitErr.ExitCode - } else if execErr != nil { - return 1 - } - return 0 - case <-signalWatcher.Done(): - // We caught a signal, which already called the close handlers - return 1 - } -} - func initializeOutputFiles(helper *cmdutil.Helper, parsedArgs turbostate.ParsedArgsFromRust) error { if parsedArgs.Trace != "" { cleanup, err := createTraceFile(parsedArgs.Trace) @@ -126,16 +83,23 @@ func RunWithTurboState(state turbostate.CLIExecutionStateFromRust, turboVersion go func() { command := state.ParsedArgs.Command if command.Link != nil { - execErr = login.RunLink(helper, &state.ParsedArgs) + execErr = login.ExecuteLink(helper, &state.ParsedArgs) } else if command.Login != nil { - execErr = login.RunLogin(ctx, helper, &state.ParsedArgs) + execErr = login.ExecuteLogin(ctx, helper, &state.ParsedArgs) } else if command.Logout != nil { - execErr = auth.RunLogout(helper, &state.ParsedArgs) + execErr = auth.ExecuteLogout(helper, &state.ParsedArgs) } else if command.Unlink != nil { - execErr = auth.RunUnlink(helper, &state.ParsedArgs) + execErr = auth.ExecuteUnlink(helper, &state.ParsedArgs) + } else if command.Daemon != nil { + execErr = daemon.ExecuteDaemon(ctx, helper, signalWatcher, &state.ParsedArgs) + } else if command.Prune != nil { + execErr = prune.ExecutePrune(helper, &state.ParsedArgs) + } else if command.Run != nil { + execErr = run.ExecuteRun(ctx, helper, signalWatcher, &state) } else { execErr = fmt.Errorf("unknown command: %v", command) } + close(doneCh) }() @@ -158,74 +122,6 @@ func RunWithTurboState(state turbostate.CLIExecutionStateFromRust, turboVersion } } -const _defaultCmd string = "run" - -// resolveArgs adds a default command to the supplied arguments if none exists. -func resolveArgs(root *cobra.Command, args []string) []string { - for _, arg := range args { - if arg == "--help" || arg == "-h" || arg == "--version" || arg == "completion" { - return args - } - } - cmd, _, err := root.Traverse(args) - if err != nil { - // The command is going to error, but defer to cobra - // to handle it - return args - } else if cmd.Name() == root.Name() { - // We resolved to the root, and this is not help or version, - // so prepend our default command - return append([]string{_defaultCmd}, args...) - } - // We resolved to something other than the root command, no need for a default - return args -} - -// getCmd returns the root cobra command -func getCmd(helper *cmdutil.Helper, signalWatcher *signals.Watcher) *cobra.Command { - execOpts := &execOpts{} - - cmd := &cobra.Command{ - Use: "turbo", - Short: "The build system that makes ship happen", - TraverseChildren: true, - Version: helper.TurboVersion, - PersistentPreRunE: func(cmd *cobra.Command, args []string) error { - if execOpts.traceFile != "" { - cleanup, err := createTraceFile(execOpts.traceFile) - if err != nil { - return err - } - helper.RegisterCleanup(cleanup) - } - if execOpts.heapFile != "" { - cleanup, err := createHeapFile(execOpts.heapFile) - if err != nil { - return err - } - helper.RegisterCleanup(cleanup) - } - if execOpts.cpuProfileFile != "" { - cleanup, err := createCpuprofileFile(execOpts.cpuProfileFile) - if err != nil { - return err - } - helper.RegisterCleanup(cleanup) - } - return nil - }, - } - cmd.SetVersionTemplate("{{.Version}}\n") - flags := cmd.PersistentFlags() - helper.AddFlags(flags) - execOpts.addFlags(flags) - cmd.AddCommand(info.BinCmd(helper)) - cmd.AddCommand(daemon.GetCmd(helper, signalWatcher)) - cmd.AddCommand(prune.GetCmd(helper)) - cmd.AddCommand(run.GetCmd(helper, signalWatcher)) - return cmd -} - type profileCleanup func() error // Close implements io.Close for profileCleanup diff --git a/cli/internal/cmd/root_test.go b/cli/internal/cmd/root_test.go deleted file mode 100644 index bff30b84b1f24..0000000000000 --- a/cli/internal/cmd/root_test.go +++ /dev/null @@ -1,61 +0,0 @@ -package cmd - -import ( - "reflect" - "testing" - - "github.com/vercel/turbo/cli/internal/cmdutil" - "github.com/vercel/turbo/cli/internal/signals" -) - -func TestDefaultCmd(t *testing.T) { - testCases := []struct { - name string - args []string - defaultAdded bool - }{ - { - name: "normal run build", - args: []string{"run", "build"}, - defaultAdded: false, - }, - { - name: "empty args", - args: []string{}, - defaultAdded: true, - }, - { - name: "root help", - args: []string{"--help"}, - defaultAdded: false, - }, - { - name: "run help", - args: []string{"run", "--help"}, - defaultAdded: false, - }, - { - name: "version", - args: []string{"--version"}, - defaultAdded: false, - }, - { - name: "heap", - args: []string{"--heap", "my-heap-profile", "some-task", "--cpuprofile", "my-profile"}, - defaultAdded: true, - }, - } - for _, tc := range testCases { - args := tc.args - t.Run(tc.name, func(t *testing.T) { - signalWatcher := signals.NewWatcher() - helper := cmdutil.NewHelper("test-version") - root := getCmd(helper, signalWatcher) - resolved := resolveArgs(root, args) - defaultAdded := !reflect.DeepEqual(args, resolved) - if defaultAdded != tc.defaultAdded { - t.Errorf("Default command added got %v, want %v", defaultAdded, tc.defaultAdded) - } - }) - } -} diff --git a/cli/internal/cmdutil/cmdutil.go b/cli/internal/cmdutil/cmdutil.go index 2145e3567ebd3..a19e5f0ea7393 100644 --- a/cli/internal/cmdutil/cmdutil.go +++ b/cli/internal/cmdutil/cmdutil.go @@ -155,7 +155,13 @@ func (h *Helper) GetCmdBase(cliConfig config.CLIConfigProvider) (*CmdBase, error if err != nil { return nil, err } - cwd, err := fs.GetCwd() + + cwdRaw, err := cliConfig.GetCwd() + if err != nil { + return nil, err + } + + cwd, err := fs.GetCwd(cwdRaw) if err != nil { return nil, err } diff --git a/cli/internal/config/config_file.go b/cli/internal/config/config_file.go index 2abff0fdbd89b..d98423f633957 100644 --- a/cli/internal/config/config_file.go +++ b/cli/internal/config/config_file.go @@ -19,6 +19,7 @@ type CLIConfigProvider interface { GetAPI() (string, error) GetTeam() (string, error) GetToken() (string, error) + GetCwd() (string, error) } // FlagSet is a wrapper so that the CLIConfigProvider interface can be implemented @@ -57,6 +58,11 @@ func (p FlagSet) GetToken() (string, error) { return p.GetString("token") } +// GetCwd returns the value of the `cwd` flag. Used to implement CLIConfigProvider interface. +func (p FlagSet) GetCwd() (string, error) { + return p.GetString("cwd") +} + // RepoConfig is a configuration object for the logged-in turborepo.com user type RepoConfig struct { repoViper *viper.Viper diff --git a/cli/internal/daemon/daemon.go b/cli/internal/daemon/daemon.go index fb6f5d5bcd2d7..72db576a14354 100644 --- a/cli/internal/daemon/daemon.go +++ b/cli/internal/daemon/daemon.go @@ -10,19 +10,17 @@ import ( "os" "time" - "github.com/vercel/turbo/cli/internal/config" - grpc_recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery" "github.com/hashicorp/go-hclog" "github.com/nightlyone/lockfile" "github.com/pkg/errors" - "github.com/spf13/cobra" "github.com/vercel/turbo/cli/internal/cmdutil" "github.com/vercel/turbo/cli/internal/daemon/connector" "github.com/vercel/turbo/cli/internal/fs" "github.com/vercel/turbo/cli/internal/server" "github.com/vercel/turbo/cli/internal/signals" "github.com/vercel/turbo/cli/internal/turbopath" + "github.com/vercel/turbo/cli/internal/turbostate" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -77,71 +75,75 @@ func (d *daemon) logError(err error) { // we do not need to read the log file. var _logFileFlags = os.O_WRONLY | os.O_APPEND | os.O_CREATE -// GetCmd returns the root daemon command -func GetCmd(helper *cmdutil.Helper, signalWatcher *signals.Watcher) *cobra.Command { - var idleTimeout time.Duration - cmd := &cobra.Command{ - Use: "daemon", - Short: "Runs the Turborepo background daemon", - SilenceUsage: true, - SilenceErrors: true, - RunE: func(cmd *cobra.Command, args []string) error { - flags := config.FlagSet{FlagSet: cmd.Flags()} - base, err := helper.GetCmdBase(flags) - if err != nil { - return err - } - logFilePath, err := getLogFilePath(base.RepoRoot) - if err != nil { - return err - } - if err := logFilePath.EnsureDir(); err != nil { - return err - } - logFile, err := logFilePath.OpenFile(_logFileFlags, 0644) - if err != nil { - return err - } - defer func() { _ = logFile.Close() }() - logger := hclog.New(&hclog.LoggerOptions{ - Output: io.MultiWriter(logFile, os.Stdout), - Level: hclog.Info, - Color: hclog.ColorOff, - Name: "turbod", - }) - ctx := cmd.Context() - d := &daemon{ - logger: logger, - repoRoot: base.RepoRoot, - timeout: idleTimeout, - reqCh: make(chan struct{}), - timedOutCh: make(chan struct{}), - } - serverName := getRepoHash(base.RepoRoot) - turboServer, err := server.New(serverName, d.logger.Named("rpc server"), base.RepoRoot, base.TurboVersion, logFilePath) - if err != nil { - d.logError(err) - return err - } - defer func() { _ = turboServer.Close() }() - err = d.runTurboServer(ctx, turboServer, signalWatcher) - if err != nil { - d.logError(err) - return err - } - return nil - }, +// ExecuteDaemon executes the root daemon command +func ExecuteDaemon(ctx context.Context, helper *cmdutil.Helper, signalWatcher *signals.Watcher, args *turbostate.ParsedArgsFromRust) error { + if args.Command.Daemon.Command != "" { + var subcommandError error + if args.Command.Daemon.Command == "Status" { + subcommandError = RunStatus(ctx, helper, args) + } else { + subcommandError = RunLifecycle(ctx, helper, args) + } + + return subcommandError } - cmd.Flags().DurationVar(&idleTimeout, "idle-time", 4*time.Hour, "Set the idle timeout for turbod") - addDaemonSubcommands(cmd, helper) - return cmd -} -func addDaemonSubcommands(cmd *cobra.Command, helper *cmdutil.Helper) { - addStatusCmd(cmd, helper) - addStartCmd(cmd, helper) - addStopCmd(cmd, helper) - addRestartCmd(cmd, helper) + base, err := helper.GetCmdBase(args) + if err != nil { + return err + } + if args.TestRun { + base.UI.Info("Daemon test run successful") + return nil + } + + idleTimeout := 4 * time.Hour + if args.Command.Daemon.IdleTimeout != "" { + idleTimeout, err = time.ParseDuration(args.Command.Daemon.IdleTimeout) + if err != nil { + return err + } + } + + logFilePath, err := getLogFilePath(base.RepoRoot) + if err != nil { + return err + } + if err := logFilePath.EnsureDir(); err != nil { + return err + } + logFile, err := logFilePath.OpenFile(_logFileFlags, 0644) + if err != nil { + return err + } + defer func() { _ = logFile.Close() }() + logger := hclog.New(&hclog.LoggerOptions{ + Output: io.MultiWriter(logFile, os.Stdout), + Level: hclog.Info, + Color: hclog.ColorOff, + Name: "turbod", + }) + + d := &daemon{ + logger: logger, + repoRoot: base.RepoRoot, + timeout: idleTimeout, + reqCh: make(chan struct{}), + timedOutCh: make(chan struct{}), + } + serverName := getRepoHash(base.RepoRoot) + turboServer, err := server.New(serverName, d.logger.Named("rpc server"), base.RepoRoot, base.TurboVersion, logFilePath) + if err != nil { + d.logError(err) + return err + } + defer func() { _ = turboServer.Close() }() + err = d.runTurboServer(ctx, turboServer, signalWatcher) + if err != nil { + d.logError(err) + return err + } + return nil } var errInactivityTimeout = errors.New("turbod shut down from inactivity") diff --git a/cli/internal/daemon/lifecycle.go b/cli/internal/daemon/lifecycle.go index d71d326d5e855..1c8a4791eee5e 100644 --- a/cli/internal/daemon/lifecycle.go +++ b/cli/internal/daemon/lifecycle.go @@ -3,92 +3,46 @@ package daemon import ( "context" "fmt" - "github.com/vercel/turbo/cli/internal/config" + "github.com/vercel/turbo/cli/internal/turbostate" "github.com/pkg/errors" - "github.com/spf13/cobra" "github.com/vercel/turbo/cli/internal/cmdutil" "github.com/vercel/turbo/cli/internal/daemon/connector" "github.com/vercel/turbo/cli/internal/turbodprotocol" ) -func addStartCmd(root *cobra.Command, helper *cmdutil.Helper) { - cmd := &cobra.Command{ - Use: "start", - Short: "Ensures that the turbo daemon is running", - SilenceUsage: true, - SilenceErrors: true, - RunE: func(cmd *cobra.Command, args []string) error { - flags := config.FlagSet{FlagSet: cmd.Flags()} - base, err := helper.GetCmdBase(flags) - if err != nil { - return err - } - l := &lifecycle{ - base, - } - if err := l.ensureStarted(cmd.Context()); err != nil { - l.logError(err) - return err - } - return nil - }, +// RunLifecycle executes the lifecycle commands `start`, `stop`, `restart`. +func RunLifecycle(ctx context.Context, helper *cmdutil.Helper, args *turbostate.ParsedArgsFromRust) error { + base, err := helper.GetCmdBase(args) + if err != nil { + return err } - root.AddCommand(cmd) -} - -func addStopCmd(root *cobra.Command, helper *cmdutil.Helper) { - cmd := &cobra.Command{ - Use: "stop", - Short: "Stop the turbo daemon", - SilenceUsage: true, - SilenceErrors: true, - RunE: func(cmd *cobra.Command, args []string) error { - flags := config.FlagSet{FlagSet: cmd.Flags()} - base, err := helper.GetCmdBase(flags) - if err != nil { - return err - } - l := &lifecycle{ - base, - } - if err := l.ensureStopped(cmd.Context()); err != nil { - l.logError(err) - return err - } - return nil - }, + l := &lifecycle{ + base, } - root.AddCommand(cmd) -} -func addRestartCmd(root *cobra.Command, helper *cmdutil.Helper) { - cmd := &cobra.Command{ - Use: "restart", - Short: "Restart the turbo daemon", - SilenceUsage: true, - SilenceErrors: true, - RunE: func(cmd *cobra.Command, args []string) error { - flags := config.FlagSet{FlagSet: cmd.Flags()} - base, err := helper.GetCmdBase(flags) - if err != nil { - return err - } - l := &lifecycle{ - base, - } - if err := l.ensureStopped(cmd.Context()); err != nil { - l.logError(err) - return err - } - if err := l.ensureStarted(cmd.Context()); err != nil { - l.logError(err) - return err - } - return nil - }, + if args.Command.Daemon.Command == "Restart" { + if err := l.ensureStopped(ctx); err != nil { + l.logError(err) + return err + } + if err := l.ensureStarted(ctx); err != nil { + l.logError(err) + return err + } + } else if args.Command.Daemon.Command == "Start" { + if err := l.ensureStarted(ctx); err != nil { + l.logError(err) + return err + } + } else if args.Command.Daemon.Command == "Stop" { + if err := l.ensureStopped(ctx); err != nil { + l.logError(err) + return err + } } - root.AddCommand(cmd) + + return nil } type lifecycle struct { diff --git a/cli/internal/daemon/status.go b/cli/internal/daemon/status.go index 7a0e54da2a4cb..489b3ad25a3db 100644 --- a/cli/internal/daemon/status.go +++ b/cli/internal/daemon/status.go @@ -6,40 +6,27 @@ import ( "fmt" "time" - "github.com/vercel/turbo/cli/internal/config" - "github.com/pkg/errors" - "github.com/spf13/cobra" "github.com/vercel/turbo/cli/internal/cmdutil" "github.com/vercel/turbo/cli/internal/daemon/connector" "github.com/vercel/turbo/cli/internal/daemonclient" + "github.com/vercel/turbo/cli/internal/turbostate" ) -func addStatusCmd(root *cobra.Command, helper *cmdutil.Helper) { - var outputJSON bool - cmd := &cobra.Command{ - Use: "status", - Short: "Reports the status of the turbo daemon", - SilenceUsage: true, - SilenceErrors: true, - RunE: func(cmd *cobra.Command, args []string) error { - flags := config.FlagSet{FlagSet: cmd.Flags()} - base, err := helper.GetCmdBase(flags) - if err != nil { - return err - } - l := &lifecycle{ - base, - } - if err := l.status(cmd.Context(), outputJSON); err != nil { - l.logError(err) - return err - } - return nil - }, +// RunStatus executes the `daemon status` command. +func RunStatus(ctx context.Context, helper *cmdutil.Helper, args *turbostate.ParsedArgsFromRust) error { + base, err := helper.GetCmdBase(args) + if err != nil { + return err + } + l := &lifecycle{ + base, } - cmd.Flags().BoolVar(&outputJSON, "json", false, "Pass --json to report status in JSON format") - root.AddCommand(cmd) + if err := l.status(ctx, args.Command.Daemon.JSON); err != nil { + l.logError(err) + return err + } + return nil } func (l *lifecycle) status(ctx context.Context, outputJSON bool) error { diff --git a/cli/internal/fs/path.go b/cli/internal/fs/path.go index a9678f17cb613..9da5e5dc23415 100644 --- a/cli/internal/fs/path.go +++ b/cli/internal/fs/path.go @@ -47,14 +47,17 @@ func AbsoluteSystemPathFromUpstream(s string) turbopath.AbsoluteSystemPath { } // GetCwd returns the calculated working directory after traversing symlinks. -func GetCwd() (turbopath.AbsoluteSystemPath, error) { - cwdRaw, err := os.Getwd() - if err != nil { - return "", fmt.Errorf("invalid working directory: %w", err) +func GetCwd(cwdRaw string) (turbopath.AbsoluteSystemPath, error) { + if cwdRaw == "" { + var err error + cwdRaw, err = os.Getwd() + if err != nil { + return "", err + } } // We evaluate symlinks here because the package managers // we support do the same. - cwdRaw, err = filepath.EvalSymlinks(cwdRaw) + cwdRaw, err := filepath.EvalSymlinks(cwdRaw) if err != nil { return "", fmt.Errorf("evaluating symlinks in cwd: %w", err) } diff --git a/cli/internal/login/link.go b/cli/internal/login/link.go index 6cee9912a085d..6977dc244c0db 100644 --- a/cli/internal/login/link.go +++ b/cli/internal/login/link.go @@ -40,8 +40,8 @@ type linkAPIClient interface { GetCachingStatus() (util.CachingStatus, error) } -// RunLink executes the `link` command. -func RunLink(helper *cmdutil.Helper, args *turbostate.ParsedArgsFromRust) error { +// ExecuteLink executes the `link` command. +func ExecuteLink(helper *cmdutil.Helper, args *turbostate.ParsedArgsFromRust) error { base, err := helper.GetCmdBase(args) if err != nil { return err diff --git a/cli/internal/login/login.go b/cli/internal/login/login.go index 7d45078789686..abd78ab916c3f 100644 --- a/cli/internal/login/login.go +++ b/cli/internal/login/login.go @@ -22,8 +22,8 @@ const defaultHostname = "127.0.0.1" const defaultPort = 9789 const defaultSSOProvider = "SAML/OIDC Single Sign-On" -// RunLogin executes the `login` command. -func RunLogin(ctx context.Context, helper *cmdutil.Helper, args *turbostate.ParsedArgsFromRust) error { +// ExecuteLogin executes the `login` command. +func ExecuteLogin(ctx context.Context, helper *cmdutil.Helper, args *turbostate.ParsedArgsFromRust) error { base, err := helper.GetCmdBase(args) if err != nil { return err diff --git a/cli/internal/packagemanager/packagemanager_test.go b/cli/internal/packagemanager/packagemanager_test.go index 76a951c082199..a5dc472273189 100644 --- a/cli/internal/packagemanager/packagemanager_test.go +++ b/cli/internal/packagemanager/packagemanager_test.go @@ -102,7 +102,9 @@ func TestParsePackageManagerString(t *testing.T) { } func TestGetPackageManager(t *testing.T) { - cwd, err := fs.GetCwd() + cwdRaw, err := os.Getwd() + assert.NilError(t, err, "os.Getwd") + cwd, err := fs.GetCwd(cwdRaw) assert.NilError(t, err, "GetCwd") tests := []struct { name string @@ -224,7 +226,7 @@ func Test_GetWorkspaces(t *testing.T) { cwd, _ := os.Getwd() - repoRoot, err := fs.GetCwd() + repoRoot, err := fs.GetCwd(cwd) assert.NilError(t, err, "GetCwd") rootPath := map[string]turbopath.AbsoluteSystemPath{ "nodejs-npm": repoRoot.UntypedJoin("../../../examples/with-yarn"), @@ -313,7 +315,9 @@ func Test_GetWorkspaceIgnores(t *testing.T) { wantErr bool } - cwd, err := fs.GetCwd() + cwdRaw, err := os.Getwd() + assert.NilError(t, err, "os.Getwd") + cwd, err := fs.GetCwd(cwdRaw) assert.NilError(t, err, "GetCwd") want := map[string][]string{ "nodejs-npm": {"**/node_modules/**"}, @@ -368,7 +372,9 @@ func Test_CanPrune(t *testing.T) { wantErr bool } - cwd, err := fs.GetCwd() + cwdRaw, err := os.Getwd() + assert.NilError(t, err, "os.Getwd") + cwd, err := fs.GetCwd(cwdRaw) assert.NilError(t, err, "GetCwd") wants := map[string]want{ "nodejs-npm": {true, false}, diff --git a/cli/internal/prune/prune.go b/cli/internal/prune/prune.go index 7c2770896e162..d25816bc959c6 100644 --- a/cli/internal/prune/prune.go +++ b/cli/internal/prune/prune.go @@ -5,14 +5,11 @@ import ( "fmt" "strings" - "github.com/vercel/turbo/cli/internal/config" - - "github.com/spf13/cobra" - "github.com/spf13/pflag" "github.com/vercel/turbo/cli/internal/cmdutil" "github.com/vercel/turbo/cli/internal/context" "github.com/vercel/turbo/cli/internal/fs" "github.com/vercel/turbo/cli/internal/turbopath" + "github.com/vercel/turbo/cli/internal/turbostate" "github.com/vercel/turbo/cli/internal/ui" "github.com/fatih/color" @@ -27,50 +24,25 @@ type opts struct { outputDir string } -func addPruneFlags(opts *opts, flags *pflag.FlagSet) { - flags.StringArrayVar(&opts.scope, "scope", nil, "Specify package(s) to act as entry points for pruned monorepo (required).") - flags.BoolVar(&opts.docker, "docker", false, "Output pruned workspace into 'full' and 'json' directories optimized for Docker layer caching.") - flags.StringVar(&opts.outputDir, "out-dir", "out", "Set the root directory for files output by this command") - // No-op the cwd flag while the root level command is not yet cobra - _ = flags.String("cwd", "", "") - if err := flags.MarkHidden("cwd"); err != nil { - // Fail fast if we have misconfigured our flags - panic(err) +// ExecutePrune executes the `prune` command. +func ExecutePrune(helper *cmdutil.Helper, args *turbostate.ParsedArgsFromRust) error { + base, err := helper.GetCmdBase(args) + if err != nil { + return err } -} - -// GetCmd returns the prune subcommand for use with cobra -func GetCmd(helper *cmdutil.Helper) *cobra.Command { - opts := &opts{} - cmd := &cobra.Command{ - Use: "prune --scope= []", - Short: "Prepare a subset of your monorepo.", - SilenceUsage: true, - SilenceErrors: true, - DisableFlagsInUseLine: true, - RunE: func(cmd *cobra.Command, args []string) error { - flags := config.FlagSet{FlagSet: cmd.Flags()} - base, err := helper.GetCmdBase(flags) - if err != nil { - return err - } - if len(opts.scope) == 0 { - err := errors.New("at least one target must be specified") - base.LogError(err.Error()) - return err - } - p := &prune{ - base, - } - if err := p.prune(opts); err != nil { - logError(p.base.Logger, p.base.UI, err) - return err - } - return nil - }, + if len(args.Command.Prune.Scope) == 0 { + err := errors.New("at least one target must be specified") + base.LogError(err.Error()) + return err + } + p := &prune{ + base, } - addPruneFlags(opts, cmd.Flags()) - return cmd + if err := p.prune(args.Command.Prune); err != nil { + logError(p.base.Logger, p.base.UI, err) + return err + } + return nil } func logError(logger hclog.Logger, ui cli.Ui, err error) { @@ -84,7 +56,7 @@ type prune struct { } // Prune creates a smaller monorepo with only the required workspaces -func (p *prune) prune(opts *opts) error { +func (p *prune) prune(opts *turbostate.PrunePayload) error { rootPackageJSONPath := p.base.RepoRoot.UntypedJoin("package.json") rootPackageJSON, err := fs.ReadPackageJSON(rootPackageJSONPath) if err != nil { @@ -94,17 +66,17 @@ func (p *prune) prune(opts *opts) error { if err != nil { return errors.Wrap(err, "could not construct graph") } - outDir := p.base.RepoRoot.UntypedJoin(opts.outputDir) + outDir := p.base.RepoRoot.UntypedJoin(opts.OutputDir) fullDir := outDir - if opts.docker { + if opts.Docker { fullDir = fullDir.UntypedJoin("full") } - p.base.Logger.Trace("scope", "value", strings.Join(opts.scope, ", ")) - p.base.Logger.Trace("docker", "value", opts.docker) + p.base.Logger.Trace("scope", "value", strings.Join(opts.Scope, ", ")) + p.base.Logger.Trace("docker", "value", opts.Docker) p.base.Logger.Trace("out dir", "value", outDir.ToString()) - for _, scope := range opts.scope { + for _, scope := range opts.Scope { p.base.Logger.Trace("scope", "value", scope) target, scopeIsValid := ctx.WorkspaceInfos[scope] if !scopeIsValid { @@ -127,7 +99,7 @@ func (p *prune) prune(opts *opts) error { return errors.New("Cannot prune without parsed lockfile") } - p.base.UI.Output(fmt.Sprintf("Generating pruned monorepo for %v in %v", ui.Bold(strings.Join(opts.scope, ", ")), ui.Bold(outDir.ToString()))) + p.base.UI.Output(fmt.Sprintf("Generating pruned monorepo for %v in %v", ui.Bold(strings.Join(opts.Scope, ", ")), ui.Bold(outDir.ToString()))) packageJSONPath := outDir.UntypedJoin("package.json") if err := packageJSONPath.EnsureDir(); err != nil { @@ -141,14 +113,14 @@ func (p *prune) prune(opts *opts) error { if err := fs.CopyFile(&workspaceFile, fullDir.UntypedJoin(ctx.PackageManager.WorkspaceConfigurationPath).ToStringDuringMigration()); err != nil { return errors.Wrapf(err, "could not copy %s", ctx.PackageManager.WorkspaceConfigurationPath) } - if opts.docker { + if opts.Docker { if err := fs.CopyFile(&workspaceFile, outDir.UntypedJoin("json", ctx.PackageManager.WorkspaceConfigurationPath).ToStringDuringMigration()); err != nil { return errors.Wrapf(err, "could not copy %s", ctx.PackageManager.WorkspaceConfigurationPath) } } } workspaces := []turbopath.AnchoredSystemPath{} - targets, err := ctx.InternalDependencies(opts.scope) + targets, err := ctx.InternalDependencies(opts.Scope) if err != nil { return errors.Wrap(err, "could not traverse the dependency graph to find topological dependencies") } @@ -176,7 +148,7 @@ func (p *prune) prune(opts *opts) error { if err := fs.RecursiveCopy(ctx.WorkspaceInfos[internalDep].Dir.ToStringDuringMigration(), targetDir.ToStringDuringMigration()); err != nil { return errors.Wrapf(err, "failed to copy %v into %v", internalDep, targetDir) } - if opts.docker { + if opts.Docker { jsonDir := outDir.UntypedJoin("json", ctx.WorkspaceInfos[internalDep].PackageJSONPath.ToStringDuringMigration()) if err := jsonDir.EnsureDir(); err != nil { return errors.Wrapf(err, "failed to create folder %v for %v", jsonDir, internalDep) @@ -273,7 +245,7 @@ func (p *prune) prune(opts *opts) error { } } - if opts.docker { + if opts.Docker { // Copy from the package.json in the full directory so we get the pruned version if needed if err := fs.CopyFile( &fs.LstatCachedFile{Path: newPackageJSONPath}, diff --git a/cli/internal/run/run.go b/cli/internal/run/run.go index 5c7dea83ce293..c988754ea71c6 100644 --- a/cli/internal/run/run.go +++ b/cli/internal/run/run.go @@ -8,25 +8,21 @@ import ( "sync" "time" - "github.com/spf13/cobra" - "github.com/spf13/pflag" "github.com/vercel/turbo/cli/internal/analytics" "github.com/vercel/turbo/cli/internal/cache" "github.com/vercel/turbo/cli/internal/cmdutil" - "github.com/vercel/turbo/cli/internal/config" "github.com/vercel/turbo/cli/internal/context" "github.com/vercel/turbo/cli/internal/core" "github.com/vercel/turbo/cli/internal/daemon" "github.com/vercel/turbo/cli/internal/daemonclient" "github.com/vercel/turbo/cli/internal/fs" "github.com/vercel/turbo/cli/internal/graph" - "github.com/vercel/turbo/cli/internal/packagemanager" "github.com/vercel/turbo/cli/internal/process" - "github.com/vercel/turbo/cli/internal/runcache" "github.com/vercel/turbo/cli/internal/scm" "github.com/vercel/turbo/cli/internal/scope" "github.com/vercel/turbo/cli/internal/signals" "github.com/vercel/turbo/cli/internal/taskhash" + "github.com/vercel/turbo/cli/internal/turbostate" "github.com/vercel/turbo/cli/internal/ui" "github.com/vercel/turbo/cli/internal/util" @@ -45,70 +41,91 @@ occurred again). Arguments passed after '--' will be passed through to the named tasks. ` -// GetCmd returns the run command -func GetCmd(helper *cmdutil.Helper, signalWatcher *signals.Watcher) *cobra.Command { - var opts *Opts - var flags *pflag.FlagSet - - cmd := &cobra.Command{ - Use: "run [...] [] -- ", - Short: "Run tasks across projects in your monorepo", - Long: _cmdLong, - SilenceUsage: true, - SilenceErrors: true, - DisableFlagsInUseLine: true, - RunE: func(cmd *cobra.Command, args []string) error { - flagSet := config.FlagSet{FlagSet: cmd.Flags()} - base, err := helper.GetCmdBase(flagSet) - if err != nil { - return err - } - tasks, passThroughArgs := parseTasksAndPassthroughArgs(args, flags) - if len(tasks) == 0 { - return errors.New("at least one task must be specified") - } +// ExecuteRun executes the run command +func ExecuteRun(ctx gocontext.Context, helper *cmdutil.Helper, signalWatcher *signals.Watcher, executionState *turbostate.CLIExecutionStateFromRust) error { + args := executionState.ParsedArgs + base, err := helper.GetCmdBase(args) + if err != nil { + return err + } + tasks := args.Command.Run.Tasks + passThroughArgs := args.Command.Run.PassThroughArgs + if len(tasks) == 0 { + return errors.New("at least one task must be specified") + } + opts, err := optsFromExecutionState(executionState) + if err != nil { + return err + } - _, packageMode := packagemanager.InferRoot(base.RepoRoot) + opts.runOpts.passThroughArgs = passThroughArgs + run := configureRun(base, opts, signalWatcher) + if err := run.run(ctx, tasks); err != nil { + base.LogError("run failed: %v", err) + return err + } + return nil +} - opts.runOpts.singlePackage = packageMode == packagemanager.Single - opts.runOpts.passThroughArgs = passThroughArgs +func optsFromExecutionState(executionState *turbostate.CLIExecutionStateFromRust) (*Opts, error) { + runPayload := executionState.ParsedArgs.Command.Run + opts := getDefaultOptions() + // aliases := make(map[string]string) + scope.OptsFromArgs(&opts.scopeOpts, &executionState.ParsedArgs) - run := configureRun(base, opts, signalWatcher) - ctx := cmd.Context() - if err := run.run(ctx, tasks); err != nil { - base.LogError("run failed: %v", err) - return err - } - return nil - }, - } + // Cache flags + opts.cacheOpts.SkipFilesystem = runPayload.RemoteOnly + opts.cacheOpts.OverrideDir = runPayload.CacheDir + opts.cacheOpts.Workers = runPayload.CacheWorkers - flags = cmd.Flags() - opts = optsFromFlags(flags) - return cmd -} + // Runcache flags + opts.runcacheOpts.SkipReads = runPayload.Force + opts.runcacheOpts.SkipWrites = runPayload.NoCache -func parseTasksAndPassthroughArgs(remainingArgs []string, flags *pflag.FlagSet) ([]string, []string) { - if argSplit := flags.ArgsLenAtDash(); argSplit != -1 { - return remainingArgs[:argSplit], remainingArgs[argSplit:] + err := opts.runcacheOpts.SetTaskOutputMode(runPayload.OutputLogs) + if err != nil { + return nil, err } - return remainingArgs, nil -} -func optsFromFlags(flags *pflag.FlagSet) *Opts { - opts := getDefaultOptions() - aliases := make(map[string]string) - scope.AddFlags(&opts.scopeOpts, flags) - addRunOpts(&opts.runOpts, flags, aliases) - cache.AddFlags(&opts.cacheOpts, flags) - runcache.AddFlags(&opts.runcacheOpts, flags) - flags.SetNormalizeFunc(func(f *pflag.FlagSet, name string) pflag.NormalizedName { - if alias, ok := aliases[name]; ok { - return pflag.NormalizedName(alias) + // Run flags + if runPayload.Concurrency != "" { + concurrency, err := util.ParseConcurrency(runPayload.Concurrency) + if err != nil { + return nil, err } - return pflag.NormalizedName(name) - }) - return opts + opts.runOpts.concurrency = concurrency + } + opts.runOpts.parallel = runPayload.Parallel + opts.runOpts.profile = runPayload.Profile + opts.runOpts.continueOnError = runPayload.ContinueExecution + opts.runOpts.only = runPayload.Only + opts.runOpts.noDaemon = runPayload.NoDaemon + opts.runOpts.singlePackage = runPayload.SinglePackage || (executionState.RepoState.Mode == "SinglePackage") + + // See comment on Graph in turbostate.go for an explanation on Graph's representation. + // If flag is passed... + if runPayload.Graph != nil { + // If no value is attached, we print to stdout + if *runPayload.Graph == "" { + opts.runOpts.graphDot = true + } else { + // Otherwise, we emit to the file name attached as value + opts.runOpts.graphDot = false + opts.runOpts.graphFile = *runPayload.Graph + } + } + + if runPayload.DryRun != "" { + opts.runOpts.dryRunJSON = runPayload.DryRun == _dryRunJSONValue + + if runPayload.DryRun == _dryRunTextValue || runPayload.DryRun == _dryRunJSONValue { + opts.runOpts.dryRun = true + } else { + return nil, fmt.Errorf("invalid dry-run mode: %v", runPayload.DryRun) + } + } + + return opts, nil } func configureRun(base *cmdutil.CmdBase, opts *Opts, signalWatcher *signals.Watcher) *run { @@ -409,157 +426,14 @@ func buildTaskGraphEngine(g *graph.CompleteGraph, rs *runSpec) (*core.Engine, er return engine, nil } -var ( - _profileHelp = `File to write turbo's performance profile output into. -You can load the file up in chrome://tracing to see -which parts of your build were slow.` - _continueHelp = `Continue execution even if a task exits with an error -or non-zero exit code. The default behavior is to bail` - _dryRunHelp = `List the packages in scope and the tasks that would be run, -but don't actually run them. Passing --dry=json or ---dry-run=json will render the output in JSON format.` - _graphHelp = `Generate a graph of the task execution and output to a file when a filename is specified (.svg, .png, .jpg, .pdf, .json, .html). -Outputs dot graph to stdout when if no filename is provided` - _concurrencyHelp = `Limit the concurrency of task execution. Use 1 for serial (i.e. one-at-a-time) execution.` - _parallelHelp = `Execute all tasks in parallel.` - _onlyHelp = `Run only the specified tasks, not their dependencies.` -) - -func addRunOpts(opts *runOpts, flags *pflag.FlagSet, aliases map[string]string) { - flags.AddFlag(&pflag.Flag{ - Name: "concurrency", - Usage: _concurrencyHelp, - DefValue: "10", - Value: &util.ConcurrencyValue{ - Value: &opts.concurrency, - }, - }) - flags.BoolVar(&opts.parallel, "parallel", false, _parallelHelp) - flags.StringVar(&opts.profile, "profile", "", _profileHelp) - flags.BoolVar(&opts.continueOnError, "continue", false, _continueHelp) - flags.BoolVar(&opts.only, "only", false, _onlyHelp) - flags.BoolVar(&opts.noDaemon, "no-daemon", false, "Run without using turbo's daemon process") - flags.BoolVar(&opts.singlePackage, "single-package", false, "Run turbo in single-package mode") - // This is a no-op flag, we don't need it anymore - flags.Bool("experimental-use-daemon", false, "Use the experimental turbo daemon") - if err := flags.MarkHidden("experimental-use-daemon"); err != nil { - panic(err) - } - if err := flags.MarkHidden("only"); err != nil { - // fail fast if we've messed up our flag configuration - panic(err) - } - if err := flags.MarkHidden("single-package"); err != nil { - panic(err) - } - aliases["dry"] = "dry-run" - flags.AddFlag(&pflag.Flag{ - Name: "dry-run", - Usage: _dryRunHelp, - DefValue: "", - NoOptDefVal: _dryRunNoValue, - Value: &dryRunValue{opts: opts}, - }) - flags.AddFlag(&pflag.Flag{ - Name: "graph", - Usage: _graphHelp, - DefValue: "", - NoOptDefVal: _graphNoValue, - Value: &graphValue{opts: opts}, - }) -} - -const ( - _graphText = "graph" - _graphNoValue = "" - _graphTextValue = "true" -) - -// graphValue implements a flag that can be treated as a boolean (--graph) -// or a string (--graph=output.svg). -type graphValue struct { - opts *runOpts -} - -var _ pflag.Value = &graphValue{} - -func (d *graphValue) String() string { - if d.opts.graphDot { - return _graphText - } - return d.opts.graphFile -} - -func (d *graphValue) Set(value string) error { - if value == _graphNoValue { - // this case matches the NoOptDefValue, which is used when the flag - // is passed, but does not have a value (i.e. boolean flag) - d.opts.graphDot = true - } else if value == _graphTextValue { - // "true" is equivalent to just setting the boolean flag - d.opts.graphDot = true - } else { - d.opts.graphDot = false - d.opts.graphFile = value - } - return nil -} - -// Type implements Value.Type, and in this case is used to -// show the alias in the usage test. -func (d *graphValue) Type() string { - return "" -} - // dry run custom flag +// NOTE: These *must* be kept in sync with the corresponding Rust +// enum definitions in shim/src/commands/mod.rs const ( - _dryRunText = "dry run" - _dryRunJSONText = "json" - _dryRunJSONValue = "json" - _dryRunNoValue = "text|json" - _dryRunTextValue = "text" + _dryRunJSONValue = "Json" + _dryRunTextValue = "Text" ) -// dryRunValue implements a flag that can be treated as a boolean (--dry-run) -// or a string (--dry-run=json). -type dryRunValue struct { - opts *runOpts -} - -var _ pflag.Value = &dryRunValue{} - -func (d *dryRunValue) String() string { - if d.opts.dryRunJSON { - return _dryRunJSONText - } else if d.opts.dryRun { - return _dryRunText - } - return "" -} - -func (d *dryRunValue) Set(value string) error { - if value == _dryRunJSONValue { - d.opts.dryRun = true - d.opts.dryRunJSON = true - } else if value == _dryRunNoValue { - // this case matches the NoOptDefValue, which is used when the flag - // is passed, but does not have a value (i.e. boolean flag) - d.opts.dryRun = true - } else if value == _dryRunTextValue { - // "text" is equivalent to just setting the boolean flag - d.opts.dryRun = true - } else { - return fmt.Errorf("invalid dry-run mode: %v", value) - } - return nil -} - -// Type implements Value.Type, and in this case is used to -// show the alias in the usage test. -func (d *dryRunValue) Type() string { - return "/ dry " -} - func validateTasks(pipeline fs.Pipeline, tasks []string) error { for _, task := range tasks { if !pipeline.HasTask(task) { diff --git a/cli/internal/run/run_state.go b/cli/internal/run/run_state.go index 6d1d3b040f10b..0402f0f59ae42 100644 --- a/cli/internal/run/run_state.go +++ b/cli/internal/run/run_state.go @@ -2,6 +2,7 @@ package run import ( "fmt" + "os" "sync" "time" @@ -172,7 +173,11 @@ func writeChrometracing(filename string, terminal cli.Ui) error { if err := chrometracing.Close(); err != nil { terminal.Warn(fmt.Sprintf("Failed to flush tracing data: %v", err)) } - root, err := fs.GetCwd() + cwdRaw, err := os.Getwd() + if err != nil { + return err + } + root, err := fs.GetCwd(cwdRaw) if err != nil { return err } diff --git a/cli/internal/run/run_test.go b/cli/internal/run/run_test.go index cda5c6d4f6734..c2cb1bb22b94a 100644 --- a/cli/internal/run/run_test.go +++ b/cli/internal/run/run_test.go @@ -1,304 +1,14 @@ package run import ( - "fmt" - "runtime" "testing" "github.com/pyr-sh/dag" - "github.com/spf13/pflag" - "github.com/vercel/turbo/cli/internal/cache" "github.com/vercel/turbo/cli/internal/fs" "github.com/vercel/turbo/cli/internal/graph" - "github.com/vercel/turbo/cli/internal/runcache" - "github.com/vercel/turbo/cli/internal/scope" "github.com/vercel/turbo/cli/internal/util" - - "github.com/stretchr/testify/assert" ) -func TestParseConfig(t *testing.T) { - cpus := runtime.NumCPU() - defaultCwd, err := fs.GetCwd() - if err != nil { - t.Errorf("failed to get cwd: %v", err) - } - cases := []struct { - Name string - Args []string - Expected *Opts - ExpectedTasks []string - }{ - { - "string flags", - []string{"foo"}, - &Opts{ - runOpts: runOpts{ - concurrency: 10, - }, - cacheOpts: cache.Opts{ - Workers: 10, - }, - runcacheOpts: runcache.Opts{}, - scopeOpts: scope.Opts{}, - }, - []string{"foo"}, - }, - { - "scope", - []string{"foo", "--scope=foo", "--scope=blah"}, - &Opts{ - runOpts: runOpts{ - concurrency: 10, - }, - cacheOpts: cache.Opts{ - Workers: 10, - }, - runcacheOpts: runcache.Opts{}, - scopeOpts: scope.Opts{ - LegacyFilter: scope.LegacyFilter{ - Entrypoints: []string{"foo", "blah"}, - }, - }, - }, - []string{"foo"}, - }, - { - "concurrency", - []string{"foo", "--concurrency=12"}, - &Opts{ - runOpts: runOpts{ - concurrency: 12, - }, - cacheOpts: cache.Opts{ - Workers: 10, - }, - runcacheOpts: runcache.Opts{}, - scopeOpts: scope.Opts{}, - }, - []string{"foo"}, - }, - { - "concurrency percent", - []string{"foo", "--concurrency=100%"}, - &Opts{ - runOpts: runOpts{ - concurrency: cpus, - }, - cacheOpts: cache.Opts{ - Workers: 10, - }, - runcacheOpts: runcache.Opts{}, - scopeOpts: scope.Opts{}, - }, - []string{"foo"}, - }, - { - "graph file", - []string{"foo", "--graph=g.png"}, - &Opts{ - runOpts: runOpts{ - concurrency: 10, - graphFile: "g.png", - graphDot: false, - }, - cacheOpts: cache.Opts{ - Workers: 10, - }, - runcacheOpts: runcache.Opts{}, - scopeOpts: scope.Opts{}, - }, - []string{"foo"}, - }, - { - "graph default", - []string{"foo", "--graph"}, - &Opts{ - runOpts: runOpts{ - concurrency: 10, - graphFile: "", - graphDot: true, - }, - cacheOpts: cache.Opts{ - Workers: 10, - }, - runcacheOpts: runcache.Opts{}, - scopeOpts: scope.Opts{}, - }, - []string{"foo"}, - }, - { - "passThroughArgs", - []string{"foo", "--graph=g.png", "--", "--boop", "zoop"}, - &Opts{ - runOpts: runOpts{ - concurrency: 10, - graphFile: "g.png", - graphDot: false, - passThroughArgs: []string{"--boop", "zoop"}, - }, - cacheOpts: cache.Opts{ - Workers: 10, - }, - runcacheOpts: runcache.Opts{}, - scopeOpts: scope.Opts{}, - }, - []string{"foo"}, - }, - { - "force", - []string{"foo", "--force"}, - &Opts{ - runOpts: runOpts{ - concurrency: 10, - }, - cacheOpts: cache.Opts{ - Workers: 10, - }, - runcacheOpts: runcache.Opts{ - SkipReads: true, - }, - scopeOpts: scope.Opts{}, - }, - []string{"foo"}, - }, - { - "remote-only", - []string{"foo", "--remote-only"}, - &Opts{ - runOpts: runOpts{ - concurrency: 10, - }, - cacheOpts: cache.Opts{ - Workers: 10, - SkipFilesystem: true, - }, - runcacheOpts: runcache.Opts{}, - scopeOpts: scope.Opts{}, - }, - []string{"foo"}, - }, - { - "no-cache", - []string{"foo", "--no-cache"}, - &Opts{ - runOpts: runOpts{ - concurrency: 10, - }, - cacheOpts: cache.Opts{ - Workers: 10, - }, - runcacheOpts: runcache.Opts{ - SkipWrites: true, - }, - scopeOpts: scope.Opts{}, - }, - []string{"foo"}, - }, - { - "Empty passThroughArgs", - []string{"foo", "--graph=g.png", "--"}, - &Opts{ - runOpts: runOpts{ - concurrency: 10, - graphFile: "g.png", - graphDot: false, - passThroughArgs: []string{}, - }, - cacheOpts: cache.Opts{ - Workers: 10, - }, - runcacheOpts: runcache.Opts{}, - scopeOpts: scope.Opts{}, - }, - []string{"foo"}, - }, - { - "can specify filter patterns", - []string{"foo", "--filter=bar", "--filter=...[main]"}, - &Opts{ - runOpts: runOpts{ - concurrency: 10, - }, - cacheOpts: cache.Opts{ - Workers: 10, - }, - runcacheOpts: runcache.Opts{}, - scopeOpts: scope.Opts{ - FilterPatterns: []string{"bar", "...[main]"}, - }, - }, - []string{"foo"}, - }, - { - "continue on errors", - []string{"foo", "--continue"}, - &Opts{ - runOpts: runOpts{ - continueOnError: true, - concurrency: 10, - }, - cacheOpts: cache.Opts{ - Workers: 10, - }, - runcacheOpts: runcache.Opts{}, - scopeOpts: scope.Opts{}, - }, - []string{"foo"}, - }, - { - "relative cache dir", - []string{"foo", "--continue", "--cache-dir=bar"}, - &Opts{ - runOpts: runOpts{ - continueOnError: true, - concurrency: 10, - }, - cacheOpts: cache.Opts{ - OverrideDir: "bar", - Workers: 10, - }, - runcacheOpts: runcache.Opts{}, - scopeOpts: scope.Opts{}, - }, - []string{"foo"}, - }, - { - "absolute cache dir", - []string{"foo", "--continue", "--cache-dir=" + defaultCwd.UntypedJoin("bar").ToString()}, - &Opts{ - runOpts: runOpts{ - continueOnError: true, - concurrency: 10, - }, - cacheOpts: cache.Opts{ - OverrideDir: defaultCwd.UntypedJoin("bar").ToString(), - Workers: 10, - }, - runcacheOpts: runcache.Opts{}, - scopeOpts: scope.Opts{}, - }, - []string{"foo"}, - }, - } - - for i, tc := range cases { - t.Run(fmt.Sprintf("%d-%s", i, tc.Name), func(t *testing.T) { - flags := pflag.NewFlagSet("test-flags", pflag.ExitOnError) - opts := optsFromFlags(flags) - err := flags.Parse(tc.Args) - remainingArgs := flags.Args() - tasks, passThroughArgs := parseTasksAndPassthroughArgs(remainingArgs, flags) - opts.runOpts.passThroughArgs = passThroughArgs - if err != nil { - t.Fatalf("invalid parse: %#v", err) - } - assert.EqualValues(t, tc.Expected, opts) - assert.EqualValues(t, tc.ExpectedTasks, tasks) - }) - } -} - func Test_dontSquashTasks(t *testing.T) { topoGraph := &dag.AcyclicGraph{} topoGraph.Add("a") diff --git a/cli/internal/runcache/runcache.go b/cli/internal/runcache/runcache.go index a98a20eee17d0..8f56dd8defe39 100644 --- a/cli/internal/runcache/runcache.go +++ b/cli/internal/runcache/runcache.go @@ -12,7 +12,6 @@ import ( "github.com/fatih/color" "github.com/hashicorp/go-hclog" "github.com/mitchellh/cli" - "github.com/spf13/pflag" "github.com/vercel/turbo/cli/internal/cache" "github.com/vercel/turbo/cli/internal/colorcache" "github.com/vercel/turbo/cli/internal/fs" @@ -36,59 +35,18 @@ type Opts struct { OutputWatcher OutputWatcher } -// AddFlags adds the flags relevant to the runcache package to the given FlagSet -func AddFlags(opts *Opts, flags *pflag.FlagSet) { - flags.BoolVar(&opts.SkipReads, "force", false, "Ignore the existing cache (to force execution).") - flags.BoolVar(&opts.SkipWrites, "no-cache", false, "Avoid saving task results to the cache. Useful for development/watch tasks.") - - defaultTaskOutputMode, err := util.ToTaskOutputModeString(util.FullTaskOutput) - if err != nil { - panic(err) - } - - flags.AddFlag(&pflag.Flag{ - Name: "output-logs", - Usage: `Set type of process output logging. Use "full" to show -all output. Use "hash-only" to show only turbo-computed -task hashes. Use "new-only" to show only new output with -only hashes for cached tasks. Use "none" to hide process -output.`, - DefValue: defaultTaskOutputMode, - Value: &taskOutputModeValue{opts: opts}, - }) - _ = flags.Bool("stream", true, "Unused") - if err := flags.MarkDeprecated("stream", "[WARNING] The --stream flag is unnecessary and has been deprecated. It will be removed in future versions of turbo."); err != nil { - // fail fast if we've misconfigured our flags - panic(err) - } -} - -type taskOutputModeValue struct { - opts *Opts -} - -func (l *taskOutputModeValue) String() string { - var outputMode util.TaskOutputMode - if l.opts.TaskOutputModeOverride != nil { - outputMode = *l.opts.TaskOutputModeOverride - } - taskOutputMode, err := util.ToTaskOutputModeString(outputMode) - if err != nil { - panic(err) - } - return taskOutputMode -} - -func (l *taskOutputModeValue) Set(value string) error { +// SetTaskOutputMode parses the task output mode from string and then sets it in opts +func (opts *Opts) SetTaskOutputMode(value string) error { outputMode, err := util.FromTaskOutputModeString(value) if err != nil { - return fmt.Errorf("must be one of \"%v\"", l.Type()) + return fmt.Errorf("must be one of \"%v\"", TaskOutputModes()) } - l.opts.TaskOutputModeOverride = &outputMode + opts.TaskOutputModeOverride = &outputMode return nil } -func (l *taskOutputModeValue) Type() string { +// TaskOutputModes creates the description string for task outputs +func TaskOutputModes() string { var builder strings.Builder first := true @@ -102,8 +60,6 @@ func (l *taskOutputModeValue) Type() string { return builder.String() } -var _ pflag.Value = &taskOutputModeValue{} - // RunCache represents the interface to the cache for a single `turbo run` type RunCache struct { taskOutputModeOverride *util.TaskOutputMode diff --git a/cli/internal/scope/scope.go b/cli/internal/scope/scope.go index 2d63ecec50ed1..157df9e7fe2af 100644 --- a/cli/internal/scope/scope.go +++ b/cli/internal/scope/scope.go @@ -9,12 +9,12 @@ import ( "github.com/hashicorp/go-hclog" "github.com/mitchellh/cli" "github.com/pkg/errors" - "github.com/spf13/pflag" "github.com/vercel/turbo/cli/internal/context" "github.com/vercel/turbo/cli/internal/graph" "github.com/vercel/turbo/cli/internal/packagemanager" "github.com/vercel/turbo/cli/internal/scm" scope_filter "github.com/vercel/turbo/cli/internal/scope/filter" + "github.com/vercel/turbo/cli/internal/turbostate" "github.com/vercel/turbo/cli/internal/util" "github.com/vercel/turbo/cli/internal/util/filter" ) @@ -36,11 +36,11 @@ var _sinceHelp = `Limit/Set scope to changed packages since a mergebase. This uses the git diff ${target_branch}... mechanism to identify which packages have changed.` -func addLegacyFlags(opts *LegacyFilter, flags *pflag.FlagSet) { - flags.BoolVar(&opts.IncludeDependencies, "include-dependencies", false, "Include the dependencies of tasks in execution.") - flags.BoolVar(&opts.SkipDependents, "no-deps", false, "Exclude dependent task consumers from execution.") - flags.StringArrayVar(&opts.Entrypoints, "scope", nil, "Specify package(s) to act as entry points for task execution. Supports globs.") - flags.StringVar(&opts.Since, "since", "", _sinceHelp) +func addLegacyFlagsFromArgs(opts *LegacyFilter, args *turbostate.ParsedArgsFromRust) { + opts.IncludeDependencies = args.Command.Run.IncludeDependencies + opts.SkipDependents = args.Command.Run.NoDeps + opts.Entrypoints = args.Command.Run.Scope + opts.Since = args.Command.Run.Since } // Opts holds the options for how to select the entrypoint packages for a turbo run @@ -66,12 +66,12 @@ match any filter will be included.` in the root directory. Includes turbo.json, root package.json, and the root lockfile by default.` ) -// AddFlags adds the flags relevant to this package to the given FlagSet -func AddFlags(opts *Opts, flags *pflag.FlagSet) { - flags.StringArrayVar(&opts.FilterPatterns, "filter", nil, _filterHelp) - flags.StringArrayVar(&opts.IgnorePatterns, "ignore", nil, _ignoreHelp) - flags.StringArrayVar(&opts.GlobalDepPatterns, "global-deps", nil, _globalDepHelp) - addLegacyFlags(&opts.LegacyFilter, flags) +// OptsFromArgs adds the settings relevant to this package to the given Opts +func OptsFromArgs(opts *Opts, args *turbostate.ParsedArgsFromRust) { + opts.FilterPatterns = args.Command.Run.Filter + opts.IgnorePatterns = args.Command.Run.Ignore + opts.GlobalDepPatterns = args.Command.Run.GlobalDeps + addLegacyFlagsFromArgs(&opts.LegacyFilter, args) } // asFilterPatterns normalizes legacy selectors to filter syntax diff --git a/cli/internal/turbostate/turbostate.go b/cli/internal/turbostate/turbostate.go index 64cc84e037c4b..bf0ece3597ed5 100644 --- a/cli/internal/turbostate/turbostate.go +++ b/cli/internal/turbostate/turbostate.go @@ -12,6 +12,14 @@ type RepoState struct { Mode string `json:"mode"` } +// DaemonPayload is the extra flags and command that are +// passed for the `daemon` subcommand +type DaemonPayload struct { + IdleTimeout string `json:"idle_time"` + Command string `json:"command"` + JSON bool `json:"json"` +} + // LinkPayload is the extra flags passed for the `link` subcommand type LinkPayload struct { DontModifyGitIgnore bool `json:"no_gitignore"` @@ -22,32 +30,76 @@ type LoginPayload struct { SsoTeam string `json:"sso_team"` } +// PrunePayload is the extra flags passed for the `prune` subcommand +type PrunePayload struct { + Scope []string `json:"scope"` + Docker bool `json:"docker"` + OutputDir string `json:"output_dir"` +} + +// RunPayload is the extra flags passed for the `run` subcommand +type RunPayload struct { + CacheDir string `json:"cache_dir"` + CacheWorkers int `json:"cache_workers"` + Concurrency string `json:"concurrency"` + ContinueExecution bool `json:"continue_execution"` + DryRun string `json:"dry_run"` + Filter []string `json:"filter"` + Force bool `json:"force"` + GlobalDeps []string `json:"global_deps"` + // NOTE: Graph has three effective states that is modeled using a *string: + // nil -> no flag passed + // "" -> flag passed but no file name attached: print to stdout + // "foo" -> flag passed and file name attached: emit to file + // The mirror for this in Rust is `Option` with the default value + // for the flag being `Some("")`. + Graph *string `json:"graph"` + Ignore []string `json:"ignore"` + IncludeDependencies bool `json:"include_dependencies"` + NoCache bool `json:"no_cache"` + NoDaemon bool `json:"no_daemon"` + NoDeps bool `json:"no_deps"` + Only bool `json:"only"` + OutputLogs string `json:"output_logs"` + PassThroughArgs []string `json:"pass_through_args"` + Parallel bool `json:"parallel"` + Profile string `json:"profile"` + RemoteOnly bool `json:"remote_only"` + Scope []string `json:"scope"` + Since string `json:"since"` + SinglePackage bool `json:"single_package"` + Tasks []string `json:"tasks"` +} + // Command consists of the data necessary to run a command. // Only one of these fields should be initialized at a time. type Command struct { - Link *LinkPayload `json:"link"` - Login *LoginPayload `json:"login"` - Logout *struct{} `json:"logout"` - Unlink *struct{} `json:"unlink"` + Daemon *DaemonPayload `json:"daemon"` + Link *LinkPayload `json:"link"` + Login *LoginPayload `json:"login"` + Logout *struct{} `json:"logout"` + Prune *PrunePayload `json:"prune"` + Run *RunPayload `json:"run"` + Unlink *struct{} `json:"unlink"` } // ParsedArgsFromRust are the parsed command line arguments passed // from the Rust shim type ParsedArgsFromRust struct { - API string `json:"api"` - Color bool `json:"color"` - CPUProfile string `json:"cpu_profile"` - CWD string `json:"cwd"` - Heap string `json:"heap"` - Login string `json:"login"` - NoColor bool `json:"no_color"` - Preflight bool `json:"preflight"` - Team string `json:"team"` - Token string `json:"token"` - Trace string `json:"trace"` - Verbosity uint8 `json:"verbosity"` - TestRun bool `json:"test_run"` - Command *Command `json:"command"` + API string `json:"api"` + Color bool `json:"color"` + CPUProfile string `json:"cpu_profile"` + CWD string `json:"cwd"` + Heap string `json:"heap"` + Login string `json:"login"` + NoColor bool `json:"no_color"` + Preflight bool `json:"preflight"` + Team string `json:"team"` + Token string `json:"token"` + Trace string `json:"trace"` + Verbosity uint8 `json:"verbosity"` + TestRun bool `json:"test_run"` + Command Command `json:"command"` } var _ config.CLIConfigProvider = (*ParsedArgsFromRust)(nil) @@ -56,7 +108,6 @@ var _ config.CLIConfigProvider = (*ParsedArgsFromRust)(nil) type CLIExecutionStateFromRust struct { RepoState RepoState `json:"repo_state"` ParsedArgs ParsedArgsFromRust `json:"parsed_args"` - RawArgs []string `json:"raw_args"` } // GetColor returns the value of the `color` flag. Used to implement CLIConfigProvider interface. @@ -88,3 +139,8 @@ func (a ParsedArgsFromRust) GetTeam() (string, error) { func (a ParsedArgsFromRust) GetToken() (string, error) { return a.Token, nil } + +// GetCwd returns the value of the `cwd` flag. Used to implement CLIConfigProvider interface. +func (a ParsedArgsFromRust) GetCwd() (string, error) { + return a.CWD, nil +} diff --git a/cli/internal/util/parse_concurrency.go b/cli/internal/util/parse_concurrency.go index cd23deb711211..4355ee7ccafa1 100644 --- a/cli/internal/util/parse_concurrency.go +++ b/cli/internal/util/parse_concurrency.go @@ -6,8 +6,6 @@ import ( "runtime" "strconv" "strings" - - "github.com/spf13/pflag" ) var ( @@ -17,7 +15,8 @@ var ( _positiveInfinity = 1 ) -func parseConcurrency(concurrencyRaw string) (int, error) { +// ParseConcurrency parses a concurrency value, which can be a number (e.g. 2) or a percentage (e.g. 50%). +func ParseConcurrency(concurrencyRaw string) (int, error) { if strings.HasSuffix(concurrencyRaw, "%") { if percent, err := strconv.ParseFloat(concurrencyRaw[:len(concurrencyRaw)-1], 64); err != nil { return 0, fmt.Errorf("invalid value for --concurrency CLI flag. This should be a number --concurrency=4 or percentage of CPU cores --concurrency=50%% : %w", err) @@ -45,26 +44,3 @@ type ConcurrencyValue struct { Value *int raw string } - -var _ pflag.Value = &ConcurrencyValue{} - -// String implements pflag.Value.String for ConcurrencyValue -func (cv *ConcurrencyValue) String() string { - return cv.raw -} - -// Set implements pflag.Value.Set for ConcurrencyValue -func (cv *ConcurrencyValue) Set(value string) error { - parsed, err := parseConcurrency(value) - if err != nil { - return err - } - cv.raw = value - *cv.Value = parsed - return nil -} - -// Type implements pflag.Value.Type for ConcurrencyValue -func (cv *ConcurrencyValue) Type() string { - return "number|percentage" -} diff --git a/cli/internal/util/parse_concurrency_test.go b/cli/internal/util/parse_concurrency_test.go index 790934b106908..b732724bd7701 100644 --- a/cli/internal/util/parse_concurrency_test.go +++ b/cli/internal/util/parse_concurrency_test.go @@ -49,7 +49,7 @@ func TestParseConcurrency(t *testing.T) { for i, tc := range cases { t.Run(fmt.Sprintf("%d) '%s' should be parsed at '%d'", i, tc.Input, tc.Expected), func(t *testing.T) { - if result, err := parseConcurrency(tc.Input); err != nil { + if result, err := ParseConcurrency(tc.Input); err != nil { t.Fatalf("invalid parse: %#v", err) } else { assert.EqualValues(t, tc.Expected, result) @@ -72,7 +72,7 @@ func TestInvalidPercents(t *testing.T) { } for _, tc := range inputs { t.Run(tc, func(t *testing.T) { - val, err := parseConcurrency(tc) + val, err := ParseConcurrency(tc) assert.Error(t, err, "input %v got %v", tc, val) }) } diff --git a/cli/libturbo.h b/cli/libturbo.h deleted file mode 100644 index 242ef5e7155c9..0000000000000 --- a/cli/libturbo.h +++ /dev/null @@ -1,82 +0,0 @@ -/* Code generated by cmd/cgo; DO NOT EDIT. */ - -/* package github.com/vercel/turbo/cli/cmd/turbo */ - - -#line 1 "cgo-builtin-export-prolog" - -#include - -#ifndef GO_CGO_EXPORT_PROLOGUE_H -#define GO_CGO_EXPORT_PROLOGUE_H - -#ifndef GO_CGO_GOSTRING_TYPEDEF -typedef struct { const char *p; ptrdiff_t n; } _GoString_; -#endif - -#endif - -/* Start of preamble from import "C" comments. */ - - - - -/* End of preamble from import "C" comments. */ - - -/* Start of boilerplate cgo prologue. */ -#line 1 "cgo-gcc-export-header-prolog" - -#ifndef GO_CGO_PROLOGUE_H -#define GO_CGO_PROLOGUE_H - -typedef signed char GoInt8; -typedef unsigned char GoUint8; -typedef short GoInt16; -typedef unsigned short GoUint16; -typedef int GoInt32; -typedef unsigned int GoUint32; -typedef long long GoInt64; -typedef unsigned long long GoUint64; -typedef GoInt64 GoInt; -typedef GoUint64 GoUint; -typedef size_t GoUintptr; -typedef float GoFloat32; -typedef double GoFloat64; -#ifdef _MSC_VER -#include -typedef _Fcomplex GoComplex64; -typedef _Dcomplex GoComplex128; -#else -typedef float _Complex GoComplex64; -typedef double _Complex GoComplex128; -#endif - -/* - static assertion to make sure the file is being used on architecture - at least with matching size of GoInt. -*/ -typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1]; - -#ifndef GO_CGO_GOSTRING_TYPEDEF -typedef _GoString_ GoString; -#endif -typedef void *GoMap; -typedef void *GoChan; -typedef struct { void *t; void *v; } GoInterface; -typedef struct { void *data; GoInt len; GoInt cap; } GoSlice; - -#endif - -/* End of boilerplate cgo prologue. */ - -#ifdef __cplusplus -extern "C" { -#endif - -extern unsigned int nativeRunWithArgs(int argc, char** argv); -extern unsigned int nativeRunWithTurboState(GoString turboStateString); - -#ifdef __cplusplus -} -#endif diff --git a/cli/package.json b/cli/package.json index c7da957938060..51e6f61ffdc5d 100644 --- a/cli/package.json +++ b/cli/package.json @@ -7,6 +7,7 @@ "build": "make", "test": "make test-go", "e2e": "make e2e", + "e2e-prebuilt": "make e2e-prebuilt", "publish": "make publish-all", "format": "make fmt-go", "lint": "make lint-go", diff --git a/cli/scripts/monorepo.ts b/cli/scripts/monorepo.ts index 4163e62ae36d2..16b3af3c8b7dc 100644 --- a/cli/scripts/monorepo.ts +++ b/cli/scripts/monorepo.ts @@ -5,7 +5,10 @@ import fs from "fs-extra"; import os from "os"; import path from "path"; const isWin = process.platform === "win32"; -const turboPath = path.join(__dirname, "../turbo" + (isWin ? ".exe" : "")); +const turboPath = path.join( + __dirname, + "../../target/debug/turbo" + (isWin ? ".exe" : "") +); type NPMClient = "npm" | "pnpm6" | "pnpm" | "yarn" | "berry"; diff --git a/crates/turborepo-lib/Cargo.toml b/crates/turborepo-lib/Cargo.toml new file mode 100644 index 0000000000000..54838436f4c35 --- /dev/null +++ b/crates/turborepo-lib/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "turborepo-lib" +version = "0.1.0" +edition = "2021" +license = "MPL-2.0" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[dev-dependencies] +assert_cmd = "2.0.6" +itertools = "0.10.5" +pretty_assertions = "1.3.0" + +[dependencies] +anyhow = { version = "1.0.65", features = ["backtrace"] } +clap = { version = "4.0.22", features = ["derive"] } +clap_complete = "4.0.6" +predicates = "2.1.1" +serde = { version = "1.0.145", features = ["derive"] } +serde_json = "1.0.86" +serde_yaml = "0.8.26" +tiny-gradient = "0.1" +turbo-updater = { path = "../turbo-updater" } diff --git a/crates/turborepo-lib/README.md b/crates/turborepo-lib/README.md new file mode 100644 index 0000000000000..10ec2d56f0ec6 --- /dev/null +++ b/crates/turborepo-lib/README.md @@ -0,0 +1,4 @@ +# turborepo-lib + +This crate contains most of the logic for the Turborepo binary and should only be consumed by the `turbo` crate. +The `turbo` crate handles building the CGO archive and linking it to the Rust code. These crates were split up so that we do not have to build the Go code to run the Rust tests. diff --git a/shim/src/commands/bin.rs b/crates/turborepo-lib/src/commands/bin.rs similarity index 100% rename from shim/src/commands/bin.rs rename to crates/turborepo-lib/src/commands/bin.rs diff --git a/crates/turborepo-lib/src/commands/mod.rs b/crates/turborepo-lib/src/commands/mod.rs new file mode 100644 index 0000000000000..c648ad47da3e4 --- /dev/null +++ b/crates/turborepo-lib/src/commands/mod.rs @@ -0,0 +1,286 @@ +pub(crate) mod bin; + +use std::{env, process}; + +use anyhow::Result; +use clap::{ArgAction, Parser, Subcommand, ValueEnum}; +use clap_complete::Shell; +use serde::Serialize; + +use crate::get_version; + +#[derive(Copy, Clone, Debug, PartialEq, Serialize, ValueEnum)] +pub enum OutputLogsMode { + #[serde(rename = "full")] + Full, + #[serde(rename = "none")] + None, + #[serde(rename = "hash-only")] + HashOnly, + #[serde(rename = "new-only")] + NewOnly, + #[serde(rename = "errors-only")] + ErrorsOnly, +} + +impl Default for OutputLogsMode { + fn default() -> Self { + Self::Full + } +} + +// NOTE: These *must* be kept in sync with the `_dryRunJSONValue` +// and `_dryRunTextValue` constants in run.go. +#[derive(Copy, Clone, Debug, PartialEq, Serialize, ValueEnum)] +pub enum DryRunMode { + Text, + Json, +} + +#[derive(Parser, Clone, Default, Debug, PartialEq, Serialize)] +#[clap(author, about = "The build system that makes ship happen", long_about = None)] +#[clap(disable_help_subcommand = true)] +#[clap(disable_version_flag = true)] +#[clap(arg_required_else_help = true)] +pub struct Args { + #[clap(long, global = true)] + pub version: bool, + /// Override the endpoint for API calls + #[clap(long, global = true, value_parser)] + pub api: Option, + /// Force color usage in the terminal + #[clap(long, global = true)] + pub color: bool, + /// Specify a file to save a cpu profile + #[clap(long, global = true, value_parser)] + pub cpu_profile: Option, + /// The directory in which to run turbo + #[clap(long, global = true, value_parser)] + pub cwd: Option, + /// Specify a file to save a pprof heap profile + #[clap(long, global = true, value_parser)] + pub heap: Option, + /// Override the login endpoint + #[clap(long, global = true, value_parser)] + pub login: Option, + /// Suppress color usage in the terminal + #[clap(long, global = true)] + pub no_color: bool, + /// When enabled, turbo will precede HTTP requests with an OPTIONS request + /// for authorization + #[clap(long, global = true)] + pub preflight: bool, + /// Set the team slug for API calls + #[clap(long, global = true, value_parser)] + pub team: Option, + /// Set the auth token for API calls + #[clap(long, global = true, value_parser)] + pub token: Option, + /// Specify a file to save a pprof trace + #[clap(long, global = true, value_parser)] + pub trace: Option, + /// verbosity + #[clap(short, long, global = true, value_parser)] + pub verbosity: Option, + #[clap(long = "__test-run", global = true, hide = true)] + pub test_run: bool, + #[clap(flatten, next_help_heading = "Run Arguments")] + pub run_args: Option, + #[clap(subcommand)] + pub command: Option, +} + +#[derive(Subcommand, Clone, Debug, Serialize, PartialEq)] +#[serde(tag = "command")] +pub enum DaemonCommand { + /// Restarts the turbo daemon + Restart, + /// Ensures that the turbo daemon is running + Start, + /// Reports the status of the turbo daemon + Status { + /// Pass --json to report status in JSON format + #[clap(long)] + json: bool, + }, + /// Stops the turbo daemon + Stop, +} + +impl Args { + pub fn new() -> Result { + let mut clap_args = Args::parse(); + // --version flag doesn't work with ignore_errors in clap, so we have to handle + // it manually + if clap_args.version { + println!("{}", get_version()); + process::exit(0); + } + + if env::var("TEST_RUN").is_ok() { + clap_args.test_run = true; + } + + Ok(clap_args) + } +} + +/// Defines the subcommands for CLI. NOTE: If we change the commands in Go, +/// we must change these as well to avoid accidentally passing the +/// --single-package flag into non-build commands. +#[derive(Subcommand, Clone, Debug, Serialize, PartialEq)] +pub enum Command { + // NOTE: Empty variants still have an empty struct attached so that serde serializes + // them as `{ "Bin": {} }` instead of as `"Bin"`. + /// Get the path to the Turbo binary + Bin {}, + /// Generate the autocompletion script for the specified shell + #[serde(skip)] + Completion { shell: Shell }, + /// Runs the Turborepo background daemon + Daemon { + /// Set the idle timeout for turbod (default 4h0m0s) + #[clap(long)] + idle_time: Option, + #[clap(subcommand)] + #[serde(flatten)] + command: Option, + }, + /// Link your local directory to a Vercel organization and enable remote + /// caching. + Link { + /// Do not create or modify .gitignore (default false) + #[clap(long)] + no_gitignore: bool, + }, + /// Login to your Vercel account + Login { + #[clap(long = "sso-team")] + sso_team: Option, + }, + /// Logout to your Vercel account + Logout {}, + /// Prepare a subset of your monorepo. + Prune { + #[clap(long)] + scope: Vec, + #[clap(long)] + docker: bool, + #[clap(long = "out-dir", default_value_t = String::from("out"), value_parser)] + output_dir: String, + }, + + /// Run tasks across projects in your monorepo + /// + /// By default, turbo executes tasks in topological order (i.e. + /// dependencies first) and then caches the results. Re-running commands for + /// tasks already in the cache will skip re-execution and immediately move + /// artifacts from the cache into the correct output folders (as if the task + /// occurred again). + /// + /// Arguments passed after '--' will be passed through to the named tasks. + Run(RunArgs), + /// Unlink the current directory from your Vercel organization and disable + /// Remote Caching + Unlink {}, +} + +#[derive(Parser, Clone, Debug, Default, Serialize, PartialEq)] +pub struct RunArgs { + /// Override the filesystem cache directory. + #[clap(long)] + pub cache_dir: Option, + /// Set the number of concurrent cache operations (default 10) + #[clap(long, default_value_t = 10)] + pub cache_workers: u32, + /// Limit the concurrency of task execution. Use 1 for serial (i.e. + /// one-at-a-time) execution. + #[clap(long)] + pub concurrency: Option, + /// Continue execution even if a task exits with an error or non-zero + /// exit code. The default behavior is to bail + #[clap(long = "continue")] + pub continue_execution: bool, + #[clap(alias = "dry", long = "dry-run", num_args = 0..=1, default_missing_value = "text")] + pub dry_run: Option, + #[clap(long, hide = true)] + #[serde(skip)] + pub experimental_use_daemon: bool, + #[clap(long, hide = true)] + #[serde(skip)] + pub stream: bool, + /// Use the given selector to specify package(s) to act as + /// entry points. The syntax mirrors pnpm's syntax, and + /// additional documentation and examples can be found in + /// turbo's documentation https://turbo.build/repo/docs/reference/command-line-reference#--filter + #[clap(long, action = ArgAction::Append)] + pub filter: Vec, + /// Ignore the existing cache (to force execution) + #[clap(long)] + pub force: bool, + /// Specify glob of global filesystem dependencies to be hashed. Useful + /// for .env and files + #[clap(long = "global-deps", action = ArgAction::Append)] + pub global_deps: Vec, + /// Generate a graph of the task execution and output to a file when a + /// filename is specified (.svg, .png, .jpg, .pdf, .json, + /// .html). Outputs dot graph to stdout when if no filename is provided + #[clap(long, num_args = 0..=1, default_missing_value = "")] + pub graph: Option, + /// Files to ignore when calculating changed files (i.e. --since). + /// Supports globs. + #[clap(long)] + pub ignore: Vec, + /// Include the dependencies of tasks in execution. + #[clap(long)] + pub include_dependencies: bool, + /// Avoid saving task results to the cache. Useful for development/watch + /// tasks. + #[clap(long)] + pub no_cache: bool, + /// Run without using turbo's daemon process + #[clap(long)] + pub no_daemon: bool, + /// Exclude dependent task consumers from execution. + #[clap(long)] + pub no_deps: bool, + /// Set type of process output logging. Use "full" to show + /// all output. Use "hash-only" to show only turbo-computed + /// task hashes. Use "new-only" to show only new output with + /// only hashes for cached tasks. Use "none" to hide process + /// output. (default full) + #[clap(long, value_enum, default_value_t = OutputLogsMode::Full)] + pub output_logs: OutputLogsMode, + #[clap(long, hide = true)] + pub only: bool, + /// Execute all tasks in parallel. + #[clap(long)] + pub parallel: bool, + /// File to write turbo's performance profile output into. + /// You can load the file up in chrome://tracing to see + /// which parts of your build were slow. + #[clap(long)] + pub profile: Option, + /// Ignore the local filesystem cache for all tasks. Only + /// allow reading and caching artifacts using the remote cache. + #[clap(long)] + pub remote_only: bool, + /// Specify package(s) to act as entry points for task execution. + /// Supports globs. + #[clap(long)] + pub scope: Vec, + /// Limit/Set scope to changed packages since a mergebase. + /// This uses the git diff ${target_branch}... mechanism + /// to identify which packages have changed. + #[clap(long)] + pub since: Option, + /// Run turbo in single-package mode + #[clap(long)] + pub single_package: bool, + // NOTE: The following two are hidden because clap displays them in the help text incorrectly: + // > Usage: turbo [OPTIONS] [TASKS]... [-- ...] [COMMAND] + #[clap(hide = true)] + pub tasks: Vec, + #[clap(last = true, hide = true)] + pub pass_through_args: Vec, +} diff --git a/crates/turborepo-lib/src/lib.rs b/crates/turborepo-lib/src/lib.rs new file mode 100644 index 0000000000000..d3b1af7e82b86 --- /dev/null +++ b/crates/turborepo-lib/src/lib.rs @@ -0,0 +1,1058 @@ +mod commands; +mod package_manager; + +use std::{ + env, + env::current_exe, + fs, io, mem, + path::{Path, PathBuf}, + process, + process::Stdio, +}; + +use anyhow::{anyhow, Context, Result}; +use clap::CommandFactory; +use clap_complete::generate; +use serde::Serialize; +use tiny_gradient::{GradientStr, RGB}; +use turbo_updater::check_for_updates; + +pub use crate::commands::Args; +use crate::{ + commands::{Command, RunArgs}, + package_manager::PackageManager, +}; + +static TURBO_JSON: &str = "turbo.json"; + +#[derive(Debug, Clone, Serialize)] +pub struct RepoState { + root: PathBuf, + mode: RepoMode, +} + +#[derive(Debug, Clone, Serialize)] +pub enum RepoMode { + SinglePackage, + MultiPackage, +} + +/// The entire state of the execution, including args, repo state, etc. +#[derive(Debug, Serialize)] +pub struct TurboState { + /// The repo_state is not required for the `link`, `unlink`, `login`, + /// `logout` commands + repo_state: Option, + parsed_args: Args, +} +pub enum Payload { + Rust(Result), + Go(Box), +} + +impl TurboState { + /// Runs the Go code linked in current binary. + /// + /// # Arguments + /// + /// * `args`: Arguments for turbo + /// + /// returns: Result + fn run_current_turbo(self) -> Payload { + match self.parsed_args.command { + Some(Command::Bin { .. }) => { + let res = commands::bin::run().map(|_| 0); + Payload::Rust(res) + } + Some(Command::Completion { .. }) => { + unreachable!("shell completion should be handled by clap_complete") + } + Some(Command::Link { .. }) + | Some(Command::Login { .. }) + | Some(Command::Logout { .. }) + | Some(Command::Unlink { .. }) + | Some(Command::Daemon { .. }) + | Some(Command::Run(_)) + | Some(Command::Prune { .. }) + | None => Payload::Go(Box::new(self)), + } + } + + /// Attempts to run correct turbo by finding nearest package.json, + /// then finding local turbo installation. If the current binary is the + /// local turbo installation, then we run current turbo. Otherwise we + /// kick over to the local turbo installation. + /// + /// # Arguments + /// + /// * `turbo_state`: state for current execution + /// + /// returns: Result + fn run_correct_turbo(mut self, current_dir: &Path) -> Result { + let repo_state = RepoState::infer(current_dir)?; + let local_turbo_path = repo_state.root.join("node_modules").join(".bin").join({ + #[cfg(windows)] + { + "turbo.cmd" + } + #[cfg(not(windows))] + { + "turbo" + } + }); + + self.repo_state = Some(repo_state); + let current_turbo_is_local_turbo = local_turbo_path == current_exe()?; + // If the local turbo path doesn't exist or if we are local turbo, then we go + // ahead and run the Go code linked in the current binary. + if current_turbo_is_local_turbo || !local_turbo_path.try_exists()? { + Ok(self.run_current_turbo()) + } else { + // Otherwise we spawn the local turbo process. + Ok(Payload::Rust(self.spawn_local_turbo(&local_turbo_path))) + } + } + + fn spawn_local_turbo(&self, local_turbo_path: &Path) -> Result { + let mut raw_args: Vec<_> = env::args().skip(1).collect(); + let has_single_package_flag = self + .parsed_args + .run_args + .as_ref() + .map_or(false, |run_args| run_args.single_package) + || matches!( + self.parsed_args.command, + Some(Command::Run(RunArgs { + single_package: true, + .. + })) + ); + + if matches!( + self.repo_state, + Some(RepoState { + mode: RepoMode::SinglePackage, + .. + }) + ) && self.parsed_args.is_run_command() + && !has_single_package_flag + { + raw_args.push("--single-package".to_string()); + } + + // Otherwise, we spawn a process that executes the local turbo + // that we've found in node_modules/.bin/turbo. + let mut command = process::Command::new(local_turbo_path) + .args(&raw_args) + .stdout(Stdio::inherit()) + .stderr(Stdio::inherit()) + .spawn() + .expect("Failed to execute turbo."); + + Ok(command.wait()?.code().unwrap_or(2)) + } +} + +impl RepoState { + /// Infers `RepoState` from current directory. + /// + /// # Arguments + /// + /// * `current_dir`: Current working directory + /// + /// returns: Result + pub fn infer(current_dir: &Path) -> Result { + // First we look for a `turbo.json`. This iterator returns the first ancestor + // that contains a `turbo.json` file. + let root_path = current_dir + .ancestors() + .find(|p| fs::metadata(p.join(TURBO_JSON)).is_ok()); + + // If that directory exists, then we figure out if there are workspaces defined + // in it NOTE: This may change with multiple `turbo.json` files + if let Some(root_path) = root_path { + let pnpm = PackageManager::Pnpm; + let npm = PackageManager::Npm; + let is_workspace = pnpm.get_workspace_globs(root_path).is_ok() + || npm.get_workspace_globs(root_path).is_ok(); + + let mode = if is_workspace { + RepoMode::MultiPackage + } else { + RepoMode::SinglePackage + }; + + return Ok(Self { + root: root_path.to_path_buf(), + mode, + }); + } + + // What we look for next is a directory that contains a `package.json`. + let potential_roots = current_dir + .ancestors() + .filter(|path| fs::metadata(path.join("package.json")).is_ok()); + + let mut first_package_json_dir = None; + // We loop through these directories and see if there are workspaces defined in + // them, either in the `package.json` or `pnm-workspaces.yml` + for dir in potential_roots { + if first_package_json_dir.is_none() { + first_package_json_dir = Some(dir) + } + + let pnpm = PackageManager::Pnpm; + let npm = PackageManager::Npm; + let is_workspace = + pnpm.get_workspace_globs(dir).is_ok() || npm.get_workspace_globs(dir).is_ok(); + + if is_workspace { + return Ok(Self { + root: dir.to_path_buf(), + mode: RepoMode::MultiPackage, + }); + } + } + + // Finally, if we don't detect any workspaces, go to the first `package.json` + // and use that in single package mode. + let root = first_package_json_dir + .ok_or_else(|| { + anyhow!( + "Unable to find `{}` or `package.json` in current path", + TURBO_JSON + ) + })? + .to_path_buf(); + + Ok(Self { + root, + mode: RepoMode::SinglePackage, + }) + } +} + +impl Args { + /// Checks if either we have an explicit run command, i.e. `turbo run build` + /// or an implicit run, i.e. `turbo build`, where the command after `turbo` + /// is not one of the reserved commands like `link`, `login`, `bin`, + /// etc. + /// + /// # Arguments + /// + /// * `clap_args`: + /// + /// returns: bool + fn is_run_command(&self) -> bool { + let is_explicit_run = matches!(self.command, Some(Command::Run { .. })); + let is_implicit_run = self.command.is_none() + && self + .run_args + .as_ref() + .map_or(false, |args| !args.tasks.is_empty()); + + is_explicit_run || is_implicit_run + } +} + +fn get_version() -> &'static str { + include_str!("../../../version.txt") + .split_once('\n') + .expect("Failed to read version from version.txt") + .0 +} + +/// Checks for `TURBO_BINARY_PATH` variable. If it is set, +/// we do not do any inference, we simply run the command as +/// the current binary. This is due to legacy behavior of `TURBO_BINARY_PATH` +/// that lets users dynamically set the path of the turbo binary. Because +/// inference involves finding a local turbo installation and executing that +/// binary, these two features are fundamentally incompatible. +fn is_turbo_binary_path_set() -> bool { + env::var("TURBO_BINARY_PATH").is_ok() +} + +//// The payload from running main, if the program can complete without using Go +/// the Rust variant will be returned. If Go is needed then the turbostate that +/// should be passed to Go will be returned. +pub fn main() -> Result { + // custom footer for update message + let footer = format!( + "Follow {username} for updates: {url}", + username = "@turborepo".gradient([RGB::new(0, 153, 247), RGB::new(241, 23, 18)]), + url = "https://twitter.com/turborepo" + ); + + // check for updates + let _ = check_for_updates( + "turbo", + "https://github.com/vercel/turbo", + Some(&footer), + get_version(), + // use defaults for timeout and refresh interval (800ms and 1 day respectively) + None, + None, + ); + + let mut clap_args = Args::new()?; + + let current_dir = if let Some(cwd) = &clap_args.cwd { + fs::canonicalize::(cwd.into())? + } else { + env::current_dir()? + }; + + clap_args.cwd = Some( + current_dir + .to_str() + .context("--cwd is not valid Unicode")? + .to_string(), + ); + + // If there is no command, we set the command to `Command::Run` with + // `self.parsed_args.run_args` as arguments. + if clap_args.command.is_none() { + if let Some(run_args) = mem::take(&mut clap_args.run_args) { + clap_args.command = Some(Command::Run(run_args)); + } else { + return Err(anyhow!("No command specified")); + } + } + + let mut turbo_state = TurboState { + repo_state: None, + parsed_args: clap_args, + }; + + // We run this *before* doing any inference because login/logout/link/unlink + // should work regardless of whether or not we're in a monorepo. + let payload = match turbo_state.parsed_args.command { + Some(Command::Login { .. }) + | Some(Command::Link { .. }) + | Some(Command::Logout { .. }) + | Some(Command::Unlink { .. }) => turbo_state.run_current_turbo(), + Some(Command::Completion { shell }) => { + generate(shell, &mut Args::command(), "turbo", &mut io::stdout()); + + Payload::Rust(Ok(0)) + } + _ => { + // When the `TURBO_BINARY_PATH` variable is set, the user is effectively saying + // that the `turbo` package should run a specific binary. Because + // this code is running, and the `TURBO_BINARY_PATH` variable is + // set, we can deduce that this code is in the binary that the user + // wishes to run. Therefore, we will not find local turbo + // and execute it, because that would go against the user's wishes. + if is_turbo_binary_path_set() { + let repo_state = RepoState::infer(¤t_dir)?; + turbo_state.repo_state = Some(repo_state); + Payload::Go(Box::new(turbo_state)) + } else { + turbo_state.run_correct_turbo(¤t_dir)? + } + } + }; + Ok(payload) +} + +#[cfg(test)] +mod test { + use clap::Parser; + use itertools::Itertools; + use pretty_assertions::assert_eq; + + struct CommandTestCase { + command: &'static str, + command_args: Vec>, + global_args: Vec>, + expected_output: Args, + } + + fn get_default_run_args() -> RunArgs { + RunArgs { + cache_workers: 10, + ..RunArgs::default() + } + } + + impl CommandTestCase { + fn test(&self) { + let permutations = self.create_all_arg_permutations(); + for command in permutations { + assert_eq!(Args::try_parse_from(command).unwrap(), self.expected_output) + } + } + + fn create_all_arg_permutations(&self) -> Vec> { + let mut permutations = Vec::new(); + let mut global_args = vec![vec![self.command]]; + global_args.extend(self.global_args.clone()); + let global_args_len = global_args.len(); + let command_args_len = self.command_args.len(); + + // Iterate through all the different permutations of args + for global_args_permutation in global_args.into_iter().permutations(global_args_len) { + let command_args = self.command_args.clone(); + for command_args_permutation in + command_args.into_iter().permutations(command_args_len) + { + let mut command = vec![vec!["turbo"]]; + command.extend(global_args_permutation.clone()); + command.extend(command_args_permutation); + permutations.push(command.into_iter().flatten().collect()) + } + } + + permutations + } + } + + use crate::{ + commands::{DryRunMode, OutputLogsMode, RunArgs}, + Args, Command, + }; + + #[test] + fn test_parse_run() { + assert_eq!( + Args::try_parse_from(["turbo", "run", "build"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "lint", "test"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string(), "lint".to_string(), "test".to_string()], + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--cache-dir", "foobar"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + cache_dir: Some("foobar".to_string()), + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--cache-workers", "100"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + cache_workers: 100, + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--concurrency", "20"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + concurrency: Some("20".to_string()), + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--continue"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + continue_execution: true, + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--dry-run"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + dry_run: Some(DryRunMode::Text), + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--dry-run", "json"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + dry_run: Some(DryRunMode::Json), + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from([ + "turbo", "run", "build", "--filter", "water", "--filter", "earth", "--filter", + "fire", "--filter", "air" + ]) + .unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + filter: vec![ + "water".to_string(), + "earth".to_string(), + "fire".to_string(), + "air".to_string() + ], + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--force"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + force: true, + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--global-deps", ".env"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + global_deps: vec![".env".to_string()], + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from([ + "turbo", + "run", + "build", + "--global-deps", + ".env", + "--global-deps", + ".env.development" + ]) + .unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + global_deps: vec![".env".to_string(), ".env.development".to_string()], + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--graph"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + graph: Some("".to_string()), + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--graph", "out.html"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + graph: Some("out.html".to_string()), + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--ignore", "foo.js"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + ignore: vec!["foo.js".to_string()], + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from([ + "turbo", "run", "build", "--ignore", "foo.js", "--ignore", "bar.js" + ]) + .unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + ignore: vec!["foo.js".to_string(), "bar.js".to_string()], + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--include-dependencies"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + include_dependencies: true, + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--no-cache"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + no_cache: true, + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--no-daemon"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + no_daemon: true, + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--no-deps"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + no_deps: true, + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--output-logs", "full"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + output_logs: OutputLogsMode::Full, + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--output-logs", "none"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + output_logs: OutputLogsMode::None, + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--output-logs", "hash-only"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + output_logs: OutputLogsMode::HashOnly, + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--parallel"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + parallel: true, + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--profile", "profile_out"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + profile: Some("profile_out".to_string()), + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--remote-only"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + remote_only: true, + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--scope", "foo", "--scope", "bar"]) + .unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + scope: vec!["foo".to_string(), "bar".to_string()], + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--since", "foo"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + since: Some("foo".to_string()), + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "build"]).unwrap(), + Args { + run_args: Some(RunArgs { + tasks: vec!["build".to_string()], + ..get_default_run_args() + }), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "build", "lint", "test"]).unwrap(), + Args { + run_args: Some(RunArgs { + tasks: vec!["build".to_string(), "lint".to_string(), "test".to_string()], + ..get_default_run_args() + }), + ..Args::default() + } + ); + } + + #[test] + fn test_parse_bin() { + assert_eq!( + Args::try_parse_from(["turbo", "bin"]).unwrap(), + Args { + command: Some(Command::Bin {}), + ..Args::default() + } + ); + + CommandTestCase { + command: "bin", + command_args: vec![], + global_args: vec![vec!["--cwd", "../examples/with-yarn"]], + expected_output: Args { + command: Some(Command::Bin {}), + cwd: Some("../examples/with-yarn".to_string()), + ..Args::default() + }, + } + .test(); + } + + #[test] + fn test_parse_login() { + assert_eq!( + Args::try_parse_from(["turbo", "login"]).unwrap(), + Args { + command: Some(Command::Login { sso_team: None }), + ..Args::default() + } + ); + + CommandTestCase { + command: "login", + command_args: vec![], + global_args: vec![vec!["--cwd", "../examples/with-yarn"]], + expected_output: Args { + command: Some(Command::Login { sso_team: None }), + cwd: Some("../examples/with-yarn".to_string()), + ..Args::default() + }, + } + .test(); + + CommandTestCase { + command: "login", + command_args: vec![vec!["--sso-team", "my-team"]], + global_args: vec![vec!["--cwd", "../examples/with-yarn"]], + expected_output: Args { + command: Some(Command::Login { + sso_team: Some("my-team".to_string()), + }), + cwd: Some("../examples/with-yarn".to_string()), + ..Args::default() + }, + } + .test(); + } + + #[test] + fn test_parse_logout() { + assert_eq!( + Args::try_parse_from(["turbo", "logout"]).unwrap(), + Args { + command: Some(Command::Logout {}), + ..Args::default() + } + ); + + CommandTestCase { + command: "logout", + command_args: vec![], + global_args: vec![vec!["--cwd", "../examples/with-yarn"]], + expected_output: Args { + command: Some(Command::Logout {}), + cwd: Some("../examples/with-yarn".to_string()), + ..Args::default() + }, + } + .test(); + } + + #[test] + fn test_parse_unlink() { + assert_eq!( + Args::try_parse_from(["turbo", "unlink"]).unwrap(), + Args { + command: Some(Command::Unlink {}), + ..Args::default() + } + ); + + CommandTestCase { + command: "unlink", + command_args: vec![], + global_args: vec![vec!["--cwd", "../examples/with-yarn"]], + expected_output: Args { + command: Some(Command::Unlink {}), + cwd: Some("../examples/with-yarn".to_string()), + ..Args::default() + }, + } + .test(); + } + + #[test] + fn test_parse_prune() { + let default_prune = Command::Prune { + scope: Vec::new(), + docker: false, + output_dir: "out".to_string(), + }; + + assert_eq!( + Args::try_parse_from(["turbo", "prune"]).unwrap(), + Args { + command: Some(default_prune.clone()), + ..Args::default() + } + ); + + CommandTestCase { + command: "prune", + command_args: vec![], + global_args: vec![vec!["--cwd", "../examples/with-yarn"]], + expected_output: Args { + command: Some(default_prune), + cwd: Some("../examples/with-yarn".to_string()), + ..Args::default() + }, + } + .test(); + + assert_eq!( + Args::try_parse_from(["turbo", "prune", "--scope", "bar"]).unwrap(), + Args { + command: Some(Command::Prune { + scope: vec!["bar".to_string()], + docker: false, + output_dir: "out".to_string(), + }), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "prune", "--docker"]).unwrap(), + Args { + command: Some(Command::Prune { + scope: Vec::new(), + docker: true, + output_dir: "out".to_string(), + }), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from(["turbo", "prune", "--out-dir", "dist"]).unwrap(), + Args { + command: Some(Command::Prune { + scope: Vec::new(), + docker: false, + output_dir: "dist".to_string(), + }), + ..Args::default() + } + ); + + CommandTestCase { + command: "prune", + command_args: vec![vec!["--out-dir", "dist"], vec!["--docker"]], + global_args: vec![], + expected_output: Args { + command: Some(Command::Prune { + scope: Vec::new(), + docker: true, + output_dir: "dist".to_string(), + }), + ..Args::default() + }, + } + .test(); + + CommandTestCase { + command: "prune", + command_args: vec![vec!["--out-dir", "dist"], vec!["--docker"]], + global_args: vec![vec!["--cwd", "../examples/with-yarn"]], + expected_output: Args { + command: Some(Command::Prune { + scope: Vec::new(), + docker: true, + output_dir: "dist".to_string(), + }), + cwd: Some("../examples/with-yarn".to_string()), + ..Args::default() + }, + } + .test(); + + CommandTestCase { + command: "prune", + command_args: vec![ + vec!["--out-dir", "dist"], + vec!["--docker"], + vec!["--scope", "foo"], + ], + global_args: vec![], + expected_output: Args { + command: Some(Command::Prune { + scope: vec!["foo".to_string()], + docker: true, + output_dir: "dist".to_string(), + }), + ..Args::default() + }, + } + .test(); + } + + #[test] + fn test_pass_through_args() { + assert_eq!( + Args::try_parse_from(["turbo", "run", "build", "--", "--script-arg=42"]).unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + pass_through_args: vec!["--script-arg=42".to_string()], + ..get_default_run_args() + })), + ..Args::default() + } + ); + + assert_eq!( + Args::try_parse_from([ + "turbo", + "run", + "build", + "--", + "--script-arg=42", + "--foo", + "--bar", + "bat" + ]) + .unwrap(), + Args { + command: Some(Command::Run(RunArgs { + tasks: vec!["build".to_string()], + pass_through_args: vec![ + "--script-arg=42".to_string(), + "--foo".to_string(), + "--bar".to_string(), + "bat".to_string() + ], + ..get_default_run_args() + })), + ..Args::default() + } + ); + } +} diff --git a/shim/src/package_manager.rs b/crates/turborepo-lib/src/package_manager.rs similarity index 97% rename from shim/src/package_manager.rs rename to crates/turborepo-lib/src/package_manager.rs index b5c83ff0637c3..87ed60f928ffc 100644 --- a/shim/src/package_manager.rs +++ b/crates/turborepo-lib/src/package_manager.rs @@ -109,7 +109,7 @@ mod tests { fn test_get_workspace_globs() { let package_manager = PackageManager::Npm; let globs = package_manager - .get_workspace_globs(Path::new("../examples/with-yarn")) + .get_workspace_globs(Path::new("../../examples/with-yarn")) .unwrap(); assert_eq!( diff --git a/examples/basic/package-lock.json b/examples/basic/package-lock.json new file mode 100644 index 0000000000000..a690d869cfbc8 --- /dev/null +++ b/examples/basic/package-lock.json @@ -0,0 +1,4787 @@ +{ + "name": "basic", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "workspaces": [ + "apps/*", + "packages/*" + ], + "devDependencies": { + "eslint": "^7.32.0", + "eslint-config-custom": "*", + "prettier": "^2.5.1", + "turbo": "latest" + } + }, + "apps/docs": { + "version": "1.0.0", + "dependencies": { + "next": "latest", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "ui": "*" + }, + "devDependencies": { + "@types/node": "^17.0.12", + "@types/react": "^18.0.22", + "@types/react-dom": "^18.0.7", + "eslint-config-custom": "*", + "tsconfig": "*", + "typescript": "^4.5.3" + } + }, + "apps/docs/node_modules/@next/env": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/@next/env/-/env-13.0.2.tgz", + "integrity": "sha512-Qb6WPuRriGIQ19qd6NBxpcrFOfj8ziN7l9eZUfwff5gl4zLXluqtuZPddYZM/oWjN53ZYcuRXzL+oowKyJeYtA==" + }, + "apps/docs/node_modules/@next/swc-darwin-arm64": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.0.2.tgz", + "integrity": "sha512-1zGIOkInkOLRv0QQGZ+3wffYsyKI4vIy62LYTvDWUn7TAYqnmXwougp9NSLqDeagLwgsv2URrykyAFixA/YqxA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "apps/docs/node_modules/@types/react": { + "version": "18.0.25", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.25.tgz", + "integrity": "sha512-xD6c0KDT4m7n9uD4ZHi02lzskaiqcBxf4zi+tXZY98a04wvc0hi/TcCPC2FOESZi51Nd7tlUeOJY8RofL799/g==", + "dev": true, + "dependencies": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "apps/docs/node_modules/@types/react-dom": { + "version": "18.0.8", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.8.tgz", + "integrity": "sha512-C3GYO0HLaOkk9dDAz3Dl4sbe4AKUGTCfFIZsz3n/82dPNN8Du533HzKatDxeUYWu24wJgMP1xICqkWk1YOLOIw==", + "dev": true, + "dependencies": { + "@types/react": "*" + } + }, + "apps/docs/node_modules/next": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/next/-/next-13.0.2.tgz", + "integrity": "sha512-uQ5z5e4D9mOe8+upy6bQdYYjo/kk1v3jMW87kTy2TgAyAsEO+CkwRnMgyZ4JoHEnhPZLHwh7dk0XymRNLe1gFw==", + "dependencies": { + "@next/env": "13.0.2", + "@swc/helpers": "0.4.11", + "caniuse-lite": "^1.0.30001406", + "postcss": "8.4.14", + "styled-jsx": "5.1.0", + "use-sync-external-store": "1.2.0" + }, + "bin": { + "next": "dist/bin/next" + }, + "engines": { + "node": ">=14.6.0" + }, + "optionalDependencies": { + "@next/swc-android-arm-eabi": "13.0.2", + "@next/swc-android-arm64": "13.0.2", + "@next/swc-darwin-arm64": "13.0.2", + "@next/swc-darwin-x64": "13.0.2", + "@next/swc-freebsd-x64": "13.0.2", + "@next/swc-linux-arm-gnueabihf": "13.0.2", + "@next/swc-linux-arm64-gnu": "13.0.2", + "@next/swc-linux-arm64-musl": "13.0.2", + "@next/swc-linux-x64-gnu": "13.0.2", + "@next/swc-linux-x64-musl": "13.0.2", + "@next/swc-win32-arm64-msvc": "13.0.2", + "@next/swc-win32-ia32-msvc": "13.0.2", + "@next/swc-win32-x64-msvc": "13.0.2" + }, + "peerDependencies": { + "fibers": ">= 3.1.0", + "node-sass": "^6.0.0 || ^7.0.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "sass": "^1.3.0" + }, + "peerDependenciesMeta": { + "fibers": { + "optional": true + }, + "node-sass": { + "optional": true + }, + "sass": { + "optional": true + } + } + }, + "apps/docs/node_modules/react": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "apps/docs/node_modules/react-dom": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.0" + }, + "peerDependencies": { + "react": "^18.2.0" + } + }, + "apps/docs/node_modules/scheduler": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "apps/docs/node_modules/styled-jsx": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.0.tgz", + "integrity": "sha512-/iHaRJt9U7T+5tp6TRelLnqBqiaIT0HsO0+vgyj8hK2KUk7aejFqRrumqPUlAqDwAj8IbS/1hk3IhBAAK/FCUQ==", + "dependencies": { + "client-only": "0.0.1" + }, + "engines": { + "node": ">= 12.0.0" + }, + "peerDependencies": { + "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "babel-plugin-macros": { + "optional": true + } + } + }, + "apps/web": { + "version": "1.0.0", + "dependencies": { + "next": "latest", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "ui": "*" + }, + "devDependencies": { + "@types/node": "^17.0.12", + "@types/react": "^18.0.22", + "@types/react-dom": "^18.0.7", + "eslint-config-custom": "*", + "tsconfig": "*", + "typescript": "^4.5.3" + } + }, + "apps/web/node_modules/@next/env": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/@next/env/-/env-13.0.2.tgz", + "integrity": "sha512-Qb6WPuRriGIQ19qd6NBxpcrFOfj8ziN7l9eZUfwff5gl4zLXluqtuZPddYZM/oWjN53ZYcuRXzL+oowKyJeYtA==" + }, + "apps/web/node_modules/@next/swc-darwin-arm64": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.0.2.tgz", + "integrity": "sha512-1zGIOkInkOLRv0QQGZ+3wffYsyKI4vIy62LYTvDWUn7TAYqnmXwougp9NSLqDeagLwgsv2URrykyAFixA/YqxA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "apps/web/node_modules/@types/react": { + "version": "18.0.25", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.25.tgz", + "integrity": "sha512-xD6c0KDT4m7n9uD4ZHi02lzskaiqcBxf4zi+tXZY98a04wvc0hi/TcCPC2FOESZi51Nd7tlUeOJY8RofL799/g==", + "dev": true, + "dependencies": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "apps/web/node_modules/@types/react-dom": { + "version": "18.0.8", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.8.tgz", + "integrity": "sha512-C3GYO0HLaOkk9dDAz3Dl4sbe4AKUGTCfFIZsz3n/82dPNN8Du533HzKatDxeUYWu24wJgMP1xICqkWk1YOLOIw==", + "dev": true, + "dependencies": { + "@types/react": "*" + } + }, + "apps/web/node_modules/next": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/next/-/next-13.0.2.tgz", + "integrity": "sha512-uQ5z5e4D9mOe8+upy6bQdYYjo/kk1v3jMW87kTy2TgAyAsEO+CkwRnMgyZ4JoHEnhPZLHwh7dk0XymRNLe1gFw==", + "dependencies": { + "@next/env": "13.0.2", + "@swc/helpers": "0.4.11", + "caniuse-lite": "^1.0.30001406", + "postcss": "8.4.14", + "styled-jsx": "5.1.0", + "use-sync-external-store": "1.2.0" + }, + "bin": { + "next": "dist/bin/next" + }, + "engines": { + "node": ">=14.6.0" + }, + "optionalDependencies": { + "@next/swc-android-arm-eabi": "13.0.2", + "@next/swc-android-arm64": "13.0.2", + "@next/swc-darwin-arm64": "13.0.2", + "@next/swc-darwin-x64": "13.0.2", + "@next/swc-freebsd-x64": "13.0.2", + "@next/swc-linux-arm-gnueabihf": "13.0.2", + "@next/swc-linux-arm64-gnu": "13.0.2", + "@next/swc-linux-arm64-musl": "13.0.2", + "@next/swc-linux-x64-gnu": "13.0.2", + "@next/swc-linux-x64-musl": "13.0.2", + "@next/swc-win32-arm64-msvc": "13.0.2", + "@next/swc-win32-ia32-msvc": "13.0.2", + "@next/swc-win32-x64-msvc": "13.0.2" + }, + "peerDependencies": { + "fibers": ">= 3.1.0", + "node-sass": "^6.0.0 || ^7.0.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "sass": "^1.3.0" + }, + "peerDependenciesMeta": { + "fibers": { + "optional": true + }, + "node-sass": { + "optional": true + }, + "sass": { + "optional": true + } + } + }, + "apps/web/node_modules/react": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "apps/web/node_modules/react-dom": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.0" + }, + "peerDependencies": { + "react": "^18.2.0" + } + }, + "apps/web/node_modules/scheduler": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "apps/web/node_modules/styled-jsx": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.0.tgz", + "integrity": "sha512-/iHaRJt9U7T+5tp6TRelLnqBqiaIT0HsO0+vgyj8hK2KUk7aejFqRrumqPUlAqDwAj8IbS/1hk3IhBAAK/FCUQ==", + "dependencies": { + "client-only": "0.0.1" + }, + "engines": { + "node": ">= 12.0.0" + }, + "peerDependencies": { + "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/@babel/code-frame": { + "version": "7.12.11", + "license": "MIT", + "dependencies": { + "@babel/highlight": "^7.10.4" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.19.1", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.18.6", + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.18.6", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "license": "MIT" + }, + "node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/runtime": { + "version": "7.19.0", + "license": "MIT", + "dependencies": { + "regenerator-runtime": "^0.13.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/runtime-corejs3": { + "version": "7.19.1", + "license": "MIT", + "dependencies": { + "core-js-pure": "^3.25.1", + "regenerator-runtime": "^0.13.4" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "0.4.3", + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.5.0", + "license": "Apache-2.0", + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "license": "BSD-3-Clause" + }, + "node_modules/@next/eslint-plugin-next": { + "version": "12.3.1", + "license": "MIT", + "dependencies": { + "glob": "7.1.7" + } + }, + "node_modules/@next/eslint-plugin-next/node_modules/glob": { + "version": "7.1.7", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@rushstack/eslint-patch": { + "version": "1.2.0", + "license": "MIT" + }, + "node_modules/@swc/helpers": { + "version": "0.4.11", + "license": "MIT", + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@types/json5": { + "version": "0.0.29", + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "17.0.45", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/prop-types": { + "version": "15.7.5", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "17.0.50", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "node_modules/@types/react-dom": { + "version": "17.0.17", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/react": "^17" + } + }, + "node_modules/@types/scheduler": { + "version": "0.16.2", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/parser": { + "version": "5.38.0", + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/scope-manager": "5.38.0", + "@typescript-eslint/types": "5.38.0", + "@typescript-eslint/typescript-estree": "5.38.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "5.38.0", + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "5.38.0", + "@typescript-eslint/visitor-keys": "5.38.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "5.38.0", + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "5.38.0", + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "5.38.0", + "@typescript-eslint/visitor-keys": "5.38.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.38.0", + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "5.38.0", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "3.3.0", + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/acorn": { + "version": "7.4.1", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "1.0.10", + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/aria-query": { + "version": "4.2.2", + "license": "Apache-2.0", + "dependencies": { + "@babel/runtime": "^7.10.2", + "@babel/runtime-corejs3": "^7.10.2" + }, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/array-includes": { + "version": "3.1.5", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5", + "get-intrinsic": "^1.1.1", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.0", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.2", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.0", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.2", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ast-types-flow": { + "version": "0.0.7", + "license": "ISC" + }, + "node_modules/astral-regex": { + "version": "2.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/axe-core": { + "version": "4.4.3", + "license": "MPL-2.0", + "engines": { + "node": ">=4" + } + }, + "node_modules/axobject-query": { + "version": "2.2.0", + "license": "Apache-2.0" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "license": "MIT", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001409", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==" + }, + "node_modules/color-convert": { + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "license": "MIT" + }, + "node_modules/core-js-pure": { + "version": "3.25.2", + "hasInstallScript": true, + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/csstype": { + "version": "3.1.1", + "dev": true, + "license": "MIT" + }, + "node_modules/damerau-levenshtein": { + "version": "1.0.8", + "license": "BSD-2-Clause" + }, + "node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "license": "MIT" + }, + "node_modules/define-properties": { + "version": "1.1.4", + "license": "MIT", + "dependencies": { + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "license": "MIT", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/docs": { + "resolved": "apps/docs", + "link": true + }, + "node_modules/doctrine": { + "version": "3.0.0", + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "license": "MIT" + }, + "node_modules/enquirer": { + "version": "2.3.6", + "license": "MIT", + "dependencies": { + "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/es-abstract": { + "version": "1.20.2", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "function.prototype.name": "^1.1.5", + "get-intrinsic": "^1.1.2", + "get-symbol-description": "^1.0.0", + "has": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.3", + "is-callable": "^1.2.4", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.2", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.4.3", + "string.prototype.trimend": "^1.0.5", + "string.prototype.trimstart": "^1.0.5", + "unbox-primitive": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "has": "^1.0.3" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "license": "MIT", + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "7.32.0", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.3", + "@humanwhocodes/config-array": "^0.5.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.1.2", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.9", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-custom": { + "resolved": "packages/eslint-config-custom", + "link": true + }, + "node_modules/eslint-config-next": { + "version": "12.3.1", + "license": "MIT", + "dependencies": { + "@next/eslint-plugin-next": "12.3.1", + "@rushstack/eslint-patch": "^1.1.3", + "@typescript-eslint/parser": "^5.21.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-import-resolver-typescript": "^2.7.1", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-jsx-a11y": "^6.5.1", + "eslint-plugin-react": "^7.31.7", + "eslint-plugin-react-hooks": "^4.5.0" + }, + "peerDependencies": { + "eslint": "^7.23.0 || ^8.0.0", + "typescript": ">=3.3.1" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/eslint-config-next/node_modules/doctrine": { + "version": "2.1.0", + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-config-next/node_modules/eslint-plugin-react": { + "version": "7.31.8", + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.5", + "array.prototype.flatmap": "^1.3.0", + "doctrine": "^2.1.0", + "estraverse": "^5.3.0", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.5", + "object.fromentries": "^2.0.5", + "object.hasown": "^1.1.1", + "object.values": "^1.1.5", + "prop-types": "^15.8.1", + "resolve": "^2.0.0-next.3", + "semver": "^6.3.0", + "string.prototype.matchall": "^4.0.7" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8" + } + }, + "node_modules/eslint-config-next/node_modules/estraverse": { + "version": "5.3.0", + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/eslint-config-next/node_modules/resolve": { + "version": "2.0.0-next.4", + "license": "MIT", + "dependencies": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/eslint-config-next/node_modules/semver": { + "version": "6.3.0", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-config-prettier": { + "version": "8.5.0", + "license": "MIT", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, + "node_modules/eslint-config-turbo": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/eslint-config-turbo/-/eslint-config-turbo-0.0.4.tgz", + "integrity": "sha512-HErPS/wfWkSdV9Yd2dDkhZt3W2B78Ih/aWPFfaHmCMjzPalh+5KxRRGTf8MOBQLCebcWJX0lP1Zvc1rZIHlXGg==", + "dependencies": { + "eslint-plugin-turbo": "0.0.4" + }, + "peerDependencies": { + "eslint": "^7.23.0 || ^8.0.0" + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.6", + "license": "MIT", + "dependencies": { + "debug": "^3.2.7", + "resolve": "^1.20.0" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-import-resolver-typescript": { + "version": "2.7.1", + "license": "ISC", + "dependencies": { + "debug": "^4.3.4", + "glob": "^7.2.0", + "is-glob": "^4.0.3", + "resolve": "^1.22.0", + "tsconfig-paths": "^3.14.1" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "*", + "eslint-plugin-import": "*" + } + }, + "node_modules/eslint-module-utils": { + "version": "2.7.4", + "license": "MIT", + "dependencies": { + "debug": "^3.2.7" + }, + "engines": { + "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.26.0", + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.4", + "array.prototype.flat": "^1.2.5", + "debug": "^2.6.9", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-module-utils": "^2.7.3", + "has": "^1.0.3", + "is-core-module": "^2.8.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.values": "^1.1.5", + "resolve": "^1.22.0", + "tsconfig-paths": "^3.14.1" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "2.6.9", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/ms": { + "version": "2.0.0", + "license": "MIT" + }, + "node_modules/eslint-plugin-jsx-a11y": { + "version": "6.6.1", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.18.9", + "aria-query": "^4.2.2", + "array-includes": "^3.1.5", + "ast-types-flow": "^0.0.7", + "axe-core": "^4.4.3", + "axobject-query": "^2.2.0", + "damerau-levenshtein": "^1.0.8", + "emoji-regex": "^9.2.2", + "has": "^1.0.3", + "jsx-ast-utils": "^3.3.2", + "language-tags": "^1.0.5", + "minimatch": "^3.1.2", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=4.0" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8" + } + }, + "node_modules/eslint-plugin-jsx-a11y/node_modules/emoji-regex": { + "version": "9.2.2", + "license": "MIT" + }, + "node_modules/eslint-plugin-jsx-a11y/node_modules/semver": { + "version": "6.3.0", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-plugin-react": { + "version": "7.28.0", + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.4", + "array.prototype.flatmap": "^1.2.5", + "doctrine": "^2.1.0", + "estraverse": "^5.3.0", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.0.4", + "object.entries": "^1.1.5", + "object.fromentries": "^2.0.5", + "object.hasown": "^1.1.0", + "object.values": "^1.1.5", + "prop-types": "^15.7.2", + "resolve": "^2.0.0-next.3", + "semver": "^6.3.0", + "string.prototype.matchall": "^4.0.6" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8" + } + }, + "node_modules/eslint-plugin-react-hooks": { + "version": "4.6.0", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0" + } + }, + "node_modules/eslint-plugin-react/node_modules/doctrine": { + "version": "2.1.0", + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-react/node_modules/estraverse": { + "version": "5.3.0", + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/eslint-plugin-react/node_modules/resolve": { + "version": "2.0.0-next.4", + "license": "MIT", + "dependencies": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/eslint-plugin-react/node_modules/semver": { + "version": "6.3.0", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-plugin-turbo": { + "version": "0.0.4", + "license": "MPL-2.0", + "peerDependencies": { + "eslint": "^7.23.0 || ^8.0.0" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "2.1.0", + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "license": "Apache-2.0", + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "license": "Apache-2.0", + "engines": { + "node": ">=10" + } + }, + "node_modules/espree": { + "version": "7.3.1", + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "license": "Apache-2.0", + "engines": { + "node": ">=4" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.4.0", + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esquery/node_modules/estraverse": { + "version": "5.3.0", + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.2.12", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.13.0", + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "license": "MIT", + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/flat-cache": { + "version": "3.0.4", + "license": "MIT", + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.7", + "license": "ISC" + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "license": "ISC" + }, + "node_modules/function-bind": { + "version": "1.1.1", + "license": "MIT" + }, + "node_modules/function.prototype.name": { + "version": "1.1.5", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "license": "MIT" + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.1.3", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globals": { + "version": "13.17.0", + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "license": "MIT", + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby/node_modules/ignore": { + "version": "5.2.0", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/has": { + "version": "1.0.3", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ignore": { + "version": "4.0.6", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "license": "ISC" + }, + "node_modules/internal-slot": { + "version": "1.0.3", + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.1.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "license": "MIT", + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.6", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.10.0", + "license": "MIT", + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.2", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-regex": { + "version": "1.1.4", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.2", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "license": "ISC" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "3.14.1", + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "license": "MIT" + }, + "node_modules/json5": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/jsx-ast-utils": { + "version": "3.3.3", + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.5", + "object.assign": "^4.1.3" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/language-subtag-registry": { + "version": "0.3.22", + "license": "CC0-1.0" + }, + "node_modules/language-tags": { + "version": "1.0.5", + "license": "MIT", + "dependencies": { + "language-subtag-registry": "~0.3.2" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "license": "MIT" + }, + "node_modules/lodash.truncate": { + "version": "4.4.2", + "license": "MIT" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "license": "MIT", + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.6", + "license": "MIT" + }, + "node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.4", + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "license": "MIT" + }, + "node_modules/object-assign": { + "version": "4.1.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.12.2", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.4", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.entries": { + "version": "1.1.5", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.5", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.hasown": { + "version": "1.1.1", + "license": "MIT", + "dependencies": { + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.values": { + "version": "1.1.5", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.1", + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "license": "MIT" + }, + "node_modules/path-type": { + "version": "4.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.4.14", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.4", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "2.7.1", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/progress": { + "version": "2.0.3", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/prop-types": { + "version": "15.8.1", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/punycode": { + "version": "2.1.1", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/react": { + "version": "17.0.2", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-is": { + "version": "16.13.1", + "license": "MIT" + }, + "node_modules/regenerator-runtime": { + "version": "0.13.9", + "license": "MIT" + }, + "node_modules/regexp.prototype.flags": { + "version": "1.4.3", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "functions-have-names": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regexpp": { + "version": "3.2.0", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.1", + "license": "MIT", + "dependencies": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/semver": { + "version": "7.3.7", + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.0.4", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi": { + "version": "4.0.0", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "license": "BSD-3-Clause" + }, + "node_modules/string-width": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string.prototype.matchall": { + "version": "4.0.7", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1", + "get-intrinsic": "^1.1.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.3", + "regexp.prototype.flags": "^1.4.1", + "side-channel": "^1.0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.5", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.5", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/table": { + "version": "6.8.0", + "license": "BSD-3-Clause", + "dependencies": { + "ajv": "^8.0.1", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/table/node_modules/ajv": { + "version": "8.11.0", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/table/node_modules/json-schema-traverse": { + "version": "1.0.0", + "license": "MIT" + }, + "node_modules/text-table": { + "version": "0.2.0", + "license": "MIT" + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tsconfig": { + "resolved": "packages/tsconfig", + "link": true + }, + "node_modules/tsconfig-paths": { + "version": "3.14.1", + "license": "MIT", + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "node_modules/tslib": { + "version": "2.4.0", + "license": "0BSD" + }, + "node_modules/tsutils": { + "version": "3.21.0", + "license": "MIT", + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/tsutils/node_modules/tslib": { + "version": "1.14.1", + "license": "0BSD" + }, + "node_modules/turbo": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/turbo/-/turbo-1.6.3.tgz", + "integrity": "sha512-FtfhJLmEEtHveGxW4Ye/QuY85AnZ2ZNVgkTBswoap7UMHB1+oI4diHPNyqrQLG4K1UFtCkjOlVoLsllUh/9QRw==", + "dev": true, + "hasInstallScript": true, + "bin": { + "turbo": "bin/turbo" + }, + "optionalDependencies": { + "turbo-darwin-64": "1.6.3", + "turbo-darwin-arm64": "1.6.3", + "turbo-linux-64": "1.6.3", + "turbo-linux-arm64": "1.6.3", + "turbo-windows-64": "1.6.3", + "turbo-windows-arm64": "1.6.3" + } + }, + "node_modules/turbo-darwin-arm64": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/turbo-darwin-arm64/-/turbo-darwin-arm64-1.6.3.tgz", + "integrity": "sha512-75DXhFpwE7CinBbtxTxH08EcWrxYSPFow3NaeFwsG8aymkWXF+U2aukYHJA6I12n9/dGqf7yRXzkF0S/9UtdyQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/type-check": { + "version": "0.4.0", + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "4.8.3", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/ui": { + "resolved": "packages/ui", + "link": true + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/use-sync-external-store": { + "version": "1.2.0", + "license": "MIT", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/v8-compile-cache": { + "version": "2.3.0", + "license": "MIT" + }, + "node_modules/web": { + "resolved": "apps/web", + "link": true + }, + "node_modules/which": { + "version": "2.0.2", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "license": "MIT", + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/word-wrap": { + "version": "1.2.3", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "license": "ISC" + }, + "node_modules/yallist": { + "version": "4.0.0", + "license": "ISC" + }, + "packages/eslint-config-custom": { + "version": "0.0.0", + "license": "MIT", + "dependencies": { + "eslint-config-next": "^12.0.8", + "eslint-config-prettier": "^8.3.0", + "eslint-config-turbo": "latest", + "eslint-plugin-react": "7.28.0" + } + }, + "packages/tsconfig": { + "version": "0.0.0", + "license": "MIT" + }, + "packages/ui": { + "version": "0.0.0", + "license": "MIT", + "devDependencies": { + "@types/react": "^17.0.37", + "@types/react-dom": "^17.0.11", + "eslint": "^7.32.0", + "eslint-config-custom": "*", + "react": "^17.0.2", + "tsconfig": "*", + "typescript": "^4.5.2" + } + } + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.11", + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.19.1" + }, + "@babel/highlight": { + "version": "7.18.6", + "requires": { + "@babel/helper-validator-identifier": "^7.18.6", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3" + }, + "escape-string-regexp": { + "version": "1.0.5" + }, + "has-flag": { + "version": "3.0.0" + }, + "supports-color": { + "version": "5.5.0", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@babel/runtime": { + "version": "7.19.0", + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "@babel/runtime-corejs3": { + "version": "7.19.1", + "requires": { + "core-js-pure": "^3.25.1", + "regenerator-runtime": "^0.13.4" + } + }, + "@eslint/eslintrc": { + "version": "0.4.3", + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^13.9.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + } + }, + "@humanwhocodes/config-array": { + "version": "0.5.0", + "requires": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + } + }, + "@humanwhocodes/object-schema": { + "version": "1.2.1" + }, + "@next/eslint-plugin-next": { + "version": "12.3.1", + "requires": { + "glob": "7.1.7" + }, + "dependencies": { + "glob": { + "version": "7.1.7", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5" + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "@rushstack/eslint-patch": { + "version": "1.2.0" + }, + "@swc/helpers": { + "version": "0.4.11", + "requires": { + "tslib": "^2.4.0" + } + }, + "@types/json5": { + "version": "0.0.29" + }, + "@types/node": { + "version": "17.0.45", + "dev": true + }, + "@types/prop-types": { + "version": "15.7.5", + "dev": true + }, + "@types/react": { + "version": "17.0.50", + "dev": true, + "requires": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "@types/react-dom": { + "version": "17.0.17", + "dev": true, + "requires": { + "@types/react": "^17" + } + }, + "@types/scheduler": { + "version": "0.16.2", + "dev": true + }, + "@typescript-eslint/parser": { + "version": "5.38.0", + "requires": { + "@typescript-eslint/scope-manager": "5.38.0", + "@typescript-eslint/types": "5.38.0", + "@typescript-eslint/typescript-estree": "5.38.0", + "debug": "^4.3.4" + } + }, + "@typescript-eslint/scope-manager": { + "version": "5.38.0", + "requires": { + "@typescript-eslint/types": "5.38.0", + "@typescript-eslint/visitor-keys": "5.38.0" + } + }, + "@typescript-eslint/types": { + "version": "5.38.0" + }, + "@typescript-eslint/typescript-estree": { + "version": "5.38.0", + "requires": { + "@typescript-eslint/types": "5.38.0", + "@typescript-eslint/visitor-keys": "5.38.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "5.38.0", + "requires": { + "@typescript-eslint/types": "5.38.0", + "eslint-visitor-keys": "^3.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "3.3.0" + } + } + }, + "acorn": { + "version": "7.4.1" + }, + "acorn-jsx": { + "version": "5.3.2", + "requires": {} + }, + "ajv": { + "version": "6.12.6", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-colors": { + "version": "4.1.3" + }, + "ansi-regex": { + "version": "5.0.1" + }, + "ansi-styles": { + "version": "4.3.0", + "requires": { + "color-convert": "^2.0.1" + } + }, + "argparse": { + "version": "1.0.10", + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "aria-query": { + "version": "4.2.2", + "requires": { + "@babel/runtime": "^7.10.2", + "@babel/runtime-corejs3": "^7.10.2" + } + }, + "array-includes": { + "version": "3.1.5", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5", + "get-intrinsic": "^1.1.1", + "is-string": "^1.0.7" + } + }, + "array-union": { + "version": "2.1.0" + }, + "array.prototype.flat": { + "version": "1.3.0", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.2", + "es-shim-unscopables": "^1.0.0" + } + }, + "array.prototype.flatmap": { + "version": "1.3.0", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.2", + "es-shim-unscopables": "^1.0.0" + } + }, + "ast-types-flow": { + "version": "0.0.7" + }, + "astral-regex": { + "version": "2.0.0" + }, + "axe-core": { + "version": "4.4.3" + }, + "axobject-query": { + "version": "2.2.0" + }, + "balanced-match": { + "version": "1.0.2" + }, + "brace-expansion": { + "version": "1.1.11", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "requires": { + "fill-range": "^7.0.1" + } + }, + "call-bind": { + "version": "1.0.2", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "callsites": { + "version": "3.1.0" + }, + "caniuse-lite": { + "version": "1.0.30001409" + }, + "chalk": { + "version": "4.1.2", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==" + }, + "color-convert": { + "version": "2.0.1", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4" + }, + "concat-map": { + "version": "0.0.1" + }, + "core-js-pure": { + "version": "3.25.2" + }, + "cross-spawn": { + "version": "7.0.3", + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "csstype": { + "version": "3.1.1", + "dev": true + }, + "damerau-levenshtein": { + "version": "1.0.8" + }, + "debug": { + "version": "4.3.4", + "requires": { + "ms": "2.1.2" + } + }, + "deep-is": { + "version": "0.1.4" + }, + "define-properties": { + "version": "1.1.4", + "requires": { + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + } + }, + "dir-glob": { + "version": "3.0.1", + "requires": { + "path-type": "^4.0.0" + } + }, + "docs": { + "version": "file:apps/docs", + "requires": { + "@types/node": "^17.0.12", + "@types/react": "^18.0.22", + "@types/react-dom": "^18.0.7", + "eslint-config-custom": "*", + "next": "latest", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "tsconfig": "*", + "typescript": "^4.5.3", + "ui": "*" + }, + "dependencies": { + "@next/env": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/@next/env/-/env-13.0.2.tgz", + "integrity": "sha512-Qb6WPuRriGIQ19qd6NBxpcrFOfj8ziN7l9eZUfwff5gl4zLXluqtuZPddYZM/oWjN53ZYcuRXzL+oowKyJeYtA==" + }, + "@next/swc-darwin-arm64": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.0.2.tgz", + "integrity": "sha512-1zGIOkInkOLRv0QQGZ+3wffYsyKI4vIy62LYTvDWUn7TAYqnmXwougp9NSLqDeagLwgsv2URrykyAFixA/YqxA==", + "optional": true + }, + "@types/react": { + "version": "18.0.25", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.25.tgz", + "integrity": "sha512-xD6c0KDT4m7n9uD4ZHi02lzskaiqcBxf4zi+tXZY98a04wvc0hi/TcCPC2FOESZi51Nd7tlUeOJY8RofL799/g==", + "dev": true, + "requires": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "@types/react-dom": { + "version": "18.0.8", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.8.tgz", + "integrity": "sha512-C3GYO0HLaOkk9dDAz3Dl4sbe4AKUGTCfFIZsz3n/82dPNN8Du533HzKatDxeUYWu24wJgMP1xICqkWk1YOLOIw==", + "dev": true, + "requires": { + "@types/react": "*" + } + }, + "next": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/next/-/next-13.0.2.tgz", + "integrity": "sha512-uQ5z5e4D9mOe8+upy6bQdYYjo/kk1v3jMW87kTy2TgAyAsEO+CkwRnMgyZ4JoHEnhPZLHwh7dk0XymRNLe1gFw==", + "requires": { + "@next/env": "13.0.2", + "@next/swc-android-arm-eabi": "13.0.2", + "@next/swc-android-arm64": "13.0.2", + "@next/swc-darwin-arm64": "13.0.2", + "@next/swc-darwin-x64": "13.0.2", + "@next/swc-freebsd-x64": "13.0.2", + "@next/swc-linux-arm-gnueabihf": "13.0.2", + "@next/swc-linux-arm64-gnu": "13.0.2", + "@next/swc-linux-arm64-musl": "13.0.2", + "@next/swc-linux-x64-gnu": "13.0.2", + "@next/swc-linux-x64-musl": "13.0.2", + "@next/swc-win32-arm64-msvc": "13.0.2", + "@next/swc-win32-ia32-msvc": "13.0.2", + "@next/swc-win32-x64-msvc": "13.0.2", + "@swc/helpers": "0.4.11", + "caniuse-lite": "^1.0.30001406", + "postcss": "8.4.14", + "styled-jsx": "5.1.0", + "use-sync-external-store": "1.2.0" + } + }, + "react": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "requires": { + "loose-envify": "^1.1.0" + } + }, + "react-dom": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "requires": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.0" + } + }, + "scheduler": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", + "requires": { + "loose-envify": "^1.1.0" + } + }, + "styled-jsx": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.0.tgz", + "integrity": "sha512-/iHaRJt9U7T+5tp6TRelLnqBqiaIT0HsO0+vgyj8hK2KUk7aejFqRrumqPUlAqDwAj8IbS/1hk3IhBAAK/FCUQ==", + "requires": { + "client-only": "0.0.1" + } + } + } + }, + "doctrine": { + "version": "3.0.0", + "requires": { + "esutils": "^2.0.2" + } + }, + "emoji-regex": { + "version": "8.0.0" + }, + "enquirer": { + "version": "2.3.6", + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "es-abstract": { + "version": "1.20.2", + "requires": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "function.prototype.name": "^1.1.5", + "get-intrinsic": "^1.1.2", + "get-symbol-description": "^1.0.0", + "has": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.3", + "is-callable": "^1.2.4", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.2", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.4.3", + "string.prototype.trimend": "^1.0.5", + "string.prototype.trimstart": "^1.0.5", + "unbox-primitive": "^1.0.2" + } + }, + "es-shim-unscopables": { + "version": "1.0.0", + "requires": { + "has": "^1.0.3" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-string-regexp": { + "version": "4.0.0" + }, + "eslint": { + "version": "7.32.0", + "requires": { + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.3", + "@humanwhocodes/config-array": "^0.5.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.1.2", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.9", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + } + }, + "eslint-config-custom": { + "version": "file:packages/eslint-config-custom", + "requires": { + "eslint-config-next": "^12.0.8", + "eslint-config-prettier": "^8.3.0", + "eslint-config-turbo": "latest", + "eslint-plugin-react": "7.28.0" + } + }, + "eslint-config-next": { + "version": "12.3.1", + "requires": { + "@next/eslint-plugin-next": "12.3.1", + "@rushstack/eslint-patch": "^1.1.3", + "@typescript-eslint/parser": "^5.21.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-import-resolver-typescript": "^2.7.1", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-jsx-a11y": "^6.5.1", + "eslint-plugin-react": "^7.31.7", + "eslint-plugin-react-hooks": "^4.5.0" + }, + "dependencies": { + "doctrine": { + "version": "2.1.0", + "requires": { + "esutils": "^2.0.2" + } + }, + "eslint-plugin-react": { + "version": "7.31.8", + "requires": { + "array-includes": "^3.1.5", + "array.prototype.flatmap": "^1.3.0", + "doctrine": "^2.1.0", + "estraverse": "^5.3.0", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.5", + "object.fromentries": "^2.0.5", + "object.hasown": "^1.1.1", + "object.values": "^1.1.5", + "prop-types": "^15.8.1", + "resolve": "^2.0.0-next.3", + "semver": "^6.3.0", + "string.prototype.matchall": "^4.0.7" + } + }, + "estraverse": { + "version": "5.3.0" + }, + "resolve": { + "version": "2.0.0-next.4", + "requires": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "semver": { + "version": "6.3.0" + } + } + }, + "eslint-config-prettier": { + "version": "8.5.0", + "requires": {} + }, + "eslint-config-turbo": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/eslint-config-turbo/-/eslint-config-turbo-0.0.4.tgz", + "integrity": "sha512-HErPS/wfWkSdV9Yd2dDkhZt3W2B78Ih/aWPFfaHmCMjzPalh+5KxRRGTf8MOBQLCebcWJX0lP1Zvc1rZIHlXGg==", + "requires": { + "eslint-plugin-turbo": "0.0.4" + } + }, + "eslint-import-resolver-node": { + "version": "0.3.6", + "requires": { + "debug": "^3.2.7", + "resolve": "^1.20.0" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "eslint-import-resolver-typescript": { + "version": "2.7.1", + "requires": { + "debug": "^4.3.4", + "glob": "^7.2.0", + "is-glob": "^4.0.3", + "resolve": "^1.22.0", + "tsconfig-paths": "^3.14.1" + } + }, + "eslint-module-utils": { + "version": "2.7.4", + "requires": { + "debug": "^3.2.7" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "eslint-plugin-import": { + "version": "2.26.0", + "requires": { + "array-includes": "^3.1.4", + "array.prototype.flat": "^1.2.5", + "debug": "^2.6.9", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-module-utils": "^2.7.3", + "has": "^1.0.3", + "is-core-module": "^2.8.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.values": "^1.1.5", + "resolve": "^1.22.0", + "tsconfig-paths": "^3.14.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "2.1.0", + "requires": { + "esutils": "^2.0.2" + } + }, + "ms": { + "version": "2.0.0" + } + } + }, + "eslint-plugin-jsx-a11y": { + "version": "6.6.1", + "requires": { + "@babel/runtime": "^7.18.9", + "aria-query": "^4.2.2", + "array-includes": "^3.1.5", + "ast-types-flow": "^0.0.7", + "axe-core": "^4.4.3", + "axobject-query": "^2.2.0", + "damerau-levenshtein": "^1.0.8", + "emoji-regex": "^9.2.2", + "has": "^1.0.3", + "jsx-ast-utils": "^3.3.2", + "language-tags": "^1.0.5", + "minimatch": "^3.1.2", + "semver": "^6.3.0" + }, + "dependencies": { + "emoji-regex": { + "version": "9.2.2" + }, + "semver": { + "version": "6.3.0" + } + } + }, + "eslint-plugin-react": { + "version": "7.28.0", + "requires": { + "array-includes": "^3.1.4", + "array.prototype.flatmap": "^1.2.5", + "doctrine": "^2.1.0", + "estraverse": "^5.3.0", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.0.4", + "object.entries": "^1.1.5", + "object.fromentries": "^2.0.5", + "object.hasown": "^1.1.0", + "object.values": "^1.1.5", + "prop-types": "^15.7.2", + "resolve": "^2.0.0-next.3", + "semver": "^6.3.0", + "string.prototype.matchall": "^4.0.6" + }, + "dependencies": { + "doctrine": { + "version": "2.1.0", + "requires": { + "esutils": "^2.0.2" + } + }, + "estraverse": { + "version": "5.3.0" + }, + "resolve": { + "version": "2.0.0-next.4", + "requires": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "semver": { + "version": "6.3.0" + } + } + }, + "eslint-plugin-react-hooks": { + "version": "4.6.0", + "requires": {} + }, + "eslint-plugin-turbo": { + "version": "0.0.4", + "requires": {} + }, + "eslint-scope": { + "version": "5.1.1", + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.1.0", + "requires": { + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0" + } + } + }, + "eslint-visitor-keys": { + "version": "2.1.0" + }, + "espree": { + "version": "7.3.1", + "requires": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0" + } + } + }, + "esprima": { + "version": "4.0.1" + }, + "esquery": { + "version": "1.4.0", + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0" + } + } + }, + "esrecurse": { + "version": "4.3.0", + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.3.0" + } + } + }, + "estraverse": { + "version": "4.3.0" + }, + "esutils": { + "version": "2.0.3" + }, + "fast-deep-equal": { + "version": "3.1.3" + }, + "fast-glob": { + "version": "3.2.12", + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + } + }, + "fast-json-stable-stringify": { + "version": "2.1.0" + }, + "fast-levenshtein": { + "version": "2.0.6" + }, + "fastq": { + "version": "1.13.0", + "requires": { + "reusify": "^1.0.4" + } + }, + "file-entry-cache": { + "version": "6.0.1", + "requires": { + "flat-cache": "^3.0.4" + } + }, + "fill-range": { + "version": "7.0.1", + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "flat-cache": { + "version": "3.0.4", + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + } + }, + "flatted": { + "version": "3.2.7" + }, + "fs.realpath": { + "version": "1.0.0" + }, + "function-bind": { + "version": "1.1.1" + }, + "function.prototype.name": { + "version": "1.1.5", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" + } + }, + "functional-red-black-tree": { + "version": "1.0.1" + }, + "functions-have-names": { + "version": "1.2.3" + }, + "get-intrinsic": { + "version": "1.1.3", + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.3" + } + }, + "get-symbol-description": { + "version": "1.0.0", + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + } + }, + "glob": { + "version": "7.2.3", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "13.17.0", + "requires": { + "type-fest": "^0.20.2" + } + }, + "globby": { + "version": "11.1.0", + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "dependencies": { + "ignore": { + "version": "5.2.0" + } + } + }, + "has": { + "version": "1.0.3", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-bigints": { + "version": "1.0.2" + }, + "has-flag": { + "version": "4.0.0" + }, + "has-property-descriptors": { + "version": "1.0.0", + "requires": { + "get-intrinsic": "^1.1.1" + } + }, + "has-symbols": { + "version": "1.0.3" + }, + "has-tostringtag": { + "version": "1.0.0", + "requires": { + "has-symbols": "^1.0.2" + } + }, + "ignore": { + "version": "4.0.6" + }, + "import-fresh": { + "version": "3.3.0", + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4" + }, + "inflight": { + "version": "1.0.6", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4" + }, + "internal-slot": { + "version": "1.0.3", + "requires": { + "get-intrinsic": "^1.1.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + } + }, + "is-bigint": { + "version": "1.0.4", + "requires": { + "has-bigints": "^1.0.1" + } + }, + "is-boolean-object": { + "version": "1.1.2", + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-callable": { + "version": "1.2.6" + }, + "is-core-module": { + "version": "2.10.0", + "requires": { + "has": "^1.0.3" + } + }, + "is-date-object": { + "version": "1.0.5", + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-extglob": { + "version": "2.1.1" + }, + "is-fullwidth-code-point": { + "version": "3.0.0" + }, + "is-glob": { + "version": "4.0.3", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-negative-zero": { + "version": "2.0.2" + }, + "is-number": { + "version": "7.0.0" + }, + "is-number-object": { + "version": "1.0.7", + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-regex": { + "version": "1.1.4", + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-shared-array-buffer": { + "version": "1.0.2", + "requires": { + "call-bind": "^1.0.2" + } + }, + "is-string": { + "version": "1.0.7", + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-symbol": { + "version": "1.0.4", + "requires": { + "has-symbols": "^1.0.2" + } + }, + "is-weakref": { + "version": "1.0.2", + "requires": { + "call-bind": "^1.0.2" + } + }, + "isexe": { + "version": "2.0.0" + }, + "js-tokens": { + "version": "4.0.0" + }, + "js-yaml": { + "version": "3.14.1", + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "json-schema-traverse": { + "version": "0.4.1" + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1" + }, + "json5": { + "version": "1.0.1", + "requires": { + "minimist": "^1.2.0" + } + }, + "jsx-ast-utils": { + "version": "3.3.3", + "requires": { + "array-includes": "^3.1.5", + "object.assign": "^4.1.3" + } + }, + "language-subtag-registry": { + "version": "0.3.22" + }, + "language-tags": { + "version": "1.0.5", + "requires": { + "language-subtag-registry": "~0.3.2" + } + }, + "levn": { + "version": "0.4.1", + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "lodash.merge": { + "version": "4.6.2" + }, + "lodash.truncate": { + "version": "4.4.2" + }, + "loose-envify": { + "version": "1.4.0", + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "lru-cache": { + "version": "6.0.0", + "requires": { + "yallist": "^4.0.0" + } + }, + "merge2": { + "version": "1.4.1" + }, + "micromatch": { + "version": "4.0.5", + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, + "minimatch": { + "version": "3.1.2", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.6" + }, + "ms": { + "version": "2.1.2" + }, + "nanoid": { + "version": "3.3.4" + }, + "natural-compare": { + "version": "1.4.0" + }, + "object-assign": { + "version": "4.1.1" + }, + "object-inspect": { + "version": "1.12.2" + }, + "object-keys": { + "version": "1.1.1" + }, + "object.assign": { + "version": "4.1.4", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + } + }, + "object.entries": { + "version": "1.1.5", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + } + }, + "object.fromentries": { + "version": "2.0.5", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + } + }, + "object.hasown": { + "version": "1.1.1", + "requires": { + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" + } + }, + "object.values": { + "version": "1.1.5", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + } + }, + "once": { + "version": "1.4.0", + "requires": { + "wrappy": "1" + } + }, + "optionator": { + "version": "0.9.1", + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "parent-module": { + "version": "1.0.1", + "requires": { + "callsites": "^3.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1" + }, + "path-key": { + "version": "3.1.1" + }, + "path-parse": { + "version": "1.0.7" + }, + "path-type": { + "version": "4.0.0" + }, + "picocolors": { + "version": "1.0.0" + }, + "picomatch": { + "version": "2.3.1" + }, + "postcss": { + "version": "8.4.14", + "requires": { + "nanoid": "^3.3.4", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + } + }, + "prelude-ls": { + "version": "1.2.1" + }, + "prettier": { + "version": "2.7.1", + "dev": true + }, + "progress": { + "version": "2.0.3" + }, + "prop-types": { + "version": "15.8.1", + "requires": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "punycode": { + "version": "2.1.1" + }, + "queue-microtask": { + "version": "1.2.3" + }, + "react": { + "version": "17.0.2", + "requires": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + }, + "react-is": { + "version": "16.13.1" + }, + "regenerator-runtime": { + "version": "0.13.9" + }, + "regexp.prototype.flags": { + "version": "1.4.3", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "functions-have-names": "^1.2.2" + } + }, + "regexpp": { + "version": "3.2.0" + }, + "require-from-string": { + "version": "2.0.2" + }, + "resolve": { + "version": "1.22.1", + "requires": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "resolve-from": { + "version": "4.0.0" + }, + "reusify": { + "version": "1.0.4" + }, + "rimraf": { + "version": "3.0.2", + "requires": { + "glob": "^7.1.3" + } + }, + "run-parallel": { + "version": "1.2.0", + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "semver": { + "version": "7.3.7", + "requires": { + "lru-cache": "^6.0.0" + } + }, + "shebang-command": { + "version": "2.0.0", + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0" + }, + "side-channel": { + "version": "1.0.4", + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + } + }, + "slash": { + "version": "3.0.0" + }, + "slice-ansi": { + "version": "4.0.0", + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + } + }, + "source-map-js": { + "version": "1.0.2" + }, + "sprintf-js": { + "version": "1.0.3" + }, + "string-width": { + "version": "4.2.3", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "string.prototype.matchall": { + "version": "4.0.7", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1", + "get-intrinsic": "^1.1.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.3", + "regexp.prototype.flags": "^1.4.1", + "side-channel": "^1.0.4" + } + }, + "string.prototype.trimend": { + "version": "1.0.5", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" + } + }, + "string.prototype.trimstart": { + "version": "1.0.5", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" + } + }, + "strip-ansi": { + "version": "6.0.1", + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-bom": { + "version": "3.0.0" + }, + "strip-json-comments": { + "version": "3.1.1" + }, + "supports-color": { + "version": "7.2.0", + "requires": { + "has-flag": "^4.0.0" + } + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0" + }, + "table": { + "version": "6.8.0", + "requires": { + "ajv": "^8.0.1", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" + }, + "dependencies": { + "ajv": { + "version": "8.11.0", + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "json-schema-traverse": { + "version": "1.0.0" + } + } + }, + "text-table": { + "version": "0.2.0" + }, + "to-regex-range": { + "version": "5.0.1", + "requires": { + "is-number": "^7.0.0" + } + }, + "tsconfig": { + "version": "file:packages/tsconfig" + }, + "tsconfig-paths": { + "version": "3.14.1", + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "tslib": { + "version": "2.4.0" + }, + "tsutils": { + "version": "3.21.0", + "requires": { + "tslib": "^1.8.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1" + } + } + }, + "turbo": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/turbo/-/turbo-1.6.3.tgz", + "integrity": "sha512-FtfhJLmEEtHveGxW4Ye/QuY85AnZ2ZNVgkTBswoap7UMHB1+oI4diHPNyqrQLG4K1UFtCkjOlVoLsllUh/9QRw==", + "dev": true, + "requires": { + "turbo-darwin-64": "1.6.3", + "turbo-darwin-arm64": "1.6.3", + "turbo-linux-64": "1.6.3", + "turbo-linux-arm64": "1.6.3", + "turbo-windows-64": "1.6.3", + "turbo-windows-arm64": "1.6.3" + } + }, + "turbo-darwin-arm64": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/turbo-darwin-arm64/-/turbo-darwin-arm64-1.6.3.tgz", + "integrity": "sha512-75DXhFpwE7CinBbtxTxH08EcWrxYSPFow3NaeFwsG8aymkWXF+U2aukYHJA6I12n9/dGqf7yRXzkF0S/9UtdyQ==", + "dev": true, + "optional": true + }, + "type-check": { + "version": "0.4.0", + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-fest": { + "version": "0.20.2" + }, + "typescript": { + "version": "4.8.3" + }, + "ui": { + "version": "file:packages/ui", + "requires": { + "@types/react": "^17.0.37", + "@types/react-dom": "^17.0.11", + "eslint": "^7.32.0", + "eslint-config-custom": "*", + "react": "^17.0.2", + "tsconfig": "*", + "typescript": "^4.5.2" + } + }, + "unbox-primitive": { + "version": "1.0.2", + "requires": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + } + }, + "uri-js": { + "version": "4.4.1", + "requires": { + "punycode": "^2.1.0" + } + }, + "use-sync-external-store": { + "version": "1.2.0", + "requires": {} + }, + "v8-compile-cache": { + "version": "2.3.0" + }, + "web": { + "version": "file:apps/web", + "requires": { + "@types/node": "^17.0.12", + "@types/react": "^18.0.22", + "@types/react-dom": "^18.0.7", + "eslint-config-custom": "*", + "next": "latest", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "tsconfig": "*", + "typescript": "^4.5.3", + "ui": "*" + }, + "dependencies": { + "@next/env": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/@next/env/-/env-13.0.2.tgz", + "integrity": "sha512-Qb6WPuRriGIQ19qd6NBxpcrFOfj8ziN7l9eZUfwff5gl4zLXluqtuZPddYZM/oWjN53ZYcuRXzL+oowKyJeYtA==" + }, + "@next/swc-darwin-arm64": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.0.2.tgz", + "integrity": "sha512-1zGIOkInkOLRv0QQGZ+3wffYsyKI4vIy62LYTvDWUn7TAYqnmXwougp9NSLqDeagLwgsv2URrykyAFixA/YqxA==", + "optional": true + }, + "@types/react": { + "version": "18.0.25", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.25.tgz", + "integrity": "sha512-xD6c0KDT4m7n9uD4ZHi02lzskaiqcBxf4zi+tXZY98a04wvc0hi/TcCPC2FOESZi51Nd7tlUeOJY8RofL799/g==", + "dev": true, + "requires": { + "@types/prop-types": "*", + "@types/scheduler": "*", + "csstype": "^3.0.2" + } + }, + "@types/react-dom": { + "version": "18.0.8", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.8.tgz", + "integrity": "sha512-C3GYO0HLaOkk9dDAz3Dl4sbe4AKUGTCfFIZsz3n/82dPNN8Du533HzKatDxeUYWu24wJgMP1xICqkWk1YOLOIw==", + "dev": true, + "requires": { + "@types/react": "*" + } + }, + "next": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/next/-/next-13.0.2.tgz", + "integrity": "sha512-uQ5z5e4D9mOe8+upy6bQdYYjo/kk1v3jMW87kTy2TgAyAsEO+CkwRnMgyZ4JoHEnhPZLHwh7dk0XymRNLe1gFw==", + "requires": { + "@next/env": "13.0.2", + "@next/swc-android-arm-eabi": "13.0.2", + "@next/swc-android-arm64": "13.0.2", + "@next/swc-darwin-arm64": "13.0.2", + "@next/swc-darwin-x64": "13.0.2", + "@next/swc-freebsd-x64": "13.0.2", + "@next/swc-linux-arm-gnueabihf": "13.0.2", + "@next/swc-linux-arm64-gnu": "13.0.2", + "@next/swc-linux-arm64-musl": "13.0.2", + "@next/swc-linux-x64-gnu": "13.0.2", + "@next/swc-linux-x64-musl": "13.0.2", + "@next/swc-win32-arm64-msvc": "13.0.2", + "@next/swc-win32-ia32-msvc": "13.0.2", + "@next/swc-win32-x64-msvc": "13.0.2", + "@swc/helpers": "0.4.11", + "caniuse-lite": "^1.0.30001406", + "postcss": "8.4.14", + "styled-jsx": "5.1.0", + "use-sync-external-store": "1.2.0" + } + }, + "react": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", + "requires": { + "loose-envify": "^1.1.0" + } + }, + "react-dom": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "requires": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.0" + } + }, + "scheduler": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", + "requires": { + "loose-envify": "^1.1.0" + } + }, + "styled-jsx": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.0.tgz", + "integrity": "sha512-/iHaRJt9U7T+5tp6TRelLnqBqiaIT0HsO0+vgyj8hK2KUk7aejFqRrumqPUlAqDwAj8IbS/1hk3IhBAAK/FCUQ==", + "requires": { + "client-only": "0.0.1" + } + } + } + }, + "which": { + "version": "2.0.2", + "requires": { + "isexe": "^2.0.0" + } + }, + "which-boxed-primitive": { + "version": "1.0.2", + "requires": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + } + }, + "word-wrap": { + "version": "1.2.3" + }, + "wrappy": { + "version": "1.0.2" + }, + "yallist": { + "version": "4.0.0" + } + } +} diff --git a/package.json b/package.json index a8889736750e9..58794e1f7c4b3 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "format:toml": "taplo format", "lint": "eslint . --ext js,jsx,ts,tsx", "turbo": "cd cli && make turbo && cd .. && node turbow.js", + "turbo-prebuilt": "node turbow.js", "docs": "pnpm -- turbo run dev --filter=docs --no-cache", "run-example": "./scripts/run-example.sh" }, diff --git a/scripts/run-example.sh b/scripts/run-example.sh index 92d781920f4cf..6dc7b7eb95858 100755 --- a/scripts/run-example.sh +++ b/scripts/run-example.sh @@ -5,7 +5,7 @@ set -e echo "=> Running examples..." # echo "=> Building turbo from source..." # cd cli && CGO_ENABLED=0 go build ./cmd/turbo/... && cd ..; -export TURBO_BINARY_PATH=$(pwd)/cli/turbo +export TURBO_BINARY_PATH=$(pwd)/target/debug/turbo export TURBO_VERSION=$(head -n 1 $(pwd)/version.txt) export TURBO_TAG=$(cat $(pwd)/version.txt | sed -n '2 p') export folder=$1 diff --git a/shim/.gitignore b/shim/.gitignore index ea8c4bf7f35f6..11c52ecb1ec34 100644 --- a/shim/.gitignore +++ b/shim/.gitignore @@ -1 +1,2 @@ /target +/src/ffi.rs diff --git a/shim/Cargo.toml b/shim/Cargo.toml index 4b55f0281b2bd..efb40c8f3ccf4 100644 --- a/shim/Cargo.toml +++ b/shim/Cargo.toml @@ -12,12 +12,13 @@ bindgen = "0.61.0" [dev-dependencies] assert_cmd = "2.0.6" itertools = "0.10.5" +pretty_assertions = "1.3.0" [dependencies] +turborepo-lib = { path = "../crates/turborepo-lib" } anyhow = { version = "1.0.65", features = ["backtrace"] } -# Because we use ignore_errors in clap, we have to stick to v3 instead of v4 -# due to issues such as: https://github.com/clap-rs/clap/issues/4391 -clap = { version = "3.2.23", features = ["derive"] } +clap = { version = "4.0.22", features = ["derive"] } +clap_complete = "4.0.6" predicates = "2.1.1" serde = { version = "1.0.145", features = ["derive"] } serde_json = "1.0.86" diff --git a/shim/build.rs b/shim/build.rs index 34b70aff3134c..5415d4503ad25 100644 --- a/shim/build.rs +++ b/shim/build.rs @@ -11,12 +11,12 @@ fn main() { println!("cargo:rustc-link-search={}", lib_search_path); println!("cargo:rustc-link-lib=turbo"); + let target = build_target::target().unwrap(); let bindings = bindgen::Builder::default() - .header("../cli/libturbo.h") + .header(header_path(&target.os)) // Tell cargo to invalidate the built crate whenever any of the // included header files changed. .parse_callbacks(Box::new(bindgen::CargoCallbacks)) - .allowlist_function("nativeRunWithArgs") .allowlist_function("nativeRunWithTurboState") .allowlist_type("GoString") .generate() @@ -25,7 +25,6 @@ fn main() { bindings .write_to_file("src/ffi.rs") .expect("Couldn't write bindings!"); - let target = build_target::target().unwrap(); if target.os == build_target::Os::MacOs { println!("cargo:rustc-link-lib=framework=cocoa"); println!("cargo:rustc-link-lib=framework=security"); @@ -73,12 +72,12 @@ fn build_debug_libturbo() -> String { .join("deps"); // workaround to make increment build works for ext in ["pdb", "exe", "d", "lib"].iter() { - std::fs::remove_file(output_deps.join(&format!("turbo.{ext}"))).unwrap_or(()); + std::fs::remove_file(output_deps.join(format!("turbo.{ext}"))).unwrap_or(()); } cmd.env("CGO_ENABLED", "1") - .env("CC", "clang") - .env("CXX", "clang++") + .env("CC", "gcc") + .env("CXX", "g++") .arg("turbo.lib"); } else { cmd.arg("libturbo.a"); @@ -92,3 +91,10 @@ fn build_debug_libturbo() -> String { ); cli_path.to_string_lossy().to_string() } + +fn header_path(target: &build_target::Os) -> &'static str { + match target { + build_target::Os::Windows => "../cli/turbo.h", + _ => "../cli/libturbo.h", + } +} diff --git a/shim/src/commands/mod.rs b/shim/src/commands/mod.rs deleted file mode 100644 index 338e2b29bad12..0000000000000 --- a/shim/src/commands/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub(crate) mod bin; diff --git a/shim/src/ffi.rs b/shim/src/ffi.rs deleted file mode 100644 index 37bdec1aef2c0..0000000000000 --- a/shim/src/ffi.rs +++ /dev/null @@ -1,53 +0,0 @@ -/* automatically generated by rust-bindgen 0.61.0 */ - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _GoString_ { - pub p: *const ::std::os::raw::c_char, - pub n: isize, -} -#[test] -fn bindgen_test_layout__GoString_() { - const UNINIT: ::std::mem::MaybeUninit<_GoString_> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_GoString_>(), - 16usize, - concat!("Size of: ", stringify!(_GoString_)) - ); - assert_eq!( - ::std::mem::align_of::<_GoString_>(), - 8usize, - concat!("Alignment of ", stringify!(_GoString_)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).p) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_GoString_), - "::", - stringify!(p) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).n) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_GoString_), - "::", - stringify!(n) - ) - ); -} -pub type GoString = _GoString_; -extern "C" { - pub fn nativeRunWithArgs( - argc: ::std::os::raw::c_int, - argv: *mut *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn nativeRunWithTurboState(turboStateString: GoString) -> ::std::os::raw::c_uint; -} diff --git a/shim/src/main.rs b/shim/src/main.rs index 2cf1509d648fd..ad07c36f27168 100644 --- a/shim/src/main.rs +++ b/shim/src/main.rs @@ -1,188 +1,11 @@ -mod commands; mod ffi; -mod package_manager; -use std::{ - env, - env::current_exe, - ffi::CString, - fs, - os::raw::{c_char, c_int}, - path::{Path, PathBuf}, - process, - process::Stdio, -}; +use std::{ffi::CString, process}; -use anyhow::{anyhow, Result}; -use clap::{CommandFactory, Parser, Subcommand}; -use serde::Serialize; -use tiny_gradient::{GradientStr, RGB}; -use turbo_updater::check_for_updates; +use anyhow::Result; +use turborepo_lib::{Payload, TurboState}; -use crate::{ - ffi::{nativeRunWithArgs, nativeRunWithTurboState, GoString}, - package_manager::PackageManager, -}; - -static TURBO_JSON: &str = "turbo.json"; - -#[derive(Parser, Clone, Default, Debug, PartialEq, Serialize)] -#[clap(author, about = "The build system that makes ship happen", long_about = None)] -#[clap( - ignore_errors = true, - disable_help_flag = true, - disable_help_subcommand = true, - disable_colored_help = true -)] -#[clap(disable_version_flag = true)] -struct Args { - #[clap(long, short)] - help: bool, - #[clap(long, global = true)] - version: bool, - /// Override the endpoint for API calls - #[clap(long, global = true, value_parser)] - api: Option, - /// Force color usage in the terminal - #[clap(long, global = true)] - color: bool, - /// Specify a file to save a cpu profile - #[clap(long, global = true, value_parser)] - cpu_profile: Option, - /// The directory in which to run turbo - #[clap(long, global = true, value_parser)] - cwd: Option, - /// Specify a file to save a pprof heap profile - #[clap(long, global = true, value_parser)] - heap: Option, - /// Override the login endpoint - #[clap(long, global = true, value_parser)] - login: Option, - /// Suppress color usage in the terminal - #[clap(long, global = true)] - no_color: bool, - /// When enabled, turbo will precede HTTP requests with an OPTIONS request - /// for authorization - #[clap(long, global = true)] - preflight: bool, - /// Set the team slug for API calls - #[clap(long, global = true, value_parser)] - team: Option, - /// Set the auth token for API calls - #[clap(long, global = true, value_parser)] - token: Option, - /// Specify a file to save a pprof trace - #[clap(long, global = true, value_parser)] - trace: Option, - /// verbosity - #[clap(short, long, global = true, value_parser)] - verbosity: Option, - #[clap(long = "__test-run", global = true, hide = true)] - test_run: bool, - #[clap(subcommand)] - command: Option, - tasks: Vec, -} - -/// Defines the subcommands for CLI. NOTE: If we change the commands in Go, -/// we must change these as well to avoid accidentally passing the -/// --single-package flag into non-build commands. -#[derive(Subcommand, Clone, Debug, Serialize, PartialEq)] -enum Command { - /// Get the path to the Turbo binary - Bin { - /// Help flag - #[clap(long, short)] - help: bool, - }, - /// Generate the autocompletion script for the specified shell - Completion { - /// Help flag - #[clap(long, short)] - help: bool, - }, - /// Runs the Turborepo background daemon - Daemon { - /// Help flag - #[clap(long, short)] - help: bool, - }, - /// Help about any command - Help { - /// Help flag - #[clap(long, short)] - help: bool, - }, - /// Link your local directory to a Vercel organization and enable remote - /// caching. - Link { - /// help for link - #[clap(long, short)] - help: bool, - /// Do not create or modify .gitignore (default false) - #[clap(long)] - no_gitignore: bool, - }, - /// Login to your Vercel account - Login { - /// Help flag - #[clap(long, short)] - help: bool, - #[clap(long = "sso-team")] - sso_team: Option, - }, - /// Logout to your Vercel account - Logout { - /// Help flag - #[clap(long, short)] - help: bool, - }, - /// Prepare a subset of your monorepo. - Prune { - /// Help flag - #[clap(long, short)] - help: bool, - #[clap(long)] - scope: Option, - #[clap(long)] - docker: bool, - #[clap(long = "out-dir", default_value = "out")] - output_dir: String, - }, - /// Run tasks across projects in your monorepo - Run { - /// Help flag - #[clap(long, short)] - help: bool, - tasks: Vec, - }, - /// Unlink the current directory from your Vercel organization and disable - /// Remote Caching - Unlink { - /// Help flag - #[clap(long, short)] - help: bool, - }, -} - -#[derive(Debug, Clone, Serialize)] -struct RepoState { - root: PathBuf, - mode: RepoMode, -} - -#[derive(Debug, Clone, Serialize)] -enum RepoMode { - SinglePackage, - MultiPackage, -} - -/// The entire state of the execution, including args, repo state, etc. -#[derive(Debug, Serialize)] -struct TurboState { - parsed_args: Args, - raw_args: Vec, -} +use crate::ffi::{nativeRunWithTurboState, GoString}; impl TryInto for TurboState { type Error = anyhow::Error; @@ -199,633 +22,19 @@ impl TryInto for TurboState { } } -/// If a command has a help flag passed, print help and return true. -/// Otherwise, return false. -/// -/// # Arguments -/// -/// * `command`: The parsed command. -/// -/// returns: Result -fn try_run_help(command: &Command) -> Result { - let (help, command_name) = match command { - Command::Bin { help, .. } => (help, "bin"), - Command::Completion { help, .. } => (help, "completion"), - Command::Daemon { help, .. } => (help, "daemon"), - Command::Help { help, .. } => (help, "help"), - Command::Link { help, .. } => (help, "link"), - Command::Login { help, .. } => (help, "login"), - Command::Logout { help, .. } => (help, "logout"), - Command::Prune { help, .. } => (help, "prune"), - Command::Run { help, .. } => (help, "run"), - Command::Unlink { help, .. } => (help, "unlink"), - }; - - if *help { - Args::command() - .find_subcommand_mut(command_name) - .unwrap_or_else(|| panic!("Could not find subcommand: {command_name}")) - .print_long_help()?; - Ok(true) - } else { - Ok(false) - } -} - -impl TurboState { - /// Runs the Go code linked in current binary. - /// - /// # Arguments - /// - /// * `args`: Arguments for turbo - /// - /// returns: Result - fn run_current_turbo(self) -> Result { - match self.parsed_args.command { - Some(Command::Bin { .. }) => { - commands::bin::run()?; - Ok(0) - } - Some(Command::Link { .. }) - | Some(Command::Login { .. }) - | Some(Command::Logout { .. }) - | Some(Command::Unlink { .. }) => { - let serialized_state = self.try_into()?; - let exit_code = unsafe { nativeRunWithTurboState(serialized_state) }; - Ok(exit_code.try_into()?) - } - _ => { - let mut args = self - .raw_args - .iter() - .map(|s| { - let c_string = CString::new(s.as_str())?; - Ok(c_string.into_raw()) - }) - .collect::>>()?; - // With vectors there is a possibility of over-allocating, whether - // from the allocator itself or the Vec implementation. - // Therefore we shrink the vector to just the length we need. - args.shrink_to_fit(); - let argc: c_int = args.len() as c_int; - let argv = args.as_mut_ptr(); - let exit_code = unsafe { nativeRunWithArgs(argc, argv) }; - Ok(exit_code.try_into()?) - } - } - } - - /// Attempts to run correct turbo by finding nearest package.json, - /// then finding local turbo installation. If the current binary is the - /// local turbo installation, then we run current turbo. Otherwise we - /// kick over to the local turbo installation. - /// - /// # Arguments - /// - /// * `turbo_state`: state for current execution - /// - /// returns: Result - fn run_correct_turbo(mut self, current_dir: PathBuf) -> Result { - // Run help for subcommand if `--help` or `-h` is passed. - if let Some(command) = &self.parsed_args.command { - if try_run_help(command)? { - return Ok(0); - } - } - - // We run this *before* the local turbo code because login/logout/link/unlink - // should work regardless of whether or not we're in a monorepo. - if matches!( - self.parsed_args.command, - Some(Command::Login { .. }) - | Some(Command::Link { .. }) - | Some(Command::Logout { .. }) - | Some(Command::Unlink { .. }) - ) { - let exit_code = unsafe { nativeRunWithTurboState(self.try_into()?) }; - return Ok(exit_code.try_into()?); - } - - let repo_state = RepoState::infer(¤t_dir)?; - let local_turbo_path = repo_state.root.join("node_modules").join(".bin").join({ - #[cfg(windows)] - { - "turbo.cmd" - } - #[cfg(not(windows))] - { - "turbo" - } - }); - - if matches!(repo_state.mode, RepoMode::SinglePackage) && self.parsed_args.is_run_command() { - self.raw_args.push("--single-package".to_string()); - } - - let current_turbo_is_local_turbo = local_turbo_path == current_exe()?; - // If the local turbo path doesn't exist or if we are local turbo, then we go - // ahead and run the Go code linked in the current binary. - if current_turbo_is_local_turbo || !local_turbo_path.try_exists()? { - return self.run_current_turbo(); - } - - // Otherwise, we spawn a process that executes the local turbo - // that we've found in node_modules/.bin/turbo. - let mut command = process::Command::new(local_turbo_path) - .args(&self.raw_args) - .stdout(Stdio::inherit()) - .stderr(Stdio::inherit()) - .spawn() - .expect("Failed to execute turbo."); - - Ok(command.wait()?.code().unwrap_or(2)) - } -} - -impl RepoState { - /// Infers `RepoState` from current directory. - /// - /// # Arguments - /// - /// * `current_dir`: Current working directory - /// - /// returns: Result - pub fn infer(current_dir: &Path) -> Result { - // First we look for a `turbo.json`. This iterator returns the first ancestor - // that contains a `turbo.json` file. - let root_path = current_dir - .ancestors() - .find(|p| fs::metadata(p.join(TURBO_JSON)).is_ok()); - - // If that directory exists, then we figure out if there are workspaces defined - // in it NOTE: This may change with multiple `turbo.json` files - if let Some(root_path) = root_path { - let pnpm = PackageManager::Pnpm; - let npm = PackageManager::Npm; - let is_workspace = pnpm.get_workspace_globs(root_path).is_ok() - || npm.get_workspace_globs(root_path).is_ok(); - - let mode = if is_workspace { - RepoMode::MultiPackage - } else { - RepoMode::SinglePackage - }; - - return Ok(Self { - root: root_path.to_path_buf(), - mode, - }); - } - - // What we look for next is a directory that contains a `package.json`. - let potential_roots = current_dir - .ancestors() - .filter(|path| fs::metadata(path.join("package.json")).is_ok()); - - let mut first_package_json_dir = None; - // We loop through these directories and see if there are workspaces defined in - // them, either in the `package.json` or `pnm-workspaces.yml` - for dir in potential_roots { - if first_package_json_dir.is_none() { - first_package_json_dir = Some(dir) - } - - let pnpm = PackageManager::Pnpm; - let npm = PackageManager::Npm; - let is_workspace = - pnpm.get_workspace_globs(dir).is_ok() || npm.get_workspace_globs(dir).is_ok(); - - if is_workspace { - return Ok(Self { - root: dir.to_path_buf(), - mode: RepoMode::MultiPackage, - }); - } - } - - // Finally, if we don't detect any workspaces, go to the first `package.json` - // and use that in single package mode. - let root = first_package_json_dir - .ok_or_else(|| { - anyhow!( - "Unable to find `{}` or `package.json` in current path", - TURBO_JSON - ) - })? - .to_path_buf(); - - Ok(Self { - root, - mode: RepoMode::SinglePackage, - }) - } -} - -impl Args { - /// Checks if either we have an explicit run command, i.e. `turbo run build` - /// or an implicit run, i.e. `turbo build`, where the command after `turbo` - /// is not one of the reserved commands like `link`, `login`, `bin`, - /// etc. - /// - /// # Arguments - /// - /// * `clap_args`: - /// - /// returns: bool - fn is_run_command(&self) -> bool { - let is_explicit_run = matches!(self.command, Some(Command::Run { .. })); - let is_implicit_run = self.command.is_none() && !self.tasks.is_empty(); - - is_explicit_run || is_implicit_run - } -} - -fn get_version() -> &'static str { - include_str!("../../version.txt") - .split_once('\n') - .expect("Failed to read version from version.txt") - .0 +fn native_run(state: TurboState) -> Result { + let serialized_state = state.try_into()?; + let exit_code = unsafe { nativeRunWithTurboState(serialized_state) }; + Ok(exit_code.try_into()?) } +// This function should not expanded. Please add any logic to +// `turborepo_lib::main` instead fn main() -> Result<()> { - // custom footer for update message - let footer = format!( - "Follow {username} for updates: {url}", - username = "@turborepo".gradient([RGB::new(0, 153, 247), RGB::new(241, 23, 18)]), - url = "https://twitter.com/turborepo" - ); - - // check for updates - let _ = check_for_updates( - "turbo", - "https://github.com/vercel/turbo", - Some(&footer), - get_version(), - // use defaults for timeout and refresh interval (800ms and 1 day respectively) - None, - None, - ); - - let clap_args = Args::parse(); - // --help doesn't work with ignore_errors in clap. - if clap_args.help { - let mut command = Args::command(); - command.print_help()?; - process::exit(0); - } - // --version flag doesn't work with ignore_errors in clap, so we have to handle - // it manually - if clap_args.version { - println!("{}", get_version()); - process::exit(0); - } - - let current_dir = if let Some(cwd) = &clap_args.cwd { - fs::canonicalize::(cwd.into())? - } else { - env::current_dir()? - }; - - let args: Vec<_> = env::args().skip(1).collect(); - if args.is_empty() { - process::exit(1); - } - - let turbo_state = TurboState { - parsed_args: clap_args, - raw_args: env::args().skip(1).collect(), - }; - - let exit_code = match turbo_state.run_correct_turbo(current_dir) { - Ok(exit_code) => exit_code, - Err(e) => { - eprintln!("failed {:?}", e); - 2 - } + let exit_code = match turborepo_lib::main()? { + Payload::Rust(res) => res.unwrap_or(2), + Payload::Go(state) => native_run(*state)?, }; process::exit(exit_code) } - -#[cfg(test)] -mod test { - use clap::Parser; - use itertools::Itertools; - - struct CommandTestCase { - command: &'static str, - command_args: Vec>, - global_args: Vec>, - expected_output: Args, - } - - impl CommandTestCase { - fn test(&self) { - let permutations = self.create_all_arg_permutations(); - for command in permutations { - assert_eq!(Args::try_parse_from(command).unwrap(), self.expected_output) - } - } - - fn create_all_arg_permutations(&self) -> Vec> { - let mut permutations = Vec::new(); - let mut global_args = vec![vec![self.command]]; - global_args.extend(self.global_args.clone()); - let global_args_len = global_args.len(); - let command_args_len = self.command_args.len(); - - // Iterate through all the different permutations of args - for global_args_permutation in global_args.into_iter().permutations(global_args_len) { - let command_args = self.command_args.clone(); - for command_args_permutation in - command_args.into_iter().permutations(command_args_len) - { - let mut command = vec![vec!["turbo"]]; - command.extend(global_args_permutation.clone()); - command.extend(command_args_permutation); - permutations.push(command.into_iter().flatten().collect()) - } - } - - permutations - } - } - - use crate::{Args, Command}; - - #[test] - fn test_parse_run() { - assert_eq!( - Args::try_parse_from(["turbo", "run", "build"]).unwrap(), - Args { - command: Some(Command::Run { - help: false, - tasks: vec!["build".to_string()] - }), - ..Args::default() - } - ); - - assert_eq!( - Args::try_parse_from(["turbo", "run", "build", "lint", "test"]).unwrap(), - Args { - command: Some(Command::Run { - help: false, - tasks: vec!["build".to_string(), "lint".to_string(), "test".to_string()] - }), - ..Args::default() - } - ); - - assert_eq!( - Args::try_parse_from(["turbo", "build"]).unwrap(), - Args { - tasks: vec!["build".to_string()], - ..Args::default() - } - ); - - assert_eq!( - Args::try_parse_from(["turbo", "build", "lint", "test"]).unwrap(), - Args { - tasks: vec!["build".to_string(), "lint".to_string(), "test".to_string()], - ..Args::default() - } - ); - } - - #[test] - fn test_parse_bin() { - assert_eq!( - Args::try_parse_from(["turbo", "bin"]).unwrap(), - Args { - command: Some(Command::Bin { help: false }), - ..Args::default() - } - ); - - CommandTestCase { - command: "bin", - command_args: vec![], - global_args: vec![vec!["--cwd", "../examples/with-yarn"]], - expected_output: Args { - command: Some(Command::Bin { help: false }), - cwd: Some("../examples/with-yarn".to_string()), - ..Args::default() - }, - } - .test(); - } - - #[test] - fn test_parse_login() { - assert_eq!( - Args::try_parse_from(["turbo", "login"]).unwrap(), - Args { - command: Some(Command::Login { - help: false, - sso_team: None - }), - ..Args::default() - } - ); - - CommandTestCase { - command: "login", - command_args: vec![], - global_args: vec![vec!["--cwd", "../examples/with-yarn"]], - expected_output: Args { - command: Some(Command::Login { - help: false, - sso_team: None, - }), - cwd: Some("../examples/with-yarn".to_string()), - ..Args::default() - }, - } - .test(); - - CommandTestCase { - command: "login", - command_args: vec![vec!["--sso-team", "my-team"]], - global_args: vec![vec!["--cwd", "../examples/with-yarn"]], - expected_output: Args { - command: Some(Command::Login { - help: false, - sso_team: Some("my-team".to_string()), - }), - cwd: Some("../examples/with-yarn".to_string()), - ..Args::default() - }, - } - .test(); - } - - #[test] - fn test_parse_logout() { - assert_eq!( - Args::try_parse_from(["turbo", "logout"]).unwrap(), - Args { - command: Some(Command::Logout { help: false }), - ..Args::default() - } - ); - - CommandTestCase { - command: "logout", - command_args: vec![], - global_args: vec![vec!["--cwd", "../examples/with-yarn"]], - expected_output: Args { - command: Some(Command::Logout { help: false }), - cwd: Some("../examples/with-yarn".to_string()), - ..Args::default() - }, - } - .test(); - } - - #[test] - fn test_parse_unlink() { - assert_eq!( - Args::try_parse_from(["turbo", "unlink"]).unwrap(), - Args { - command: Some(Command::Unlink { help: false }), - ..Args::default() - } - ); - - CommandTestCase { - command: "unlink", - command_args: vec![], - global_args: vec![vec!["--cwd", "../examples/with-yarn"]], - expected_output: Args { - command: Some(Command::Unlink { help: false }), - cwd: Some("../examples/with-yarn".to_string()), - ..Args::default() - }, - } - .test(); - } - - #[test] - fn test_parse_prune() { - let default_prune = Command::Prune { - help: false, - scope: None, - docker: false, - output_dir: "out".to_string(), - }; - - assert_eq!( - Args::try_parse_from(["turbo", "prune"]).unwrap(), - Args { - command: Some(default_prune.clone()), - ..Args::default() - } - ); - - CommandTestCase { - command: "prune", - command_args: vec![], - global_args: vec![vec!["--cwd", "../examples/with-yarn"]], - expected_output: Args { - command: Some(default_prune), - cwd: Some("../examples/with-yarn".to_string()), - ..Args::default() - }, - } - .test(); - - assert_eq!( - Args::try_parse_from(["turbo", "prune", "--scope", "bar"]).unwrap(), - Args { - command: Some(Command::Prune { - help: false, - scope: Some("bar".to_string()), - docker: false, - output_dir: "out".to_string(), - }), - ..Args::default() - } - ); - - assert_eq!( - Args::try_parse_from(["turbo", "prune", "--docker"]).unwrap(), - Args { - command: Some(Command::Prune { - help: false, - scope: None, - docker: true, - output_dir: "out".to_string(), - }), - ..Args::default() - } - ); - - assert_eq!( - Args::try_parse_from(["turbo", "prune", "--out-dir", "dist"]).unwrap(), - Args { - command: Some(Command::Prune { - help: false, - scope: None, - docker: false, - output_dir: "dist".to_string(), - }), - ..Args::default() - } - ); - - CommandTestCase { - command: "prune", - command_args: vec![vec!["--out-dir", "dist"], vec!["--docker"]], - global_args: vec![], - expected_output: Args { - command: Some(Command::Prune { - help: false, - scope: None, - docker: true, - output_dir: "dist".to_string(), - }), - ..Args::default() - }, - } - .test(); - - CommandTestCase { - command: "prune", - command_args: vec![vec!["--out-dir", "dist"], vec!["--docker"]], - global_args: vec![vec!["--cwd", "../examples/with-yarn"]], - expected_output: Args { - command: Some(Command::Prune { - help: false, - scope: None, - docker: true, - output_dir: "dist".to_string(), - }), - cwd: Some("../examples/with-yarn".to_string()), - ..Args::default() - }, - } - .test(); - - CommandTestCase { - command: "prune", - command_args: vec![ - vec!["--out-dir", "dist"], - vec!["--docker"], - vec!["--scope", "foo"], - ], - global_args: vec![], - expected_output: Args { - command: Some(Command::Prune { - help: false, - scope: Some("foo".to_string()), - docker: true, - output_dir: "dist".to_string(), - }), - ..Args::default() - }, - } - .test(); - } -} diff --git a/shim/tests/mod.rs b/shim/tests/mod.rs deleted file mode 100644 index 67399cec7aebc..0000000000000 --- a/shim/tests/mod.rs +++ /dev/null @@ -1,96 +0,0 @@ -use assert_cmd::Command; - -fn get_version() -> &'static str { - include_str!("../../version.txt") - .split_once('\n') - .expect("Failed to read version from version.txt") - .0 -} - -#[test] -fn test_version() { - let mut cmd = Command::cargo_bin("turbo").unwrap(); - cmd.arg("--version"); - cmd.assert() - .success() - .stdout(format!("{}\n", get_version())); -} - -#[test] -fn test_no_arguments() { - let mut cmd = Command::cargo_bin("turbo").unwrap(); - cmd.assert() - .append_context("turbo", "no arguments") - .append_context( - "expect", - "`turbo` with no arguments should exit with code 1", - ) - .code(1); -} - -#[test] -fn test_find_turbo_in_example() { - let mut cmd = Command::cargo_bin("turbo").unwrap(); - cmd.args(["--cwd", "../examples/with-yarn", "bin"]) - .assert() - .append_context( - "turbo", - "bin command with cwd flag set to package with local turbo installed", - ) - .append_context( - "expect", - "`turbo --cwd ../../examples/with-yarn bin` should print out local turbo binary \ - installed in examples/with-yarn", - ) - .success() - .stdout(predicates::str::ends_with({ - #[cfg(target_os = "linux")] - { - "examples/with-yarn/node_modules/turbo/bin/turbo\n" - } - #[cfg(target_os = "macos")] - { - "examples/with-yarn/node_modules/.bin/turbo\n" - } - #[cfg(target_os = "windows")] - { - #[cfg(target_arch = "x86_64")] - { - "examples\\with-yarn\\node_modules\\turbo-windows-64\\bin\\turbo.exe\n" - } - #[cfg(target_arch = "aarch64")] - { - "examples\\with-yarn\\node_modules\\turbo-windows-arm64\\bin\\turbo.exe\n" - } - } - })); -} - -#[test] -fn test_find_correct_turbo() { - let mut cmd = Command::cargo_bin("turbo").unwrap(); - let assertion = cmd - .args(["--cwd", "..", "bin"]) - .assert() - .append_context( - "turbo", - "bin command with cwd flag set to package without local turbo installed", - ) - .append_context( - "expect", - "`turbo --cwd .. bin` should print out current turbo binary", - ) - .success(); - - if cfg!(debug_assertions) { - if cfg!(windows) { - assertion.stdout(predicates::str::ends_with("target\\debug\\turbo.exe\n")); - } else { - assertion.stdout(predicates::str::ends_with("target/debug/turbo\n")); - } - } else if cfg!(windows) { - assertion.stdout(predicates::str::ends_with("target\\release\\turbo.exe\n")); - } else { - assertion.stdout(predicates::str::ends_with("target/release/turbo\n")); - } -} diff --git a/turbo.json b/turbo.json index b42c89c0bf174..684dff8aa61ba 100644 --- a/turbo.json +++ b/turbo.json @@ -66,7 +66,18 @@ "cli/**/*.go", "cli/go.mod", "cli/go.sum", - "cli/scripts/e2e/e2e.ts" + "cli/scripts/e2e/e2e.ts", + "shim/**/*.rs" + ] + }, + "cli#e2e-prebuilt": { + "outputs": [], + "inputs": [ + "cli/**/*.go", + "cli/go.mod", + "cli/go.sum", + "cli/scripts/e2e/e2e.ts", + "shim/**/*.rs" ] }, "cli#integration-tests": { diff --git a/turbow.js b/turbow.js index cbd03efefd60f..e133ae3ddde58 100755 --- a/turbow.js +++ b/turbow.js @@ -4,9 +4,9 @@ const path = require("path"); let binPath; if (path.sep === "\\") { - binPath = ".\\cli\\turbo.exe"; + binPath = ".\\target\\debug\\turbo.exe"; } else { - binPath = "./cli/turbo"; + binPath = "./target/debug/turbo"; } try {