Repository: Quramy/prisma-fabbrica (ts)

Issue:
verbatimModuleSyntax = true breaks a project that uses Fabbrica
**Describe the bug**
We enabled [verbatimModuleSyntax](https://www.typescriptlang.org/tsconfig#verbatimModuleSyntax) in our project, because we want to be more strict about our imports to prevent import elision and issues down the road with other tools (like SWC).

Since our generated fabbrica code lives in our source directory, we have the issue that `tsc` now complains about a type import that is not marked as a type import.

```
src/server/prisma/generated/fabbrica/index.ts:25:21 - error TS1484: 'ModelWithFields' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

25 import { getClient, ModelWithFields, createScreener, getScalarFieldValueGenerator, Resolver, normalizeResolver, normalizeList, getSequenceCounter, } from "@quramy/prisma-fabbrica/lib/internal";
                       ~~~~~~~~~~~~~~~

src/server/prisma/generated/fabbrica/index.ts:25:84 - error TS1484: 'Resolver' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled.

25 import { getClient, ModelWithFields, createScreener, getScalarFieldValueGenerator, Resolver, normalizeResolver, normalizeList, getSequenceCounter, } from "@quramy/prisma-fabbrica/lib/internal";
                                                                                      ~~~~~~~~
```

**To Reproduce**
Steps to reproduce the behavior:
1. Enable [verbatimModuleSyntax](https://www.typescriptlang.org/tsconfig#verbatimModuleSyntax) in your tsconfig.json
2. Run tsc

**Expected behavior**
A clear and concise description of what you expected to happen.

The import of `Resolver` and `ModelWithFields` should be marked as a"type" import or an option should be given that enables type imports in the generated code.

**Your Schema**
Not relevant.

**Environment (please complete the following information):**
- TypeScript version: 5.1.3

Pull request:
chore: Use explicit import type statement
Ir closes #293 

Patch:
diff --git a/examples/example-prj/src/__generated__/fabbrica/index.d.ts b/examples/example-prj/src/__generated__/fabbrica/index.d.ts
index 545d8d0..de0c7fa 100644
--- a/examples/example-prj/src/__generated__/fabbrica/index.d.ts
+++ b/examples/example-prj/src/__generated__/fabbrica/index.d.ts
@@ -2,8 +2,8 @@ import type { User } from "@prisma/client";
 import type { Post } from "@prisma/client";
 import type { Comment } from "@prisma/client";
 import type { Category } from "@prisma/client";
-import { Prisma } from "@prisma/client";
-import { Resolver } from "@quramy/prisma-fabbrica/lib/internal";
+import type { Prisma } from "@prisma/client";
+import type { Resolver } from "@quramy/prisma-fabbrica/lib/internal";
 export { resetSequence, registerScalarFieldValueGenerator, resetScalarFieldValueGenerator } from "@quramy/prisma-fabbrica/lib/internal";
 type BuildDataOptions = {
     readonly seq: number;
diff --git a/packages/prisma-fabbrica/src/templates/index.ts b/packages/prisma-fabbrica/src/templates/index.ts
index a48de6d..1cfa2b3 100644
--- a/packages/prisma-fabbrica/src/templates/index.ts
+++ b/packages/prisma-fabbrica/src/templates/index.ts
@@ -78,18 +78,19 @@ function extractFirstEnumValue(enums: readonly DMMF.SchemaEnum[], field: DMMF.Sc
 
 export const header = (prismaClientModuleSpecifier: string) =>
   template.sourceFile`
-    import { Prisma } from ${() => ast.stringLiteral(prismaClientModuleSpecifier)};
-    import type { PrismaClient } from ${() => ast.stringLiteral(prismaClientModuleSpecifier)};
+    import type { Prisma, PrismaClient } from ${() => ast.stringLiteral(prismaClientModuleSpecifier)};
     import {
       createInitializer,
-      ModelWithFields,
       createScreener,
       getScalarFieldValueGenerator,
-      Resolver,
       normalizeResolver,
       normalizeList,
       getSequenceCounter,
     } from "@quramy/prisma-fabbrica/lib/internal";
+    import type {
+      ModelWithFields,
+      Resolver,
+    } from "@quramy/prisma-fabbrica/lib/internal";
     export { resetSequence, registerScalarFieldValueGenerator, resetScalarFieldValueGenerator } from "@quramy/prisma-fabbrica/lib/internal";
   `();
 


Test patch:
diff --git a/packages/artifact-testing/fixtures/field-variation/__generated__/fabbrica/index.ts b/packages/artifact-testing/fixtures/field-variation/__generated__/fabbrica/index.ts
index 74fa05d..260d151 100644
--- a/packages/artifact-testing/fixtures/field-variation/__generated__/fabbrica/index.ts
+++ b/packages/artifact-testing/fixtures/field-variation/__generated__/fabbrica/index.ts
@@ -4,9 +4,9 @@ import type { FieldTypePatternModel } from "../client";
 import type { NoPkModel } from "../client";
 import type { Role } from "../client";
 import type { Status } from "../client";
-import { Prisma } from "../client";
-import type { PrismaClient } from "../client";
-import { createInitializer, ModelWithFields, createScreener, getScalarFieldValueGenerator, Resolver, normalizeResolver, normalizeList, getSequenceCounter, } from "@quramy/prisma-fabbrica/lib/internal";
+import type { Prisma, PrismaClient } from "../client";
+import { createInitializer, createScreener, getScalarFieldValueGenerator, normalizeResolver, normalizeList, getSequenceCounter, } from "@quramy/prisma-fabbrica/lib/internal";
+import type { ModelWithFields, Resolver, } from "@quramy/prisma-fabbrica/lib/internal";
 export { resetSequence, registerScalarFieldValueGenerator, resetScalarFieldValueGenerator } from "@quramy/prisma-fabbrica/lib/internal";
 
 type BuildDataOptions = {
diff --git a/packages/artifact-testing/fixtures/relations-many-to-many/__generated__/fabbrica/index.ts b/packages/artifact-testing/fixtures/relations-many-to-many/__generated__/fabbrica/index.ts
index 2042882..feb8dff 100644
--- a/packages/artifact-testing/fixtures/relations-many-to-many/__generated__/fabbrica/index.ts
+++ b/packages/artifact-testing/fixtures/relations-many-to-many/__generated__/fabbrica/index.ts
@@ -1,8 +1,8 @@
 import type { Post } from "../client";
 import type { Category } from "../client";
-import { Prisma } from "../client";
-import type { PrismaClient } from "../client";
-import { createInitializer, ModelWithFields, createScreener, getScalarFieldValueGenerator, Resolver, normalizeResolver, normalizeList, getSequenceCounter, } from "@quramy/prisma-fabbrica/lib/internal";
+import type { Prisma, PrismaClient } from "../client";
+import { createInitializer, createScreener, getScalarFieldValueGenerator, normalizeResolver, normalizeList, getSequenceCounter, } from "@quramy/prisma-fabbrica/lib/internal";
+import type { ModelWithFields, Resolver, } from "@quramy/prisma-fabbrica/lib/internal";
 export { resetSequence, registerScalarFieldValueGenerator, resetScalarFieldValueGenerator } from "@quramy/prisma-fabbrica/lib/internal";
 
 type BuildDataOptions = {
diff --git a/packages/artifact-testing/fixtures/relations-one-to-many/__generated__/fabbrica/index.ts b/packages/artifact-testing/fixtures/relations-one-to-many/__generated__/fabbrica/index.ts
index ae26243..b95d267 100644
--- a/packages/artifact-testing/fixtures/relations-one-to-many/__generated__/fabbrica/index.ts
+++ b/packages/artifact-testing/fixtures/relations-one-to-many/__generated__/fabbrica/index.ts
@@ -1,9 +1,9 @@
 import type { User } from "../client";
 import type { Post } from "../client";
 import type { Review } from "../client";
-import { Prisma } from "../client";
-import type { PrismaClient } from "../client";
-import { createInitializer, ModelWithFields, createScreener, getScalarFieldValueGenerator, Resolver, normalizeResolver, normalizeList, getSequenceCounter, } from "@quramy/prisma-fabbrica/lib/internal";
+import type { Prisma, PrismaClient } from "../client";
+import { createInitializer, createScreener, getScalarFieldValueGenerator, normalizeResolver, normalizeList, getSequenceCounter, } from "@quramy/prisma-fabbrica/lib/internal";
+import type { ModelWithFields, Resolver, } from "@quramy/prisma-fabbrica/lib/internal";
 export { resetSequence, registerScalarFieldValueGenerator, resetScalarFieldValueGenerator } from "@quramy/prisma-fabbrica/lib/internal";
 
 type BuildDataOptions = {
diff --git a/packages/artifact-testing/fixtures/relations-one-to-one/__generated__/fabbrica/index.ts b/packages/artifact-testing/fixtures/relations-one-to-one/__generated__/fabbrica/index.ts
index 044ca80..7af7038 100644
--- a/packages/artifact-testing/fixtures/relations-one-to-one/__generated__/fabbrica/index.ts
+++ b/packages/artifact-testing/fixtures/relations-one-to-one/__generated__/fabbrica/index.ts
@@ -1,8 +1,8 @@
 import type { User } from "../client";
 import type { Profile } from "../client";
-import { Prisma } from "../client";
-import type { PrismaClient } from "../client";
-import { createInitializer, ModelWithFields, createScreener, getScalarFieldValueGenerator, Resolver, normalizeResolver, normalizeList, getSequenceCounter, } from "@quramy/prisma-fabbrica/lib/internal";
+import type { Prisma, PrismaClient } from "../client";
+import { createInitializer, createScreener, getScalarFieldValueGenerator, normalizeResolver, normalizeList, getSequenceCounter, } from "@quramy/prisma-fabbrica/lib/internal";
+import type { ModelWithFields, Resolver, } from "@quramy/prisma-fabbrica/lib/internal";
 export { resetSequence, registerScalarFieldValueGenerator, resetScalarFieldValueGenerator } from "@quramy/prisma-fabbrica/lib/internal";
 
 type BuildDataOptions = {
diff --git a/packages/artifact-testing/fixtures/simple-model/__generated__/fabbrica/index.ts b/packages/artifact-testing/fixtures/simple-model/__generated__/fabbrica/index.ts
index 9e08528..538b6c9 100644
--- a/packages/artifact-testing/fixtures/simple-model/__generated__/fabbrica/index.ts
+++ b/packages/artifact-testing/fixtures/simple-model/__generated__/fabbrica/index.ts
@@ -1,7 +1,7 @@
 import type { User } from "../client";
-import { Prisma } from "../client";
-import type { PrismaClient } from "../client";
-import { createInitializer, ModelWithFields, createScreener, getScalarFieldValueGenerator, Resolver, normalizeResolver, normalizeList, getSequenceCounter, } from "@quramy/prisma-fabbrica/lib/internal";
+import type { Prisma, PrismaClient } from "../client";
+import { createInitializer, createScreener, getScalarFieldValueGenerator, normalizeResolver, normalizeList, getSequenceCounter, } from "@quramy/prisma-fabbrica/lib/internal";
+import type { ModelWithFields, Resolver, } from "@quramy/prisma-fabbrica/lib/internal";
 export { resetSequence, registerScalarFieldValueGenerator, resetScalarFieldValueGenerator } from "@quramy/prisma-fabbrica/lib/internal";
 
 type BuildDataOptions = {
diff --git a/packages/prisma-fabbrica/src/templates/__snapshots__/getSourceFile.test.ts.snap b/packages/prisma-fabbrica/src/templates/__snapshots__/getSourceFile.test.ts.snap
index 295f8b8..61eb449 100644
--- a/packages/prisma-fabbrica/src/templates/__snapshots__/getSourceFile.test.ts.snap
+++ b/packages/prisma-fabbrica/src/templates/__snapshots__/getSourceFile.test.ts.snap
@@ -2,9 +2,9 @@
 
 exports[`getSourceFile generates TypeScript AST 1`] = `
 "import type { User } from "@prisma/client";
-import { Prisma } from "@prisma/client";
-import type { PrismaClient } from "@prisma/client";
-import { createInitializer, ModelWithFields, createScreener, getScalarFieldValueGenerator, Resolver, normalizeResolver, normalizeList, getSequenceCounter, } from "@quramy/prisma-fabbrica/lib/internal";
+import type { Prisma, PrismaClient } from "@prisma/client";
+import { createInitializer, createScreener, getScalarFieldValueGenerator, normalizeResolver, normalizeList, getSequenceCounter, } from "@quramy/prisma-fabbrica/lib/internal";
+import type { ModelWithFields, Resolver, } from "@quramy/prisma-fabbrica/lib/internal";
 export { resetSequence, registerScalarFieldValueGenerator, resetScalarFieldValueGenerator } from "@quramy/prisma-fabbrica/lib/internal";
 
 type BuildDataOptions = {