turbo
turbo copied to clipboard
Use scope options in prune flags
Originally requested in https://github.com/vercel/turbo/issues/864, this PR makes prune's --scope flag into a string array. This allows us to prune down to more than just one package.
Relevant discussion: https://github.com/vercel/turbo/discussions/2503
@CJEnright is attempting to deploy a commit to the Vercel Team on Vercel.
A member of the Team first needs to authorize it.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated |
|---|---|---|---|
| examples-basic-web | ✅ Ready (Inspect) | Visit Preview | Nov 29, 2022 at 6:58PM (UTC) |
| examples-designsystem-docs | ✅ Ready (Inspect) | Visit Preview | Nov 29, 2022 at 6:58PM (UTC) |
| examples-kitchensink-blog | ✅ Ready (Inspect) | Visit Preview | Nov 29, 2022 at 6:58PM (UTC) |
| examples-native-web | ✅ Ready (Inspect) | Visit Preview | Nov 29, 2022 at 6:58PM (UTC) |
| examples-nonmonorepo | ✅ Ready (Inspect) | Visit Preview | Nov 29, 2022 at 6:58PM (UTC) |
| examples-svelte-web | ✅ Ready (Inspect) | Visit Preview | Nov 29, 2022 at 6:58PM (UTC) |
So, the --scope flag for prune and the --scope flag for run are intentionally distinct. My apologies for the confusion. --scope for prune is not deprecated, and it's using that name intentionally because it doesn't collide with the --filter naming available in run.
In the prune world we're intentionally trying to limit you. We don't want you to be able to specify the full gamut of filtering rules that you can in run because it doesn't make sense. When you're constructing a pruned repository we only allow you to specify the leaf nodes and we calculate all of the intermediate nodes for you.
That is to say: scope.AddFlags() isn't an option here. We need to switch to the array method I described in #2503.
Thanks to both of you for the tips! Made all those changes requested and the outcome is definitely much nicer.
Thanks again @chris-olszewski! Was able to run the e2e tests locally and looks like sorting did the trick.