turbo icon indicating copy to clipboard operation
turbo copied to clipboard

Use scope options in prune flags

Open CJEnright opened this issue 1 year ago • 4 comments

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 avatar Nov 02 '22 04:11 CJEnright

@CJEnright is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Nov 02 '22 04:11 vercel[bot]

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

5 Ignored Deployments
Name Status Preview Updated
examples-basic-web ⬜️ Ignored (Inspect) Nov 2, 2022 at 4:03AM (UTC)
examples-designsystem-docs ⬜️ Ignored (Inspect) Nov 2, 2022 at 4:03AM (UTC)
examples-kitchensink-blog ⬜️ Ignored (Inspect) Nov 2, 2022 at 4:03AM (UTC)
examples-native-web ⬜️ Ignored (Inspect) Nov 2, 2022 at 4:03AM (UTC)
examples-svelte-web ⬜️ Ignored (Inspect) Nov 2, 2022 at 4:03AM (UTC)

vercel[bot] avatar Nov 02 '22 04:11 vercel[bot]

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.

nathanhammond avatar Nov 02 '22 06:11 nathanhammond