diff --git a/README.md b/README.md index e563072..6d5d2ce 100644 --- a/README.md +++ b/README.md @@ -210,7 +210,7 @@ Glint adds per-file overhead (TS program build, module rewrite, TypeChecker call ### Caching -Glint results are content-addressed and cached on disk under `node_modules/.cache/html-validate-ember/glint/`. Set `HVE_NO_CACHE=1` to bypass the cache. +Glint results, the transform output and (for `validate-gts`) the report of each file are cached on disk under `node_modules/.cache/html-validate-ember/`. An entry is keyed on the file's content plus the content of every project file it imports, transitively (through relative paths and tsconfig `paths`), the project's ambient `.d.ts` files, the lockfile, the tsconfig and the plugin — so editing an imported component invalidates its consumers. Set `HVE_NO_CACHE=1` to bypass the caches. ## Silencing rules diff --git a/lib/backend/ts6.ts b/lib/backend/ts6.ts index 4dd0669..5cc3c18 100644 --- a/lib/backend/ts6.ts +++ b/lib/backend/ts6.ts @@ -9,7 +9,7 @@ import { createRequire } from 'node:module'; import type * as TS from 'typescript'; import { isComponentTag } from '../../blank.js'; -import { readCache, writeCache } from '../cache.js'; +import { cacheDependencies, readCache, writeCache } from '../cache.js'; import type { OpenedFile, PreloadProgress, @@ -479,7 +479,8 @@ export function createTs6Backend(deps: Ts6Deps, tsconfigPath: string): TypeBacke } // If a cached extraction exists for this file, skip the rewrite — // we'll never need its rewritten contents in the program. - if (readCache(filename, contents, tsconfigPath, 'ts6')) { + const dependencies = cacheDependencies(filename, contents, tsconfigPath); + if (readCache(filename, contents, tsconfigPath, 'ts6', dependencies)) { cached++; onProgress?.({ done, total: filenames.length, phase: 'rewrite' }); continue; @@ -503,11 +504,14 @@ export function createTs6Backend(deps: Ts6Deps, tsconfigPath: string): TypeBacke // `