@prisma/client-generator-js 6.8.0-dev.4 → 6.8.0-dev.40

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.
@@ -12,8 +12,6 @@ export type TSClientOptions = O.Required<GenerateClientOptions, 'runtimeBase'> &
12
12
  runtimeNameTs: RuntimeName;
13
13
  /** When generating the browser client */
14
14
  browser: boolean;
15
- /** When generating via the Deno CLI */
16
- deno: boolean;
17
15
  /** When we are generating an /edge client */
18
16
  edge: boolean;
19
17
  /** When we are generating a /wasm client */
@@ -1,5 +1,5 @@
1
1
  import type { TSClientOptions } from './TSClient';
2
- export declare const commonCodeJS: ({ runtimeBase, runtimeNameJs, browser, clientVersion, engineVersion, generator, deno, }: TSClientOptions) => string;
2
+ export declare const commonCodeJS: ({ runtimeBase, runtimeNameJs, browser, clientVersion, engineVersion, generator, }: TSClientOptions) => string;
3
3
  export declare const notSupportOnBrowser: (fnc: string, browser?: boolean) => string;
4
4
  export declare const commonCodeTS: ({ runtimeBase, runtimeNameTs, clientVersion, engineVersion, generator, }: TSClientOptions) => {
5
5
  tsWithoutNamespace: () => string;
package/dist/index.js CHANGED
@@ -4482,7 +4482,7 @@ var package_default = {
4482
4482
  "@prisma/dmmf": "workspace:*",
4483
4483
  "@prisma/driver-adapter-utils": "workspace:*",
4484
4484
  "@prisma/engines": "workspace:*",
4485
- "@prisma/engines-version": "6.8.0-7.b5aa5ebfc30fd6ed747ca6fdf505d5c45a3204a1",
4485
+ "@prisma/engines-version": "6.8.0-41.b03dd9008d13ed18b5f85f9fc9d97c16419fd0e2",
4486
4486
  "@prisma/fetch-engine": "workspace:*",
4487
4487
  "@prisma/generator": "workspace:*",
4488
4488
  "@prisma/generator-helper": "workspace:*",
@@ -4492,8 +4492,8 @@ var package_default = {
4492
4492
  "@prisma/migrate": "workspace:*",
4493
4493
  "@prisma/mini-proxy": "0.9.5",
4494
4494
  "@prisma/pg-worker": "workspace:*",
4495
- "@prisma/query-compiler-wasm": "6.8.0-7.b5aa5ebfc30fd6ed747ca6fdf505d5c45a3204a1",
4496
- "@prisma/query-engine-wasm": "6.8.0-7.b5aa5ebfc30fd6ed747ca6fdf505d5c45a3204a1",
4495
+ "@prisma/query-compiler-wasm": "6.8.0-41.b03dd9008d13ed18b5f85f9fc9d97c16419fd0e2",
4496
+ "@prisma/query-engine-wasm": "6.8.0-41.b03dd9008d13ed18b5f85f9fc9d97c16419fd0e2",
4497
4497
  "@prisma/ts-builders": "workspace:*",
4498
4498
  "@snaplet/copycat": "6.0.0",
4499
4499
  "@swc-node/register": "1.10.9",
@@ -4529,7 +4529,6 @@ var package_default = {
4529
4529
  memfs: "4.17.0",
4530
4530
  mssql: "11.0.1",
4531
4531
  "new-github-issue-url": "0.2.1",
4532
- "node-fetch": "3.3.2",
4533
4532
  "p-retry": "4.6.2",
4534
4533
  pg: "8.14.1",
4535
4534
  resolve: "1.22.10",
@@ -6644,6 +6643,20 @@ function buildQueryEngineWasmModule(wasm, copyEngine, runtimeNameJs) {
6644
6643
  return `config.engineWasm = undefined`;
6645
6644
  }
6646
6645
 
6646
+ // src/utils/buildInlineDatasources.ts
6647
+ function buildInlineDatasources(datasources) {
6648
+ return datasources.reduce((acc, ds) => {
6649
+ return acc[ds.name] = buildInlineDatasource(ds), acc;
6650
+ }, {});
6651
+ }
6652
+ function buildInlineDatasource(ds) {
6653
+ if (ds.url.fromEnvVar) {
6654
+ return { url: { fromEnvVar: ds.url.fromEnvVar, value: null } };
6655
+ } else {
6656
+ return { url: { fromEnvVar: null, value: ds.url.value } };
6657
+ }
6658
+ }
6659
+
6647
6660
  // src/utils/buildNFTAnnotations.ts
6648
6661
  var import_get_platform = require("@prisma/get-platform");
6649
6662
  var import_internals5 = require("@prisma/internals");
@@ -6715,32 +6728,10 @@ var commonCodeJS = ({
6715
6728
  browser,
6716
6729
  clientVersion,
6717
6730
  engineVersion,
6718
- generator,
6719
- deno
6720
- }) => `${deno ? "const exports = {}" : ""}
6731
+ generator
6732
+ }) => `
6721
6733
  Object.defineProperty(exports, "__esModule", { value: true });
6722
- ${deno ? `
6723
- import {
6724
- PrismaClientKnownRequestError,
6725
- PrismaClientUnknownRequestError,
6726
- PrismaClientRustPanicError,
6727
- PrismaClientInitializationError,
6728
- PrismaClientValidationError,
6729
- getPrismaClient,
6730
- sqltag,
6731
- empty,
6732
- join,
6733
- raw,
6734
- Decimal,
6735
- Debug,
6736
- objectEnumValues,
6737
- makeStrictEnum,
6738
- Extensions,
6739
- defineDmmfProperty,
6740
- Public,
6741
- getRuntime,
6742
- skip
6743
- } from '${runtimeBase}/${runtimeNameJs}.js'` : browser ? `
6734
+ ${browser ? `
6744
6735
  const {
6745
6736
  Decimal,
6746
6737
  objectEnumValues,
@@ -7987,7 +7978,6 @@ var TSClient = class {
7987
7978
  runtimeBase,
7988
7979
  runtimeNameJs,
7989
7980
  datasources,
7990
- deno,
7991
7981
  copyEngine = true,
7992
7982
  reusedJs,
7993
7983
  envPaths
@@ -8014,9 +8004,7 @@ var TSClient = class {
8014
8004
  activeProvider: this.options.activeProvider,
8015
8005
  postinstall: this.options.postinstall,
8016
8006
  ciName: import_ci_info.default.name ?? void 0,
8017
- inlineDatasources: datasources.reduce((acc, ds) => {
8018
- return acc[ds.name] = { url: ds.url }, acc;
8019
- }, {}),
8007
+ inlineDatasources: buildInlineDatasources(datasources),
8020
8008
  inlineSchema,
8021
8009
  inlineSchemaHash,
8022
8010
  copyEngine
@@ -8051,7 +8039,7 @@ ${buildWarnEnvConflicts(edge, runtimeBase, runtimeNameJs)}
8051
8039
  ${buildDebugInitialization(edge)}
8052
8040
  const PrismaClient = getPrismaClient(config)
8053
8041
  exports.PrismaClient = PrismaClient
8054
- Object.assign(exports, Prisma)${deno ? "\nexport { exports as default, Prisma, PrismaClient }" : ""}
8042
+ Object.assign(exports, Prisma)
8055
8043
  ${buildNFTAnnotations(edge || !copyEngine, clientEngineType, binaryTargets, relativeOutdir)}
8056
8044
  `;
8057
8045
  return code;
@@ -8594,7 +8582,6 @@ async function buildClient({
8594
8582
  copyEngine,
8595
8583
  datamodel,
8596
8584
  browser: false,
8597
- deno: false,
8598
8585
  edge: false,
8599
8586
  wasm: false
8600
8587
  };
@@ -8723,23 +8710,6 @@ async function buildClient({
8723
8710
  fileMap["wasm.js"] = fileMap["index-browser.js"];
8724
8711
  fileMap["wasm.d.ts"] = fileMap["default.d.ts"];
8725
8712
  }
8726
- if (generator.previewFeatures.includes("deno") && !!globalThis.Deno) {
8727
- const denoEdgeClient = new TSClient({
8728
- ...baseClientOptions,
8729
- runtimeBase: `../${runtimeBase}`,
8730
- runtimeNameJs: "edge-esm",
8731
- runtimeNameTs: "library.d.ts",
8732
- deno: true,
8733
- edge: true
8734
- });
8735
- fileMap["deno/edge.js"] = JS(denoEdgeClient);
8736
- fileMap["deno/index.d.ts"] = TS(denoEdgeClient);
8737
- fileMap["deno/edge.ts"] = `
8738
- import './polyfill.js'
8739
- // @deno-types="./index.d.ts"
8740
- export * from './edge.js'`;
8741
- fileMap["deno/polyfill.js"] = "globalThis.process = { env: Deno.env.toObject() }; globalThis.global = globalThis";
8742
- }
8743
8713
  if (typedSql && typedSql.length > 0) {
8744
8714
  const edgeRuntimeName = usesWasmRuntime ? "wasm" : "edge";
8745
8715
  const cjsEdgeIndex = `./sql/index.${edgeRuntimeName}.js`;
@@ -8866,9 +8836,6 @@ To learn more about how to rename models, check out https://pris.ly/d/naming-mod
8866
8836
  await deleteOutputDir(outputDir);
8867
8837
  }
8868
8838
  await (0, import_fs_extra.ensureDir)(outputDir);
8869
- if (generator.previewFeatures.includes("deno") && !!globalThis.Deno) {
8870
- await (0, import_fs_extra.ensureDir)(import_path3.default.join(outputDir, "deno"));
8871
- }
8872
8839
  await writeFileMap(outputDir, fileMap);
8873
8840
  if (copyRuntime || generator.isCustomOutput === true) {
8874
8841
  const copiedRuntimeDir = import_path3.default.join(outputDir, "runtime");
@@ -9154,7 +9121,7 @@ var import_internals12 = require("@prisma/internals");
9154
9121
  var import_ts_pattern = require("ts-pattern");
9155
9122
 
9156
9123
  // package.json
9157
- var version = "6.8.0-dev.4";
9124
+ var version = "6.8.0-dev.40";
9158
9125
 
9159
9126
  // src/resolvePrismaClient.ts
9160
9127
  var import_promises2 = __toESM(require("node:fs/promises"));
@@ -9380,7 +9347,6 @@ function dmmfToTypes(dmmf) {
9380
9347
  },
9381
9348
  datamodel: "",
9382
9349
  browser: false,
9383
- deno: false,
9384
9350
  edge: false,
9385
9351
  wasm: false,
9386
9352
  envPaths: {
package/dist/index.mjs CHANGED
@@ -4477,7 +4477,7 @@ var package_default = {
4477
4477
  "@prisma/dmmf": "workspace:*",
4478
4478
  "@prisma/driver-adapter-utils": "workspace:*",
4479
4479
  "@prisma/engines": "workspace:*",
4480
- "@prisma/engines-version": "6.8.0-7.b5aa5ebfc30fd6ed747ca6fdf505d5c45a3204a1",
4480
+ "@prisma/engines-version": "6.8.0-41.b03dd9008d13ed18b5f85f9fc9d97c16419fd0e2",
4481
4481
  "@prisma/fetch-engine": "workspace:*",
4482
4482
  "@prisma/generator": "workspace:*",
4483
4483
  "@prisma/generator-helper": "workspace:*",
@@ -4487,8 +4487,8 @@ var package_default = {
4487
4487
  "@prisma/migrate": "workspace:*",
4488
4488
  "@prisma/mini-proxy": "0.9.5",
4489
4489
  "@prisma/pg-worker": "workspace:*",
4490
- "@prisma/query-compiler-wasm": "6.8.0-7.b5aa5ebfc30fd6ed747ca6fdf505d5c45a3204a1",
4491
- "@prisma/query-engine-wasm": "6.8.0-7.b5aa5ebfc30fd6ed747ca6fdf505d5c45a3204a1",
4490
+ "@prisma/query-compiler-wasm": "6.8.0-41.b03dd9008d13ed18b5f85f9fc9d97c16419fd0e2",
4491
+ "@prisma/query-engine-wasm": "6.8.0-41.b03dd9008d13ed18b5f85f9fc9d97c16419fd0e2",
4492
4492
  "@prisma/ts-builders": "workspace:*",
4493
4493
  "@snaplet/copycat": "6.0.0",
4494
4494
  "@swc-node/register": "1.10.9",
@@ -4524,7 +4524,6 @@ var package_default = {
4524
4524
  memfs: "4.17.0",
4525
4525
  mssql: "11.0.1",
4526
4526
  "new-github-issue-url": "0.2.1",
4527
- "node-fetch": "3.3.2",
4528
4527
  "p-retry": "4.6.2",
4529
4528
  pg: "8.14.1",
4530
4529
  resolve: "1.22.10",
@@ -6642,6 +6641,20 @@ function buildQueryEngineWasmModule(wasm, copyEngine, runtimeNameJs) {
6642
6641
  return `config.engineWasm = undefined`;
6643
6642
  }
6644
6643
 
6644
+ // src/utils/buildInlineDatasources.ts
6645
+ function buildInlineDatasources(datasources) {
6646
+ return datasources.reduce((acc, ds) => {
6647
+ return acc[ds.name] = buildInlineDatasource(ds), acc;
6648
+ }, {});
6649
+ }
6650
+ function buildInlineDatasource(ds) {
6651
+ if (ds.url.fromEnvVar) {
6652
+ return { url: { fromEnvVar: ds.url.fromEnvVar, value: null } };
6653
+ } else {
6654
+ return { url: { fromEnvVar: null, value: ds.url.value } };
6655
+ }
6656
+ }
6657
+
6645
6658
  // src/utils/buildNFTAnnotations.ts
6646
6659
  import { getNodeAPIName } from "@prisma/get-platform";
6647
6660
  import { ClientEngineType, parseAWSNodejsRuntimeEnvVarVersion, pathToPosix as pathToPosix2 } from "@prisma/internals";
@@ -6713,32 +6726,10 @@ var commonCodeJS = ({
6713
6726
  browser,
6714
6727
  clientVersion,
6715
6728
  engineVersion,
6716
- generator,
6717
- deno
6718
- }) => `${deno ? "const exports = {}" : ""}
6729
+ generator
6730
+ }) => `
6719
6731
  Object.defineProperty(exports, "__esModule", { value: true });
6720
- ${deno ? `
6721
- import {
6722
- PrismaClientKnownRequestError,
6723
- PrismaClientUnknownRequestError,
6724
- PrismaClientRustPanicError,
6725
- PrismaClientInitializationError,
6726
- PrismaClientValidationError,
6727
- getPrismaClient,
6728
- sqltag,
6729
- empty,
6730
- join,
6731
- raw,
6732
- Decimal,
6733
- Debug,
6734
- objectEnumValues,
6735
- makeStrictEnum,
6736
- Extensions,
6737
- defineDmmfProperty,
6738
- Public,
6739
- getRuntime,
6740
- skip
6741
- } from '${runtimeBase}/${runtimeNameJs}.js'` : browser ? `
6732
+ ${browser ? `
6742
6733
  const {
6743
6734
  Decimal,
6744
6735
  objectEnumValues,
@@ -7985,7 +7976,6 @@ var TSClient = class {
7985
7976
  runtimeBase,
7986
7977
  runtimeNameJs,
7987
7978
  datasources,
7988
- deno,
7989
7979
  copyEngine = true,
7990
7980
  reusedJs,
7991
7981
  envPaths
@@ -8012,9 +8002,7 @@ var TSClient = class {
8012
8002
  activeProvider: this.options.activeProvider,
8013
8003
  postinstall: this.options.postinstall,
8014
8004
  ciName: ciInfo.name ?? void 0,
8015
- inlineDatasources: datasources.reduce((acc, ds) => {
8016
- return acc[ds.name] = { url: ds.url }, acc;
8017
- }, {}),
8005
+ inlineDatasources: buildInlineDatasources(datasources),
8018
8006
  inlineSchema,
8019
8007
  inlineSchemaHash,
8020
8008
  copyEngine
@@ -8049,7 +8037,7 @@ ${buildWarnEnvConflicts(edge, runtimeBase, runtimeNameJs)}
8049
8037
  ${buildDebugInitialization(edge)}
8050
8038
  const PrismaClient = getPrismaClient(config)
8051
8039
  exports.PrismaClient = PrismaClient
8052
- Object.assign(exports, Prisma)${deno ? "\nexport { exports as default, Prisma, PrismaClient }" : ""}
8040
+ Object.assign(exports, Prisma)
8053
8041
  ${buildNFTAnnotations(edge || !copyEngine, clientEngineType, binaryTargets, relativeOutdir)}
8054
8042
  `;
8055
8043
  return code;
@@ -8592,7 +8580,6 @@ async function buildClient({
8592
8580
  copyEngine,
8593
8581
  datamodel,
8594
8582
  browser: false,
8595
- deno: false,
8596
8583
  edge: false,
8597
8584
  wasm: false
8598
8585
  };
@@ -8721,23 +8708,6 @@ async function buildClient({
8721
8708
  fileMap["wasm.js"] = fileMap["index-browser.js"];
8722
8709
  fileMap["wasm.d.ts"] = fileMap["default.d.ts"];
8723
8710
  }
8724
- if (generator.previewFeatures.includes("deno") && !!globalThis.Deno) {
8725
- const denoEdgeClient = new TSClient({
8726
- ...baseClientOptions,
8727
- runtimeBase: `../${runtimeBase}`,
8728
- runtimeNameJs: "edge-esm",
8729
- runtimeNameTs: "library.d.ts",
8730
- deno: true,
8731
- edge: true
8732
- });
8733
- fileMap["deno/edge.js"] = JS(denoEdgeClient);
8734
- fileMap["deno/index.d.ts"] = TS(denoEdgeClient);
8735
- fileMap["deno/edge.ts"] = `
8736
- import './polyfill.js'
8737
- // @deno-types="./index.d.ts"
8738
- export * from './edge.js'`;
8739
- fileMap["deno/polyfill.js"] = "globalThis.process = { env: Deno.env.toObject() }; globalThis.global = globalThis";
8740
- }
8741
8711
  if (typedSql && typedSql.length > 0) {
8742
8712
  const edgeRuntimeName = usesWasmRuntime ? "wasm" : "edge";
8743
8713
  const cjsEdgeIndex = `./sql/index.${edgeRuntimeName}.js`;
@@ -8864,9 +8834,6 @@ To learn more about how to rename models, check out https://pris.ly/d/naming-mod
8864
8834
  await deleteOutputDir(outputDir);
8865
8835
  }
8866
8836
  await (0, import_fs_extra.ensureDir)(outputDir);
8867
- if (generator.previewFeatures.includes("deno") && !!globalThis.Deno) {
8868
- await (0, import_fs_extra.ensureDir)(path3.join(outputDir, "deno"));
8869
- }
8870
8837
  await writeFileMap(outputDir, fileMap);
8871
8838
  if (copyRuntime || generator.isCustomOutput === true) {
8872
8839
  const copiedRuntimeDir = path3.join(outputDir, "runtime");
@@ -9152,7 +9119,7 @@ import { ClientEngineType as ClientEngineType4, getClientEngineType as getClient
9152
9119
  import { match } from "ts-pattern";
9153
9120
 
9154
9121
  // package.json
9155
- var version = "6.8.0-dev.4";
9122
+ var version = "6.8.0-dev.40";
9156
9123
 
9157
9124
  // src/resolvePrismaClient.ts
9158
9125
  var import_execa = __toESM(require_execa());
@@ -9378,7 +9345,6 @@ function dmmfToTypes(dmmf) {
9378
9345
  },
9379
9346
  datamodel: "",
9380
9347
  browser: false,
9381
- deno: false,
9382
9348
  edge: false,
9383
9349
  wasm: false,
9384
9350
  envPaths: {
@@ -0,0 +1,3 @@
1
+ import type { GetPrismaClientConfig } from '@prisma/client-common';
2
+ import { DataSource } from '@prisma/generator';
3
+ export declare function buildInlineDatasources(datasources: DataSource[]): GetPrismaClientConfig['inlineDatasources'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/client-generator-js",
3
- "version": "6.8.0-dev.4",
3
+ "version": "6.8.0-dev.40",
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.8.0-7.b5aa5ebfc30fd6ed747ca6fdf505d5c45a3204a1",
28
+ "@prisma/engines-version": "6.8.0-41.b03dd9008d13ed18b5f85f9fc9d97c16419fd0e2",
29
29
  "ci-info": "4.2.0",
30
30
  "env-paths": "2.2.1",
31
31
  "indent-string": "4.0.0",
@@ -33,14 +33,14 @@
33
33
  "pkg-up": "3.1.0",
34
34
  "pluralize": "8.0.0",
35
35
  "ts-pattern": "5.6.2",
36
- "@prisma/client-common": "6.8.0-dev.4",
37
- "@prisma/debug": "6.8.0-dev.4",
38
- "@prisma/dmmf": "6.8.0-dev.4",
39
- "@prisma/generator": "6.8.0-dev.4",
40
- "@prisma/get-platform": "6.8.0-dev.4",
41
- "@prisma/internals": "6.8.0-dev.4",
42
- "@prisma/ts-builders": "6.8.0-dev.4",
43
- "@prisma/fetch-engine": "6.8.0-dev.4"
36
+ "@prisma/client-common": "6.8.0-dev.40",
37
+ "@prisma/debug": "6.8.0-dev.40",
38
+ "@prisma/dmmf": "6.8.0-dev.40",
39
+ "@prisma/get-platform": "6.8.0-dev.40",
40
+ "@prisma/fetch-engine": "6.8.0-dev.40",
41
+ "@prisma/generator": "6.8.0-dev.40",
42
+ "@prisma/ts-builders": "6.8.0-dev.40",
43
+ "@prisma/internals": "6.8.0-dev.40"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/pluralize": "0.0.33",