Files
pnpm/lockfile
Eyal Mizrachi a4ea4e89d9 fix(lockfile.utils): gate file: synthesis on refIsLocalDirectory
Synthesizing `{ type: 'directory' }` resolution for any depPath starting
with `file:` was too wide — `file:./foo.tgz`, `file:./foo.tar.gz`, and
`file:./foo.tar` are local-tarball refs that reach a different code path
in pnpm. Misclassifying them as directories would route them through
local-package install code with a `directory` field they don't have on
disk.

Use the existing `refIsLocalDirectory` helper (which is `startsWith('file:')`
minus the local-tarball extensions) so the synthesis branch only fires for
true workspace-directory refs.

Also expands the JSDoc with the helper's usage contract: every iteration
site that touches `pkgSnapshot.resolution` directly or via a downstream
utility (`pkgSnapshotToResolution`, `convertPackageSnapshot`, etc.) must
route its raw `lockfile.packages[depPath]` entry through this helper first.
Downstream utilities assume their input is already normalized.

Regression test added for the three local-tarball extensions.
2026-05-15 05:26:50 -04:00
..
2026-05-11 19:56:10 +02:00
2026-05-11 19:56:10 +02:00
2026-05-14 13:31:53 +02:00
2026-05-11 19:56:10 +02:00
2026-05-14 13:31:53 +02:00
2026-05-11 19:56:10 +02:00
2026-05-14 13:31:53 +02:00
2026-05-14 13:31:53 +02:00
2026-05-11 19:56:10 +02:00
2026-05-14 13:31:53 +02:00
2026-05-11 19:56:10 +02:00