@prisma/client-generator-ts 6.11.0-dev.43 → 6.11.0-dev.5

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.
package/dist/index.js CHANGED
@@ -3431,12 +3431,6 @@ config.runtimeDataModel = JSON.parse(${JSON.stringify(datamodelString)})`;
3431
3431
  // src/utils/buildGetWasmModule.ts
3432
3432
  var import_client_common10 = require("@prisma/client-common");
3433
3433
  var import_ts_pattern = require("ts-pattern");
3434
- function buildDynamicRequireFn() {
3435
- return `const dynamicRequireFn = async <const T extends string>(name: T) =>
3436
- typeof globalThis.__non_webpack_require__ === 'function'
3437
- ? Promise.resolve(globalThis.__non_webpack_require__(name))
3438
- : await import(/* webpackIgnore: true */ name)`;
3439
- }
3440
3434
  function buildGetWasmModule({
3441
3435
  component,
3442
3436
  runtimeName,
@@ -3456,12 +3450,9 @@ function buildGetWasmModule({
3456
3450
  getRuntime: async () => await import(${JSON.stringify(wasmBindingsPath)}),
3457
3451
 
3458
3452
  getQuery${capitalizedComponent}WasmModule: async () => {
3459
- ${buildDynamicRequireFn()}
3460
-
3461
- // Note: we must use dynamic imports here to avoid bundling errors like \`Module parse failed: Unexpected character '' (1:0)\`.
3462
- const { readFile } = await dynamicRequireFn('node:fs/promises')
3453
+ const { readFile } = await import('node:fs/promises')
3463
3454
  ${buildRequire(moduleFormat)}
3464
- const wasmModulePath = _require.resolve(${JSON.stringify(wasmModulePath)})
3455
+ const wasmModulePath = require.resolve(${JSON.stringify(wasmModulePath)})
3465
3456
  const wasmModuleBytes = await readFile(wasmModulePath)
3466
3457
 
3467
3458
  return new globalThis.WebAssembly.Module(wasmModuleBytes)
@@ -3483,10 +3474,10 @@ function buildGetWasmModule({
3483
3474
  }
3484
3475
  function buildRequire(moduleFormat) {
3485
3476
  if (moduleFormat === "cjs") {
3486
- return "const _require = require\n";
3477
+ return "";
3487
3478
  }
3488
- return `const { createRequire } = await dynamicRequireFn('node:module')
3489
- const _require = createRequire(import.meta.url)
3479
+ return `const { createRequire } = await import('node:module')
3480
+ const require = createRequire(import.meta.url)
3490
3481
  `;
3491
3482
  }
3492
3483
 
@@ -6490,7 +6481,7 @@ var import_get_tsconfig = require("get-tsconfig");
6490
6481
  var import_ts_pattern2 = require("ts-pattern");
6491
6482
 
6492
6483
  // package.json
6493
- var version = "6.11.0-dev.43";
6484
+ var version = "6.11.0-dev.5";
6494
6485
 
6495
6486
  // src/module-format.ts
6496
6487
  function parseModuleFormat(format) {
package/dist/index.mjs CHANGED
@@ -3430,12 +3430,6 @@ config.runtimeDataModel = JSON.parse(${JSON.stringify(datamodelString)})`;
3430
3430
  // src/utils/buildGetWasmModule.ts
3431
3431
  import { capitalize as capitalize6 } from "@prisma/client-common";
3432
3432
  import { match } from "ts-pattern";
3433
- function buildDynamicRequireFn() {
3434
- return `const dynamicRequireFn = async <const T extends string>(name: T) =>
3435
- typeof globalThis.__non_webpack_require__ === 'function'
3436
- ? Promise.resolve(globalThis.__non_webpack_require__(name))
3437
- : await import(/* webpackIgnore: true */ name)`;
3438
- }
3439
3433
  function buildGetWasmModule({
3440
3434
  component,
3441
3435
  runtimeName,
@@ -3455,12 +3449,9 @@ function buildGetWasmModule({
3455
3449
  getRuntime: async () => await import(${JSON.stringify(wasmBindingsPath)}),
3456
3450
 
3457
3451
  getQuery${capitalizedComponent}WasmModule: async () => {
3458
- ${buildDynamicRequireFn()}
3459
-
3460
- // Note: we must use dynamic imports here to avoid bundling errors like \`Module parse failed: Unexpected character '' (1:0)\`.
3461
- const { readFile } = await dynamicRequireFn('node:fs/promises')
3452
+ const { readFile } = await import('node:fs/promises')
3462
3453
  ${buildRequire(moduleFormat)}
3463
- const wasmModulePath = _require.resolve(${JSON.stringify(wasmModulePath)})
3454
+ const wasmModulePath = require.resolve(${JSON.stringify(wasmModulePath)})
3464
3455
  const wasmModuleBytes = await readFile(wasmModulePath)
3465
3456
 
3466
3457
  return new globalThis.WebAssembly.Module(wasmModuleBytes)
@@ -3482,10 +3473,10 @@ function buildGetWasmModule({
3482
3473
  }
3483
3474
  function buildRequire(moduleFormat) {
3484
3475
  if (moduleFormat === "cjs") {
3485
- return "const _require = require\n";
3476
+ return "";
3486
3477
  }
3487
- return `const { createRequire } = await dynamicRequireFn('node:module')
3488
- const _require = createRequire(import.meta.url)
3478
+ return `const { createRequire } = await import('node:module')
3479
+ const require = createRequire(import.meta.url)
3489
3480
  `;
3490
3481
  }
