@prisma/generator-helper 7.2.0-integration-fix-enums-mapped-types-v7.2 → 7.2.0

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.
@@ -18,11 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var GeneratorProcess_exports = {};
20
20
  __export(GeneratorProcess_exports, {
21
- GeneratorError: () => import_chunk_MXZE5TCU.GeneratorError,
22
- GeneratorProcess: () => import_chunk_MXZE5TCU.GeneratorProcess
21
+ GeneratorError: () => import_chunk_UMIHM3GW.GeneratorError,
22
+ GeneratorProcess: () => import_chunk_UMIHM3GW.GeneratorProcess
23
23
  });
24
24
  module.exports = __toCommonJS(GeneratorProcess_exports);
25
- var import_chunk_MXZE5TCU = require("./chunk-MXZE5TCU.js");
26
- var import_chunk_EOPVK4AE = require("./chunk-EOPVK4AE.js");
25
+ var import_chunk_UMIHM3GW = require("./chunk-UMIHM3GW.js");
27
26
  var import_chunk_KEYE2GFS = require("./chunk-KEYE2GFS.js");
28
27
  var import_chunk_QGM4M3NI = require("./chunk-QGM4M3NI.js");
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,16 +17,28 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_IH6S2YZX_exports = {};
20
- __export(chunk_IH6S2YZX_exports, {
29
+ var chunk_AWUR6KKS_exports = {};
30
+ __export(chunk_AWUR6KKS_exports, {
21
31
  generatorHandler: () => generatorHandler
22
32
  });
23
- module.exports = __toCommonJS(chunk_IH6S2YZX_exports);
24
- var import_chunk_EOPVK4AE = require("./chunk-EOPVK4AE.js");
33
+ module.exports = __toCommonJS(chunk_AWUR6KKS_exports);
34
+ var import_node_readline = __toESM(require("node:readline"));
25
35
  function generatorHandler(handler) {
26
- (0, import_chunk_EOPVK4AE.byline)(process.stdin).on("data", async (line) => {
27
- const json = JSON.parse(String(line));
36
+ const stdinInterface = import_node_readline.default.createInterface({
37
+ input: process.stdin,
38
+ crlfDelay: Infinity
39
+ });
40
+ stdinInterface.on("line", async (line) => {
41
+ const json = JSON.parse(line);
28
42
  if (json.method === "generate" && json.params) {
29
43
  try {
30
44
  const result = await handler.onGenerate(json.params);
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,17 +17,25 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_MXZE5TCU_exports = {};
20
- __export(chunk_MXZE5TCU_exports, {
29
+ var chunk_UMIHM3GW_exports = {};
30
+ __export(chunk_UMIHM3GW_exports, {
21
31
  GeneratorError: () => GeneratorError,
22
32
  GeneratorProcess: () => GeneratorProcess
23
33
  });
24
- module.exports = __toCommonJS(chunk_MXZE5TCU_exports);
25
- var import_chunk_EOPVK4AE = require("./chunk-EOPVK4AE.js");
34
+ module.exports = __toCommonJS(chunk_UMIHM3GW_exports);
26
35
  var import_chunk_KEYE2GFS = require("./chunk-KEYE2GFS.js");
27
36
  var import_chunk_QGM4M3NI = require("./chunk-QGM4M3NI.js");
28
37
  var import_node_child_process = require("node:child_process");
38
+ var import_node_readline = __toESM(require("node:readline"));
29
39
  var import_debug = require("@prisma/debug");
30
40
  var require_windows = (0, import_chunk_QGM4M3NI.__commonJS)({
31
41
  "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module2) {
@@ -633,14 +643,17 @@ ${this.errorLogs}`
633
643
  }
634
644
  this.rejectAllHandlers(error);
635
645
  });
636
- (0, import_chunk_EOPVK4AE.byline)(this.child.stderr).on("data", (line) => {
637
- const response = String(line);
646
+ const stderrInterface = import_node_readline.default.createInterface({
647
+ input: this.child.stderr,
648
+ crlfDelay: Infinity
649
+ });
650
+ stderrInterface.on("line", (line) => {
638
651
  let data;
639
652
  try {
640
- data = JSON.parse(response);
653
+ data = JSON.parse(line);
641
654
  } catch (e) {
642
- this.errorLogs += response + "\n";
643
- debug(response);
655
+ this.errorLogs += line + "\n";
656
+ debug(line);
644
657
  }
645
658
  if (data) {
646
659
  this.handleResponse(data);
@@ -18,9 +18,8 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var generatorHandler_exports = {};
20
20
  __export(generatorHandler_exports, {
21
- generatorHandler: () => import_chunk_IH6S2YZX.generatorHandler
21
+ generatorHandler: () => import_chunk_AWUR6KKS.generatorHandler
22
22
  });
23
23
  module.exports = __toCommonJS(generatorHandler_exports);
24
- var import_chunk_IH6S2YZX = require("./chunk-IH6S2YZX.js");
25
- var import_chunk_EOPVK4AE = require("./chunk-EOPVK4AE.js");
24
+ var import_chunk_AWUR6KKS = require("./chunk-AWUR6KKS.js");
26
25
  var import_chunk_QGM4M3NI = require("./chunk-QGM4M3NI.js");
package/dist/index.js CHANGED
@@ -18,13 +18,12 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var index_exports = {};
20
20
  __export(index_exports, {
21
- GeneratorError: () => import_chunk_MXZE5TCU.GeneratorError,
22
- GeneratorProcess: () => import_chunk_MXZE5TCU.GeneratorProcess,
23
- generatorHandler: () => import_chunk_IH6S2YZX.generatorHandler
21
+ GeneratorError: () => import_chunk_UMIHM3GW.GeneratorError,
22
+ GeneratorProcess: () => import_chunk_UMIHM3GW.GeneratorProcess,
23
+ generatorHandler: () => import_chunk_AWUR6KKS.generatorHandler
24
24
  });
25
25
  module.exports = __toCommonJS(index_exports);
26
- var import_chunk_MXZE5TCU = require("./chunk-MXZE5TCU.js");
27
- var import_chunk_IH6S2YZX = require("./chunk-IH6S2YZX.js");
28
- var import_chunk_EOPVK4AE = require("./chunk-EOPVK4AE.js");
26
+ var import_chunk_UMIHM3GW = require("./chunk-UMIHM3GW.js");
27
+ var import_chunk_AWUR6KKS = require("./chunk-AWUR6KKS.js");
29
28
  var import_chunk_KEYE2GFS = require("./chunk-KEYE2GFS.js");
30
29
  var import_chunk_QGM4M3NI = require("./chunk-QGM4M3NI.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/generator-helper",
3
- "version": "7.2.0-integration-fix-enums-mapped-types-v7.2",
3
+ "version": "7.2.0",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,9 +15,9 @@
15
15
  "homepage": "https://www.prisma.io",
16
16
  "bugs": "https://github.com/prisma/prisma/issues",
17
17
  "dependencies": {
18
- "@prisma/debug": "7.2.0-integration-fix-enums-mapped-types-v7.2",
19
- "@prisma/dmmf": "7.2.0-integration-fix-enums-mapped-types-v7.2",
20
- "@prisma/generator": "7.2.0-integration-fix-enums-mapped-types-v7.2"
18
+ "@prisma/debug": "7.2.0",
19
+ "@prisma/dmmf": "7.2.0",
20
+ "@prisma/generator": "7.2.0"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@swc-node/register": "1.10.9",
package/dist/byline.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export default function byline(readStream: any, options?: any): any;
2
- export declare function createStream(readStream: any, options: any): any;
3
- export declare function createLineStream(readStream: any, options: any): any;
4
- export declare function LineStream(this: any, options: any): void;
package/dist/byline.js DELETED
@@ -1,28 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var byline_exports = {};
20
- __export(byline_exports, {
21
- LineStream: () => import_chunk_EOPVK4AE.LineStream,
22
- createLineStream: () => import_chunk_EOPVK4AE.createLineStream,
23
- createStream: () => import_chunk_EOPVK4AE.createStream,
24
- default: () => import_chunk_EOPVK4AE.byline
25
- });
26
- module.exports = __toCommonJS(byline_exports);
27
- var import_chunk_EOPVK4AE = require("./chunk-EOPVK4AE.js");
28
- var import_chunk_QGM4M3NI = require("./chunk-QGM4M3NI.js");
@@ -1,125 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_EOPVK4AE_exports = {};
30
- __export(chunk_EOPVK4AE_exports, {
31
- LineStream: () => LineStream,
32
- byline: () => byline,
33
- createLineStream: () => createLineStream,
34
- createStream: () => createStream
35
- });
36
- module.exports = __toCommonJS(chunk_EOPVK4AE_exports);
37
- var import_stream = __toESM(require("stream"));
38
- var import_util = __toESM(require("util"));
39
- function byline(readStream, options) {
40
- return createStream(readStream, options);
41
- }
42
- function createStream(readStream, options) {
43
- if (readStream) {
44
- return createLineStream(readStream, options);
45
- } else {
46
- return new LineStream(options);
47
- }
48
- }
49
- function createLineStream(readStream, options) {
50
- if (!readStream) {
51
- throw new Error("expected readStream");
52
- }
53
- if (!readStream.readable) {
54
- throw new Error("readStream must be readable");
55
- }
56
- const ls = new LineStream(options);
57
- readStream.pipe(ls);
58
- return ls;
59
- }
60
- function LineStream(options) {
61
- import_stream.default.Transform.call(this, options);
62
- options = options || {};
63
- this._readableState.objectMode = true;
64
- this._lineBuffer = [];
65
- this._keepEmptyLines = options.keepEmptyLines || false;
66
- this._lastChunkEndedWithCR = false;
67
- this.on("pipe", function(src) {
68
- if (!this.encoding) {
69
- if (src instanceof import_stream.default.Readable) {
70
- this.encoding = src._readableState.encoding;
71
- }
72
- }
73
- });
74
- }
75
- import_util.default.inherits(LineStream, import_stream.default.Transform);
76
- LineStream.prototype._transform = function(chunk, encoding, done) {
77
- encoding = encoding || "utf8";
78
- if (Buffer.isBuffer(chunk)) {
79
- if (encoding == "buffer") {
80
- chunk = chunk.toString();
81
- encoding = "utf8";
82
- } else {
83
- chunk = chunk.toString(encoding);
84
- }
85
- }
86
- this._chunkEncoding = encoding;
87
- const lines = chunk.split(/\r\n|\r|\n/g);
88
- if (this._lastChunkEndedWithCR && chunk[0] == "\n") {
89
- lines.shift();
90
- }
91
- if (this._lineBuffer.length > 0) {
92
- this._lineBuffer[this._lineBuffer.length - 1] += lines[0];
93
- lines.shift();
94
- }
95
- this._lastChunkEndedWithCR = chunk[chunk.length - 1] == "\r";
96
- this._lineBuffer = this._lineBuffer.concat(lines);
97
- this._pushBuffer(encoding, 1, done);
98
- };
99
- LineStream.prototype._pushBuffer = function(encoding, keep, done) {
100
- while (this._lineBuffer.length > keep) {
101
- const line = this._lineBuffer.shift();
102
- if (this._keepEmptyLines || line.length > 0) {
103
- if (!this.push(this._reencode(line, encoding))) {
104
- const self = this;
105
- setImmediate(function() {
106
- self._pushBuffer(encoding, keep, done);
107
- });
108
- return;
109
- }
110
- }
111
- }
112
- done();
113
- };
114
- LineStream.prototype._flush = function(done) {
115
- this._pushBuffer(this._chunkEncoding, 0, done);
116
- };
117
- LineStream.prototype._reencode = function(line, chunkEncoding) {
118
- if (this.encoding && this.encoding != chunkEncoding) {
119
- return Buffer.from(line, chunkEncoding).toString(this.encoding);
120
- } else if (this.encoding) {
121
- return line;
122
- } else {
123
- return Buffer.from(line, chunkEncoding);
124
- }
125
- };