Commit graph

2 commits

Author SHA1 Message Date
DEls
c36eaeed51 fix(plant-hours-template): ESM-safe __dirname + freeze note
Two follow-up fixes from the Task 5 code-quality review:

- scripts/generate-plant-hours-template.ts uses
  fileURLToPath(import.meta.url) instead of __dirname. The
  project's tsconfig has module: esnext, so the moment the
  package flips to ESM the original would throw
  ReferenceError: __dirname is not defined.
- src/lib/plant-hours-template.ts documents that the frozen
  header row is a best-effort request — SheetJS Community
  Edition silently drops the !freeze property (only Pro emits
  frozen-pane XML). The function still produces the canonical
  13-column workbook, but the doc comment no longer claims a
  behaviour that doesn't happen.
2026-08-28 12:55:08 +02:00
DEls
1e212a7339 feat(plant-hours): template workbook generator + seed file
buildPlantHoursTemplateWorkbook() emits the canonical 13-column xlsx
with a frozen header row, typed cells (date/time/number), a sample
row using the supplied vehicle, and a Notes column widened for
readability. Used by both /api/plant-hours/template and the seed
script that writes RAW_DOCS/Plant_Hours_Template_2.xlsx.
2026-08-28 12:51:14 +02:00