You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] install-strategy=linked creates an unnecessary self-link inside every undeclared workspace's node_modules/ #9398
When installing a monorepo with --install-strategy=linked, every workspace that is not listed in the root package.json's dependencies / devDependencies / optionalDependencies gets a symlink to itself created inside its own node_modules/ directory, even though the workspace does not declare itself as a dependency.
For example, given a workspace packages/test whose package is named @namespace/test and which is not declared in the root manifest, the following symlink is created:
packages/test/node_modules/@namespace/test -> ..
This symlink is not pointed to by any edge in the dependency graph. It is created as a side effect of how the isolated reifier parks the workspace IsolatedLink node off-root when the workspace is undeclared.
Packages that need to resolve themselves by name rely on Node.js's built-in self-referencing via the exports field instead.
Expected Behavior
No self-link should be created inside an undeclared workspace's node_modules/. The on-disk layout should match the "After" example shown in #9076's description:
packages/a/node_modules/@scope/b -> packages/b # @scope/a depends on @scope/b
…with no extra packages/<ws>/node_modules/<ws> self-symlink.
Steps To Reproduce
Create a monorepo where the root does not list its workspaces as dependencies:
Activity
fix(arborist): do not materialize self-link for undeclared workspaces
fix(arborist): do not materialize self-link for undeclared workspaces
fix(arborist): do not materialize self-link for undeclared workspaces
fix(arborist): drop self-link materialization for undeclared workspac…
fix(reify): report added count for fresh linked installs (#9661)