Skip to content

fix(focus): don't crash the pnpm linker when the root isn't focused - #385

Open
arcanis wants to merge 1 commit into
mainfrom
mael/focus-pnpm-root
Open

arcanis wants to merge 1 commit into
mainfrom
mael/focus-pnpm-root

Conversation

@arcanis

@arcanis arcanis commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Issue: with nodeLinker: pnpm, yarn workspaces focus <ws> fails with Package map generation error: expected the top-level package to have been registered whenever the focused workspaces don't include the root. The package map builder requires the root node.

Fix: a missing root is treated as having no top-level dependencies. Covered by an acceptance test (fails before, passes after).

This is the linker part of #365, without the --immutable/--mode flags.


Note

Low Risk
Narrow linker edge-case fix with a regression test; behavior only changes when the root workspace is omitted from a focused pnpm install.

Overview
Fixes yarn workspaces focus with nodeLinker: pnpm when the focused set does not include the root workspace, which previously failed during package map generation with expected the top-level package to have been registered.

PnpmPackageMapBuilder::build no longer requires the root locator to be registered. If the root is absent (typical for a focused install), loose package maps treat top-level dependencies as empty instead of merging from a missing root node; standard maps are unchanged.

Adds an acceptance test that runs workspaces focus foo from packages/foo under the pnpm linker and asserts no-deps is linked correctly.

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

With nodeLinker: pnpm, `yarn workspaces focus <ws>` on a workspace that
doesn't depend on the root workspace failed with "expected the top-level
package to have been registered": the package map builder required the
root node. A missing root is now treated as having no top-level
dependencies.
@cursor

cursor Bot commented Oct 15, 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: 7dbe9376-4050-40c6-a000-1cb7d4b9d8fb)

@netlify

netlify Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for yarn-v6 ready!

Name Link
🔨 Latest commit 4b71fd3
🔍 Latest deploy log https://app.netlify.com/projects/yarn-v6/deploys/6ad0d0eb0c428ac5f725af39
😎 Deploy Preview https://deploy-preview-385--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.

@github-actions

Copy link
Copy Markdown

⏱️ Benchmark Results

gatsby install-full-cold

Metric Base Head Difference
Mean 4.384s 4.378s -0.12% ✅
Median 4.373s 4.364s -0.20% ✅
Min 4.319s 4.251s
Max 4.511s 4.904s
Std Dev 0.050s 0.117s
📊 Raw benchmark data (gatsby install-full-cold)

Base times: 4.334s, 4.340s, 4.319s, 4.511s, 4.372s, 4.351s, 4.343s, 4.360s, 4.393s, 4.351s, 4.395s, 4.414s, 4.374s, 4.417s, 4.377s, 4.438s, 4.327s, 4.395s, 4.344s, 4.323s, 4.361s, 4.330s, 4.442s, 4.373s, 4.371s, 4.469s, 4.388s, 4.416s, 4.378s, 4.501s

Head times: 4.346s, 4.335s, 4.364s, 4.332s, 4.369s, 4.312s, 4.420s, 4.339s, 4.385s, 4.329s, 4.346s, 4.396s, 4.289s, 4.285s, 4.400s, 4.365s, 4.252s, 4.403s, 4.251s, 4.332s, 4.376s, 4.440s, 4.371s, 4.320s, 4.380s, 4.385s, 4.306s, 4.469s, 4.550s, 4.904s


gatsby install-cache-only

Metric Base Head Difference
Mean 1.316s 1.311s -0.41% ✅
Median 1.317s 1.303s -1.07% ✅
Min 1.289s 1.287s
Max 1.334s 1.501s
Std Dev 0.010s 0.038s
📊 Raw benchmark data (gatsby install-cache-only)

Base times: 1.325s, 1.320s, 1.317s, 1.317s, 1.318s, 1.289s, 1.320s, 1.309s, 1.309s, 1.309s, 1.312s, 1.312s, 1.318s, 1.316s, 1.333s, 1.329s, 1.324s, 1.309s, 1.326s, 1.334s, 1.312s, 1.305s, 1.327s, 1.316s, 1.317s, 1.300s, 1.326s, 1.323s, 1.301s, 1.307s

Head times: 1.287s, 1.287s, 1.299s, 1.302s, 1.306s, 1.314s, 1.325s, 1.304s, 1.291s, 1.317s, 1.301s, 1.290s, 1.302s, 1.299s, 1.303s, 1.315s, 1.310s, 1.287s, 1.299s, 1.501s, 1.319s, 1.319s, 1.322s, 1.322s, 1.323s, 1.307s, 1.297s, 1.288s, 1.290s, 1.290s


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

Metric Base Head Difference
Mean 0.369s 0.372s +0.77% ⚠️
Median 0.368s 0.370s +0.78% ⚠️
Min 0.361s 0.359s
Max 0.389s 0.412s
Std Dev 0.006s 0.009s
📊 Raw benchmark data (gatsby install-cache-and-lock (warm, with lockfile))

Base times: 0.363s, 0.370s, 0.364s, 0.375s, 0.362s, 0.374s, 0.365s, 0.368s, 0.369s, 0.364s, 0.366s, 0.367s, 0.379s, 0.373s, 0.367s, 0.374s, 0.366s, 0.372s, 0.370s, 0.372s, 0.365s, 0.361s, 0.368s, 0.364s, 0.362s, 0.375s, 0.368s, 0.389s, 0.375s, 0.367s

Head times: 0.365s, 0.369s, 0.370s, 0.368s, 0.373s, 0.368s, 0.370s, 0.375s, 0.375s, 0.375s, 0.372s, 0.377s, 0.373s, 0.375s, 0.372s, 0.382s, 0.374s, 0.412s, 0.371s, 0.366s, 0.367s, 0.365s, 0.368s, 0.359s, 0.368s, 0.373s, 0.375s, 0.368s, 0.369s, 0.368s

This branch was successfully deployed

1 active deployment
test-reports — 4b71fd36 Deployed Oct 15, 2026 by arcanis via Reporting test results #1471
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