Repository: Quramy/prisma-fabbrica (ts)

Issue:
TypeScript error when exporting defined factories: symbol factoryFor cannot be named
After the change to make `factoryFor` a private symbol, exporting a generated factory results in a type error: 

`Exported variable 'FooFactory' has or is using name 'factoryFor' from external module "test/factories/fabbrica/index" but cannot be named.`

The error occurs on this line:
 
```typescript
export const FooFactory = defineFooFactory();
```


Pull request description:
fix: TypeScript error caused by internal symbol
## What 

It fixes #281 via reverting #250 .


Patch:
diff --git a/examples/example-prj/src/__generated__/fabbrica/index.d.ts b/examples/example-prj/src/__generated__/fabbrica/index.d.ts
index 7d39807..545d8d0 100644
--- a/examples/example-prj/src/__generated__/fabbrica/index.d.ts
+++ b/examples/example-prj/src/__generated__/fabbrica/index.d.ts
@@ -9,7 +9,6 @@ type BuildDataOptions = {
     readonly seq: number;
 };
 export declare const initialize: (options: import("@quramy/prisma-fabbrica/lib/initialize").InitializeOptions) => void;
-declare const factoryFor: unique symbol;
 type UserFactoryDefineInput = {
     id?: string;
     email?: string;
@@ -29,7 +28,7 @@ type UserFactoryDefineOptions = {
 };
 type UserTraitKeys<TOptions extends UserFactoryDefineOptions> = keyof TOptions["traits"];
 export interface UserFactoryInterfaceWithoutTraits {
-    readonly [factoryFor]: "User";
+    readonly _factoryFor: "User";
     build(inputData?: Partial<Prisma.UserCreateInput>): PromiseLike<Prisma.UserCreateInput>;
     buildCreateInput(inputData?: Partial<Prisma.UserCreateInput>): PromiseLike<Prisma.UserCreateInput>;
     buildList(inputData: number | readonly Partial<Prisma.UserCreateInput>[]): PromiseLike<Prisma.UserCreateInput[]>;
@@ -49,7 +48,7 @@ export interface UserFactoryInterface<TOptions extends UserFactoryDefineOptions
  */
 export declare function defineUserFactory<TOptions extends UserFactoryDefineOptions>(options?: TOptions): UserFactoryInterface<TOptions>;
 type PostauthorFactory = {
-    [factoryFor]: "User";
+    _factoryFor: "User";
     build: () => PromiseLike<Prisma.UserCreateNestedOneWithoutPostsInput["create"]>;
 };
 type PostFactoryDefineInput = {
@@ -71,7 +70,7 @@ type PostFactoryDefineOptions = {
 };
 type PostTraitKeys<TOptions extends PostFactoryDefineOptions> = keyof TOptions["traits"];
 export interface PostFactoryInterfaceWithoutTraits {
-    readonly [factoryFor]: "Post";
+    readonly _factoryFor: "Post";
     build(inputData?: Partial<Prisma.PostCreateInput>): PromiseLike<Prisma.PostCreateInput>;
     buildCreateInput(inputData?: Partial<Prisma.PostCreateInput>): PromiseLike<Prisma.PostCreateInput>;
     buildList(inputData: number | readonly Partial<Prisma.PostCreateInput>[]): PromiseLike<Prisma.PostCreateInput[]>;
@@ -91,11 +90,11 @@ export interface PostFactoryInterface<TOptions extends PostFactoryDefineOptions
  */
 export declare function definePostFactory<TOptions extends PostFactoryDefineOptions>(options: TOptions): PostFactoryInterface<TOptions>;
 type CommentpostFactory = {
-    [factoryFor]: "Post";
+    _factoryFor: "Post";
     build: () => PromiseLike<Prisma.PostCreateNestedOneWithoutCommentsInput["create"]>;
 };
 type CommentauthorFactory = {
-    [factoryFor]: "User";
+    _factoryFor: "User";
     build: () => PromiseLike<Prisma.UserCreateNestedOneWithoutCommentsInput["create"]>;
 };
 type CommentFactoryDefineInput = {
@@ -116,7 +115,7 @@ type CommentFactoryDefineOptions = {
 };
 type CommentTraitKeys<TOptions extends CommentFactoryDefineOptions> = keyof TOptions["traits"];
 export interface CommentFactoryInterfaceWithoutTraits {
-    readonly [factoryFor]: "Comment";
+    readonly _factoryFor: "Comment";
     build(inputData?: Partial<Prisma.CommentCreateInput>): PromiseLike<Prisma.CommentCreateInput>;
     buildCreateInput(inputData?: Partial<Prisma.CommentCreateInput>): PromiseLike<Prisma.CommentCreateInput>;
     buildList(inputData: number | readonly Partial<Prisma.CommentCreateInput>[]): PromiseLike<Prisma.CommentCreateInput[]>;
@@ -150,7 +149,7 @@ type CategoryFactoryDefineOptions = {
 };
 type CategoryTraitKeys<TOptions extends CategoryFactoryDefineOptions> = keyof TOptions["traits"];
 export interface CategoryFactoryInterfaceWithoutTraits {
-    readonly [factoryFor]: "Category";
+    readonly _factoryFor: "Category";
     build(inputData?: Partial<Prisma.CategoryCreateInput>): PromiseLike<Prisma.CategoryCreateInput>;
     buildCreateInput(inputData?: Partial<Prisma.CategoryCreateInput>): PromiseLike<Prisma.CategoryCreateInput>;
     buildList(inputData: number | readonly Partial<Prisma.CategoryCreateInput>[]): PromiseLike<Prisma.CategoryCreateInput[]>;
diff --git a/examples/example-prj/src/__generated__/fabbrica/index.js b/examples/example-prj/src/__generated__/fabbrica/index.js
index 85551f6..4a84950 100644
--- a/examples/example-prj/src/__generated__/fabbrica/index.js
+++ b/examples/example-prj/src/__generated__/fabbrica/index.js
@@ -9,7 +9,6 @@ Object.defineProperty(exports, "resetScalarFieldValueGenerator", { enumerable: t
 const initializer = (0, internal_1.createInitializer)();
 const { getClient } = initializer;
 exports.initialize = initializer.initialize;
-const factoryFor = Symbol("factoryFor");
 const modelFieldDefinitions = [{
         name: "User",
         fields: [{
@@ -95,7 +94,7 @@ function defineUserFactoryInternal({ defaultData: defaultDataResolver, traits: t
         const createList = (inputData) => Promise.all((0, internal_1.normalizeList)(inputData).map(data => create(data)));
         const createForConnect = (inputData = {}) => create(inputData).then(pickForConnect);
         return {
-            [factoryFor]: "User",
+            _factoryFor: "User",
             build,
             buildList,
             buildCreateInput: build,
@@ -125,7 +124,7 @@ function defineUserFactory(options) {
 }
 exports.defineUserFactory = defineUserFactory;
 function isPostauthorFactory(x) {
-    return x?.[factoryFor] === "User";
+    return x?._factoryFor === "User";
 }
 function autoGeneratePostScalarsOrEnums({ seq }) {
     return {
@@ -170,7 +169,7 @@ function definePostFactoryInternal({ defaultData: defaultDataResolver, traits: t
         const createList = (inputData) => Promise.all((0, internal_1.normalizeList)(inputData).map(data => create(data)));
         const createForConnect = (inputData = {}) => create(inputData).then(pickForConnect);
         return {
-            [factoryFor]: "Post",
+            _factoryFor: "Post",
             build,
             buildList,
             buildCreateInput: build,
@@ -200,10 +199,10 @@ function definePostFactory(options) {
 }
 exports.definePostFactory = definePostFactory;
 function isCommentpostFactory(x) {
-    return x?.[factoryFor] === "Post";
+    return x?._factoryFor === "Post";
 }
 function isCommentauthorFactory(x) {
-    return x?.[factoryFor] === "User";
+    return x?._factoryFor === "User";
 }
 function autoGenerateCommentScalarsOrEnums({ seq }) {
     return {
@@ -251,7 +250,7 @@ function defineCommentFactoryInternal({ defaultData: defaultDataResolver, traits
         const createList = (inputData) => Promise.all((0, internal_1.normalizeList)(inputData).map(data => create(data)));
         const createForConnect = (inputData = {}) => create(inputData).then(pickForConnect);
         return {
-            [factoryFor]: "Comment",
+            _factoryFor: "Comment",
             build,
             buildList,
             buildCreateInput: build,
@@ -319,7 +318,7 @@ function defineCategoryFactoryInternal({ defaultData: defaultDataResolver, trait
         const createList = (inputData) => Promise.all((0, internal_1.normalizeList)(inputData).map(data => create(data)));
         const createForConnect = (inputData = {}) => create(inputData).then(pickForConnect);
         return {
-            [factoryFor]: "Category",
+            _factoryFor: "Category",
             build,
             buildList,
             buildCreateInput: build,
diff --git a/packages/prisma-fabbrica/package.json b/packages/prisma-fabbrica/package.json
index 7b2270f..38d62c1 100644
--- a/packages/prisma-fabbrica/package.json
+++ b/packages/prisma-fabbrica/package.json
@@ -31,7 +31,7 @@
     }
   },
   "scripts": {
-    "clean": "rimraf \"*.tsbuildinfo\" \"lib/**/*.{js,ts}\" coverage",
+    "clean": "rimraf -g \"*.tsbuildinfo\" \"lib/**/*.{js,ts}\" coverage",
     "test": "NODE_ENV=development jest",
     "test:ci": "NODE_ENV=development jest --coverage",
     "prepublishOnly": "cp ../../README.md ."
diff --git a/packages/prisma-fabbrica/src/templates/index.ts b/packages/prisma-fabbrica/src/templates/index.ts
index d99da7f..d29fc9a 100644
--- a/packages/prisma-fabbrica/src/templates/index.ts
+++ b/packages/prisma-fabbrica/src/templates/index.ts
@@ -112,11 +112,6 @@ export const initializer = () =>
     export const { initialize } = initializer;
   `();
 
-export const symbols = () =>
-  template.sourceFile`
-    const factoryFor = Symbol("factoryFor");
-  `();
-
 export const modelFieldDefinitions = (models: readonly DMMF.Model[]) =>
   template.statement`
     const modelFieldDefinitions: ModelWithFields[] = ${() => createJSONLiteral(createFieldDefinitions(models))};
@@ -202,7 +197,7 @@ export const modelBelongsToRelationFactory = (fieldType: DMMF.SchemaArg, model:
   const targetModel = model.fields.find(byName(fieldType))!;
   return template.statement<ts.TypeAliasDeclaration>`
     type ${() => ast.identifier(`${model.name}${fieldType.name}Factory`)} = {
-      [factoryFor]: ${() => ast.literalTypeNode(ast.stringLiteral(targetModel.type))};
+      _factoryFor: ${() => ast.literalTypeNode(ast.stringLiteral(targetModel.type))};
       build: () => PromiseLike<Prisma.${() => ast.identifier(fieldType.inputTypes[0].type as string)}["create"]>;
     };
   `();
@@ -270,7 +265,7 @@ export const modelTraitKeys = (model: DMMF.Model) =>
 export const modelFactoryInterfaceWithoutTraits = (model: DMMF.Model) =>
   template.statement`
     export interface MODEL_FACTORY_INTERFACE_WITHOUT_TRAITS {
-      readonly [factoryFor]: ${() => ast.literalTypeNode(ast.stringLiteral(model.name))}
+      readonly _factoryFor: ${() => ast.literalTypeNode(ast.stringLiteral(model.name))}
       build(inputData?: Partial<Prisma.MODEL_CREATE_INPUT>): PromiseLike<Prisma.MODEL_CREATE_INPUT>
       buildCreateInput(inputData?: Partial<Prisma.MODEL_CREATE_INPUT>): PromiseLike<Prisma.MODEL_CREATE_INPUT>
       buildList(inputData: number | readonly Partial<Prisma.MODEL_CREATE_INPUT>[]): PromiseLike<Prisma.MODEL_CREATE_INPUT[]>
@@ -307,7 +302,7 @@ export const isModelAssociationFactory = (fieldType: DMMF.SchemaArg, model: DMMF
       x: MODEL_BELONGS_TO_RELATION_FACTORY | ${() =>
         argInputType(model, fieldType.name, fieldType.inputTypes[0])} | undefined
     ): x is MODEL_BELONGS_TO_RELATION_FACTORY {
-      return (x as any)?.[factoryFor] === ${() => ast.stringLiteral(targetModel.type)};
+      return (x as any)?._factoryFor === ${() => ast.stringLiteral(targetModel.type)};
     }
   `({
     MODEL_BELONGS_TO_RELATION_FACTORY: ast.typeReferenceNode(`${model.name}${fieldType.name}Factory`),
@@ -433,7 +428,7 @@ export const defineModelFactoryInternal = (model: DMMF.Model, inputType: DMMF.In
         const createForConnect = (inputData: Partial<Prisma.MODEL_CREATE_INPUT> = {}) => create(inputData).then(pickForConnect);
 
         return {
-          [factoryFor]: ${() => ast.stringLiteral(model.name)} as const,
+          _factoryFor: ${() => ast.stringLiteral(model.name)} as const,
           build,
           buildList,
           buildCreateInput: build,
@@ -521,7 +516,6 @@ export function getSourceFile({
     ...header(prismaClientModuleSpecifier).statements,
     insertLeadingBreakMarker(buildDataOptions()),
     ...insertLeadingBreakMarker(initializer().statements),
-    ...insertLeadingBreakMarker(symbols().statements),
     insertLeadingBreakMarker(modelFieldDefinitions(document.datamodel.models)),
     ...document.datamodel.models
       .reduce((acc, model) => {


Test patch:
diff --git a/packages/artifact-testing/.gitignore b/packages/artifact-testing/.gitignore
index 4fe8d26..303ec13 100644
--- a/packages/artifact-testing/.gitignore
+++ b/packages/artifact-testing/.gitignore
@@ -1,2 +1,3 @@
 fixtures/*/__generated__/client
 dmmf.json
+built/
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 95e6d48..74fa05d 100644
--- a/packages/artifact-testing/fixtures/field-variation/__generated__/fabbrica/index.ts
+++ b/packages/artifact-testing/fixtures/field-variation/__generated__/fabbrica/index.ts
@@ -19,8 +19,6 @@ const { getClient } = initializer;
 
 export const { initialize } = initializer;
 
-const factoryFor = Symbol("factoryFor");
-
 const modelFieldDefinitions: ModelWithFields[] = [{
         name: "User",
         fields: []
@@ -63,7 +61,7 @@ type UserFactoryDefineOptions = {
 type UserTraitKeys<TOptions extends UserFactoryDefineOptions> = keyof TOptions["traits"];
 
 export interface UserFactoryInterfaceWithoutTraits {
-    readonly [factoryFor]: "User";
+    readonly _factoryFor: "User";
     build(inputData?: Partial<Prisma.UserCreateInput>): PromiseLike<Prisma.UserCreateInput>;
     buildCreateInput(inputData?: Partial<Prisma.UserCreateInput>): PromiseLike<Prisma.UserCreateInput>;
     buildList(inputData: number | readonly Partial<Prisma.UserCreateInput>[]): PromiseLike<Prisma.UserCreateInput[]>;
@@ -119,7 +117,7 @@ function defineUserFactoryInternal<TOptions extends UserFactoryDefineOptions>({
         const createList = (inputData: number | readonly Partial<Prisma.UserCreateInput>[]) => Promise.all(normalizeList(inputData).map(data => create(data)));
         const createForConnect = (inputData: Partial<Prisma.UserCreateInput> = {}) => create(inputData).then(pickForConnect);
         return {
-            [factoryFor]: "User" as const,
+            _factoryFor: "User" as const,
             build,
             buildList,
             buildCreateInput: build,
@@ -171,7 +169,7 @@ type ComplexIdModelFactoryDefineOptions = {
 type ComplexIdModelTraitKeys<TOptions extends ComplexIdModelFactoryDefineOptions> = keyof TOptions["traits"];
 
 export interface ComplexIdModelFactoryInterfaceWithoutTraits {
-    readonly [factoryFor]: "ComplexIdModel";
+    readonly _factoryFor: "ComplexIdModel";
     build(inputData?: Partial<Prisma.ComplexIdModelCreateInput>): PromiseLike<Prisma.ComplexIdModelCreateInput>;
     buildCreateInput(inputData?: Partial<Prisma.ComplexIdModelCreateInput>): PromiseLike<Prisma.ComplexIdModelCreateInput>;
     buildList(inputData: number | readonly Partial<Prisma.ComplexIdModelCreateInput>[]): PromiseLike<Prisma.ComplexIdModelCreateInput[]>;
@@ -228,7 +226,7 @@ function defineComplexIdModelFactoryInternal<TOptions extends ComplexIdModelFact
         const createList = (inputData: number | readonly Partial<Prisma.ComplexIdModelCreateInput>[]) => Promise.all(normalizeList(inputData).map(data => create(data)));
         const createForConnect = (inputData: Partial<Prisma.ComplexIdModelCreateInput> = {}) => create(inputData).then(pickForConnect);
         return {
-            [factoryFor]: "ComplexIdModel" as const,
+            _factoryFor: "ComplexIdModel" as const,
             build,
             buildList,
             buildCreateInput: build,
@@ -304,7 +302,7 @@ type FieldTypePatternModelFactoryDefineOptions = {
 type FieldTypePatternModelTraitKeys<TOptions extends FieldTypePatternModelFactoryDefineOptions> = keyof TOptions["traits"];
 
 export interface FieldTypePatternModelFactoryInterfaceWithoutTraits {
-    readonly [factoryFor]: "FieldTypePatternModel";
+    readonly _factoryFor: "FieldTypePatternModel";
     build(inputData?: Partial<Prisma.FieldTypePatternModelCreateInput>): PromiseLike<Prisma.FieldTypePatternModelCreateInput>;
     buildCreateInput(inputData?: Partial<Prisma.FieldTypePatternModelCreateInput>): PromiseLike<Prisma.FieldTypePatternModelCreateInput>;
     buildList(inputData: number | readonly Partial<Prisma.FieldTypePatternModelCreateInput>[]): PromiseLike<Prisma.FieldTypePatternModelCreateInput[]>;
@@ -367,7 +365,7 @@ function defineFieldTypePatternModelFactoryInternal<TOptions extends FieldTypePa
         const createList = (inputData: number | readonly Partial<Prisma.FieldTypePatternModelCreateInput>[]) => Promise.all(normalizeList(inputData).map(data => create(data)));
         const createForConnect = (inputData: Partial<Prisma.FieldTypePatternModelCreateInput> = {}) => create(inputData).then(pickForConnect);
         return {
-            [factoryFor]: "FieldTypePatternModel" as const,
+            _factoryFor: "FieldTypePatternModel" as const,
             build,
             buildList,
             buildCreateInput: build,
@@ -417,7 +415,7 @@ type NoPkModelFactoryDefineOptions = {
 type NoPkModelTraitKeys<TOptions extends NoPkModelFactoryDefineOptions> = keyof TOptions["traits"];
 
 export interface NoPkModelFactoryInterfaceWithoutTraits {
-    readonly [factoryFor]: "NoPkModel";
+    readonly _factoryFor: "NoPkModel";
     build(inputData?: Partial<Prisma.NoPkModelCreateInput>): PromiseLike<Prisma.NoPkModelCreateInput>;
     buildCreateInput(inputData?: Partial<Prisma.NoPkModelCreateInput>): PromiseLike<Prisma.NoPkModelCreateInput>;
     buildList(inputData: number | readonly Partial<Prisma.NoPkModelCreateInput>[]): PromiseLike<Prisma.NoPkModelCreateInput[]>;
@@ -472,7 +470,7 @@ function defineNoPkModelFactoryInternal<TOptions extends NoPkModelFactoryDefineO
         const createList = (inputData: number | readonly Partial<Prisma.NoPkModelCreateInput>[]) => Promise.all(normalizeList(inputData).map(data => create(data)));
         const createForConnect = (inputData: Partial<Prisma.NoPkModelCreateInput> = {}) => create(inputData).then(pickForConnect);
         return {
-            [factoryFor]: "NoPkModel" as const,
+            _factoryFor: "NoPkModel" as const,
             build,
             buildList,
             buildCreateInput: build,
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 b1a45aa..2042882 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
@@ -15,8 +15,6 @@ const { getClient } = initializer;
 
 export const { initialize } = initializer;
 
-const factoryFor = Symbol("factoryFor");
-
 const modelFieldDefinitions: ModelWithFields[] = [{
         name: "Post",
         fields: [{
@@ -56,7 +54,7 @@ type PostFactoryDefineOptions = {
 type PostTraitKeys<TOptions extends PostFactoryDefineOptions> = keyof TOptions["traits"];
 
 export interface PostFactoryInterfaceWithoutTraits {
-    readonly [factoryFor]: "Post";
+    readonly _factoryFor: "Post";
     build(inputData?: Partial<Prisma.PostCreateInput>): PromiseLike<Prisma.PostCreateInput>;
     buildCreateInput(inputData?: Partial<Prisma.PostCreateInput>): PromiseLike<Prisma.PostCreateInput>;
     buildList(inputData: number | readonly Partial<Prisma.PostCreateInput>[]): PromiseLike<Prisma.PostCreateInput[]>;
@@ -112,7 +110,7 @@ function definePostFactoryInternal<TOptions extends PostFactoryDefineOptions>({
         const createList = (inputData: number | readonly Partial<Prisma.PostCreateInput>[]) => Promise.all(normalizeList(inputData).map(data => create(data)));
         const createForConnect = (inputData: Partial<Prisma.PostCreateInput> = {}) => create(inputData).then(pickForConnect);
         return {
-            [factoryFor]: "Post" as const,
+            _factoryFor: "Post" as const,
             build,
             buildList,
             buildCreateInput: build,
@@ -165,7 +163,7 @@ type CategoryFactoryDefineOptions = {
 type CategoryTraitKeys<TOptions extends CategoryFactoryDefineOptions> = keyof TOptions["traits"];
 
 export interface CategoryFactoryInterfaceWithoutTraits {
-    readonly [factoryFor]: "Category";
+    readonly _factoryFor: "Category";
     build(inputData?: Partial<Prisma.CategoryCreateInput>): PromiseLike<Prisma.CategoryCreateInput>;
     buildCreateInput(inputData?: Partial<Prisma.CategoryCreateInput>): PromiseLike<Prisma.CategoryCreateInput>;
     buildList(inputData: number | readonly Partial<Prisma.CategoryCreateInput>[]): PromiseLike<Prisma.CategoryCreateInput[]>;
@@ -221,7 +219,7 @@ function defineCategoryFactoryInternal<TOptions extends CategoryFactoryDefineOpt
         const createList = (inputData: number | readonly Partial<Prisma.CategoryCreateInput>[]) => Promise.all(normalizeList(inputData).map(data => create(data)));
         const createForConnect = (inputData: Partial<Prisma.CategoryCreateInput> = {}) => create(inputData).then(pickForConnect);
         return {
-            [factoryFor]: "Category" as const,
+            _factoryFor: "Category" as const,
             build,
             buildList,
             buildCreateInput: build,
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 e6e1f52..ae26243 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
@@ -16,8 +16,6 @@ const { getClient } = initializer;
 
 export const { initialize } = initializer;
 
-const factoryFor = Symbol("factoryFor");
-
 const modelFieldDefinitions: ModelWithFields[] = [{
         name: "User",
         fields: [{
@@ -77,7 +75,7 @@ type UserFactoryDefineOptions = {
 type UserTraitKeys<TOptions extends UserFactoryDefineOptions> = keyof TOptions["traits"];
 
 export interface UserFactoryInterfaceWithoutTraits {
-    readonly [factoryFor]: "User";
+    readonly _factoryFor: "User";
     build(inputData?: Partial<Prisma.UserCreateInput>): PromiseLike<Prisma.UserCreateInput>;
     buildCreateInput(inputData?: Partial<Prisma.UserCreateInput>): PromiseLike<Prisma.UserCreateInput>;
     buildList(inputData: number | readonly Partial<Prisma.UserCreateInput>[]): PromiseLike<Prisma.UserCreateInput[]>;
@@ -133,7 +131,7 @@ function defineUserFactoryInternal<TOptions extends UserFactoryDefineOptions>({
         const createList = (inputData: number | readonly Partial<Prisma.UserCreateInput>[]) => Promise.all(normalizeList(inputData).map(data => create(data)));
         const createForConnect = (inputData: Partial<Prisma.UserCreateInput> = {}) => create(inputData).then(pickForConnect);
         return {
-            [factoryFor]: "User" as const,
+            _factoryFor: "User" as const,
             build,
             buildList,
             buildCreateInput: build,
@@ -169,7 +167,7 @@ type PostScalarOrEnumFields = {
 };
 
 type PostauthorFactory = {
-    [factoryFor]: "User";
+    _factoryFor: "User";
     build: () => PromiseLike<Prisma.UserCreateNestedOneWithoutPostsInput["create"]>;
 };
 
@@ -190,13 +188,13 @@ type PostFactoryDefineOptions = {
 };
 
 function isPostauthorFactory(x: PostauthorFactory | Prisma.UserCreateNestedOneWithoutPostsInput | undefined): x is PostauthorFactory {
-    return (x as any)?.[factoryFor] === "User";
+    return (x as any)?._factoryFor === "User";
 }
 
 type PostTraitKeys<TOptions extends PostFactoryDefineOptions> = keyof TOptions["traits"];
 
 export interface PostFactoryInterfaceWithoutTraits {
-    readonly [factoryFor]: "Post";
+    readonly _factoryFor: "Post";
     build(inputData?: Partial<Prisma.PostCreateInput>): PromiseLike<Prisma.PostCreateInput>;
     buildCreateInput(inputData?: Partial<Prisma.PostCreateInput>): PromiseLike<Prisma.PostCreateInput>;
     buildList(inputData: number | readonly Partial<Prisma.PostCreateInput>[]): PromiseLike<Prisma.PostCreateInput[]>;
@@ -256,7 +254,7 @@ function definePostFactoryInternal<TOptions extends PostFactoryDefineOptions>({
         const createList = (inputData: number | readonly Partial<Prisma.PostCreateInput>[]) => Promise.all(normalizeList(inputData).map(data => create(data)));
         const createForConnect = (inputData: Partial<Prisma.PostCreateInput> = {}) => create(inputData).then(pickForConnect);
         return {
-            [factoryFor]: "Post" as const,
+            _factoryFor: "Post" as const,
             build,
             buildList,
             buildCreateInput: build,
@@ -292,12 +290,12 @@ type ReviewScalarOrEnumFields = {
 };
 
 type ReviewpostFactory = {
-    [factoryFor]: "Post";
+    _factoryFor: "Post";
     build: () => PromiseLike<Prisma.PostCreateNestedOneWithoutReviewsInput["create"]>;
 };
 
 type ReviewreviewerFactory = {
-    [factoryFor]: "User";
+    _factoryFor: "User";
     build: () => PromiseLike<Prisma.UserCreateNestedOneWithoutReviewsInput["create"]>;
 };
 
@@ -318,17 +316,17 @@ type ReviewFactoryDefineOptions = {
 };
 
 function isReviewpostFactory(x: ReviewpostFactory | Prisma.PostCreateNestedOneWithoutReviewsInput | undefined): x is ReviewpostFactory {
-    return (x as any)?.[factoryFor] === "Post";
+    return (x as any)?._factoryFor === "Post";
 }
 
 function isReviewreviewerFactory(x: ReviewreviewerFactory | Prisma.UserCreateNestedOneWithoutReviewsInput | undefined): x is ReviewreviewerFactory {
-    return (x as any)?.[factoryFor] === "User";
+    return (x as any)?._factoryFor === "User";
 }
 
 type ReviewTraitKeys<TOptions extends ReviewFactoryDefineOptions> = keyof TOptions["traits"];
 
 export interface ReviewFactoryInterfaceWithoutTraits {
-    readonly [factoryFor]: "Review";
+    readonly _factoryFor: "Review";
     build(inputData?: Partial<Prisma.ReviewCreateInput>): PromiseLike<Prisma.ReviewCreateInput>;
     buildCreateInput(inputData?: Partial<Prisma.ReviewCreateInput>): PromiseLike<Prisma.ReviewCreateInput>;
     buildList(inputData: number | readonly Partial<Prisma.ReviewCreateInput>[]): PromiseLike<Prisma.ReviewCreateInput[]>;
@@ -391,7 +389,7 @@ function defineReviewFactoryInternal<TOptions extends ReviewFactoryDefineOptions
         const createList = (inputData: number | readonly Partial<Prisma.ReviewCreateInput>[]) => Promise.all(normalizeList(inputData).map(data => create(data)));
         const createForConnect = (inputData: Partial<Prisma.ReviewCreateInput> = {}) => create(inputData).then(pickForConnect);
         return {
-            [factoryFor]: "Review" as const,
+            _factoryFor: "Review" as const,
             build,
             buildList,
             buildCreateInput: build,
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 f9f589b..044ca80 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
@@ -15,8 +15,6 @@ const { getClient } = initializer;
 
 export const { initialize } = initializer;
 
-const factoryFor = Symbol("factoryFor");
-
 const modelFieldDefinitions: ModelWithFields[] = [{
         name: "User",
         fields: [{
@@ -39,7 +37,7 @@ type UserScalarOrEnumFields = {
 };
 
 type UserprofileFactory = {
-    [factoryFor]: "Profile";
+    _factoryFor: "Profile";
     build: () => PromiseLike<Prisma.ProfileCreateNestedOneWithoutUserInput["create"]>;
 };
 
@@ -59,13 +57,13 @@ type UserFactoryDefineOptions = {
 };
 
 function isUserprofileFactory(x: UserprofileFactory | Prisma.ProfileCreateNestedOneWithoutUserInput | undefined): x is UserprofileFactory {
-    return (x as any)?.[factoryFor] === "Profile";
+    return (x as any)?._factoryFor === "Profile";
 }
 
 type UserTraitKeys<TOptions extends UserFactoryDefineOptions> = keyof TOptions["traits"];
 
 export interface UserFactoryInterfaceWithoutTraits {
-    readonly [factoryFor]: "User";
+    readonly _factoryFor: "User";
     build(inputData?: Partial<Prisma.UserCreateInput>): PromiseLike<Prisma.UserCreateInput>;
     buildCreateInput(inputData?: Partial<Prisma.UserCreateInput>): PromiseLike<Prisma.UserCreateInput>;
     buildList(inputData: number | readonly Partial<Prisma.UserCreateInput>[]): PromiseLike<Prisma.UserCreateInput[]>;
@@ -125,7 +123,7 @@ function defineUserFactoryInternal<TOptions extends UserFactoryDefineOptions>({
         const createList = (inputData: number | readonly Partial<Prisma.UserCreateInput>[]) => Promise.all(normalizeList(inputData).map(data => create(data)));
         const createForConnect = (inputData: Partial<Prisma.UserCreateInput> = {}) => create(inputData).then(pickForConnect);
         return {
-            [factoryFor]: "User" as const,
+            _factoryFor: "User" as const,
             build,
             buildList,
             buildCreateInput: build,
@@ -160,7 +158,7 @@ type ProfileScalarOrEnumFields = {
 };
 
 type ProfileuserFactory = {
-    [factoryFor]: "User";
+    _factoryFor: "User";
     build: () => PromiseLike<Prisma.UserCreateNestedOneWithoutProfileInput["create"]>;
 };
 
@@ -179,13 +177,13 @@ type ProfileFactoryDefineOptions = {
 };
 
 function isProfileuserFactory(x: ProfileuserFactory | Prisma.UserCreateNestedOneWithoutProfileInput | undefined): x is ProfileuserFactory {
-    return (x as any)?.[factoryFor] === "User";
+    return (x as any)?._factoryFor === "User";
 }
 
 type ProfileTraitKeys<TOptions extends ProfileFactoryDefineOptions> = keyof TOptions["traits"];
 
 export interface ProfileFactoryInterfaceWithoutTraits {
-    readonly [factoryFor]: "Profile";
+    readonly _factoryFor: "Profile";
     build(inputData?: Partial<Prisma.ProfileCreateInput>): PromiseLike<Prisma.ProfileCreateInput>;
     buildCreateInput(inputData?: Partial<Prisma.ProfileCreateInput>): PromiseLike<Prisma.ProfileCreateInput>;
     buildList(inputData: number | readonly Partial<Prisma.ProfileCreateInput>[]): PromiseLike<Prisma.ProfileCreateInput[]>;
@@ -244,7 +242,7 @@ function defineProfileFactoryInternal<TOptions extends ProfileFactoryDefineOptio
         const createList = (inputData: number | readonly Partial<Prisma.ProfileCreateInput>[]) => Promise.all(normalizeList(inputData).map(data => create(data)));
         const createForConnect = (inputData: Partial<Prisma.ProfileCreateInput> = {}) => create(inputData).then(pickForConnect);
         return {
-            [factoryFor]: "Profile" as const,
+            _factoryFor: "Profile" as const,
             build,
             buildList,
             buildCreateInput: build,
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 8962e01..9e08528 100644
--- a/packages/artifact-testing/fixtures/simple-model/__generated__/fabbrica/index.ts
+++ b/packages/artifact-testing/fixtures/simple-model/__generated__/fabbrica/index.ts
@@ -14,8 +14,6 @@ const { getClient } = initializer;
 
 export const { initialize } = initializer;
 
-const factoryFor = Symbol("factoryFor");
-
 const modelFieldDefinitions: ModelWithFields[] = [{
         name: "User",
         fields: []
@@ -43,7 +41,7 @@ type UserFactoryDefineOptions = {
 type UserTraitKeys<TOptions extends UserFactoryDefineOptions> = keyof TOptions["traits"];
 
 export interface UserFactoryInterfaceWithoutTraits {
-    readonly [factoryFor]: "User";
+    readonly _factoryFor: "User";
     build(inputData?: Partial<Prisma.UserCreateInput>): PromiseLike<Prisma.UserCreateInput>;
     buildCreateInput(inputData?: Partial<Prisma.UserCreateInput>): PromiseLike<Prisma.UserCreateInput>;
     buildList(inputData: number | readonly Partial<Prisma.UserCreateInput>[]): PromiseLike<Prisma.UserCreateInput[]>;
@@ -99,7 +97,7 @@ function defineUserFactoryInternal<TOptions extends UserFactoryDefineOptions>({
         const createList = (inputData: number | readonly Partial<Prisma.UserCreateInput>[]) => Promise.all(normalizeList(inputData).map(data => create(data)));
         const createForConnect = (inputData: Partial<Prisma.UserCreateInput> = {}) => create(inputData).then(pickForConnect);
         return {
-            [factoryFor]: "User" as const,
+            _factoryFor: "User" as const,
             build,
             buildList,
             buildCreateInput: build,
diff --git a/packages/artifact-testing/package.json b/packages/artifact-testing/package.json
index 12ced81..641a52c 100644
--- a/packages/artifact-testing/package.json
+++ b/packages/artifact-testing/package.json
@@ -3,7 +3,7 @@
   "name": "artifact-testing",
   "version": "2.1.0",
   "scripts": {
-    "clean": "rimraf \"fixtures/*/__generated__/client\" \"fixtures/*/dmmf.json\"",
+    "clean": "rimraf -g \"fixtures/*/__generated__/client\" \"fixtures/*/dmmf.json\" built \"*.tsbuildinfo\"",
     "pretest:compile": "ts-node scripts/generateFixtures.ts",
     "pretest:compile:ci": "ts-node scripts/generateFixtures.ts",
     "test": "npm run test:compile && npm run test:functions",
diff --git a/packages/artifact-testing/tsconfig.json b/packages/artifact-testing/tsconfig.json
index 7e62704..b7e04e4 100644
--- a/packages/artifact-testing/tsconfig.json
+++ b/packages/artifact-testing/tsconfig.json
@@ -1,6 +1,8 @@
 {
   "extends": "../../tsconfig.json",
   "compilerOptions": {
-    "noEmit": true
-  }
+    "noEmit": false,
+    "outDir": "built"
+  },
+  "exclude": ["built"]
 }
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 0c5d744..295f8b8 100644
--- a/packages/prisma-fabbrica/src/templates/__snapshots__/getSourceFile.test.ts.snap
+++ b/packages/prisma-fabbrica/src/templates/__snapshots__/getSourceFile.test.ts.snap
@@ -17,8 +17,6 @@ const { getClient } = initializer;
 
 export const { initialize } = initializer;
 
-const factoryFor = Symbol("factoryFor");
-
 const modelFieldDefinitions: ModelWithFields[] = [{
         name: "User",
         fields: []
@@ -46,7 +44,7 @@ type UserFactoryDefineOptions = {
 type UserTraitKeys<TOptions extends UserFactoryDefineOptions> = keyof TOptions["traits"];
 
 export interface UserFactoryInterfaceWithoutTraits {
-    readonly [factoryFor]: "User";
+    readonly _factoryFor: "User";
     build(inputData?: Partial<Prisma.UserCreateInput>): PromiseLike<Prisma.UserCreateInput>;
     buildCreateInput(inputData?: Partial<Prisma.UserCreateInput>): PromiseLike<Prisma.UserCreateInput>;
     buildList(inputData: number | readonly Partial<Prisma.UserCreateInput>[]): PromiseLike<Prisma.UserCreateInput[]>;
@@ -102,7 +100,7 @@ function defineUserFactoryInternal<TOptions extends UserFactoryDefineOptions>({
         const createList = (inputData: number | readonly Partial<Prisma.UserCreateInput>[]) => Promise.all(normalizeList(inputData).map(data => create(data)));
         const createForConnect = (inputData: Partial<Prisma.UserCreateInput> = {}) => create(inputData).then(pickForConnect);
         return {
-            [factoryFor]: "User" as const,
+            _factoryFor: "User" as const,
             build,
             buildList,
             buildCreateInput: build,