Kaizen
Browse modulesInsightsinsights/serverSchemas and constants

Variable: XLSX\_MIME\_TYPE

const XLSX_MIME_TYPE: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";

Defined in: server/insights/export/xlsx.ts:30

XLSX export through an injected writer port.

taproot does not depend on exceljs. The workbook writer is a structural port (XlsxWorkbookPort) describing exactly the four things this file uses — addWorksheet, a worksheet's columns, addRow, and xlsx.writeBuffer(). An exceljs Workbook satisfies it as-is, so a consumer has two options:

  1. Install exceljs in their own app and pass nothing — createExcelJsWorkbook lazily import()s it at call time. The specifier is computed at runtime, so neither TypeScript nor the bundler resolves exceljs at build time and the package stays optional.
  2. Supply their own writer — any object matching the port (a different library, a stub, an in-house streaming writer).

If neither is true, XlsxWriterUnavailableError explains both options instead of surfacing a raw module-resolution failure.

Money cells are written as exact decimal strings (see cell-format.ts): converting minor units to a major-unit JS number means dividing by 10 ** scale, and values like 1234.56 have no exact binary representation. number/boolean columns keep their native types.