3491
3482
 
@@ -6489,7 +6480,7 @@ import { getTsconfig } from "get-tsconfig";
6489
6480
  import { match as match2 } from "ts-pattern";
6490
6481
 
6491
6482
  // package.json
6492
- var version = "6.11.0-dev.43";
6483
+ var version = "6.11.0-dev.5";
6493
6484
 
6494
6485
  // src/module-format.ts
6495
6486
  function parseModuleFormat(format) {
@@ -10,16 +10,4 @@ export type BuildWasmModuleOptions = {
10
10
  activeProvider: ActiveConnectorType;
11
11
  moduleFormat: ModuleFormat;
12
12
  };
13
- /**
14
- * This function evaluates to:
15
- * - `import(name)` for all bundler targets, except Webpack, but including Turbopack.
16
- * - `__non_webpack_require__(name)` for Webpack targets.
17
- *
18
- * This is used to dynamically import a module at runtime, while also excluding it from Webpack's bundle.
19
- * It allows to mitigate the following issues:
20
- * - https://github.com/webpack/webpack/issues/19607
21
- * - https://github.com/prisma/prisma/issues/27049
22
- * - https://github.com/prisma/prisma/issues/27343
23
- */
24
- export declare function buildDynamicRequireFn(): string;
25
13
  export declare function buildGetWasmModule({ component, runtimeName, runtimeBase, target, activeProvider, moduleFormat, }: BuildWasmModuleOptions): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/client-generator-ts",
3
- "version": "6.11.0-dev.43",
3
+ "version": "6.11.0-dev.5",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -25,7 +25,7 @@
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
27
  "@antfu/ni": "0.21.12",
28
- "@prisma/engines-version": "6.11.0-18.9c30299f5a0ea26a96790e13f796dc6094db3173",
28
+ "@prisma/engines-version": "6.11.0-2.161d5c633d6c62240c9d92b45423d22117e1b297",
29
29
  "ci-info": "4.2.0",
30
30
  "fast-glob": "3.3.3",
31
31
  "get-tsconfig": "4.10.0",
@@ -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.11.0-dev.43",
38
- "@prisma/debug": "6.11.0-dev.43",
39
- "@prisma/dmmf": "6.11.0-dev.43",
40
- "@prisma/fetch-engine": "6.11.0-dev.43",
41
- "@prisma/generator": "6.11.0-dev.43",
42
- "@prisma/get-platform": "6.11.0-dev.43",
43
- "@prisma/internals": "6.11.0-dev.43",
44
- "@prisma/ts-builders": "6.11.0-dev.43"
37
+ "@prisma/client-common": "6.11.0-dev.5",
38
+ "@prisma/dmmf": "6.11.0-dev.5",
39
+ "@prisma/debug": "6.11.0-dev.5",
40
+ "@prisma/fetch-engine": "6.11.0-dev.5",
41
+ "@prisma/generator": "6.11.0-dev.5",
42
+ "@prisma/get-platform": "6.11.0-dev.5",
43
+ "@prisma/internals": "6.11.0-dev.5",
44
+ "@prisma/ts-builders": "6.11.0-dev.5"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/pluralize": "0.0.33",