feat(web): switch to implementation-first capability wave
This commit is contained in:
26
tools/web/refresh-wbv2-implementation-hashes.mjs
Normal file
26
tools/web/refresh-wbv2-implementation-hashes.mjs
Normal file
@@ -0,0 +1,26 @@
|
||||
import crypto from "node:crypto";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
|
||||
const ids = ["WBV2-P24-003", "WBV2-P25-000", "WBV2-P25-001", "WBV2-P25-002", "WBV2-P25-003", "WBV2-P25-004", "WBV2-P25-005", "WBV2-P25-006", "WBV2-P25-007", "WBV2-P25-008", "WBV2-P26-000", "WBV2-P26-001", "WBV2-P26-002", "WBV2-P26-003", "WBV2-P26-004", "WBV2-P26-005", "WBV2-P26-006", "WBV2-P27-000", "WBV2-P27-001"];
|
||||
const abs = (file) => path.join(root, file);
|
||||
const sha = (file) => crypto.createHash("sha256").update(fs.readFileSync(abs(file))).digest("hex");
|
||||
for (let pass = 0; pass < ids.length; pass += 1) {
|
||||
let changed = false;
|
||||
for (const id of ids) {
|
||||
const file = `tests/golden/${id}/manifest.json`;
|
||||
if (!fs.existsSync(abs(file))) continue;
|
||||
const manifest = JSON.parse(fs.readFileSync(abs(file), "utf8"));
|
||||
for (const artifact of Object.values(manifest.artifacts ?? {})) {
|
||||
if (artifact?.path && fs.existsSync(abs(artifact.path))) {
|
||||
const current = sha(artifact.path);
|
||||
if (artifact.sha256 !== current) { artifact.sha256 = current; changed = true; }
|
||||
}
|
||||
}
|
||||
fs.writeFileSync(abs(file), `${JSON.stringify(manifest, null, 2)}\n`);
|
||||
}
|
||||
if (!changed) break;
|
||||
}
|
||||
console.log(`wbv2-implementation-hashes-refreshed tasks=${ids.length}`);
|
||||
Reference in New Issue
Block a user