(root: string, part: BuildPart)
| 22 | } |
| 23 | |
| 24 | function 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 | |
| 37 | function outputSnapshot(root: string, part: BuildPart): Record<string, string> { |
| 38 | const directory = part === 'engine' ? 'dist' : 'dist/viewer'; |
no test coverage detected