turbo_workspace
Native Turborepo workspace seed.
Description#
turbo_workspace asks turbo for its package graph (turbo query) and for
the dry run of the requested tasks (turbo run --dry=json) at graph load
time, and emits one task target per package and task pair. Dependency edges
are the ones turbo resolves from dependsOn, including the upstream ^
form, package#task references, and package configurations that extend
the root turbo.json.
Turborepo remains authoritative for package discovery and task
configuration. Struo schedules, caches, and optionally executes remotely
the tasks it emits without shelling back into turbo run. Tasks named
test become turbo_test targets;
the rest become turbo_task targets.
The default task filter emits every build, test, and lint task,
together with the tasks they depend on. Names that no package defines are
skipped. Set targets to the empty list to include every task. Tasks
without a script are bridged: their dependents depend on the runnable tasks
behind them. Persistent and interactive tasks are not emitted.
Wildcard environment patterns are expanded by turbo against the caller's environment, so a changed environment reloads the graph.
Attributes#
| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
node | string | no | node | Node.js executable name, absolute path, or workspace-relative path |
targets | list<string> | no | ["build", "test", "lint"] | Task names to emit with the tasks they depend on; empty list includes every task |
resolver_inputs | list<string> | no | srcs | Text inputs available while deriving the graph |
graph_file | string | no | Optional workspace-relative graph snapshot with packages (the package items of turbo query) and dry (the output of turbo run --dry=json). Struo reads it directly instead of invoking turbo | |
coverage_per_test | bool | no | false | Forward isolated coverage opt-in to generated test targets running one native Jest or Vitest command |
coverage_sources | list<string> | no | [] | Product source globs forwarded to coverage-enabled test targets |
_default_test_roots | list<string> | no | [] | Resolver-owned test target names selected by targetless struo test |
Providers#
The target emits turbo_workspace.
Capabilities#
| Capability | Output groups |
|---|---|
build | none |
Building the seed builds every emitted build task.
Direct Use#
Install the workspace's Node.js dependencies with its package manager so
that node_modules/turbo is present:
npm installStruo never installs Node.js dependencies or updates lock files.
Inspect the automatically derived graph:
struo query workspace
struo query targets --kind turbo_taskNo struo.toml is required. To configure the resolver explicitly, author a
target equivalent to:
[[target]]
name = "turbo"
kind = "turbo_workspace"
srcs = ["turbo.json", "package.json"]
[target.attrs]
resolver_inputs = ["turbo.json", "package.json", "**/package.json"]
targets = ["build", "test", "lint", "typecheck"]Example#
struo query example turbo_workspace turbo-workspace-native-projectSources#
- Turborepo task configuration
defines
dependsOn,outputs,cache,env, andpassThroughEnv. turbo run --dryreports the resolved task graph Struo reads.