vercel / turborepo

Build system optimized for JavaScript and TypeScript, written in Rust
https://turbo.build/repo
MIT License
26.49k stars 1.85k forks source link

fix(cli): error on out of place run args #9445

Open chris-olszewski opened 2 weeks ago

chris-olszewski commented 2 weeks ago

Description

Currently we have a bug where run args can be specified incorrectly and we'll silently ignore them.

This PR makes these explicit failures instead of silently ignoring them. There is a solution where we attempt to "merge" args provided on either side of the subcommand, but that would require us to switch to clap's builder interface which would make our 80 line top level CLI interface ~1k lines. I do not think this is worth the time to go about that refactor to allow for awkward syntax.

⚠️ This will very possibly break user workflows, but I think this is better than our current ignoring of user provided flags. We could warn here, but I'm afraid that those warnings would go unseen.

I suggest reviewing each commit individually as there was some required refactoring to unit test this behavior.

Testing Instructions

Added unit tests

vercel[bot] commented 2 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 15, 2024 3:29pm
8 Skipped Deployments | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **examples-basic-web** | ⬜️ Ignored ([Inspect](https://vercel.com/vercel/examples-basic-web/7Qt5Vj4C8pAtY5oRgFJEwoSMZsay)) | | | Nov 15, 2024 3:29pm | | **examples-designsystem-docs** | ⬜️ Ignored ([Inspect](https://vercel.com/vercel/examples-designsystem-docs/9raVpwyzp18aHk3EmXmZ37mdH9Wd)) | | | Nov 15, 2024 3:29pm | | **examples-gatsby-web** | ⬜️ Ignored ([Inspect](https://vercel.com/vercel/examples-gatsby-web/fnF6vANSUAxxi5yu8MZxL6iPcc2Z)) | | | Nov 15, 2024 3:29pm | | **examples-kitchensink-blog** | ⬜️ Ignored ([Inspect](https://vercel.com/vercel/examples-kitchensink-blog/8vx7pXjd2PiWX4udr4tQ9wDgybAZ)) | | | Nov 15, 2024 3:29pm | | **examples-native-web** | ⬜️ Ignored ([Inspect](https://vercel.com/vercel/examples-native-web/HFayTekWexSQaADZ1uv2rVVNtbjR)) | | | Nov 15, 2024 3:29pm | | **examples-svelte-web** | ⬜️ Ignored ([Inspect](https://vercel.com/vercel/examples-svelte-web/Byww8NHJEL6gbtxzT69HjHARF59B)) | | | Nov 15, 2024 3:29pm | | **examples-tailwind-web** | ⬜️ Ignored ([Inspect](https://vercel.com/vercel/examples-tailwind-web/HGQi6FpceTZrNbn7bH1C42p16HrW)) | | | Nov 15, 2024 3:29pm | | **examples-vite-web** | ⬜️ Ignored ([Inspect](https://vercel.com/vercel/examples-vite-web/AexMLXzRXAysir6MGRm4QpN67a3x)) | | | Nov 15, 2024 3:29pm |