Skip to content

refactor: Richer internal dependency data - #13188

Merged
anthonyshew merged 6 commits into
mainfrom
shew/package-graph-dependency-types-e827
Jul 1, 2026
Merged

anthonyshew merged 6 commits into
mainfrom
shew/package-graph-dependency-types-e827

Conversation

@anthonyshew

Copy link
Copy Markdown
Contributor

Description

Passing internal dependency type information around in our graph knowledge to set up for richer dependency-related features. Namely #1100 is our interest today.

Testing Instructions

Added some tests.

cursoragent and others added 2 commits June 30, 2026 23:23
Store DependencyKind on internal workspace edges so consumers like prune
can distinguish production and dev workspace dependencies in a follow-up.

- Add DependencyKind::Dev and emit it from devDependencies
- Weight package graph edges with DependencyKind during construction
- Expose dependency_kind and immediate_dependencies_with_kinds APIs
- Surface edge kind in the turborepo-query package graph schema
- Generalize transitive_closure over arbitrary edge weights

Co-authored-by: Anthony Shew <anthonyshew@users.noreply.github.com>
Co-authored-by: Anthony Shew <anthonyshew@users.noreply.github.com>
@anthonyshew
anthonyshew requested a review from a team as a code owner July 1, 2026 00:33
@anthonyshew
anthonyshew requested review from tknickman and removed request for a team July 1, 2026 00:33
@vercel

vercel Bot commented Jul 1, 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 Jul 1, 2026 12:59am
examples-designsystem-docs Ready Ready Preview, Comment, Open in v0 Jul 1, 2026 12:59am
examples-gatsby-web Ready Ready Preview, Comment, Open in v0 Jul 1, 2026 12:59am
examples-kitchensink-blog Ready Ready Preview, Comment, Open in v0 Jul 1, 2026 12:59am
examples-nonmonorepo Ready Ready Preview, Comment, Open in v0 Jul 1, 2026 12:59am
examples-svelte-web Ready Ready Preview, Comment, Open in v0 Jul 1, 2026 12:59am
examples-tailwind-web Ready Ready Preview, Comment, Open in v0 Jul 1, 2026 12:59am
examples-vite-web Ready Ready Preview, Comment, Open in v0 Jul 1, 2026 12:59am
turbo-site Ready Ready Preview, Comment, Open in v0 Jul 1, 2026 12:59am
turborepo-eve-agent Error Error Open in v0 Jul 1, 2026 12:59am

@anthonyshew anthonyshew changed the title Shew/package graph dependency types e827 refactor: Richer internal dependency data Jul 1, 2026
Comment thread crates/turborepo-query/src/package_graph.rs Outdated
Co-authored-by: Anthony Shew <anthonyshew@users.noreply.github.com>
Co-authored-by: Anthony Shew <anthonyshew@users.noreply.github.com>
Co-authored-by: Anthony Shew <anthonyshew@users.noreply.github.com>
Co-authored-by: Anthony Shew <anthonyshew@users.noreply.github.com>
@anthonyshew
anthonyshew merged commit 909c696 into main Jul 1, 2026
41 of 42 checks passed
@anthonyshew
anthonyshew deleted the shew/package-graph-dependency-types-e827 branch July 1, 2026 01:12
anthonyshew added a commit that referenced this pull request Jul 1, 2026
<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
### Description

Adds `turbo prune --production` to exclude in-workspace packages that
are only reachable through `devDependencies` when selecting which
workspace packages to copy into the pruned output.

This builds on the dependency kind data added to the package graph in
#13188. When `--production` is set, prune uses a production-only
transitive closure over internal workspace edges. Peer workspace
handling, lockfile pruning, and copied `package.json` contents are
unchanged.

Closes #1100.

### Testing Instructions

1. In a monorepo where a scope target has both `dependencies` and
`devDependencies` on workspace packages, run:
- `turbo prune <scope>` and confirm dev-only workspace packages are
included.
- `turbo prune <scope> --production` and confirm dev-only workspace
packages are excluded.
2. Confirm root `devDependencies` on workspace packages are excluded
with `--production`.
3. Confirm `--production` works with `--docker` (both `full/` and
`json/` outputs omit dev-only packages).
4. Run tests:
   - `cargo test -p turborepo-lib --lib internal_dependencies`
   - `cargo test -p turbo --test prune_test test_prune_production`
   - `cargo test -p turborepo-repository test_dev_dependency_edge_kind`
<!-- CURSOR_AGENT_PR_BODY_END -->

<div><a
href="https://cursor.com/agents/bc-019f1b82-c058-787d-8d7d-03052c32ffcf"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-019f1b82-c058-787d-8d7d-03052c32ffcf"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Anthony Shew <anthonyshew@users.noreply.github.com>
anthonyshew pushed a commit that referenced this pull request Jul 1, 2026
## Release v2.10.3-canary.5

