feat: allow configuring custom includes for prune subcommand #10989
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Extended
turbo prunecommand andturbo.jsonconfig, so it's possible to specify additional fields that need to be copied during the prune operation. For example, it's possible to specify in the top-levelturbo.json:so that
README.mdof all pruned workspaces should be copied and ifshared-libraryis part of the prunned tree,shared-library/example.filewill also be copied.It should also be possible to specify prune includes in the workspace-level
turbo.json:Here the
includessupports workspace-relative paths.Motivation for this change
I have a use-case, where some of my workspaces have
postinstallscript performing some additional, required operations for a successful installation. By definition,postinstallis invoked directly afteryarn/npm/pnpm install. I useturbo prune --docker, so before I can invoke install I need to manually copy relevant files first. While that works at a smaller scale, when thispostinstallscript is part of a shared library used by many apps/other libraries in the monorepo, everyDockerfileneeds to manually copy these required files, which is annoying. Being able to configure that once in theturbo.jsonsimplifies that use-case.Related discussion: #7464
Testing Instructions