Skip to content

[pull] latest from npm:latest#225

Merged
pull[bot] merged 1 commit into
LadyK-21:latestfrom
npm:latest
Jun 26, 2026
Merged

[pull] latest from npm:latest#225
pull[bot] merged 1 commit into
LadyK-21:latestfrom
npm:latest

Conversation

@pull

@pull pull Bot commented Jun 26, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

#9657)

In continuation of our exploration of using `install-strategy=linked` in
the [Gutenberg
monorepo](WordPress/gutenberg#75814), which
powers the WordPress Block Editor.

Under `install-strategy=linked`, a declared workspace that the root does
not depend on is installed on disk but was invisible to `npm ls --all`,
`npm ls --workspaces`, and `npm query ':root > *'`, all of which
reported an empty tree. The hoisted strategy lists every workspace.

Undeclared workspaces are intentionally not symlinked into the root
`node_modules` under the linked strategy, so when `loadActual` rebuilds
the actual tree (from the filesystem scan or the hidden lockfile,
neither of which records a `node_modules/<ws>` entry) the root's
`workspace` edges resolve to nothing and the workspaces drop out of the
tree that `ls` and `query` traverse. `npm ls` then hid those missing
edges entirely to avoid a false `UNMET DEPENDENCY`.

The fix adds `loadActual` post-processing that, for the linked strategy,
synthesizes an in-memory `Link` at `node_modules/<ws>` for each
undeclared workspace so its root edge resolves, matching the logical
layout the regular `package-lock.json` already records. This is
introspection-only and writes nothing to disk. A declared workspace
whose root link is genuinely missing is left alone so it still reports
`UNMET`, an existing root child of the same name is never replaced, and
a workspace that was not loaded is skipped. With the edges now
resolving, the workspace-skip branch that `npm ls` used to suppress them
is removed.

## References

Fixes #9618
@pull pull Bot locked and limited conversation to collaborators Jun 26, 2026
@pull pull Bot added the ⤵️ pull label Jun 26, 2026
@pull pull Bot merged commit ae6dbeb into LadyK-21:latest Jun 26, 2026
7 of 11 checks passed
@LadyK-21

Copy link
Copy Markdown
Owner

⚠️ Snyk checks are incomplete.

Status Scan Engine Critical High Medium Low Total (2)
⚠️ Open Source Security 1 1 0 0 See details

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants