MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / inputFingerprint

Function inputFingerprint

__tests__/global-setup-dist.ts:24–35  ·  view source on GitHub ↗
(root: string, part: BuildPart)

Source from the content-addressed store, hash-verified

22}
23
24function inputFingerprint(root: string, part: BuildPart): string {
25 const inputs = [
26 'package.json', 'package-lock.json', 'scripts', '__tests__/global-setup-dist.ts',
27 ...fs.readdirSync(root).filter(name => /^tsconfig.*\.json$/.test(name)),
28 part === 'engine' ? 'src' : 'ui',
29 ];
30 const hash = createHash('sha256');
31 for (const file of inputs.flatMap(input => filesUnder(root, input)).sort()) {
32 hash.update(file).update('\0').update(fs.readFileSync(path.join(root, file))).update('\0');
33 }
34 return hash.digest('hex');
35}
36
37function outputSnapshot(root: string, part: BuildPart): Record<string, string> {
38 const directory = part === 'engine' ? 'dist' : 'dist/viewer';

Callers 1

ensureTestDistFunction · 0.85

Calls 3

filesUnderFunction · 0.85
updateMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected