@prisma/client-generator-js 6.7.0-dev.34 → 6.7.0-dev.35

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
@@ -8531,6 +8531,24 @@ function buildTypedSql({
8531
8531
  return fileMap;
8532
8532
  }
8533
8533
 
8534
+ // src/utils/addPreamble.ts
8535
+ var generatedCodePreamble = `
8536
+ /* !!! This is code generated by Prisma. Do not edit directly. !!!
8537
+ /* eslint-disable */
8538
+ `;
8539
+ function addPreambleToJSFiles(fileMap) {
8540
+ for (const [key, value] of Object.entries(fileMap)) {
8541
+ if (typeof value === "string" && (key.endsWith(".js") || key.endsWith(".mjs"))) {
8542
+ fileMap[key] = addPreamble(value);
8543
+ } else if (typeof value === "object" && value !== null) {
8544
+ addPreambleToJSFiles(value);
8545
+ }
8546
+ }
8547
+ }
8548
+ function addPreamble(fileContent) {
8549
+ return generatedCodePreamble + fileContent;
8550
+ }
8551
+
8534
8552
  // src/generateClient.ts
8535
8553
  var debug = (0, import_debug.Debug)("prisma:client:generateClient");
8536
8554
  var DenylistError = class extends Error {
@@ -8754,6 +8772,7 @@ export * from './edge.js'`;
8754
8772
  });
8755
8773
  }
8756
8774
  fileMap["package.json"] = JSON.stringify(pkgJson, null, 2);
8775
+ addPreambleToJSFiles(fileMap);
8757
8776
  return {
8758
8777
  fileMap,
8759
8778
  // a map of file names to their contents
@@ -9095,7 +9114,18 @@ async function copyRuntimeFiles({ from, to, runtimeName, sourceMaps }) {
9095
9114
  if (sourceMaps) {
9096
9115
  files.push(...files.filter((file4) => file4.endsWith(".js")).map((file4) => `${file4}.map`));
9097
9116
  }
9098
- await Promise.all(files.map((file4) => import_promises.default.copyFile(import_path3.default.join(from, file4), import_path3.default.join(to, file4))));
9117
+ await Promise.all(
9118
+ files.map(async (file4) => {
9119
+ const sourcePath = import_path3.default.join(from, file4);
9120
+ const targetPath = import_path3.default.join(to, file4);
9121
+ if (file4.endsWith(".js")) {
9122
+ const content = await import_promises.default.readFile(sourcePath, "utf-8");
9123
+ await import_promises.default.writeFile(targetPath, addPreamble(content));
9124
+ } else {
9125
+ await import_promises.default.copyFile(sourcePath, targetPath);
9126
+ }
9127
+ })
9128
+ );
9099
9129
  }
9100
9130
  async function deleteOutputDir(outputDir) {
9101
9131
  try {
@@ -9124,7 +9154,7 @@ var import_internals12 = require("@prisma/internals");
9124
9154
  var import_ts_pattern = require("ts-pattern");
9125
9155
 
9126
9156
  // package.json
9127
- var version = "6.7.0-dev.34";
9157
+ var version = "6.7.0-dev.35";
9128
9158
 
9129
9159
  // src/resolvePrismaClient.ts
9130
9160
  var import_promises2 = __toESM(require("node:fs/promises"));
package/dist/index.mjs CHANGED
@@ -8529,6 +8529,24 @@ function buildTypedSql({
8529
8529
  return fileMap;
8530
8530
  }
8531
8531
 
8532
+ // src/utils/addPreamble.ts
8533
+ var generatedCodePreamble = `
8534
+ /* !!! This is code generated by Prisma. Do not edit directly. !!!
8535
+ /* eslint-disable */
8536
+ `;
8537
+ function addPreambleToJSFiles(fileMap) {
8538
+ for (const [key, value] of Object.entries(fileMap)) {
8539
+ if (typeof value === "string" && (key.endsWith(".js") || key.endsWith(".mjs"))) {
8540
+ fileMap[key] = addPreamble(value);
8541
+ } else if (typeof value === "object" && value !== null) {
8542
+ addPreambleToJSFiles(value);
8543
+ }
8544
+ }
8545
+ }
8546
+ function addPreamble(fileContent) {
8547
+ return generatedCodePreamble + fileContent;
8548
+ }
8549
+
8532
8550
  // src/generateClient.ts
8533
8551
  var debug = Debug("prisma:client:generateClient");
8534
8552
  var DenylistError = class extends Error {
@@ -8752,6 +8770,7 @@ export * from './edge.js'`;
8752
8770
  });
