Files
pnpm/pkg-manager
Victor Sumner 01a0bc9499 fix(core): decouple shouldRefreshResolution from canResolve in custom resolvers (#10593)
* fix(core): decouple shouldForceResolve from canResolve in custom resolvers

shouldForceResolve is now called for every package in the lockfile
without gating on canResolve, since it runs before resolution where
the original specifier is not available. Resolvers should handle their
own filtering within shouldForceResolve (e.g. by inspecting depPath
or pkgSnapshot.resolution).

* refactor: shouldForceResolve=>shouldRefreshResolution

* docs: remove changeset

We don't need a new changeset, we just updated the existing changeset

* refactor(core): use Promise.any for early exit in checkCustomResolverForceResolve

Replace Promise.all + .some(Boolean) with Promise.any so that the check
short-circuits as soon as any shouldRefreshResolution hook returns true,
instead of waiting for every hook to complete. Real errors thrown by hooks
are re-thrown instead of being silently swallowed.

* refactor(core): replace Promise.any with custom anyTrue helper

Handle sync boolean returns from shouldRefreshResolution without
creating unnecessary promises. Only async results go through the
anyTrue helper, which short-circuits on the first true value.

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2026-02-13 11:45:16 +01:00
..