Returns the on-disk cache path for projectRoot. The path embeds a SHA-1
tag of the absolute project root so projects that share a hoisted/symlinked
node_modules (pnpm workspaces, monorepos, integration test fixtures) write
to distinct files. 12 hex chars is far below collision risk for the scale of
"projects on one machine."
Reads the cached metafile. Returns null on miss or corruption.
Best-effort write; failures are swallowed because a cache miss on the next read just degrades to "run all tests."
Persistent on-disk cache of the most recent successful esbuild metafile,
used by --changed / --since to compute the reverse-dependency graph
without re-running esbuild. Lives under node_modules/.cache/ (npm convention,
gitignored, survives rm -rf tmp/).
-
esbuildCwd: string
process.cwd()at the moment the metafile was produced; metafile paths are relative to it. -
metafile: AffectedMetafile
The raw esbuild metafile this cache represents.
Usage
import * as mod from "lib/utils/metafile-cache.ts";