fix: add .js extension to schema-sql imports for ESM compatibility (#15)

This commit is contained in:
Daniel Volz
2026-01-02 15:41:58 +01:00
committed by GitHub
parent 1a1931fd92
commit f41f6df558
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ import { drizzle } from "drizzle-orm/libsql";
import { existsSync, mkdirSync, accessSync, constants, statSync, writeFileSync } from "fs";
import { resolve } from "path";
import dotenv from "dotenv";
import { getTableCreationSQL } from "./schema-sql";
import { getTableCreationSQL } from "./schema-sql.js";
dotenv.config({ path: process.env.DOTENV_PATH || ".env" });
@@ -45,7 +45,7 @@ export function ensureDataDirectory(dataDir: string): { success: boolean; error?
}
/** Get the SQL statements for creating all tables (re-exported from schema-sql) */
export { getTableCreationSQL } from "./schema-sql";
export { getTableCreationSQL } from "./schema-sql.js";
/** Run table creation migrations on a client */
export async function runTableMigrations(client: Client): Promise<{ success: boolean; errors: string[] }> {
+1 -1
View File
@@ -2,7 +2,7 @@ import { createClient, Client } from "@libsql/client";
import dotenv from "dotenv";
import fs from "fs";
import path from "path";
import { getTableCreationSQL } from "./schema-sql";
import { getTableCreationSQL } from "./schema-sql.js";
dotenv.config({ path: process.env.DOTENV_PATH || ".env" });
+1 -1
View File
@@ -10,7 +10,7 @@ import fastifyMultipart from "@fastify/multipart";
import { createClient, Client } from "@libsql/client";
import { drizzle } from "drizzle-orm/libsql";
import { beforeAll, afterAll, beforeEach } from "vitest";
import { getTableCreationSQL } from "../db/schema-sql";
import { getTableCreationSQL } from "../db/schema-sql.js";
// Type for our test database
export type TestDb = ReturnType<typeof drizzle>;