MCPcopy Create free account
hub / github.com/adobe/react-spectrum / harnessHash

Function harnessHash

perf/build.mjs:41–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39}
40
41export async function harnessHash() {
42 let files = [
43 ...(await filesIn(path.join(root, 'perf/app'))),
44 ...[
45 '.parcelrc',
46 'package.json',
47 'scenarios.mjs',
48 'drivers.mjs',
49 'trace.mjs',
50 'confirm.mjs',
51 'runner.mjs',
52 'report.mjs',
53 'build.mjs',
54 'cli.mjs'
55 ].map(name => path.join(root, 'perf', name))
56 ];
57 return hash(
58 Buffer.concat(
59 await Promise.all(
60 files.map(async file =>
61 Buffer.concat([Buffer.from(path.relative(root, file)), await fs.readFile(file)])
62 )
63 )
64 )
65 );
66}
67
68async function artifactHash(dir) {
69 let files = (await filesIn(dir)).filter(file => path.basename(file) !== 'manifest.json');

Callers 3

confirm.test.mjsFile · 0.90
buildFunction · 0.85
loadBuildFunction · 0.85

Calls 2

filesInFunction · 0.85
hashFunction · 0.70

Tested by

no test coverage detected