Skip to content

fix(install): fix resolving duplicate dependencies #21059

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

Merged
merged 16 commits into from
Jul 16, 2025

Conversation

dylan-conway
Copy link
Member

@dylan-conway dylan-conway commented Jul 15, 2025

What does this PR do?

Dependency sort order (and priority) is changed to:

  1. devDependencies
  2. optionalDependencies
  3. dependencies
  4. peerDependencies

Moves "nodeLinker" from "workspaces" in package.json to bunfig.toml under "linker".

[install]
linker = "isolated" # or "hoisted

"node-linker" (from yarn or pnpm) and "install-strategy" (from npm) can be read from .npmrc

node-linker=isolated
# or
install-strategy=linked

Fixes a diff bug causing workspaces to be diffed multiple times.

How did you verify your code works?

Added one claude generated test and one handwritten test for the exact behavior.

@robobun
Copy link
Collaborator

robobun commented Jul 15, 2025

Updated 10:51 PM PT - Jul 15th, 2025

@dylan-conway, your commit 2d7fb48 is building: #20710

@dylan-conway dylan-conway marked this pull request as ready for review July 16, 2025 05:51
},
};

try lockfile.buffers.dependencies.append(allocator, dep);
Copy link
Collaborator

@Jarred-Sumner Jarred-Sumner Jul 16, 2025

Choose a reason for hiding this comment

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

Suggested change
try lockfile.buffers.dependencies.append(allocator, dep);
// We don't need to worry about the resolutions list having a different length than the dependencies list because ....
try lockfile.buffers.dependencies.append(allocator, dep);

@Jarred-Sumner Jarred-Sumner merged commit 2bc75a8 into main Jul 16, 2025
60 of 62 checks passed
@Jarred-Sumner Jarred-Sumner deleted the dylan/isolated-install-fixup branch July 16, 2025 08:01
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.

3 participants