feat: add dependsOn package dependency selection#467
Conversation
Co-authored-by: GPT-5 Codex <codex@openai.com>
1e68775 to
6d9d369
Compare
Fold the redundant intermediate set and the duplicated value-loop in add_package_dependency_entry into a single pass, and extract the shared package-to-task lookup into resolve_packages_to_tasks, now reused by map_subgraph_to_tasks. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: GPT-5 Codex <codex@openai.com>
Add a plan-snapshot fixture where a selected package transitively depends on another selected package only through a task-less intermediate. The two build tasks stay unordered, locking in that nearest object-form dependsOn selection does not create transitive ordering edges. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b79c338884
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let pkg_to_task = self.resolve_nearest_packages_to_tasks( | ||
| package_graph | ||
| .edges(origin_package) | ||
| .filter(|edge| entry.dependency_types.contains(edge.weight())) | ||
| .map(|edge| edge.target()), |
There was a problem hiding this comment.
Exclude the source package from dependency walks
When a dependency path cycles back to the package that declared the object dependsOn (for example app -> plugin -> app, with plugin lacking the requested task), this walk can return the origin package as a nearest match. That makes { "task": "build", "from": ... } add app#build from within app (or a self-edge when the source is app#build), even though the new semantics say the source package itself is not selected; seed the walk with origin_package as already seen or filter it out before adding edges.
Useful? React with 👍 / 👎.

Summary
dependsOnentries with{ task, from }for direct workspace dependency package selection.dependencies,devDependencies, andpeerDependenciesthrough the existing workspace dependency model.Motivation
This provides parity with the common Turbo/Nx
^taskworkflow without special-character task syntax. It reduces migration friction for workspaces that rely on upstream package tasks, such as builds or generated artifacts, before running downstream tasks.