这是indexloc提供的服务,不要输入任何密码
Skip to content

fix(bun): fix workspace peerDependencies #10549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

camero2734
Copy link
Contributor

@camero2734 camero2734 commented Jun 7, 2025

Description

Should resolve #10410

Both Bun and NPM install (non-optional) peer dependencies by default in their latest versions. It seems turbo currently skips over peerDependencies when calculating all_packages for a package.json, which results in (at least for Bun) an incomplete lockfile since "unmet" peer dependencies aren't resolved.

Testing Instructions

Utilizing the repro repo provided in #10410 (comment):

Before:

bunx turbo prune @pkg/a --docker
cd out/json
bun install --frozen-lockfile

gives

error: Failed to resolve root peer dependency 'typescript'
    at bun.lock:4:9
InvalidPackageInfo: failed to parse lockfile: 'bun.lock'

After:

../turborepo/target/debug/turbo prune @pkg/a --docker --skip-infer
cd out/json
bun install --frozen-lockfile

gives no error

@turbo-orchestrator turbo-orchestrator bot added the needs: triage New issues get this label. Remove it after triage label Jun 7, 2025
Copy link

vercel bot commented Jun 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-basic-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2025 3:37pm
examples-designsystem-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2025 3:37pm
examples-gatsby-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2025 3:37pm
examples-kitchensink-blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2025 3:37pm
examples-native-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2025 3:37pm
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2025 3:37pm
examples-svelte-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2025 3:37pm
examples-tailwind-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2025 3:37pm
examples-vite-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2025 3:37pm
turbo-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2025 3:37pm

Copy link

vercel bot commented Jun 7, 2025

@camero2734 is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@camero2734 camero2734 changed the title Fix bun prune peer_dependencies fix(bun): fix workspace peerDependencies Jun 7, 2025
@camero2734 camero2734 marked this pull request as ready for review June 9, 2025 06:41
@camero2734 camero2734 requested a review from a team as a code owner June 9, 2025 06:42
Copy link
Member

@chris-olszewski chris-olszewski left a comment

Choose a reason for hiding this comment

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

This will break some analysis since peerDependencies are not actually provided by the package they are declared in. The host package needs to include them. Maybe this isn't the case for Bun, but if so we need to make this behavior package manager dependent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: triage New issues get this label. Remove it after triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Turbo prune of bun monorepo leaves bad entries in pruned lockfile
3 participants