@prisma/client-generator-ts 6.8.0-dev.4 → 6.8.0-dev.41

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
@@ -2335,7 +2335,7 @@ function inferImportFileExtensionFromTsConfig(tsconfig, generatedFileExtension)
2335
2335
  }
2336
2336
  const moduleResolution = tsconfig.compilerOptions?.moduleResolution?.toLowerCase();
2337
2337
  const module2 = tsconfig.compilerOptions?.module?.toLowerCase();
2338
- if (moduleResolution !== void 0 && moduleResolution !== "classic" && module2 === "commonjs") {
2338
+ if (module2 === "commonjs" || moduleResolution === "bundler") {
2339
2339
  return "";
2340
2340
  }
2341
2341
  return matchingJsExtension(generatedFileExtension);
@@ -3481,6 +3481,20 @@ function buildRequire(moduleFormat) {
3481
3481
  `;
3482
3482
  }
3483
3483
 
3484
+ // src/utils/buildInlineDatasources.ts
3485
+ function buildInlineDatasources(datasources) {
3486
+ return datasources.reduce((acc, ds) => {
3487
+ return acc[ds.name] = buildInlineDatasource(ds), acc;
3488
+ }, {});
3489
+ }
3490
+ function buildInlineDatasource(ds) {
3491
+ if (ds.url.fromEnvVar) {
3492
+ return { url: { fromEnvVar: ds.url.fromEnvVar, value: null } };
3493
+ } else {
3494
+ return { url: { fromEnvVar: null, value: ds.url.value } };
3495
+ }
3496
+ }
3497
+
3484
3498
  // src/TSClient/PrismaClient.ts
3485
3499
  var import_client_common11 = require("@prisma/client-common");
3486
3500
  var ts4 = __toESM(require("@prisma/ts-builders"));
@@ -3851,9 +3865,7 @@ function clientConfig(context, options) {
3851
3865
  activeProvider: options.activeProvider,
3852
3866
  postinstall: options.postinstall,
3853
3867
  ciName: import_ci_info.default.name ?? void 0,
3854
- inlineDatasources: datasources.reduce((acc, ds) => {
3855
- return acc[ds.name] = { url: ds.url }, acc;
3856
- }, {}),
3868
+ inlineDatasources: buildInlineDatasources(datasources),
3857
3869
  inlineSchema,
3858
3870
  inlineSchemaHash,
3859
3871
  copyEngine,
@@ -6111,7 +6123,7 @@ var generatedCodePreamble = `
6111
6123
  /* !!! This is code generated by Prisma. Do not edit directly. !!! */
6112
6124
  /* eslint-disable */
6113
6125
  `;
6114
- var tsNoCheckPreamble = `/* @ts-nocheck */
6126
+ var tsNoCheckPreamble = `// @ts-nocheck
6115
6127
  `;
6116
6128
  function addPreambleToTSFiles(fileMap, includeTSNoCheckPreamble) {
6117
6129
  for (const [key, value] of Object.entries(fileMap)) {
@@ -6470,7 +6482,7 @@ var import_get_tsconfig = require("get-tsconfig");
6470
6482
  var import_ts_pattern2 = require("ts-pattern");
6471
6483
 
6472
6484
  // package.json
6473
- var version = "6.8.0-dev.4";
6485
+ var version = "6.8.0-dev.41";
6474
6486
 
6475
6487
  // src/module-format.ts
6476
6488
  function parseModuleFormat(format) {
package/dist/index.mjs CHANGED
@@ -2331,7 +2331,7 @@ function inferImportFileExtensionFromTsConfig(tsconfig, generatedFileExtension)
2331
2331
  }
2332
2332
  const moduleResolution = tsconfig.compilerOptions?.moduleResolution?.toLowerCase();
2333
2333
  const module = tsconfig.compilerOptions?.module?.toLowerCase();
2334
- if (moduleResolution !== void 0 && moduleResolution !== "classic" && module === "commonjs") {
2334
+ if (module === "commonjs" || moduleResolution === "bundler") {
2335
2335
  return "";
2336
2336
  }
2337
2337
  return matchingJsExtension(generatedFileExtension);
@@ -3480,6 +3480,20 @@ function buildRequire(moduleFormat) {
3480
3480
  `;
3481
3481
  }
3482
3482
 
3483
+ // src/utils/buildInlineDatasources.ts
3484
+ function buildInlineDatasources(datasources) {
3485
+ return datasources.reduce((acc, ds) => {
3486
+ return acc[ds.name] = buildInlineDatasource(ds), acc;
3487
+ }, {});
3488
+ }
3489
+ function buildInlineDatasource(ds) {
3490
+ if (ds.url.fromEnvVar) {
3491
+ return { url: { fromEnvVar: ds.url.fromEnvVar, value: null } };
3492
+ } else {
3493
+ return { url: { fromEnvVar: null, value: ds.url.value } };
3494
+ }
3495
+ }
3496
+
3483
3497
  // src/TSClient/PrismaClient.ts
3484
3498
  import { lowerCase as lowerCase4 } from "@prisma/client-common";
3485
3499
  import * as ts4 from "@prisma/ts-builders";
@@ -3850,9 +3864,7 @@ function clientConfig(context, options) {
3850
3864
  activeProvider: options.activeProvider,
3851
3865
  postinstall: options.postinstall,
3852
3866
  ciName: ciInfo.name ?? void 0,
3853
- inlineDatasources: datasources.reduce((acc, ds) => {
3854
- return acc[ds.name] = { url: ds.url }, acc;
3855
- }, {}),
3867
+ inlineDatasources: buildInlineDatasources(datasources),
3856
3868
  inlineSchema,
3857
3869
  inlineSchemaHash,
3858
3870
  copyEngine,
@@ -6110,7 +6122,7 @@ var generatedCodePreamble = `
6110
6122
  /* !!! This is code generated by Prisma. Do not edit directly. !!! */
6111
6123
  /* eslint-disable */
6112
6124
  `;
6113
- var tsNoCheckPreamble = `/* @ts-nocheck */
6125
+ var tsNoCheckPreamble = `// @ts-nocheck
6114
6126
  `;
6115
6127
  function addPreambleToTSFiles(fileMap, includeTSNoCheckPreamble) {
6116
6128
  for (const [key, value] of Object.entries(fileMap)) {
@@ -6469,7 +6481,7 @@ import { getTsconfig } from "get-tsconfig";
6469
6481
  import { match as match2 } from "ts-pattern";
6470
6482
 
6471
6483
  // package.json
6472
- var version = "6.8.0-dev.4";
6484
+ var version = "6.8.0-dev.41";
6473
6485
 
6474
6486
  // src/module-format.ts
6475
6487
  function parseModuleFormat(format) {
@@ -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-ts",
3
- "version": "6.8.0-dev.4",
3
+ "version": "6.8.0-dev.41",
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-42.de97e6aff41b72abc6bdd5c9a6926ea66a74ee9d",
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.8.0-dev.4",
38
- "@prisma/debug": "6.8.0-dev.4",
39
- "@prisma/dmmf": "6.8.0-dev.4",
40
- "@prisma/fetch-engine": "6.8.0-dev.4",
41
- "@prisma/get-platform": "6.8.0-dev.4",
42
- "@prisma/ts-builders": "6.8.0-dev.4",
43
- "@prisma/internals": "6.8.0-dev.4",
44
- "@prisma/generator": "6.8.0-dev.4"
37
+ "@prisma/client-common": "6.8.0-dev.41",
38
+ "@prisma/debug": "6.8.0-dev.41",
39
+ "@prisma/dmmf": "6.8.0-dev.41",
40
+ "@prisma/fetch-engine": "6.8.0-dev.41",
41
+ "@prisma/generator": "6.8.0-dev.41",
42
+ "@prisma/internals": "6.8.0-dev.41",
43
+ "@prisma/get-platform": "6.8.0-dev.41",
44
+ "@prisma/ts-builders": "6.8.0-dev.41"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/pluralize": "0.0.33",