From 28085b5a437ab1ef1714ee2bf86faec1d7ee44b2 Mon Sep 17 00:00:00 2001 From: Ajay Ghanwat Date: Tue, 18 Aug 2026 19:17:02 +0530 Subject: [PATCH] chore(db,scripts): pending migration and packaging tweaks Pre-existing working-tree changes to migration SQL parsing, query generation, and the packaging scripts. Committed as-is rather than authored here. Co-Authored-By: Claude Opus 5 --- packages/db/src/generate.ts | 4 +--- packages/db/src/migrate.ts | 7 ++++--- scripts/lib/package-integrity.ts | 3 ++- scripts/publish-packages.ts | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/db/src/generate.ts b/packages/db/src/generate.ts index a14f29fb..5634e85e 100644 --- a/packages/db/src/generate.ts +++ b/packages/db/src/generate.ts @@ -226,9 +226,7 @@ export function generateQueriesFile( ); } - const imports = [ - `import type { Db${usesExecResult ? ", ExecResult" : ""} } from "@wrnexus/db";`, - ]; + const imports = [`import type { Db${usesExecResult ? ", ExecResult" : ""} } from "@wrnexus/db";`]; if (usedModels.size > 0) { imports.push(`import { ${[...usedModels].sort().join(", ")} } from "./schema.ts";`); } diff --git a/packages/db/src/migrate.ts b/packages/db/src/migrate.ts index 23130937..aff7c0ee 100644 --- a/packages/db/src/migrate.ts +++ b/packages/db/src/migrate.ts @@ -91,9 +91,10 @@ function additiveColumnTarget(sql: string): { table: string; column: string } | .replace(/\/\*[\s\S]*?\*\//g, " ") .replace(/--[^\r\n]*/g, " ") .trim(); - const match = /^ALTER\s+TABLE\s+([A-Za-z_][A-Za-z0-9_]*)\s+ADD\s+COLUMN\s+([A-Za-z_][A-Za-z0-9_]*)\b[\s\S]*;?\s*$/i.exec( - executable, - ); + const match = + /^ALTER\s+TABLE\s+([A-Za-z_][A-Za-z0-9_]*)\s+ADD\s+COLUMN\s+([A-Za-z_][A-Za-z0-9_]*)\b[\s\S]*;?\s*$/i.exec( + executable, + ); return match ? { table: match[1]!, column: match[2]! } : undefined; } diff --git a/scripts/lib/package-integrity.ts b/scripts/lib/package-integrity.ts index 935be270..66c67c61 100644 --- a/scripts/lib/package-integrity.ts +++ b/scripts/lib/package-integrity.ts @@ -48,7 +48,8 @@ export function validateStagedManifest(stage: string, manifest: Record` (or set // WRNEXUS_NPM_ACCESS=public to stage public manifests). Requires the `wrnexus`