Files
5b68320870 fix(overrides): measure a workspace: path in an override from the workspace (#17016)
`pnpm.overrides` is written once, at the workspace root, and applied to
every package that matches. `file:`, `link:` and bare-path values are
anchored at the root and rendered again for each package the override
rewrites. A `workspace:` path was not, so `workspace:./packages/target`
was measured from the consuming package. Without injection the install
left a dangling link; with `injectWorkspacePackages` it failed because
the directory does not exist.

The overrider now claims a value starting with `workspace:.`, the only
`workspace:` shape the resolver reads as a path, and renders it relative
to each package with a leading `./`, so it keeps reaching the local
resolver under the `workspace:` protocol. A manifest with no directory
keeps the value as declared, because an absolute `workspace:/...` would
be read as a version range.

An override in a file listed under `include` has its `workspace:` path
rebased from that file to the workspace root, as `file:` and `link:`
values are.

Present in both pnpm v11 and v12, so fixed in both.

Closes pnpm/pnpm#17010

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 19:26:05 +02:00
..