fix(arborist): symlink workspace file: deps on non-workspace local packages#9591
Merged
owlstronaut merged 2 commits intoJun 22, 2026
Conversation
01bf576 to
a626b70
Compare
…ckages with linked strategy
a626b70 to
501235f
Compare
…ages with linked strategy
owlstronaut
approved these changes
Jun 22, 2026
Contributor
|
🎉 Backport to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In continuation of our exploration of using
install-strategy=linkedin the Gutenberg monorepo, which powers the WordPress Block Editor.With
install-strategy=linked, a workspace declaring afile:dependency on a local package that is not itself a workspace was silently skipped.npm installreportedup to date, created nonode_modulesentry, and the workspace could not resolve the dependency at runtime, all with no error or warning.This covered two variants: a target inside the repo root but outside the workspaces globs, and a target outside the repo root entirely (the real
npm --workspace=<ws> link <external>case).The cause is in
#assignCommonPropertiesinisolated-reifier.js, where each dependency is classified as local (symlinked directly) or external (extracted into.store).The check
n.isWorkspace || node.fsChildren?.has(n)only recognized file: targets viafsChildren, which exists on the root ideal tree but not on workspace nodes, and never contains targets outside the repo root.A workspace to workspace file: dep still worked because the target satisfies
n.isWorkspace, but a non-workspace or out-of-repo target failed both checks, was misclassified as external, and had no store entry, so#processDepsdropped it with no symlink.The fix detects a file: dependency from its edge: a file: dep surfaces as a Link edge whose resolved spec starts with
file:.Classifying those targets as local handles both variants uniformly, regardless of
fsChildrenmembership, and reuses the workspace proxy already created for the target inmakeIdealGraph.Only file: link edges and workspaces are treated as local, so no registry dependency can be misclassified.
References
Fixes #9589
Related #9115, #9166, #9210