> [!CAUTION]
> Versioned docs aliasing FAILED. [View
logs](https://github.com/vercel/turborepo/actions/runs/28526268634)

### Changes

- release(turborepo): 2.10.3-canary.4 (#13186) (`406fe59`)
- refactor: Richer internal dependency data (#13188) (`909c696`)
- fix: Honor package manager version ranges (`136273e`)
- fix: Skip node_modules in boundaries checks (#13191) (`93741a0`)
- fix: Add token exchange recovery guidance (#13192) (`bef588b`)
- feat: Add --production flag to turbo prune (#13190) (`3777442`)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
anthonyshew pushed a commit that referenced this pull request Jul 3, 2026
## Release v2.10.3

> [!CAUTION]
> Versioned docs aliasing FAILED. [View
logs](https://github.com/vercel/turborepo/actions/runs/28672736782)

### Changes

- feat: Add nub to create-turbo options (#13173) (`82b1cf1`)
- release(turborepo): 2.10.2 (#13174) (`ec30b18`)
- release(turborepo): 2.10.3-canary.1 (#13176) (`47e2b22`)
- fix: Normalize package manager versions (#13177) (`658f607`)
- fix: Use singular workspace in package resolution error (#13178)
(`d199c53`)
- fix: Support nub native lockfiles (#13179) (`50546e6`)
- perf(build): Enable thin LTO + codegen-units=1 for release builds
(#13160) (`628aea9`)
- release(turborepo): 2.10.3-canary.2 (#13181) (`16aed08`)
- feat: Add aube package manager support (#13183) (`0f78006`)
- release(turborepo): 2.10.3-canary.3 (#13184) (`fec7cee`)
- fix: Normalize package manager version output (#13185) (`f469ed8`)
- release(turborepo): 2.10.3-canary.4 (#13186) (`406fe59`)
- refactor: Richer internal dependency data (#13188) (`909c696`)
- fix: Honor package manager version ranges (`136273e`)
- fix: Skip node_modules in boundaries checks (#13191) (`93741a0`)
- fix: Add token exchange recovery guidance (#13192) (`bef588b`)
- feat: Add --production flag to turbo prune (#13190) (`3777442`)
- release(turborepo): 2.10.3-canary.5 (#13193) (`ca20ca2`)
- feat: Accept Bun lockfile version 2 (#13119) (`69e2085`)
- fix: Handle task executor join errors as internal errors (#13148)
(`c4017e9`)
- fix:  Tweaks for nub support (#13187) (`ca029ee`)
- release(turborepo): 2.10.3-canary.6 (#13194) (`b79f767`)
- release(turborepo): 2.10.3-canary.7 (#13195) (`b426736`)
- chore: Upgrade TypeScript to 7.0.1-rc (#13144) (`cf07baa`)
- docs: Add filtered installs to Vercel guide (#13196) (`7e70b52`)
- examples: add with-mcp-servers (#12997) (`8eb4d9d`)
- fix: Report malformed JSON parse errors instead of panicking (#13198)
(`a69df7d`)
- fix: Improve error messaging when platform binary is missing (#13199)
(`8e145f0`)
- release(turborepo): 2.10.3-canary.8 (#13200) (`5987ed1`)
- fix(watch): recover from slow initial hash instead of timing out
(#13159) (`05e26cb`)
- chore: Update vitest example to vitest 4 and use native test merging
(#13202) (`e2b61dc`)
- feat: Toggle between the TUI and streamed logs (#13203) (`1325455`)
- fix: Resolve Bun scoped package deps that share a name with a
dependency (#13207) (`e4773ab`)
- feat: Select tasks by clicking rows in the TUI task list (#13206)
(`c568f67`)
- perf: Avoid deep-cloning dependency maps in lockfile closure cache
(#13209) (`abd84cf`)
- perf: Cache root internal dependencies in package graph (#13211)
(`7ec8c6d`)
- feat: Automatically copy TUI selection to clipboard on mouse release
(#13208) (`61d6013`)
- perf: Cache env wildcard matches across tasks during hashing (#13210)
(`148b1dd`)
- perf: Replace per-package graph traversals in scope filtering (#13212)
(`28d1871`)
- perf: Derive dirty hash from repo index (#13213) (`b521d32`)
- fix: Include untracked symlinks in repo-index dirty hash (#13218)
(`c3c91ab`)
- refactor: Use upstream libghostty-vt crates instead of vendored
bindings (#13205) (`c2115dc`)
- fix: Remove devtools feature flag (#13219) (`65efe27`)
- fix: Harden TUI terminal restore during shutdown (#13220) (`dccab93`)
- fix: Correct gitignore precedence in untracked walk and memoize
matcher chains (#13221) (`bc32fcc`)

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

This branch had an error being deployed

1 failed deployment
Preview – turborepo-eve-agent — 4743af2c Deployed Jul 1, 2026 by vercel[bot]
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.

2 participants