Skip to content

fix(arborist): validate lockfile edges behind workspace links - #9985

Open
manzoorwanijk wants to merge 1 commit into
npm:latestfrom
manzoorwanijk:fix/workspace-lockfile-edge-validation
Open

manzoorwanijk wants to merge 1 commit into
npm:latestfrom
manzoorwanijk:fix/workspace-lockfile-edge-validation

Conversation

@manzoorwanijk

@manzoorwanijk manzoorwanijk commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

With a lockfile, npm install never repaired invalid or missing deps reached through a workspace, so --strict-peer-deps passed on a tree that npm ls reports as invalid.
#initTree scans the loaded tree through edge.to, and a workspace edge points at a Link, which has no edgesOut, so the scan stopped at every workspace.
The scan in build-ideal-tree.js now starts at the root target and walks into link targets inside the project, matching #resolveLinks, which also covers a symlinked project root.

Workspace-owned deps now behave like root-owned deps: a peer conflict left by --legacy-peer-deps fails with ERESOLVE unless that flag or --force is used.

References

Fixes #9977

@mpelikan

Copy link
Copy Markdown

#10013 fixes the related case where the workspace has no link yet (#10011). It touches the same walk in #initTree, but neither PR depends on the other, so whichever lands second needs a small rebase.

@manzoorwanijk
manzoorwanijk force-pushed the fix/workspace-lockfile-edge-validation branch from 4e96d6d to 86f2ca0 Compare October 5, 2026 05:55
manzoorwanijk added a commit to WordPress/gutenberg that referenced this pull request Oct 5, 2026
Root eslint@10 did not satisfy eslint-plugin-react, eslint-plugin-import and
eslint-plugin-jsx-a11y peer ranges, and type-fest@0.6.0 did not satisfy the
@pmmmwh/react-refresh-webpack-plugin peer range. npm install never repaired
these edges behind workspace links (npm/cli#9977), so strict-peer-deps passed.

Regenerated with npm/cli#9985.
manzoorwanijk added a commit to WordPress/gutenberg that referenced this pull request Oct 5, 2026
* Repair invalid peer dependencies in the lockfile

Root eslint@10 did not satisfy eslint-plugin-react, eslint-plugin-import and
eslint-plugin-jsx-a11y peer ranges, and type-fest@0.6.0 did not satisfy the
@pmmmwh/react-refresh-webpack-plugin peer range. npm install never repaired
these edges behind workspace links (npm/cli#9977), so strict-peer-deps passed.

Regenerated with npm/cli#9985.

* Keep ESLint 10 for plugins with outdated peer ranges

eslint-plugin-react, eslint-plugin-import and eslint-plugin-jsx-a11y cap
their eslint peer at v9, which made npm resolve a second eslint@9 for
every hoisted plugin. They already run on ESLint 10 through
fixupPluginRules, so override the peer instead.

Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
Co-authored-by: jsnajdr <jsnajdr@git.wordpress.org>
peterwilsoncc pushed a commit to peterwilsoncc/gutenberg-build that referenced this pull request Oct 5, 2026
* Repair invalid peer dependencies in the lockfile

Root eslint@10 did not satisfy eslint-plugin-react, eslint-plugin-import and
eslint-plugin-jsx-a11y peer ranges, and type-fest@0.6.0 did not satisfy the
@pmmmwh/react-refresh-webpack-plugin peer range. npm install never repaired
these edges behind workspace links (npm/cli#9977), so strict-peer-deps passed.

Regenerated with npm/cli#9985.

* Keep ESLint 10 for plugins with outdated peer ranges

eslint-plugin-react, eslint-plugin-import and eslint-plugin-jsx-a11y cap
their eslint peer at v9, which made npm resolve a second eslint@9 for
every hoisted plugin. They already run on ESLint 10 through
fixupPluginRules, so override the peer instead.

Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
Co-authored-by: jsnajdr <jsnajdr@git.wordpress.org>

Source: WordPress/gutenberg@b46b0c9
@manzoorwanijk
manzoorwanijk force-pushed the fix/workspace-lockfile-edge-validation branch from 86f2ca0 to a832276 Compare October 13, 2026 08:43
peterwilsoncc pushed a commit to peterwilsoncc/gutenberg-build that referenced this pull request Oct 14, 2026
* Repair invalid peer dependencies in the lockfile

Root eslint@10 did not satisfy eslint-plugin-react, eslint-plugin-import and
eslint-plugin-jsx-a11y peer ranges, and type-fest@0.6.0 did not satisfy the
@pmmmwh/react-refresh-webpack-plugin peer range. npm install never repaired
these edges behind workspace links (npm/cli#9977), so strict-peer-deps passed.

Regenerated with npm/cli#9985.

* Keep ESLint 10 for plugins with outdated peer ranges

eslint-plugin-react, eslint-plugin-import and eslint-plugin-jsx-a11y cap
their eslint peer at v9, which made npm resolve a second eslint@9 for
every hoisted plugin. They already run on ESLint 10 through
fixupPluginRules, so override the peer instead.

Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
Co-authored-by: jsnajdr <jsnajdr@git.wordpress.org>

Source: WordPress/gutenberg@b46b0c9
@manzoorwanijk
manzoorwanijk force-pushed the fix/workspace-lockfile-edge-validation branch 3 times, most recently from 450ae4e to ed4e4ec Compare October 16, 2026 06:54
@manzoorwanijk
manzoorwanijk force-pushed the fix/workspace-lockfile-edge-validation branch from ed4e4ec to 8247f2a Compare October 16, 2026 07:01
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.

[BUG] npm install does not repair invalid or missing lockfile deps behind a workspace, so strict-peer-deps passes

2 participants