@prisma/client-generator-js 6.8.0-dev.3 → 6.8.0-dev.31

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-35.7c820c0ac3c21b2c97a74c39067a820e9cee63f0",
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-35.7c820c0ac3c21b2c97a74c39067a820e9cee63f0",
4496
+ "@prisma/query-engine-wasm": "6.8.0-35.7c820c0ac3c21b2c97a74c39067a820e9cee63f0",
4497
4497
  "@prisma/ts-builders": "workspace:*",
4498
4498
  "@snaplet/copycat": "6.0.0",
4499
4499
  "@swc-node/register": "1.10.9",
@@ -6644,6 +6644,20 @@ function buildQueryEngineWasmModule(wasm, copyEngine, runtimeNameJs) {
6644
6644
  return `config.engineWasm = undefined`;
6645
6645
  }
6646
6646
 
6647
+ // src/utils/buildInlineDatasources.ts
6648
+ function buildInlineDatasources(datasources) {
6649
+ return datasources.reduce((acc, ds) => {
6650
+ return acc[ds.name] = buildInlineDatasource(ds), acc;
6651
+ }, {});
6652
+ }
6653
+ function buildInlineDatasource(ds) {
6654
+ if (ds.url.fromEnvVar) {
6655
+ return { url: { fromEnvVar: ds.url.fromEnvVar, value: null } };
6656
+ } else {
6657
+ return { url: { fromEnvVar: null, value: ds.url.value } };
6658
+ }
6659
+ }
6660
+
6647
6661
  // src/utils/buildNFTAnnotations.ts
6648
6662
  var import_get_platform = require("@prisma/get-platform");
6649
6663
  var import_internals5 = require("@prisma/internals");
