feat(import): harden workbook parser boundaries
This commit is contained in:
@@ -2,14 +2,18 @@
|
||||
* Generate samples/CapaKrakenExamples.xlsx from the live database.
|
||||
*
|
||||
* Run from repo root:
|
||||
* DATABASE_URL=postgresql://capakraken:capakraken_dev@localhost:5433/capakraken \
|
||||
* pnpm --filter @capakraken/db tsx src/generate-excel.ts
|
||||
* pnpm --filter @capakraken/db db:excel
|
||||
*/
|
||||
|
||||
import { PrismaClient } from "@prisma/client";
|
||||
import ExcelJS from "exceljs";
|
||||
import path from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import { loadWorkspaceEnv } from "./load-workspace-env.js";
|
||||
import { assertCapaKrakenDbTarget } from "./safe-destructive-env.js";
|
||||
|
||||
loadWorkspaceEnv();
|
||||
assertCapaKrakenDbTarget("db:excel");
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
@@ -2,6 +2,7 @@ import { fileURLToPath, pathToFileURL } from "node:url";
|
||||
import { resolve } from "node:path";
|
||||
import { PrismaClient, StagedRecordStatus } from "@prisma/client";
|
||||
import { loadWorkspaceEnv, resolveWorkspacePath } from "./load-workspace-env.js";
|
||||
import { assertCapaKrakenDbTarget } from "./safe-destructive-env.js";
|
||||
|
||||
loadWorkspaceEnv();
|
||||
|
||||
@@ -378,6 +379,7 @@ function ensureCommitAllowed(options: ImportDispoBatchOptions, readiness: DispoI
|
||||
}
|
||||
|
||||
export async function runImportDispoBatch(options: ImportDispoBatchOptions) {
|
||||
assertCapaKrakenDbTarget("db:import:dispo");
|
||||
const dispoImport = await loadDispoImportModule();
|
||||
|
||||
printWorkbookSources(options);
|
||||
|
||||
Reference in New Issue
Block a user