@prisma/client-generator-ts 6.15.0-dev.20 → 6.15.0-dev.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@ import { EnvPaths } from '@prisma/internals';
6
6
  import type { O } from 'ts-toolbelt';
7
7
  import { GeneratedFileExtension, ImportFileExtension } from './file-extensions';
8
8
  import { ModuleFormat } from './module-format';
9
- import { RuntimeTarget } from './runtime-targets';
9
+ import type { RuntimeTargetInternal } from './runtime-targets';
10
10
  export declare class DenylistError extends Error {
11
11
  constructor(message: string);
12
12
  }
@@ -29,7 +29,7 @@ export interface GenerateClientOptions {
29
29
  /** False when --no-engine is passed via CLI */
30
30
  copyEngine?: boolean;
31
31
  typedSql?: SqlQueryOutput[];
32
- target: RuntimeTarget;
32
+ target: RuntimeTargetInternal;
33
33
  generatedFileExtension: GeneratedFileExtension;
34
34
  importFileExtension: ImportFileExtension;
35
35
  moduleFormat: ModuleFormat;
package/dist/index.d.mts CHANGED
@@ -43,7 +43,7 @@ export declare interface GenerateClientOptions {
43
43
  /** False when --no-engine is passed via CLI */
44
44
  copyEngine?: boolean;
45
45
  typedSql?: SqlQueryOutput[];
46
- target: RuntimeTarget;
46
+ target: RuntimeTargetInternal;
47
47
  generatedFileExtension: GeneratedFileExtension;
48
48
  importFileExtension: ImportFileExtension;
49
49
  moduleFormat: ModuleFormat;
@@ -67,8 +67,11 @@ export declare class PrismaClientTsGenerator implements Generator_2 {
67
67
  generate(options: GeneratorOptions): Promise<void>;
68
68
  }
69
69
 
70
- declare type RuntimeTarget = (typeof supportedRuntimes)[number];
70
+ /**
71
+ * The internal representation of the `runtime` attribute for the `prisma-client` generator.
72
+ */
73
+ declare type RuntimeTargetInternal = (typeof supportedInternalRuntimes)[number];
71
74
 
72
- declare const supportedRuntimes: readonly ["nodejs", "deno", "bun", "workerd", "edge-light", "react-native"];
75
+ declare const supportedInternalRuntimes: readonly ["nodejs", "workerd", "vercel-edge", "react-native"];
73
76
 
74
77
  export { }
package/dist/index.d.ts CHANGED
@@ -43,7 +43,7 @@ export declare interface GenerateClientOptions {
43
43
  /** False when --no-engine is passed via CLI */
44
44
  copyEngine?: boolean;
45
45
  typedSql?: SqlQueryOutput[];
46
- target: RuntimeTarget;
46
+ target: RuntimeTargetInternal;
47
47
  generatedFileExtension: GeneratedFileExtension;
48
48
  importFileExtension: ImportFileExtension;
49
49
  moduleFormat: ModuleFormat;
@@ -67,8 +67,11 @@ export declare class PrismaClientTsGenerator implements Generator_2 {
67
67
  generate(options: GeneratorOptions): Promise<void>;
68
68
  }
69
69
 
70
- declare type RuntimeTarget = (typeof supportedRuntimes)[number];
70
+ /**
71
+ * The internal representation of the `runtime` attribute for the `prisma-client` generator.
72
+ */
73
+ declare type RuntimeTargetInternal = (typeof supportedInternalRuntimes)[number];
71
74
 
72
- declare const supportedRuntimes: readonly ["nodejs", "deno", "bun", "workerd", "edge-light", "react-native"];
75
+ declare const supportedInternalRuntimes: readonly ["nodejs", "workerd", "vercel-edge", "react-native"];
73
76
 
74
77
  export { }
package/dist/index.js CHANGED
@@ -2803,7 +2803,7 @@ var DMMFHelper = class {
2803
2803
  }
2804
2804
  buildInputTypesMap() {
2805
2805
  const result = /* @__PURE__ */ new Map();
2806
- for (const type of this.inputObjectTypes.prisma) {
2806
+ for (const type of this.inputObjectTypes.prisma ?? []) {
2807
2807
  result.set(fullyQualifiedName(type.name, "prisma"), type);
2808
2808
  }
2809
2809
  if (!this.inputObjectTypes.model) {
@@ -3494,7 +3494,7 @@ config.${component}Wasm = {
3494
3494
  }`;
3495
3495
  }
3496
3496
  if (buildEdgeLoader) {
3497
- const fullWasmModulePath = target === "edge-light" ? `${wasmModulePath}?module` : wasmModulePath;
3497
+ const fullWasmModulePath = target === "vercel-edge" ? `${wasmModulePath}?module` : wasmModulePath;
3498
3498
  return `config.${component}Wasm = {
3499
3499
  getRuntime: async () => await import(${JSON.stringify(wasmBindingsPath)}),
3500
3500
 
@@ -4068,7 +4068,7 @@ function createCommonInputTypeFiles(context) {
4068
4068
  ts7.moduleImport(context.importFileName(`./enums`)).asNamespace("$Enums"),
4069
4069
  ts7.moduleImport(context.importFileName(`./internal/prismaNamespace`)).asNamespace("Prisma").typeOnly()
4070
4070
  ].map((i) => ts7.stringify(i));
4071
- const genericInputTypes = context.dmmf.inputObjectTypes.prisma.filter((i) => !i.meta?.grouping).map((inputType) => new InputType(inputType, context).toTS());
4071
+ const genericInputTypes = context.dmmf.inputObjectTypes.prisma?.filter((i) => !i.meta?.grouping)?.map((inputType) => new InputType(inputType, context).toTS()) ?? [];
4072
4072
  return `${jsDocHeader3}
4073
4073
  ${imports.join("\n")}
4074
4074
 
@@ -6492,11 +6492,9 @@ async function getGenerationDirs({ runtimeBase, outputDir }) {
6492
6492
  function getRuntimeNameForTarget(target, engineType, previewFeatures) {
6493
6493
  switch (target) {
6494
6494
  case "nodejs":
6495
- case "deno":
6496
- case "bun":
6497
6495
  return getNodeRuntimeName(engineType);
6498
6496
  case "workerd":
6499
- case "edge-light":
6497
+ case "vercel-edge":
6500
6498
  if (previewFeatures.includes("driverAdapters")) {
6501
6499
  return engineType === import_internals9.ClientEngineType.Client ? "wasm-compiler-edge" : "wasm-engine-edge";
6502
6500
  } else {
@@ -6561,7 +6559,7 @@ var import_get_tsconfig = require("get-tsconfig");
6561
6559
  var import_ts_pattern2 = require("ts-pattern");
6562
6560
 
6563
6561
  // package.json
6564
- var version = "6.15.0-dev.20";
6562
+ var version = "6.15.0-dev.22";
6565
6563
 
6566
6564
  // src/module-format.ts
6567
6565
  function parseModuleFormat(format) {
@@ -6604,28 +6602,33 @@ function fromTsConfigModule(module2) {
6604
6602
  }
6605
6603
 
6606
6604
  // src/runtime-targets.ts
6607
- var supportedRuntimes = ["nodejs", "deno", "bun", "workerd", "edge-light", "react-native"];
6605
+ var supportedPublicRuntimes = [
6606
+ "nodejs",
6607
+ "deno",
6608
+ "bun",
6609
+ "workerd",
6610
+ "cloudflare",
6611
+ "vercel-edge",
6612
+ "edge-light",
6613
+ "react-native"
6614
+ ];
6608
6615
  function parseRuntimeTarget(target) {
6609
6616
  switch (target.toLowerCase()) {
6610
- case "node":
6611
- case "nodejs":
6612
- return "nodejs";
6613
- case "deno":
6614
- case "deno-deploy":
6615
- return "deno";
6616
- case "bun":
6617
- return "bun";
6618
6617
  case "workerd":
6619
6618
  case "cloudflare":
6620
6619
  return "workerd";
6621
6620
  case "edge-light":
6622
- case "vercel":
6623
- return "edge-light";
6621
+ case "vercel-edge":
6622
+ return "vercel-edge";
6623
+ case "nodejs":
6624
+ case "deno":
6625
+ case "bun":
6626
+ return "nodejs";
6624
6627
  case "react-native":
6625
6628
  return "react-native";
6626
6629
  default:
6627
6630
  throw new Error(
6628
- `Unknown target runtime: "${target}". The available options are: ${supportedRuntimes.map((runtime) => `"${runtime}"`).join(", ")}`
6631
+ `Unknown target runtime: "${target}". The available options are: ${supportedPublicRuntimes.map((runtime) => `"${runtime}"`).join(", ")}`
6629
6632
  );
6630
6633
  }
6631
6634
  }
package/dist/index.mjs CHANGED
@@ -2799,7 +2799,7 @@ var DMMFHelper = class {
2799
2799
  }
2800
2800
  buildInputTypesMap() {
2801
2801
  const result = /* @__PURE__ */ new Map();
2802
- for (const type of this.inputObjectTypes.prisma) {
2802
+ for (const type of this.inputObjectTypes.prisma ?? []) {
2803
2803
  result.set(fullyQualifiedName(type.name, "prisma"), type);
2804
2804
  }
2805
2805
  if (!this.inputObjectTypes.model) {
@@ -3493,7 +3493,7 @@ config.${component}Wasm = {
3493
3493
  }`;
3494
3494
  }
3495
3495
  if (buildEdgeLoader) {
3496
- const fullWasmModulePath = target === "edge-light" ? `${wasmModulePath}?module` : wasmModulePath;
3496
+ const fullWasmModulePath = target === "vercel-edge" ? `${wasmModulePath}?module` : wasmModulePath;
3497
3497
  return `config.${component}Wasm = {
3498
3498
  getRuntime: async () => await import(${JSON.stringify(wasmBindingsPath)}),
3499
3499
 
@@ -4067,7 +4067,7 @@ function createCommonInputTypeFiles(context) {
4067
4067
  ts7.moduleImport(context.importFileName(`./enums`)).asNamespace("$Enums"),
4068
4068
  ts7.moduleImport(context.importFileName(`./internal/prismaNamespace`)).asNamespace("Prisma").typeOnly()
4069
4069
  ].map((i) => ts7.stringify(i));
4070
- const genericInputTypes = context.dmmf.inputObjectTypes.prisma.filter((i) => !i.meta?.grouping).map((inputType) => new InputType(inputType, context).toTS());
4070
+ const genericInputTypes = context.dmmf.inputObjectTypes.prisma?.filter((i) => !i.meta?.grouping)?.map((inputType) => new InputType(inputType, context).toTS()) ?? [];
4071
4071
  return `${jsDocHeader3}
4072
4072
  ${imports.join("\n")}
4073
4073
 
@@ -6491,11 +6491,9 @@ async function getGenerationDirs({ runtimeBase, outputDir }) {
6491
6491
  function getRuntimeNameForTarget(target, engineType, previewFeatures) {
6492
6492
  switch (target) {
6493
6493
  case "nodejs":
6494
- case "deno":
6495
- case "bun":
6496
6494
  return getNodeRuntimeName(engineType);
6497
6495
  case "workerd":
6498
- case "edge-light":
6496
+ case "vercel-edge":
6499
6497
  if (previewFeatures.includes("driverAdapters")) {
6500
6498
  return engineType === ClientEngineType3.Client ? "wasm-compiler-edge" : "wasm-engine-edge";
6501
6499
  } else {
@@ -6560,7 +6558,7 @@ import { getTsconfig } from "get-tsconfig";
6560
6558
  import { match as match2 } from "ts-pattern";
6561
6559
 
6562
6560
  // package.json
6563
- var version = "6.15.0-dev.20";
6561
+ var version = "6.15.0-dev.22";
6564
6562
 
6565
6563
  // src/module-format.ts
6566
6564
  function parseModuleFormat(format) {
@@ -6603,28 +6601,33 @@ function fromTsConfigModule(module) {
6603
6601
  }
6604
6602
 
6605
6603
  // src/runtime-targets.ts
6606
- var supportedRuntimes = ["nodejs", "deno", "bun", "workerd", "edge-light", "react-native"];
6604
+ var supportedPublicRuntimes = [
6605
+ "nodejs",
6606
+ "deno",
6607
+ "bun",
6608
+ "workerd",
6609
+ "cloudflare",
6610
+ "vercel-edge",
6611
+ "edge-light",
6612
+ "react-native"
6613
+ ];
6607
6614
  function parseRuntimeTarget(target) {
6608
6615
  switch (target.toLowerCase()) {
6609
- case "node":
6610
- case "nodejs":
6611
- return "nodejs";
6612
- case "deno":
6613
- case "deno-deploy":
6614
- return "deno";
6615
- case "bun":
6616
- return "bun";
6617
6616
  case "workerd":
6618
6617
  case "cloudflare":
6619
6618
  return "workerd";
6620
6619
  case "edge-light":
6621
- case "vercel":
6622
- return "edge-light";
6620
+ case "vercel-edge":
6621
+ return "vercel-edge";
6622
+ case "nodejs":
6623
+ case "deno":
6624
+ case "bun":
6625
+ return "nodejs";
6623
6626
  case "react-native":
6624
6627
  return "react-native";
6625
6628
  default:
6626
6629
  throw new Error(
6627
- `Unknown target runtime: "${target}". The available options are: ${supportedRuntimes.map((runtime) => `"${runtime}"`).join(", ")}`
6630
+ `Unknown target runtime: "${target}". The available options are: ${supportedPublicRuntimes.map((runtime) => `"${runtime}"`).join(", ")}`
6628
6631
  );
6629
6632
  }
6630
6633
  }
@@ -1,5 +1,12 @@
1
- declare const supportedRuntimes: readonly ["nodejs", "deno", "bun", "workerd", "edge-light", "react-native"];
2
- export type RuntimeTarget = (typeof supportedRuntimes)[number];
3
- export declare function parseRuntimeTarget(target: string): RuntimeTarget;
4
- export declare function parseRuntimeTargetFromUnknown(target: unknown): RuntimeTarget;
1
+ export declare const supportedInternalRuntimes: readonly ["nodejs", "workerd", "vercel-edge", "react-native"];
2
+ declare const supportedPublicRuntimes: readonly ["nodejs", "deno", "bun", "workerd", "cloudflare", "vercel-edge", "edge-light", "react-native"];
3
+ /**
4
+ * The user-facing `runtime` attribute for the `prisma-client` generator.
5
+ */
6
+ export type RuntimeTarget = (typeof supportedPublicRuntimes)[number];
7
+ /**
8
+ * The internal representation of the `runtime` attribute for the `prisma-client` generator.
9
+ */
10
+ export type RuntimeTargetInternal = (typeof supportedInternalRuntimes)[number];
11
+ export declare function parseRuntimeTargetFromUnknown(target: unknown): "nodejs" | "workerd" | "vercel-edge" | "react-native";
5
12
  export {};
@@ -1,13 +1,13 @@
1
1
  import { ActiveConnectorType } from '@prisma/generator';
2
2
  import type { FileMap } from '../generateClient';
3
- import { ModuleFormat } from '../module-format';
4
- import { RuntimeTarget } from '../runtime-targets';
5
- import { RuntimeName } from '../TSClient/TSClient';
3
+ import type { ModuleFormat } from '../module-format';
4
+ import type { RuntimeTargetInternal } from '../runtime-targets';
5
+ import type { RuntimeName } from '../TSClient/TSClient';
6
6
  export type BuildWasmModuleOptions = {
7
7
  component: 'engine' | 'compiler';
8
8
  runtimeName: RuntimeName;
9
9
  runtimeBase: string;
10
- target: RuntimeTarget;
10
+ target: RuntimeTargetInternal;
11
11
  activeProvider: ActiveConnectorType;
12
12
  moduleFormat: ModuleFormat;
13
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/client-generator-ts",
3
- "version": "6.15.0-dev.20",
3
+ "version": "6.15.0-dev.22",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -34,14 +34,14 @@
34
34
  "pkg-up": "3.1.0",
35
35
  "pluralize": "8.0.0",
36
36
  "ts-pattern": "5.6.2",
37
- "@prisma/client-common": "6.15.0-dev.20",
38
- "@prisma/fetch-engine": "6.15.0-dev.20",
39
- "@prisma/debug": "6.15.0-dev.20",
40
- "@prisma/dmmf": "6.15.0-dev.20",
41
- "@prisma/generator": "6.15.0-dev.20",
42
- "@prisma/get-platform": "6.15.0-dev.20",
43
- "@prisma/internals": "6.15.0-dev.20",
44
- "@prisma/ts-builders": "6.15.0-dev.20"
37
+ "@prisma/client-common": "6.15.0-dev.22",
38
+ "@prisma/dmmf": "6.15.0-dev.22",
39
+ "@prisma/fetch-engine": "6.15.0-dev.22",
40
+ "@prisma/debug": "6.15.0-dev.22",
41
+ "@prisma/generator": "6.15.0-dev.22",
42
+ "@prisma/get-platform": "6.15.0-dev.22",
43
+ "@prisma/internals": "6.15.0-dev.22",
44
+ "@prisma/ts-builders": "6.15.0-dev.22"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/pluralize": "0.0.33",