From 6fe5d929e967a63d66c43fab91f3cd7b5222bb89 Mon Sep 17 00:00:00 2001 From: "Visal .In" Date: Tue, 16 Apr 2024 08:01:01 +0700 Subject: [PATCH] fixing monorepo deployment --- gui/package.json | 5 +++++ gui/src/driver.ts | 9 +++++++++ gui/src/index.tsx | 9 --------- gui/tsup.config.ts | 2 +- studio/next.config.js | 1 + studio/src/drivers/collaboration-driver.ts | 2 +- studio/src/drivers/remote-driver.ts | 2 +- studio/src/drivers/rqlite-driver.ts | 2 +- studio/src/drivers/turso-driver.tsx | 2 +- studio/src/drivers/valtown-driver.ts | 5 ++++- studio/src/lib/api-response-types.ts | 2 +- studio/src/lib/api/api-request-types.ts | 2 +- 12 files changed, 26 insertions(+), 17 deletions(-) create mode 100644 gui/src/driver.ts diff --git a/gui/package.json b/gui/package.json index 90a478bd..f3b7882a 100644 --- a/gui/package.json +++ b/gui/package.json @@ -9,6 +9,11 @@ "import": "./dist/index.js", "require": "./dist/index.cjs" }, + "./driver": { + "types": "./dist/driver.d.ts", + "import": "./dist/driver.js", + "require": "./dist/driver.cjs" + }, "./css": "./dist/index.css" }, "scripts": { diff --git a/gui/src/driver.ts b/gui/src/driver.ts new file mode 100644 index 00000000..f28cfc21 --- /dev/null +++ b/gui/src/driver.ts @@ -0,0 +1,9 @@ +export * from "./drivers/base-driver"; +export { CollaborationDriver } from "./drivers/collaboration-driver"; +export { SqliteLikeBaseDriver } from "./drivers/sqlite-base-driver"; +export { + convertSqliteType, + escapeIdentity, + escapeSqlValue, +} from "./sqlite/sql-helper"; +export { default as parseSafeJson } from "./lib/json-safe"; diff --git a/gui/src/index.tsx b/gui/src/index.tsx index 018d8503..62413600 100644 --- a/gui/src/index.tsx +++ b/gui/src/index.tsx @@ -1,10 +1 @@ export { Studio } from "./studio"; -export * from "./drivers/base-driver"; -export { CollaborationDriver } from "./drivers/collaboration-driver"; -export { SqliteLikeBaseDriver } from "./drivers/sqlite-base-driver"; -export { - convertSqliteType, - escapeIdentity, - escapeSqlValue, -} from "./sqlite/sql-helper"; -export { default as parseSafeJson } from "./lib/json-safe"; diff --git a/gui/tsup.config.ts b/gui/tsup.config.ts index 4fc99f41..a0d75e32 100644 --- a/gui/tsup.config.ts +++ b/gui/tsup.config.ts @@ -1,7 +1,7 @@ import { defineConfig } from "tsup"; export default defineConfig((opts) => ({ - entry: ["src/index.tsx"], + entry: ["src/index.tsx", "src/driver.ts"], format: ["esm", "cjs"], splitting: true, sourcemap: true, diff --git a/studio/next.config.js b/studio/next.config.js index c6f6e2cc..7eb51db9 100644 --- a/studio/next.config.js +++ b/studio/next.config.js @@ -5,6 +5,7 @@ const nextConfig = { experimental: { turbo: { resolveAlias: { + "@libsqlstudio/gui/driver": "../gui/src/driver.ts", "@libsqlstudio/gui": "../gui/src/index.tsx", }, }, diff --git a/studio/src/drivers/collaboration-driver.ts b/studio/src/drivers/collaboration-driver.ts index 223774f4..860ea3bf 100644 --- a/studio/src/drivers/collaboration-driver.ts +++ b/studio/src/drivers/collaboration-driver.ts @@ -5,7 +5,7 @@ import { ApiUserListResponse, ApiUserRole, } from "@studio/lib/api/api-database-response"; -import { CollaborationDriver } from "@libsqlstudio/gui"; +import { CollaborationDriver } from "@libsqlstudio/gui/driver"; export default class Collaborator implements CollaborationDriver { protected id: string = ""; diff --git a/studio/src/drivers/remote-driver.ts b/studio/src/drivers/remote-driver.ts index 0f11ae72..cbf60117 100644 --- a/studio/src/drivers/remote-driver.ts +++ b/studio/src/drivers/remote-driver.ts @@ -8,7 +8,7 @@ import { DatabaseTableSchema, DatabaseTriggerSchema, SelectFromTableOptions, -} from "@libsqlstudio/gui"; +} from "@libsqlstudio/gui/driver"; import { ApiOpsBatchResponse, ApiOpsQueryResponse, diff --git a/studio/src/drivers/rqlite-driver.ts b/studio/src/drivers/rqlite-driver.ts index f9bd90b0..6a8aa9d3 100644 --- a/studio/src/drivers/rqlite-driver.ts +++ b/studio/src/drivers/rqlite-driver.ts @@ -5,7 +5,7 @@ import { DatabaseResultSet, DatabaseRow, convertSqliteType, -} from "@libsqlstudio/gui"; +} from "@libsqlstudio/gui/driver"; interface RqliteResult { columns?: string[]; diff --git a/studio/src/drivers/turso-driver.tsx b/studio/src/drivers/turso-driver.tsx index 790601d6..66da7652 100644 --- a/studio/src/drivers/turso-driver.tsx +++ b/studio/src/drivers/turso-driver.tsx @@ -10,7 +10,7 @@ import { DatabaseResultSet, DatabaseRow, convertSqliteType, -} from "@libsqlstudio/gui"; +} from "@libsqlstudio/gui/driver"; export function transformRawResult(raw: ResultSet): DatabaseResultSet { const headerSet = new Set(); diff --git a/studio/src/drivers/valtown-driver.ts b/studio/src/drivers/valtown-driver.ts index c30306bb..0363de9a 100644 --- a/studio/src/drivers/valtown-driver.ts +++ b/studio/src/drivers/valtown-driver.ts @@ -1,6 +1,9 @@ import { InStatement, ResultSet } from "@libsql/client"; import { transformRawResult } from "./turso-driver"; -import { DatabaseResultSet, SqliteLikeBaseDriver } from "@libsqlstudio/gui"; +import { + DatabaseResultSet, + SqliteLikeBaseDriver, +} from "@libsqlstudio/gui/driver"; export default class ValtownDriver extends SqliteLikeBaseDriver { protected token: string; diff --git a/studio/src/lib/api-response-types.ts b/studio/src/lib/api-response-types.ts index 7d005633..de7af044 100644 --- a/studio/src/lib/api-response-types.ts +++ b/studio/src/lib/api-response-types.ts @@ -5,7 +5,7 @@ import { DatabaseSchemaItem, DatabaseTableSchema, DatabaseTriggerSchema, -} from "@libsqlstudio/gui"; +} from "@libsqlstudio/gui/driver"; export interface ApiOpsBatchResponse { error?: string; diff --git a/studio/src/lib/api/api-request-types.ts b/studio/src/lib/api/api-request-types.ts index dcfb4517..23978bb1 100644 --- a/studio/src/lib/api/api-request-types.ts +++ b/studio/src/lib/api/api-request-types.ts @@ -1,7 +1,7 @@ import { DatabaseTableOperation, SelectFromTableOptions, -} from "@libsqlstudio/gui"; +} from "@libsqlstudio/gui/driver"; import { InStatement } from "@libsql/client/web"; export interface RequestOperationBatch {