-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Which project is this feature idea for?
Turborepo
Describe the feature you'd like to request
I would like to run some script after all packages have executed a given task.
For example, running coverage task in each package, and then running an additional task at the root that merges/aggregates all of that coverage. I can think of similar postXxx tasks for documentation, copying/moving/bundling files, etc.
Keywords: "all packages", "star dependsOn"
Describe the solution you'd like
Due to the nature of “all packages,” I would like a special dependsOn value ("*") that only root tasks can reference.
Example:
"//#coverage": {
"dependsOn": ["*coverage"]
}
Note: I originally thought just *, but realized *<task_name> may make more sense.
Describe alternatives you've considered
Alternatives I considered
-
Running a new turbo instance. For example, having the root package.json’s
coverage:rootrunturbo run coverageand have apostcoverage:rootexecute the aggregation. Not ideal because we would have twoturboruns which limits parallelization I think. -
Creating an umbrella
@scope/all-packagespackage that declares every other package as a dependency. I could then use this package to execute any aggregation logic. Not ideal at first glance because I now have two places to maintain workspace configuration/workspace list, which can lead to out-of-sync issues.This has similarity to explicitly declaring dependencies in
dependsOnfor the root task, but I think Turbo prefers we usepackage.jsondependencies to model package dependencies, anddependsOnto manage task dependencies.