2026-08-28 10:51:14 +00:00
|
|
|
/**
|
|
|
|
|
* One-shot script: writes the canonical Plant_Hours_Template_2.xlsx
|
|
|
|
|
* to RAW_DOCS/. Run when the template layout changes — keep the
|
|
|
|
|
* seed file in sync with src/lib/plant-hours-template.ts.
|
|
|
|
|
*
|
|
|
|
|
* npx tsx scripts/generate-plant-hours-template.ts
|
|
|
|
|
*/
|
|
|
|
|
import * as fs from "node:fs";
|
|
|
|
|
import * as path from "node:path";
|
2026-08-28 10:55:08 +00:00
|
|
|
import { fileURLToPath } from "node:url";
|
2026-08-28 10:51:14 +00:00
|
|
|
import { buildPlantHoursTemplateWorkbook } from "../src/lib/plant-hours-template";
|
|
|
|
|
|
2026-08-28 10:55:08 +00:00
|
|
|
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
|
const out = path.resolve(here, "../RAW_DOCS/Plant_Hours_Template_2.xlsx");
|
2026-08-28 10:51:14 +00:00
|
|
|
const bytes = buildPlantHoursTemplateWorkbook();
|
|
|
|
|
fs.writeFileSync(out, bytes);
|
|
|
|
|
console.log(`Wrote ${out} (${bytes.byteLength} bytes)`);
|