Files
pnpm/.changeset/cache-path-command.md
Zoltan Kochan 49ea66c385 feat: add pnpm cache path and keep the lockfile verification log on store prune (#13893)
Two changes that let a CI job reuse a past lockfile verification.

`pnpm store prune` kept deleting `lockfile-verified.jsonl` in the TypeScript
CLI, for a cosmetic reason: a record written under a different policy or
lockfile looked like an alien file in `cacheDir`. It is not one — the record is
keyed on the lockfile content and the policy snapshot, and a stale one is
simply never trusted. Deleting it costs the next install a full
re-verification against the registry, which is the dominant cost of an install
in CI: 16.6s of a 17.6s install on Linux and 40.1s of 42.4s on Windows in
typescript-eslint's repository. The Rust CLI already kept it.

`pnpm cache path` prints the resolved cache directory, mirroring `pnpm store
path`. pnpm derives that directory from the platform and the `cacheDir`
setting and never reported it, so callers that want to cache or inspect it —
`pnpm/setup` and `pnpm/action-setup` among them — had to mirror the resolution
by hand. Both stacks print it absolute and lexically cleaned, so a relative
`cacheDir` yields a path other tools can consume; symlinks are left alone so
macOS does not print a path that differs from the configuration.
2026-08-14 16:04:32 +02:00

348 B

@pnpm/cache.commands, pacquet, pnpm
@pnpm/cache.commands pacquet pnpm
minor minor minor

Added pnpm cache path, which prints the directory pnpm uses for its metadata cache. CI setups can use it to cache that directory — including the lockfile verification log, which lets a job skip re-checking an unchanged lockfile against the configured supply-chain policies.