Fix TypeScript compilation issues in packages

- Add explicit type annotations for isolatedDeclarations
- Export Database type alias from db-schema
- Fix import paths and add proper type exports
- Update common schemas with better exports

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
RevIQ
2026-01-09 11:46:11 +08:00
parent aee22ae454
commit 5eeef44850
7 changed files with 81 additions and 69 deletions

View File

@@ -4,8 +4,8 @@
* @module @reviq/db
*/
import { Kysely, PostgresDialect } from "kysely";
import type { Database } from "@reviq/db-schema";
import { Kysely, PostgresDialect } from "kysely";
import pg from "pg";
const { Pool } = pg;
@@ -17,11 +17,11 @@ const { Pool } = pg;
* @returns Kysely database instance
*/
export const createDb = (
connectionString: string = process.env.DATABASE_URL || ""
connectionString: string = process.env.DATABASE_URL || "",
): Kysely<Database> => {
if (!connectionString) {
throw new Error(
"Database connection string is required. Set DATABASE_URL environment variable."
"Database connection string is required. Set DATABASE_URL environment variable.",
);
}