8753
8771
  }
8754
8772
  fileMap["package.json"] = JSON.stringify(pkgJson, null, 2);
8773
+ addPreambleToJSFiles(fileMap);
8755
8774
  return {
8756
8775
  fileMap,
8757
8776
  // a map of file names to their contents
@@ -9093,7 +9112,18 @@ async function copyRuntimeFiles({ from, to, runtimeName, sourceMaps }) {
9093
9112
  if (sourceMaps) {
9094
9113
  files.push(...files.filter((file4) => file4.endsWith(".js")).map((file4) => `${file4}.map`));
9095
9114
  }
9096
- await Promise.all(files.map((file4) => fs.copyFile(path3.join(from, file4), path3.join(to, file4))));
9115
+ await Promise.all(
9116
+ files.map(async (file4) => {
9117
+ const sourcePath = path3.join(from, file4);
9118
+ const targetPath = path3.join(to, file4);
9119
+ if (file4.endsWith(".js")) {
9120
+ const content = await fs.readFile(sourcePath, "utf-8");
9121
+ await fs.writeFile(targetPath, addPreamble(content));
9122
+ } else {
9123
+ await fs.copyFile(sourcePath, targetPath);
9124
+ }
9125
+ })
9126
+ );
9097
9127
  }
9098
9128
  async function deleteOutputDir(outputDir) {
9099
9129
  try {
@@ -9122,7 +9152,7 @@ import { ClientEngineType as ClientEngineType4, getClientEngineType as getClient
9122
9152
  import { match } from "ts-pattern";
9123
9153
 
9124
9154
  // package.json
9125
- var version = "6.7.0-dev.34";
9155
+ var version = "6.7.0-dev.35";
9126
9156
 
9127
9157
  // src/resolvePrismaClient.ts
9128
9158
  var import_execa = __toESM(require_execa());
@@ -0,0 +1,6 @@
1
+ import { FileMap } from '../generateClient';
2
+ /**
3
+ * To ensure it is clear that this is generated code and shall not be lint checked.
4
+ */
5
+ export declare function addPreambleToJSFiles(fileMap: FileMap): void;
6
+ export declare function addPreamble(fileContent: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/client-generator-js",
3
- "version": "6.7.0-dev.34",
3
+ "version": "6.7.0-dev.35",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -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.7.0-dev.34",
37
- "@prisma/debug": "6.7.0-dev.34",
38
- "@prisma/fetch-engine": "6.7.0-dev.34",
39
- "@prisma/dmmf": "6.7.0-dev.34",
40
- "@prisma/generator": "6.7.0-dev.34",
41
- "@prisma/get-platform": "6.7.0-dev.34",
42
- "@prisma/internals": "6.7.0-dev.34",
43
- "@prisma/ts-builders": "6.7.0-dev.34"
36
+ "@prisma/client-common": "6.7.0-dev.35",
37
+ "@prisma/debug": "6.7.0-dev.35",
38
+ "@prisma/fetch-engine": "6.7.0-dev.35",
39
+ "@prisma/dmmf": "6.7.0-dev.35",
40
+ "@prisma/generator": "6.7.0-dev.35",
41
+ "@prisma/internals": "6.7.0-dev.35",
42
+ "@prisma/get-platform": "6.7.0-dev.35",
43
+ "@prisma/ts-builders": "6.7.0-dev.35"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@types/pluralize": "0.0.33",