From 65f10d6967208f4128c48300657f147dd43af0d5 Mon Sep 17 00:00:00 2001 From: Kevin Date: Thu, 30 Nov 2023 11:22:57 +0100 Subject: [PATCH] fix (generator): let generated client import types using TypeScript's import type (#710) This PR fixes #707 by explicitly importing types using `import type` instead of just `import`. --- .changeset/tasty-lizards-boil.md | 5 +++++ generator/src/functions/writeSingleFileImportStatements.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/tasty-lizards-boil.md diff --git a/.changeset/tasty-lizards-boil.md b/.changeset/tasty-lizards-boil.md new file mode 100644 index 0000000000..b240579f46 --- /dev/null +++ b/.changeset/tasty-lizards-boil.md @@ -0,0 +1,5 @@ +--- +"@electric-sql/prisma-generator": patch +--- + +Import types using import type in generated Electric client. diff --git a/generator/src/functions/writeSingleFileImportStatements.ts b/generator/src/functions/writeSingleFileImportStatements.ts index fb054681ac..4b8a45893c 100644 --- a/generator/src/functions/writeSingleFileImportStatements.ts +++ b/generator/src/functions/writeSingleFileImportStatements.ts @@ -19,7 +19,7 @@ export const writeSingleFileImportStatements: WriteStatements = ( } writeImport( - `{ TableSchema, DbSchema, Relation, ElectricClient, HKT }`, + `{ type TableSchema, DbSchema, Relation, ElectricClient, type HKT }`, 'electric-sql/client/model' )