@@ -6715,32 +6729,10 @@ var commonCodeJS = ({
6715
6729
  browser,
6716
6730
  clientVersion,
6717
6731
  engineVersion,
6718
- generator,
6719
- deno
6720
- }) => `${deno ? "const exports = {}" : ""}
6732
+ generator
6733
+ }) => `
6721
6734
  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 ? `
6735
+ ${browser ? `
6744
6736
  const {
6745
6737
  Decimal,
6746
6738
  objectEnumValues,
@@ -7987,7 +7979,6 @@ var TSClient = class {
7987
7979
  runtimeBase,
7988
7980
  runtimeNameJs,
7989
7981
  datasources,
7990
- deno,
7991
7982
  copyEngine = true,
7992
7983
  reusedJs,
7993
7984
  envPaths
@@ -8014,9 +8005,7 @@ var TSClient = class {
8014
8005
  activeProvider: this.options.activeProvider,
8015
8006
  postinstall: this.options.postinstall,
8016
8007
  ciName: import_ci_info.default.name ?? void 0,
8017
- inlineDatasources: datasources.reduce((acc, ds) => {
8018
- return acc[ds.name] = { url: ds.url }, acc;
8019
- }, {}),
8008
+ inlineDatasources: buildInlineDatasources(datasources),
8020
8009
  inlineSchema,
8021
8010
  inlineSchemaHash,
8022
8011
  copyEngine
@@ -8051,7 +8040,7 @@ ${buildWarnEnvConflicts(edge, runtimeBase, runtimeNameJs)}
8051
8040
  ${buildDebugInitialization(edge)}
8052
8041
  const PrismaClient = getPrismaClient(config)
8053
8042
  exports.PrismaClient = PrismaClient
8054
- Object.assign(exports, Prisma)${deno ? "\nexport { exports as default, Prisma, PrismaClient }" : ""}
8043
+ Object.assign(exports, Prisma)
8055
8044
  ${buildNFTAnnotations(edge || !copyEngine, clientEngineType, binaryTargets, relativeOutdir)}
8056
8045
  `;
8057
8046
  return code;
@@ -8594,7 +8583,6 @@ async function buildClient({
8594
8583
  copyEngine,
8595
8584
  datamodel,
8596
8585
  browser: false,
8597
- deno: false,
8598
8586
  edge: false,
8599
8587
  wasm: false
8600
8588
  };
@@ -8723,23 +8711,6 @@ async function buildClient({
8723
8711
  fileMap["wasm.js"] = fileMap["index-browser.js"];
8724
8712
  fileMap["wasm.d.ts"] = fileMap["default.d.ts"];
8725
8713
  }
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
8714
  if (typedSql && typedSql.length > 0) {
8744
8715
  const edgeRuntimeName = usesWasmRuntime ? "wasm" : "edge";
8745
8716
  const cjsEdgeIndex = `./sql/index.${edgeRuntimeName}.js`;
@@ -8866,9 +8837,6 @@ To learn more about how to rename models, check out https://pris.ly/d/naming-mod
8866
8837
  await deleteOutputDir(outputDir);
8867
8838
  }
8868
8839
  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
8840
  await writeFileMap(outputDir, fileMap);
8873
8841
  if (copyRuntime || generator.isCustomOutput === true) {
8874
8842
  const copiedRuntimeDir = import_path3.default.join(outputDir, "runtime");
@@ -9154,7 +9122,7 @@ var import_internals12 = require("@prisma/internals");
9154
9122
  var import_ts_pattern = require("ts-pattern");
9155
9123
 
9156
9124
  // package.json
9157
- var version = "6.8.0-dev.3";
9125
+ var version = "6.8.0-dev.31";
9158
9126
 
9159
9127
  // src/resolvePrismaClient.ts
9160
9128
  var import_promises2 = __toESM(require("node:fs/promises"));
@@ -9380,7 +9348,6 @@ function dmmfToTypes(dmmf) {
9380
9348
  },
9381
9349
  datamodel: "",
9382
9350
  browser: false,
9383
- deno: false,
9384
9351
  edge: false,
9385
9352
  wasm: false,
9386
9353
  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-35.7c820c0ac3c21b2c97a74c39067a820e9cee63f0",
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-35.7c820c0ac3c21b2c97a74c39067a820e9cee63f0",
4491
+ "@prisma/query-engine-wasm": "6.8.0-35.7c820c0ac3c21b2c97a74c39067a820e9cee63f0",
4492
4492
  "@prisma/ts-builders": "workspace:*",
4493
4493
  "@snaplet/copycat": "6.0.0",
4494
4494
  "@swc-node/register": "1.10.9",
@@ -6642,6 +6642,20 @@ function buildQueryEngineWasmModule(wasm, copyEngine, runtimeNameJs) {
6642
6642
  return `config.engineWasm = undefined`;
6643
6643
  }
6644
6644
 
6645
+ // src/utils/buildInlineDatasources.ts
6646
+ function buildInlineDatasources(datasources) {
6647
+ return datasources.reduce((acc, ds) => {
6648
+ return acc[ds.name] = buildInlineDatasource(ds), acc;
6649
+ }, {});
6650
+ }
6651
+ function buildInlineDatasource(ds) {
6652
+ if (ds.url.fromEnvVar) {
6653
+ return { url: { fromEnvVar: ds.url.fromEnvVar, value: null } };
6654
+ } else {
6655
+ return { url: { fromEnvVar: null, value: ds.url.value } };
6656
+ }
6657
+ }
6658
+
6645
6659
  // src/utils/buildNFTAnnotations.ts
6646
6660
  import { getNodeAPIName } from "@prisma/get-platform";
6647
6661
  import { ClientEngineType, parseAWSNodejsRuntimeEnvVarVersion, pathToPosix as pathToPosix2 } from "@prisma/internals";
@@ -6713,32 +6727,10 @@ var commonCodeJS = ({
6713
6727
  browser,
6714
6728
  clientVersion,
6715
6729
  engineVersion,
6716
- generator,
6717
- deno
6718
- }) => `${deno ? "const exports = {}" : ""}
6730
+ generator
6731
+ }) => `
6719
6732
  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 ? `
6733
+ ${browser ? `
6742
6734
  const {
6743
6735
  Decimal,
6744
6736
  objectEnumValues,
@@ -7985,7 +7977,6 @@ var TSClient = class {
7985
7977
  runtimeBase,
7986
7978
  runtimeNameJs,
7987
7979
  datasources,
7988
- deno,
7989
7980
  copyEngine = true,
7990
7981
  reusedJs,
7991
7982
  envPaths
@@ -8012,9 +8003,7 @@ var TSClient = class {
8012
8003
  activeProvider: this.options.activeProvider,
8013
8004
  postinstall: this.options.postinstall,
8014
8005
  ciName: ciInfo.name ?? void 0,
8015
- inlineDatasources: datasources.reduce((acc, ds) => {
8016
- return acc[ds.name] = { url: ds.url }, acc;
8017
- }, {}),
8006
+ inlineDatasources: buildInlineDatasources(datasources),
8018
8007
  inlineSchema,
8019
8008
  inlineSchemaHash,
8020
8009
  copyEngine
@@ -8049,7 +8038,7 @@ ${buildWarnEnvConflicts(edge, runtimeBase, runtimeNameJs)}
8049
8038
  ${buildDebugInitialization(edge)}
8050
8039
  const PrismaClient = getPrismaClient(config)
8051
8040
  exports.PrismaClient = PrismaClient
8052
- Object.assign(exports, Prisma)${deno ? "\nexport { exports as default, Prisma, PrismaClient }" : ""}
8041
+ Object.assign(exports, Prisma)
8053
8042
  ${buildNFTAnnotations(edge || !copyEngine, clientEngineType, binaryTargets, relativeOutdir)}
8054
8043
  `;
8055
8044
  return code;
@@ -8592,7 +8581,6 @@ async function buildClient({
8592
8581
  copyEngine,
8593
8582
  datamodel,
8594
8583
  browser: false,
8595
- deno: false,
8596
8584
  edge: false,
8597
8585
  wasm: false
8598
8586
  };
@@ -8721,23 +8709,6 @@ async function buildClient({
8721
8709
  fileMap["wasm.js"] = fileMap["index-browser.js"];
8722
8710
  fileMap["wasm.d.ts"] = fileMap["default.d.ts"];
8723
8711
  }
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
8712
  if (typedSql && typedSql.length > 0) {
8742
8713
  const edgeRuntimeName = usesWasmRuntime ? "wasm" : "edge";
8743
8714
  const cjsEdgeIndex = `./sql/index.${edgeRuntimeName}.js`;
@@ -8864,9 +8835,6 @@ To learn more about how to rename models, check out https://pris.ly/d/naming-mod
8864
8835
  await deleteOutputDir(outputDir);
8865
8836
  }
8866
8837
  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
8838
  await writeFileMap(outputDir, fileMap);
8871
8839
  if (copyRuntime || generator.isCustomOutput === true) {
8872
8840
  const copiedRuntimeDir = path3.join(outputDir, "runtime");
@@ -9152,7 +9120,7 @@ import { ClientEngineType as ClientEngineType4, getClientEngineType as getClient
9152
9120
  import { match } from "ts-pattern";
9153
9121
 
9154
9122
  // package.json
9155
- var version = "6.8.0-dev.3";
9123
+ var version = "6.8.0-dev.31";
9156
9124
 
9157
9125
  // src/resolvePrismaClient.ts
9158
9126
  var import_execa = __toESM(require_execa());
@@ -9378,7 +9346,6 @@ function dmmfToTypes(dmmf) {
9378
9346
  },
9379
9347
  datamodel: "",
9380
9348
  browser: false,
9381
- deno: false,
9382
9349
  edge: false,
9383
9350
  wasm: false,
9384
9351
  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.3",
3
+ "version": "6.8.0-dev.31",
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-35.7c820c0ac3c21b2c97a74c39067a820e9cee63f0",
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.3",
37
- "@prisma/debug": "6.8.0-dev.3",
38
- "@prisma/fetch-engine": "6.8.0-dev.3",
39
- "@prisma/dmmf": "6.8.0-dev.3",
40
- "@prisma/generator": "6.8.0-dev.3",
41
- "@prisma/internals": "6.8.0-dev.3",
42
- "@prisma/ts-builders": "6.8.0-dev.3",
43
- "@prisma/get-platform": "6.8.0-dev.3"
36
+ "@prisma/debug": "6.8.0-dev.31",
37
+ "@prisma/client-common": "6.8.0-dev.31",
38
+ "@prisma/dmmf": "6.8.0-dev.31",
39
+ "@prisma/fetch-engine": "6.8.0-dev.31",
40
+ "@prisma/get-platform": "6.8.0-dev.31",
41
+ "@prisma/generator": "6.8.0-dev.31",
42
+ "@prisma/internals": "6.8.0-dev.31",
43
+ "@prisma/ts-builders": "6.8.0-dev.31"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/pluralize": "0.0.33",