Repository navigation
Link unambiguous workspace peers in pnpm installs - #390
aghiles-dd wants to merge 1 commit into
Conversation
👷 Deploy request for yarn-v6 pending review.Visit the deploys page to approve it
|
⏱️ Benchmark Resultsgatsby install-full-cold
📊 Raw benchmark data (gatsby install-full-cold)Base times: 4.805s, 4.812s, 4.709s, 4.850s, 4.778s, 4.653s, 4.907s, 4.839s, 4.990s, 4.879s, 4.728s, 4.854s, 4.915s, 4.834s, 4.816s, 4.697s, 4.757s, 5.021s, 4.768s, 4.747s, 4.838s, 4.723s, 4.706s, 4.776s, 4.797s, 4.725s, 4.816s, 4.679s, 4.851s, 4.791s Head times: 4.842s, 4.735s, 4.755s, 4.660s, 4.726s, 4.768s, 4.712s, 4.640s, 4.692s, 4.726s, 4.813s, 4.687s, 4.657s, 4.681s, 4.697s, 4.715s, 4.653s, 4.723s, 4.683s, 4.739s, 4.690s, 4.680s, 4.733s, 4.695s, 4.747s, 4.680s, 4.682s, 4.701s, 4.747s, 4.826s gatsby install-cache-only
📊 Raw benchmark data (gatsby install-cache-only)Base times: 1.665s, 1.562s, 1.541s, 1.571s, 1.540s, 1.535s, 1.545s, 1.529s, 1.561s, 1.576s, 1.575s, 1.545s, 1.544s, 1.539s, 2.167s, 1.532s, 1.545s, 1.546s, 1.553s, 1.532s, 1.534s, 1.524s, 1.513s, 1.684s, 1.571s, 1.532s, 1.533s, 1.532s, 1.531s, 1.529s Head times: 1.542s, 1.557s, 1.557s, 1.645s, 1.517s, 1.551s, 1.535s, 1.539s, 1.532s, 1.624s, 1.542s, 1.746s, 1.550s, 1.825s, 1.703s, 1.647s, 1.543s, 1.531s, 1.537s, 1.533s, 1.552s, 1.551s, 1.530s, 1.525s, 1.546s, 1.540s, 1.557s, 1.541s, 1.549s, 1.560s gatsby install-cache-and-lock (warm, with lockfile)
📊 Raw benchmark data (gatsby install-cache-and-lock (warm, with lockfile))Base times: 0.479s, 0.476s, 0.469s, 0.469s, 0.471s, 0.472s, 0.475s, 0.475s, 0.470s, 0.483s, 0.474s, 0.483s, 0.479s, 0.478s, 0.478s, 0.475s, 0.478s, 0.472s, 0.478s, 0.482s, 0.480s, 0.483s, 0.473s, 0.474s, 0.474s, 0.476s, 0.478s, 0.476s, 0.469s, 0.472s Head times: 0.483s, 0.482s, 0.478s, 0.479s, 0.477s, 0.891s, 0.943s, 1.090s, 0.479s, 0.488s, 0.482s, 0.484s, 0.488s, 0.490s, 0.490s, 0.483s, 0.488s, 0.482s, 0.481s, 0.490s, 0.488s, 0.486s, 0.485s, 0.477s, 0.478s, 0.484s, 0.477s, 0.477s, 0.475s, 0.473s |
Problem
With the pnpm linker, a virtual workspace's peer dependencies are registered under its virtual store path even though the workspace executes from its shared source directory. For example, if workspace
adepends on workspaceb, andbdeclaresaas a peer, Yarn reports that peer as provided but Node cannot resolve it fromb.Change
Add peer links to the physical workspace directory only when every consumed virtual context agrees on the physical target. Keep existing direct dependencies and peer fallbacks authoritative. Ambiguous or missing peer contexts keep their existing placement: this does not attempt to support multiple incompatible peer environments in one shared source directory.
Ordinary dependency placement is unchanged.
Validation
Validated the local binary against web-ui with unchanged manifests and lockfile: immutable pnpm install succeeds, Node resolves the previously missing cyclic workspace peer, the 15,838-context inventory has zero unresolved edges/unexplained absences, three graph consumers run, and 74 focused tests pass. The repository was restored to its configured PnP install afterward.