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

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

@vercel
Copy link
Contributor

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

@vercel
Copy link
Contributor

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
Contributor

@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.

@LudvigHz
Copy link

LudvigHz commented Aug 19, 2025

Are there any plans to find a way to resolve this? I know a lot of people would love to be able to fully use turbo prune with bun 😄

@anthonyshew
Copy link
Contributor

I'll close this one because Bun has changed their lockfile format entirely. We're working on the new version in #10729. Let's meet up there!

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.

Turbo prune of bun monorepo leaves bad entries in pruned lockfile

4 participants