// Regenerates reports/*.report.json and manifests/*.video.manifest.json from // sweeps/*.md with today's converters. Run after a converter change, review the // diff, commit it: cd common && pnpm exec tsx testing/draft/regenerate.ts // fixtures.test.ts fails until the committed files match the converters. import { writeFile, mkdir } from "node:fs/promises"; import path from "node:path"; import { fileURLToPath } from "node:url"; import { DERIVED, deriveFixture } from "./derive"; const HERE = path.dirname(/* turbopackIgnore: true */ fileURLToPath(import.meta.url)); for (const name of DERIVED) { const { report, manifest } = await deriveFixture(name); await mkdir(/* turbopackIgnore: true */ path.join(/* turbopackIgnore: true */ HERE, "reports"), { recursive: true }); await mkdir(/* turbopackIgnore: true */ path.join(/* turbopackIgnore: true */ HERE, "manifests"), { recursive: true }); await writeFile(/* turbopackIgnore: true */ path.join(/* turbopackIgnore: true */ HERE, "reports", `${name}.report.json`), JSON.stringify(report, null, 2) + "\n"); await writeFile(/* turbopackIgnore: true */ path.join(/* turbopackIgnore: true */ HERE, "manifests", `${name}.video.manifest.json`), JSON.stringify(manifest, null, 2) + "\n"); console.log(`wrote ${name}`); }