Skip to content

fix(pnpm linker): always link dependencies next to store packages - #369

Merged
arcanis merged 2 commits into
mainfrom
mael/pnpm-store-links
Oct 13, 2026
Merged

arcanis merged 2 commits into
mainfrom
mael/pnpm-store-links

Conversation

@arcanis

@arcanis arcanis commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Issue: the pnpm linker skipped a store package's dependency link when the same version was hoisted, relying on Node to resolve it through node_modules/.pnpm/node_modules. Tools that read a package's dependencies from its own node_modules (bundlers, type crawlers) didn't find them.

Fix: dependencies are always linked next to the package, as pnpm does. Covered by an acceptance test.


Note

Medium Risk
Changes core pnpm install linking for hoisted deps and may add symlinks on disk, but behavior aligns with pnpm and is scoped to the linker’s second pass.

Overview
Fixes pnpm linker layout when dependencies are hoisted: the second pass no longer skips creating a dependency symlink inside a store package’s node_modules just because the same version is also hoisted to the store’s shared node_modules.

Previously the linker assumed Node would resolve through the hoisted copy; bundlers and type crawlers that read each package’s own node_modules could miss those deps. Every declared dependency is now linked next to its parent in the store, matching real pnpm behavior.

An acceptance test covers pnpmHoistPatterns: ['*'] and asserts one-fixed-dep still has node_modules/no-deps under its store folder.

Reviewed by Cursor Bugbot for commit 3b7e964. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

⏱️ Benchmark Results

gatsby install-full-cold

Metric Base Head Difference
Mean 4.053s 4.023s -0.74% ✅
Median 4.046s 4.025s -0.53% ✅
Min 3.950s 3.942s
Max 4.242s 4.156s
Std Dev 0.073s 0.053s
📊 Raw benchmark data (gatsby install-full-cold)

Base times: 4.015s, 4.177s, 3.950s, 3.976s, 3.988s, 4.047s, 4.242s, 3.987s, 4.088s, 3.976s, 3.982s, 4.153s, 4.101s, 4.082s, 4.053s, 4.056s, 3.964s, 3.973s, 4.031s, 4.039s, 3.978s, 4.159s, 4.041s, 4.104s, 4.009s, 4.046s, 4.101s, 4.069s, 4.168s, 4.049s

Head times: 4.018s, 4.048s, 4.027s, 4.046s, 4.026s, 4.026s, 4.040s, 4.011s, 3.942s, 4.030s, 3.949s, 4.041s, 4.107s, 3.992s, 4.093s, 4.156s, 4.035s, 3.967s, 3.956s, 4.021s, 4.095s, 3.950s, 4.126s, 3.956s, 4.050s, 3.985s, 3.995s, 4.005s, 4.024s, 3.985s


gatsby install-cache-only

Metric Base Head Difference
Mean 1.318s 1.326s +0.59% ⚠️
Median 1.278s 1.271s -0.60% ✅
Min 1.233s 1.247s
Max 1.982s 1.893s
Std Dev 0.159s 0.156s
📊 Raw benchmark data (gatsby install-cache-only)

Base times: 1.982s, 1.286s, 1.243s, 1.249s, 1.239s, 1.296s, 1.315s, 1.316s, 1.267s, 1.295s, 1.285s, 1.319s, 1.278s, 1.269s, 1.269s, 1.303s, 1.248s, 1.795s, 1.278s, 1.265s, 1.279s, 1.251s, 1.246s, 1.263s, 1.259s, 1.303s, 1.253s, 1.233s, 1.333s, 1.337s

Head times: 1.266s, 1.283s, 1.257s, 1.252s, 1.247s, 1.285s, 1.273s, 1.272s, 1.350s, 1.365s, 1.330s, 1.341s, 1.271s, 1.251s, 1.266s, 1.248s, 1.719s, 1.893s, 1.699s, 1.252s, 1.289s, 1.252s, 1.252s, 1.258s, 1.270s, 1.253s, 1.262s, 1.250s, 1.297s, 1.282s


gatsby install-cache-and-lock (warm, with lockfile)

Metric Base Head Difference
Mean 0.358s 0.417s +16.69% ⚠️
Median 0.353s 0.360s +2.01% ⚠️
Min 0.340s 0.343s
Max 0.397s 1.249s
Std Dev 0.015s 0.210s
📊 Raw benchmark data (gatsby install-cache-and-lock (warm, with lockfile))

Base times: 0.354s, 0.366s, 0.353s, 0.353s, 0.344s, 0.347s, 0.342s, 0.340s, 0.345s, 0.372s, 0.368s, 0.343s, 0.342s, 0.356s, 0.350s, 0.376s, 0.359s, 0.388s, 0.374s, 0.351s, 0.350s, 0.397s, 0.351s, 0.352s, 0.349s, 0.344s, 0.349s, 0.368s, 0.386s, 0.359s

Head times: 0.354s, 0.357s, 0.374s, 0.369s, 0.371s, 0.351s, 0.352s, 0.356s, 1.249s, 1.127s, 0.355s, 0.376s, 0.373s, 0.373s, 0.372s, 0.358s, 0.356s, 0.362s, 0.358s, 0.355s, 0.359s, 0.353s, 0.383s, 0.381s, 0.378s, 0.361s, 0.369s, 0.349s, 0.344s, 0.343s

@netlify

netlify Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for yarn-v6 ready!

Name Link
🔨 Latest commit 3b7e964
🔍 Latest deploy log https://app.netlify.com/projects/yarn-v6/deploys/6ace7e91040b0c00d05af88f
😎 Deploy Preview https://deploy-preview-369--yarn-v6.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@cursor

cursor Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 106f45c4-8488-497d-92c2-f565ebc20634)

The pnpm linker didn't create a store package's dependency link when
the same version was hoisted, relying on Node resolving it through
node_modules/.pnpm/node_modules. Tools that read a package's
dependencies from its own node_modules folder (bundlers, type crawlers)
didn't find them.

Dependencies are now always linked next to the package, as pnpm does.
@arcanis
arcanis force-pushed the mael/pnpm-store-links branch from bf6525d to 7bad369 Compare October 13, 2026 18:27
@cursor

cursor Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 127b185c-9062-4b1e-a793-d9d852008ab4)

# Conflicts:
#	packages/zpm/src/linker/pnpm.rs
@cursor

cursor Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: cb91839c-369c-4000-8c68-ec31820fa472)

@arcanis
arcanis merged commit 79ab364 into main Oct 13, 2026
27 checks passed
@arcanis
arcanis deleted the mael/pnpm-store-links branch October 13, 2026 19:37

This branch was successfully deployed

1 active deployment
test-reports — 3b7e964c Deployed Oct 13, 2026 by arcanis via Reporting test results #1459
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