@prisma/client-generator-js 6.20.0-dev.1 → 6.20.0-dev.11
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/TSClient/Args.d.ts +5 -5
- package/dist/TSClient/PrismaClient.d.ts +2 -2
- package/dist/TSClient/TSClient.d.ts +2 -7
- package/dist/TSClient/common.d.ts +2 -2
- package/dist/generateClient.d.ts +1 -7
- package/dist/generator.d.ts +1 -1
- package/dist/index.d.mts +1 -7
- package/dist/index.d.ts +1 -7
- package/dist/index.js +308 -2959
- package/dist/index.mjs +292 -2949
- package/dist/resolvePrismaClient.d.ts +0 -5
- package/dist/typedSql/buildIndex.d.ts +2 -2
- package/dist/typedSql/typedSql.d.ts +1 -1
- package/dist/utils/buildDMMF.d.ts +1 -1
- package/dist/utils/buildDebugInitialization.d.ts +1 -1
- package/dist/utils/buildGetQueryCompilerWasmModule.d.ts +1 -1
- package/dist/utils/runtimeImport.d.ts +1 -8
- package/package.json +10 -11
- package/dist/TSClient/Datasources.d.ts +0 -7
- package/dist/extractSqliteSources.d.ts +0 -6
- package/dist/extractSqliteSources.test.d.ts +0 -1
- package/dist/resolveDatasources.d.ts +0 -1
- package/dist/resolveDatasources.test.d.ts +0 -1
- package/dist/serializeDatasources.d.ts +0 -4
- package/dist/serializeDatasources.test.d.ts +0 -1
- package/dist/utils/buildDirname.d.ts +0 -7
- package/dist/utils/buildGetQueryEngineWasmModule.d.ts +0 -6
- package/dist/utils/buildInjectableEdgeEnv.d.ts +0 -20
- package/dist/utils/buildInlineDatasources.d.ts +0 -3
- package/dist/utils/buildNFTAnnotations.d.ts +0 -11
- package/dist/utils/buildNFTAnnotations.test.d.ts +0 -1
- package/dist/utils/buildWarnEnvConflicts.d.ts +0 -10
package/dist/index.js
CHANGED
|
@@ -62,7 +62,7 @@ var require_universalify = __commonJS({
|
|
|
62
62
|
var require_polyfills = __commonJS({
|
|
63
63
|
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js"(exports2, module2) {
|
|
64
64
|
"use strict";
|
|
65
|
-
var
|
|
65
|
+
var constants = require("constants");
|
|
66
66
|
var origCwd = process.cwd;
|
|
67
67
|
var cwd = null;
|
|
68
68
|
var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
@@ -86,7 +86,7 @@ var require_polyfills = __commonJS({
|
|
|
86
86
|
var chdir;
|
|
87
87
|
module2.exports = patch;
|
|
88
88
|
function patch(fs3) {
|
|
89
|
-
if (
|
|
89
|
+
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
90
90
|
patchLchmod(fs3);
|
|
91
91
|
}
|
|
92
92
|
if (!fs3.lutimes) {
|
|
@@ -111,14 +111,14 @@ var require_polyfills = __commonJS({
|
|
|
111
111
|
fs3.fstatSync = statFixSync(fs3.fstatSync);
|
|
112
112
|
fs3.lstatSync = statFixSync(fs3.lstatSync);
|
|
113
113
|
if (fs3.chmod && !fs3.lchmod) {
|
|
114
|
-
fs3.lchmod = function(
|
|
114
|
+
fs3.lchmod = function(path5, mode, cb) {
|
|
115
115
|
if (cb) process.nextTick(cb);
|
|
116
116
|
};
|
|
117
117
|
fs3.lchmodSync = function() {
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
120
|
if (fs3.chown && !fs3.lchown) {
|
|
121
|
-
fs3.lchown = function(
|
|
121
|
+
fs3.lchown = function(path5, uid, gid, cb) {
|
|
122
122
|
if (cb) process.nextTick(cb);
|
|
123
123
|
};
|
|
124
124
|
fs3.lchownSync = function() {
|
|
@@ -185,10 +185,10 @@ var require_polyfills = __commonJS({
|
|
|
185
185
|
};
|
|
186
186
|
}(fs3.readSync);
|
|
187
187
|
function patchLchmod(fs4) {
|
|
188
|
-
fs4.lchmod = function(
|
|
188
|
+
fs4.lchmod = function(path5, mode, callback) {
|
|
189
189
|
fs4.open(
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
path5,
|
|
191
|
+
constants.O_WRONLY | constants.O_SYMLINK,
|
|
192
192
|
mode,
|
|
193
193
|
function(err, fd) {
|
|
194
194
|
if (err) {
|
|
@@ -203,8 +203,8 @@ var require_polyfills = __commonJS({
|
|
|
203
203
|
}
|
|
204
204
|
);
|
|
205
205
|
};
|
|
206
|
-
fs4.lchmodSync = function(
|
|
207
|
-
var fd = fs4.openSync(
|
|
206
|
+
fs4.lchmodSync = function(path5, mode) {
|
|
207
|
+
var fd = fs4.openSync(path5, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
208
208
|
var threw = true;
|
|
209
209
|
var ret;
|
|
210
210
|
try {
|
|
@@ -224,9 +224,9 @@ var require_polyfills = __commonJS({
|
|
|
224
224
|
};
|
|
225
225
|
}
|
|
226
226
|
function patchLutimes(fs4) {
|
|
227
|
-
if (
|
|
228
|
-
fs4.lutimes = function(
|
|
229
|
-
fs4.open(
|
|
227
|
+
if (constants.hasOwnProperty("O_SYMLINK") && fs4.futimes) {
|
|
228
|
+
fs4.lutimes = function(path5, at, mt, cb) {
|
|
229
|
+
fs4.open(path5, constants.O_SYMLINK, function(er, fd) {
|
|
230
230
|
if (er) {
|
|
231
231
|
if (cb) cb(er);
|
|
232
232
|
return;
|
|
@@ -238,8 +238,8 @@ var require_polyfills = __commonJS({
|
|
|
238
238
|
});
|
|
239
239
|
});
|
|
240
240
|
};
|
|
241
|
-
fs4.lutimesSync = function(
|
|
242
|
-
var fd = fs4.openSync(
|
|
241
|
+
fs4.lutimesSync = function(path5, at, mt) {
|
|
242
|
+
var fd = fs4.openSync(path5, constants.O_SYMLINK);
|
|
243
243
|
var ret;
|
|
244
244
|
var threw = true;
|
|
245
245
|
try {
|
|
@@ -358,11 +358,11 @@ var require_legacy_streams = __commonJS({
|
|
|
358
358
|
ReadStream,
|
|
359
359
|
WriteStream
|
|
360
360
|
};
|
|
361
|
-
function ReadStream(
|
|
362
|
-
if (!(this instanceof ReadStream)) return new ReadStream(
|
|
361
|
+
function ReadStream(path5, options) {
|
|
362
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path5, options);
|
|
363
363
|
Stream.call(this);
|
|
364
364
|
var self = this;
|
|
365
|
-
this.path =
|
|
365
|
+
this.path = path5;
|
|
366
366
|
this.fd = null;
|
|
367
367
|
this.readable = true;
|
|
368
368
|
this.paused = false;
|
|
@@ -407,10 +407,10 @@ var require_legacy_streams = __commonJS({
|
|
|
407
407
|
self._read();
|
|
408
408
|
});
|
|
409
409
|
}
|
|
410
|
-
function WriteStream(
|
|
411
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
410
|
+
function WriteStream(path5, options) {
|
|
411
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path5, options);
|
|
412
412
|
Stream.call(this);
|
|
413
|
-
this.path =
|
|
413
|
+
this.path = path5;
|
|
414
414
|
this.fd = null;
|
|
415
415
|
this.writable = true;
|
|
416
416
|
this.flags = "w";
|
|
@@ -485,7 +485,7 @@ var require_graceful_fs = __commonJS({
|
|
|
485
485
|
gracefulQueue = "___graceful-fs.queue";
|
|
486
486
|
previousSymbol = "___graceful-fs.previous";
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function noop() {
|
|
489
489
|
}
|
|
490
490
|
function publishQueue(context, queue2) {
|
|
491
491
|
Object.defineProperty(context, gracefulQueue, {
|
|
@@ -494,11 +494,11 @@ var require_graceful_fs = __commonJS({
|
|
|
494
494
|
}
|
|
495
495
|
});
|
|
496
496
|
}
|
|
497
|
-
var
|
|
497
|
+
var debug2 = noop;
|
|
498
498
|
if (util.debuglog)
|
|
499
|
-
|
|
499
|
+
debug2 = util.debuglog("gfs4");
|
|
500
500
|
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
|
|
501
|
-
|
|
501
|
+
debug2 = function() {
|
|
502
502
|
var m = util.format.apply(util, arguments);
|
|
503
503
|
m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
|
|
504
504
|
console.error(m);
|
|
@@ -533,7 +533,7 @@ var require_graceful_fs = __commonJS({
|
|
|
533
533
|
}(fs3.closeSync);
|
|
534
534
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
535
535
|
process.on("exit", function() {
|
|
536
|
-
|
|
536
|
+
debug2(fs3[gracefulQueue]);
|
|
537
537
|
require("assert").equal(fs3[gracefulQueue].length, 0);
|
|
538
538
|
});
|
|
539
539
|
}
|
|
@@ -550,18 +550,18 @@ var require_graceful_fs = __commonJS({
|
|
|
550
550
|
function patch(fs4) {
|
|
551
551
|
polyfills(fs4);
|
|
552
552
|
fs4.gracefulify = patch;
|
|
553
|
-
fs4.createReadStream =
|
|
554
|
-
fs4.createWriteStream =
|
|
553
|
+
fs4.createReadStream = createReadStream;
|
|
554
|
+
fs4.createWriteStream = createWriteStream;
|
|
555
555
|
var fs$readFile = fs4.readFile;
|
|
556
556
|
fs4.readFile = readFile;
|
|
557
|
-
function readFile(
|
|
557
|
+
function readFile(path5, options, cb) {
|
|
558
558
|
if (typeof options === "function")
|
|
559
559
|
cb = options, options = null;
|
|
560
|
-
return go$readFile(
|
|
561
|
-
function go$readFile(
|
|
562
|
-
return fs$readFile(
|
|
560
|
+
return go$readFile(path5, options, cb);
|
|
561
|
+
function go$readFile(path6, options2, cb2, startTime) {
|
|
562
|
+
return fs$readFile(path6, options2, function(err) {
|
|
563
563
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
564
|
-
enqueue([go$readFile, [
|
|
564
|
+
enqueue([go$readFile, [path6, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
565
565
|
else {
|
|
566
566
|
if (typeof cb2 === "function")
|
|
567
567
|
cb2.apply(this, arguments);
|
|
@@ -571,14 +571,14 @@ var require_graceful_fs = __commonJS({
|
|
|
571
571
|
}
|
|
572
572
|
var fs$writeFile = fs4.writeFile;
|
|
573
573
|
fs4.writeFile = writeFile;
|
|
574
|
-
function writeFile(
|
|
574
|
+
function writeFile(path5, data, options, cb) {
|
|
575
575
|
if (typeof options === "function")
|
|
576
576
|
cb = options, options = null;
|
|
577
|
-
return go$writeFile(
|
|
578
|
-
function go$writeFile(
|
|
579
|
-
return fs$writeFile(
|
|
577
|
+
return go$writeFile(path5, data, options, cb);
|
|
578
|
+
function go$writeFile(path6, data2, options2, cb2, startTime) {
|
|
579
|
+
return fs$writeFile(path6, data2, options2, function(err) {
|
|
580
580
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
581
|
-
enqueue([go$writeFile, [
|
|
581
|
+
enqueue([go$writeFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
582
582
|
else {
|
|
583
583
|
if (typeof cb2 === "function")
|
|
584
584
|
cb2.apply(this, arguments);
|
|
@@ -589,14 +589,14 @@ var require_graceful_fs = __commonJS({
|
|
|
589
589
|
var fs$appendFile = fs4.appendFile;
|
|
590
590
|
if (fs$appendFile)
|
|
591
591
|
fs4.appendFile = appendFile;
|
|
592
|
-
function appendFile(
|
|
592
|
+
function appendFile(path5, data, options, cb) {
|
|
593
593
|
if (typeof options === "function")
|
|
594
594
|
cb = options, options = null;
|
|
595
|
-
return go$appendFile(
|
|
596
|
-
function go$appendFile(
|
|
597
|
-
return fs$appendFile(
|
|
595
|
+
return go$appendFile(path5, data, options, cb);
|
|
596
|
+
function go$appendFile(path6, data2, options2, cb2, startTime) {
|
|
597
|
+
return fs$appendFile(path6, data2, options2, function(err) {
|
|
598
598
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
599
|
-
enqueue([go$appendFile, [
|
|
599
|
+
enqueue([go$appendFile, [path6, data2, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
600
600
|
else {
|
|
601
601
|
if (typeof cb2 === "function")
|
|
602
602
|
cb2.apply(this, arguments);
|
|
@@ -627,31 +627,31 @@ var require_graceful_fs = __commonJS({
|
|
|
627
627
|
var fs$readdir = fs4.readdir;
|
|
628
628
|
fs4.readdir = readdir;
|
|
629
629
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
630
|
-
function readdir(
|
|
630
|
+
function readdir(path5, options, cb) {
|
|
631
631
|
if (typeof options === "function")
|
|
632
632
|
cb = options, options = null;
|
|
633
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(
|
|
634
|
-
return fs$readdir(
|
|
635
|
-
|
|
633
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path6, options2, cb2, startTime) {
|
|
634
|
+
return fs$readdir(path6, fs$readdirCallback(
|
|
635
|
+
path6,
|
|
636
636
|
options2,
|
|
637
637
|
cb2,
|
|
638
638
|
startTime
|
|
639
639
|
));
|
|
640
|
-
} : function go$readdir2(
|
|
641
|
-
return fs$readdir(
|
|
642
|
-
|
|
640
|
+
} : function go$readdir2(path6, options2, cb2, startTime) {
|
|
641
|
+
return fs$readdir(path6, options2, fs$readdirCallback(
|
|
642
|
+
path6,
|
|
643
643
|
options2,
|
|
644
644
|
cb2,
|
|
645
645
|
startTime
|
|
646
646
|
));
|
|
647
647
|
};
|
|
648
|
-
return go$readdir(
|
|
649
|
-
function fs$readdirCallback(
|
|
648
|
+
return go$readdir(path5, options, cb);
|
|
649
|
+
function fs$readdirCallback(path6, options2, cb2, startTime) {
|
|
650
650
|
return function(err, files) {
|
|
651
651
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
652
652
|
enqueue([
|
|
653
653
|
go$readdir,
|
|
654
|
-
[
|
|
654
|
+
[path6, options2, cb2],
|
|
655
655
|
err,
|
|
656
656
|
startTime || Date.now(),
|
|
657
657
|
Date.now()
|
|
@@ -722,7 +722,7 @@ var require_graceful_fs = __commonJS({
|
|
|
722
722
|
enumerable: true,
|
|
723
723
|
configurable: true
|
|
724
724
|
});
|
|
725
|
-
function ReadStream(
|
|
725
|
+
function ReadStream(path5, options) {
|
|
726
726
|
if (this instanceof ReadStream)
|
|
727
727
|
return fs$ReadStream.apply(this, arguments), this;
|
|
728
728
|
else
|
|
@@ -742,7 +742,7 @@ var require_graceful_fs = __commonJS({
|
|
|
742
742
|
}
|
|
743
743
|
});
|
|
744
744
|
}
|
|
745
|
-
function WriteStream(
|
|
745
|
+
function WriteStream(path5, options) {
|
|
746
746
|
if (this instanceof WriteStream)
|
|
747
747
|
return fs$WriteStream.apply(this, arguments), this;
|
|
748
748
|
else
|
|
@@ -760,22 +760,22 @@ var require_graceful_fs = __commonJS({
|
|
|
760
760
|
}
|
|
761
761
|
});
|
|
762
762
|
}
|
|
763
|
-
function
|
|
764
|
-
return new fs4.ReadStream(
|
|
763
|
+
function createReadStream(path5, options) {
|
|
764
|
+
return new fs4.ReadStream(path5, options);
|
|
765
765
|
}
|
|
766
|
-
function
|
|
767
|
-
return new fs4.WriteStream(
|
|
766
|
+
function createWriteStream(path5, options) {
|
|
767
|
+
return new fs4.WriteStream(path5, options);
|
|
768
768
|
}
|
|
769
769
|
var fs$open = fs4.open;
|
|
770
770
|
fs4.open = open;
|
|
771
|
-
function open(
|
|
771
|
+
function open(path5, flags, mode, cb) {
|
|
772
772
|
if (typeof mode === "function")
|
|
773
773
|
cb = mode, mode = null;
|
|
774
|
-
return go$open(
|
|
775
|
-
function go$open(
|
|
776
|
-
return fs$open(
|
|
774
|
+
return go$open(path5, flags, mode, cb);
|
|
775
|
+
function go$open(path6, flags2, mode2, cb2, startTime) {
|
|
776
|
+
return fs$open(path6, flags2, mode2, function(err, fd) {
|
|
777
777
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
778
|
-
enqueue([go$open, [
|
|
778
|
+
enqueue([go$open, [path6, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
779
779
|
else {
|
|
780
780
|
if (typeof cb2 === "function")
|
|
781
781
|
cb2.apply(this, arguments);
|
|
@@ -786,7 +786,7 @@ var require_graceful_fs = __commonJS({
|
|
|
786
786
|
return fs4;
|
|
787
787
|
}
|
|
788
788
|
function enqueue(elem) {
|
|
789
|
-
|
|
789
|
+
debug2("ENQUEUE", elem[0].name, elem[1]);
|
|
790
790
|
fs3[gracefulQueue].push(elem);
|
|
791
791
|
retry();
|
|
792
792
|
}
|
|
@@ -813,10 +813,10 @@ var require_graceful_fs = __commonJS({
|
|
|
813
813
|
var startTime = elem[3];
|
|
814
814
|
var lastTime = elem[4];
|
|
815
815
|
if (startTime === void 0) {
|
|
816
|
-
|
|
816
|
+
debug2("RETRY", fn.name, args);
|
|
817
817
|
fn.apply(null, args);
|
|
818
818
|
} else if (Date.now() - startTime >= 6e4) {
|
|
819
|
-
|
|
819
|
+
debug2("TIMEOUT", fn.name, args);
|
|
820
820
|
var cb = args.pop();
|
|
821
821
|
if (typeof cb === "function")
|
|
822
822
|
cb.call(null, err);
|
|
@@ -825,7 +825,7 @@ var require_graceful_fs = __commonJS({
|
|
|
825
825
|
var sinceStart = Math.max(lastTime - startTime, 1);
|
|
826
826
|
var desiredDelay = Math.min(sinceStart * 1.2, 100);
|
|
827
827
|
if (sinceAttempt >= desiredDelay) {
|
|
828
|
-
|
|
828
|
+
debug2("RETRY", fn.name, args);
|
|
829
829
|
fn.apply(null, args.concat([startTime]));
|
|
830
830
|
} else {
|
|
831
831
|
fs3[gracefulQueue].push(elem);
|
|
@@ -958,10 +958,10 @@ var require_fs = __commonJS({
|
|
|
958
958
|
var require_utils = __commonJS({
|
|
959
959
|
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) {
|
|
960
960
|
"use strict";
|
|
961
|
-
var
|
|
961
|
+
var path5 = require("path");
|
|
962
962
|
module2.exports.checkPath = function checkPath(pth) {
|
|
963
963
|
if (process.platform === "win32") {
|
|
964
|
-
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(
|
|
964
|
+
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path5.parse(pth).root, ""));
|
|
965
965
|
if (pathHasInvalidWinCharacters) {
|
|
966
966
|
const error = new Error(`Path contains invalid characters: ${pth}`);
|
|
967
967
|
error.code = "EINVAL";
|
|
@@ -1025,8 +1025,8 @@ var require_path_exists = __commonJS({
|
|
|
1025
1025
|
"use strict";
|
|
1026
1026
|
var u = require_universalify().fromPromise;
|
|
1027
1027
|
var fs3 = require_fs();
|
|
1028
|
-
function pathExists(
|
|
1029
|
-
return fs3.access(
|
|
1028
|
+
function pathExists(path5) {
|
|
1029
|
+
return fs3.access(path5).then(() => true).catch(() => false);
|
|
1030
1030
|
}
|
|
1031
1031
|
module2.exports = {
|
|
1032
1032
|
pathExists: u(pathExists),
|
|
@@ -1041,8 +1041,8 @@ var require_utimes = __commonJS({
|
|
|
1041
1041
|
"use strict";
|
|
1042
1042
|
var fs3 = require_fs();
|
|
1043
1043
|
var u = require_universalify().fromPromise;
|
|
1044
|
-
async function utimesMillis(
|
|
1045
|
-
const fd = await fs3.open(
|
|
1044
|
+
async function utimesMillis(path5, atime, mtime) {
|
|
1045
|
+
const fd = await fs3.open(path5, "r+");
|
|
1046
1046
|
let closeErr = null;
|
|
1047
1047
|
try {
|
|
1048
1048
|
await fs3.futimes(fd, atime, mtime);
|
|
@@ -1057,8 +1057,8 @@ var require_utimes = __commonJS({
|
|
|
1057
1057
|
throw closeErr;
|
|
1058
1058
|
}
|
|
1059
1059
|
}
|
|
1060
|
-
function utimesMillisSync(
|
|
1061
|
-
const fd = fs3.openSync(
|
|
1060
|
+
function utimesMillisSync(path5, atime, mtime) {
|
|
1061
|
+
const fd = fs3.openSync(path5, "r+");
|
|
1062
1062
|
fs3.futimesSync(fd, atime, mtime);
|
|
1063
1063
|
return fs3.closeSync(fd);
|
|
1064
1064
|
}
|
|
@@ -1074,7 +1074,7 @@ var require_stat = __commonJS({
|
|
|
1074
1074
|
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/util/stat.js"(exports2, module2) {
|
|
1075
1075
|
"use strict";
|
|
1076
1076
|
var fs3 = require_fs();
|
|
1077
|
-
var
|
|
1077
|
+
var path5 = require("path");
|
|
1078
1078
|
var u = require_universalify().fromPromise;
|
|
1079
1079
|
function getStats(src, dest, opts) {
|
|
1080
1080
|
const statFunc = opts.dereference ? (file4) => fs3.stat(file4, { bigint: true }) : (file4) => fs3.lstat(file4, { bigint: true });
|
|
@@ -1102,8 +1102,8 @@ var require_stat = __commonJS({
|
|
|
1102
1102
|
const { srcStat, destStat } = await getStats(src, dest, opts);
|
|
1103
1103
|
if (destStat) {
|
|
1104
1104
|
if (areIdentical(srcStat, destStat)) {
|
|
1105
|
-
const srcBaseName =
|
|
1106
|
-
const destBaseName =
|
|
1105
|
+
const srcBaseName = path5.basename(src);
|
|
1106
|
+
const destBaseName = path5.basename(dest);
|
|
1107
1107
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
1108
1108
|
return { srcStat, destStat, isChangingCase: true };
|
|
1109
1109
|
}
|
|
@@ -1125,8 +1125,8 @@ var require_stat = __commonJS({
|
|
|
1125
1125
|
const { srcStat, destStat } = getStatsSync(src, dest, opts);
|
|
1126
1126
|
if (destStat) {
|
|
1127
1127
|
if (areIdentical(srcStat, destStat)) {
|
|
1128
|
-
const srcBaseName =
|
|
1129
|
-
const destBaseName =
|
|
1128
|
+
const srcBaseName = path5.basename(src);
|
|
1129
|
+
const destBaseName = path5.basename(dest);
|
|
1130
1130
|
if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
|
|
1131
1131
|
return { srcStat, destStat, isChangingCase: true };
|
|
1132
1132
|
}
|
|
@@ -1145,9 +1145,9 @@ var require_stat = __commonJS({
|
|
|
1145
1145
|
return { srcStat, destStat };
|
|
1146
1146
|
}
|
|
1147
1147
|
async function checkParentPaths(src, srcStat, dest, funcName) {
|
|
1148
|
-
const srcParent =
|
|
1149
|
-
const destParent =
|
|
1150
|
-
if (destParent === srcParent || destParent ===
|
|
1148
|
+
const srcParent = path5.resolve(path5.dirname(src));
|
|
1149
|
+
const destParent = path5.resolve(path5.dirname(dest));
|
|
1150
|
+
if (destParent === srcParent || destParent === path5.parse(destParent).root) return;
|
|
1151
1151
|
let destStat;
|
|
1152
1152
|
try {
|
|
1153
1153
|
destStat = await fs3.stat(destParent, { bigint: true });
|
|
@@ -1161,9 +1161,9 @@ var require_stat = __commonJS({
|
|
|
1161
1161
|
return checkParentPaths(src, srcStat, destParent, funcName);
|
|
1162
1162
|
}
|
|
1163
1163
|
function checkParentPathsSync(src, srcStat, dest, funcName) {
|
|
1164
|
-
const srcParent =
|
|
1165
|
-
const destParent =
|
|
1166
|
-
if (destParent === srcParent || destParent ===
|
|
1164
|
+
const srcParent = path5.resolve(path5.dirname(src));
|
|
1165
|
+
const destParent = path5.resolve(path5.dirname(dest));
|
|
1166
|
+
if (destParent === srcParent || destParent === path5.parse(destParent).root) return;
|
|
1167
1167
|
let destStat;
|
|
1168
1168
|
try {
|
|
1169
1169
|
destStat = fs3.statSync(destParent, { bigint: true });
|
|
@@ -1180,8 +1180,8 @@ var require_stat = __commonJS({
|
|
|
1180
1180
|
return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
|
1181
1181
|
}
|
|
1182
1182
|
function isSrcSubdir(src, dest) {
|
|
1183
|
-
const srcArr =
|
|
1184
|
-
const destArr =
|
|
1183
|
+
const srcArr = path5.resolve(src).split(path5.sep).filter((i) => i);
|
|
1184
|
+
const destArr = path5.resolve(dest).split(path5.sep).filter((i) => i);
|
|
1185
1185
|
return srcArr.every((cur, i) => destArr[i] === cur);
|
|
1186
1186
|
}
|
|
1187
1187
|
function errMsg(src, dest, funcName) {
|
|
@@ -1206,7 +1206,7 @@ var require_copy = __commonJS({
|
|
|
1206
1206
|
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) {
|
|
1207
1207
|
"use strict";
|
|
1208
1208
|
var fs3 = require_fs();
|
|
1209
|
-
var
|
|
1209
|
+
var path5 = require("path");
|
|
1210
1210
|
var { mkdirs } = require_mkdirs();
|
|
1211
1211
|
var { pathExists } = require_path_exists();
|
|
1212
1212
|
var { utimesMillis } = require_utimes();
|
|
@@ -1228,7 +1228,7 @@ var require_copy = __commonJS({
|
|
|
1228
1228
|
await stat.checkParentPaths(src, srcStat, dest, "copy");
|
|
1229
1229
|
const include = await runFilter(src, dest, opts);
|
|
1230
1230
|
if (!include) return;
|
|
1231
|
-
const destParent =
|
|
1231
|
+
const destParent = path5.dirname(dest);
|
|
1232
1232
|
const dirExists = await pathExists(destParent);
|
|
1233
1233
|
if (!dirExists) {
|
|
1234
1234
|
await mkdirs(destParent);
|
|
@@ -1282,8 +1282,8 @@ var require_copy = __commonJS({
|
|
|
1282
1282
|
}
|
|
1283
1283
|
const promises = [];
|
|
1284
1284
|
for await (const item of await fs3.opendir(src)) {
|
|
1285
|
-
const srcItem =
|
|
1286
|
-
const destItem =
|
|
1285
|
+
const srcItem = path5.join(src, item.name);
|
|
1286
|
+
const destItem = path5.join(dest, item.name);
|
|
1287
1287
|
promises.push(
|
|
1288
1288
|
runFilter(srcItem, destItem, opts).then((include) => {
|
|
1289
1289
|
if (include) {
|
|
@@ -1302,7 +1302,7 @@ var require_copy = __commonJS({
|
|
|
1302
1302
|
async function onLink(destStat, src, dest, opts) {
|
|
1303
1303
|
let resolvedSrc = await fs3.readlink(src);
|
|
1304
1304
|
if (opts.dereference) {
|
|
1305
|
-
resolvedSrc =
|
|
1305
|
+
resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
|
|
1306
1306
|
}
|
|
1307
1307
|
if (!destStat) {
|
|
1308
1308
|
return fs3.symlink(resolvedSrc, dest);
|
|
@@ -1315,7 +1315,7 @@ var require_copy = __commonJS({
|
|
|
1315
1315
|
throw e;
|
|
1316
1316
|
}
|
|
1317
1317
|
if (opts.dereference) {
|
|
1318
|
-
resolvedDest =
|
|
1318
|
+
resolvedDest = path5.resolve(process.cwd(), resolvedDest);
|
|
1319
1319
|
}
|
|
1320
1320
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
1321
1321
|
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
@@ -1335,7 +1335,7 @@ var require_copy_sync = __commonJS({
|
|
|
1335
1335
|
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) {
|
|
1336
1336
|
"use strict";
|
|
1337
1337
|
var fs3 = require_graceful_fs();
|
|
1338
|
-
var
|
|
1338
|
+
var path5 = require("path");
|
|
1339
1339
|
var mkdirsSync = require_mkdirs().mkdirsSync;
|
|
1340
1340
|
var utimesMillisSync = require_utimes().utimesMillisSync;
|
|
1341
1341
|
var stat = require_stat();
|
|
@@ -1356,7 +1356,7 @@ var require_copy_sync = __commonJS({
|
|
|
1356
1356
|
const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
|
|
1357
1357
|
stat.checkParentPathsSync(src, srcStat, dest, "copy");
|
|
1358
1358
|
if (opts.filter && !opts.filter(src, dest)) return;
|
|
1359
|
-
const destParent =
|
|
1359
|
+
const destParent = path5.dirname(dest);
|
|
1360
1360
|
if (!fs3.existsSync(destParent)) mkdirsSync(destParent);
|
|
1361
1361
|
return getStats(destStat, src, dest, opts);
|
|
1362
1362
|
}
|
|
@@ -1425,8 +1425,8 @@ var require_copy_sync = __commonJS({
|
|
|
1425
1425
|
}
|
|
1426
1426
|
}
|
|
1427
1427
|
function copyDirItem(item, src, dest, opts) {
|
|
1428
|
-
const srcItem =
|
|
1429
|
-
const destItem =
|
|
1428
|
+
const srcItem = path5.join(src, item);
|
|
1429
|
+
const destItem = path5.join(dest, item);
|
|
1430
1430
|
if (opts.filter && !opts.filter(srcItem, destItem)) return;
|
|
1431
1431
|
const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
|
|
1432
1432
|
return getStats(destStat, srcItem, destItem, opts);
|
|
@@ -1434,7 +1434,7 @@ var require_copy_sync = __commonJS({
|
|
|
1434
1434
|
function onLink(destStat, src, dest, opts) {
|
|
1435
1435
|
let resolvedSrc = fs3.readlinkSync(src);
|
|
1436
1436
|
if (opts.dereference) {
|
|
1437
|
-
resolvedSrc =
|
|
1437
|
+
resolvedSrc = path5.resolve(process.cwd(), resolvedSrc);
|
|
1438
1438
|
}
|
|
1439
1439
|
if (!destStat) {
|
|
1440
1440
|
return fs3.symlinkSync(resolvedSrc, dest);
|
|
@@ -1447,7 +1447,7 @@ var require_copy_sync = __commonJS({
|
|
|
1447
1447
|
throw err;
|
|
1448
1448
|
}
|
|
1449
1449
|
if (opts.dereference) {
|
|
1450
|
-
resolvedDest =
|
|
1450
|
+
resolvedDest = path5.resolve(process.cwd(), resolvedDest);
|
|
1451
1451
|
}
|
|
1452
1452
|
if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
|
|
1453
1453
|
throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
|
|
@@ -1484,11 +1484,11 @@ var require_remove = __commonJS({
|
|
|
1484
1484
|
"use strict";
|
|
1485
1485
|
var fs3 = require_graceful_fs();
|
|
1486
1486
|
var u = require_universalify().fromCallback;
|
|
1487
|
-
function remove(
|
|
1488
|
-
fs3.rm(
|
|
1487
|
+
function remove(path5, callback) {
|
|
1488
|
+
fs3.rm(path5, { recursive: true, force: true }, callback);
|
|
1489
1489
|
}
|
|
1490
|
-
function removeSync(
|
|
1491
|
-
fs3.rmSync(
|
|
1490
|
+
function removeSync(path5) {
|
|
1491
|
+
fs3.rmSync(path5, { recursive: true, force: true });
|
|
1492
1492
|
}
|
|
1493
1493
|
module2.exports = {
|
|
1494
1494
|
remove: u(remove),
|
|
@@ -1503,7 +1503,7 @@ var require_empty = __commonJS({
|
|
|
1503
1503
|
"use strict";
|
|
1504
1504
|
var u = require_universalify().fromPromise;
|
|
1505
1505
|
var fs3 = require_fs();
|
|
1506
|
-
var
|
|
1506
|
+
var path5 = require("path");
|
|
1507
1507
|
var mkdir = require_mkdirs();
|
|
1508
1508
|
var remove = require_remove();
|
|
1509
1509
|
var emptyDir = u(async function emptyDir2(dir) {
|
|
@@ -1513,7 +1513,7 @@ var require_empty = __commonJS({
|
|
|
1513
1513
|
} catch {
|
|
1514
1514
|
return mkdir.mkdirs(dir);
|
|
1515
1515
|
}
|
|
1516
|
-
return Promise.all(items.map((item) => remove.remove(
|
|
1516
|
+
return Promise.all(items.map((item) => remove.remove(path5.join(dir, item))));
|
|
1517
1517
|
});
|
|
1518
1518
|
function emptyDirSync(dir) {
|
|
1519
1519
|
let items;
|
|
@@ -1523,7 +1523,7 @@ var require_empty = __commonJS({
|
|
|
1523
1523
|
return mkdir.mkdirsSync(dir);
|
|
1524
1524
|
}
|
|
1525
1525
|
items.forEach((item) => {
|
|
1526
|
-
item =
|
|
1526
|
+
item = path5.join(dir, item);
|
|
1527
1527
|
remove.removeSync(item);
|
|
1528
1528
|
});
|
|
1529
1529
|
}
|
|
@@ -1541,7 +1541,7 @@ var require_file = __commonJS({
|
|
|
1541
1541
|
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) {
|
|
1542
1542
|
"use strict";
|
|
1543
1543
|
var u = require_universalify().fromPromise;
|
|
1544
|
-
var
|
|
1544
|
+
var path5 = require("path");
|
|
1545
1545
|
var fs3 = require_fs();
|
|
1546
1546
|
var mkdir = require_mkdirs();
|
|
1547
1547
|
async function createFile(file4) {
|
|
@@ -1551,7 +1551,7 @@ var require_file = __commonJS({
|
|
|
1551
1551
|
} catch {
|
|
1552
1552
|
}
|
|
1553
1553
|
if (stats && stats.isFile()) return;
|
|
1554
|
-
const dir =
|
|
1554
|
+
const dir = path5.dirname(file4);
|
|
1555
1555
|
let dirStats = null;
|
|
1556
1556
|
try {
|
|
1557
1557
|
dirStats = await fs3.stat(dir);
|
|
@@ -1577,7 +1577,7 @@ var require_file = __commonJS({
|
|
|
1577
1577
|
} catch {
|
|
1578
1578
|
}
|
|
1579
1579
|
if (stats && stats.isFile()) return;
|
|
1580
|
-
const dir =
|
|
1580
|
+
const dir = path5.dirname(file4);
|
|
1581
1581
|
try {
|
|
1582
1582
|
if (!fs3.statSync(dir).isDirectory()) {
|
|
1583
1583
|
fs3.readdirSync(dir);
|
|
@@ -1600,7 +1600,7 @@ var require_link = __commonJS({
|
|
|
1600
1600
|
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) {
|
|
1601
1601
|
"use strict";
|
|
1602
1602
|
var u = require_universalify().fromPromise;
|
|
1603
|
-
var
|
|
1603
|
+
var path5 = require("path");
|
|
1604
1604
|
var fs3 = require_fs();
|
|
1605
1605
|
var mkdir = require_mkdirs();
|
|
1606
1606
|
var { pathExists } = require_path_exists();
|
|
@@ -1619,7 +1619,7 @@ var require_link = __commonJS({
|
|
|
1619
1619
|
throw err;
|
|
1620
1620
|
}
|
|
1621
1621
|
if (dstStat && areIdentical(srcStat, dstStat)) return;
|
|
1622
|
-
const dir =
|
|
1622
|
+
const dir = path5.dirname(dstpath);
|
|
1623
1623
|
const dirExists = await pathExists(dir);
|
|
1624
1624
|
if (!dirExists) {
|
|
1625
1625
|
await mkdir.mkdirs(dir);
|
|
@@ -1639,7 +1639,7 @@ var require_link = __commonJS({
|
|
|
1639
1639
|
err.message = err.message.replace("lstat", "ensureLink");
|
|
1640
1640
|
throw err;
|
|
1641
1641
|
}
|
|
1642
|
-
const dir =
|
|
1642
|
+
const dir = path5.dirname(dstpath);
|
|
1643
1643
|
const dirExists = fs3.existsSync(dir);
|
|
1644
1644
|
if (dirExists) return fs3.linkSync(srcpath, dstpath);
|
|
1645
1645
|
mkdir.mkdirsSync(dir);
|
|
@@ -1656,12 +1656,12 @@ var require_link = __commonJS({
|
|
|
1656
1656
|
var require_symlink_paths = __commonJS({
|
|
1657
1657
|
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) {
|
|
1658
1658
|
"use strict";
|
|
1659
|
-
var
|
|
1659
|
+
var path5 = require("path");
|
|
1660
1660
|
var fs3 = require_fs();
|
|
1661
1661
|
var { pathExists } = require_path_exists();
|
|
1662
1662
|
var u = require_universalify().fromPromise;
|
|
1663
1663
|
async function symlinkPaths(srcpath, dstpath) {
|
|
1664
|
-
if (
|
|
1664
|
+
if (path5.isAbsolute(srcpath)) {
|
|
1665
1665
|
try {
|
|
1666
1666
|
await fs3.lstat(srcpath);
|
|
1667
1667
|
} catch (err) {
|
|
@@ -1673,8 +1673,8 @@ var require_symlink_paths = __commonJS({
|
|
|
1673
1673
|
toDst: srcpath
|
|
1674
1674
|
};
|
|
1675
1675
|
}
|
|
1676
|
-
const dstdir =
|
|
1677
|
-
const relativeToDst =
|
|
1676
|
+
const dstdir = path5.dirname(dstpath);
|
|
1677
|
+
const relativeToDst = path5.join(dstdir, srcpath);
|
|
1678
1678
|
const exists = await pathExists(relativeToDst);
|
|
1679
1679
|
if (exists) {
|
|
1680
1680
|
return {
|
|
@@ -1690,11 +1690,11 @@ var require_symlink_paths = __commonJS({
|
|
|
1690
1690
|
}
|
|
1691
1691
|
return {
|
|
1692
1692
|
toCwd: srcpath,
|
|
1693
|
-
toDst:
|
|
1693
|
+
toDst: path5.relative(dstdir, srcpath)
|
|
1694
1694
|
};
|
|
1695
1695
|
}
|
|
1696
1696
|
function symlinkPathsSync(srcpath, dstpath) {
|
|
1697
|
-
if (
|
|
1697
|
+
if (path5.isAbsolute(srcpath)) {
|
|
1698
1698
|
const exists2 = fs3.existsSync(srcpath);
|
|
1699
1699
|
if (!exists2) throw new Error("absolute srcpath does not exist");
|
|
1700
1700
|
return {
|
|
@@ -1702,8 +1702,8 @@ var require_symlink_paths = __commonJS({
|
|
|
1702
1702
|
toDst: srcpath
|
|
1703
1703
|
};
|
|
1704
1704
|
}
|
|
1705
|
-
const dstdir =
|
|
1706
|
-
const relativeToDst =
|
|
1705
|
+
const dstdir = path5.dirname(dstpath);
|
|
1706
|
+
const relativeToDst = path5.join(dstdir, srcpath);
|
|
1707
1707
|
const exists = fs3.existsSync(relativeToDst);
|
|
1708
1708
|
if (exists) {
|
|
1709
1709
|
return {
|
|
@@ -1715,7 +1715,7 @@ var require_symlink_paths = __commonJS({
|
|
|
1715
1715
|
if (!srcExists) throw new Error("relative srcpath does not exist");
|
|
1716
1716
|
return {
|
|
1717
1717
|
toCwd: srcpath,
|
|
1718
|
-
toDst:
|
|
1718
|
+
toDst: path5.relative(dstdir, srcpath)
|
|
1719
1719
|
};
|
|
1720
1720
|
}
|
|
1721
1721
|
module2.exports = {
|
|
@@ -1763,7 +1763,7 @@ var require_symlink = __commonJS({
|
|
|
1763
1763
|
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) {
|
|
1764
1764
|
"use strict";
|
|
1765
1765
|
var u = require_universalify().fromPromise;
|
|
1766
|
-
var
|
|
1766
|
+
var path5 = require("path");
|
|
1767
1767
|
var fs3 = require_fs();
|
|
1768
1768
|
var { mkdirs, mkdirsSync } = require_mkdirs();
|
|
1769
1769
|
var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
|
|
@@ -1786,7 +1786,7 @@ var require_symlink = __commonJS({
|
|
|
1786
1786
|
const relative = await symlinkPaths(srcpath, dstpath);
|
|
1787
1787
|
srcpath = relative.toDst;
|
|
1788
1788
|
const toType = await symlinkType(relative.toCwd, type);
|
|
1789
|
-
const dir =
|
|
1789
|
+
const dir = path5.dirname(dstpath);
|
|
1790
1790
|
if (!await pathExists(dir)) {
|
|
1791
1791
|
await mkdirs(dir);
|
|
1792
1792
|
}
|
|
@@ -1806,7 +1806,7 @@ var require_symlink = __commonJS({
|
|
|
1806
1806
|
const relative = symlinkPathsSync(srcpath, dstpath);
|
|
1807
1807
|
srcpath = relative.toDst;
|
|
1808
1808
|
type = symlinkTypeSync(relative.toCwd, type);
|
|
1809
|
-
const dir =
|
|
1809
|
+
const dir = path5.dirname(dstpath);
|
|
1810
1810
|
const exists = fs3.existsSync(dir);
|
|
1811
1811
|
if (exists) return fs3.symlinkSync(srcpath, dstpath, type);
|
|
1812
1812
|
mkdirsSync(dir);
|
|
@@ -1897,7 +1897,7 @@ var require_jsonfile = __commonJS({
|
|
|
1897
1897
|
return obj;
|
|
1898
1898
|
}
|
|
1899
1899
|
var readFile = universalify.fromPromise(_readFile);
|
|
1900
|
-
function
|
|
1900
|
+
function readFileSync(file4, options = {}) {
|
|
1901
1901
|
if (typeof options === "string") {
|
|
1902
1902
|
options = { encoding: options };
|
|
1903
1903
|
}
|
|
@@ -1929,7 +1929,7 @@ var require_jsonfile = __commonJS({
|
|
|
1929
1929
|
}
|
|
1930
1930
|
var jsonfile = {
|
|
1931
1931
|
readFile,
|
|
1932
|
-
readFileSync
|
|
1932
|
+
readFileSync,
|
|
1933
1933
|
writeFile,
|
|
1934
1934
|
writeFileSync
|
|
1935
1935
|
};
|
|
@@ -1958,18 +1958,18 @@ var require_output_file = __commonJS({
|
|
|
1958
1958
|
"use strict";
|
|
1959
1959
|
var u = require_universalify().fromPromise;
|
|
1960
1960
|
var fs3 = require_fs();
|
|
1961
|
-
var
|
|
1961
|
+
var path5 = require("path");
|
|
1962
1962
|
var mkdir = require_mkdirs();
|
|
1963
1963
|
var pathExists = require_path_exists().pathExists;
|
|
1964
1964
|
async function outputFile(file4, data, encoding = "utf-8") {
|
|
1965
|
-
const dir =
|
|
1965
|
+
const dir = path5.dirname(file4);
|
|
1966
1966
|
if (!await pathExists(dir)) {
|
|
1967
1967
|
await mkdir.mkdirs(dir);
|
|
1968
1968
|
}
|
|
1969
1969
|
return fs3.writeFile(file4, data, encoding);
|
|
1970
1970
|
}
|
|
1971
1971
|
function outputFileSync(file4, ...args) {
|
|
1972
|
-
const dir =
|
|
1972
|
+
const dir = path5.dirname(file4);
|
|
1973
1973
|
if (!fs3.existsSync(dir)) {
|
|
1974
1974
|
mkdir.mkdirsSync(dir);
|
|
1975
1975
|
}
|
|
@@ -2033,7 +2033,7 @@ var require_move = __commonJS({
|
|
|
2033
2033
|
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/move/move.js"(exports2, module2) {
|
|
2034
2034
|
"use strict";
|
|
2035
2035
|
var fs3 = require_fs();
|
|
2036
|
-
var
|
|
2036
|
+
var path5 = require("path");
|
|
2037
2037
|
var { copy } = require_copy2();
|
|
2038
2038
|
var { remove } = require_remove();
|
|
2039
2039
|
var { mkdirp } = require_mkdirs();
|
|
@@ -2043,8 +2043,8 @@ var require_move = __commonJS({
|
|
|
2043
2043
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
2044
2044
|
const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
|
|
2045
2045
|
await stat.checkParentPaths(src, srcStat, dest, "move");
|
|
2046
|
-
const destParent =
|
|
2047
|
-
const parsedParentPath =
|
|
2046
|
+
const destParent = path5.dirname(dest);
|
|
2047
|
+
const parsedParentPath = path5.parse(destParent);
|
|
2048
2048
|
if (parsedParentPath.root !== destParent) {
|
|
2049
2049
|
await mkdirp(destParent);
|
|
2050
2050
|
}
|
|
@@ -2085,7 +2085,7 @@ var require_move_sync = __commonJS({
|
|
|
2085
2085
|
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) {
|
|
2086
2086
|
"use strict";
|
|
2087
2087
|
var fs3 = require_graceful_fs();
|
|
2088
|
-
var
|
|
2088
|
+
var path5 = require("path");
|
|
2089
2089
|
var copySync = require_copy2().copySync;
|
|
2090
2090
|
var removeSync = require_remove().removeSync;
|
|
2091
2091
|
var mkdirpSync = require_mkdirs().mkdirpSync;
|
|
@@ -2095,12 +2095,12 @@ var require_move_sync = __commonJS({
|
|
|
2095
2095
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
2096
2096
|
const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
|
|
2097
2097
|
stat.checkParentPathsSync(src, srcStat, dest, "move");
|
|
2098
|
-
if (!isParentRoot(dest)) mkdirpSync(
|
|
2098
|
+
if (!isParentRoot(dest)) mkdirpSync(path5.dirname(dest));
|
|
2099
2099
|
return doRename(src, dest, overwrite, isChangingCase);
|
|
2100
2100
|
}
|
|
2101
2101
|
function isParentRoot(dest) {
|
|
2102
|
-
const parent =
|
|
2103
|
-
const parsedPath =
|
|
2102
|
+
const parent = path5.dirname(dest);
|
|
2103
|
+
const parsedPath = path5.parse(parent);
|
|
2104
2104
|
return parsedPath.root === parent;
|
|
2105
2105
|
}
|
|
2106
2106
|
function doRename(src, dest, overwrite, isChangingCase) {
|
|
@@ -2166,547 +2166,6 @@ var require_lib = __commonJS({
|
|
|
2166
2166
|
}
|
|
2167
2167
|
});
|
|
2168
2168
|
|
|
2169
|
-
// ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js
|
|
2170
|
-
var require_windows = __commonJS({
|
|
2171
|
-
"../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports2, module2) {
|
|
2172
|
-
"use strict";
|
|
2173
|
-
module2.exports = isexe;
|
|
2174
|
-
isexe.sync = sync;
|
|
2175
|
-
var fs3 = require("fs");
|
|
2176
|
-
function checkPathExt(path9, options) {
|
|
2177
|
-
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
2178
|
-
if (!pathext) {
|
|
2179
|
-
return true;
|
|
2180
|
-
}
|
|
2181
|
-
pathext = pathext.split(";");
|
|
2182
|
-
if (pathext.indexOf("") !== -1) {
|
|
2183
|
-
return true;
|
|
2184
|
-
}
|
|
2185
|
-
for (var i = 0; i < pathext.length; i++) {
|
|
2186
|
-
var p = pathext[i].toLowerCase();
|
|
2187
|
-
if (p && path9.substr(-p.length).toLowerCase() === p) {
|
|
2188
|
-
return true;
|
|
2189
|
-
}
|
|
2190
|
-
}
|
|
2191
|
-
return false;
|
|
2192
|
-
}
|
|
2193
|
-
function checkStat(stat, path9, options) {
|
|
2194
|
-
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
2195
|
-
return false;
|
|
2196
|
-
}
|
|
2197
|
-
return checkPathExt(path9, options);
|
|
2198
|
-
}
|
|
2199
|
-
function isexe(path9, options, cb) {
|
|
2200
|
-
fs3.stat(path9, function(er, stat) {
|
|
2201
|
-
cb(er, er ? false : checkStat(stat, path9, options));
|
|
2202
|
-
});
|
|
2203
|
-
}
|
|
2204
|
-
function sync(path9, options) {
|
|
2205
|
-
return checkStat(fs3.statSync(path9), path9, options);
|
|
2206
|
-
}
|
|
2207
|
-
}
|
|
2208
|
-
});
|
|
2209
|
-
|
|
2210
|
-
// ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js
|
|
2211
|
-
var require_mode = __commonJS({
|
|
2212
|
-
"../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports2, module2) {
|
|
2213
|
-
"use strict";
|
|
2214
|
-
module2.exports = isexe;
|
|
2215
|
-
isexe.sync = sync;
|
|
2216
|
-
var fs3 = require("fs");
|
|
2217
|
-
function isexe(path9, options, cb) {
|
|
2218
|
-
fs3.stat(path9, function(er, stat) {
|
|
2219
|
-
cb(er, er ? false : checkStat(stat, options));
|
|
2220
|
-
});
|
|
2221
|
-
}
|
|
2222
|
-
function sync(path9, options) {
|
|
2223
|
-
return checkStat(fs3.statSync(path9), options);
|
|
2224
|
-
}
|
|
2225
|
-
function checkStat(stat, options) {
|
|
2226
|
-
return stat.isFile() && checkMode(stat, options);
|
|
2227
|
-
}
|
|
2228
|
-
function checkMode(stat, options) {
|
|
2229
|
-
var mod = stat.mode;
|
|
2230
|
-
var uid = stat.uid;
|
|
2231
|
-
var gid = stat.gid;
|
|
2232
|
-
var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
|
|
2233
|
-
var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
|
|
2234
|
-
var u = parseInt("100", 8);
|
|
2235
|
-
var g = parseInt("010", 8);
|
|
2236
|
-
var o = parseInt("001", 8);
|
|
2237
|
-
var ug = u | g;
|
|
2238
|
-
var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
|
|
2239
|
-
return ret;
|
|
2240
|
-
}
|
|
2241
|
-
}
|
|
2242
|
-
});
|
|
2243
|
-
|
|
2244
|
-
// ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
|
|
2245
|
-
var require_isexe = __commonJS({
|
|
2246
|
-
"../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports2, module2) {
|
|
2247
|
-
"use strict";
|
|
2248
|
-
var fs3 = require("fs");
|
|
2249
|
-
var core;
|
|
2250
|
-
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
2251
|
-
core = require_windows();
|
|
2252
|
-
} else {
|
|
2253
|
-
core = require_mode();
|
|
2254
|
-
}
|
|
2255
|
-
module2.exports = isexe;
|
|
2256
|
-
isexe.sync = sync;
|
|
2257
|
-
function isexe(path9, options, cb) {
|
|
2258
|
-
if (typeof options === "function") {
|
|
2259
|
-
cb = options;
|
|
2260
|
-
options = {};
|
|
2261
|
-
}
|
|
2262
|
-
if (!cb) {
|
|
2263
|
-
if (typeof Promise !== "function") {
|
|
2264
|
-
throw new TypeError("callback not provided");
|
|
2265
|
-
}
|
|
2266
|
-
return new Promise(function(resolve, reject) {
|
|
2267
|
-
isexe(path9, options || {}, function(er, is) {
|
|
2268
|
-
if (er) {
|
|
2269
|
-
reject(er);
|
|
2270
|
-
} else {
|
|
2271
|
-
resolve(is);
|
|
2272
|
-
}
|
|
2273
|
-
});
|
|
2274
|
-
});
|
|
2275
|
-
}
|
|
2276
|
-
core(path9, options || {}, function(er, is) {
|
|
2277
|
-
if (er) {
|
|
2278
|
-
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
2279
|
-
er = null;
|
|
2280
|
-
is = false;
|
|
2281
|
-
}
|
|
2282
|
-
}
|
|
2283
|
-
cb(er, is);
|
|
2284
|
-
});
|
|
2285
|
-
}
|
|
2286
|
-
function sync(path9, options) {
|
|
2287
|
-
try {
|
|
2288
|
-
return core.sync(path9, options || {});
|
|
2289
|
-
} catch (er) {
|
|
2290
|
-
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
2291
|
-
return false;
|
|
2292
|
-
} else {
|
|
2293
|
-
throw er;
|
|
2294
|
-
}
|
|
2295
|
-
}
|
|
2296
|
-
}
|
|
2297
|
-
}
|
|
2298
|
-
});
|
|
2299
|
-
|
|
2300
|
-
// ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
|
|
2301
|
-
var require_which = __commonJS({
|
|
2302
|
-
"../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports2, module2) {
|
|
2303
|
-
"use strict";
|
|
2304
|
-
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
2305
|
-
var path9 = require("path");
|
|
2306
|
-
var COLON = isWindows ? ";" : ":";
|
|
2307
|
-
var isexe = require_isexe();
|
|
2308
|
-
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
2309
|
-
var getPathInfo = (cmd, opt) => {
|
|
2310
|
-
const colon = opt.colon || COLON;
|
|
2311
|
-
const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [""] : [
|
|
2312
|
-
// windows always checks the cwd first
|
|
2313
|
-
...isWindows ? [process.cwd()] : [],
|
|
2314
|
-
...(opt.path || process.env.PATH || /* istanbul ignore next: very unusual */
|
|
2315
|
-
"").split(colon)
|
|
2316
|
-
];
|
|
2317
|
-
const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || ".EXE;.CMD;.BAT;.COM" : "";
|
|
2318
|
-
const pathExt = isWindows ? pathExtExe.split(colon) : [""];
|
|
2319
|
-
if (isWindows) {
|
|
2320
|
-
if (cmd.indexOf(".") !== -1 && pathExt[0] !== "")
|
|
2321
|
-
pathExt.unshift("");
|
|
2322
|
-
}
|
|
2323
|
-
return {
|
|
2324
|
-
pathEnv,
|
|
2325
|
-
pathExt,
|
|
2326
|
-
pathExtExe
|
|
2327
|
-
};
|
|
2328
|
-
};
|
|
2329
|
-
var which = (cmd, opt, cb) => {
|
|
2330
|
-
if (typeof opt === "function") {
|
|
2331
|
-
cb = opt;
|
|
2332
|
-
opt = {};
|
|
2333
|
-
}
|
|
2334
|
-
if (!opt)
|
|
2335
|
-
opt = {};
|
|
2336
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
2337
|
-
const found = [];
|
|
2338
|
-
const step = (i) => new Promise((resolve, reject) => {
|
|
2339
|
-
if (i === pathEnv.length)
|
|
2340
|
-
return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
|
|
2341
|
-
const ppRaw = pathEnv[i];
|
|
2342
|
-
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
2343
|
-
const pCmd = path9.join(pathPart, cmd);
|
|
2344
|
-
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
2345
|
-
resolve(subStep(p, i, 0));
|
|
2346
|
-
});
|
|
2347
|
-
const subStep = (p, i, ii) => new Promise((resolve, reject) => {
|
|
2348
|
-
if (ii === pathExt.length)
|
|
2349
|
-
return resolve(step(i + 1));
|
|
2350
|
-
const ext = pathExt[ii];
|
|
2351
|
-
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
2352
|
-
if (!er && is) {
|
|
2353
|
-
if (opt.all)
|
|
2354
|
-
found.push(p + ext);
|
|
2355
|
-
else
|
|
2356
|
-
return resolve(p + ext);
|
|
2357
|
-
}
|
|
2358
|
-
return resolve(subStep(p, i, ii + 1));
|
|
2359
|
-
});
|
|
2360
|
-
});
|
|
2361
|
-
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
2362
|
-
};
|
|
2363
|
-
var whichSync = (cmd, opt) => {
|
|
2364
|
-
opt = opt || {};
|
|
2365
|
-
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
2366
|
-
const found = [];
|
|
2367
|
-
for (let i = 0; i < pathEnv.length; i++) {
|
|
2368
|
-
const ppRaw = pathEnv[i];
|
|
2369
|
-
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
2370
|
-
const pCmd = path9.join(pathPart, cmd);
|
|
2371
|
-
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
2372
|
-
for (let j = 0; j < pathExt.length; j++) {
|
|
2373
|
-
const cur = p + pathExt[j];
|
|
2374
|
-
try {
|
|
2375
|
-
const is = isexe.sync(cur, { pathExt: pathExtExe });
|
|
2376
|
-
if (is) {
|
|
2377
|
-
if (opt.all)
|
|
2378
|
-
found.push(cur);
|
|
2379
|
-
else
|
|
2380
|
-
return cur;
|
|
2381
|
-
}
|
|
2382
|
-
} catch (ex) {
|
|
2383
|
-
}
|
|
2384
|
-
}
|
|
2385
|
-
}
|
|
2386
|
-
if (opt.all && found.length)
|
|
2387
|
-
return found;
|
|
2388
|
-
if (opt.nothrow)
|
|
2389
|
-
return null;
|
|
2390
|
-
throw getNotFoundError(cmd);
|
|
2391
|
-
};
|
|
2392
|
-
module2.exports = which;
|
|
2393
|
-
which.sync = whichSync;
|
|
2394
|
-
}
|
|
2395
|
-
});
|
|
2396
|
-
|
|
2397
|
-
// ../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js
|
|
2398
|
-
var require_path_key = __commonJS({
|
|
2399
|
-
"../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js"(exports2, module2) {
|
|
2400
|
-
"use strict";
|
|
2401
|
-
var pathKey2 = (options = {}) => {
|
|
2402
|
-
const environment = options.env || process.env;
|
|
2403
|
-
const platform = options.platform || process.platform;
|
|
2404
|
-
if (platform !== "win32") {
|
|
2405
|
-
return "PATH";
|
|
2406
|
-
}
|
|
2407
|
-
return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
2408
|
-
};
|
|
2409
|
-
module2.exports = pathKey2;
|
|
2410
|
-
module2.exports.default = pathKey2;
|
|
2411
|
-
}
|
|
2412
|
-
});
|
|
2413
|
-
|
|
2414
|
-
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
|
|
2415
|
-
var require_resolveCommand = __commonJS({
|
|
2416
|
-
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports2, module2) {
|
|
2417
|
-
"use strict";
|
|
2418
|
-
var path9 = require("path");
|
|
2419
|
-
var which = require_which();
|
|
2420
|
-
var getPathKey = require_path_key();
|
|
2421
|
-
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
2422
|
-
const env = parsed.options.env || process.env;
|
|
2423
|
-
const cwd = process.cwd();
|
|
2424
|
-
const hasCustomCwd = parsed.options.cwd != null;
|
|
2425
|
-
const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
|
|
2426
|
-
if (shouldSwitchCwd) {
|
|
2427
|
-
try {
|
|
2428
|
-
process.chdir(parsed.options.cwd);
|
|
2429
|
-
} catch (err) {
|
|
2430
|
-
}
|
|
2431
|
-
}
|
|
2432
|
-
let resolved;
|
|
2433
|
-
try {
|
|
2434
|
-
resolved = which.sync(parsed.command, {
|
|
2435
|
-
path: env[getPathKey({ env })],
|
|
2436
|
-
pathExt: withoutPathExt ? path9.delimiter : void 0
|
|
2437
|
-
});
|
|
2438
|
-
} catch (e) {
|
|
2439
|
-
} finally {
|
|
2440
|
-
if (shouldSwitchCwd) {
|
|
2441
|
-
process.chdir(cwd);
|
|
2442
|
-
}
|
|
2443
|
-
}
|
|
2444
|
-
if (resolved) {
|
|
2445
|
-
resolved = path9.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
2446
|
-
}
|
|
2447
|
-
return resolved;
|
|
2448
|
-
}
|
|
2449
|
-
function resolveCommand(parsed) {
|
|
2450
|
-
return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
|
|
2451
|
-
}
|
|
2452
|
-
module2.exports = resolveCommand;
|
|
2453
|
-
}
|
|
2454
|
-
});
|
|
2455
|
-
|
|
2456
|
-
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js
|
|
2457
|
-
var require_escape = __commonJS({
|
|
2458
|
-
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js"(exports2, module2) {
|
|
2459
|
-
"use strict";
|
|
2460
|
-
var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
2461
|
-
function escapeCommand(arg) {
|
|
2462
|
-
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
2463
|
-
return arg;
|
|
2464
|
-
}
|
|
2465
|
-
function escapeArgument(arg, doubleEscapeMetaChars) {
|
|
2466
|
-
arg = `${arg}`;
|
|
2467
|
-
arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
|
|
2468
|
-
arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
|
|
2469
|
-
arg = `"${arg}"`;
|
|
2470
|
-
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
2471
|
-
if (doubleEscapeMetaChars) {
|
|
2472
|
-
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
2473
|
-
}
|
|
2474
|
-
return arg;
|
|
2475
|
-
}
|
|
2476
|
-
module2.exports.command = escapeCommand;
|
|
2477
|
-
module2.exports.argument = escapeArgument;
|
|
2478
|
-
}
|
|
2479
|
-
});
|
|
2480
|
-
|
|
2481
|
-
// ../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js
|
|
2482
|
-
var require_shebang_regex = __commonJS({
|
|
2483
|
-
"../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js"(exports2, module2) {
|
|
2484
|
-
"use strict";
|
|
2485
|
-
module2.exports = /^#!(.*)/;
|
|
2486
|
-
}
|
|
2487
|
-
});
|
|
2488
|
-
|
|
2489
|
-
// ../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js
|
|
2490
|
-
var require_shebang_command = __commonJS({
|
|
2491
|
-
"../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js"(exports2, module2) {
|
|
2492
|
-
"use strict";
|
|
2493
|
-
var shebangRegex = require_shebang_regex();
|
|
2494
|
-
module2.exports = (string = "") => {
|
|
2495
|
-
const match2 = string.match(shebangRegex);
|
|
2496
|
-
if (!match2) {
|
|
2497
|
-
return null;
|
|
2498
|
-
}
|
|
2499
|
-
const [path9, argument] = match2[0].replace(/#! ?/, "").split(" ");
|
|
2500
|
-
const binary = path9.split("/").pop();
|
|
2501
|
-
if (binary === "env") {
|
|
2502
|
-
return argument;
|
|
2503
|
-
}
|
|
2504
|
-
return argument ? `${binary} ${argument}` : binary;
|
|
2505
|
-
};
|
|
2506
|
-
}
|
|
2507
|
-
});
|
|
2508
|
-
|
|
2509
|
-
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
|
|
2510
|
-
var require_readShebang = __commonJS({
|
|
2511
|
-
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js"(exports2, module2) {
|
|
2512
|
-
"use strict";
|
|
2513
|
-
var fs3 = require("fs");
|
|
2514
|
-
var shebangCommand = require_shebang_command();
|
|
2515
|
-
function readShebang(command) {
|
|
2516
|
-
const size = 150;
|
|
2517
|
-
const buffer = Buffer.alloc(size);
|
|
2518
|
-
let fd;
|
|
2519
|
-
try {
|
|
2520
|
-
fd = fs3.openSync(command, "r");
|
|
2521
|
-
fs3.readSync(fd, buffer, 0, size, 0);
|
|
2522
|
-
fs3.closeSync(fd);
|
|
2523
|
-
} catch (e) {
|
|
2524
|
-
}
|
|
2525
|
-
return shebangCommand(buffer.toString());
|
|
2526
|
-
}
|
|
2527
|
-
module2.exports = readShebang;
|
|
2528
|
-
}
|
|
2529
|
-
});
|
|
2530
|
-
|
|
2531
|
-
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
|
|
2532
|
-
var require_parse = __commonJS({
|
|
2533
|
-
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports2, module2) {
|
|
2534
|
-
"use strict";
|
|
2535
|
-
var path9 = require("path");
|
|
2536
|
-
var resolveCommand = require_resolveCommand();
|
|
2537
|
-
var escape = require_escape();
|
|
2538
|
-
var readShebang = require_readShebang();
|
|
2539
|
-
var isWin = process.platform === "win32";
|
|
2540
|
-
var isExecutableRegExp = /\.(?:com|exe)$/i;
|
|
2541
|
-
var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
2542
|
-
function detectShebang(parsed) {
|
|
2543
|
-
parsed.file = resolveCommand(parsed);
|
|
2544
|
-
const shebang = parsed.file && readShebang(parsed.file);
|
|
2545
|
-
if (shebang) {
|
|
2546
|
-
parsed.args.unshift(parsed.file);
|
|
2547
|
-
parsed.command = shebang;
|
|
2548
|
-
return resolveCommand(parsed);
|
|
2549
|
-
}
|
|
2550
|
-
return parsed.file;
|
|
2551
|
-
}
|
|
2552
|
-
function parseNonShell(parsed) {
|
|
2553
|
-
if (!isWin) {
|
|
2554
|
-
return parsed;
|
|
2555
|
-
}
|
|
2556
|
-
const commandFile = detectShebang(parsed);
|
|
2557
|
-
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
2558
|
-
if (parsed.options.forceShell || needsShell) {
|
|
2559
|
-
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
2560
|
-
parsed.command = path9.normalize(parsed.command);
|
|
2561
|
-
parsed.command = escape.command(parsed.command);
|
|
2562
|
-
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
2563
|
-
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
2564
|
-
parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
|
|
2565
|
-
parsed.command = process.env.comspec || "cmd.exe";
|
|
2566
|
-
parsed.options.windowsVerbatimArguments = true;
|
|
2567
|
-
}
|
|
2568
|
-
return parsed;
|
|
2569
|
-
}
|
|
2570
|
-
function parse(command, args, options) {
|
|
2571
|
-
if (args && !Array.isArray(args)) {
|
|
2572
|
-
options = args;
|
|
2573
|
-
args = null;
|
|
2574
|
-
}
|
|
2575
|
-
args = args ? args.slice(0) : [];
|
|
2576
|
-
options = Object.assign({}, options);
|
|
2577
|
-
const parsed = {
|
|
2578
|
-
command,
|
|
2579
|
-
args,
|
|
2580
|
-
options,
|
|
2581
|
-
file: void 0,
|
|
2582
|
-
original: {
|
|
2583
|
-
command,
|
|
2584
|
-
args
|
|
2585
|
-
}
|
|
2586
|
-
};
|
|
2587
|
-
return options.shell ? parsed : parseNonShell(parsed);
|
|
2588
|
-
}
|
|
2589
|
-
module2.exports = parse;
|
|
2590
|
-
}
|
|
2591
|
-
});
|
|
2592
|
-
|
|
2593
|
-
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js
|
|
2594
|
-
var require_enoent = __commonJS({
|
|
2595
|
-
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js"(exports2, module2) {
|
|
2596
|
-
"use strict";
|
|
2597
|
-
var isWin = process.platform === "win32";
|
|
2598
|
-
function notFoundError(original, syscall) {
|
|
2599
|
-
return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
|
|
2600
|
-
code: "ENOENT",
|
|
2601
|
-
errno: "ENOENT",
|
|
2602
|
-
syscall: `${syscall} ${original.command}`,
|
|
2603
|
-
path: original.command,
|
|
2604
|
-
spawnargs: original.args
|
|
2605
|
-
});
|
|
2606
|
-
}
|
|
2607
|
-
function hookChildProcess(cp, parsed) {
|
|
2608
|
-
if (!isWin) {
|
|
2609
|
-
return;
|
|
2610
|
-
}
|
|
2611
|
-
const originalEmit = cp.emit;
|
|
2612
|
-
cp.emit = function(name, arg1) {
|
|
2613
|
-
if (name === "exit") {
|
|
2614
|
-
const err = verifyENOENT(arg1, parsed);
|
|
2615
|
-
if (err) {
|
|
2616
|
-
return originalEmit.call(cp, "error", err);
|
|
2617
|
-
}
|
|
2618
|
-
}
|
|
2619
|
-
return originalEmit.apply(cp, arguments);
|
|
2620
|
-
};
|
|
2621
|
-
}
|
|
2622
|
-
function verifyENOENT(status, parsed) {
|
|
2623
|
-
if (isWin && status === 1 && !parsed.file) {
|
|
2624
|
-
return notFoundError(parsed.original, "spawn");
|
|
2625
|
-
}
|
|
2626
|
-
return null;
|
|
2627
|
-
}
|
|
2628
|
-
function verifyENOENTSync(status, parsed) {
|
|
2629
|
-
if (isWin && status === 1 && !parsed.file) {
|
|
2630
|
-
return notFoundError(parsed.original, "spawnSync");
|
|
2631
|
-
}
|
|
2632
|
-
return null;
|
|
2633
|
-
}
|
|
2634
|
-
module2.exports = {
|
|
2635
|
-
hookChildProcess,
|
|
2636
|
-
verifyENOENT,
|
|
2637
|
-
verifyENOENTSync,
|
|
2638
|
-
notFoundError
|
|
2639
|
-
};
|
|
2640
|
-
}
|
|
2641
|
-
});
|
|
2642
|
-
|
|
2643
|
-
// ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js
|
|
2644
|
-
var require_cross_spawn = __commonJS({
|
|
2645
|
-
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports2, module2) {
|
|
2646
|
-
"use strict";
|
|
2647
|
-
var cp = require("child_process");
|
|
2648
|
-
var parse = require_parse();
|
|
2649
|
-
var enoent = require_enoent();
|
|
2650
|
-
function spawn(command, args, options) {
|
|
2651
|
-
const parsed = parse(command, args, options);
|
|
2652
|
-
const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
|
|
2653
|
-
enoent.hookChildProcess(spawned, parsed);
|
|
2654
|
-
return spawned;
|
|
2655
|
-
}
|
|
2656
|
-
function spawnSync(command, args, options) {
|
|
2657
|
-
const parsed = parse(command, args, options);
|
|
2658
|
-
const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
2659
|
-
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
2660
|
-
return result;
|
|
2661
|
-
}
|
|
2662
|
-
module2.exports = spawn;
|
|
2663
|
-
module2.exports.spawn = spawn;
|
|
2664
|
-
module2.exports.sync = spawnSync;
|
|
2665
|
-
module2.exports._parse = parse;
|
|
2666
|
-
module2.exports._enoent = enoent;
|
|
2667
|
-
}
|
|
2668
|
-
});
|
|
2669
|
-
|
|
2670
|
-
// ../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js
|
|
2671
|
-
var require_merge_stream = __commonJS({
|
|
2672
|
-
"../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js"(exports2, module2) {
|
|
2673
|
-
"use strict";
|
|
2674
|
-
var { PassThrough } = require("stream");
|
|
2675
|
-
module2.exports = function() {
|
|
2676
|
-
var sources = [];
|
|
2677
|
-
var output = new PassThrough({ objectMode: true });
|
|
2678
|
-
output.setMaxListeners(0);
|
|
2679
|
-
output.add = add;
|
|
2680
|
-
output.isEmpty = isEmpty;
|
|
2681
|
-
output.on("unpipe", remove);
|
|
2682
|
-
Array.prototype.slice.call(arguments).forEach(add);
|
|
2683
|
-
return output;
|
|
2684
|
-
function add(source) {
|
|
2685
|
-
if (Array.isArray(source)) {
|
|
2686
|
-
source.forEach(add);
|
|
2687
|
-
return this;
|
|
2688
|
-
}
|
|
2689
|
-
sources.push(source);
|
|
2690
|
-
source.once("end", remove.bind(null, source));
|
|
2691
|
-
source.once("error", output.emit.bind(output, "error"));
|
|
2692
|
-
source.pipe(output, { end: false });
|
|
2693
|
-
return this;
|
|
2694
|
-
}
|
|
2695
|
-
function isEmpty() {
|
|
2696
|
-
return sources.length == 0;
|
|
2697
|
-
}
|
|
2698
|
-
function remove(source) {
|
|
2699
|
-
sources = sources.filter(function(it) {
|
|
2700
|
-
return it !== source;
|
|
2701
|
-
});
|
|
2702
|
-
if (!sources.length && output.readable) {
|
|
2703
|
-
output.end();
|
|
2704
|
-
}
|
|
2705
|
-
}
|
|
2706
|
-
};
|
|
2707
|
-
}
|
|
2708
|
-
});
|
|
2709
|
-
|
|
2710
2169
|
// src/index.ts
|
|
2711
2170
|
var index_exports = {};
|
|
2712
2171
|
__export(index_exports, {
|
|
@@ -2764,12 +2223,9 @@ function getMappings(mappings, datamodel) {
|
|
|
2764
2223
|
}
|
|
2765
2224
|
|
|
2766
2225
|
// src/generateClient.ts
|
|
2767
|
-
var
|
|
2768
|
-
var
|
|
2769
|
-
var import_internals10 = require("@prisma/internals");
|
|
2770
|
-
var import_crypto2 = require("crypto");
|
|
2226
|
+
var import_internals7 = require("@prisma/internals");
|
|
2227
|
+
var import_crypto = require("crypto");
|
|
2771
2228
|
var import_env_paths = __toESM(require("env-paths"));
|
|
2772
|
-
var import_fs = require("fs");
|
|
2773
2229
|
var import_promises = __toESM(require("fs/promises"));
|
|
2774
2230
|
var import_fs_extra = __toESM(require_lib());
|
|
2775
2231
|
|
|
@@ -2823,7 +2279,7 @@ var bgWhite = init(47, 49);
|
|
|
2823
2279
|
|
|
2824
2280
|
// src/generateClient.ts
|
|
2825
2281
|
var import_package_up = require("package-up");
|
|
2826
|
-
var
|
|
2282
|
+
var import_path = __toESM(require("path"));
|
|
2827
2283
|
|
|
2828
2284
|
// ../client/package.json
|
|
2829
2285
|
var package_default = {
|
|
@@ -2855,8 +2311,7 @@ var package_default = {
|
|
|
2855
2311
|
"MSSQL",
|
|
2856
2312
|
"SQL Server",
|
|
2857
2313
|
"SQLServer",
|
|
2858
|
-
"MongoDB"
|
|
2859
|
-
"react-native"
|
|
2314
|
+
"MongoDB"
|
|
2860
2315
|
],
|
|
2861
2316
|
main: "default.js",
|
|
2862
2317
|
types: "default.d.ts",
|
|
@@ -2882,18 +2337,6 @@ var package_default = {
|
|
|
2882
2337
|
},
|
|
2883
2338
|
default: "./default.js"
|
|
2884
2339
|
},
|
|
2885
|
-
"./edge": {
|
|
2886
|
-
types: "./edge.d.ts",
|
|
2887
|
-
require: "./edge.js",
|
|
2888
|
-
import: "./edge.js",
|
|
2889
|
-
default: "./edge.js"
|
|
2890
|
-
},
|
|
2891
|
-
"./react-native": {
|
|
2892
|
-
types: "./react-native.d.ts",
|
|
2893
|
-
require: "./react-native.js",
|
|
2894
|
-
import: "./react-native.js",
|
|
2895
|
-
default: "./react-native.js"
|
|
2896
|
-
},
|
|
2897
2340
|
"./extension": {
|
|
2898
2341
|
types: "./extension.d.ts",
|
|
2899
2342
|
require: "./extension.js",
|
|
@@ -2912,11 +2355,11 @@ var package_default = {
|
|
|
2912
2355
|
import: "./index.js",
|
|
2913
2356
|
default: "./index.js"
|
|
2914
2357
|
},
|
|
2915
|
-
"./
|
|
2916
|
-
types: "./
|
|
2917
|
-
require: "./
|
|
2918
|
-
import: "./
|
|
2919
|
-
default: "./
|
|
2358
|
+
"./edge": {
|
|
2359
|
+
types: "./edge.d.ts",
|
|
2360
|
+
require: "./edge.js",
|
|
2361
|
+
import: "./edge.js",
|
|
2362
|
+
default: "./edge.js"
|
|
2920
2363
|
},
|
|
2921
2364
|
"./runtime/client": {
|
|
2922
2365
|
types: "./runtime/client.d.ts",
|
|
@@ -2928,42 +2371,12 @@ var package_default = {
|
|
|
2928
2371
|
import: "./runtime/client.mjs",
|
|
2929
2372
|
default: "./runtime/client.mjs"
|
|
2930
2373
|
},
|
|
2931
|
-
"./runtime/library": {
|
|
2932
|
-
types: "./runtime/library.d.ts",
|
|
2933
|
-
require: "./runtime/library.js",
|
|
2934
|
-
import: "./runtime/library.mjs",
|
|
2935
|
-
default: "./runtime/library.mjs"
|
|
2936
|
-
},
|
|
2937
|
-
"./runtime/binary": {
|
|
2938
|
-
types: "./runtime/binary.d.ts",
|
|
2939
|
-
require: "./runtime/binary.js",
|
|
2940
|
-
import: "./runtime/binary.mjs",
|
|
2941
|
-
default: "./runtime/binary.mjs"
|
|
2942
|
-
},
|
|
2943
|
-
"./runtime/wasm-engine-edge": {
|
|
2944
|
-
types: "./runtime/wasm-engine-edge.d.ts",
|
|
2945
|
-
require: "./runtime/wasm-engine-edge.js",
|
|
2946
|
-
import: "./runtime/wasm-engine-edge.mjs",
|
|
2947
|
-
default: "./runtime/wasm-engine-edge.mjs"
|
|
2948
|
-
},
|
|
2949
2374
|
"./runtime/wasm-compiler-edge": {
|
|
2950
2375
|
types: "./runtime/wasm-compiler-edge.d.ts",
|
|
2951
2376
|
require: "./runtime/wasm-compiler-edge.js",
|
|
2952
2377
|
import: "./runtime/wasm-compiler-edge.mjs",
|
|
2953
2378
|
default: "./runtime/wasm-compiler-edge.mjs"
|
|
2954
2379
|
},
|
|
2955
|
-
"./runtime/edge": {
|
|
2956
|
-
types: "./runtime/edge.d.ts",
|
|
2957
|
-
require: "./runtime/edge.js",
|
|
2958
|
-
import: "./runtime/edge-esm.js",
|
|
2959
|
-
default: "./runtime/edge-esm.js"
|
|
2960
|
-
},
|
|
2961
|
-
"./runtime/react-native": {
|
|
2962
|
-
types: "./runtime/react-native.d.ts",
|
|
2963
|
-
require: "./runtime/react-native.js",
|
|
2964
|
-
import: "./runtime/react-native.js",
|
|
2965
|
-
default: "./runtime/react-native.js"
|
|
2966
|
-
},
|
|
2967
2380
|
"./runtime/index-browser": {
|
|
2968
2381
|
types: "./runtime/index-browser.d.ts",
|
|
2969
2382
|
require: "./runtime/index-browser.js",
|
|
@@ -2992,7 +2405,7 @@ var package_default = {
|
|
|
2992
2405
|
},
|
|
2993
2406
|
license: "Apache-2.0",
|
|
2994
2407
|
engines: {
|
|
2995
|
-
node: "
|
|
2408
|
+
node: "^20.19 || ^22.12 || ^24.0"
|
|
2996
2409
|
},
|
|
2997
2410
|
homepage: "https://www.prisma.io",
|
|
2998
2411
|
repository: {
|
|
@@ -3008,13 +2421,11 @@ var package_default = {
|
|
|
3008
2421
|
test: "dotenv -e ../../.db.env -- jest --silent",
|
|
3009
2422
|
"test:e2e": "dotenv -e ../../.db.env -- tsx tests/e2e/_utils/run.ts",
|
|
3010
2423
|
"test:functional": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts",
|
|
3011
|
-
"test:functional:client": "pnpm run test:functional --client-runtime client
|
|
2424
|
+
"test:functional:client": "pnpm run test:functional --client-runtime client",
|
|
3012
2425
|
"test:memory": "dotenv -e ../../.db.env -- tsx helpers/memory-tests.ts",
|
|
3013
2426
|
"test:functional:code": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts --no-types",
|
|
3014
2427
|
"test:functional:types": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts --types-only",
|
|
3015
2428
|
"test-notypes": "dotenv -e ../../.db.env -- jest --testPathIgnorePatterns src/__tests__/types/types.test.ts",
|
|
3016
|
-
generate: "node scripts/postinstall.js",
|
|
3017
|
-
postinstall: "node scripts/postinstall.js",
|
|
3018
2429
|
prepublishOnly: "pnpm run build",
|
|
3019
2430
|
"new-test": "tsx ./helpers/new-test/new-test.ts"
|
|
3020
2431
|
},
|
|
@@ -3025,12 +2436,8 @@ var package_default = {
|
|
|
3025
2436
|
"generator-build",
|
|
3026
2437
|
"edge.js",
|
|
3027
2438
|
"edge.d.ts",
|
|
3028
|
-
"wasm.js",
|
|
3029
|
-
"wasm.d.ts",
|
|
3030
2439
|
"index.js",
|
|
3031
2440
|
"index.d.ts",
|
|
3032
|
-
"react-native.js",
|
|
3033
|
-
"react-native.d.ts",
|
|
3034
2441
|
"default.js",
|
|
3035
2442
|
"default.d.ts",
|
|
3036
2443
|
"index-browser.js",
|
|
@@ -3041,7 +2448,7 @@ var package_default = {
|
|
|
3041
2448
|
"sql.mjs"
|
|
3042
2449
|
],
|
|
3043
2450
|
devDependencies: {
|
|
3044
|
-
"@cloudflare/workers-types": "^4.
|
|
2451
|
+
"@cloudflare/workers-types": "^4.20251014.0",
|
|
3045
2452
|
"@codspeed/benchmark.js-plugin": "4.0.0",
|
|
3046
2453
|
"@faker-js/faker": "9.6.0",
|
|
3047
2454
|
"@fast-check/jest": "2.0.3",
|
|
@@ -3076,7 +2483,7 @@ var package_default = {
|
|
|
3076
2483
|
"@prisma/dmmf": "workspace:*",
|
|
3077
2484
|
"@prisma/driver-adapter-utils": "workspace:*",
|
|
3078
2485
|
"@prisma/engines": "workspace:*",
|
|
3079
|
-
"@prisma/engines-version": "6.
|
|
2486
|
+
"@prisma/engines-version": "6.20.0-16.next-0c19ccc313cf9911a90d99d2ac2eb0280c76c513",
|
|
3080
2487
|
"@prisma/fetch-engine": "workspace:*",
|
|
3081
2488
|
"@prisma/generator": "workspace:*",
|
|
3082
2489
|
"@prisma/generator-helper": "workspace:*",
|
|
@@ -3084,9 +2491,7 @@ var package_default = {
|
|
|
3084
2491
|
"@prisma/instrumentation": "workspace:*",
|
|
3085
2492
|
"@prisma/internals": "workspace:*",
|
|
3086
2493
|
"@prisma/migrate": "workspace:*",
|
|
3087
|
-
"@prisma/
|
|
3088
|
-
"@prisma/query-compiler-wasm": "6.19.0-26.2ba551f319ab1df4bc874a89965d8b3641056773",
|
|
3089
|
-
"@prisma/query-engine-wasm": "6.19.0-26.2ba551f319ab1df4bc874a89965d8b3641056773",
|
|
2494
|
+
"@prisma/query-compiler-wasm": "6.20.0-16.next-0c19ccc313cf9911a90d99d2ac2eb0280c76c513",
|
|
3090
2495
|
"@prisma/query-plan-executor": "workspace:*",
|
|
3091
2496
|
"@prisma/ts-builders": "workspace:*",
|
|
3092
2497
|
"@snaplet/copycat": "6.0.0",
|
|
@@ -3099,12 +2504,11 @@ var package_default = {
|
|
|
3099
2504
|
"@types/jest": "29.5.14",
|
|
3100
2505
|
"@types/js-levenshtein": "1.1.3",
|
|
3101
2506
|
"@types/mssql": "9.1.8",
|
|
3102
|
-
"@types/node": "
|
|
2507
|
+
"@types/node": "~20.19.24",
|
|
3103
2508
|
"@types/pg": "8.11.11",
|
|
3104
2509
|
arg: "5.0.2",
|
|
3105
2510
|
benchmark: "2.1.4",
|
|
3106
2511
|
"cookie-es": "2.0.0",
|
|
3107
|
-
"decimal.js": "10.5.0",
|
|
3108
2512
|
execa: "8.0.1",
|
|
3109
2513
|
"expect-type": "1.2.2",
|
|
3110
2514
|
"fs-extra": "11.3.0",
|
|
@@ -3129,7 +2533,6 @@ var package_default = {
|
|
|
3129
2533
|
"simple-statistics": "7.8.8",
|
|
3130
2534
|
"sort-keys": "5.1.0",
|
|
3131
2535
|
"source-map-support": "0.5.21",
|
|
3132
|
-
"sql-template-tag": "5.2.1",
|
|
3133
2536
|
"stacktrace-parser": "0.1.11",
|
|
3134
2537
|
"strip-ansi": "7.1.0",
|
|
3135
2538
|
"strip-indent": "4.0.0",
|
|
@@ -3140,9 +2543,12 @@ var package_default = {
|
|
|
3140
2543
|
undici: "7.4.0",
|
|
3141
2544
|
zx: "8.4.1"
|
|
3142
2545
|
},
|
|
2546
|
+
dependencies: {
|
|
2547
|
+
"@prisma/client-runtime-utils": "workspace:*"
|
|
2548
|
+
},
|
|
3143
2549
|
peerDependencies: {
|
|
3144
2550
|
prisma: "*",
|
|
3145
|
-
typescript: ">=5.
|
|
2551
|
+
typescript: ">=5.4.0"
|
|
3146
2552
|
},
|
|
3147
2553
|
peerDependenciesMeta: {
|
|
3148
2554
|
prisma: {
|
|
@@ -3187,7 +2593,7 @@ var Enum = class {
|
|
|
3187
2593
|
toJS() {
|
|
3188
2594
|
const { type } = this;
|
|
3189
2595
|
const enumVariants = `{
|
|
3190
|
-
${(0, import_indent_string.default)(type.
|
|
2596
|
+
${(0, import_indent_string.default)(type.data.map((v) => `${v.key}: ${this.getValueJS(v.value)}`).join(",\n"), TAB_SIZE)}
|
|
3191
2597
|
}`;
|
|
3192
2598
|
const enumBody = this.isStrictEnum() ? `makeStrictEnum(${enumVariants})` : enumVariants;
|
|
3193
2599
|
return this.useNamespace ? `exports.Prisma.${type.name} = ${enumBody};` : `exports.${type.name} = exports.$Enums.${type.name} = ${enumBody};`;
|
|
@@ -3198,7 +2604,7 @@ ${(0, import_indent_string.default)(type.values.map((v) => `${v}: ${this.getValu
|
|
|
3198
2604
|
toTS() {
|
|
3199
2605
|
const { type } = this;
|
|
3200
2606
|
return `export const ${type.name}: {
|
|
3201
|
-
${(0, import_indent_string.default)(type.
|
|
2607
|
+
${(0, import_indent_string.default)(type.data.map((v) => `${v.key}: ${this.getValueTS(v.value)}`).join(",\n"), TAB_SIZE)}
|
|
3202
2608
|
};
|
|
3203
2609
|
|
|
3204
2610
|
export type ${type.name} = (typeof ${type.name})[keyof typeof ${type.name}]
|
|
@@ -4925,12 +4331,8 @@ function fluentWrapperName(modelName) {
|
|
|
4925
4331
|
|
|
4926
4332
|
// src/TSClient/TSClient.ts
|
|
4927
4333
|
var import_dmmf = require("@prisma/dmmf");
|
|
4928
|
-
var import_internals7 = require("@prisma/internals");
|
|
4929
4334
|
var ts12 = __toESM(require("@prisma/ts-builders"));
|
|
4930
|
-
var
|
|
4931
|
-
var import_crypto = __toESM(require("crypto"));
|
|
4932
|
-
var import_indent_string8 = __toESM(require("indent-string"));
|
|
4933
|
-
var import_path2 = __toESM(require("path"));
|
|
4335
|
+
var import_indent_string7 = __toESM(require("indent-string"));
|
|
4934
4336
|
|
|
4935
4337
|
// src/dmmf.ts
|
|
4936
4338
|
var import_client_common10 = require("@prisma/client-common");
|
|
@@ -5125,87 +4527,24 @@ var GenericArgsInfo = class {
|
|
|
5125
4527
|
}
|
|
5126
4528
|
};
|
|
5127
4529
|
|
|
5128
|
-
// src/utils/buildInjectableEdgeEnv.ts
|
|
5129
|
-
function buildInjectableEdgeEnv(edge, datasources) {
|
|
5130
|
-
if (edge === true) {
|
|
5131
|
-
return declareInjectableEdgeEnv(datasources);
|
|
5132
|
-
}
|
|
5133
|
-
return ``;
|
|
5134
|
-
}
|
|
5135
|
-
function declareInjectableEdgeEnv(datasources) {
|
|
5136
|
-
const injectableEdgeEnv = { parsed: {} };
|
|
5137
|
-
const envVarNames = getSelectedEnvVarNames(datasources);
|
|
5138
|
-
for (const envVarName of envVarNames) {
|
|
5139
|
-
injectableEdgeEnv.parsed[envVarName] = getRuntimeEdgeEnvVar(envVarName);
|
|
5140
|
-
}
|
|
5141
|
-
const injectableEdgeEnvJson = JSON.stringify(injectableEdgeEnv, null, 2);
|
|
5142
|
-
const injectableEdgeEnvCode = injectableEdgeEnvJson.replace(/"/g, "");
|
|
5143
|
-
return `
|
|
5144
|
-
config.injectableEdgeEnv = () => (${injectableEdgeEnvCode})`;
|
|
5145
|
-
}
|
|
5146
|
-
function getSelectedEnvVarNames(datasources) {
|
|
5147
|
-
return datasources.reduce((acc, datasource) => {
|
|
5148
|
-
if (datasource.url.fromEnvVar) {
|
|
5149
|
-
return [...acc, datasource.url.fromEnvVar];
|
|
5150
|
-
}
|
|
5151
|
-
return acc;
|
|
5152
|
-
}, []);
|
|
5153
|
-
}
|
|
5154
|
-
function getRuntimeEdgeEnvVar(envVarName) {
|
|
5155
|
-
const cfwEnv = `typeof globalThis !== 'undefined' && globalThis['${envVarName}']`;
|
|
5156
|
-
const nodeOrVercelEnv = `typeof process !== 'undefined' && process.env && process.env.${envVarName}`;
|
|
5157
|
-
return `${cfwEnv} || ${nodeOrVercelEnv} || undefined`;
|
|
5158
|
-
}
|
|
5159
|
-
|
|
5160
4530
|
// src/utils/buildDebugInitialization.ts
|
|
5161
4531
|
function buildDebugInitialization(edge) {
|
|
5162
4532
|
if (!edge) {
|
|
5163
4533
|
return "";
|
|
5164
4534
|
}
|
|
5165
|
-
const debugVar =
|
|
4535
|
+
const debugVar = `typeof globalThis !== 'undefined' && globalThis['DEBUG'] || (typeof process !== 'undefined' && process.env && process.env.DEBUG) || undefined`;
|
|
5166
4536
|
return `if (${debugVar}) {
|
|
5167
4537
|
Debug.enable(${debugVar})
|
|
5168
4538
|
}
|
|
5169
4539
|
`;
|
|
5170
4540
|
}
|
|
5171
4541
|
|
|
5172
|
-
// src/utils/buildDirname.ts
|
|
5173
|
-
var import_internals4 = require("@prisma/internals");
|
|
5174
|
-
function buildDirname(edge, relativeOutdir) {
|
|
5175
|
-
if (edge === true) {
|
|
5176
|
-
return buildDirnameDefault();
|
|
5177
|
-
}
|
|
5178
|
-
return buildDirnameFind(relativeOutdir);
|
|
5179
|
-
}
|
|
5180
|
-
function buildDirnameFind(relativeOutdir) {
|
|
5181
|
-
return `
|
|
5182
|
-
const fs = require('fs')
|
|
5183
|
-
|
|
5184
|
-
config.dirname = __dirname
|
|
5185
|
-
if (!fs.existsSync(path.join(__dirname, 'schema.prisma'))) {
|
|
5186
|
-
const alternativePaths = [
|
|
5187
|
-
${JSON.stringify((0, import_internals4.pathToPosix)(relativeOutdir))},
|
|
5188
|
-
${JSON.stringify((0, import_internals4.pathToPosix)(relativeOutdir).split("/").slice(1).join("/"))},
|
|
5189
|
-
]
|
|
5190
|
-
|
|
5191
|
-
const alternativePath = alternativePaths.find((altPath) => {
|
|
5192
|
-
return fs.existsSync(path.join(process.cwd(), altPath, 'schema.prisma'))
|
|
5193
|
-
}) ?? alternativePaths[0]
|
|
5194
|
-
|
|
5195
|
-
config.dirname = path.join(process.cwd(), alternativePath)
|
|
5196
|
-
config.isBundled = true
|
|
5197
|
-
}`;
|
|
5198
|
-
}
|
|
5199
|
-
function buildDirnameDefault() {
|
|
5200
|
-
return `config.dirname = '/'`;
|
|
5201
|
-
}
|
|
5202
|
-
|
|
5203
4542
|
// src/utils/buildDMMF.ts
|
|
5204
4543
|
var import_client_common12 = require("@prisma/client-common");
|
|
5205
|
-
function buildRuntimeDataModel(datamodel,
|
|
4544
|
+
function buildRuntimeDataModel(datamodel, runtimeName) {
|
|
5206
4545
|
const runtimeDataModel = (0, import_client_common12.dmmfToRuntimeDataModel)(datamodel);
|
|
5207
4546
|
let prunedDataModel;
|
|
5208
|
-
if (
|
|
4547
|
+
if (runtimeName === "wasm-compiler-edge" || runtimeName === "client") {
|
|
5209
4548
|
prunedDataModel = (0, import_client_common12.pruneRuntimeDataModel)(runtimeDataModel);
|
|
5210
4549
|
} else {
|
|
5211
4550
|
prunedDataModel = runtimeDataModel;
|
|
@@ -5217,19 +4556,20 @@ defineDmmfProperty(exports.Prisma, config.runtimeDataModel)`;
|
|
|
5217
4556
|
}
|
|
5218
4557
|
|
|
5219
4558
|
// src/utils/buildGetQueryCompilerWasmModule.ts
|
|
5220
|
-
function buildQueryCompilerWasmModule(forceEdgeWasmLoader,
|
|
5221
|
-
if (
|
|
4559
|
+
function buildQueryCompilerWasmModule(forceEdgeWasmLoader, runtimeName) {
|
|
4560
|
+
if (runtimeName === "client" && !forceEdgeWasmLoader) {
|
|
5222
4561
|
return `config.compilerWasm = {
|
|
5223
4562
|
getRuntime: async () => require('./query_compiler_bg.js'),
|
|
5224
4563
|
getQueryCompilerWasmModule: async () => {
|
|
5225
|
-
const
|
|
5226
|
-
const
|
|
4564
|
+
const { Buffer } = require('node:buffer')
|
|
4565
|
+
const { wasm } = require('./query_compiler_bg.wasm-base64.js')
|
|
4566
|
+
const queryCompilerWasmFileBytes = Buffer.from(wasm, 'base64')
|
|
5227
4567
|
|
|
5228
4568
|
return new WebAssembly.Module(queryCompilerWasmFileBytes)
|
|
5229
4569
|
}
|
|
5230
4570
|
}`;
|
|
5231
4571
|
}
|
|
5232
|
-
if (
|
|
4572
|
+
if (runtimeName === "client" && forceEdgeWasmLoader || runtimeName === "wasm-compiler-edge") {
|
|
5233
4573
|
return `config.compilerWasm = {
|
|
5234
4574
|
getRuntime: async () => require('./query_compiler_bg.js'),
|
|
5235
4575
|
getQueryCompilerWasmModule: async () => {
|
|
@@ -5242,90 +4582,6 @@ function buildQueryCompilerWasmModule(forceEdgeWasmLoader, runtimeNameJs) {
|
|
|
5242
4582
|
return `config.compilerWasm = undefined`;
|
|
5243
4583
|
}
|
|
5244
4584
|
|
|
5245
|
-
// src/utils/buildGetQueryEngineWasmModule.ts
|
|
5246
|
-
function buildQueryEngineWasmModule(wasm, copyEngine, runtimeNameJs) {
|
|
5247
|
-
if (copyEngine && runtimeNameJs === "library" && process.env.PRISMA_CLIENT_FORCE_WASM) {
|
|
5248
|
-
return `config.engineWasm = {
|
|
5249
|
-
getRuntime: async () => require('./query_engine_bg.js'),
|
|
5250
|
-
getQueryEngineWasmModule: async () => {
|
|
5251
|
-
const queryEngineWasmFilePath = require('path').join(config.dirname, 'query_engine_bg.wasm')
|
|
5252
|
-
const queryEngineWasmFileBytes = require('fs').readFileSync(queryEngineWasmFilePath)
|
|
5253
|
-
|
|
5254
|
-
return new WebAssembly.Module(queryEngineWasmFileBytes)
|
|
5255
|
-
}
|
|
5256
|
-
}`;
|
|
5257
|
-
}
|
|
5258
|
-
if (copyEngine && wasm === true && runtimeNameJs === "wasm-engine-edge") {
|
|
5259
|
-
return `config.engineWasm = {
|
|
5260
|
-
getRuntime: async () => require('./query_engine_bg.js'),
|
|
5261
|
-
getQueryEngineWasmModule: async () => {
|
|
5262
|
-
const loader = (await import('#wasm-engine-loader')).default
|
|
5263
|
-
const engine = (await loader).default
|
|
5264
|
-
return engine
|
|
5265
|
-
}
|
|
5266
|
-
}`;
|
|
5267
|
-
}
|
|
5268
|
-
return `config.engineWasm = undefined`;
|
|
5269
|
-
}
|
|
5270
|
-
|
|
5271
|
-
// src/utils/buildInlineDatasources.ts
|
|
5272
|
-
function buildInlineDatasources(datasources) {
|
|
5273
|
-
return datasources.reduce((acc, ds) => {
|
|
5274
|
-
return acc[ds.name] = buildInlineDatasource(ds), acc;
|
|
5275
|
-
}, {});
|
|
5276
|
-
}
|
|
5277
|
-
function buildInlineDatasource(ds) {
|
|
5278
|
-
if (ds.url.fromEnvVar) {
|
|
5279
|
-
return { url: { fromEnvVar: ds.url.fromEnvVar, value: null } };
|
|
5280
|
-
} else {
|
|
5281
|
-
return { url: { fromEnvVar: null, value: ds.url.value } };
|
|
5282
|
-
}
|
|
5283
|
-
}
|
|
5284
|
-
|
|
5285
|
-
// src/utils/buildNFTAnnotations.ts
|
|
5286
|
-
var import_get_platform = require("@prisma/get-platform");
|
|
5287
|
-
var import_internals5 = require("@prisma/internals");
|
|
5288
|
-
var import_path = __toESM(require("path"));
|
|
5289
|
-
function buildNFTAnnotations(noEngine, engineType, binaryTargets, relativeOutdir) {
|
|
5290
|
-
if (noEngine === true) return "";
|
|
5291
|
-
if (binaryTargets === void 0) {
|
|
5292
|
-
return "";
|
|
5293
|
-
}
|
|
5294
|
-
if (process.env.NETLIFY) {
|
|
5295
|
-
const isNodeMajor20OrUp = parseInt(process.versions.node.split(".")[0]) >= 20;
|
|
5296
|
-
const awsRuntimeVersion = (0, import_internals5.parseAWSNodejsRuntimeEnvVarVersion)();
|
|
5297
|
-
const isRuntimeEnvVar20OrUp = awsRuntimeVersion && awsRuntimeVersion >= 20;
|
|
5298
|
-
const isRuntimeEnvVar18OrDown = awsRuntimeVersion && awsRuntimeVersion <= 18;
|
|
5299
|
-
if ((isNodeMajor20OrUp || isRuntimeEnvVar20OrUp) && !isRuntimeEnvVar18OrDown) {
|
|
5300
|
-
binaryTargets = ["rhel-openssl-3.0.x"];
|
|
5301
|
-
} else {
|
|
5302
|
-
binaryTargets = ["rhel-openssl-1.0.x"];
|
|
5303
|
-
}
|
|
5304
|
-
}
|
|
5305
|
-
const engineAnnotations = binaryTargets.map((binaryTarget) => {
|
|
5306
|
-
const engineFilename = getQueryEngineFilename(engineType, binaryTarget);
|
|
5307
|
-
return engineFilename ? buildNFTAnnotation(engineFilename, relativeOutdir) : "";
|
|
5308
|
-
}).join("\n");
|
|
5309
|
-
const schemaAnnotations = buildNFTAnnotation("schema.prisma", relativeOutdir);
|
|
5310
|
-
return `${engineAnnotations}${schemaAnnotations}`;
|
|
5311
|
-
}
|
|
5312
|
-
function getQueryEngineFilename(engineType, binaryTarget) {
|
|
5313
|
-
if (engineType === import_internals5.ClientEngineType.Library) {
|
|
5314
|
-
return (0, import_get_platform.getNodeAPIName)(binaryTarget, "fs");
|
|
5315
|
-
}
|
|
5316
|
-
if (engineType === import_internals5.ClientEngineType.Binary) {
|
|
5317
|
-
return `query-engine-${binaryTarget}`;
|
|
5318
|
-
}
|
|
5319
|
-
return void 0;
|
|
5320
|
-
}
|
|
5321
|
-
function buildNFTAnnotation(fileName, relativeOutdir) {
|
|
5322
|
-
const relativeFilePath = import_path.default.join(relativeOutdir, fileName);
|
|
5323
|
-
return `
|
|
5324
|
-
// file annotations for bundling tools to include these files
|
|
5325
|
-
path.join(__dirname, ${JSON.stringify((0, import_internals5.pathToPosix)(fileName))});
|
|
5326
|
-
path.join(process.cwd(), ${JSON.stringify((0, import_internals5.pathToPosix)(relativeFilePath))})`;
|
|
5327
|
-
}
|
|
5328
|
-
|
|
5329
4585
|
// src/utils/buildRequirePath.ts
|
|
5330
4586
|
function buildRequirePath(edge) {
|
|
5331
4587
|
if (edge === true) return "";
|
|
@@ -5333,23 +4589,11 @@ function buildRequirePath(edge) {
|
|
|
5333
4589
|
const path = require('path')`;
|
|
5334
4590
|
}
|
|
5335
4591
|
|
|
5336
|
-
// src/utils/buildWarnEnvConflicts.ts
|
|
5337
|
-
function buildWarnEnvConflicts(edge, runtimeBase, runtimeNameJs) {
|
|
5338
|
-
if (edge === true) return "";
|
|
5339
|
-
return `
|
|
5340
|
-
const { warnEnvConflicts } = require('${runtimeBase}/${runtimeNameJs}.js')
|
|
5341
|
-
|
|
5342
|
-
warnEnvConflicts({
|
|
5343
|
-
rootEnvPath: config.relativeEnvPaths.rootEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.rootEnvPath),
|
|
5344
|
-
schemaEnvPath: config.relativeEnvPaths.schemaEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.schemaEnvPath)
|
|
5345
|
-
})`;
|
|
5346
|
-
}
|
|
5347
|
-
|
|
5348
4592
|
// src/TSClient/common.ts
|
|
5349
4593
|
var import_indent_string4 = __toESM(require("indent-string"));
|
|
5350
4594
|
var commonCodeJS = ({
|
|
5351
4595
|
runtimeBase,
|
|
5352
|
-
|
|
4596
|
+
runtimeName,
|
|
5353
4597
|
browser,
|
|
5354
4598
|
clientVersion,
|
|
5355
4599
|
engineVersion,
|
|
@@ -5359,12 +4603,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5359
4603
|
${browser ? `
|
|
5360
4604
|
const {
|
|
5361
4605
|
Decimal,
|
|
5362
|
-
|
|
4606
|
+
DbNull,
|
|
4607
|
+
JsonNull,
|
|
4608
|
+
AnyNull,
|
|
4609
|
+
NullTypes,
|
|
5363
4610
|
makeStrictEnum,
|
|
5364
4611
|
Public,
|
|
5365
4612
|
getRuntime,
|
|
5366
4613
|
skip
|
|
5367
|
-
} = require('${runtimeBase}/${
|
|
4614
|
+
} = require('${runtimeBase}/${runtimeName}.js')
|
|
5368
4615
|
` : `
|
|
5369
4616
|
const {
|
|
5370
4617
|
PrismaClientKnownRequestError,
|
|
@@ -5380,7 +4627,10 @@ const {
|
|
|
5380
4627
|
skip,
|
|
5381
4628
|
Decimal,
|
|
5382
4629
|
Debug,
|
|
5383
|
-
|
|
4630
|
+
DbNull,
|
|
4631
|
+
JsonNull,
|
|
4632
|
+
AnyNull,
|
|
4633
|
+
NullTypes,
|
|
5384
4634
|
makeStrictEnum,
|
|
5385
4635
|
Extensions,
|
|
5386
4636
|
warnOnce,
|
|
@@ -5388,7 +4638,7 @@ const {
|
|
|
5388
4638
|
Public,
|
|
5389
4639
|
getRuntime,
|
|
5390
4640
|
createParam,
|
|
5391
|
-
} = require('${runtimeBase}/${
|
|
4641
|
+
} = require('${runtimeBase}/${runtimeName}.js')
|
|
5392
4642
|
`}
|
|
5393
4643
|
|
|
5394
4644
|
const Prisma = {}
|
|
@@ -5430,15 +4680,11 @@ Prisma.defineExtension = ${notSupportOnBrowser("Extensions.defineExtension", bro
|
|
|
5430
4680
|
/**
|
|
5431
4681
|
* Shorthand utilities for JSON filtering
|
|
5432
4682
|
*/
|
|
5433
|
-
Prisma.DbNull =
|
|
5434
|
-
Prisma.JsonNull =
|
|
5435
|
-
Prisma.AnyNull =
|
|
4683
|
+
Prisma.DbNull = DbNull
|
|
4684
|
+
Prisma.JsonNull = JsonNull
|
|
4685
|
+
Prisma.AnyNull = AnyNull
|
|
5436
4686
|
|
|
5437
|
-
Prisma.NullTypes =
|
|
5438
|
-
DbNull: objectEnumValues.classes.DbNull,
|
|
5439
|
-
JsonNull: objectEnumValues.classes.JsonNull,
|
|
5440
|
-
AnyNull: objectEnumValues.classes.AnyNull
|
|
5441
|
-
}
|
|
4687
|
+
Prisma.NullTypes = NullTypes
|
|
5442
4688
|
|
|
5443
4689
|
${buildPrismaSkipJs(generator.previewFeatures)}
|
|
5444
4690
|
`;
|
|
@@ -5454,12 +4700,12 @@ In case this error is unexpected for you, please report it in https://pris.ly/pr
|
|
|
5454
4700
|
};
|
|
5455
4701
|
var commonCodeTS = ({
|
|
5456
4702
|
runtimeBase,
|
|
5457
|
-
|
|
4703
|
+
runtimeName,
|
|
5458
4704
|
clientVersion,
|
|
5459
4705
|
engineVersion,
|
|
5460
4706
|
generator
|
|
5461
4707
|
}) => ({
|
|
5462
|
-
tsWithoutNamespace: () => `import * as runtime from '${runtimeBase}/${
|
|
4708
|
+
tsWithoutNamespace: () => `import * as runtime from '${runtimeBase}/${runtimeName}.js';
|
|
5463
4709
|
import $Types = runtime.Types // general types
|
|
5464
4710
|
import $Public = runtime.Types.Public
|
|
5465
4711
|
import $Utils = runtime.Types.Utils
|
|
@@ -5504,14 +4750,6 @@ export import Decimal = runtime.Decimal
|
|
|
5504
4750
|
|
|
5505
4751
|
export type DecimalJsLike = runtime.DecimalJsLike
|
|
5506
4752
|
|
|
5507
|
-
/**
|
|
5508
|
-
* Metrics
|
|
5509
|
-
*/
|
|
5510
|
-
export type Metrics = runtime.Metrics
|
|
5511
|
-
export type Metric<T> = runtime.Metric<T>
|
|
5512
|
-
export type MetricHistogram = runtime.MetricHistogram
|
|
5513
|
-
export type MetricHistogramBucket = runtime.MetricHistogramBucket
|
|
5514
|
-
|
|
5515
4753
|
/**
|
|
5516
4754
|
* Extensions
|
|
5517
4755
|
*/
|
|
@@ -5528,6 +4766,7 @@ export import Exact = $Public.Exact
|
|
|
5528
4766
|
*/
|
|
5529
4767
|
export type PrismaVersion = {
|
|
5530
4768
|
client: string
|
|
4769
|
+
engine: string
|
|
5531
4770
|
}
|
|
5532
4771
|
|
|
5533
4772
|
export const prismaVersion: PrismaVersion
|
|
@@ -6005,33 +5244,16 @@ var GenerateContext = class {
|
|
|
6005
5244
|
|
|
6006
5245
|
// src/TSClient/PrismaClient.ts
|
|
6007
5246
|
var import_client_common15 = require("@prisma/client-common");
|
|
6008
|
-
var
|
|
5247
|
+
var import_internals4 = require("@prisma/internals");
|
|
6009
5248
|
var ts11 = __toESM(require("@prisma/ts-builders"));
|
|
6010
|
-
var
|
|
5249
|
+
var import_indent_string6 = __toESM(require("indent-string"));
|
|
6011
5250
|
|
|
6012
5251
|
// src/utils/runtimeImport.ts
|
|
6013
5252
|
var ts9 = __toESM(require("@prisma/ts-builders"));
|
|
6014
|
-
function runtimeImport(name) {
|
|
6015
|
-
return name;
|
|
6016
|
-
}
|
|
6017
5253
|
function runtimeImportedType(name) {
|
|
6018
5254
|
return ts9.namedType(`runtime.${name}`);
|
|
6019
5255
|
}
|
|
6020
5256
|
|
|
6021
|
-
// src/TSClient/Datasources.ts
|
|
6022
|
-
var import_indent_string6 = __toESM(require("indent-string"));
|
|
6023
|
-
var Datasources = class {
|
|
6024
|
-
constructor(internalDatasources) {
|
|
6025
|
-
this.internalDatasources = internalDatasources;
|
|
6026
|
-
}
|
|
6027
|
-
toTS() {
|
|
6028
|
-
const sources = this.internalDatasources;
|
|
6029
|
-
return `export type Datasources = {
|
|
6030
|
-
${(0, import_indent_string6.default)(sources.map((s) => `${s.name}?: Datasource`).join("\n"), 2)}
|
|
6031
|
-
}`;
|
|
6032
|
-
}
|
|
6033
|
-
};
|
|
6034
|
-
|
|
6035
5257
|
// src/TSClient/globalOmit.ts
|
|
6036
5258
|
var import_client_common14 = require("@prisma/client-common");
|
|
6037
5259
|
var ts10 = __toESM(require("@prisma/ts-builders"));
|
|
@@ -6102,7 +5324,7 @@ function clientTypeMapModelsResultDefinition(modelName, action) {
|
|
|
6102
5324
|
if (action === "update") return payloadToResult(modelName);
|
|
6103
5325
|
if (action === "upsert") return payloadToResult(modelName);
|
|
6104
5326
|
if (action === "delete") return payloadToResult(modelName);
|
|
6105
|
-
(0,
|
|
5327
|
+
(0, import_internals4.assertNever)(action, `Unknown action: ${action}`);
|
|
6106
5328
|
}
|
|
6107
5329
|
function payloadToResult(modelName) {
|
|
6108
5330
|
return ts11.namedType("$Utils.PayloadToResult").addGenericArgument(ts11.namedType(getPayloadName(modelName)));
|
|
@@ -6282,26 +5504,8 @@ function queryRawTypedDefinition(context) {
|
|
|
6282
5504
|
).setReturnType(prismaPromise(ts11.array(param.toArgument())));
|
|
6283
5505
|
return ts11.stringify(method3, { indentLevel: 1, newLine: "leading" });
|
|
6284
5506
|
}
|
|
6285
|
-
function
|
|
6286
|
-
if (!context.
|
|
6287
|
-
return "";
|
|
6288
|
-
}
|
|
6289
|
-
const property11 = ts11.property("$metrics", ts11.namedType(`runtime.${runtimeImport("MetricsClient")}`)).setDocComment(
|
|
6290
|
-
ts11.docComment`
|
|
6291
|
-
Gives access to the client metrics in json or prometheus format.
|
|
6292
|
-
|
|
6293
|
-
@example
|
|
6294
|
-
\`\`\`
|
|
6295
|
-
const metrics = await prisma.$metrics.json()
|
|
6296
|
-
// or
|
|
6297
|
-
const metrics = await prisma.$metrics.prometheus()
|
|
6298
|
-
\`\`\`
|
|
6299
|
-
`
|
|
6300
|
-
).readonly();
|
|
6301
|
-
return ts11.stringify(property11, { indentLevel: 1, newLine: "leading" });
|
|
6302
|
-
}
|
|
6303
|
-
function runCommandRawDefinition(context) {
|
|
6304
|
-
if (!context.dmmf.mappings.otherOperations.write.includes("runCommandRaw")) {
|
|
5507
|
+
function runCommandRawDefinition(context) {
|
|
5508
|
+
if (!context.dmmf.mappings.otherOperations.write.includes("runCommandRaw")) {
|
|
6305
5509
|
return "";
|
|
6306
5510
|
}
|
|
6307
5511
|
const method3 = ts11.method("$runCommandRaw").addParameter(ts11.parameter("command", ts11.namedType("Prisma.InputJsonObject"))).setReturnType(prismaPromise(ts11.namedType("Prisma.JsonObject"))).setDocComment(ts11.docComment`
|
|
@@ -6319,28 +5523,12 @@ function runCommandRawDefinition(context) {
|
|
|
6319
5523
|
`);
|
|
6320
5524
|
return ts11.stringify(method3, { indentLevel: 1, newLine: "leading" });
|
|
6321
5525
|
}
|
|
6322
|
-
function applyPendingMigrationsDefinition() {
|
|
6323
|
-
if (this.runtimeNameTs !== "react-native") {
|
|
6324
|
-
return null;
|
|
6325
|
-
}
|
|
6326
|
-
const method3 = ts11.method("$applyPendingMigrations").setReturnType(promise(ts11.voidType)).setDocComment(
|
|
6327
|
-
ts11.docComment`Tries to apply pending migrations one by one. If a migration fails to apply, the function will stop and throw an error. You are responsible for informing the user and possibly blocking the app as we cannot guarantee the state of the database.`
|
|
6328
|
-
);
|
|
6329
|
-
return ts11.stringify(method3, { indentLevel: 1, newLine: "leading" });
|
|
6330
|
-
}
|
|
6331
|
-
function eventRegistrationMethodDeclaration(runtimeNameTs) {
|
|
6332
|
-
if (runtimeNameTs === "binary.js") {
|
|
6333
|
-
return `$on<V extends (U | 'beforeExit')>(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : V extends 'beforeExit' ? () => $Utils.JsPromise<void> : Prisma.LogEvent) => void): PrismaClient;`;
|
|
6334
|
-
} else {
|
|
6335
|
-
return `$on<V extends U>(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): PrismaClient;`;
|
|
6336
|
-
}
|
|
6337
|
-
}
|
|
6338
5526
|
var PrismaClientClass = class {
|
|
6339
|
-
constructor(context, internalDatasources, outputDir,
|
|
5527
|
+
constructor(context, internalDatasources, outputDir, runtimeName, browser) {
|
|
6340
5528
|
this.context = context;
|
|
6341
5529
|
this.internalDatasources = internalDatasources;
|
|
6342
5530
|
this.outputDir = outputDir;
|
|
6343
|
-
this.
|
|
5531
|
+
this.runtimeName = runtimeName;
|
|
6344
5532
|
this.browser = browser;
|
|
6345
5533
|
}
|
|
6346
5534
|
get jsDoc() {
|
|
@@ -6379,10 +5567,10 @@ export class PrismaClient<
|
|
|
6379
5567
|
> {
|
|
6380
5568
|
[K: symbol]: { types: Prisma.TypeMap<ExtArgs>['other'] }
|
|
6381
5569
|
|
|
6382
|
-
${(0,
|
|
5570
|
+
${(0, import_indent_string6.default)(this.jsDoc, TAB_SIZE)}
|
|
6383
5571
|
|
|
6384
5572
|
constructor(optionsArg ?: Prisma.Subset<ClientOptions, Prisma.PrismaClientOptions>);
|
|
6385
|
-
$
|
|
5573
|
+
$on<V extends U>(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): PrismaClient;
|
|
6386
5574
|
|
|
6387
5575
|
/**
|
|
6388
5576
|
* Connect with the database
|
|
@@ -6401,12 +5589,10 @@ ${[
|
|
|
6401
5589
|
batchingTransactionDefinition(this.context),
|
|
6402
5590
|
interactiveTransactionDefinition(this.context),
|
|
6403
5591
|
runCommandRawDefinition(this.context),
|
|
6404
|
-
metricDefinition(this.context),
|
|
6405
|
-
applyPendingMigrationsDefinition.bind(this)(),
|
|
6406
5592
|
extendsPropertyDefinition()
|
|
6407
5593
|
].filter((d) => d !== null).join("\n").trim()}
|
|
6408
5594
|
|
|
6409
|
-
${(0,
|
|
5595
|
+
${(0, import_indent_string6.default)(
|
|
6410
5596
|
dmmf.mappings.modelOperations.filter((m) => m.findMany).map((m) => {
|
|
6411
5597
|
let methodName = (0, import_client_common15.uncapitalize)(m.model);
|
|
6412
5598
|
if (methodName === "constructor") {
|
|
@@ -6429,8 +5615,7 @@ get ${methodName}(): Prisma.${m.model}Delegate<${generics.join(", ")}>;`;
|
|
|
6429
5615
|
}
|
|
6430
5616
|
toTS() {
|
|
6431
5617
|
const clientOptions = this.buildClientOptions();
|
|
6432
|
-
return `${
|
|
6433
|
-
${clientExtensionsDefinitions(this.context)}
|
|
5618
|
+
return `${clientExtensionsDefinitions(this.context)}
|
|
6434
5619
|
export type DefaultPrismaClient = PrismaClient
|
|
6435
5620
|
export type ErrorFormat = 'pretty' | 'colorless' | 'minimal'
|
|
6436
5621
|
${ts11.stringify(ts11.moduleExport(clientOptions))}
|
|
@@ -6503,10 +5688,6 @@ export type TransactionClient = Omit<Prisma.DefaultPrismaClient, runtime.ITXClie
|
|
|
6503
5688
|
}
|
|
6504
5689
|
buildClientOptions() {
|
|
6505
5690
|
const clientOptions = ts11.interfaceDeclaration("PrismaClientOptions").add(
|
|
6506
|
-
ts11.property("datasources", ts11.namedType("Datasources")).optional().setDocComment(ts11.docComment("Overwrites the datasource url from your schema.prisma file"))
|
|
6507
|
-
).add(
|
|
6508
|
-
ts11.property("datasourceUrl", ts11.stringType).optional().setDocComment(ts11.docComment("Overwrites the datasource url from your schema.prisma file"))
|
|
6509
|
-
).add(
|
|
6510
5691
|
ts11.property("errorFormat", ts11.namedType("ErrorFormat")).optional().setDocComment(ts11.docComment('@default "colorless"'))
|
|
6511
5692
|
).add(
|
|
6512
5693
|
ts11.property("log", ts11.array(ts11.unionType([ts11.namedType("LogLevel"), ts11.namedType("LogDefinition")]))).optional().setDocComment(ts11.docComment`
|
|
@@ -6545,14 +5726,23 @@ export type TransactionClient = Omit<Prisma.DefaultPrismaClient, runtime.ITXClie
|
|
|
6545
5726
|
timeout ?= 5000
|
|
6546
5727
|
`)
|
|
6547
5728
|
);
|
|
6548
|
-
if (
|
|
6549
|
-
|
|
5729
|
+
if (
|
|
5730
|
+
// We don't support a custom adapter with MongoDB for now.
|
|
5731
|
+
this.internalDatasources.some((d) => d.provider !== "mongodb")
|
|
5732
|
+
) {
|
|
6550
5733
|
clientOptions.add(
|
|
6551
|
-
ts11.property("adapter", ts11.
|
|
5734
|
+
ts11.property("adapter", ts11.namedType("runtime.SqlDriverAdapterFactory")).optional().setDocComment(
|
|
6552
5735
|
ts11.docComment("Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale`")
|
|
6553
5736
|
)
|
|
6554
5737
|
);
|
|
6555
5738
|
}
|
|
5739
|
+
clientOptions.add(
|
|
5740
|
+
ts11.property("accelerateUrl", ts11.stringType).optional().setDocComment(
|
|
5741
|
+
ts11.docComment(
|
|
5742
|
+
"Prisma Accelerate URL allowing the client to connect through Accelerate instead of a direct database."
|
|
5743
|
+
)
|
|
5744
|
+
)
|
|
5745
|
+
);
|
|
6556
5746
|
clientOptions.add(
|
|
6557
5747
|
ts11.property("omit", ts11.namedType("Prisma.GlobalOmitConfig")).optional().setDocComment(ts11.docComment`
|
|
6558
5748
|
Global configuration for omitting model fields by default.
|
|
@@ -6583,61 +5773,33 @@ var TSClient = class {
|
|
|
6583
5773
|
dmmf;
|
|
6584
5774
|
genericsInfo;
|
|
6585
5775
|
toJS() {
|
|
6586
|
-
const {
|
|
6587
|
-
edge,
|
|
6588
|
-
wasm,
|
|
6589
|
-
binaryPaths,
|
|
6590
|
-
generator,
|
|
6591
|
-
outputDir,
|
|
6592
|
-
datamodel: inlineSchema,
|
|
6593
|
-
runtimeBase,
|
|
6594
|
-
runtimeNameJs,
|
|
6595
|
-
datasources,
|
|
6596
|
-
copyEngine = true,
|
|
6597
|
-
reusedJs,
|
|
6598
|
-
envPaths
|
|
6599
|
-
} = this.options;
|
|
5776
|
+
const { edge, wasm, generator, datamodel: inlineSchema, runtimeName, reusedJs } = this.options;
|
|
6600
5777
|
if (reusedJs) {
|
|
6601
5778
|
return `module.exports = { ...require('${reusedJs}') }`;
|
|
6602
5779
|
}
|
|
6603
|
-
const relativeEnvPaths = {
|
|
6604
|
-
rootEnvPath: envPaths.rootEnvPath && (0, import_internals7.pathToPosix)(import_path2.default.relative(outputDir, envPaths.rootEnvPath)),
|
|
6605
|
-
schemaEnvPath: envPaths.schemaEnvPath && (0, import_internals7.pathToPosix)(import_path2.default.relative(outputDir, envPaths.schemaEnvPath))
|
|
6606
|
-
};
|
|
6607
|
-
const clientEngineType = (0, import_internals7.getClientEngineType)(generator);
|
|
6608
|
-
generator.config.engineType = clientEngineType;
|
|
6609
|
-
const binaryTargets = clientEngineType === import_internals7.ClientEngineType.Library ? Object.keys(binaryPaths.libqueryEngine ?? {}) : Object.keys(binaryPaths.queryEngine ?? {});
|
|
6610
|
-
const inlineSchemaHash = import_crypto.default.createHash("sha256").update(Buffer.from(inlineSchema, "utf8").toString("base64")).digest("hex");
|
|
6611
|
-
const datasourceFilePath = datasources[0].sourceFilePath;
|
|
6612
5780
|
const config = {
|
|
6613
|
-
generator,
|
|
6614
|
-
relativeEnvPaths,
|
|
6615
|
-
relativePath: (0, import_internals7.pathToPosix)(import_path2.default.relative(outputDir, import_path2.default.dirname(datasourceFilePath))),
|
|
5781
|
+
previewFeatures: generator.previewFeatures,
|
|
6616
5782
|
clientVersion: this.options.clientVersion,
|
|
6617
5783
|
engineVersion: this.options.engineVersion,
|
|
6618
|
-
datasourceNames: datasources.map((d) => d.name),
|
|
6619
5784
|
activeProvider: this.options.activeProvider,
|
|
6620
|
-
|
|
6621
|
-
ciName: import_ci_info.default.name ?? void 0,
|
|
6622
|
-
inlineDatasources: buildInlineDatasources(datasources),
|
|
6623
|
-
inlineSchema,
|
|
6624
|
-
inlineSchemaHash,
|
|
6625
|
-
copyEngine
|
|
5785
|
+
inlineSchema
|
|
6626
5786
|
};
|
|
6627
|
-
const relativeOutdir = import_path2.default.relative(process.cwd(), outputDir);
|
|
6628
5787
|
const code = `${commonCodeJS({ ...this.options, browser: false })}
|
|
6629
5788
|
${buildRequirePath(edge)}
|
|
6630
5789
|
|
|
6631
5790
|
/**
|
|
6632
5791
|
* Enums
|
|
6633
5792
|
*/
|
|
6634
|
-
${this.dmmf.schema.enumTypes.prisma?.map((type) => new Enum(type, true).toJS()).join("\n\n")}
|
|
5793
|
+
${this.dmmf.schema.enumTypes.prisma?.map((type) => new Enum((0, import_dmmf.datamodelSchemaEnumToSchemaEnum)(type), true).toJS()).join("\n\n")}
|
|
6635
5794
|
${this.dmmf.datamodel.enums.map((datamodelEnum) => new Enum((0, import_dmmf.datamodelEnumToSchemaEnum)(datamodelEnum), false).toJS()).join("\n\n")}
|
|
6636
5795
|
|
|
6637
5796
|
${new Enum(
|
|
6638
5797
|
{
|
|
6639
5798
|
name: "ModelName",
|
|
6640
|
-
|
|
5799
|
+
data: this.dmmf.mappings.modelOperations.map((m) => ({
|
|
5800
|
+
key: m.model,
|
|
5801
|
+
value: m.model
|
|
5802
|
+
}))
|
|
6641
5803
|
},
|
|
6642
5804
|
true
|
|
6643
5805
|
).toJS()}
|
|
@@ -6645,17 +5807,12 @@ ${new Enum(
|
|
|
6645
5807
|
* Create the Client
|
|
6646
5808
|
*/
|
|
6647
5809
|
const config = ${JSON.stringify(config, null, 2)}
|
|
6648
|
-
${
|
|
6649
|
-
${
|
|
6650
|
-
${buildQueryEngineWasmModule(wasm, copyEngine, runtimeNameJs)}
|
|
6651
|
-
${buildQueryCompilerWasmModule(wasm, runtimeNameJs)}
|
|
6652
|
-
${buildInjectableEdgeEnv(edge, datasources)}
|
|
6653
|
-
${buildWarnEnvConflicts(edge, runtimeBase, runtimeNameJs)}
|
|
5810
|
+
${buildRuntimeDataModel(this.dmmf.datamodel, runtimeName)}
|
|
5811
|
+
${buildQueryCompilerWasmModule(wasm, runtimeName)}
|
|
6654
5812
|
${buildDebugInitialization(edge)}
|
|
6655
5813
|
const PrismaClient = getPrismaClient(config)
|
|
6656
5814
|
exports.PrismaClient = PrismaClient
|
|
6657
5815
|
Object.assign(exports, Prisma)
|
|
6658
|
-
${buildNFTAnnotations(edge || !copyEngine, clientEngineType, binaryTargets, relativeOutdir)}
|
|
6659
5816
|
`;
|
|
6660
5817
|
return code;
|
|
6661
5818
|
}
|
|
@@ -6674,7 +5831,7 @@ ${buildNFTAnnotations(edge || !copyEngine, clientEngineType, binaryTargets, rela
|
|
|
6674
5831
|
context,
|
|
6675
5832
|
this.options.datasources,
|
|
6676
5833
|
this.options.outputDir,
|
|
6677
|
-
this.options.
|
|
5834
|
+
this.options.runtimeName,
|
|
6678
5835
|
this.options.browser
|
|
6679
5836
|
);
|
|
6680
5837
|
const commonCode = commonCodeTS(this.options);
|
|
@@ -6684,7 +5841,9 @@ ${buildNFTAnnotations(edge || !copyEngine, clientEngineType, binaryTargets, rela
|
|
|
6684
5841
|
}
|
|
6685
5842
|
return acc;
|
|
6686
5843
|
}, []);
|
|
6687
|
-
const prismaEnums = this.dmmf.schema.enumTypes.prisma?.map(
|
|
5844
|
+
const prismaEnums = this.dmmf.schema.enumTypes.prisma?.map(
|
|
5845
|
+
(type) => new Enum((0, import_dmmf.datamodelSchemaEnumToSchemaEnum)(type), true).toTS()
|
|
5846
|
+
);
|
|
6688
5847
|
const modelEnums = [];
|
|
6689
5848
|
const modelEnumsAliases = [];
|
|
6690
5849
|
for (const datamodelEnum of this.dmmf.datamodel.enums) {
|
|
@@ -6721,12 +5880,15 @@ ${modelEnumsAliases.join("\n\n")}
|
|
|
6721
5880
|
${prismaClientClass.toTSWithoutNamespace()}
|
|
6722
5881
|
|
|
6723
5882
|
export namespace Prisma {
|
|
6724
|
-
${(0,
|
|
5883
|
+
${(0, import_indent_string7.default)(
|
|
6725
5884
|
`${commonCode.ts()}
|
|
6726
5885
|
${new Enum(
|
|
6727
5886
|
{
|
|
6728
5887
|
name: "ModelName",
|
|
6729
|
-
|
|
5888
|
+
data: this.dmmf.mappings.modelOperations.map((m) => ({
|
|
5889
|
+
key: m.model,
|
|
5890
|
+
value: m.model
|
|
5891
|
+
}))
|
|
6730
5892
|
},
|
|
6731
5893
|
true
|
|
6732
5894
|
).toTS()}
|
|
@@ -6803,20 +5965,23 @@ export const dmmf: runtime.BaseDMMF
|
|
|
6803
5965
|
toBrowserJS() {
|
|
6804
5966
|
const code = `${commonCodeJS({
|
|
6805
5967
|
...this.options,
|
|
6806
|
-
|
|
5968
|
+
runtimeName: "index-browser",
|
|
6807
5969
|
browser: true
|
|
6808
5970
|
})}
|
|
6809
5971
|
/**
|
|
6810
5972
|
* Enums
|
|
6811
5973
|
*/
|
|
6812
5974
|
|
|
6813
|
-
${this.dmmf.schema.enumTypes.prisma?.map((type) => new Enum(type, true).toJS()).join("\n\n")}
|
|
6814
|
-
${this.dmmf.schema.enumTypes.model?.map((type) => new Enum(type, false).toJS()).join("\n\n") ?? ""}
|
|
5975
|
+
${this.dmmf.schema.enumTypes.prisma?.map((type) => new Enum((0, import_dmmf.datamodelSchemaEnumToSchemaEnum)(type), true).toJS()).join("\n\n")}
|
|
5976
|
+
${this.dmmf.schema.enumTypes.model?.map((type) => new Enum((0, import_dmmf.datamodelSchemaEnumToSchemaEnum)(type), false).toJS()).join("\n\n") ?? ""}
|
|
6815
5977
|
|
|
6816
5978
|
${new Enum(
|
|
6817
5979
|
{
|
|
6818
5980
|
name: "ModelName",
|
|
6819
|
-
|
|
5981
|
+
data: this.dmmf.mappings.modelOperations.map((m) => ({
|
|
5982
|
+
key: m.model,
|
|
5983
|
+
value: m.model
|
|
5984
|
+
}))
|
|
6820
5985
|
},
|
|
6821
5986
|
true
|
|
6822
5987
|
).toJS()}
|
|
@@ -6857,7 +6022,7 @@ Object.assign(exports, Prisma)
|
|
|
6857
6022
|
};
|
|
6858
6023
|
|
|
6859
6024
|
// src/typedSql/buildDbEnums.ts
|
|
6860
|
-
var
|
|
6025
|
+
var import_internals5 = require("@prisma/internals");
|
|
6861
6026
|
var ts13 = __toESM(require("@prisma/ts-builders"));
|
|
6862
6027
|
var DbEnumsList = class {
|
|
6863
6028
|
enums;
|
|
@@ -6875,14 +6040,14 @@ var DbEnumsList = class {
|
|
|
6875
6040
|
}
|
|
6876
6041
|
*validJsIdentifiers() {
|
|
6877
6042
|
for (const dbEnum of this.enums) {
|
|
6878
|
-
if ((0,
|
|
6043
|
+
if ((0, import_internals5.isValidJsIdentifier)(dbEnum.name)) {
|
|
6879
6044
|
yield dbEnum;
|
|
6880
6045
|
}
|
|
6881
6046
|
}
|
|
6882
6047
|
}
|
|
6883
6048
|
*invalidJsIdentifiers() {
|
|
6884
6049
|
for (const dbEnum of this.enums) {
|
|
6885
|
-
if (!(0,
|
|
6050
|
+
if (!(0, import_internals5.isValidJsIdentifier)(dbEnum.name)) {
|
|
6886
6051
|
yield dbEnum;
|
|
6887
6052
|
}
|
|
6888
6053
|
}
|
|
@@ -6954,7 +6119,7 @@ var ts16 = __toESM(require("@prisma/ts-builders"));
|
|
|
6954
6119
|
var import_ts_builders3 = require("@prisma/ts-builders");
|
|
6955
6120
|
|
|
6956
6121
|
// src/typedSql/mapTypes.ts
|
|
6957
|
-
var
|
|
6122
|
+
var import_internals6 = require("@prisma/internals");
|
|
6958
6123
|
var ts15 = __toESM(require("@prisma/ts-builders"));
|
|
6959
6124
|
var decimal = ts15.namedType("$runtime.Decimal");
|
|
6960
6125
|
var uint8Array = ts15.namedType("$runtime.Bytes");
|
|
@@ -7048,7 +6213,7 @@ function getMappingConfig(introspectionType, enums) {
|
|
|
7048
6213
|
return config;
|
|
7049
6214
|
}
|
|
7050
6215
|
function getEnumType(name) {
|
|
7051
|
-
if ((0,
|
|
6216
|
+
if ((0, import_internals6.isValidJsIdentifier)(name)) {
|
|
7052
6217
|
return ts15.namedType(`$DbEnums.${name}`);
|
|
7053
6218
|
}
|
|
7054
6219
|
return ts15.namedType("$DbEnums").subKey(name);
|
|
@@ -7154,14 +6319,13 @@ function addPreamble(fileContent) {
|
|
|
7154
6319
|
}
|
|
7155
6320
|
|
|
7156
6321
|
// src/generateClient.ts
|
|
7157
|
-
var debug = (0, import_debug.Debug)("prisma:client:generateClient");
|
|
7158
6322
|
var DenylistError = class extends Error {
|
|
7159
6323
|
constructor(message) {
|
|
7160
6324
|
super(message);
|
|
7161
6325
|
this.stack = void 0;
|
|
7162
6326
|
}
|
|
7163
6327
|
};
|
|
7164
|
-
(0,
|
|
6328
|
+
(0, import_internals7.setClassName)(DenylistError, "DenylistError");
|
|
7165
6329
|
async function buildClient({
|
|
7166
6330
|
schemaPath,
|
|
7167
6331
|
runtimeBase,
|
|
@@ -7175,15 +6339,10 @@ async function buildClient({
|
|
|
7175
6339
|
engineVersion,
|
|
7176
6340
|
clientVersion,
|
|
7177
6341
|
activeProvider,
|
|
7178
|
-
postinstall,
|
|
7179
|
-
copyEngine,
|
|
7180
|
-
envPaths,
|
|
7181
6342
|
typedSql
|
|
7182
6343
|
}) {
|
|
7183
|
-
const clientEngineType = (0, import_internals10.getClientEngineType)(generator);
|
|
7184
6344
|
const baseClientOptions = {
|
|
7185
6345
|
dmmf: getPrismaClientDMMF(dmmf),
|
|
7186
|
-
envPaths: envPaths ?? { rootEnvPath: null, schemaEnvPath: void 0 },
|
|
7187
6346
|
datasources,
|
|
7188
6347
|
generator,
|
|
7189
6348
|
binaryPaths,
|
|
@@ -7194,8 +6353,6 @@ async function buildClient({
|
|
|
7194
6353
|
clientVersion,
|
|
7195
6354
|
engineVersion,
|
|
7196
6355
|
activeProvider,
|
|
7197
|
-
postinstall,
|
|
7198
|
-
copyEngine,
|
|
7199
6356
|
datamodel,
|
|
7200
6357
|
browser: false,
|
|
7201
6358
|
edge: false,
|
|
@@ -7203,8 +6360,7 @@ async function buildClient({
|
|
|
7203
6360
|
};
|
|
7204
6361
|
const nodeClientOptions = {
|
|
7205
6362
|
...baseClientOptions,
|
|
7206
|
-
|
|
7207
|
-
runtimeNameTs: `${getNodeRuntimeName(clientEngineType)}.js`
|
|
6363
|
+
runtimeName: "client"
|
|
7208
6364
|
};
|
|
7209
6365
|
const nodeClient = new TSClient(nodeClientOptions);
|
|
7210
6366
|
const defaultClient = new TSClient({
|
|
@@ -7212,19 +6368,6 @@ async function buildClient({
|
|
|
7212
6368
|
reusedTs: "index",
|
|
7213
6369
|
reusedJs: "."
|
|
7214
6370
|
});
|
|
7215
|
-
const edgeClient = new TSClient({
|
|
7216
|
-
...baseClientOptions,
|
|
7217
|
-
runtimeNameJs: "edge",
|
|
7218
|
-
runtimeNameTs: "library.js",
|
|
7219
|
-
reusedTs: "default",
|
|
7220
|
-
edge: true
|
|
7221
|
-
});
|
|
7222
|
-
const rnTsClient = new TSClient({
|
|
7223
|
-
...baseClientOptions,
|
|
7224
|
-
runtimeNameJs: "react-native",
|
|
7225
|
-
runtimeNameTs: "react-native",
|
|
7226
|
-
edge: true
|
|
7227
|
-
});
|
|
7228
6371
|
const trampolineTsClient = new TSClient({
|
|
7229
6372
|
...nodeClientOptions,
|
|
7230
6373
|
reusedTs: "index",
|
|
@@ -7232,9 +6375,9 @@ async function buildClient({
|
|
|
7232
6375
|
});
|
|
7233
6376
|
const exportsMapBase = {
|
|
7234
6377
|
node: "./index.js",
|
|
7235
|
-
"edge-light": "./
|
|
7236
|
-
workerd: "./
|
|
7237
|
-
worker: "./
|
|
6378
|
+
"edge-light": "./edge.js",
|
|
6379
|
+
workerd: "./edge.js",
|
|
6380
|
+
worker: "./edge.js",
|
|
7238
6381
|
browser: "./index-browser.js",
|
|
7239
6382
|
default: "./index.js"
|
|
7240
6383
|
};
|
|
@@ -7258,7 +6401,10 @@ async function buildClient({
|
|
|
7258
6401
|
".": exportsMapDefault
|
|
7259
6402
|
},
|
|
7260
6403
|
version: clientVersion,
|
|
7261
|
-
sideEffects: false
|
|
6404
|
+
sideEffects: false,
|
|
6405
|
+
dependencies: {
|
|
6406
|
+
"@prisma/client-runtime-utils": clientVersion
|
|
6407
|
+
}
|
|
7262
6408
|
};
|
|
7263
6409
|
const fileMap = {};
|
|
7264
6410
|
fileMap["index.js"] = JS(nodeClient);
|
|
@@ -7266,28 +6412,16 @@ async function buildClient({
|
|
|
7266
6412
|
fileMap["default.js"] = JS(defaultClient);
|
|
7267
6413
|
fileMap["default.d.ts"] = TS(defaultClient);
|
|
7268
6414
|
fileMap["index-browser.js"] = BrowserJS(nodeClient);
|
|
7269
|
-
fileMap["edge.js"] = JS(edgeClient);
|
|
7270
|
-
fileMap["edge.d.ts"] = TS(edgeClient);
|
|
7271
6415
|
fileMap["client.js"] = JS(defaultClient);
|
|
7272
6416
|
fileMap["client.d.ts"] = TS(defaultClient);
|
|
7273
|
-
if (generator.previewFeatures.includes("reactNative")) {
|
|
7274
|
-
fileMap["react-native.js"] = JS(rnTsClient);
|
|
7275
|
-
fileMap["react-native.d.ts"] = TS(rnTsClient);
|
|
7276
|
-
}
|
|
7277
|
-
const usesClientEngine = clientEngineType === import_internals10.ClientEngineType.Client;
|
|
7278
6417
|
fileMap["default.js"] = JS(trampolineTsClient);
|
|
7279
6418
|
fileMap["default.d.ts"] = TS(trampolineTsClient);
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
fileMap["wasm-edge-light-loader.mjs"] = `export default import('./query_compiler_bg.wasm?module')`;
|
|
7283
|
-
} else {
|
|
7284
|
-
fileMap["wasm-worker-loader.mjs"] = `export default import('./query_engine_bg.wasm')`;
|
|
7285
|
-
fileMap["wasm-edge-light-loader.mjs"] = `export default import('./query_engine_bg.wasm?module')`;
|
|
7286
|
-
}
|
|
6419
|
+
fileMap["wasm-worker-loader.mjs"] = `export default import('./query_compiler_bg.wasm')`;
|
|
6420
|
+
fileMap["wasm-edge-light-loader.mjs"] = `export default import('./query_compiler_bg.wasm?module')`;
|
|
7287
6421
|
pkgJson["browser"] = "default.js";
|
|
7288
6422
|
pkgJson["imports"] = {
|
|
7289
|
-
// when `import('#wasm-
|
|
7290
|
-
|
|
6423
|
+
// when `import('#wasm-compiler-loader')` is called, it will be resolved to the correct file
|
|
6424
|
+
"#wasm-compiler-loader": {
|
|
7291
6425
|
// Keys reference: https://runtime-keys.proposal.wintercg.org/#keys
|
|
7292
6426
|
/**
|
|
7293
6427
|
* Vercel Edge Functions / Next.js Middlewares
|
|
@@ -7312,16 +6446,15 @@ async function buildClient({
|
|
|
7312
6446
|
};
|
|
7313
6447
|
const wasmClient = new TSClient({
|
|
7314
6448
|
...baseClientOptions,
|
|
7315
|
-
|
|
7316
|
-
runtimeNameTs: "library.js",
|
|
6449
|
+
runtimeName: "wasm-compiler-edge",
|
|
7317
6450
|
reusedTs: "default",
|
|
7318
6451
|
edge: true,
|
|
7319
6452
|
wasm: true
|
|
7320
6453
|
});
|
|
7321
|
-
fileMap["
|
|
7322
|
-
fileMap["
|
|
6454
|
+
fileMap["edge.js"] = JS(wasmClient);
|
|
6455
|
+
fileMap["edge.d.ts"] = TS(wasmClient);
|
|
7323
6456
|
if (typedSql && typedSql.length > 0) {
|
|
7324
|
-
const edgeRuntimeName =
|
|
6457
|
+
const edgeRuntimeName = "wasm-compiler-edge";
|
|
7325
6458
|
const cjsEdgeIndex = `./sql/index.${edgeRuntimeName}.js`;
|
|
7326
6459
|
const esmEdgeIndex = `./sql/index.${edgeRuntimeName}.mjs`;
|
|
7327
6460
|
pkgJson.exports["./sql"] = {
|
|
@@ -7346,7 +6479,7 @@ async function buildClient({
|
|
|
7346
6479
|
fileMap["sql"] = buildTypedSql({
|
|
7347
6480
|
dmmf,
|
|
7348
6481
|
runtimeBase: getTypedSqlRuntimeBase(runtimeBase),
|
|
7349
|
-
mainRuntimeName:
|
|
6482
|
+
mainRuntimeName: "client",
|
|
7350
6483
|
queries: typedSql,
|
|
7351
6484
|
edgeRuntimeName
|
|
7352
6485
|
});
|
|
@@ -7369,20 +6502,11 @@ function getTypedSqlRuntimeBase(runtimeBase) {
|
|
|
7369
6502
|
}
|
|
7370
6503
|
return `../${runtimeBase}`;
|
|
7371
6504
|
}
|
|
7372
|
-
|
|
7373
|
-
if (outputDir.endsWith(
|
|
7374
|
-
return
|
|
6505
|
+
function getDefaultOutdir(outputDir) {
|
|
6506
|
+
if (outputDir.endsWith(import_path.default.normalize("node_modules/@prisma/client"))) {
|
|
6507
|
+
return import_path.default.join(outputDir, "../../.prisma/client");
|
|
7375
6508
|
}
|
|
7376
|
-
|
|
7377
|
-
if ((0, import_fs.existsSync)(import_path3.default.join(process.env.INIT_CWD, "package.json"))) {
|
|
7378
|
-
return import_path3.default.join(process.env.INIT_CWD, "node_modules/.prisma/client");
|
|
7379
|
-
}
|
|
7380
|
-
const packagePath = await (0, import_package_up.packageUp)({ cwd: process.env.INIT_CWD });
|
|
7381
|
-
if (packagePath) {
|
|
7382
|
-
return import_path3.default.join(import_path3.default.dirname(packagePath), "node_modules/.prisma/client");
|
|
7383
|
-
}
|
|
7384
|
-
}
|
|
7385
|
-
return import_path3.default.join(outputDir, "../../.prisma/client");
|
|
6509
|
+
return import_path.default.join(outputDir, "../../.prisma/client");
|
|
7386
6510
|
}
|
|
7387
6511
|
async function generateClient(options) {
|
|
7388
6512
|
const {
|
|
@@ -7399,12 +6523,8 @@ async function generateClient(options) {
|
|
|
7399
6523
|
clientVersion,
|
|
7400
6524
|
engineVersion,
|
|
7401
6525
|
activeProvider,
|
|
7402
|
-
postinstall,
|
|
7403
|
-
envPaths,
|
|
7404
|
-
copyEngine = true,
|
|
7405
6526
|
typedSql
|
|
7406
6527
|
} = options;
|
|
7407
|
-
const clientEngineType = (0, import_internals10.getClientEngineType)(generator);
|
|
7408
6528
|
const { runtimeBase, outputDir } = await getGenerationDirs(options);
|
|
7409
6529
|
const { prismaClientDmmf, fileMap } = await buildClient({
|
|
7410
6530
|
datamodel,
|
|
@@ -7419,10 +6539,7 @@ async function generateClient(options) {
|
|
|
7419
6539
|
clientVersion,
|
|
7420
6540
|
engineVersion,
|
|
7421
6541
|
activeProvider,
|
|
7422
|
-
postinstall,
|
|
7423
|
-
copyEngine,
|
|
7424
6542
|
testMode,
|
|
7425
|
-
envPaths,
|
|
7426
6543
|
typedSql
|
|
7427
6544
|
});
|
|
7428
6545
|
const provider = datasources[0].provider;
|
|
@@ -7439,51 +6556,32 @@ async function generateClient(options) {
|
|
|
7439
6556
|
To learn more about how to rename models, check out https://pris.ly/d/naming-models`;
|
|
7440
6557
|
throw new DenylistError(message);
|
|
7441
6558
|
}
|
|
7442
|
-
if (!copyEngine) {
|
|
7443
|
-
await deleteOutputDir(outputDir);
|
|
7444
|
-
}
|
|
7445
6559
|
await (0, import_fs_extra.ensureDir)(outputDir);
|
|
7446
6560
|
await writeFileMap(outputDir, fileMap);
|
|
7447
6561
|
if (copyRuntime || generator.isCustomOutput === true) {
|
|
7448
|
-
const copiedRuntimeDir =
|
|
6562
|
+
const copiedRuntimeDir = import_path.default.join(outputDir, "runtime");
|
|
7449
6563
|
await (0, import_fs_extra.ensureDir)(copiedRuntimeDir);
|
|
7450
6564
|
await copyRuntimeFiles({
|
|
7451
6565
|
from: runtimeSourcePath,
|
|
7452
6566
|
to: copiedRuntimeDir,
|
|
7453
6567
|
sourceMaps: copyRuntimeSourceMaps,
|
|
7454
|
-
runtimeName:
|
|
6568
|
+
runtimeName: "client"
|
|
7455
6569
|
});
|
|
7456
6570
|
}
|
|
7457
|
-
const
|
|
7458
|
-
if (copyEngine && enginePath) {
|
|
7459
|
-
if (process.env.NETLIFY) {
|
|
7460
|
-
await (0, import_fs_extra.ensureDir)("/tmp/prisma-engines");
|
|
7461
|
-
}
|
|
7462
|
-
for (const [binaryTarget, filePath] of Object.entries(enginePath)) {
|
|
7463
|
-
const fileName = import_path3.default.basename(filePath);
|
|
7464
|
-
let target;
|
|
7465
|
-
if (process.env.NETLIFY && !["rhel-openssl-1.0.x", "rhel-openssl-3.0.x"].includes(binaryTarget)) {
|
|
7466
|
-
target = import_path3.default.join("/tmp/prisma-engines", fileName);
|
|
7467
|
-
} else {
|
|
7468
|
-
target = import_path3.default.join(outputDir, fileName);
|
|
7469
|
-
}
|
|
7470
|
-
await (0, import_fetch_engine.overwriteFile)(filePath, target);
|
|
7471
|
-
}
|
|
7472
|
-
}
|
|
7473
|
-
const schemaTargetPath = import_path3.default.join(outputDir, "schema.prisma");
|
|
6571
|
+
const schemaTargetPath = import_path.default.join(outputDir, "schema.prisma");
|
|
7474
6572
|
await import_promises.default.writeFile(schemaTargetPath, datamodel, { encoding: "utf-8" });
|
|
7475
|
-
|
|
7476
|
-
if (runtimeNeedsWasmEngine && isWasmEngineSupported(provider) && !testMode) {
|
|
6573
|
+
if (isWasmEngineSupported(provider) && !testMode) {
|
|
7477
6574
|
const suffix = provider === "postgres" ? "postgresql" : provider;
|
|
7478
|
-
const filename =
|
|
7479
|
-
const wasmJsBundlePath =
|
|
6575
|
+
const filename = "query_compiler_bg";
|
|
6576
|
+
const wasmJsBundlePath = import_path.default.join(runtimeSourcePath, `${filename}.${suffix}.wasm-base64.js`);
|
|
7480
6577
|
const wasmBase64 = require(wasmJsBundlePath).wasm;
|
|
7481
|
-
await import_promises.default.writeFile(
|
|
7482
|
-
await import_promises.default.copyFile(
|
|
6578
|
+
await import_promises.default.writeFile(import_path.default.join(outputDir, `${filename}.wasm`), Buffer.from(wasmBase64, "base64"));
|
|
6579
|
+
await import_promises.default.copyFile(import_path.default.join(runtimeSourcePath, `${filename}.${suffix}.js`), import_path.default.join(outputDir, `${filename}.js`));
|
|
6580
|
+
await import_promises.default.copyFile(wasmJsBundlePath, import_path.default.join(outputDir, `${filename}.wasm-base64.js`));
|
|
7483
6581
|
}
|
|
7484
6582
|
try {
|
|
7485
6583
|
const prismaCache = (0, import_env_paths.default)("prisma").cache;
|
|
7486
|
-
const signalsPath =
|
|
6584
|
+
const signalsPath = import_path.default.join(prismaCache, "last-generate");
|
|
7487
6585
|
await import_promises.default.mkdir(prismaCache, { recursive: true });
|
|
7488
6586
|
await import_promises.default.writeFile(signalsPath, Date.now().toString());
|
|
7489
6587
|
} catch {
|
|
@@ -7492,7 +6590,7 @@ To learn more about how to rename models, check out https://pris.ly/d/naming-mod
|
|
|
7492
6590
|
function writeFileMap(outputDir, fileMap) {
|
|
7493
6591
|
return Promise.all(
|
|
7494
6592
|
Object.entries(fileMap).map(async ([fileName, content]) => {
|
|
7495
|
-
const absolutePath =
|
|
6593
|
+
const absolutePath = import_path.default.join(outputDir, fileName);
|
|
7496
6594
|
await import_promises.default.rm(absolutePath, { recursive: true, force: true });
|
|
7497
6595
|
if (typeof content === "string") {
|
|
7498
6596
|
await import_promises.default.writeFile(absolutePath, content);
|
|
@@ -7592,18 +6690,18 @@ async function getGenerationDirs({
|
|
|
7592
6690
|
testMode
|
|
7593
6691
|
}) {
|
|
7594
6692
|
const isCustomOutput = generator.isCustomOutput === true;
|
|
7595
|
-
const normalizedOutputDir =
|
|
6693
|
+
const normalizedOutputDir = import_path.default.normalize(outputDir);
|
|
7596
6694
|
let userRuntimeImport = isCustomOutput ? "./runtime" : "@prisma/client/runtime";
|
|
7597
|
-
let userOutputDir = isCustomOutput ? normalizedOutputDir :
|
|
6695
|
+
let userOutputDir = isCustomOutput ? normalizedOutputDir : getDefaultOutdir(normalizedOutputDir);
|
|
7598
6696
|
if (testMode && runtimeBase) {
|
|
7599
6697
|
userOutputDir = outputDir;
|
|
7600
|
-
userRuntimeImport = (0,
|
|
6698
|
+
userRuntimeImport = (0, import_internals7.pathToPosix)(runtimeBase);
|
|
7601
6699
|
}
|
|
7602
6700
|
if (isCustomOutput) {
|
|
7603
6701
|
await verifyOutputDirectory(userOutputDir, datamodel, schemaPath);
|
|
7604
6702
|
}
|
|
7605
|
-
const userPackageRoot = await (0, import_package_up.packageUp)({ cwd:
|
|
7606
|
-
const userProjectRoot = userPackageRoot ?
|
|
6703
|
+
const userPackageRoot = await (0, import_package_up.packageUp)({ cwd: import_path.default.dirname(userOutputDir) });
|
|
6704
|
+
const userProjectRoot = userPackageRoot ? import_path.default.dirname(userPackageRoot) : process.cwd();
|
|
7607
6705
|
return {
|
|
7608
6706
|
runtimeBase: userRuntimeImport,
|
|
7609
6707
|
outputDir: userOutputDir,
|
|
@@ -7613,7 +6711,7 @@ async function getGenerationDirs({
|
|
|
7613
6711
|
async function verifyOutputDirectory(directory, datamodel, schemaPath) {
|
|
7614
6712
|
let content;
|
|
7615
6713
|
try {
|
|
7616
|
-
content = await import_promises.default.readFile(
|
|
6714
|
+
content = await import_promises.default.readFile(import_path.default.join(directory, "package.json"), "utf8");
|
|
7617
6715
|
} catch (e) {
|
|
7618
6716
|
if (e.code === "ENOENT") {
|
|
7619
6717
|
return;
|
|
@@ -7656,43 +6754,17 @@ function findOutputPathDeclaration(datamodel) {
|
|
|
7656
6754
|
}
|
|
7657
6755
|
return null;
|
|
7658
6756
|
}
|
|
7659
|
-
function getNodeRuntimeName(engineType) {
|
|
7660
|
-
if (engineType === import_internals10.ClientEngineType.Binary) {
|
|
7661
|
-
return "binary";
|
|
7662
|
-
}
|
|
7663
|
-
if (engineType === import_internals10.ClientEngineType.Library) {
|
|
7664
|
-
return "library";
|
|
7665
|
-
}
|
|
7666
|
-
if (engineType === import_internals10.ClientEngineType.Client) {
|
|
7667
|
-
return "client";
|
|
7668
|
-
}
|
|
7669
|
-
(0, import_internals10.assertNever)(engineType, "Unknown engine type");
|
|
7670
|
-
}
|
|
7671
6757
|
async function copyRuntimeFiles({ from, to, runtimeName, sourceMaps }) {
|
|
7672
|
-
const files = [
|
|
7673
|
-
// library.d.ts is always included, as it contains the actual runtime type
|
|
7674
|
-
// definitions. Rest of the `runtime.d.ts` files just re-export everything
|
|
7675
|
-
// from `library.d.ts`
|
|
7676
|
-
"library.d.ts",
|
|
7677
|
-
"index-browser.js",
|
|
7678
|
-
"index-browser.d.ts",
|
|
7679
|
-
"edge.js",
|
|
7680
|
-
"edge-esm.js",
|
|
7681
|
-
"react-native.js",
|
|
7682
|
-
"wasm-engine-edge.js",
|
|
7683
|
-
"wasm-compiler-edge.js"
|
|
7684
|
-
];
|
|
6758
|
+
const files = ["index-browser.js", "index-browser.d.ts", "wasm-compiler-edge.js"];
|
|
7685
6759
|
files.push(`${runtimeName}.js`);
|
|
7686
|
-
|
|
7687
|
-
files.push(`${runtimeName}.d.ts`);
|
|
7688
|
-
}
|
|
6760
|
+
files.push(`${runtimeName}.d.ts`);
|
|
7689
6761
|
if (sourceMaps) {
|
|
7690
6762
|
files.push(...files.filter((file4) => file4.endsWith(".js")).map((file4) => `${file4}.map`));
|
|
7691
6763
|
}
|
|
7692
6764
|
await Promise.all(
|
|
7693
6765
|
files.map(async (file4) => {
|
|
7694
|
-
const sourcePath =
|
|
7695
|
-
const targetPath =
|
|
6766
|
+
const sourcePath = import_path.default.join(from, file4);
|
|
6767
|
+
const targetPath = import_path.default.join(to, file4);
|
|
7696
6768
|
if (file4.endsWith(".js")) {
|
|
7697
6769
|
const content = await import_promises.default.readFile(sourcePath, "utf-8");
|
|
7698
6770
|
await import_promises.default.writeFile(targetPath, addPreamble(content));
|
|
@@ -7702,1651 +6774,31 @@ async function copyRuntimeFiles({ from, to, runtimeName, sourceMaps }) {
|
|
|
7702
6774
|
})
|
|
7703
6775
|
);
|
|
7704
6776
|
}
|
|
7705
|
-
async function deleteOutputDir(outputDir) {
|
|
7706
|
-
try {
|
|
7707
|
-
debug(`attempting to delete ${outputDir} recursively`);
|
|
7708
|
-
if (require(`${outputDir}/package.json`).name?.startsWith(GENERATED_PACKAGE_NAME_PREFIX)) {
|
|
7709
|
-
await import_promises.default.rmdir(outputDir, { recursive: true }).catch(() => {
|
|
7710
|
-
debug(`failed to delete ${outputDir} recursively`);
|
|
7711
|
-
});
|
|
7712
|
-
}
|
|
7713
|
-
} catch {
|
|
7714
|
-
debug(`failed to delete ${outputDir} recursively, not found`);
|
|
7715
|
-
}
|
|
7716
|
-
}
|
|
7717
6777
|
function getUniquePackageName(datamodel) {
|
|
7718
|
-
const hash = (0,
|
|
6778
|
+
const hash = (0, import_crypto.createHash)("sha256");
|
|
7719
6779
|
hash.write(datamodel);
|
|
7720
6780
|
return `${GENERATED_PACKAGE_NAME_PREFIX}${hash.digest().toString("hex")}`;
|
|
7721
6781
|
}
|
|
7722
6782
|
var GENERATED_PACKAGE_NAME_PREFIX = "prisma-client-";
|
|
7723
6783
|
|
|
7724
6784
|
// src/generator.ts
|
|
7725
|
-
var
|
|
7726
|
-
var import_debug3 = require("@prisma/debug");
|
|
6785
|
+
var import_node_path2 = __toESM(require("node:path"));
|
|
7727
6786
|
var import_engines_version = require("@prisma/engines-version");
|
|
7728
|
-
var
|
|
7729
|
-
var import_ts_pattern = require("ts-pattern");
|
|
6787
|
+
var import_internals9 = require("@prisma/internals");
|
|
7730
6788
|
|
|
7731
6789
|
// package.json
|
|
7732
|
-
var version = "6.20.0-dev.
|
|
6790
|
+
var version = "6.20.0-dev.11";
|
|
7733
6791
|
|
|
7734
6792
|
// src/resolvePrismaClient.ts
|
|
7735
|
-
var
|
|
7736
|
-
var
|
|
6793
|
+
var import_promises2 = __toESM(require("node:fs/promises"));
|
|
6794
|
+
var import_node_path = __toESM(require("node:path"));
|
|
7737
6795
|
var import_ni = require("@antfu/ni");
|
|
7738
|
-
var
|
|
7739
|
-
var
|
|
7740
|
-
|
|
7741
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js
|
|
7742
|
-
var import_node_buffer2 = require("node:buffer");
|
|
7743
|
-
var import_node_path2 = __toESM(require("node:path"), 1);
|
|
7744
|
-
var import_node_child_process3 = __toESM(require("node:child_process"), 1);
|
|
7745
|
-
var import_node_process4 = __toESM(require("node:process"), 1);
|
|
7746
|
-
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
7747
|
-
|
|
7748
|
-
// ../../node_modules/.pnpm/strip-final-newline@3.0.0/node_modules/strip-final-newline/index.js
|
|
7749
|
-
function stripFinalNewline(input) {
|
|
7750
|
-
const LF = typeof input === "string" ? "\n" : "\n".charCodeAt();
|
|
7751
|
-
const CR = typeof input === "string" ? "\r" : "\r".charCodeAt();
|
|
7752
|
-
if (input[input.length - 1] === LF) {
|
|
7753
|
-
input = input.slice(0, -1);
|
|
7754
|
-
}
|
|
7755
|
-
if (input[input.length - 1] === CR) {
|
|
7756
|
-
input = input.slice(0, -1);
|
|
7757
|
-
}
|
|
7758
|
-
return input;
|
|
7759
|
-
}
|
|
7760
|
-
|
|
7761
|
-
// ../../node_modules/.pnpm/npm-run-path@5.3.0/node_modules/npm-run-path/index.js
|
|
7762
|
-
var import_node_process = __toESM(require("node:process"), 1);
|
|
7763
|
-
var import_node_path = __toESM(require("node:path"), 1);
|
|
7764
|
-
var import_node_url = require("node:url");
|
|
7765
|
-
|
|
7766
|
-
// ../../node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js
|
|
7767
|
-
function pathKey(options = {}) {
|
|
7768
|
-
const {
|
|
7769
|
-
env = process.env,
|
|
7770
|
-
platform = process.platform
|
|
7771
|
-
} = options;
|
|
7772
|
-
if (platform !== "win32") {
|
|
7773
|
-
return "PATH";
|
|
7774
|
-
}
|
|
7775
|
-
return Object.keys(env).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
7776
|
-
}
|
|
7777
|
-
|
|
7778
|
-
// ../../node_modules/.pnpm/npm-run-path@5.3.0/node_modules/npm-run-path/index.js
|
|
7779
|
-
var npmRunPath = ({
|
|
7780
|
-
cwd = import_node_process.default.cwd(),
|
|
7781
|
-
path: pathOption = import_node_process.default.env[pathKey()],
|
|
7782
|
-
preferLocal = true,
|
|
7783
|
-
execPath = import_node_process.default.execPath,
|
|
7784
|
-
addExecPath = true
|
|
7785
|
-
} = {}) => {
|
|
7786
|
-
const cwdString = cwd instanceof URL ? (0, import_node_url.fileURLToPath)(cwd) : cwd;
|
|
7787
|
-
const cwdPath = import_node_path.default.resolve(cwdString);
|
|
7788
|
-
const result = [];
|
|
7789
|
-
if (preferLocal) {
|
|
7790
|
-
applyPreferLocal(result, cwdPath);
|
|
7791
|
-
}
|
|
7792
|
-
if (addExecPath) {
|
|
7793
|
-
applyExecPath(result, execPath, cwdPath);
|
|
7794
|
-
}
|
|
7795
|
-
return [...result, pathOption].join(import_node_path.default.delimiter);
|
|
7796
|
-
};
|
|
7797
|
-
var applyPreferLocal = (result, cwdPath) => {
|
|
7798
|
-
let previous;
|
|
7799
|
-
while (previous !== cwdPath) {
|
|
7800
|
-
result.push(import_node_path.default.join(cwdPath, "node_modules/.bin"));
|
|
7801
|
-
previous = cwdPath;
|
|
7802
|
-
cwdPath = import_node_path.default.resolve(cwdPath, "..");
|
|
7803
|
-
}
|
|
7804
|
-
};
|
|
7805
|
-
var applyExecPath = (result, execPath, cwdPath) => {
|
|
7806
|
-
const execPathString = execPath instanceof URL ? (0, import_node_url.fileURLToPath)(execPath) : execPath;
|
|
7807
|
-
result.push(import_node_path.default.resolve(cwdPath, execPathString, ".."));
|
|
7808
|
-
};
|
|
7809
|
-
var npmRunPathEnv = ({ env = import_node_process.default.env, ...options } = {}) => {
|
|
7810
|
-
env = { ...env };
|
|
7811
|
-
const pathName = pathKey({ env });
|
|
7812
|
-
options.path = env[pathName];
|
|
7813
|
-
env[pathName] = npmRunPath(options);
|
|
7814
|
-
return env;
|
|
7815
|
-
};
|
|
7816
|
-
|
|
7817
|
-
// ../../node_modules/.pnpm/mimic-fn@4.0.0/node_modules/mimic-fn/index.js
|
|
7818
|
-
var copyProperty = (to, from, property11, ignoreNonConfigurable) => {
|
|
7819
|
-
if (property11 === "length" || property11 === "prototype") {
|
|
7820
|
-
return;
|
|
7821
|
-
}
|
|
7822
|
-
if (property11 === "arguments" || property11 === "caller") {
|
|
7823
|
-
return;
|
|
7824
|
-
}
|
|
7825
|
-
const toDescriptor = Object.getOwnPropertyDescriptor(to, property11);
|
|
7826
|
-
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property11);
|
|
7827
|
-
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
|
|
7828
|
-
return;
|
|
7829
|
-
}
|
|
7830
|
-
Object.defineProperty(to, property11, fromDescriptor);
|
|
7831
|
-
};
|
|
7832
|
-
var canCopyProperty = function(toDescriptor, fromDescriptor) {
|
|
7833
|
-
return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
|
|
7834
|
-
};
|
|
7835
|
-
var changePrototype = (to, from) => {
|
|
7836
|
-
const fromPrototype = Object.getPrototypeOf(from);
|
|
7837
|
-
if (fromPrototype === Object.getPrototypeOf(to)) {
|
|
7838
|
-
return;
|
|
7839
|
-
}
|
|
7840
|
-
Object.setPrototypeOf(to, fromPrototype);
|
|
7841
|
-
};
|
|
7842
|
-
var wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/
|
|
7843
|
-
${fromBody}`;
|
|
7844
|
-
var toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
|
|
7845
|
-
var toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
|
|
7846
|
-
var changeToString = (to, from, name) => {
|
|
7847
|
-
const withName = name === "" ? "" : `with ${name.trim()}() `;
|
|
7848
|
-
const newToString = wrappedToString.bind(null, withName, from.toString());
|
|
7849
|
-
Object.defineProperty(newToString, "name", toStringName);
|
|
7850
|
-
Object.defineProperty(to, "toString", { ...toStringDescriptor, value: newToString });
|
|
7851
|
-
};
|
|
7852
|
-
function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
|
|
7853
|
-
const { name } = to;
|
|
7854
|
-
for (const property11 of Reflect.ownKeys(from)) {
|
|
7855
|
-
copyProperty(to, from, property11, ignoreNonConfigurable);
|
|
7856
|
-
}
|
|
7857
|
-
changePrototype(to, from);
|
|
7858
|
-
changeToString(to, from, name);
|
|
7859
|
-
return to;
|
|
7860
|
-
}
|
|
7861
|
-
|
|
7862
|
-
// ../../node_modules/.pnpm/onetime@6.0.0/node_modules/onetime/index.js
|
|
7863
|
-
var calledFunctions = /* @__PURE__ */ new WeakMap();
|
|
7864
|
-
var onetime = (function_, options = {}) => {
|
|
7865
|
-
if (typeof function_ !== "function") {
|
|
7866
|
-
throw new TypeError("Expected a function");
|
|
7867
|
-
}
|
|
7868
|
-
let returnValue;
|
|
7869
|
-
let callCount = 0;
|
|
7870
|
-
const functionName = function_.displayName || function_.name || "<anonymous>";
|
|
7871
|
-
const onetime2 = function(...arguments_) {
|
|
7872
|
-
calledFunctions.set(onetime2, ++callCount);
|
|
7873
|
-
if (callCount === 1) {
|
|
7874
|
-
returnValue = function_.apply(this, arguments_);
|
|
7875
|
-
function_ = null;
|
|
7876
|
-
} else if (options.throw === true) {
|
|
7877
|
-
throw new Error(`Function \`${functionName}\` can only be called once`);
|
|
7878
|
-
}
|
|
7879
|
-
return returnValue;
|
|
7880
|
-
};
|
|
7881
|
-
mimicFunction(onetime2, function_);
|
|
7882
|
-
calledFunctions.set(onetime2, callCount);
|
|
7883
|
-
return onetime2;
|
|
7884
|
-
};
|
|
7885
|
-
onetime.callCount = (function_) => {
|
|
7886
|
-
if (!calledFunctions.has(function_)) {
|
|
7887
|
-
throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
|
|
7888
|
-
}
|
|
7889
|
-
return calledFunctions.get(function_);
|
|
7890
|
-
};
|
|
7891
|
-
var onetime_default = onetime;
|
|
7892
|
-
|
|
7893
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/error.js
|
|
7894
|
-
var import_node_process2 = __toESM(require("node:process"), 1);
|
|
7895
|
-
|
|
7896
|
-
// ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/main.js
|
|
7897
|
-
var import_node_os2 = require("node:os");
|
|
7898
|
-
|
|
7899
|
-
// ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/realtime.js
|
|
7900
|
-
var getRealtimeSignals = () => {
|
|
7901
|
-
const length = SIGRTMAX - SIGRTMIN + 1;
|
|
7902
|
-
return Array.from({ length }, getRealtimeSignal);
|
|
7903
|
-
};
|
|
7904
|
-
var getRealtimeSignal = (value, index) => ({
|
|
7905
|
-
name: `SIGRT${index + 1}`,
|
|
7906
|
-
number: SIGRTMIN + index,
|
|
7907
|
-
action: "terminate",
|
|
7908
|
-
description: "Application-specific signal (realtime)",
|
|
7909
|
-
standard: "posix"
|
|
7910
|
-
});
|
|
7911
|
-
var SIGRTMIN = 34;
|
|
7912
|
-
var SIGRTMAX = 64;
|
|
7913
|
-
|
|
7914
|
-
// ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/signals.js
|
|
7915
|
-
var import_node_os = require("node:os");
|
|
7916
|
-
|
|
7917
|
-
// ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/core.js
|
|
7918
|
-
var SIGNALS = [
|
|
7919
|
-
{
|
|
7920
|
-
name: "SIGHUP",
|
|
7921
|
-
number: 1,
|
|
7922
|
-
action: "terminate",
|
|
7923
|
-
description: "Terminal closed",
|
|
7924
|
-
standard: "posix"
|
|
7925
|
-
},
|
|
7926
|
-
{
|
|
7927
|
-
name: "SIGINT",
|
|
7928
|
-
number: 2,
|
|
7929
|
-
action: "terminate",
|
|
7930
|
-
description: "User interruption with CTRL-C",
|
|
7931
|
-
standard: "ansi"
|
|
7932
|
-
},
|
|
7933
|
-
{
|
|
7934
|
-
name: "SIGQUIT",
|
|
7935
|
-
number: 3,
|
|
7936
|
-
action: "core",
|
|
7937
|
-
description: "User interruption with CTRL-\\",
|
|
7938
|
-
standard: "posix"
|
|
7939
|
-
},
|
|
7940
|
-
{
|
|
7941
|
-
name: "SIGILL",
|
|
7942
|
-
number: 4,
|
|
7943
|
-
action: "core",
|
|
7944
|
-
description: "Invalid machine instruction",
|
|
7945
|
-
standard: "ansi"
|
|
7946
|
-
},
|
|
7947
|
-
{
|
|
7948
|
-
name: "SIGTRAP",
|
|
7949
|
-
number: 5,
|
|
7950
|
-
action: "core",
|
|
7951
|
-
description: "Debugger breakpoint",
|
|
7952
|
-
standard: "posix"
|
|
7953
|
-
},
|
|
7954
|
-
{
|
|
7955
|
-
name: "SIGABRT",
|
|
7956
|
-
number: 6,
|
|
7957
|
-
action: "core",
|
|
7958
|
-
description: "Aborted",
|
|
7959
|
-
standard: "ansi"
|
|
7960
|
-
},
|
|
7961
|
-
{
|
|
7962
|
-
name: "SIGIOT",
|
|
7963
|
-
number: 6,
|
|
7964
|
-
action: "core",
|
|
7965
|
-
description: "Aborted",
|
|
7966
|
-
standard: "bsd"
|
|
7967
|
-
},
|
|
7968
|
-
{
|
|
7969
|
-
name: "SIGBUS",
|
|
7970
|
-
number: 7,
|
|
7971
|
-
action: "core",
|
|
7972
|
-
description: "Bus error due to misaligned, non-existing address or paging error",
|
|
7973
|
-
standard: "bsd"
|
|
7974
|
-
},
|
|
7975
|
-
{
|
|
7976
|
-
name: "SIGEMT",
|
|
7977
|
-
number: 7,
|
|
7978
|
-
action: "terminate",
|
|
7979
|
-
description: "Command should be emulated but is not implemented",
|
|
7980
|
-
standard: "other"
|
|
7981
|
-
},
|
|
7982
|
-
{
|
|
7983
|
-
name: "SIGFPE",
|
|
7984
|
-
number: 8,
|
|
7985
|
-
action: "core",
|
|
7986
|
-
description: "Floating point arithmetic error",
|
|
7987
|
-
standard: "ansi"
|
|
7988
|
-
},
|
|
7989
|
-
{
|
|
7990
|
-
name: "SIGKILL",
|
|
7991
|
-
number: 9,
|
|
7992
|
-
action: "terminate",
|
|
7993
|
-
description: "Forced termination",
|
|
7994
|
-
standard: "posix",
|
|
7995
|
-
forced: true
|
|
7996
|
-
},
|
|
7997
|
-
{
|
|
7998
|
-
name: "SIGUSR1",
|
|
7999
|
-
number: 10,
|
|
8000
|
-
action: "terminate",
|
|
8001
|
-
description: "Application-specific signal",
|
|
8002
|
-
standard: "posix"
|
|
8003
|
-
},
|
|
8004
|
-
{
|
|
8005
|
-
name: "SIGSEGV",
|
|
8006
|
-
number: 11,
|
|
8007
|
-
action: "core",
|
|
8008
|
-
description: "Segmentation fault",
|
|
8009
|
-
standard: "ansi"
|
|
8010
|
-
},
|
|
8011
|
-
{
|
|
8012
|
-
name: "SIGUSR2",
|
|
8013
|
-
number: 12,
|
|
8014
|
-
action: "terminate",
|
|
8015
|
-
description: "Application-specific signal",
|
|
8016
|
-
standard: "posix"
|
|
8017
|
-
},
|
|
8018
|
-
{
|
|
8019
|
-
name: "SIGPIPE",
|
|
8020
|
-
number: 13,
|
|
8021
|
-
action: "terminate",
|
|
8022
|
-
description: "Broken pipe or socket",
|
|
8023
|
-
standard: "posix"
|
|
8024
|
-
},
|
|
8025
|
-
{
|
|
8026
|
-
name: "SIGALRM",
|
|
8027
|
-
number: 14,
|
|
8028
|
-
action: "terminate",
|
|
8029
|
-
description: "Timeout or timer",
|
|
8030
|
-
standard: "posix"
|
|
8031
|
-
},
|
|
8032
|
-
{
|
|
8033
|
-
name: "SIGTERM",
|
|
8034
|
-
number: 15,
|
|
8035
|
-
action: "terminate",
|
|
8036
|
-
description: "Termination",
|
|
8037
|
-
standard: "ansi"
|
|
8038
|
-
},
|
|
8039
|
-
{
|
|
8040
|
-
name: "SIGSTKFLT",
|
|
8041
|
-
number: 16,
|
|
8042
|
-
action: "terminate",
|
|
8043
|
-
description: "Stack is empty or overflowed",
|
|
8044
|
-
standard: "other"
|
|
8045
|
-
},
|
|
8046
|
-
{
|
|
8047
|
-
name: "SIGCHLD",
|
|
8048
|
-
number: 17,
|
|
8049
|
-
action: "ignore",
|
|
8050
|
-
description: "Child process terminated, paused or unpaused",
|
|
8051
|
-
standard: "posix"
|
|
8052
|
-
},
|
|
8053
|
-
{
|
|
8054
|
-
name: "SIGCLD",
|
|
8055
|
-
number: 17,
|
|
8056
|
-
action: "ignore",
|
|
8057
|
-
description: "Child process terminated, paused or unpaused",
|
|
8058
|
-
standard: "other"
|
|
8059
|
-
},
|
|
8060
|
-
{
|
|
8061
|
-
name: "SIGCONT",
|
|
8062
|
-
number: 18,
|
|
8063
|
-
action: "unpause",
|
|
8064
|
-
description: "Unpaused",
|
|
8065
|
-
standard: "posix",
|
|
8066
|
-
forced: true
|
|
8067
|
-
},
|
|
8068
|
-
{
|
|
8069
|
-
name: "SIGSTOP",
|
|
8070
|
-
number: 19,
|
|
8071
|
-
action: "pause",
|
|
8072
|
-
description: "Paused",
|
|
8073
|
-
standard: "posix",
|
|
8074
|
-
forced: true
|
|
8075
|
-
},
|
|
8076
|
-
{
|
|
8077
|
-
name: "SIGTSTP",
|
|
8078
|
-
number: 20,
|
|
8079
|
-
action: "pause",
|
|
8080
|
-
description: 'Paused using CTRL-Z or "suspend"',
|
|
8081
|
-
standard: "posix"
|
|
8082
|
-
},
|
|
8083
|
-
{
|
|
8084
|
-
name: "SIGTTIN",
|
|
8085
|
-
number: 21,
|
|
8086
|
-
action: "pause",
|
|
8087
|
-
description: "Background process cannot read terminal input",
|
|
8088
|
-
standard: "posix"
|
|
8089
|
-
},
|
|
8090
|
-
{
|
|
8091
|
-
name: "SIGBREAK",
|
|
8092
|
-
number: 21,
|
|
8093
|
-
action: "terminate",
|
|
8094
|
-
description: "User interruption with CTRL-BREAK",
|
|
8095
|
-
standard: "other"
|
|
8096
|
-
},
|
|
8097
|
-
{
|
|
8098
|
-
name: "SIGTTOU",
|
|
8099
|
-
number: 22,
|
|
8100
|
-
action: "pause",
|
|
8101
|
-
description: "Background process cannot write to terminal output",
|
|
8102
|
-
standard: "posix"
|
|
8103
|
-
},
|
|
8104
|
-
{
|
|
8105
|
-
name: "SIGURG",
|
|
8106
|
-
number: 23,
|
|
8107
|
-
action: "ignore",
|
|
8108
|
-
description: "Socket received out-of-band data",
|
|
8109
|
-
standard: "bsd"
|
|
8110
|
-
},
|
|
8111
|
-
{
|
|
8112
|
-
name: "SIGXCPU",
|
|
8113
|
-
number: 24,
|
|
8114
|
-
action: "core",
|
|
8115
|
-
description: "Process timed out",
|
|
8116
|
-
standard: "bsd"
|
|
8117
|
-
},
|
|
8118
|
-
{
|
|
8119
|
-
name: "SIGXFSZ",
|
|
8120
|
-
number: 25,
|
|
8121
|
-
action: "core",
|
|
8122
|
-
description: "File too big",
|
|
8123
|
-
standard: "bsd"
|
|
8124
|
-
},
|
|
8125
|
-
{
|
|
8126
|
-
name: "SIGVTALRM",
|
|
8127
|
-
number: 26,
|
|
8128
|
-
action: "terminate",
|
|
8129
|
-
description: "Timeout or timer",
|
|
8130
|
-
standard: "bsd"
|
|
8131
|
-
},
|
|
8132
|
-
{
|
|
8133
|
-
name: "SIGPROF",
|
|
8134
|
-
number: 27,
|
|
8135
|
-
action: "terminate",
|
|
8136
|
-
description: "Timeout or timer",
|
|
8137
|
-
standard: "bsd"
|
|
8138
|
-
},
|
|
8139
|
-
{
|
|
8140
|
-
name: "SIGWINCH",
|
|
8141
|
-
number: 28,
|
|
8142
|
-
action: "ignore",
|
|
8143
|
-
description: "Terminal window size changed",
|
|
8144
|
-
standard: "bsd"
|
|
8145
|
-
},
|
|
8146
|
-
{
|
|
8147
|
-
name: "SIGIO",
|
|
8148
|
-
number: 29,
|
|
8149
|
-
action: "terminate",
|
|
8150
|
-
description: "I/O is available",
|
|
8151
|
-
standard: "other"
|
|
8152
|
-
},
|
|
8153
|
-
{
|
|
8154
|
-
name: "SIGPOLL",
|
|
8155
|
-
number: 29,
|
|
8156
|
-
action: "terminate",
|
|
8157
|
-
description: "Watched event",
|
|
8158
|
-
standard: "other"
|
|
8159
|
-
},
|
|
8160
|
-
{
|
|
8161
|
-
name: "SIGINFO",
|
|
8162
|
-
number: 29,
|
|
8163
|
-
action: "ignore",
|
|
8164
|
-
description: "Request for process information",
|
|
8165
|
-
standard: "other"
|
|
8166
|
-
},
|
|
8167
|
-
{
|
|
8168
|
-
name: "SIGPWR",
|
|
8169
|
-
number: 30,
|
|
8170
|
-
action: "terminate",
|
|
8171
|
-
description: "Device running out of power",
|
|
8172
|
-
standard: "systemv"
|
|
8173
|
-
},
|
|
8174
|
-
{
|
|
8175
|
-
name: "SIGSYS",
|
|
8176
|
-
number: 31,
|
|
8177
|
-
action: "core",
|
|
8178
|
-
description: "Invalid system call",
|
|
8179
|
-
standard: "other"
|
|
8180
|
-
},
|
|
8181
|
-
{
|
|
8182
|
-
name: "SIGUNUSED",
|
|
8183
|
-
number: 31,
|
|
8184
|
-
action: "terminate",
|
|
8185
|
-
description: "Invalid system call",
|
|
8186
|
-
standard: "other"
|
|
8187
|
-
}
|
|
8188
|
-
];
|
|
8189
|
-
|
|
8190
|
-
// ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/signals.js
|
|
8191
|
-
var getSignals = () => {
|
|
8192
|
-
const realtimeSignals = getRealtimeSignals();
|
|
8193
|
-
const signals2 = [...SIGNALS, ...realtimeSignals].map(normalizeSignal);
|
|
8194
|
-
return signals2;
|
|
8195
|
-
};
|
|
8196
|
-
var normalizeSignal = ({
|
|
8197
|
-
name,
|
|
8198
|
-
number: defaultNumber,
|
|
8199
|
-
description,
|
|
8200
|
-
action,
|
|
8201
|
-
forced = false,
|
|
8202
|
-
standard
|
|
8203
|
-
}) => {
|
|
8204
|
-
const {
|
|
8205
|
-
signals: { [name]: constantSignal }
|
|
8206
|
-
} = import_node_os.constants;
|
|
8207
|
-
const supported = constantSignal !== void 0;
|
|
8208
|
-
const number = supported ? constantSignal : defaultNumber;
|
|
8209
|
-
return { name, number, description, supported, action, forced, standard };
|
|
8210
|
-
};
|
|
8211
|
-
|
|
8212
|
-
// ../../node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/main.js
|
|
8213
|
-
var getSignalsByName = () => {
|
|
8214
|
-
const signals2 = getSignals();
|
|
8215
|
-
return Object.fromEntries(signals2.map(getSignalByName));
|
|
8216
|
-
};
|
|
8217
|
-
var getSignalByName = ({
|
|
8218
|
-
name,
|
|
8219
|
-
number,
|
|
8220
|
-
description,
|
|
8221
|
-
supported,
|
|
8222
|
-
action,
|
|
8223
|
-
forced,
|
|
8224
|
-
standard
|
|
8225
|
-
}) => [name, { name, number, description, supported, action, forced, standard }];
|
|
8226
|
-
var signalsByName = getSignalsByName();
|
|
8227
|
-
var getSignalsByNumber = () => {
|
|
8228
|
-
const signals2 = getSignals();
|
|
8229
|
-
const length = SIGRTMAX + 1;
|
|
8230
|
-
const signalsA = Array.from(
|
|
8231
|
-
{ length },
|
|
8232
|
-
(value, number) => getSignalByNumber(number, signals2)
|
|
8233
|
-
);
|
|
8234
|
-
return Object.assign({}, ...signalsA);
|
|
8235
|
-
};
|
|
8236
|
-
var getSignalByNumber = (number, signals2) => {
|
|
8237
|
-
const signal = findSignalByNumber(number, signals2);
|
|
8238
|
-
if (signal === void 0) {
|
|
8239
|
-
return {};
|
|
8240
|
-
}
|
|
8241
|
-
const { name, description, supported, action, forced, standard } = signal;
|
|
8242
|
-
return {
|
|
8243
|
-
[number]: {
|
|
8244
|
-
name,
|
|
8245
|
-
number,
|
|
8246
|
-
description,
|
|
8247
|
-
supported,
|
|
8248
|
-
action,
|
|
8249
|
-
forced,
|
|
8250
|
-
standard
|
|
8251
|
-
}
|
|
8252
|
-
};
|
|
8253
|
-
};
|
|
8254
|
-
var findSignalByNumber = (number, signals2) => {
|
|
8255
|
-
const signal = signals2.find(({ name }) => import_node_os2.constants.signals[name] === number);
|
|
8256
|
-
if (signal !== void 0) {
|
|
8257
|
-
return signal;
|
|
8258
|
-
}
|
|
8259
|
-
return signals2.find((signalA) => signalA.number === number);
|
|
8260
|
-
};
|
|
8261
|
-
var signalsByNumber = getSignalsByNumber();
|
|
8262
|
-
|
|
8263
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/error.js
|
|
8264
|
-
var getErrorPrefix = ({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }) => {
|
|
8265
|
-
if (timedOut) {
|
|
8266
|
-
return `timed out after ${timeout} milliseconds`;
|
|
8267
|
-
}
|
|
8268
|
-
if (isCanceled) {
|
|
8269
|
-
return "was canceled";
|
|
8270
|
-
}
|
|
8271
|
-
if (errorCode !== void 0) {
|
|
8272
|
-
return `failed with ${errorCode}`;
|
|
8273
|
-
}
|
|
8274
|
-
if (signal !== void 0) {
|
|
8275
|
-
return `was killed with ${signal} (${signalDescription})`;
|
|
8276
|
-
}
|
|
8277
|
-
if (exitCode !== void 0) {
|
|
8278
|
-
return `failed with exit code ${exitCode}`;
|
|
8279
|
-
}
|
|
8280
|
-
return "failed";
|
|
8281
|
-
};
|
|
8282
|
-
var makeError = ({
|
|
8283
|
-
stdout,
|
|
8284
|
-
stderr,
|
|
8285
|
-
all,
|
|
8286
|
-
error,
|
|
8287
|
-
signal,
|
|
8288
|
-
exitCode,
|
|
8289
|
-
command,
|
|
8290
|
-
escapedCommand,
|
|
8291
|
-
timedOut,
|
|
8292
|
-
isCanceled,
|
|
8293
|
-
killed,
|
|
8294
|
-
parsed: { options: { timeout, cwd = import_node_process2.default.cwd() } }
|
|
8295
|
-
}) => {
|
|
8296
|
-
exitCode = exitCode === null ? void 0 : exitCode;
|
|
8297
|
-
signal = signal === null ? void 0 : signal;
|
|
8298
|
-
const signalDescription = signal === void 0 ? void 0 : signalsByName[signal].description;
|
|
8299
|
-
const errorCode = error && error.code;
|
|
8300
|
-
const prefix = getErrorPrefix({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled });
|
|
8301
|
-
const execaMessage = `Command ${prefix}: ${command}`;
|
|
8302
|
-
const isError = Object.prototype.toString.call(error) === "[object Error]";
|
|
8303
|
-
const shortMessage = isError ? `${execaMessage}
|
|
8304
|
-
${error.message}` : execaMessage;
|
|
8305
|
-
const message = [shortMessage, stderr, stdout].filter(Boolean).join("\n");
|
|
8306
|
-
if (isError) {
|
|
8307
|
-
error.originalMessage = error.message;
|
|
8308
|
-
error.message = message;
|
|
8309
|
-
} else {
|
|
8310
|
-
error = new Error(message);
|
|
8311
|
-
}
|
|
8312
|
-
error.shortMessage = shortMessage;
|
|
8313
|
-
error.command = command;
|
|
8314
|
-
error.escapedCommand = escapedCommand;
|
|
8315
|
-
error.exitCode = exitCode;
|
|
8316
|
-
error.signal = signal;
|
|
8317
|
-
error.signalDescription = signalDescription;
|
|
8318
|
-
error.stdout = stdout;
|
|
8319
|
-
error.stderr = stderr;
|
|
8320
|
-
error.cwd = cwd;
|
|
8321
|
-
if (all !== void 0) {
|
|
8322
|
-
error.all = all;
|
|
8323
|
-
}
|
|
8324
|
-
if ("bufferedData" in error) {
|
|
8325
|
-
delete error.bufferedData;
|
|
8326
|
-
}
|
|
8327
|
-
error.failed = true;
|
|
8328
|
-
error.timedOut = Boolean(timedOut);
|
|
8329
|
-
error.isCanceled = isCanceled;
|
|
8330
|
-
error.killed = killed && !timedOut;
|
|
8331
|
-
return error;
|
|
8332
|
-
};
|
|
8333
|
-
|
|
8334
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stdio.js
|
|
8335
|
-
var aliases = ["stdin", "stdout", "stderr"];
|
|
8336
|
-
var hasAlias = (options) => aliases.some((alias) => options[alias] !== void 0);
|
|
8337
|
-
var normalizeStdio = (options) => {
|
|
8338
|
-
if (!options) {
|
|
8339
|
-
return;
|
|
8340
|
-
}
|
|
8341
|
-
const { stdio } = options;
|
|
8342
|
-
if (stdio === void 0) {
|
|
8343
|
-
return aliases.map((alias) => options[alias]);
|
|
8344
|
-
}
|
|
8345
|
-
if (hasAlias(options)) {
|
|
8346
|
-
throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map((alias) => `\`${alias}\``).join(", ")}`);
|
|
8347
|
-
}
|
|
8348
|
-
if (typeof stdio === "string") {
|
|
8349
|
-
return stdio;
|
|
8350
|
-
}
|
|
8351
|
-
if (!Array.isArray(stdio)) {
|
|
8352
|
-
throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
|
|
8353
|
-
}
|
|
8354
|
-
const length = Math.max(stdio.length, aliases.length);
|
|
8355
|
-
return Array.from({ length }, (value, index) => stdio[index]);
|
|
8356
|
-
};
|
|
8357
|
-
|
|
8358
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/kill.js
|
|
8359
|
-
var import_node_os3 = __toESM(require("node:os"), 1);
|
|
8360
|
-
|
|
8361
|
-
// ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
8362
|
-
var signals = [];
|
|
8363
|
-
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
8364
|
-
if (process.platform !== "win32") {
|
|
8365
|
-
signals.push(
|
|
8366
|
-
"SIGALRM",
|
|
8367
|
-
"SIGABRT",
|
|
8368
|
-
"SIGVTALRM",
|
|
8369
|
-
"SIGXCPU",
|
|
8370
|
-
"SIGXFSZ",
|
|
8371
|
-
"SIGUSR2",
|
|
8372
|
-
"SIGTRAP",
|
|
8373
|
-
"SIGSYS",
|
|
8374
|
-
"SIGQUIT",
|
|
8375
|
-
"SIGIOT"
|
|
8376
|
-
// should detect profiler and enable/disable accordingly.
|
|
8377
|
-
// see #21
|
|
8378
|
-
// 'SIGPROF'
|
|
8379
|
-
);
|
|
8380
|
-
}
|
|
8381
|
-
if (process.platform === "linux") {
|
|
8382
|
-
signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
8383
|
-
}
|
|
8384
|
-
|
|
8385
|
-
// ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
|
|
8386
|
-
var processOk = (process7) => !!process7 && typeof process7 === "object" && typeof process7.removeListener === "function" && typeof process7.emit === "function" && typeof process7.reallyExit === "function" && typeof process7.listeners === "function" && typeof process7.kill === "function" && typeof process7.pid === "number" && typeof process7.on === "function";
|
|
8387
|
-
var kExitEmitter = Symbol.for("signal-exit emitter");
|
|
8388
|
-
var global2 = globalThis;
|
|
8389
|
-
var ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
8390
|
-
var Emitter = class {
|
|
8391
|
-
emitted = {
|
|
8392
|
-
afterExit: false,
|
|
8393
|
-
exit: false
|
|
8394
|
-
};
|
|
8395
|
-
listeners = {
|
|
8396
|
-
afterExit: [],
|
|
8397
|
-
exit: []
|
|
8398
|
-
};
|
|
8399
|
-
count = 0;
|
|
8400
|
-
id = Math.random();
|
|
8401
|
-
constructor() {
|
|
8402
|
-
if (global2[kExitEmitter]) {
|
|
8403
|
-
return global2[kExitEmitter];
|
|
8404
|
-
}
|
|
8405
|
-
ObjectDefineProperty(global2, kExitEmitter, {
|
|
8406
|
-
value: this,
|
|
8407
|
-
writable: false,
|
|
8408
|
-
enumerable: false,
|
|
8409
|
-
configurable: false
|
|
8410
|
-
});
|
|
8411
|
-
}
|
|
8412
|
-
on(ev, fn) {
|
|
8413
|
-
this.listeners[ev].push(fn);
|
|
8414
|
-
}
|
|
8415
|
-
removeListener(ev, fn) {
|
|
8416
|
-
const list = this.listeners[ev];
|
|
8417
|
-
const i = list.indexOf(fn);
|
|
8418
|
-
if (i === -1) {
|
|
8419
|
-
return;
|
|
8420
|
-
}
|
|
8421
|
-
if (i === 0 && list.length === 1) {
|
|
8422
|
-
list.length = 0;
|
|
8423
|
-
} else {
|
|
8424
|
-
list.splice(i, 1);
|
|
8425
|
-
}
|
|
8426
|
-
}
|
|
8427
|
-
emit(ev, code, signal) {
|
|
8428
|
-
if (this.emitted[ev]) {
|
|
8429
|
-
return false;
|
|
8430
|
-
}
|
|
8431
|
-
this.emitted[ev] = true;
|
|
8432
|
-
let ret = false;
|
|
8433
|
-
for (const fn of this.listeners[ev]) {
|
|
8434
|
-
ret = fn(code, signal) === true || ret;
|
|
8435
|
-
}
|
|
8436
|
-
if (ev === "exit") {
|
|
8437
|
-
ret = this.emit("afterExit", code, signal) || ret;
|
|
8438
|
-
}
|
|
8439
|
-
return ret;
|
|
8440
|
-
}
|
|
8441
|
-
};
|
|
8442
|
-
var SignalExitBase = class {
|
|
8443
|
-
};
|
|
8444
|
-
var signalExitWrap = (handler) => {
|
|
8445
|
-
return {
|
|
8446
|
-
onExit(cb, opts) {
|
|
8447
|
-
return handler.onExit(cb, opts);
|
|
8448
|
-
},
|
|
8449
|
-
load() {
|
|
8450
|
-
return handler.load();
|
|
8451
|
-
},
|
|
8452
|
-
unload() {
|
|
8453
|
-
return handler.unload();
|
|
8454
|
-
}
|
|
8455
|
-
};
|
|
8456
|
-
};
|
|
8457
|
-
var SignalExitFallback = class extends SignalExitBase {
|
|
8458
|
-
onExit() {
|
|
8459
|
-
return () => {
|
|
8460
|
-
};
|
|
8461
|
-
}
|
|
8462
|
-
load() {
|
|
8463
|
-
}
|
|
8464
|
-
unload() {
|
|
8465
|
-
}
|
|
8466
|
-
};
|
|
8467
|
-
var SignalExit = class extends SignalExitBase {
|
|
8468
|
-
// "SIGHUP" throws an `ENOSYS` error on Windows,
|
|
8469
|
-
// so use a supported signal instead
|
|
8470
|
-
/* c8 ignore start */
|
|
8471
|
-
#hupSig = process4.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
8472
|
-
/* c8 ignore stop */
|
|
8473
|
-
#emitter = new Emitter();
|
|
8474
|
-
#process;
|
|
8475
|
-
#originalProcessEmit;
|
|
8476
|
-
#originalProcessReallyExit;
|
|
8477
|
-
#sigListeners = {};
|
|
8478
|
-
#loaded = false;
|
|
8479
|
-
constructor(process7) {
|
|
8480
|
-
super();
|
|
8481
|
-
this.#process = process7;
|
|
8482
|
-
this.#sigListeners = {};
|
|
8483
|
-
for (const sig of signals) {
|
|
8484
|
-
this.#sigListeners[sig] = () => {
|
|
8485
|
-
const listeners = this.#process.listeners(sig);
|
|
8486
|
-
let { count } = this.#emitter;
|
|
8487
|
-
const p = process7;
|
|
8488
|
-
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") {
|
|
8489
|
-
count += p.__signal_exit_emitter__.count;
|
|
8490
|
-
}
|
|
8491
|
-
if (listeners.length === count) {
|
|
8492
|
-
this.unload();
|
|
8493
|
-
const ret = this.#emitter.emit("exit", null, sig);
|
|
8494
|
-
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
8495
|
-
if (!ret)
|
|
8496
|
-
process7.kill(process7.pid, s);
|
|
8497
|
-
}
|
|
8498
|
-
};
|
|
8499
|
-
}
|
|
8500
|
-
this.#originalProcessReallyExit = process7.reallyExit;
|
|
8501
|
-
this.#originalProcessEmit = process7.emit;
|
|
8502
|
-
}
|
|
8503
|
-
onExit(cb, opts) {
|
|
8504
|
-
if (!processOk(this.#process)) {
|
|
8505
|
-
return () => {
|
|
8506
|
-
};
|
|
8507
|
-
}
|
|
8508
|
-
if (this.#loaded === false) {
|
|
8509
|
-
this.load();
|
|
8510
|
-
}
|
|
8511
|
-
const ev = opts?.alwaysLast ? "afterExit" : "exit";
|
|
8512
|
-
this.#emitter.on(ev, cb);
|
|
8513
|
-
return () => {
|
|
8514
|
-
this.#emitter.removeListener(ev, cb);
|
|
8515
|
-
if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) {
|
|
8516
|
-
this.unload();
|
|
8517
|
-
}
|
|
8518
|
-
};
|
|
8519
|
-
}
|
|
8520
|
-
load() {
|
|
8521
|
-
if (this.#loaded) {
|
|
8522
|
-
return;
|
|
8523
|
-
}
|
|
8524
|
-
this.#loaded = true;
|
|
8525
|
-
this.#emitter.count += 1;
|
|
8526
|
-
for (const sig of signals) {
|
|
8527
|
-
try {
|
|
8528
|
-
const fn = this.#sigListeners[sig];
|
|
8529
|
-
if (fn)
|
|
8530
|
-
this.#process.on(sig, fn);
|
|
8531
|
-
} catch (_) {
|
|
8532
|
-
}
|
|
8533
|
-
}
|
|
8534
|
-
this.#process.emit = (ev, ...a) => {
|
|
8535
|
-
return this.#processEmit(ev, ...a);
|
|
8536
|
-
};
|
|
8537
|
-
this.#process.reallyExit = (code) => {
|
|
8538
|
-
return this.#processReallyExit(code);
|
|
8539
|
-
};
|
|
8540
|
-
}
|
|
8541
|
-
unload() {
|
|
8542
|
-
if (!this.#loaded) {
|
|
8543
|
-
return;
|
|
8544
|
-
}
|
|
8545
|
-
this.#loaded = false;
|
|
8546
|
-
signals.forEach((sig) => {
|
|
8547
|
-
const listener = this.#sigListeners[sig];
|
|
8548
|
-
if (!listener) {
|
|
8549
|
-
throw new Error("Listener not defined for signal: " + sig);
|
|
8550
|
-
}
|
|
8551
|
-
try {
|
|
8552
|
-
this.#process.removeListener(sig, listener);
|
|
8553
|
-
} catch (_) {
|
|
8554
|
-
}
|
|
8555
|
-
});
|
|
8556
|
-
this.#process.emit = this.#originalProcessEmit;
|
|
8557
|
-
this.#process.reallyExit = this.#originalProcessReallyExit;
|
|
8558
|
-
this.#emitter.count -= 1;
|
|
8559
|
-
}
|
|
8560
|
-
#processReallyExit(code) {
|
|
8561
|
-
if (!processOk(this.#process)) {
|
|
8562
|
-
return 0;
|
|
8563
|
-
}
|
|
8564
|
-
this.#process.exitCode = code || 0;
|
|
8565
|
-
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
8566
|
-
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
|
|
8567
|
-
}
|
|
8568
|
-
#processEmit(ev, ...args) {
|
|
8569
|
-
const og = this.#originalProcessEmit;
|
|
8570
|
-
if (ev === "exit" && processOk(this.#process)) {
|
|
8571
|
-
if (typeof args[0] === "number") {
|
|
8572
|
-
this.#process.exitCode = args[0];
|
|
8573
|
-
}
|
|
8574
|
-
const ret = og.call(this.#process, ev, ...args);
|
|
8575
|
-
this.#emitter.emit("exit", this.#process.exitCode, null);
|
|
8576
|
-
return ret;
|
|
8577
|
-
} else {
|
|
8578
|
-
return og.call(this.#process, ev, ...args);
|
|
8579
|
-
}
|
|
8580
|
-
}
|
|
8581
|
-
};
|
|
8582
|
-
var process4 = globalThis.process;
|
|
8583
|
-
var {
|
|
8584
|
-
/**
|
|
8585
|
-
* Called when the process is exiting, whether via signal, explicit
|
|
8586
|
-
* exit, or running out of stuff to do.
|
|
8587
|
-
*
|
|
8588
|
-
* If the global process object is not suitable for instrumentation,
|
|
8589
|
-
* then this will be a no-op.
|
|
8590
|
-
*
|
|
8591
|
-
* Returns a function that may be used to unload signal-exit.
|
|
8592
|
-
*/
|
|
8593
|
-
onExit,
|
|
8594
|
-
/**
|
|
8595
|
-
* Load the listeners. Likely you never need to call this, unless
|
|
8596
|
-
* doing a rather deep integration with signal-exit functionality.
|
|
8597
|
-
* Mostly exposed for the benefit of testing.
|
|
8598
|
-
*
|
|
8599
|
-
* @internal
|
|
8600
|
-
*/
|
|
8601
|
-
load,
|
|
8602
|
-
/**
|
|
8603
|
-
* Unload the listeners. Likely you never need to call this, unless
|
|
8604
|
-
* doing a rather deep integration with signal-exit functionality.
|
|
8605
|
-
* Mostly exposed for the benefit of testing.
|
|
8606
|
-
*
|
|
8607
|
-
* @internal
|
|
8608
|
-
*/
|
|
8609
|
-
unload
|
|
8610
|
-
} = signalExitWrap(processOk(process4) ? new SignalExit(process4) : new SignalExitFallback());
|
|
8611
|
-
|
|
8612
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/kill.js
|
|
8613
|
-
var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5;
|
|
8614
|
-
var spawnedKill = (kill, signal = "SIGTERM", options = {}) => {
|
|
8615
|
-
const killResult = kill(signal);
|
|
8616
|
-
setKillTimeout(kill, signal, options, killResult);
|
|
8617
|
-
return killResult;
|
|
8618
|
-
};
|
|
8619
|
-
var setKillTimeout = (kill, signal, options, killResult) => {
|
|
8620
|
-
if (!shouldForceKill(signal, options, killResult)) {
|
|
8621
|
-
return;
|
|
8622
|
-
}
|
|
8623
|
-
const timeout = getForceKillAfterTimeout(options);
|
|
8624
|
-
const t = setTimeout(() => {
|
|
8625
|
-
kill("SIGKILL");
|
|
8626
|
-
}, timeout);
|
|
8627
|
-
if (t.unref) {
|
|
8628
|
-
t.unref();
|
|
8629
|
-
}
|
|
8630
|
-
};
|
|
8631
|
-
var shouldForceKill = (signal, { forceKillAfterTimeout }, killResult) => isSigterm(signal) && forceKillAfterTimeout !== false && killResult;
|
|
8632
|
-
var isSigterm = (signal) => signal === import_node_os3.default.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM";
|
|
8633
|
-
var getForceKillAfterTimeout = ({ forceKillAfterTimeout = true }) => {
|
|
8634
|
-
if (forceKillAfterTimeout === true) {
|
|
8635
|
-
return DEFAULT_FORCE_KILL_TIMEOUT;
|
|
8636
|
-
}
|
|
8637
|
-
if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) {
|
|
8638
|
-
throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);
|
|
8639
|
-
}
|
|
8640
|
-
return forceKillAfterTimeout;
|
|
8641
|
-
};
|
|
8642
|
-
var spawnedCancel = (spawned, context) => {
|
|
8643
|
-
const killResult = spawned.kill();
|
|
8644
|
-
if (killResult) {
|
|
8645
|
-
context.isCanceled = true;
|
|
8646
|
-
}
|
|
8647
|
-
};
|
|
8648
|
-
var timeoutKill = (spawned, signal, reject) => {
|
|
8649
|
-
spawned.kill(signal);
|
|
8650
|
-
reject(Object.assign(new Error("Timed out"), { timedOut: true, signal }));
|
|
8651
|
-
};
|
|
8652
|
-
var setupTimeout = (spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise) => {
|
|
8653
|
-
if (timeout === 0 || timeout === void 0) {
|
|
8654
|
-
return spawnedPromise;
|
|
8655
|
-
}
|
|
8656
|
-
let timeoutId;
|
|
8657
|
-
const timeoutPromise = new Promise((resolve, reject) => {
|
|
8658
|
-
timeoutId = setTimeout(() => {
|
|
8659
|
-
timeoutKill(spawned, killSignal, reject);
|
|
8660
|
-
}, timeout);
|
|
8661
|
-
});
|
|
8662
|
-
const safeSpawnedPromise = spawnedPromise.finally(() => {
|
|
8663
|
-
clearTimeout(timeoutId);
|
|
8664
|
-
});
|
|
8665
|
-
return Promise.race([timeoutPromise, safeSpawnedPromise]);
|
|
8666
|
-
};
|
|
8667
|
-
var validateTimeout = ({ timeout }) => {
|
|
8668
|
-
if (timeout !== void 0 && (!Number.isFinite(timeout) || timeout < 0)) {
|
|
8669
|
-
throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
|
|
8670
|
-
}
|
|
8671
|
-
};
|
|
8672
|
-
var setExitHandler = async (spawned, { cleanup, detached }, timedPromise) => {
|
|
8673
|
-
if (!cleanup || detached) {
|
|
8674
|
-
return timedPromise;
|
|
8675
|
-
}
|
|
8676
|
-
const removeExitHandler = onExit(() => {
|
|
8677
|
-
spawned.kill();
|
|
8678
|
-
});
|
|
8679
|
-
return timedPromise.finally(() => {
|
|
8680
|
-
removeExitHandler();
|
|
8681
|
-
});
|
|
8682
|
-
};
|
|
8683
|
-
|
|
8684
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/pipe.js
|
|
8685
|
-
var import_node_fs = require("node:fs");
|
|
8686
|
-
var import_node_child_process = require("node:child_process");
|
|
8687
|
-
|
|
8688
|
-
// ../../node_modules/.pnpm/is-stream@3.0.0/node_modules/is-stream/index.js
|
|
8689
|
-
function isStream(stream) {
|
|
8690
|
-
return stream !== null && typeof stream === "object" && typeof stream.pipe === "function";
|
|
8691
|
-
}
|
|
8692
|
-
function isWritableStream(stream) {
|
|
8693
|
-
return isStream(stream) && stream.writable !== false && typeof stream._write === "function" && typeof stream._writableState === "object";
|
|
8694
|
-
}
|
|
8695
|
-
|
|
8696
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/pipe.js
|
|
8697
|
-
var isExecaChildProcess = (target) => target instanceof import_node_child_process.ChildProcess && typeof target.then === "function";
|
|
8698
|
-
var pipeToTarget = (spawned, streamName, target) => {
|
|
8699
|
-
if (typeof target === "string") {
|
|
8700
|
-
spawned[streamName].pipe((0, import_node_fs.createWriteStream)(target));
|
|
8701
|
-
return spawned;
|
|
8702
|
-
}
|
|
8703
|
-
if (isWritableStream(target)) {
|
|
8704
|
-
spawned[streamName].pipe(target);
|
|
8705
|
-
return spawned;
|
|
8706
|
-
}
|
|
8707
|
-
if (!isExecaChildProcess(target)) {
|
|
8708
|
-
throw new TypeError("The second argument must be a string, a stream or an Execa child process.");
|
|
8709
|
-
}
|
|
8710
|
-
if (!isWritableStream(target.stdin)) {
|
|
8711
|
-
throw new TypeError("The target child process's stdin must be available.");
|
|
8712
|
-
}
|
|
8713
|
-
spawned[streamName].pipe(target.stdin);
|
|
8714
|
-
return target;
|
|
8715
|
-
};
|
|
8716
|
-
var addPipeMethods = (spawned) => {
|
|
8717
|
-
if (spawned.stdout !== null) {
|
|
8718
|
-
spawned.pipeStdout = pipeToTarget.bind(void 0, spawned, "stdout");
|
|
8719
|
-
}
|
|
8720
|
-
if (spawned.stderr !== null) {
|
|
8721
|
-
spawned.pipeStderr = pipeToTarget.bind(void 0, spawned, "stderr");
|
|
8722
|
-
}
|
|
8723
|
-
if (spawned.all !== void 0) {
|
|
8724
|
-
spawned.pipeAll = pipeToTarget.bind(void 0, spawned, "all");
|
|
8725
|
-
}
|
|
8726
|
-
};
|
|
8727
|
-
|
|
8728
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stream.js
|
|
8729
|
-
var import_node_fs2 = require("node:fs");
|
|
8730
|
-
var import_promises2 = require("node:timers/promises");
|
|
8731
|
-
|
|
8732
|
-
// ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/contents.js
|
|
8733
|
-
var getStreamContents = async (stream, { init: init2, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize }, { maxBuffer = Number.POSITIVE_INFINITY } = {}) => {
|
|
8734
|
-
if (!isAsyncIterable(stream)) {
|
|
8735
|
-
throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");
|
|
8736
|
-
}
|
|
8737
|
-
const state = init2();
|
|
8738
|
-
state.length = 0;
|
|
8739
|
-
try {
|
|
8740
|
-
for await (const chunk of stream) {
|
|
8741
|
-
const chunkType = getChunkType(chunk);
|
|
8742
|
-
const convertedChunk = convertChunk[chunkType](chunk, state);
|
|
8743
|
-
appendChunk({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer });
|
|
8744
|
-
}
|
|
8745
|
-
appendFinalChunk({ state, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer });
|
|
8746
|
-
return finalize(state);
|
|
8747
|
-
} catch (error) {
|
|
8748
|
-
error.bufferedData = finalize(state);
|
|
8749
|
-
throw error;
|
|
8750
|
-
}
|
|
8751
|
-
};
|
|
8752
|
-
var appendFinalChunk = ({ state, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer }) => {
|
|
8753
|
-
const convertedChunk = getFinalChunk(state);
|
|
8754
|
-
if (convertedChunk !== void 0) {
|
|
8755
|
-
appendChunk({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer });
|
|
8756
|
-
}
|
|
8757
|
-
};
|
|
8758
|
-
var appendChunk = ({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer }) => {
|
|
8759
|
-
const chunkSize = getSize(convertedChunk);
|
|
8760
|
-
const newLength = state.length + chunkSize;
|
|
8761
|
-
if (newLength <= maxBuffer) {
|
|
8762
|
-
addNewChunk(convertedChunk, state, addChunk, newLength);
|
|
8763
|
-
return;
|
|
8764
|
-
}
|
|
8765
|
-
const truncatedChunk = truncateChunk(convertedChunk, maxBuffer - state.length);
|
|
8766
|
-
if (truncatedChunk !== void 0) {
|
|
8767
|
-
addNewChunk(truncatedChunk, state, addChunk, maxBuffer);
|
|
8768
|
-
}
|
|
8769
|
-
throw new MaxBufferError();
|
|
8770
|
-
};
|
|
8771
|
-
var addNewChunk = (convertedChunk, state, addChunk, newLength) => {
|
|
8772
|
-
state.contents = addChunk(convertedChunk, state, newLength);
|
|
8773
|
-
state.length = newLength;
|
|
8774
|
-
};
|
|
8775
|
-
var isAsyncIterable = (stream) => typeof stream === "object" && stream !== null && typeof stream[Symbol.asyncIterator] === "function";
|
|
8776
|
-
var getChunkType = (chunk) => {
|
|
8777
|
-
const typeOfChunk = typeof chunk;
|
|
8778
|
-
if (typeOfChunk === "string") {
|
|
8779
|
-
return "string";
|
|
8780
|
-
}
|
|
8781
|
-
if (typeOfChunk !== "object" || chunk === null) {
|
|
8782
|
-
return "others";
|
|
8783
|
-
}
|
|
8784
|
-
if (globalThis.Buffer?.isBuffer(chunk)) {
|
|
8785
|
-
return "buffer";
|
|
8786
|
-
}
|
|
8787
|
-
const prototypeName = objectToString.call(chunk);
|
|
8788
|
-
if (prototypeName === "[object ArrayBuffer]") {
|
|
8789
|
-
return "arrayBuffer";
|
|
8790
|
-
}
|
|
8791
|
-
if (prototypeName === "[object DataView]") {
|
|
8792
|
-
return "dataView";
|
|
8793
|
-
}
|
|
8794
|
-
if (Number.isInteger(chunk.byteLength) && Number.isInteger(chunk.byteOffset) && objectToString.call(chunk.buffer) === "[object ArrayBuffer]") {
|
|
8795
|
-
return "typedArray";
|
|
8796
|
-
}
|
|
8797
|
-
return "others";
|
|
8798
|
-
};
|
|
8799
|
-
var { toString: objectToString } = Object.prototype;
|
|
8800
|
-
var MaxBufferError = class extends Error {
|
|
8801
|
-
name = "MaxBufferError";
|
|
8802
|
-
constructor() {
|
|
8803
|
-
super("maxBuffer exceeded");
|
|
8804
|
-
}
|
|
8805
|
-
};
|
|
8806
|
-
|
|
8807
|
-
// ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/utils.js
|
|
8808
|
-
var identity = (value) => value;
|
|
8809
|
-
var noop = () => void 0;
|
|
8810
|
-
var getContentsProp = ({ contents }) => contents;
|
|
8811
|
-
var throwObjectStream = (chunk) => {
|
|
8812
|
-
throw new Error(`Streams in object mode are not supported: ${String(chunk)}`);
|
|
8813
|
-
};
|
|
8814
|
-
var getLengthProp = (convertedChunk) => convertedChunk.length;
|
|
8815
|
-
|
|
8816
|
-
// ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array-buffer.js
|
|
8817
|
-
async function getStreamAsArrayBuffer(stream, options) {
|
|
8818
|
-
return getStreamContents(stream, arrayBufferMethods, options);
|
|
8819
|
-
}
|
|
8820
|
-
var initArrayBuffer = () => ({ contents: new ArrayBuffer(0) });
|
|
8821
|
-
var useTextEncoder = (chunk) => textEncoder.encode(chunk);
|
|
8822
|
-
var textEncoder = new TextEncoder();
|
|
8823
|
-
var useUint8Array = (chunk) => new Uint8Array(chunk);
|
|
8824
|
-
var useUint8ArrayWithOffset = (chunk) => new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);
|
|
8825
|
-
var truncateArrayBufferChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize);
|
|
8826
|
-
var addArrayBufferChunk = (convertedChunk, { contents, length: previousLength }, length) => {
|
|
8827
|
-
const newContents = hasArrayBufferResize() ? resizeArrayBuffer(contents, length) : resizeArrayBufferSlow(contents, length);
|
|
8828
|
-
new Uint8Array(newContents).set(convertedChunk, previousLength);
|
|
8829
|
-
return newContents;
|
|
8830
|
-
};
|
|
8831
|
-
var resizeArrayBufferSlow = (contents, length) => {
|
|
8832
|
-
if (length <= contents.byteLength) {
|
|
8833
|
-
return contents;
|
|
8834
|
-
}
|
|
8835
|
-
const arrayBuffer = new ArrayBuffer(getNewContentsLength(length));
|
|
8836
|
-
new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);
|
|
8837
|
-
return arrayBuffer;
|
|
8838
|
-
};
|
|
8839
|
-
var resizeArrayBuffer = (contents, length) => {
|
|
8840
|
-
if (length <= contents.maxByteLength) {
|
|
8841
|
-
contents.resize(length);
|
|
8842
|
-
return contents;
|
|
8843
|
-
}
|
|
8844
|
-
const arrayBuffer = new ArrayBuffer(length, { maxByteLength: getNewContentsLength(length) });
|
|
8845
|
-
new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);
|
|
8846
|
-
return arrayBuffer;
|
|
8847
|
-
};
|
|
8848
|
-
var getNewContentsLength = (length) => SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(SCALE_FACTOR));
|
|
8849
|
-
var SCALE_FACTOR = 2;
|
|
8850
|
-
var finalizeArrayBuffer = ({ contents, length }) => hasArrayBufferResize() ? contents : contents.slice(0, length);
|
|
8851
|
-
var hasArrayBufferResize = () => "resize" in ArrayBuffer.prototype;
|
|
8852
|
-
var arrayBufferMethods = {
|
|
8853
|
-
init: initArrayBuffer,
|
|
8854
|
-
convertChunk: {
|
|
8855
|
-
string: useTextEncoder,
|
|
8856
|
-
buffer: useUint8Array,
|
|
8857
|
-
arrayBuffer: useUint8Array,
|
|
8858
|
-
dataView: useUint8ArrayWithOffset,
|
|
8859
|
-
typedArray: useUint8ArrayWithOffset,
|
|
8860
|
-
others: throwObjectStream
|
|
8861
|
-
},
|
|
8862
|
-
getSize: getLengthProp,
|
|
8863
|
-
truncateChunk: truncateArrayBufferChunk,
|
|
8864
|
-
addChunk: addArrayBufferChunk,
|
|
8865
|
-
getFinalChunk: noop,
|
|
8866
|
-
finalize: finalizeArrayBuffer
|
|
8867
|
-
};
|
|
8868
|
-
|
|
8869
|
-
// ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/buffer.js
|
|
8870
|
-
async function getStreamAsBuffer(stream, options) {
|
|
8871
|
-
if (!("Buffer" in globalThis)) {
|
|
8872
|
-
throw new Error("getStreamAsBuffer() is only supported in Node.js");
|
|
8873
|
-
}
|
|
8874
|
-
try {
|
|
8875
|
-
return arrayBufferToNodeBuffer(await getStreamAsArrayBuffer(stream, options));
|
|
8876
|
-
} catch (error) {
|
|
8877
|
-
if (error.bufferedData !== void 0) {
|
|
8878
|
-
error.bufferedData = arrayBufferToNodeBuffer(error.bufferedData);
|
|
8879
|
-
}
|
|
8880
|
-
throw error;
|
|
8881
|
-
}
|
|
8882
|
-
}
|
|
8883
|
-
var arrayBufferToNodeBuffer = (arrayBuffer) => globalThis.Buffer.from(arrayBuffer);
|
|
8884
|
-
|
|
8885
|
-
// ../../node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/string.js
|
|
8886
|
-
async function getStreamAsString(stream, options) {
|
|
8887
|
-
return getStreamContents(stream, stringMethods, options);
|
|
8888
|
-
}
|
|
8889
|
-
var initString = () => ({ contents: "", textDecoder: new TextDecoder() });
|
|
8890
|
-
var useTextDecoder = (chunk, { textDecoder }) => textDecoder.decode(chunk, { stream: true });
|
|
8891
|
-
var addStringChunk = (convertedChunk, { contents }) => contents + convertedChunk;
|
|
8892
|
-
var truncateStringChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize);
|
|
8893
|
-
var getFinalStringChunk = ({ textDecoder }) => {
|
|
8894
|
-
const finalChunk = textDecoder.decode();
|
|
8895
|
-
return finalChunk === "" ? void 0 : finalChunk;
|
|
8896
|
-
};
|
|
8897
|
-
var stringMethods = {
|
|
8898
|
-
init: initString,
|
|
8899
|
-
convertChunk: {
|
|
8900
|
-
string: identity,
|
|
8901
|
-
buffer: useTextDecoder,
|
|
8902
|
-
arrayBuffer: useTextDecoder,
|
|
8903
|
-
dataView: useTextDecoder,
|
|
8904
|
-
typedArray: useTextDecoder,
|
|
8905
|
-
others: throwObjectStream
|
|
8906
|
-
},
|
|
8907
|
-
getSize: getLengthProp,
|
|
8908
|
-
truncateChunk: truncateStringChunk,
|
|
8909
|
-
addChunk: addStringChunk,
|
|
8910
|
-
getFinalChunk: getFinalStringChunk,
|
|
8911
|
-
finalize: getContentsProp
|
|
8912
|
-
};
|
|
8913
|
-
|
|
8914
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stream.js
|
|
8915
|
-
var import_merge_stream = __toESM(require_merge_stream(), 1);
|
|
8916
|
-
var validateInputOptions = (input) => {
|
|
8917
|
-
if (input !== void 0) {
|
|
8918
|
-
throw new TypeError("The `input` and `inputFile` options cannot be both set.");
|
|
8919
|
-
}
|
|
8920
|
-
};
|
|
8921
|
-
var getInputSync = ({ input, inputFile }) => {
|
|
8922
|
-
if (typeof inputFile !== "string") {
|
|
8923
|
-
return input;
|
|
8924
|
-
}
|
|
8925
|
-
validateInputOptions(input);
|
|
8926
|
-
return (0, import_node_fs2.readFileSync)(inputFile);
|
|
8927
|
-
};
|
|
8928
|
-
var handleInputSync = (options) => {
|
|
8929
|
-
const input = getInputSync(options);
|
|
8930
|
-
if (isStream(input)) {
|
|
8931
|
-
throw new TypeError("The `input` option cannot be a stream in sync mode");
|
|
8932
|
-
}
|
|
8933
|
-
return input;
|
|
8934
|
-
};
|
|
8935
|
-
var getInput = ({ input, inputFile }) => {
|
|
8936
|
-
if (typeof inputFile !== "string") {
|
|
8937
|
-
return input;
|
|
8938
|
-
}
|
|
8939
|
-
validateInputOptions(input);
|
|
8940
|
-
return (0, import_node_fs2.createReadStream)(inputFile);
|
|
8941
|
-
};
|
|
8942
|
-
var handleInput = (spawned, options) => {
|
|
8943
|
-
const input = getInput(options);
|
|
8944
|
-
if (input === void 0) {
|
|
8945
|
-
return;
|
|
8946
|
-
}
|
|
8947
|
-
if (isStream(input)) {
|
|
8948
|
-
input.pipe(spawned.stdin);
|
|
8949
|
-
} else {
|
|
8950
|
-
spawned.stdin.end(input);
|
|
8951
|
-
}
|
|
8952
|
-
};
|
|
8953
|
-
var makeAllStream = (spawned, { all }) => {
|
|
8954
|
-
if (!all || !spawned.stdout && !spawned.stderr) {
|
|
8955
|
-
return;
|
|
8956
|
-
}
|
|
8957
|
-
const mixed = (0, import_merge_stream.default)();
|
|
8958
|
-
if (spawned.stdout) {
|
|
8959
|
-
mixed.add(spawned.stdout);
|
|
8960
|
-
}
|
|
8961
|
-
if (spawned.stderr) {
|
|
8962
|
-
mixed.add(spawned.stderr);
|
|
8963
|
-
}
|
|
8964
|
-
return mixed;
|
|
8965
|
-
};
|
|
8966
|
-
var getBufferedData = async (stream, streamPromise) => {
|
|
8967
|
-
if (!stream || streamPromise === void 0) {
|
|
8968
|
-
return;
|
|
8969
|
-
}
|
|
8970
|
-
await (0, import_promises2.setTimeout)(0);
|
|
8971
|
-
stream.destroy();
|
|
8972
|
-
try {
|
|
8973
|
-
return await streamPromise;
|
|
8974
|
-
} catch (error) {
|
|
8975
|
-
return error.bufferedData;
|
|
8976
|
-
}
|
|
8977
|
-
};
|
|
8978
|
-
var getStreamPromise = (stream, { encoding, buffer, maxBuffer }) => {
|
|
8979
|
-
if (!stream || !buffer) {
|
|
8980
|
-
return;
|
|
8981
|
-
}
|
|
8982
|
-
if (encoding === "utf8" || encoding === "utf-8") {
|
|
8983
|
-
return getStreamAsString(stream, { maxBuffer });
|
|
8984
|
-
}
|
|
8985
|
-
if (encoding === null || encoding === "buffer") {
|
|
8986
|
-
return getStreamAsBuffer(stream, { maxBuffer });
|
|
8987
|
-
}
|
|
8988
|
-
return applyEncoding(stream, maxBuffer, encoding);
|
|
8989
|
-
};
|
|
8990
|
-
var applyEncoding = async (stream, maxBuffer, encoding) => {
|
|
8991
|
-
const buffer = await getStreamAsBuffer(stream, { maxBuffer });
|
|
8992
|
-
return buffer.toString(encoding);
|
|
8993
|
-
};
|
|
8994
|
-
var getSpawnedResult = async ({ stdout, stderr, all }, { encoding, buffer, maxBuffer }, processDone) => {
|
|
8995
|
-
const stdoutPromise = getStreamPromise(stdout, { encoding, buffer, maxBuffer });
|
|
8996
|
-
const stderrPromise = getStreamPromise(stderr, { encoding, buffer, maxBuffer });
|
|
8997
|
-
const allPromise = getStreamPromise(all, { encoding, buffer, maxBuffer: maxBuffer * 2 });
|
|
8998
|
-
try {
|
|
8999
|
-
return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]);
|
|
9000
|
-
} catch (error) {
|
|
9001
|
-
return Promise.all([
|
|
9002
|
-
{ error, signal: error.signal, timedOut: error.timedOut },
|
|
9003
|
-
getBufferedData(stdout, stdoutPromise),
|
|
9004
|
-
getBufferedData(stderr, stderrPromise),
|
|
9005
|
-
getBufferedData(all, allPromise)
|
|
9006
|
-
]);
|
|
9007
|
-
}
|
|
9008
|
-
};
|
|
9009
|
-
|
|
9010
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/promise.js
|
|
9011
|
-
var nativePromisePrototype = (async () => {
|
|
9012
|
-
})().constructor.prototype;
|
|
9013
|
-
var descriptors = ["then", "catch", "finally"].map((property11) => [
|
|
9014
|
-
property11,
|
|
9015
|
-
Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property11)
|
|
9016
|
-
]);
|
|
9017
|
-
var mergePromise = (spawned, promise2) => {
|
|
9018
|
-
for (const [property11, descriptor] of descriptors) {
|
|
9019
|
-
const value = typeof promise2 === "function" ? (...args) => Reflect.apply(descriptor.value, promise2(), args) : descriptor.value.bind(promise2);
|
|
9020
|
-
Reflect.defineProperty(spawned, property11, { ...descriptor, value });
|
|
9021
|
-
}
|
|
9022
|
-
};
|
|
9023
|
-
var getSpawnedPromise = (spawned) => new Promise((resolve, reject) => {
|
|
9024
|
-
spawned.on("exit", (exitCode, signal) => {
|
|
9025
|
-
resolve({ exitCode, signal });
|
|
9026
|
-
});
|
|
9027
|
-
spawned.on("error", (error) => {
|
|
9028
|
-
reject(error);
|
|
9029
|
-
});
|
|
9030
|
-
if (spawned.stdin) {
|
|
9031
|
-
spawned.stdin.on("error", (error) => {
|
|
9032
|
-
reject(error);
|
|
9033
|
-
});
|
|
9034
|
-
}
|
|
9035
|
-
});
|
|
9036
|
-
|
|
9037
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/command.js
|
|
9038
|
-
var import_node_buffer = require("node:buffer");
|
|
9039
|
-
var import_node_child_process2 = require("node:child_process");
|
|
9040
|
-
var normalizeArgs = (file4, args = []) => {
|
|
9041
|
-
if (!Array.isArray(args)) {
|
|
9042
|
-
return [file4];
|
|
9043
|
-
}
|
|
9044
|
-
return [file4, ...args];
|
|
9045
|
-
};
|
|
9046
|
-
var NO_ESCAPE_REGEXP = /^[\w.-]+$/;
|
|
9047
|
-
var escapeArg = (arg) => {
|
|
9048
|
-
if (typeof arg !== "string" || NO_ESCAPE_REGEXP.test(arg)) {
|
|
9049
|
-
return arg;
|
|
9050
|
-
}
|
|
9051
|
-
return `"${arg.replaceAll('"', '\\"')}"`;
|
|
9052
|
-
};
|
|
9053
|
-
var joinCommand = (file4, args) => normalizeArgs(file4, args).join(" ");
|
|
9054
|
-
var getEscapedCommand = (file4, args) => normalizeArgs(file4, args).map((arg) => escapeArg(arg)).join(" ");
|
|
9055
|
-
var SPACES_REGEXP = / +/g;
|
|
9056
|
-
var parseCommand = (command) => {
|
|
9057
|
-
const tokens = [];
|
|
9058
|
-
for (const token of command.trim().split(SPACES_REGEXP)) {
|
|
9059
|
-
const previousToken = tokens.at(-1);
|
|
9060
|
-
if (previousToken && previousToken.endsWith("\\")) {
|
|
9061
|
-
tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`;
|
|
9062
|
-
} else {
|
|
9063
|
-
tokens.push(token);
|
|
9064
|
-
}
|
|
9065
|
-
}
|
|
9066
|
-
return tokens;
|
|
9067
|
-
};
|
|
9068
|
-
var parseExpression = (expression) => {
|
|
9069
|
-
const typeOfExpression = typeof expression;
|
|
9070
|
-
if (typeOfExpression === "string") {
|
|
9071
|
-
return expression;
|
|
9072
|
-
}
|
|
9073
|
-
if (typeOfExpression === "number") {
|
|
9074
|
-
return String(expression);
|
|
9075
|
-
}
|
|
9076
|
-
if (typeOfExpression === "object" && expression !== null && !(expression instanceof import_node_child_process2.ChildProcess) && "stdout" in expression) {
|
|
9077
|
-
const typeOfStdout = typeof expression.stdout;
|
|
9078
|
-
if (typeOfStdout === "string") {
|
|
9079
|
-
return expression.stdout;
|
|
9080
|
-
}
|
|
9081
|
-
if (import_node_buffer.Buffer.isBuffer(expression.stdout)) {
|
|
9082
|
-
return expression.stdout.toString();
|
|
9083
|
-
}
|
|
9084
|
-
throw new TypeError(`Unexpected "${typeOfStdout}" stdout in template expression`);
|
|
9085
|
-
}
|
|
9086
|
-
throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`);
|
|
9087
|
-
};
|
|
9088
|
-
var concatTokens = (tokens, nextTokens, isNew) => isNew || tokens.length === 0 || nextTokens.length === 0 ? [...tokens, ...nextTokens] : [
|
|
9089
|
-
...tokens.slice(0, -1),
|
|
9090
|
-
`${tokens.at(-1)}${nextTokens[0]}`,
|
|
9091
|
-
...nextTokens.slice(1)
|
|
9092
|
-
];
|
|
9093
|
-
var parseTemplate = ({ templates, expressions, tokens, index, template }) => {
|
|
9094
|
-
const templateString = template ?? templates.raw[index];
|
|
9095
|
-
const templateTokens = templateString.split(SPACES_REGEXP).filter(Boolean);
|
|
9096
|
-
const newTokens = concatTokens(
|
|
9097
|
-
tokens,
|
|
9098
|
-
templateTokens,
|
|
9099
|
-
templateString.startsWith(" ")
|
|
9100
|
-
);
|
|
9101
|
-
if (index === expressions.length) {
|
|
9102
|
-
return newTokens;
|
|
9103
|
-
}
|
|
9104
|
-
const expression = expressions[index];
|
|
9105
|
-
const expressionTokens = Array.isArray(expression) ? expression.map((expression2) => parseExpression(expression2)) : [parseExpression(expression)];
|
|
9106
|
-
return concatTokens(
|
|
9107
|
-
newTokens,
|
|
9108
|
-
expressionTokens,
|
|
9109
|
-
templateString.endsWith(" ")
|
|
9110
|
-
);
|
|
9111
|
-
};
|
|
9112
|
-
var parseTemplates = (templates, expressions) => {
|
|
9113
|
-
let tokens = [];
|
|
9114
|
-
for (const [index, template] of templates.entries()) {
|
|
9115
|
-
tokens = parseTemplate({ templates, expressions, tokens, index, template });
|
|
9116
|
-
}
|
|
9117
|
-
return tokens;
|
|
9118
|
-
};
|
|
9119
|
-
|
|
9120
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/verbose.js
|
|
9121
|
-
var import_node_util = require("node:util");
|
|
9122
|
-
var import_node_process3 = __toESM(require("node:process"), 1);
|
|
9123
|
-
var verboseDefault = (0, import_node_util.debuglog)("execa").enabled;
|
|
9124
|
-
var padField = (field, padding) => String(field).padStart(padding, "0");
|
|
9125
|
-
var getTimestamp = () => {
|
|
9126
|
-
const date2 = /* @__PURE__ */ new Date();
|
|
9127
|
-
return `${padField(date2.getHours(), 2)}:${padField(date2.getMinutes(), 2)}:${padField(date2.getSeconds(), 2)}.${padField(date2.getMilliseconds(), 3)}`;
|
|
9128
|
-
};
|
|
9129
|
-
var logCommand = (escapedCommand, { verbose }) => {
|
|
9130
|
-
if (!verbose) {
|
|
9131
|
-
return;
|
|
9132
|
-
}
|
|
9133
|
-
import_node_process3.default.stderr.write(`[${getTimestamp()}] ${escapedCommand}
|
|
9134
|
-
`);
|
|
9135
|
-
};
|
|
9136
|
-
|
|
9137
|
-
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js
|
|
9138
|
-
var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100;
|
|
9139
|
-
var getEnv = ({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
|
|
9140
|
-
const env = extendEnv ? { ...import_node_process4.default.env, ...envOption } : envOption;
|
|
9141
|
-
if (preferLocal) {
|
|
9142
|
-
return npmRunPathEnv({ env, cwd: localDir, execPath });
|
|
9143
|
-
}
|
|
9144
|
-
return env;
|
|
9145
|
-
};
|
|
9146
|
-
var handleArguments = (file4, args, options = {}) => {
|
|
9147
|
-
const parsed = import_cross_spawn.default._parse(file4, args, options);
|
|
9148
|
-
file4 = parsed.command;
|
|
9149
|
-
args = parsed.args;
|
|
9150
|
-
options = parsed.options;
|
|
9151
|
-
options = {
|
|
9152
|
-
maxBuffer: DEFAULT_MAX_BUFFER,
|
|
9153
|
-
buffer: true,
|
|
9154
|
-
stripFinalNewline: true,
|
|
9155
|
-
extendEnv: true,
|
|
9156
|
-
preferLocal: false,
|
|
9157
|
-
localDir: options.cwd || import_node_process4.default.cwd(),
|
|
9158
|
-
execPath: import_node_process4.default.execPath,
|
|
9159
|
-
encoding: "utf8",
|
|
9160
|
-
reject: true,
|
|
9161
|
-
cleanup: true,
|
|
9162
|
-
all: false,
|
|
9163
|
-
windowsHide: true,
|
|
9164
|
-
verbose: verboseDefault,
|
|
9165
|
-
...options
|
|
9166
|
-
};
|
|
9167
|
-
options.env = getEnv(options);
|
|
9168
|
-
options.stdio = normalizeStdio(options);
|
|
9169
|
-
if (import_node_process4.default.platform === "win32" && import_node_path2.default.basename(file4, ".exe") === "cmd") {
|
|
9170
|
-
args.unshift("/q");
|
|
9171
|
-
}
|
|
9172
|
-
return { file: file4, args, options, parsed };
|
|
9173
|
-
};
|
|
9174
|
-
var handleOutput = (options, value, error) => {
|
|
9175
|
-
if (typeof value !== "string" && !import_node_buffer2.Buffer.isBuffer(value)) {
|
|
9176
|
-
return error === void 0 ? void 0 : "";
|
|
9177
|
-
}
|
|
9178
|
-
if (options.stripFinalNewline) {
|
|
9179
|
-
return stripFinalNewline(value);
|
|
9180
|
-
}
|
|
9181
|
-
return value;
|
|
9182
|
-
};
|
|
9183
|
-
function execa(file4, args, options) {
|
|
9184
|
-
const parsed = handleArguments(file4, args, options);
|
|
9185
|
-
const command = joinCommand(file4, args);
|
|
9186
|
-
const escapedCommand = getEscapedCommand(file4, args);
|
|
9187
|
-
logCommand(escapedCommand, parsed.options);
|
|
9188
|
-
validateTimeout(parsed.options);
|
|
9189
|
-
let spawned;
|
|
9190
|
-
try {
|
|
9191
|
-
spawned = import_node_child_process3.default.spawn(parsed.file, parsed.args, parsed.options);
|
|
9192
|
-
} catch (error) {
|
|
9193
|
-
const dummySpawned = new import_node_child_process3.default.ChildProcess();
|
|
9194
|
-
const errorPromise = Promise.reject(makeError({
|
|
9195
|
-
error,
|
|
9196
|
-
stdout: "",
|
|
9197
|
-
stderr: "",
|
|
9198
|
-
all: "",
|
|
9199
|
-
command,
|
|
9200
|
-
escapedCommand,
|
|
9201
|
-
parsed,
|
|
9202
|
-
timedOut: false,
|
|
9203
|
-
isCanceled: false,
|
|
9204
|
-
killed: false
|
|
9205
|
-
}));
|
|
9206
|
-
mergePromise(dummySpawned, errorPromise);
|
|
9207
|
-
return dummySpawned;
|
|
9208
|
-
}
|
|
9209
|
-
const spawnedPromise = getSpawnedPromise(spawned);
|
|
9210
|
-
const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);
|
|
9211
|
-
const processDone = setExitHandler(spawned, parsed.options, timedPromise);
|
|
9212
|
-
const context = { isCanceled: false };
|
|
9213
|
-
spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));
|
|
9214
|
-
spawned.cancel = spawnedCancel.bind(null, spawned, context);
|
|
9215
|
-
const handlePromise = async () => {
|
|
9216
|
-
const [{ error, exitCode, signal, timedOut }, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone);
|
|
9217
|
-
const stdout = handleOutput(parsed.options, stdoutResult);
|
|
9218
|
-
const stderr = handleOutput(parsed.options, stderrResult);
|
|
9219
|
-
const all = handleOutput(parsed.options, allResult);
|
|
9220
|
-
if (error || exitCode !== 0 || signal !== null) {
|
|
9221
|
-
const returnedError = makeError({
|
|
9222
|
-
error,
|
|
9223
|
-
exitCode,
|
|
9224
|
-
signal,
|
|
9225
|
-
stdout,
|
|
9226
|
-
stderr,
|
|
9227
|
-
all,
|
|
9228
|
-
command,
|
|
9229
|
-
escapedCommand,
|
|
9230
|
-
parsed,
|
|
9231
|
-
timedOut,
|
|
9232
|
-
isCanceled: context.isCanceled || (parsed.options.signal ? parsed.options.signal.aborted : false),
|
|
9233
|
-
killed: spawned.killed
|
|
9234
|
-
});
|
|
9235
|
-
if (!parsed.options.reject) {
|
|
9236
|
-
return returnedError;
|
|
9237
|
-
}
|
|
9238
|
-
throw returnedError;
|
|
9239
|
-
}
|
|
9240
|
-
return {
|
|
9241
|
-
command,
|
|
9242
|
-
escapedCommand,
|
|
9243
|
-
exitCode: 0,
|
|
9244
|
-
stdout,
|
|
9245
|
-
stderr,
|
|
9246
|
-
all,
|
|
9247
|
-
failed: false,
|
|
9248
|
-
timedOut: false,
|
|
9249
|
-
isCanceled: false,
|
|
9250
|
-
killed: false
|
|
9251
|
-
};
|
|
9252
|
-
};
|
|
9253
|
-
const handlePromiseOnce = onetime_default(handlePromise);
|
|
9254
|
-
handleInput(spawned, parsed.options);
|
|
9255
|
-
spawned.all = makeAllStream(spawned, parsed.options);
|
|
9256
|
-
addPipeMethods(spawned);
|
|
9257
|
-
mergePromise(spawned, handlePromiseOnce);
|
|
9258
|
-
return spawned;
|
|
9259
|
-
}
|
|
9260
|
-
function execaSync(file4, args, options) {
|
|
9261
|
-
const parsed = handleArguments(file4, args, options);
|
|
9262
|
-
const command = joinCommand(file4, args);
|
|
9263
|
-
const escapedCommand = getEscapedCommand(file4, args);
|
|
9264
|
-
logCommand(escapedCommand, parsed.options);
|
|
9265
|
-
const input = handleInputSync(parsed.options);
|
|
9266
|
-
let result;
|
|
9267
|
-
try {
|
|
9268
|
-
result = import_node_child_process3.default.spawnSync(parsed.file, parsed.args, { ...parsed.options, input });
|
|
9269
|
-
} catch (error) {
|
|
9270
|
-
throw makeError({
|
|
9271
|
-
error,
|
|
9272
|
-
stdout: "",
|
|
9273
|
-
stderr: "",
|
|
9274
|
-
all: "",
|
|
9275
|
-
command,
|
|
9276
|
-
escapedCommand,
|
|
9277
|
-
parsed,
|
|
9278
|
-
timedOut: false,
|
|
9279
|
-
isCanceled: false,
|
|
9280
|
-
killed: false
|
|
9281
|
-
});
|
|
9282
|
-
}
|
|
9283
|
-
const stdout = handleOutput(parsed.options, result.stdout, result.error);
|
|
9284
|
-
const stderr = handleOutput(parsed.options, result.stderr, result.error);
|
|
9285
|
-
if (result.error || result.status !== 0 || result.signal !== null) {
|
|
9286
|
-
const error = makeError({
|
|
9287
|
-
stdout,
|
|
9288
|
-
stderr,
|
|
9289
|
-
error: result.error,
|
|
9290
|
-
signal: result.signal,
|
|
9291
|
-
exitCode: result.status,
|
|
9292
|
-
command,
|
|
9293
|
-
escapedCommand,
|
|
9294
|
-
parsed,
|
|
9295
|
-
timedOut: result.error && result.error.code === "ETIMEDOUT",
|
|
9296
|
-
isCanceled: false,
|
|
9297
|
-
killed: result.signal !== null
|
|
9298
|
-
});
|
|
9299
|
-
if (!parsed.options.reject) {
|
|
9300
|
-
return error;
|
|
9301
|
-
}
|
|
9302
|
-
throw error;
|
|
9303
|
-
}
|
|
9304
|
-
return {
|
|
9305
|
-
command,
|
|
9306
|
-
escapedCommand,
|
|
9307
|
-
exitCode: 0,
|
|
9308
|
-
stdout,
|
|
9309
|
-
stderr,
|
|
9310
|
-
failed: false,
|
|
9311
|
-
timedOut: false,
|
|
9312
|
-
isCanceled: false,
|
|
9313
|
-
killed: false
|
|
9314
|
-
};
|
|
9315
|
-
}
|
|
9316
|
-
var normalizeScriptStdin = ({ input, inputFile, stdio }) => input === void 0 && inputFile === void 0 && stdio === void 0 ? { stdin: "inherit" } : {};
|
|
9317
|
-
var normalizeScriptOptions = (options = {}) => ({
|
|
9318
|
-
preferLocal: true,
|
|
9319
|
-
...normalizeScriptStdin(options),
|
|
9320
|
-
...options
|
|
9321
|
-
});
|
|
9322
|
-
function create$(options) {
|
|
9323
|
-
function $3(templatesOrOptions, ...expressions) {
|
|
9324
|
-
if (!Array.isArray(templatesOrOptions)) {
|
|
9325
|
-
return create$({ ...options, ...templatesOrOptions });
|
|
9326
|
-
}
|
|
9327
|
-
const [file4, ...args] = parseTemplates(templatesOrOptions, expressions);
|
|
9328
|
-
return execa(file4, args, normalizeScriptOptions(options));
|
|
9329
|
-
}
|
|
9330
|
-
$3.sync = (templates, ...expressions) => {
|
|
9331
|
-
if (!Array.isArray(templates)) {
|
|
9332
|
-
throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");
|
|
9333
|
-
}
|
|
9334
|
-
const [file4, ...args] = parseTemplates(templates, expressions);
|
|
9335
|
-
return execaSync(file4, args, normalizeScriptOptions(options));
|
|
9336
|
-
};
|
|
9337
|
-
return $3;
|
|
9338
|
-
}
|
|
9339
|
-
var $2 = create$();
|
|
9340
|
-
function execaCommand(command, options) {
|
|
9341
|
-
const [file4, ...args] = parseCommand(command);
|
|
9342
|
-
return execa(file4, args, options);
|
|
9343
|
-
}
|
|
9344
|
-
|
|
9345
|
-
// src/resolvePrismaClient.ts
|
|
9346
|
-
var debug2 = (0, import_debug2.Debug)("prisma:generator");
|
|
6796
|
+
var import_debug = require("@prisma/debug");
|
|
6797
|
+
var import_internals8 = require("@prisma/internals");
|
|
6798
|
+
var debug = (0, import_debug.Debug)("prisma:generator");
|
|
9347
6799
|
async function resolvePrismaClient(baseDir) {
|
|
9348
6800
|
const prismaClientDir = await findPrismaClientDir(baseDir);
|
|
9349
|
-
|
|
6801
|
+
debug("baseDir", baseDir);
|
|
9350
6802
|
if (!prismaClientDir) {
|
|
9351
6803
|
throw new Error(
|
|
9352
6804
|
`Could not resolve @prisma/client.
|
|
@@ -9357,83 +6809,16 @@ Please try to install it with ${bold(
|
|
|
9357
6809
|
}
|
|
9358
6810
|
return prismaClientDir;
|
|
9359
6811
|
}
|
|
9360
|
-
async function resolveOrInstallPrismaClient(baseDir, version2) {
|
|
9361
|
-
let prismaClientDir = await findPrismaClientDir(baseDir);
|
|
9362
|
-
debug2("baseDir", baseDir);
|
|
9363
|
-
if (prismaClientDir) {
|
|
9364
|
-
return prismaClientDir;
|
|
9365
|
-
}
|
|
9366
|
-
let projectRoot = (0, import_internals11.longestCommonPathPrefix)(baseDir, process.cwd());
|
|
9367
|
-
debug2("projectRoot", projectRoot);
|
|
9368
|
-
const warningTag = `${bold("Warning:")} ${dim("[Prisma auto-install on generate]")}`;
|
|
9369
|
-
if (projectRoot === void 0) {
|
|
9370
|
-
console.warn(
|
|
9371
|
-
yellow(
|
|
9372
|
-
`${warningTag} The Prisma schema directory ${bold(baseDir)} and the current working directory ${bold(
|
|
9373
|
-
process.cwd()
|
|
9374
|
-
)} have no common ancestor. The Prisma schema directory will be used as the project root.`
|
|
9375
|
-
)
|
|
9376
|
-
);
|
|
9377
|
-
projectRoot = baseDir;
|
|
9378
|
-
}
|
|
9379
|
-
try {
|
|
9380
|
-
await import_promises3.default.stat(import_node_path3.default.join(projectRoot, "package.json"));
|
|
9381
|
-
} catch (err) {
|
|
9382
|
-
if (err.code === "ENOENT") {
|
|
9383
|
-
console.warn(
|
|
9384
|
-
yellow(
|
|
9385
|
-
`${warningTag} Prisma could not find a ${bold("package.json")} file in the inferred project root ${bold(
|
|
9386
|
-
projectRoot
|
|
9387
|
-
)}. During the next step, when an auto-install of Prisma package(s) will be attempted, it will then be created by your package manager on the appropriate level if necessary.`
|
|
9388
|
-
)
|
|
9389
|
-
);
|
|
9390
|
-
} else {
|
|
9391
|
-
throw err;
|
|
9392
|
-
}
|
|
9393
|
-
}
|
|
9394
|
-
const prismaCliDir = await (0, import_internals11.resolvePkg)("prisma", { basedir: baseDir });
|
|
9395
|
-
if (process.platform === "win32" && await isYarnUsed(baseDir)) {
|
|
9396
|
-
const hasCli = (s) => prismaCliDir !== void 0 ? s : "";
|
|
9397
|
-
const missingCli = (s) => prismaCliDir === void 0 ? s : "";
|
|
9398
|
-
throw new Error(
|
|
9399
|
-
`Could not resolve ${missingCli(`${bold("prisma")} and `)}${bold(
|
|
9400
|
-
"@prisma/client"
|
|
9401
|
-
)} in the current project. Please install ${hasCli("it")}${missingCli("them")} with ${missingCli(
|
|
9402
|
-
`${bold(green(`${await getPackageCmd(baseDir, "add", "prisma", "-D")}`))} and `
|
|
9403
|
-
)}${bold(green(`${await getPackageCmd(baseDir, "add", "@prisma/client")}`))}, and rerun ${bold(
|
|
9404
|
-
await getPackageCmd(baseDir, "execute", "prisma generate")
|
|
9405
|
-
)} \u{1F64F}.`
|
|
9406
|
-
);
|
|
9407
|
-
}
|
|
9408
|
-
if (!prismaCliDir) {
|
|
9409
|
-
await runPackageCmd(projectRoot, "add", `prisma@${version2}`, "-D", "--silent");
|
|
9410
|
-
}
|
|
9411
|
-
await runPackageCmd(projectRoot, "add", `@prisma/client@${version2}`, "--silent");
|
|
9412
|
-
prismaClientDir = await findPrismaClientDir(import_node_path3.default.join(".", baseDir));
|
|
9413
|
-
if (!prismaClientDir) {
|
|
9414
|
-
throw new Error(
|
|
9415
|
-
`Could not resolve @prisma/client despite the installation that we just tried.
|
|
9416
|
-
Please try to install it by hand with ${bold(
|
|
9417
|
-
green(`${await getPackageCmd(baseDir, "add", "@prisma/client")}`)
|
|
9418
|
-
)} and rerun ${bold(await getPackageCmd(baseDir, "execute", "prisma generate"))} \u{1F64F}.`
|
|
9419
|
-
);
|
|
9420
|
-
}
|
|
9421
|
-
console.info(
|
|
9422
|
-
`
|
|
9423
|
-
\u2714 Installed the ${bold(green("@prisma/client"))} and ${bold(green("prisma"))} packages in your project`
|
|
9424
|
-
);
|
|
9425
|
-
return prismaClientDir;
|
|
9426
|
-
}
|
|
9427
6812
|
async function findPrismaClientDir(baseDir) {
|
|
9428
6813
|
const resolveOpts = { basedir: baseDir, preserveSymlinks: true };
|
|
9429
|
-
const cliDir = await (0,
|
|
9430
|
-
const clientDir = await (0,
|
|
9431
|
-
const resolvedClientDir = clientDir && await
|
|
9432
|
-
|
|
9433
|
-
|
|
6814
|
+
const cliDir = await (0, import_internals8.resolvePkg)("prisma", resolveOpts);
|
|
6815
|
+
const clientDir = await (0, import_internals8.resolvePkg)("@prisma/client", resolveOpts);
|
|
6816
|
+
const resolvedClientDir = clientDir && await import_promises2.default.realpath(clientDir);
|
|
6817
|
+
debug("prismaCliDir", cliDir);
|
|
6818
|
+
debug("prismaClientDir", clientDir);
|
|
9434
6819
|
if (cliDir === void 0) return resolvedClientDir;
|
|
9435
6820
|
if (clientDir === void 0) return resolvedClientDir;
|
|
9436
|
-
const relDir =
|
|
6821
|
+
const relDir = import_node_path.default.relative(cliDir, clientDir).split(import_node_path.default.sep);
|
|
9437
6822
|
if (relDir[0] !== ".." || relDir[1] === "..") return void 0;
|
|
9438
6823
|
return resolvedClientDir;
|
|
9439
6824
|
}
|
|
@@ -9441,56 +6826,34 @@ async function getPackageCmd(cwd, cmd, ...args) {
|
|
|
9441
6826
|
const agent = await (0, import_ni.detect)({ cwd, autoInstall: false, programmatic: true });
|
|
9442
6827
|
return (0, import_ni.getCommand)(agent ?? "npm", cmd, args);
|
|
9443
6828
|
}
|
|
9444
|
-
async function isYarnUsed(baseDir) {
|
|
9445
|
-
const agent = await (0, import_ni.detect)({ cwd: baseDir, autoInstall: false, programmatic: true });
|
|
9446
|
-
return agent === "yarn" || agent === "yarn@berry";
|
|
9447
|
-
}
|
|
9448
|
-
async function runPackageCmd(cwd, cmd, ...args) {
|
|
9449
|
-
await execaCommand(await getPackageCmd(cwd, cmd, ...args), {
|
|
9450
|
-
// we skip this because we are already in the generator
|
|
9451
|
-
env: { PRISMA_SKIP_POSTINSTALL_GENERATE: "true" },
|
|
9452
|
-
stdio: "inherit",
|
|
9453
|
-
cwd
|
|
9454
|
-
});
|
|
9455
|
-
}
|
|
9456
6829
|
|
|
9457
6830
|
// src/generator.ts
|
|
9458
|
-
var debug3 = (0, import_debug3.Debug)("prisma:client:generator");
|
|
9459
6831
|
var PrismaClientJsGenerator = class {
|
|
9460
6832
|
name = "prisma-client-js";
|
|
9461
6833
|
#shouldResolvePrismaClient;
|
|
9462
|
-
#shouldInstallMissingPackages;
|
|
9463
6834
|
#runtimePath;
|
|
9464
6835
|
#cachedPrismaClientPath;
|
|
9465
|
-
constructor({
|
|
9466
|
-
shouldResolvePrismaClient = true,
|
|
9467
|
-
shouldInstallMissingPackages = true,
|
|
9468
|
-
runtimePath
|
|
9469
|
-
} = {}) {
|
|
6836
|
+
constructor({ shouldResolvePrismaClient = true, runtimePath } = {}) {
|
|
9470
6837
|
this.#shouldResolvePrismaClient = shouldResolvePrismaClient;
|
|
9471
|
-
this.#shouldInstallMissingPackages = shouldInstallMissingPackages;
|
|
9472
6838
|
this.#runtimePath = runtimePath;
|
|
9473
6839
|
}
|
|
9474
6840
|
async getManifest(config) {
|
|
9475
|
-
const requiresEngines = (0, import_ts_pattern.match)((0, import_internals12.getClientEngineType)(config)).with(import_internals12.ClientEngineType.Library, () => ["libqueryEngine"]).with(import_internals12.ClientEngineType.Binary, () => ["queryEngine"]).with(import_internals12.ClientEngineType.Client, () => []).exhaustive();
|
|
9476
|
-
debug3("requiresEngines", requiresEngines);
|
|
9477
6841
|
const defaultOutput = this.#shouldResolvePrismaClient ? await this.#getPrismaClientPath(config) : ".prisma/client";
|
|
9478
6842
|
return {
|
|
9479
6843
|
defaultOutput,
|
|
9480
6844
|
prettyName: "Prisma Client",
|
|
9481
6845
|
version,
|
|
9482
|
-
requiresEngines,
|
|
6846
|
+
requiresEngines: [],
|
|
9483
6847
|
requiresEngineVersion: import_engines_version.enginesVersion
|
|
9484
6848
|
};
|
|
9485
6849
|
}
|
|
9486
6850
|
async generate(options) {
|
|
9487
|
-
const outputDir = (0,
|
|
6851
|
+
const outputDir = (0, import_internals9.parseEnvValue)(options.generator.output);
|
|
9488
6852
|
await generateClient({
|
|
9489
6853
|
datamodel: options.datamodel,
|
|
9490
6854
|
schemaPath: options.schemaPath,
|
|
9491
6855
|
binaryPaths: options.binaryPaths,
|
|
9492
6856
|
datasources: options.datasources,
|
|
9493
|
-
envPaths: options.envPaths,
|
|
9494
6857
|
outputDir,
|
|
9495
6858
|
copyRuntime: Boolean(options.generator.config.copyRuntime),
|
|
9496
6859
|
copyRuntimeSourceMaps: Boolean(process.env.PRISMA_COPY_RUNTIME_SOURCEMAPS),
|
|
@@ -9500,8 +6863,6 @@ var PrismaClientJsGenerator = class {
|
|
|
9500
6863
|
engineVersion: options.version,
|
|
9501
6864
|
clientVersion: version,
|
|
9502
6865
|
activeProvider: options.datasources[0]?.activeProvider,
|
|
9503
|
-
postinstall: options.postinstall,
|
|
9504
|
-
copyEngine: !options.noEngine,
|
|
9505
6866
|
typedSql: options.typedSql
|
|
9506
6867
|
});
|
|
9507
6868
|
}
|
|
@@ -9509,27 +6870,20 @@ var PrismaClientJsGenerator = class {
|
|
|
9509
6870
|
if (this.#cachedPrismaClientPath) {
|
|
9510
6871
|
return this.#cachedPrismaClientPath;
|
|
9511
6872
|
}
|
|
9512
|
-
this.#cachedPrismaClientPath = await
|
|
6873
|
+
this.#cachedPrismaClientPath = await resolvePrismaClient(import_node_path2.default.dirname(config.sourceFilePath));
|
|
9513
6874
|
return this.#cachedPrismaClientPath;
|
|
9514
6875
|
}
|
|
9515
6876
|
async #getRuntimePath(config) {
|
|
9516
6877
|
if (this.#runtimePath) {
|
|
9517
6878
|
return this.#runtimePath;
|
|
9518
6879
|
}
|
|
9519
|
-
this.#runtimePath =
|
|
6880
|
+
this.#runtimePath = import_node_path2.default.join(await this.#getPrismaClientPath(config), "runtime");
|
|
9520
6881
|
return this.#runtimePath;
|
|
9521
6882
|
}
|
|
9522
|
-
async #resolveOrInstallPrismaClient(baseDir) {
|
|
9523
|
-
if (this.#shouldInstallMissingPackages && !process.env.PRISMA_GENERATE_SKIP_AUTOINSTALL) {
|
|
9524
|
-
return await resolveOrInstallPrismaClient(baseDir, version);
|
|
9525
|
-
} else {
|
|
9526
|
-
return await resolvePrismaClient(baseDir);
|
|
9527
|
-
}
|
|
9528
|
-
}
|
|
9529
6883
|
};
|
|
9530
6884
|
|
|
9531
6885
|
// src/utils/types/dmmfToTypes.ts
|
|
9532
|
-
var
|
|
6886
|
+
var import_node_path3 = __toESM(require("node:path"));
|
|
9533
6887
|
function dmmfToTypes(dmmf) {
|
|
9534
6888
|
return new TSClient({
|
|
9535
6889
|
dmmf,
|
|
@@ -9537,9 +6891,8 @@ function dmmfToTypes(dmmf) {
|
|
|
9537
6891
|
clientVersion: "",
|
|
9538
6892
|
engineVersion: "",
|
|
9539
6893
|
runtimeBase: "@prisma/client",
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
runtimeSourcePath: import_node_path5.default.join(__dirname, "../../../runtime"),
|
|
6894
|
+
runtimeName: "client",
|
|
6895
|
+
runtimeSourcePath: import_node_path3.default.join(__dirname, "../../../runtime"),
|
|
9543
6896
|
schemaPath: "",
|
|
9544
6897
|
outputDir: "",
|
|
9545
6898
|
activeProvider: "",
|
|
@@ -9557,11 +6910,7 @@ function dmmfToTypes(dmmf) {
|
|
|
9557
6910
|
datamodel: "",
|
|
9558
6911
|
browser: false,
|
|
9559
6912
|
edge: false,
|
|
9560
|
-
wasm: false
|
|
9561
|
-
envPaths: {
|
|
9562
|
-
rootEnvPath: null,
|
|
9563
|
-
schemaEnvPath: void 0
|
|
9564
|
-
}
|
|
6913
|
+
wasm: false
|
|
9565
6914
|
}).toTS();
|
|
9566
6915
|
}
|
|
9567
6916
|
// Annotate the CommonJS export names for ESM import in node:
|