Repository navigation
fix(pnpm linker): always link dependencies next to store packages - #369
Conversation
⏱️ Benchmark Resultsgatsby install-full-cold
📊 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
📊 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)
📊 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 |
✅ Deploy Preview for yarn-v6 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Bugbot couldn't run - usage limit reachedBugbot 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.
bf6525d to
7bad369
Compare
Bugbot couldn't run - usage limit reachedBugbot 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
Bugbot couldn't run - usage limit reachedBugbot 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) |
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 ownnode_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_modulesjust because the same version is also hoisted to the store’s sharednode_modules.Previously the linker assumed Node would resolve through the hoisted copy; bundlers and type crawlers that read each package’s own
node_modulescould 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 assertsone-fixed-depstill hasnode_modules/no-depsunder its store folder.Reviewed by Cursor Bugbot for commit 3b7e964. Bugbot is set up for automated code reviews on this repo. Configure here.