Files
hermes-agent/apps/desktop/scripts/compiler-cache.d.mts
kshitijk4poor d2cbfcf7db test(desktop): the React Compiler cache is its own module with focused tests
The cache lived inline in vite.config.ts, and the renderer builder tests use a bare fixture
config, so nothing exercised it: a broken warm path would still pass every test.

Move it to scripts/compiler-cache.mjs (behaviour unchanged; toolchain files and cache root are
now parameters, and an existing closeBundle hook is chained instead of replaced) and test hit
vs fresh output, toolchain/NODE_ENV generations, corrupt entries, pruning, incremental (watch)
rebuilds and the dev-server bypass. A cold and warm production build of the real app stay
byte-identical. Reported by Greptile on #135092.
2026-10-08 15:20:58 -07:00

11 lines
266 B
TypeScript

export function withCompilerCache<P extends { transform: { handler: (...args: any[]) => unknown } }>(
plugin: P,
options: {
command: string
cacheRoot: string
base: string
toolchain: string[]
env?: Record<string, string | undefined>
},
): P