Skip to content

feat: add dependsOn package dependency selection#467

Merged
wan9chi merged 4 commits into
mainfrom
codex/depends-on-package-dependencies
Jun 15, 2026
Merged

feat: add dependsOn package dependency selection#467
wan9chi merged 4 commits into
mainfrom
codex/depends-on-package-dependencies

Conversation

@wan9chi

@wan9chi wan9chi commented Jun 15, 2026

Copy link
Copy Markdown
Member

Summary

  • Add object-form dependsOn entries with { task, from } for direct workspace dependency package selection.
  • Support dependencies, devDependencies, and peerDependencies through the existing workspace dependency model.
  • Add plan snapshot coverage, generated TypeScript config types, docs, an RFC, and a changelog entry.

Motivation

This provides parity with the common Turbo/Nx ^task workflow 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.

wan9chi commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Co-authored-by: GPT-5 Codex <codex@openai.com>
@wan9chi wan9chi force-pushed the codex/depends-on-package-dependencies branch from 1e68775 to 6d9d369 Compare June 15, 2026 02:16
wan9chi and others added 3 commits June 15, 2026 15:11
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>
@wan9chi wan9chi marked this pull request as ready for review June 15, 2026 07:58
@wan9chi wan9chi merged commit 6296ffa into main Jun 15, 2026
34 of 36 checks passed
@wan9chi wan9chi deleted the codex/depends-on-package-dependencies branch June 15, 2026 08:05

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +333 to +337
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()),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant