diff --git a/package.json b/package.json index 182ce94..8374bb4 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "deploy-frontend": "vercel --cwd apps/frontend --prod --yes", "eval:run": "pnpm --dir apps/eval run run", "eval:review": "pnpm --dir apps/eval run review", + "eval:sync": "node scripts/sync-report.mjs", "eval:typecheck": "pnpm --dir apps/eval run typecheck" }, "license": "ISC", diff --git a/scripts/sync-report.mjs b/scripts/sync-report.mjs new file mode 100644 index 0000000..9e88818 --- /dev/null +++ b/scripts/sync-report.mjs @@ -0,0 +1,18 @@ +import { copyFileSync, existsSync, mkdirSync } from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..'); +const src = path.join(root, 'apps', 'eval', 'out', 'report.json'); +const destDir = path.join(root, 'apps', 'web', 'static'); +const dest = path.join(destDir, 'report.json'); + +if (!existsSync(src)) { + console.error(`[sync-report] Not found: ${src}`); + console.error('Run the eval first (pnpm eval:run / eval:review) to produce an out/report.json.'); + process.exit(1); +} + +mkdirSync(destDir, { recursive: true }); +copyFileSync(src, dest); +console.log(`[sync-report] ${path.relative(root, src)} -> ${path.relative(root, dest)}`);