Skip to content

fix: Ignore peer dependencies in package graph - #13029

Closed
anthonyshew wants to merge 1 commit into
mainfrom
shew/ignore-peer-dependencies-package-graph
Closed

anthonyshew wants to merge 1 commit into
mainfrom
shew/ignore-peer-dependencies-package-graph

Conversation

@anthonyshew

Copy link
Copy Markdown
Contributor

Why

Turborepo should not treat peerDependencies as package graph inputs. Peers are supplied by consumers and should not create workspace build-order edges, participate in cycle detection, or influence package graph external dependency metadata.

This fixes a regression where pure peer back-edges could make otherwise valid monorepos fail with circular package dependency errors.

What

  • Ignore peer dependencies during package graph dependency splitting.
  • Preserve normal dependency behavior for dependencies, devDependencies, and optionalDependencies.
  • Add regression coverage for internal peer back-edges and external peer declarations.

How

Run:

cargo test -p turborepo-repository

Manual reproduction:

  1. Create a workspace where app depends on lib and lib declares app only as a peer.
  2. Configure build with dependsOn: ["^build"].
  3. Run turbo run build.

Expected result: Turbo builds lib before app and does not report a package dependency cycle.

@vercel

vercel Bot commented Jun 5, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
examples-basic-web Ready Ready Preview, Comment, Open in v0 Jun 5, 2026 8:20pm
examples-designsystem-docs Ready Ready Preview, Comment, Open in v0 Jun 5, 2026 8:20pm
examples-gatsby-web Ready Ready Preview, Comment, Open in v0 Jun 5, 2026 8:20pm
examples-kitchensink-blog Ready Ready Preview, Comment, Open in v0 Jun 5, 2026 8:20pm
examples-nonmonorepo Building Building Preview, Open in v0 Jun 5, 2026 8:20pm
examples-svelte-web Ready Ready Preview, Comment, Open in v0 Jun 5, 2026 8:20pm
examples-tailwind-web Building Building Preview, Open in v0 Jun 5, 2026 8:20pm
examples-vite-web Ready Ready Preview, Comment, Open in v0 Jun 5, 2026 8:20pm
turbo-site Ready Ready Preview, Comment, Open in v0 Jun 5, 2026 8:20pm

@anthonyshew
anthonyshew requested a review from a team as a code owner June 5, 2026 20:20
@anthonyshew
anthonyshew requested review from tknickman and removed request for a team June 5, 2026 20:20
@anthonyshew

Copy link
Copy Markdown
Contributor Author

Closing in favor of updating #13025 directly.

@anthonyshew anthonyshew closed this Jun 5, 2026
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