@prisma/client-generator-js 6.19.0-integration-next.22 → 6.20.0-dev.1
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/TSClient.d.ts +4 -1
- package/dist/generateClient.d.ts +5 -1
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +584 -293
- package/dist/index.mjs +592 -295
- package/dist/typedSql/buildIndex.d.ts +2 -2
- package/dist/typedSql/typedSql.d.ts +1 -1
- package/dist/utils/buildDebugInitialization.d.ts +1 -1
- package/dist/utils/buildGetQueryEngineWasmModule.d.ts +1 -1
- package/dist/utils/buildInjectableEdgeEnv.d.ts +20 -0
- package/dist/utils/buildNFTAnnotations.d.ts +11 -0
- package/dist/utils/buildNFTAnnotations.test.d.ts +1 -0
- package/dist/utils/buildWarnEnvConflicts.d.ts +10 -0
- package/dist/utils/runtimeImport.d.ts +7 -0
- package/package.json +10 -10
package/dist/index.mjs
CHANGED
|
@@ -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(path9, 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(path9, uid, gid, cb) {
|
|
122
122
|
if (cb) process.nextTick(cb);
|
|
123
123
|
};
|
|
124
124
|
fs3.lchownSync = function() {
|
|
@@ -185,9 +185,9 @@ var require_polyfills = __commonJS({
|
|
|
185
185
|
};
|
|
186
186
|
}(fs3.readSync);
|
|
187
187
|
function patchLchmod(fs4) {
|
|
188
|
-
fs4.lchmod = function(
|
|
188
|
+
fs4.lchmod = function(path9, mode, callback) {
|
|
189
189
|
fs4.open(
|
|
190
|
-
|
|
190
|
+
path9,
|
|
191
191
|
constants3.O_WRONLY | constants3.O_SYMLINK,
|
|
192
192
|
mode,
|
|
193
193
|
function(err, fd) {
|
|
@@ -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(path9, mode) {
|
|
207
|
+
var fd = fs4.openSync(path9, constants3.O_WRONLY | constants3.O_SYMLINK, mode);
|
|
208
208
|
var threw = true;
|
|
209
209
|
var ret;
|
|
210
210
|
try {
|
|
@@ -225,8 +225,8 @@ var require_polyfills = __commonJS({
|
|
|
225
225
|
}
|
|
226
226
|
function patchLutimes(fs4) {
|
|
227
227
|
if (constants3.hasOwnProperty("O_SYMLINK") && fs4.futimes) {
|
|
228
|
-
fs4.lutimes = function(
|
|
229
|
-
fs4.open(
|
|
228
|
+
fs4.lutimes = function(path9, at, mt, cb) {
|
|
229
|
+
fs4.open(path9, constants3.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(path9, at, mt) {
|
|
242
|
+
var fd = fs4.openSync(path9, constants3.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(path9, options) {
|
|
362
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path9, options);
|
|
363
363
|
Stream.call(this);
|
|
364
364
|
var self = this;
|
|
365
|
-
this.path =
|
|
365
|
+
this.path = path9;
|
|
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(path9, options) {
|
|
411
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path9, options);
|
|
412
412
|
Stream.call(this);
|
|
413
|
-
this.path =
|
|
413
|
+
this.path = path9;
|
|
414
414
|
this.fd = null;
|
|
415
415
|
this.writable = true;
|
|
416
416
|
this.flags = "w";
|
|
@@ -494,11 +494,11 @@ var require_graceful_fs = __commonJS({
|
|
|
494
494
|
}
|
|
495
495
|
});
|
|
496
496
|
}
|
|
497
|
-
var
|
|
497
|
+
var debug4 = noop2;
|
|
498
498
|
if (util.debuglog)
|
|
499
|
-
|
|
499
|
+
debug4 = util.debuglog("gfs4");
|
|
500
500
|
else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ""))
|
|
501
|
-
|
|
501
|
+
debug4 = 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
|
+
debug4(fs3[gracefulQueue]);
|
|
537
537
|
__require("assert").equal(fs3[gracefulQueue].length, 0);
|
|
538
538
|
});
|
|
539
539
|
}
|
|
@@ -554,14 +554,14 @@ var require_graceful_fs = __commonJS({
|
|
|
554
554
|
fs4.createWriteStream = createWriteStream2;
|
|
555
555
|
var fs$readFile = fs4.readFile;
|
|
556
556
|
fs4.readFile = readFile;
|
|
557
|
-
function readFile(
|
|
557
|
+
function readFile(path9, 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(path9, options, cb);
|
|
561
|
+
function go$readFile(path10, options2, cb2, startTime) {
|
|
562
|
+
return fs$readFile(path10, options2, function(err) {
|
|
563
563
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
564
|
-
enqueue([go$readFile, [
|
|
564
|
+
enqueue([go$readFile, [path10, 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(path9, 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(path9, data, options, cb);
|
|
578
|
+
function go$writeFile(path10, data2, options2, cb2, startTime) {
|
|
579
|
+
return fs$writeFile(path10, data2, options2, function(err) {
|
|
580
580
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
581
|
-
enqueue([go$writeFile, [
|
|
581
|
+
enqueue([go$writeFile, [path10, 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(path9, 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(path9, data, options, cb);
|
|
596
|
+
function go$appendFile(path10, data2, options2, cb2, startTime) {
|
|
597
|
+
return fs$appendFile(path10, data2, options2, function(err) {
|
|
598
598
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
599
|
-
enqueue([go$appendFile, [
|
|
599
|
+
enqueue([go$appendFile, [path10, 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(path9, 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(path10, options2, cb2, startTime) {
|
|
634
|
+
return fs$readdir(path10, fs$readdirCallback(
|
|
635
|
+
path10,
|
|
636
636
|
options2,
|
|
637
637
|
cb2,
|
|
638
638
|
startTime
|
|
639
639
|
));
|
|
640
|
-
} : function go$readdir2(
|
|
641
|
-
return fs$readdir(
|
|
642
|
-
|
|
640
|
+
} : function go$readdir2(path10, options2, cb2, startTime) {
|
|
641
|
+
return fs$readdir(path10, options2, fs$readdirCallback(
|
|
642
|
+
path10,
|
|
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(path9, options, cb);
|
|
649
|
+
function fs$readdirCallback(path10, 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
|
+
[path10, 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(path9, 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(path9, 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 createReadStream2(
|
|
764
|
-
return new fs4.ReadStream(
|
|
763
|
+
function createReadStream2(path9, options) {
|
|
764
|
+
return new fs4.ReadStream(path9, options);
|
|
765
765
|
}
|
|
766
|
-
function createWriteStream2(
|
|
767
|
-
return new fs4.WriteStream(
|
|
766
|
+
function createWriteStream2(path9, options) {
|
|
767
|
+
return new fs4.WriteStream(path9, options);
|
|
768
768
|
}
|
|
769
769
|
var fs$open = fs4.open;
|
|
770
770
|
fs4.open = open;
|
|
771
|
-
function open(
|
|
771
|
+
function open(path9, 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(path9, flags, mode, cb);
|
|
775
|
+
function go$open(path10, flags2, mode2, cb2, startTime) {
|
|
776
|
+
return fs$open(path10, flags2, mode2, function(err, fd) {
|
|
777
777
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
778
|
-
enqueue([go$open, [
|
|
778
|
+
enqueue([go$open, [path10, 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
|
+
debug4("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
|
+
debug4("RETRY", fn.name, args);
|
|
817
817
|
fn.apply(null, args);
|
|
818
818
|
} else if (Date.now() - startTime >= 6e4) {
|
|
819
|
-
|
|
819
|
+
debug4("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
|
+
debug4("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"(exports, module) {
|
|
960
960
|
"use strict";
|
|
961
|
-
var
|
|
961
|
+
var path9 = __require("path");
|
|
962
962
|
module.exports.checkPath = function checkPath(pth) {
|
|
963
963
|
if (process.platform === "win32") {
|
|
964
|
-
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(
|
|
964
|
+
const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path9.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(path9) {
|
|
1029
|
+
return fs3.access(path9).then(() => true).catch(() => false);
|
|
1030
1030
|
}
|
|
1031
1031
|
module.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(path9, atime, mtime) {
|
|
1045
|
+
const fd = await fs3.open(path9, "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(path9, atime, mtime) {
|
|
1061
|
+
const fd = fs3.openSync(path9, "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"(exports, module) {
|
|
1075
1075
|
"use strict";
|
|
1076
1076
|
var fs3 = require_fs();
|
|
1077
|
-
var
|
|
1077
|
+
var path9 = __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 = path9.basename(src);
|
|
1106
|
+
const destBaseName = path9.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 = path9.basename(src);
|
|
1129
|
+
const destBaseName = path9.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 = path9.resolve(path9.dirname(src));
|
|
1149
|
+
const destParent = path9.resolve(path9.dirname(dest));
|
|
1150
|
+
if (destParent === srcParent || destParent === path9.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 = path9.resolve(path9.dirname(src));
|
|
1165
|
+
const destParent = path9.resolve(path9.dirname(dest));
|
|
1166
|
+
if (destParent === srcParent || destParent === path9.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 = path9.resolve(src).split(path9.sep).filter((i) => i);
|
|
1184
|
+
const destArr = path9.resolve(dest).split(path9.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"(exports, module) {
|
|
1207
1207
|
"use strict";
|
|
1208
1208
|
var fs3 = require_fs();
|
|
1209
|
-
var
|
|
1209
|
+
var path9 = __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 = path9.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 = path9.join(src, item.name);
|
|
1286
|
+
const destItem = path9.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 = path9.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 = path9.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"(exports, module) {
|
|
1336
1336
|
"use strict";
|
|
1337
1337
|
var fs3 = require_graceful_fs();
|
|
1338
|
-
var
|
|
1338
|
+
var path9 = __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 = path9.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 = path9.join(src, item);
|
|
1429
|
+
const destItem = path9.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 = path9.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 = path9.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(path9, callback) {
|
|
1488
|
+
fs3.rm(path9, { recursive: true, force: true }, callback);
|
|
1489
1489
|
}
|
|
1490
|
-
function removeSync(
|
|
1491
|
-
fs3.rmSync(
|
|
1490
|
+
function removeSync(path9) {
|
|
1491
|
+
fs3.rmSync(path9, { recursive: true, force: true });
|
|
1492
1492
|
}
|
|
1493
1493
|
module.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 path9 = __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(path9.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 = path9.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"(exports, module) {
|
|
1542
1542
|
"use strict";
|
|
1543
1543
|
var u = require_universalify().fromPromise;
|
|
1544
|
-
var
|
|
1544
|
+
var path9 = __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 = path9.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 = path9.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"(exports, module) {
|
|
1601
1601
|
"use strict";
|
|
1602
1602
|
var u = require_universalify().fromPromise;
|
|
1603
|
-
var
|
|
1603
|
+
var path9 = __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 = path9.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 = path9.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"(exports, module) {
|
|
1658
1658
|
"use strict";
|
|
1659
|
-
var
|
|
1659
|
+
var path9 = __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 (path9.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 = path9.dirname(dstpath);
|
|
1677
|
+
const relativeToDst = path9.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: path9.relative(dstdir, srcpath)
|
|
1694
1694
|
};
|
|
1695
1695
|
}
|
|
1696
1696
|
function symlinkPathsSync(srcpath, dstpath) {
|
|
1697
|
-
if (
|
|
1697
|
+
if (path9.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 = path9.dirname(dstpath);
|
|
1706
|
+
const relativeToDst = path9.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: path9.relative(dstdir, srcpath)
|
|
1719
1719
|
};
|
|
1720
1720
|
}
|
|
1721
1721
|
module.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"(exports, module) {
|
|
1764
1764
|
"use strict";
|
|
1765
1765
|
var u = require_universalify().fromPromise;
|
|
1766
|
-
var
|
|
1766
|
+
var path9 = __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 = path9.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 = path9.dirname(dstpath);
|
|
1810
1810
|
const exists = fs3.existsSync(dir);
|
|
1811
1811
|
if (exists) return fs3.symlinkSync(srcpath, dstpath, type);
|
|
1812
1812
|
mkdirsSync(dir);
|
|
@@ -1846,9 +1846,9 @@ var require_ensure = __commonJS({
|
|
|
1846
1846
|
}
|
|
1847
1847
|
});
|
|
1848
1848
|
|
|
1849
|
-
// ../../node_modules/.pnpm/jsonfile@6.
|
|
1849
|
+
// ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js
|
|
1850
1850
|
var require_utils2 = __commonJS({
|
|
1851
|
-
"../../node_modules/.pnpm/jsonfile@6.
|
|
1851
|
+
"../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js"(exports, module) {
|
|
1852
1852
|
"use strict";
|
|
1853
1853
|
function stringify9(obj, { EOL = "\n", finalEOL = true, replacer = null, spaces } = {}) {
|
|
1854
1854
|
const EOF = finalEOL ? EOL : "";
|
|
@@ -1863,9 +1863,9 @@ var require_utils2 = __commonJS({
|
|
|
1863
1863
|
}
|
|
1864
1864
|
});
|
|
1865
1865
|
|
|
1866
|
-
// ../../node_modules/.pnpm/jsonfile@6.
|
|
1866
|
+
// ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js
|
|
1867
1867
|
var require_jsonfile = __commonJS({
|
|
1868
|
-
"../../node_modules/.pnpm/jsonfile@6.
|
|
1868
|
+
"../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js"(exports, module) {
|
|
1869
1869
|
"use strict";
|
|
1870
1870
|
var _fs;
|
|
1871
1871
|
try {
|
|
@@ -1927,12 +1927,13 @@ var require_jsonfile = __commonJS({
|
|
|
1927
1927
|
const str = stringify9(obj, options);
|
|
1928
1928
|
return fs3.writeFileSync(file4, str, options);
|
|
1929
1929
|
}
|
|
1930
|
-
|
|
1930
|
+
var jsonfile = {
|
|
1931
1931
|
readFile,
|
|
1932
1932
|
readFileSync: readFileSync2,
|
|
1933
1933
|
writeFile,
|
|
1934
1934
|
writeFileSync
|
|
1935
1935
|
};
|
|
1936
|
+
module.exports = jsonfile;
|
|
1936
1937
|
}
|
|
1937
1938
|
});
|
|
1938
1939
|
|
|
@@ -1957,18 +1958,18 @@ var require_output_file = __commonJS({
|
|
|
1957
1958
|
"use strict";
|
|
1958
1959
|
var u = require_universalify().fromPromise;
|
|
1959
1960
|
var fs3 = require_fs();
|
|
1960
|
-
var
|
|
1961
|
+
var path9 = __require("path");
|
|
1961
1962
|
var mkdir = require_mkdirs();
|
|
1962
1963
|
var pathExists = require_path_exists().pathExists;
|
|
1963
1964
|
async function outputFile(file4, data, encoding = "utf-8") {
|
|
1964
|
-
const dir =
|
|
1965
|
+
const dir = path9.dirname(file4);
|
|
1965
1966
|
if (!await pathExists(dir)) {
|
|
1966
1967
|
await mkdir.mkdirs(dir);
|
|
1967
1968
|
}
|
|
1968
1969
|
return fs3.writeFile(file4, data, encoding);
|
|
1969
1970
|
}
|
|
1970
1971
|
function outputFileSync(file4, ...args) {
|
|
1971
|
-
const dir =
|
|
1972
|
+
const dir = path9.dirname(file4);
|
|
1972
1973
|
if (!fs3.existsSync(dir)) {
|
|
1973
1974
|
mkdir.mkdirsSync(dir);
|
|
1974
1975
|
}
|
|
@@ -2032,7 +2033,7 @@ var require_move = __commonJS({
|
|
|
2032
2033
|
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/move/move.js"(exports, module) {
|
|
2033
2034
|
"use strict";
|
|
2034
2035
|
var fs3 = require_fs();
|
|
2035
|
-
var
|
|
2036
|
+
var path9 = __require("path");
|
|
2036
2037
|
var { copy } = require_copy2();
|
|
2037
2038
|
var { remove } = require_remove();
|
|
2038
2039
|
var { mkdirp } = require_mkdirs();
|
|
@@ -2042,8 +2043,8 @@ var require_move = __commonJS({
|
|
|
2042
2043
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
2043
2044
|
const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
|
|
2044
2045
|
await stat.checkParentPaths(src, srcStat, dest, "move");
|
|
2045
|
-
const destParent =
|
|
2046
|
-
const parsedParentPath =
|
|
2046
|
+
const destParent = path9.dirname(dest);
|
|
2047
|
+
const parsedParentPath = path9.parse(destParent);
|
|
2047
2048
|
if (parsedParentPath.root !== destParent) {
|
|
2048
2049
|
await mkdirp(destParent);
|
|
2049
2050
|
}
|
|
@@ -2084,7 +2085,7 @@ var require_move_sync = __commonJS({
|
|
|
2084
2085
|
"../../node_modules/.pnpm/fs-extra@11.3.0/node_modules/fs-extra/lib/move/move-sync.js"(exports, module) {
|
|
2085
2086
|
"use strict";
|
|
2086
2087
|
var fs3 = require_graceful_fs();
|
|
2087
|
-
var
|
|
2088
|
+
var path9 = __require("path");
|
|
2088
2089
|
var copySync = require_copy2().copySync;
|
|
2089
2090
|
var removeSync = require_remove().removeSync;
|
|
2090
2091
|
var mkdirpSync = require_mkdirs().mkdirpSync;
|
|
@@ -2094,12 +2095,12 @@ var require_move_sync = __commonJS({
|
|
|
2094
2095
|
const overwrite = opts.overwrite || opts.clobber || false;
|
|
2095
2096
|
const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts);
|
|
2096
2097
|
stat.checkParentPathsSync(src, srcStat, dest, "move");
|
|
2097
|
-
if (!isParentRoot(dest)) mkdirpSync(
|
|
2098
|
+
if (!isParentRoot(dest)) mkdirpSync(path9.dirname(dest));
|
|
2098
2099
|
return doRename(src, dest, overwrite, isChangingCase);
|
|
2099
2100
|
}
|
|
2100
2101
|
function isParentRoot(dest) {
|
|
2101
|
-
const parent =
|
|
2102
|
-
const parsedPath =
|
|
2102
|
+
const parent = path9.dirname(dest);
|
|
2103
|
+
const parsedPath = path9.parse(parent);
|
|
2103
2104
|
return parsedPath.root === parent;
|
|
2104
2105
|
}
|
|
2105
2106
|
function doRename(src, dest, overwrite, isChangingCase) {
|
|
@@ -2172,7 +2173,7 @@ var require_windows = __commonJS({
|
|
|
2172
2173
|
module.exports = isexe;
|
|
2173
2174
|
isexe.sync = sync;
|
|
2174
2175
|
var fs3 = __require("fs");
|
|
2175
|
-
function checkPathExt(
|
|
2176
|
+
function checkPathExt(path9, options) {
|
|
2176
2177
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
2177
2178
|
if (!pathext) {
|
|
2178
2179
|
return true;
|
|
@@ -2183,25 +2184,25 @@ var require_windows = __commonJS({
|
|
|
2183
2184
|
}
|
|
2184
2185
|
for (var i = 0; i < pathext.length; i++) {
|
|
2185
2186
|
var p = pathext[i].toLowerCase();
|
|
2186
|
-
if (p &&
|
|
2187
|
+
if (p && path9.substr(-p.length).toLowerCase() === p) {
|
|
2187
2188
|
return true;
|
|
2188
2189
|
}
|
|
2189
2190
|
}
|
|
2190
2191
|
return false;
|
|
2191
2192
|
}
|
|
2192
|
-
function checkStat(stat,
|
|
2193
|
+
function checkStat(stat, path9, options) {
|
|
2193
2194
|
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
2194
2195
|
return false;
|
|
2195
2196
|
}
|
|
2196
|
-
return checkPathExt(
|
|
2197
|
+
return checkPathExt(path9, options);
|
|
2197
2198
|
}
|
|
2198
|
-
function isexe(
|
|
2199
|
-
fs3.stat(
|
|
2200
|
-
cb(er, er ? false : checkStat(stat,
|
|
2199
|
+
function isexe(path9, options, cb) {
|
|
2200
|
+
fs3.stat(path9, function(er, stat) {
|
|
2201
|
+
cb(er, er ? false : checkStat(stat, path9, options));
|
|
2201
2202
|
});
|
|
2202
2203
|
}
|
|
2203
|
-
function sync(
|
|
2204
|
-
return checkStat(fs3.statSync(
|
|
2204
|
+
function sync(path9, options) {
|
|
2205
|
+
return checkStat(fs3.statSync(path9), path9, options);
|
|
2205
2206
|
}
|
|
2206
2207
|
}
|
|
2207
2208
|
});
|
|
@@ -2213,13 +2214,13 @@ var require_mode = __commonJS({
|
|
|
2213
2214
|
module.exports = isexe;
|
|
2214
2215
|
isexe.sync = sync;
|
|
2215
2216
|
var fs3 = __require("fs");
|
|
2216
|
-
function isexe(
|
|
2217
|
-
fs3.stat(
|
|
2217
|
+
function isexe(path9, options, cb) {
|
|
2218
|
+
fs3.stat(path9, function(er, stat) {
|
|
2218
2219
|
cb(er, er ? false : checkStat(stat, options));
|
|
2219
2220
|
});
|
|
2220
2221
|
}
|
|
2221
|
-
function sync(
|
|
2222
|
-
return checkStat(fs3.statSync(
|
|
2222
|
+
function sync(path9, options) {
|
|
2223
|
+
return checkStat(fs3.statSync(path9), options);
|
|
2223
2224
|
}
|
|
2224
2225
|
function checkStat(stat, options) {
|
|
2225
2226
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -2253,7 +2254,7 @@ var require_isexe = __commonJS({
|
|
|
2253
2254
|
}
|
|
2254
2255
|
module.exports = isexe;
|
|
2255
2256
|
isexe.sync = sync;
|
|
2256
|
-
function isexe(
|
|
2257
|
+
function isexe(path9, options, cb) {
|
|
2257
2258
|
if (typeof options === "function") {
|
|
2258
2259
|
cb = options;
|
|
2259
2260
|
options = {};
|
|
@@ -2263,7 +2264,7 @@ var require_isexe = __commonJS({
|
|
|
2263
2264
|
throw new TypeError("callback not provided");
|
|
2264
2265
|
}
|
|
2265
2266
|
return new Promise(function(resolve, reject) {
|
|
2266
|
-
isexe(
|
|
2267
|
+
isexe(path9, options || {}, function(er, is) {
|
|
2267
2268
|
if (er) {
|
|
2268
2269
|
reject(er);
|
|
2269
2270
|
} else {
|
|
@@ -2272,7 +2273,7 @@ var require_isexe = __commonJS({
|
|
|
2272
2273
|
});
|
|
2273
2274
|
});
|
|
2274
2275
|
}
|
|
2275
|
-
core(
|
|
2276
|
+
core(path9, options || {}, function(er, is) {
|
|
2276
2277
|
if (er) {
|
|
2277
2278
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
2278
2279
|
er = null;
|
|
@@ -2282,9 +2283,9 @@ var require_isexe = __commonJS({
|
|
|
2282
2283
|
cb(er, is);
|
|
2283
2284
|
});
|
|
2284
2285
|
}
|
|
2285
|
-
function sync(
|
|
2286
|
+
function sync(path9, options) {
|
|
2286
2287
|
try {
|
|
2287
|
-
return core.sync(
|
|
2288
|
+
return core.sync(path9, options || {});
|
|
2288
2289
|
} catch (er) {
|
|
2289
2290
|
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
2290
2291
|
return false;
|
|
@@ -2301,7 +2302,7 @@ var require_which = __commonJS({
|
|
|
2301
2302
|
"../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js"(exports, module) {
|
|
2302
2303
|
"use strict";
|
|
2303
2304
|
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
2304
|
-
var
|
|
2305
|
+
var path9 = __require("path");
|
|
2305
2306
|
var COLON = isWindows ? ";" : ":";
|
|
2306
2307
|
var isexe = require_isexe();
|
|
2307
2308
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -2339,7 +2340,7 @@ var require_which = __commonJS({
|
|
|
2339
2340
|
return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
|
|
2340
2341
|
const ppRaw = pathEnv[i];
|
|
2341
2342
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
2342
|
-
const pCmd =
|
|
2343
|
+
const pCmd = path9.join(pathPart, cmd);
|
|
2343
2344
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
2344
2345
|
resolve(subStep(p, i, 0));
|
|
2345
2346
|
});
|
|
@@ -2366,7 +2367,7 @@ var require_which = __commonJS({
|
|
|
2366
2367
|
for (let i = 0; i < pathEnv.length; i++) {
|
|
2367
2368
|
const ppRaw = pathEnv[i];
|
|
2368
2369
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
2369
|
-
const pCmd =
|
|
2370
|
+
const pCmd = path9.join(pathPart, cmd);
|
|
2370
2371
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
2371
2372
|
for (let j = 0; j < pathExt.length; j++) {
|
|
2372
2373
|
const cur = p + pathExt[j];
|
|
@@ -2414,7 +2415,7 @@ var require_path_key = __commonJS({
|
|
|
2414
2415
|
var require_resolveCommand = __commonJS({
|
|
2415
2416
|
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module) {
|
|
2416
2417
|
"use strict";
|
|
2417
|
-
var
|
|
2418
|
+
var path9 = __require("path");
|
|
2418
2419
|
var which = require_which();
|
|
2419
2420
|
var getPathKey = require_path_key();
|
|
2420
2421
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -2432,7 +2433,7 @@ var require_resolveCommand = __commonJS({
|
|
|
2432
2433
|
try {
|
|
2433
2434
|
resolved = which.sync(parsed.command, {
|
|
2434
2435
|
path: env[getPathKey({ env })],
|
|
2435
|
-
pathExt: withoutPathExt ?
|
|
2436
|
+
pathExt: withoutPathExt ? path9.delimiter : void 0
|
|
2436
2437
|
});
|
|
2437
2438
|
} catch (e) {
|
|
2438
2439
|
} finally {
|
|
@@ -2441,7 +2442,7 @@ var require_resolveCommand = __commonJS({
|
|
|
2441
2442
|
}
|
|
2442
2443
|
}
|
|
2443
2444
|
if (resolved) {
|
|
2444
|
-
resolved =
|
|
2445
|
+
resolved = path9.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
2445
2446
|
}
|
|
2446
2447
|
return resolved;
|
|
2447
2448
|
}
|
|
@@ -2491,12 +2492,12 @@ var require_shebang_command = __commonJS({
|
|
|
2491
2492
|
"use strict";
|
|
2492
2493
|
var shebangRegex = require_shebang_regex();
|
|
2493
2494
|
module.exports = (string = "") => {
|
|
2494
|
-
const
|
|
2495
|
-
if (!
|
|
2495
|
+
const match2 = string.match(shebangRegex);
|
|
2496
|
+
if (!match2) {
|
|
2496
2497
|
return null;
|
|
2497
2498
|
}
|
|
2498
|
-
const [
|
|
2499
|
-
const binary =
|
|
2499
|
+
const [path9, argument] = match2[0].replace(/#! ?/, "").split(" ");
|
|
2500
|
+
const binary = path9.split("/").pop();
|
|
2500
2501
|
if (binary === "env") {
|
|
2501
2502
|
return argument;
|
|
2502
2503
|
}
|
|
@@ -2531,7 +2532,7 @@ var require_readShebang = __commonJS({
|
|
|
2531
2532
|
var require_parse = __commonJS({
|
|
2532
2533
|
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js"(exports, module) {
|
|
2533
2534
|
"use strict";
|
|
2534
|
-
var
|
|
2535
|
+
var path9 = __require("path");
|
|
2535
2536
|
var resolveCommand = require_resolveCommand();
|
|
2536
2537
|
var escape = require_escape();
|
|
2537
2538
|
var readShebang = require_readShebang();
|
|
@@ -2556,7 +2557,7 @@ var require_parse = __commonJS({
|
|
|
2556
2557
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
2557
2558
|
if (parsed.options.forceShell || needsShell) {
|
|
2558
2559
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
2559
|
-
parsed.command =
|
|
2560
|
+
parsed.command = path9.normalize(parsed.command);
|
|
2560
2561
|
parsed.command = escape.command(parsed.command);
|
|
2561
2562
|
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
2562
2563
|
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
@@ -2753,7 +2754,15 @@ function getMappings(mappings, datamodel) {
|
|
|
2753
2754
|
|
|
2754
2755
|
// src/generateClient.ts
|
|
2755
2756
|
var import_fs_extra = __toESM(require_lib());
|
|
2756
|
-
import {
|
|
2757
|
+
import { Debug } from "@prisma/debug";
|
|
2758
|
+
import { overwriteFile } from "@prisma/fetch-engine";
|
|
2759
|
+
import {
|
|
2760
|
+
assertNever as assertNever3,
|
|
2761
|
+
ClientEngineType as ClientEngineType3,
|
|
2762
|
+
getClientEngineType as getClientEngineType2,
|
|
2763
|
+
pathToPosix as pathToPosix4,
|
|
2764
|
+
setClassName
|
|
2765
|
+
} from "@prisma/internals";
|
|
2757
2766
|
import { createHash } from "crypto";
|
|
2758
2767
|
import paths from "env-paths";
|
|
2759
2768
|
import { existsSync } from "fs";
|
|
@@ -2809,7 +2818,7 @@ var bgWhite = init(47, 49);
|
|
|
2809
2818
|
|
|
2810
2819
|
// src/generateClient.ts
|
|
2811
2820
|
import { packageUp } from "package-up";
|
|
2812
|
-
import
|
|
2821
|
+
import path3 from "path";
|
|
2813
2822
|
|
|
2814
2823
|
// ../client/package.json
|
|
2815
2824
|
var package_default = {
|
|
@@ -2841,7 +2850,8 @@ var package_default = {
|
|
|
2841
2850
|
"MSSQL",
|
|
2842
2851
|
"SQL Server",
|
|
2843
2852
|
"SQLServer",
|
|
2844
|
-
"MongoDB"
|
|
2853
|
+
"MongoDB",
|
|
2854
|
+
"react-native"
|
|
2845
2855
|
],
|
|
2846
2856
|
main: "default.js",
|
|
2847
2857
|
types: "default.d.ts",
|
|
@@ -2867,6 +2877,18 @@ var package_default = {
|
|
|
2867
2877
|
},
|
|
2868
2878
|
default: "./default.js"
|
|
2869
2879
|
},
|
|
2880
|
+
"./edge": {
|
|
2881
|
+
types: "./edge.d.ts",
|
|
2882
|
+
require: "./edge.js",
|
|
2883
|
+
import: "./edge.js",
|
|
2884
|
+
default: "./edge.js"
|
|
2885
|
+
},
|
|
2886
|
+
"./react-native": {
|
|
2887
|
+
types: "./react-native.d.ts",
|
|
2888
|
+
require: "./react-native.js",
|
|
2889
|
+
import: "./react-native.js",
|
|
2890
|
+
default: "./react-native.js"
|
|
2891
|
+
},
|
|
2870
2892
|
"./extension": {
|
|
2871
2893
|
types: "./extension.d.ts",
|
|
2872
2894
|
require: "./extension.js",
|
|
@@ -2901,12 +2923,42 @@ var package_default = {
|
|
|
2901
2923
|
import: "./runtime/client.mjs",
|
|
2902
2924
|
default: "./runtime/client.mjs"
|
|
2903
2925
|
},
|
|
2926
|
+
"./runtime/library": {
|
|
2927
|
+
types: "./runtime/library.d.ts",
|
|
2928
|
+
require: "./runtime/library.js",
|
|
2929
|
+
import: "./runtime/library.mjs",
|
|
2930
|
+
default: "./runtime/library.mjs"
|
|
2931
|
+
},
|
|
2932
|
+
"./runtime/binary": {
|
|
2933
|
+
types: "./runtime/binary.d.ts",
|
|
2934
|
+
require: "./runtime/binary.js",
|
|
2935
|
+
import: "./runtime/binary.mjs",
|
|
2936
|
+
default: "./runtime/binary.mjs"
|
|
2937
|
+
},
|
|
2938
|
+
"./runtime/wasm-engine-edge": {
|
|
2939
|
+
types: "./runtime/wasm-engine-edge.d.ts",
|
|
2940
|
+
require: "./runtime/wasm-engine-edge.js",
|
|
2941
|
+
import: "./runtime/wasm-engine-edge.mjs",
|
|
2942
|
+
default: "./runtime/wasm-engine-edge.mjs"
|
|
2943
|
+
},
|
|
2904
2944
|
"./runtime/wasm-compiler-edge": {
|
|
2905
2945
|
types: "./runtime/wasm-compiler-edge.d.ts",
|
|
2906
2946
|
require: "./runtime/wasm-compiler-edge.js",
|
|
2907
2947
|
import: "./runtime/wasm-compiler-edge.mjs",
|
|
2908
2948
|
default: "./runtime/wasm-compiler-edge.mjs"
|
|
2909
2949
|
},
|
|
2950
|
+
"./runtime/edge": {
|
|
2951
|
+
types: "./runtime/edge.d.ts",
|
|
2952
|
+
require: "./runtime/edge.js",
|
|
2953
|
+
import: "./runtime/edge-esm.js",
|
|
2954
|
+
default: "./runtime/edge-esm.js"
|
|
2955
|
+
},
|
|
2956
|
+
"./runtime/react-native": {
|
|
2957
|
+
types: "./runtime/react-native.d.ts",
|
|
2958
|
+
require: "./runtime/react-native.js",
|
|
2959
|
+
import: "./runtime/react-native.js",
|
|
2960
|
+
default: "./runtime/react-native.js"
|
|
2961
|
+
},
|
|
2910
2962
|
"./runtime/index-browser": {
|
|
2911
2963
|
types: "./runtime/index-browser.d.ts",
|
|
2912
2964
|
require: "./runtime/index-browser.js",
|
|
@@ -2935,7 +2987,7 @@ var package_default = {
|
|
|
2935
2987
|
},
|
|
2936
2988
|
license: "Apache-2.0",
|
|
2937
2989
|
engines: {
|
|
2938
|
-
node: "
|
|
2990
|
+
node: ">=18.18"
|
|
2939
2991
|
},
|
|
2940
2992
|
homepage: "https://www.prisma.io",
|
|
2941
2993
|
repository: {
|
|
@@ -2951,7 +3003,7 @@ var package_default = {
|
|
|
2951
3003
|
test: "dotenv -e ../../.db.env -- jest --silent",
|
|
2952
3004
|
"test:e2e": "dotenv -e ../../.db.env -- tsx tests/e2e/_utils/run.ts",
|
|
2953
3005
|
"test:functional": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts",
|
|
2954
|
-
"test:functional:client": "pnpm run test:functional --client-runtime client",
|
|
3006
|
+
"test:functional:client": "pnpm run test:functional --client-runtime client --engine-type client",
|
|
2955
3007
|
"test:memory": "dotenv -e ../../.db.env -- tsx helpers/memory-tests.ts",
|
|
2956
3008
|
"test:functional:code": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts --no-types",
|
|
2957
3009
|
"test:functional:types": "dotenv -e ../../.db.env -- tsx helpers/functional-test/run-tests.ts --types-only",
|
|
@@ -2966,10 +3018,14 @@ var package_default = {
|
|
|
2966
3018
|
"runtime",
|
|
2967
3019
|
"scripts",
|
|
2968
3020
|
"generator-build",
|
|
3021
|
+
"edge.js",
|
|
3022
|
+
"edge.d.ts",
|
|
2969
3023
|
"wasm.js",
|
|
2970
3024
|
"wasm.d.ts",
|
|
2971
3025
|
"index.js",
|
|
2972
3026
|
"index.d.ts",
|
|
3027
|
+
"react-native.js",
|
|
3028
|
+
"react-native.d.ts",
|
|
2973
3029
|
"default.js",
|
|
2974
3030
|
"default.d.ts",
|
|
2975
3031
|
"index-browser.js",
|
|
@@ -2980,7 +3036,7 @@ var package_default = {
|
|
|
2980
3036
|
"sql.mjs"
|
|
2981
3037
|
],
|
|
2982
3038
|
devDependencies: {
|
|
2983
|
-
"@cloudflare/workers-types": "^4.
|
|
3039
|
+
"@cloudflare/workers-types": "^4.20250408.0",
|
|
2984
3040
|
"@codspeed/benchmark.js-plugin": "4.0.0",
|
|
2985
3041
|
"@faker-js/faker": "9.6.0",
|
|
2986
3042
|
"@fast-check/jest": "2.0.3",
|
|
@@ -3015,7 +3071,7 @@ var package_default = {
|
|
|
3015
3071
|
"@prisma/dmmf": "workspace:*",
|
|
3016
3072
|
"@prisma/driver-adapter-utils": "workspace:*",
|
|
3017
3073
|
"@prisma/engines": "workspace:*",
|
|
3018
|
-
"@prisma/engines-version": "6.19.0-
|
|
3074
|
+
"@prisma/engines-version": "6.19.0-26.2ba551f319ab1df4bc874a89965d8b3641056773",
|
|
3019
3075
|
"@prisma/fetch-engine": "workspace:*",
|
|
3020
3076
|
"@prisma/generator": "workspace:*",
|
|
3021
3077
|
"@prisma/generator-helper": "workspace:*",
|
|
@@ -3023,8 +3079,9 @@ var package_default = {
|
|
|
3023
3079
|
"@prisma/instrumentation": "workspace:*",
|
|
3024
3080
|
"@prisma/internals": "workspace:*",
|
|
3025
3081
|
"@prisma/migrate": "workspace:*",
|
|
3026
|
-
"@prisma/
|
|
3027
|
-
"@prisma/query-
|
|
3082
|
+
"@prisma/mini-proxy": "0.9.5",
|
|
3083
|
+
"@prisma/query-compiler-wasm": "6.19.0-26.2ba551f319ab1df4bc874a89965d8b3641056773",
|
|
3084
|
+
"@prisma/query-engine-wasm": "6.19.0-26.2ba551f319ab1df4bc874a89965d8b3641056773",
|
|
3028
3085
|
"@prisma/query-plan-executor": "workspace:*",
|
|
3029
3086
|
"@prisma/ts-builders": "workspace:*",
|
|
3030
3087
|
"@snaplet/copycat": "6.0.0",
|
|
@@ -3037,11 +3094,12 @@ var package_default = {
|
|
|
3037
3094
|
"@types/jest": "29.5.14",
|
|
3038
3095
|
"@types/js-levenshtein": "1.1.3",
|
|
3039
3096
|
"@types/mssql": "9.1.8",
|
|
3040
|
-
"@types/node": "
|
|
3097
|
+
"@types/node": "18.19.76",
|
|
3041
3098
|
"@types/pg": "8.11.11",
|
|
3042
3099
|
arg: "5.0.2",
|
|
3043
3100
|
benchmark: "2.1.4",
|
|
3044
3101
|
"cookie-es": "2.0.0",
|
|
3102
|
+
"decimal.js": "10.5.0",
|
|
3045
3103
|
execa: "8.0.1",
|
|
3046
3104
|
"expect-type": "1.2.2",
|
|
3047
3105
|
"fs-extra": "11.3.0",
|
|
@@ -3066,6 +3124,7 @@ var package_default = {
|
|
|
3066
3124
|
"simple-statistics": "7.8.8",
|
|
3067
3125
|
"sort-keys": "5.1.0",
|
|
3068
3126
|
"source-map-support": "0.5.21",
|
|
3127
|
+
"sql-template-tag": "5.2.1",
|
|
3069
3128
|
"stacktrace-parser": "0.1.11",
|
|
3070
3129
|
"strip-ansi": "7.1.0",
|
|
3071
3130
|
"strip-indent": "4.0.0",
|
|
@@ -3076,12 +3135,9 @@ var package_default = {
|
|
|
3076
3135
|
undici: "7.4.0",
|
|
3077
3136
|
zx: "8.4.1"
|
|
3078
3137
|
},
|
|
3079
|
-
dependencies: {
|
|
3080
|
-
"@prisma/client-runtime-utils": "workspace:*"
|
|
3081
|
-
},
|
|
3082
3138
|
peerDependencies: {
|
|
3083
3139
|
prisma: "*",
|
|
3084
|
-
typescript: ">=5.
|
|
3140
|
+
typescript: ">=5.1.0"
|
|
3085
3141
|
},
|
|
3086
3142
|
peerDependenciesMeta: {
|
|
3087
3143
|
prisma: {
|
|
@@ -3126,7 +3182,7 @@ var Enum = class {
|
|
|
3126
3182
|
toJS() {
|
|
3127
3183
|
const { type } = this;
|
|
3128
3184
|
const enumVariants = `{
|
|
3129
|
-
${indent(type.
|
|
3185
|
+
${indent(type.values.map((v) => `${v}: ${this.getValueJS(v)}`).join(",\n"), TAB_SIZE)}
|
|
3130
3186
|
}`;
|
|
3131
3187
|
const enumBody = this.isStrictEnum() ? `makeStrictEnum(${enumVariants})` : enumVariants;
|
|
3132
3188
|
return this.useNamespace ? `exports.Prisma.${type.name} = ${enumBody};` : `exports.${type.name} = exports.$Enums.${type.name} = ${enumBody};`;
|
|
@@ -3137,7 +3193,7 @@ ${indent(type.data.map((v) => `${v.key}: ${this.getValueJS(v.value)}`).join(",\n
|
|
|
3137
3193
|
toTS() {
|
|
3138
3194
|
const { type } = this;
|
|
3139
3195
|
return `export const ${type.name}: {
|
|
3140
|
-
${indent(type.
|
|
3196
|
+
${indent(type.values.map((v) => `${v}: ${this.getValueTS(v)}`).join(",\n"), TAB_SIZE)}
|
|
3141
3197
|
};
|
|
3142
3198
|
|
|
3143
3199
|
export type ${type.name} = (typeof ${type.name})[keyof typeof ${type.name}]
|
|
@@ -4863,12 +4919,13 @@ function fluentWrapperName(modelName) {
|
|
|
4863
4919
|
}
|
|
4864
4920
|
|
|
4865
4921
|
// src/TSClient/TSClient.ts
|
|
4866
|
-
import { datamodelEnumToSchemaEnum
|
|
4867
|
-
import { pathToPosix as
|
|
4922
|
+
import { datamodelEnumToSchemaEnum } from "@prisma/dmmf";
|
|
4923
|
+
import { ClientEngineType as ClientEngineType2, getClientEngineType, pathToPosix as pathToPosix3 } from "@prisma/internals";
|
|
4868
4924
|
import * as ts12 from "@prisma/ts-builders";
|
|
4869
4925
|
import ciInfo from "ci-info";
|
|
4926
|
+
import crypto from "crypto";
|
|
4870
4927
|
import indent8 from "indent-string";
|
|
4871
|
-
import
|
|
4928
|
+
import path2 from "path";
|
|
4872
4929
|
|
|
4873
4930
|
// src/dmmf.ts
|
|
4874
4931
|
import { keyBy } from "@prisma/client-common";
|
|
@@ -5063,12 +5120,44 @@ var GenericArgsInfo = class {
|
|
|
5063
5120
|
}
|
|
5064
5121
|
};
|
|
5065
5122
|
|
|
5123
|
+
// src/utils/buildInjectableEdgeEnv.ts
|
|
5124
|
+
function buildInjectableEdgeEnv(edge, datasources) {
|
|
5125
|
+
if (edge === true) {
|
|
5126
|
+
return declareInjectableEdgeEnv(datasources);
|
|
5127
|
+
}
|
|
5128
|
+
return ``;
|
|
5129
|
+
}
|
|
5130
|
+
function declareInjectableEdgeEnv(datasources) {
|
|
5131
|
+
const injectableEdgeEnv = { parsed: {} };
|
|
5132
|
+
const envVarNames = getSelectedEnvVarNames(datasources);
|
|
5133
|
+
for (const envVarName of envVarNames) {
|
|
5134
|
+
injectableEdgeEnv.parsed[envVarName] = getRuntimeEdgeEnvVar(envVarName);
|
|
5135
|
+
}
|
|
5136
|
+
const injectableEdgeEnvJson = JSON.stringify(injectableEdgeEnv, null, 2);
|
|
5137
|
+
const injectableEdgeEnvCode = injectableEdgeEnvJson.replace(/"/g, "");
|
|
5138
|
+
return `
|
|
5139
|
+
config.injectableEdgeEnv = () => (${injectableEdgeEnvCode})`;
|
|
5140
|
+
}
|
|
5141
|
+
function getSelectedEnvVarNames(datasources) {
|
|
5142
|
+
return datasources.reduce((acc, datasource) => {
|
|
5143
|
+
if (datasource.url.fromEnvVar) {
|
|
5144
|
+
return [...acc, datasource.url.fromEnvVar];
|
|
5145
|
+
}
|
|
5146
|
+
return acc;
|
|
5147
|
+
}, []);
|
|
5148
|
+
}
|
|
5149
|
+
function getRuntimeEdgeEnvVar(envVarName) {
|
|
5150
|
+
const cfwEnv = `typeof globalThis !== 'undefined' && globalThis['${envVarName}']`;
|
|
5151
|
+
const nodeOrVercelEnv = `typeof process !== 'undefined' && process.env && process.env.${envVarName}`;
|
|
5152
|
+
return `${cfwEnv} || ${nodeOrVercelEnv} || undefined`;
|
|
5153
|
+
}
|
|
5154
|
+
|
|
5066
5155
|
// src/utils/buildDebugInitialization.ts
|
|
5067
5156
|
function buildDebugInitialization(edge) {
|
|
5068
5157
|
if (!edge) {
|
|
5069
5158
|
return "";
|
|
5070
5159
|
}
|
|
5071
|
-
const debugVar =
|
|
5160
|
+
const debugVar = getRuntimeEdgeEnvVar("DEBUG");
|
|
5072
5161
|
return `if (${debugVar}) {
|
|
5073
5162
|
Debug.enable(${debugVar})
|
|
5074
5163
|
}
|
|
@@ -5114,7 +5203,7 @@ import {
|
|
|
5114
5203
|
function buildRuntimeDataModel(datamodel, runtimeNameJs) {
|
|
5115
5204
|
const runtimeDataModel = dmmfToRuntimeDataModel(datamodel);
|
|
5116
5205
|
let prunedDataModel;
|
|
5117
|
-
if (runtimeNameJs === "wasm-compiler-edge" || runtimeNameJs === "client") {
|
|
5206
|
+
if (runtimeNameJs === "wasm-engine-edge" || runtimeNameJs === "wasm-compiler-edge" || runtimeNameJs === "client") {
|
|
5118
5207
|
prunedDataModel = pruneRuntimeDataModel(runtimeDataModel);
|
|
5119
5208
|
} else {
|
|
5120
5209
|
prunedDataModel = runtimeDataModel;
|
|
@@ -5152,8 +5241,8 @@ function buildQueryCompilerWasmModule(forceEdgeWasmLoader, runtimeNameJs) {
|
|
|
5152
5241
|
}
|
|
5153
5242
|
|
|
5154
5243
|
// src/utils/buildGetQueryEngineWasmModule.ts
|
|
5155
|
-
function buildQueryEngineWasmModule(runtimeNameJs) {
|
|
5156
|
-
if (runtimeNameJs === "library" && process.env.PRISMA_CLIENT_FORCE_WASM) {
|
|
5244
|
+
function buildQueryEngineWasmModule(wasm, copyEngine, runtimeNameJs) {
|
|
5245
|
+
if (copyEngine && runtimeNameJs === "library" && process.env.PRISMA_CLIENT_FORCE_WASM) {
|
|
5157
5246
|
return `config.engineWasm = {
|
|
5158
5247
|
getRuntime: async () => require('./query_engine_bg.js'),
|
|
5159
5248
|
getQueryEngineWasmModule: async () => {
|
|
@@ -5164,6 +5253,16 @@ function buildQueryEngineWasmModule(runtimeNameJs) {
|
|
|
5164
5253
|
}
|
|
5165
5254
|
}`;
|
|
5166
5255
|
}
|
|
5256
|
+
if (copyEngine && wasm === true && runtimeNameJs === "wasm-engine-edge") {
|
|
5257
|
+
return `config.engineWasm = {
|
|
5258
|
+
getRuntime: async () => require('./query_engine_bg.js'),
|
|
5259
|
+
getQueryEngineWasmModule: async () => {
|
|
5260
|
+
const loader = (await import('#wasm-engine-loader')).default
|
|
5261
|
+
const engine = (await loader).default
|
|
5262
|
+
return engine
|
|
5263
|
+
}
|
|
5264
|
+
}`;
|
|
5265
|
+
}
|
|
5167
5266
|
return `config.engineWasm = undefined`;
|
|
5168
5267
|
}
|
|
5169
5268
|
|
|
@@ -5181,6 +5280,50 @@ function buildInlineDatasource(ds) {
|
|
|
5181
5280
|
}
|
|
5182
5281
|
}
|
|
5183
5282
|
|
|
5283
|
+
// src/utils/buildNFTAnnotations.ts
|
|
5284
|
+
import { getNodeAPIName } from "@prisma/get-platform";
|
|
5285
|
+
import { ClientEngineType, parseAWSNodejsRuntimeEnvVarVersion, pathToPosix as pathToPosix2 } from "@prisma/internals";
|
|
5286
|
+
import path from "path";
|
|
5287
|
+
function buildNFTAnnotations(noEngine, engineType, binaryTargets, relativeOutdir) {
|
|
5288
|
+
if (noEngine === true) return "";
|
|
5289
|
+
if (binaryTargets === void 0) {
|
|
5290
|
+
return "";
|
|
5291
|
+
}
|
|
5292
|
+
if (process.env.NETLIFY) {
|
|
5293
|
+
const isNodeMajor20OrUp = parseInt(process.versions.node.split(".")[0]) >= 20;
|
|
5294
|
+
const awsRuntimeVersion = parseAWSNodejsRuntimeEnvVarVersion();
|
|
5295
|
+
const isRuntimeEnvVar20OrUp = awsRuntimeVersion && awsRuntimeVersion >= 20;
|
|
5296
|
+
const isRuntimeEnvVar18OrDown = awsRuntimeVersion && awsRuntimeVersion <= 18;
|
|
5297
|
+
if ((isNodeMajor20OrUp || isRuntimeEnvVar20OrUp) && !isRuntimeEnvVar18OrDown) {
|
|
5298
|
+
binaryTargets = ["rhel-openssl-3.0.x"];
|
|
5299
|
+
} else {
|
|
5300
|
+
binaryTargets = ["rhel-openssl-1.0.x"];
|
|
5301
|
+
}
|
|
5302
|
+
}
|
|
5303
|
+
const engineAnnotations = binaryTargets.map((binaryTarget) => {
|
|
5304
|
+
const engineFilename = getQueryEngineFilename(engineType, binaryTarget);
|
|
5305
|
+
return engineFilename ? buildNFTAnnotation(engineFilename, relativeOutdir) : "";
|
|
5306
|
+
}).join("\n");
|
|
5307
|
+
const schemaAnnotations = buildNFTAnnotation("schema.prisma", relativeOutdir);
|
|
5308
|
+
return `${engineAnnotations}${schemaAnnotations}`;
|
|
5309
|
+
}
|
|
5310
|
+
function getQueryEngineFilename(engineType, binaryTarget) {
|
|
5311
|
+
if (engineType === ClientEngineType.Library) {
|
|
5312
|
+
return getNodeAPIName(binaryTarget, "fs");
|
|
5313
|
+
}
|
|
5314
|
+
if (engineType === ClientEngineType.Binary) {
|
|
5315
|
+
return `query-engine-${binaryTarget}`;
|
|
5316
|
+
}
|
|
5317
|
+
return void 0;
|
|
5318
|
+
}
|
|
5319
|
+
function buildNFTAnnotation(fileName, relativeOutdir) {
|
|
5320
|
+
const relativeFilePath = path.join(relativeOutdir, fileName);
|
|
5321
|
+
return `
|
|
5322
|
+
// file annotations for bundling tools to include these files
|
|
5323
|
+
path.join(__dirname, ${JSON.stringify(pathToPosix2(fileName))});
|
|
5324
|
+
path.join(process.cwd(), ${JSON.stringify(pathToPosix2(relativeFilePath))})`;
|
|
5325
|
+
}
|
|
5326
|
+
|
|
5184
5327
|
// src/utils/buildRequirePath.ts
|
|
5185
5328
|
function buildRequirePath(edge) {
|
|
5186
5329
|
if (edge === true) return "";
|
|
@@ -5188,6 +5331,18 @@ function buildRequirePath(edge) {
|
|
|
5188
5331
|
const path = require('path')`;
|
|
5189
5332
|
}
|
|
5190
5333
|
|
|
5334
|
+
// src/utils/buildWarnEnvConflicts.ts
|
|
5335
|
+
function buildWarnEnvConflicts(edge, runtimeBase, runtimeNameJs) {
|
|
5336
|
+
if (edge === true) return "";
|
|
5337
|
+
return `
|
|
5338
|
+
const { warnEnvConflicts } = require('${runtimeBase}/${runtimeNameJs}.js')
|
|
5339
|
+
|
|
5340
|
+
warnEnvConflicts({
|
|
5341
|
+
rootEnvPath: config.relativeEnvPaths.rootEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.rootEnvPath),
|
|
5342
|
+
schemaEnvPath: config.relativeEnvPaths.schemaEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.schemaEnvPath)
|
|
5343
|
+
})`;
|
|
5344
|
+
}
|
|
5345
|
+
|
|
5191
5346
|
// src/TSClient/common.ts
|
|
5192
5347
|
import indent4 from "indent-string";
|
|
5193
5348
|
var commonCodeJS = ({
|
|
@@ -5202,10 +5357,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5202
5357
|
${browser ? `
|
|
5203
5358
|
const {
|
|
5204
5359
|
Decimal,
|
|
5205
|
-
|
|
5206
|
-
JsonNull,
|
|
5207
|
-
AnyNull,
|
|
5208
|
-
NullTypes,
|
|
5360
|
+
objectEnumValues,
|
|
5209
5361
|
makeStrictEnum,
|
|
5210
5362
|
Public,
|
|
5211
5363
|
getRuntime,
|
|
@@ -5226,10 +5378,7 @@ const {
|
|
|
5226
5378
|
skip,
|
|
5227
5379
|
Decimal,
|
|
5228
5380
|
Debug,
|
|
5229
|
-
|
|
5230
|
-
JsonNull,
|
|
5231
|
-
AnyNull,
|
|
5232
|
-
NullTypes,
|
|
5381
|
+
objectEnumValues,
|
|
5233
5382
|
makeStrictEnum,
|
|
5234
5383
|
Extensions,
|
|
5235
5384
|
warnOnce,
|
|
@@ -5279,11 +5428,15 @@ Prisma.defineExtension = ${notSupportOnBrowser("Extensions.defineExtension", bro
|
|
|
5279
5428
|
/**
|
|
5280
5429
|
* Shorthand utilities for JSON filtering
|
|
5281
5430
|
*/
|
|
5282
|
-
Prisma.DbNull = DbNull
|
|
5283
|
-
Prisma.JsonNull = JsonNull
|
|
5284
|
-
Prisma.AnyNull = AnyNull
|
|
5431
|
+
Prisma.DbNull = objectEnumValues.instances.DbNull
|
|
5432
|
+
Prisma.JsonNull = objectEnumValues.instances.JsonNull
|
|
5433
|
+
Prisma.AnyNull = objectEnumValues.instances.AnyNull
|
|
5285
5434
|
|
|
5286
|
-
Prisma.NullTypes =
|
|
5435
|
+
Prisma.NullTypes = {
|
|
5436
|
+
DbNull: objectEnumValues.classes.DbNull,
|
|
5437
|
+
JsonNull: objectEnumValues.classes.JsonNull,
|
|
5438
|
+
AnyNull: objectEnumValues.classes.AnyNull
|
|
5439
|
+
}
|
|
5287
5440
|
|
|
5288
5441
|
${buildPrismaSkipJs(generator.previewFeatures)}
|
|
5289
5442
|
`;
|
|
@@ -5349,6 +5502,14 @@ export import Decimal = runtime.Decimal
|
|
|
5349
5502
|
|
|
5350
5503
|
export type DecimalJsLike = runtime.DecimalJsLike
|
|
5351
5504
|
|
|
5505
|
+
/**
|
|
5506
|
+
* Metrics
|
|
5507
|
+
*/
|
|
5508
|
+
export type Metrics = runtime.Metrics
|
|
5509
|
+
export type Metric<T> = runtime.Metric<T>
|
|
5510
|
+
export type MetricHistogram = runtime.MetricHistogram
|
|
5511
|
+
export type MetricHistogramBucket = runtime.MetricHistogramBucket
|
|
5512
|
+
|
|
5352
5513
|
/**
|
|
5353
5514
|
* Extensions
|
|
5354
5515
|
*/
|
|
@@ -5848,6 +6009,9 @@ import indent7 from "indent-string";
|
|
|
5848
6009
|
|
|
5849
6010
|
// src/utils/runtimeImport.ts
|
|
5850
6011
|
import * as ts9 from "@prisma/ts-builders";
|
|
6012
|
+
function runtimeImport(name) {
|
|
6013
|
+
return name;
|
|
6014
|
+
}
|
|
5851
6015
|
function runtimeImportedType(name) {
|
|
5852
6016
|
return ts9.namedType(`runtime.${name}`);
|
|
5853
6017
|
}
|
|
@@ -6116,6 +6280,24 @@ function queryRawTypedDefinition(context) {
|
|
|
6116
6280
|
).setReturnType(prismaPromise(ts11.array(param.toArgument())));
|
|
6117
6281
|
return ts11.stringify(method3, { indentLevel: 1, newLine: "leading" });
|
|
6118
6282
|
}
|
|
6283
|
+
function metricDefinition(context) {
|
|
6284
|
+
if (!context.isPreviewFeatureOn("metrics")) {
|
|
6285
|
+
return "";
|
|
6286
|
+
}
|
|
6287
|
+
const property11 = ts11.property("$metrics", ts11.namedType(`runtime.${runtimeImport("MetricsClient")}`)).setDocComment(
|
|
6288
|
+
ts11.docComment`
|
|
6289
|
+
Gives access to the client metrics in json or prometheus format.
|
|
6290
|
+
|
|
6291
|
+
@example
|
|
6292
|
+
\`\`\`
|
|
6293
|
+
const metrics = await prisma.$metrics.json()
|
|
6294
|
+
// or
|
|
6295
|
+
const metrics = await prisma.$metrics.prometheus()
|
|
6296
|
+
\`\`\`
|
|
6297
|
+
`
|
|
6298
|
+
).readonly();
|
|
6299
|
+
return ts11.stringify(property11, { indentLevel: 1, newLine: "leading" });
|
|
6300
|
+
}
|
|
6119
6301
|
function runCommandRawDefinition(context) {
|
|
6120
6302
|
if (!context.dmmf.mappings.otherOperations.write.includes("runCommandRaw")) {
|
|
6121
6303
|
return "";
|
|
@@ -6135,6 +6317,15 @@ function runCommandRawDefinition(context) {
|
|
|
6135
6317
|
`);
|
|
6136
6318
|
return ts11.stringify(method3, { indentLevel: 1, newLine: "leading" });
|
|
6137
6319
|
}
|
|
6320
|
+
function applyPendingMigrationsDefinition() {
|
|
6321
|
+
if (this.runtimeNameTs !== "react-native") {
|
|
6322
|
+
return null;
|
|
6323
|
+
}
|
|
6324
|
+
const method3 = ts11.method("$applyPendingMigrations").setReturnType(promise(ts11.voidType)).setDocComment(
|
|
6325
|
+
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.`
|
|
6326
|
+
);
|
|
6327
|
+
return ts11.stringify(method3, { indentLevel: 1, newLine: "leading" });
|
|
6328
|
+
}
|
|
6138
6329
|
function eventRegistrationMethodDeclaration(runtimeNameTs) {
|
|
6139
6330
|
if (runtimeNameTs === "binary.js") {
|
|
6140
6331
|
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;`;
|
|
@@ -6208,6 +6399,8 @@ ${[
|
|
|
6208
6399
|
batchingTransactionDefinition(this.context),
|
|
6209
6400
|
interactiveTransactionDefinition(this.context),
|
|
6210
6401
|
runCommandRawDefinition(this.context),
|
|
6402
|
+
metricDefinition(this.context),
|
|
6403
|
+
applyPendingMigrationsDefinition.bind(this)(),
|
|
6211
6404
|
extendsPropertyDefinition()
|
|
6212
6405
|
].filter((d) => d !== null).join("\n").trim()}
|
|
6213
6406
|
|
|
@@ -6309,6 +6502,8 @@ export type TransactionClient = Omit<Prisma.DefaultPrismaClient, runtime.ITXClie
|
|
|
6309
6502
|
buildClientOptions() {
|
|
6310
6503
|
const clientOptions = ts11.interfaceDeclaration("PrismaClientOptions").add(
|
|
6311
6504
|
ts11.property("datasources", ts11.namedType("Datasources")).optional().setDocComment(ts11.docComment("Overwrites the datasource url from your schema.prisma file"))
|
|
6505
|
+
).add(
|
|
6506
|
+
ts11.property("datasourceUrl", ts11.stringType).optional().setDocComment(ts11.docComment("Overwrites the datasource url from your schema.prisma file"))
|
|
6312
6507
|
).add(
|
|
6313
6508
|
ts11.property("errorFormat", ts11.namedType("ErrorFormat")).optional().setDocComment(ts11.docComment('@default "colorless"'))
|
|
6314
6509
|
).add(
|
|
@@ -6351,18 +6546,11 @@ export type TransactionClient = Omit<Prisma.DefaultPrismaClient, runtime.ITXClie
|
|
|
6351
6546
|
if (["library.js", "client.js"].includes(this.runtimeNameTs) && // We don't support a custom adapter with MongoDB for now.
|
|
6352
6547
|
this.internalDatasources.some((d) => d.provider !== "mongodb")) {
|
|
6353
6548
|
clientOptions.add(
|
|
6354
|
-
ts11.property("adapter", ts11.namedType("runtime.SqlDriverAdapterFactory")).optional().setDocComment(
|
|
6549
|
+
ts11.property("adapter", ts11.unionType([ts11.namedType("runtime.SqlDriverAdapterFactory"), ts11.namedType("null")])).optional().setDocComment(
|
|
6355
6550
|
ts11.docComment("Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale`")
|
|
6356
6551
|
)
|
|
6357
6552
|
);
|
|
6358
6553
|
}
|
|
6359
|
-
clientOptions.add(
|
|
6360
|
-
ts11.property("accelerateUrl", ts11.stringType).optional().setDocComment(
|
|
6361
|
-
ts11.docComment(
|
|
6362
|
-
"Prisma Accelerate URL allowing the client to connect through Accelerate instead of a direct database."
|
|
6363
|
-
)
|
|
6364
|
-
)
|
|
6365
|
-
);
|
|
6366
6554
|
clientOptions.add(
|
|
6367
6555
|
ts11.property("omit", ts11.namedType("Prisma.GlobalOmitConfig")).optional().setDocComment(ts11.docComment`
|
|
6368
6556
|
Global configuration for omitting model fields by default.
|
|
@@ -6396,20 +6584,33 @@ var TSClient = class {
|
|
|
6396
6584
|
const {
|
|
6397
6585
|
edge,
|
|
6398
6586
|
wasm,
|
|
6587
|
+
binaryPaths,
|
|
6399
6588
|
generator,
|
|
6400
6589
|
outputDir,
|
|
6401
6590
|
datamodel: inlineSchema,
|
|
6591
|
+
runtimeBase,
|
|
6402
6592
|
runtimeNameJs,
|
|
6403
6593
|
datasources,
|
|
6404
|
-
|
|
6594
|
+
copyEngine = true,
|
|
6595
|
+
reusedJs,
|
|
6596
|
+
envPaths
|
|
6405
6597
|
} = this.options;
|
|
6406
6598
|
if (reusedJs) {
|
|
6407
6599
|
return `module.exports = { ...require('${reusedJs}') }`;
|
|
6408
6600
|
}
|
|
6601
|
+
const relativeEnvPaths = {
|
|
6602
|
+
rootEnvPath: envPaths.rootEnvPath && pathToPosix3(path2.relative(outputDir, envPaths.rootEnvPath)),
|
|
6603
|
+
schemaEnvPath: envPaths.schemaEnvPath && pathToPosix3(path2.relative(outputDir, envPaths.schemaEnvPath))
|
|
6604
|
+
};
|
|
6605
|
+
const clientEngineType = getClientEngineType(generator);
|
|
6606
|
+
generator.config.engineType = clientEngineType;
|
|
6607
|
+
const binaryTargets = clientEngineType === ClientEngineType2.Library ? Object.keys(binaryPaths.libqueryEngine ?? {}) : Object.keys(binaryPaths.queryEngine ?? {});
|
|
6608
|
+
const inlineSchemaHash = crypto.createHash("sha256").update(Buffer.from(inlineSchema, "utf8").toString("base64")).digest("hex");
|
|
6409
6609
|
const datasourceFilePath = datasources[0].sourceFilePath;
|
|
6410
6610
|
const config = {
|
|
6411
6611
|
generator,
|
|
6412
|
-
|
|
6612
|
+
relativeEnvPaths,
|
|
6613
|
+
relativePath: pathToPosix3(path2.relative(outputDir, path2.dirname(datasourceFilePath))),
|
|
6413
6614
|
clientVersion: this.options.clientVersion,
|
|
6414
6615
|
engineVersion: this.options.engineVersion,
|
|
6415
6616
|
datasourceNames: datasources.map((d) => d.name),
|
|
@@ -6417,25 +6618,24 @@ var TSClient = class {
|
|
|
6417
6618
|
postinstall: this.options.postinstall,
|
|
6418
6619
|
ciName: ciInfo.name ?? void 0,
|
|
6419
6620
|
inlineDatasources: buildInlineDatasources(datasources),
|
|
6420
|
-
inlineSchema
|
|
6621
|
+
inlineSchema,
|
|
6622
|
+
inlineSchemaHash,
|
|
6623
|
+
copyEngine
|
|
6421
6624
|
};
|
|
6422
|
-
const relativeOutdir =
|
|
6625
|
+
const relativeOutdir = path2.relative(process.cwd(), outputDir);
|
|
6423
6626
|
const code = `${commonCodeJS({ ...this.options, browser: false })}
|
|
6424
6627
|
${buildRequirePath(edge)}
|
|
6425
6628
|
|
|
6426
6629
|
/**
|
|
6427
6630
|
* Enums
|
|
6428
6631
|
*/
|
|
6429
|
-
${this.dmmf.schema.enumTypes.prisma?.map((type) => new Enum(
|
|
6632
|
+
${this.dmmf.schema.enumTypes.prisma?.map((type) => new Enum(type, true).toJS()).join("\n\n")}
|
|
6430
6633
|
${this.dmmf.datamodel.enums.map((datamodelEnum) => new Enum(datamodelEnumToSchemaEnum(datamodelEnum), false).toJS()).join("\n\n")}
|
|
6431
6634
|
|
|
6432
6635
|
${new Enum(
|
|
6433
6636
|
{
|
|
6434
6637
|
name: "ModelName",
|
|
6435
|
-
|
|
6436
|
-
key: m.model,
|
|
6437
|
-
value: m.model
|
|
6438
|
-
}))
|
|
6638
|
+
values: this.dmmf.mappings.modelOperations.map((m) => m.model)
|
|
6439
6639
|
},
|
|
6440
6640
|
true
|
|
6441
6641
|
).toJS()}
|
|
@@ -6445,12 +6645,15 @@ ${new Enum(
|
|
|
6445
6645
|
const config = ${JSON.stringify(config, null, 2)}
|
|
6446
6646
|
${buildDirname(edge, relativeOutdir)}
|
|
6447
6647
|
${buildRuntimeDataModel(this.dmmf.datamodel, runtimeNameJs)}
|
|
6448
|
-
${buildQueryEngineWasmModule(runtimeNameJs)}
|
|
6648
|
+
${buildQueryEngineWasmModule(wasm, copyEngine, runtimeNameJs)}
|
|
6449
6649
|
${buildQueryCompilerWasmModule(wasm, runtimeNameJs)}
|
|
6650
|
+
${buildInjectableEdgeEnv(edge, datasources)}
|
|
6651
|
+
${buildWarnEnvConflicts(edge, runtimeBase, runtimeNameJs)}
|
|
6450
6652
|
${buildDebugInitialization(edge)}
|
|
6451
6653
|
const PrismaClient = getPrismaClient(config)
|
|
6452
6654
|
exports.PrismaClient = PrismaClient
|
|
6453
6655
|
Object.assign(exports, Prisma)
|
|
6656
|
+
${buildNFTAnnotations(edge || !copyEngine, clientEngineType, binaryTargets, relativeOutdir)}
|
|
6454
6657
|
`;
|
|
6455
6658
|
return code;
|
|
6456
6659
|
}
|
|
@@ -6479,9 +6682,7 @@ Object.assign(exports, Prisma)
|
|
|
6479
6682
|
}
|
|
6480
6683
|
return acc;
|
|
6481
6684
|
}, []);
|
|
6482
|
-
const prismaEnums = this.dmmf.schema.enumTypes.prisma?.map(
|
|
6483
|
-
(type) => new Enum(datamodelSchemaEnumToSchemaEnum(type), true).toTS()
|
|
6484
|
-
);
|
|
6685
|
+
const prismaEnums = this.dmmf.schema.enumTypes.prisma?.map((type) => new Enum(type, true).toTS());
|
|
6485
6686
|
const modelEnums = [];
|
|
6486
6687
|
const modelEnumsAliases = [];
|
|
6487
6688
|
for (const datamodelEnum of this.dmmf.datamodel.enums) {
|
|
@@ -6523,10 +6724,7 @@ ${indent8(
|
|
|
6523
6724
|
${new Enum(
|
|
6524
6725
|
{
|
|
6525
6726
|
name: "ModelName",
|
|
6526
|
-
|
|
6527
|
-
key: m.model,
|
|
6528
|
-
value: m.model
|
|
6529
|
-
}))
|
|
6727
|
+
values: this.dmmf.mappings.modelOperations.map((m) => m.model)
|
|
6530
6728
|
},
|
|
6531
6729
|
true
|
|
6532
6730
|
).toTS()}
|
|
@@ -6610,16 +6808,13 @@ export const dmmf: runtime.BaseDMMF
|
|
|
6610
6808
|
* Enums
|
|
6611
6809
|
*/
|
|
6612
6810
|
|
|
6613
|
-
${this.dmmf.schema.enumTypes.prisma?.map((type) => new Enum(
|
|
6614
|
-
${this.dmmf.schema.enumTypes.model?.map((type) => new Enum(
|
|
6811
|
+
${this.dmmf.schema.enumTypes.prisma?.map((type) => new Enum(type, true).toJS()).join("\n\n")}
|
|
6812
|
+
${this.dmmf.schema.enumTypes.model?.map((type) => new Enum(type, false).toJS()).join("\n\n") ?? ""}
|
|
6615
6813
|
|
|
6616
6814
|
${new Enum(
|
|
6617
6815
|
{
|
|
6618
6816
|
name: "ModelName",
|
|
6619
|
-
|
|
6620
|
-
key: m.model,
|
|
6621
|
-
value: m.model
|
|
6622
|
-
}))
|
|
6817
|
+
values: this.dmmf.mappings.modelOperations.map((m) => m.model)
|
|
6623
6818
|
},
|
|
6624
6819
|
true
|
|
6625
6820
|
).toJS()}
|
|
@@ -6957,6 +7152,7 @@ function addPreamble(fileContent) {
|
|
|
6957
7152
|
}
|
|
6958
7153
|
|
|
6959
7154
|
// src/generateClient.ts
|
|
7155
|
+
var debug = Debug("prisma:client:generateClient");
|
|
6960
7156
|
var DenylistError = class extends Error {
|
|
6961
7157
|
constructor(message) {
|
|
6962
7158
|
super(message);
|
|
@@ -6978,10 +7174,14 @@ async function buildClient({
|
|
|
6978
7174
|
clientVersion,
|
|
6979
7175
|
activeProvider,
|
|
6980
7176
|
postinstall,
|
|
7177
|
+
copyEngine,
|
|
7178
|
+
envPaths,
|
|
6981
7179
|
typedSql
|
|
6982
7180
|
}) {
|
|
7181
|
+
const clientEngineType = getClientEngineType2(generator);
|
|
6983
7182
|
const baseClientOptions = {
|
|
6984
7183
|
dmmf: getPrismaClientDMMF(dmmf),
|
|
7184
|
+
envPaths: envPaths ?? { rootEnvPath: null, schemaEnvPath: void 0 },
|
|
6985
7185
|
datasources,
|
|
6986
7186
|
generator,
|
|
6987
7187
|
binaryPaths,
|
|
@@ -6993,6 +7193,7 @@ async function buildClient({
|
|
|
6993
7193
|
engineVersion,
|
|
6994
7194
|
activeProvider,
|
|
6995
7195
|
postinstall,
|
|
7196
|
+
copyEngine,
|
|
6996
7197
|
datamodel,
|
|
6997
7198
|
browser: false,
|
|
6998
7199
|
edge: false,
|
|
@@ -7000,8 +7201,8 @@ async function buildClient({
|
|
|
7000
7201
|
};
|
|
7001
7202
|
const nodeClientOptions = {
|
|
7002
7203
|
...baseClientOptions,
|
|
7003
|
-
runtimeNameJs:
|
|
7004
|
-
runtimeNameTs:
|
|
7204
|
+
runtimeNameJs: getNodeRuntimeName(clientEngineType),
|
|
7205
|
+
runtimeNameTs: `${getNodeRuntimeName(clientEngineType)}.js`
|
|
7005
7206
|
};
|
|
7006
7207
|
const nodeClient = new TSClient(nodeClientOptions);
|
|
7007
7208
|
const defaultClient = new TSClient({
|
|
@@ -7009,6 +7210,19 @@ async function buildClient({
|
|
|
7009
7210
|
reusedTs: "index",
|
|
7010
7211
|
reusedJs: "."
|
|
7011
7212
|
});
|
|
7213
|
+
const edgeClient = new TSClient({
|
|
7214
|
+
...baseClientOptions,
|
|
7215
|
+
runtimeNameJs: "edge",
|
|
7216
|
+
runtimeNameTs: "library.js",
|
|
7217
|
+
reusedTs: "default",
|
|
7218
|
+
edge: true
|
|
7219
|
+
});
|
|
7220
|
+
const rnTsClient = new TSClient({
|
|
7221
|
+
...baseClientOptions,
|
|
7222
|
+
runtimeNameJs: "react-native",
|
|
7223
|
+
runtimeNameTs: "react-native",
|
|
7224
|
+
edge: true
|
|
7225
|
+
});
|
|
7012
7226
|
const trampolineTsClient = new TSClient({
|
|
7013
7227
|
...nodeClientOptions,
|
|
7014
7228
|
reusedTs: "index",
|
|
@@ -7042,10 +7256,7 @@ async function buildClient({
|
|
|
7042
7256
|
".": exportsMapDefault
|
|
7043
7257
|
},
|
|
7044
7258
|
version: clientVersion,
|
|
7045
|
-
sideEffects: false
|
|
7046
|
-
dependencies: {
|
|
7047
|
-
"@prisma/client-runtime-utils": clientVersion
|
|
7048
|
-
}
|
|
7259
|
+
sideEffects: false
|
|
7049
7260
|
};
|
|
7050
7261
|
const fileMap = {};
|
|
7051
7262
|
fileMap["index.js"] = JS(nodeClient);
|
|
@@ -7053,16 +7264,28 @@ async function buildClient({
|
|
|
7053
7264
|
fileMap["default.js"] = JS(defaultClient);
|
|
7054
7265
|
fileMap["default.d.ts"] = TS(defaultClient);
|
|
7055
7266
|
fileMap["index-browser.js"] = BrowserJS(nodeClient);
|
|
7267
|
+
fileMap["edge.js"] = JS(edgeClient);
|
|
7268
|
+
fileMap["edge.d.ts"] = TS(edgeClient);
|
|
7056
7269
|
fileMap["client.js"] = JS(defaultClient);
|
|
7057
7270
|
fileMap["client.d.ts"] = TS(defaultClient);
|
|
7271
|
+
if (generator.previewFeatures.includes("reactNative")) {
|
|
7272
|
+
fileMap["react-native.js"] = JS(rnTsClient);
|
|
7273
|
+
fileMap["react-native.d.ts"] = TS(rnTsClient);
|
|
7274
|
+
}
|
|
7275
|
+
const usesClientEngine = clientEngineType === ClientEngineType3.Client;
|
|
7058
7276
|
fileMap["default.js"] = JS(trampolineTsClient);
|
|
7059
7277
|
fileMap["default.d.ts"] = TS(trampolineTsClient);
|
|
7060
|
-
|
|
7061
|
-
|
|
7278
|
+
if (usesClientEngine) {
|
|
7279
|
+
fileMap["wasm-worker-loader.mjs"] = `export default import('./query_compiler_bg.wasm')`;
|
|
7280
|
+
fileMap["wasm-edge-light-loader.mjs"] = `export default import('./query_compiler_bg.wasm?module')`;
|
|
7281
|
+
} else {
|
|
7282
|
+
fileMap["wasm-worker-loader.mjs"] = `export default import('./query_engine_bg.wasm')`;
|
|
7283
|
+
fileMap["wasm-edge-light-loader.mjs"] = `export default import('./query_engine_bg.wasm?module')`;
|
|
7284
|
+
}
|
|
7062
7285
|
pkgJson["browser"] = "default.js";
|
|
7063
7286
|
pkgJson["imports"] = {
|
|
7064
|
-
// when `import('#wasm-compiler-loader')` is called, it will be resolved to the correct file
|
|
7065
|
-
"#wasm-compiler-loader": {
|
|
7287
|
+
// when `import('#wasm-engine-loader')` or `import('#wasm-compiler-loader')` is called, it will be resolved to the correct file
|
|
7288
|
+
[usesClientEngine ? "#wasm-compiler-loader" : "#wasm-engine-loader"]: {
|
|
7066
7289
|
// Keys reference: https://runtime-keys.proposal.wintercg.org/#keys
|
|
7067
7290
|
/**
|
|
7068
7291
|
* Vercel Edge Functions / Next.js Middlewares
|
|
@@ -7087,7 +7310,7 @@ async function buildClient({
|
|
|
7087
7310
|
};
|
|
7088
7311
|
const wasmClient = new TSClient({
|
|
7089
7312
|
...baseClientOptions,
|
|
7090
|
-
runtimeNameJs: "wasm-compiler-edge",
|
|
7313
|
+
runtimeNameJs: usesClientEngine ? "wasm-compiler-edge" : "wasm-engine-edge",
|
|
7091
7314
|
runtimeNameTs: "library.js",
|
|
7092
7315
|
reusedTs: "default",
|
|
7093
7316
|
edge: true,
|
|
@@ -7096,7 +7319,7 @@ async function buildClient({
|
|
|
7096
7319
|
fileMap["wasm.js"] = JS(wasmClient);
|
|
7097
7320
|
fileMap["wasm.d.ts"] = TS(wasmClient);
|
|
7098
7321
|
if (typedSql && typedSql.length > 0) {
|
|
7099
|
-
const edgeRuntimeName = "wasm-compiler-edge";
|
|
7322
|
+
const edgeRuntimeName = usesClientEngine ? "wasm-compiler-edge" : "edge";
|
|
7100
7323
|
const cjsEdgeIndex = `./sql/index.${edgeRuntimeName}.js`;
|
|
7101
7324
|
const esmEdgeIndex = `./sql/index.${edgeRuntimeName}.mjs`;
|
|
7102
7325
|
pkgJson.exports["./sql"] = {
|
|
@@ -7121,7 +7344,7 @@ async function buildClient({
|
|
|
7121
7344
|
fileMap["sql"] = buildTypedSql({
|
|
7122
7345
|
dmmf,
|
|
7123
7346
|
runtimeBase: getTypedSqlRuntimeBase(runtimeBase),
|
|
7124
|
-
mainRuntimeName:
|
|
7347
|
+
mainRuntimeName: getNodeRuntimeName(clientEngineType),
|
|
7125
7348
|
queries: typedSql,
|
|
7126
7349
|
edgeRuntimeName
|
|
7127
7350
|
});
|
|
@@ -7145,19 +7368,19 @@ function getTypedSqlRuntimeBase(runtimeBase) {
|
|
|
7145
7368
|
return `../${runtimeBase}`;
|
|
7146
7369
|
}
|
|
7147
7370
|
async function getDefaultOutdir(outputDir) {
|
|
7148
|
-
if (outputDir.endsWith(
|
|
7149
|
-
return
|
|
7371
|
+
if (outputDir.endsWith(path3.normalize("node_modules/@prisma/client"))) {
|
|
7372
|
+
return path3.join(outputDir, "../../.prisma/client");
|
|
7150
7373
|
}
|
|
7151
7374
|
if (process.env.INIT_CWD && process.env.npm_lifecycle_event === "postinstall" && !process.env.PWD?.includes(".pnpm")) {
|
|
7152
|
-
if (existsSync(
|
|
7153
|
-
return
|
|
7375
|
+
if (existsSync(path3.join(process.env.INIT_CWD, "package.json"))) {
|
|
7376
|
+
return path3.join(process.env.INIT_CWD, "node_modules/.prisma/client");
|
|
7154
7377
|
}
|
|
7155
7378
|
const packagePath = await packageUp({ cwd: process.env.INIT_CWD });
|
|
7156
7379
|
if (packagePath) {
|
|
7157
|
-
return
|
|
7380
|
+
return path3.join(path3.dirname(packagePath), "node_modules/.prisma/client");
|
|
7158
7381
|
}
|
|
7159
7382
|
}
|
|
7160
|
-
return
|
|
7383
|
+
return path3.join(outputDir, "../../.prisma/client");
|
|
7161
7384
|
}
|
|
7162
7385
|
async function generateClient(options) {
|
|
7163
7386
|
const {
|
|
@@ -7175,8 +7398,11 @@ async function generateClient(options) {
|
|
|
7175
7398
|
engineVersion,
|
|
7176
7399
|
activeProvider,
|
|
7177
7400
|
postinstall,
|
|
7401
|
+
envPaths,
|
|
7402
|
+
copyEngine = true,
|
|
7178
7403
|
typedSql
|
|
7179
7404
|
} = options;
|
|
7405
|
+
const clientEngineType = getClientEngineType2(generator);
|
|
7180
7406
|
const { runtimeBase, outputDir } = await getGenerationDirs(options);
|
|
7181
7407
|
const { prismaClientDmmf, fileMap } = await buildClient({
|
|
7182
7408
|
datamodel,
|
|
@@ -7192,7 +7418,9 @@ async function generateClient(options) {
|
|
|
7192
7418
|
engineVersion,
|
|
7193
7419
|
activeProvider,
|
|
7194
7420
|
postinstall,
|
|
7421
|
+
copyEngine,
|
|
7195
7422
|
testMode,
|
|
7423
|
+
envPaths,
|
|
7196
7424
|
typedSql
|
|
7197
7425
|
});
|
|
7198
7426
|
const provider = datasources[0].provider;
|
|
@@ -7209,31 +7437,51 @@ async function generateClient(options) {
|
|
|
7209
7437
|
To learn more about how to rename models, check out https://pris.ly/d/naming-models`;
|
|
7210
7438
|
throw new DenylistError(message);
|
|
7211
7439
|
}
|
|
7440
|
+
if (!copyEngine) {
|
|
7441
|
+
await deleteOutputDir(outputDir);
|
|
7442
|
+
}
|
|
7212
7443
|
await (0, import_fs_extra.ensureDir)(outputDir);
|
|
7213
7444
|
await writeFileMap(outputDir, fileMap);
|
|
7214
7445
|
if (copyRuntime || generator.isCustomOutput === true) {
|
|
7215
|
-
const copiedRuntimeDir =
|
|
7446
|
+
const copiedRuntimeDir = path3.join(outputDir, "runtime");
|
|
7216
7447
|
await (0, import_fs_extra.ensureDir)(copiedRuntimeDir);
|
|
7217
7448
|
await copyRuntimeFiles({
|
|
7218
7449
|
from: runtimeSourcePath,
|
|
7219
7450
|
to: copiedRuntimeDir,
|
|
7220
7451
|
sourceMaps: copyRuntimeSourceMaps,
|
|
7221
|
-
runtimeName:
|
|
7452
|
+
runtimeName: getNodeRuntimeName(clientEngineType)
|
|
7222
7453
|
});
|
|
7223
7454
|
}
|
|
7224
|
-
const
|
|
7455
|
+
const enginePath = clientEngineType === ClientEngineType3.Library ? binaryPaths.libqueryEngine : binaryPaths.queryEngine;
|
|
7456
|
+
if (copyEngine && enginePath) {
|
|
7457
|
+
if (process.env.NETLIFY) {
|
|
7458
|
+
await (0, import_fs_extra.ensureDir)("/tmp/prisma-engines");
|
|
7459
|
+
}
|
|
7460
|
+
for (const [binaryTarget, filePath] of Object.entries(enginePath)) {
|
|
7461
|
+
const fileName = path3.basename(filePath);
|
|
7462
|
+
let target;
|
|
7463
|
+
if (process.env.NETLIFY && !["rhel-openssl-1.0.x", "rhel-openssl-3.0.x"].includes(binaryTarget)) {
|
|
7464
|
+
target = path3.join("/tmp/prisma-engines", fileName);
|
|
7465
|
+
} else {
|
|
7466
|
+
target = path3.join(outputDir, fileName);
|
|
7467
|
+
}
|
|
7468
|
+
await overwriteFile(filePath, target);
|
|
7469
|
+
}
|
|
7470
|
+
}
|
|
7471
|
+
const schemaTargetPath = path3.join(outputDir, "schema.prisma");
|
|
7225
7472
|
await fs.writeFile(schemaTargetPath, datamodel, { encoding: "utf-8" });
|
|
7226
|
-
|
|
7473
|
+
const runtimeNeedsWasmEngine = clientEngineType === ClientEngineType3.Client || copyEngine;
|
|
7474
|
+
if (runtimeNeedsWasmEngine && isWasmEngineSupported(provider) && !testMode) {
|
|
7227
7475
|
const suffix = provider === "postgres" ? "postgresql" : provider;
|
|
7228
|
-
const filename = "query_compiler_bg";
|
|
7229
|
-
const wasmJsBundlePath =
|
|
7476
|
+
const filename = clientEngineType === ClientEngineType3.Client ? "query_compiler_bg" : "query_engine_bg";
|
|
7477
|
+
const wasmJsBundlePath = path3.join(runtimeSourcePath, `${filename}.${suffix}.wasm-base64.js`);
|
|
7230
7478
|
const wasmBase64 = __require(wasmJsBundlePath).wasm;
|
|
7231
|
-
await fs.writeFile(
|
|
7232
|
-
await fs.copyFile(
|
|
7479
|
+
await fs.writeFile(path3.join(outputDir, `${filename}.wasm`), Buffer.from(wasmBase64, "base64"));
|
|
7480
|
+
await fs.copyFile(path3.join(runtimeSourcePath, `${filename}.${suffix}.js`), path3.join(outputDir, `${filename}.js`));
|
|
7233
7481
|
}
|
|
7234
7482
|
try {
|
|
7235
7483
|
const prismaCache = paths("prisma").cache;
|
|
7236
|
-
const signalsPath =
|
|
7484
|
+
const signalsPath = path3.join(prismaCache, "last-generate");
|
|
7237
7485
|
await fs.mkdir(prismaCache, { recursive: true });
|
|
7238
7486
|
await fs.writeFile(signalsPath, Date.now().toString());
|
|
7239
7487
|
} catch {
|
|
@@ -7242,7 +7490,7 @@ To learn more about how to rename models, check out https://pris.ly/d/naming-mod
|
|
|
7242
7490
|
function writeFileMap(outputDir, fileMap) {
|
|
7243
7491
|
return Promise.all(
|
|
7244
7492
|
Object.entries(fileMap).map(async ([fileName, content]) => {
|
|
7245
|
-
const absolutePath =
|
|
7493
|
+
const absolutePath = path3.join(outputDir, fileName);
|
|
7246
7494
|
await fs.rm(absolutePath, { recursive: true, force: true });
|
|
7247
7495
|
if (typeof content === "string") {
|
|
7248
7496
|
await fs.writeFile(absolutePath, content);
|
|
@@ -7342,18 +7590,18 @@ async function getGenerationDirs({
|
|
|
7342
7590
|
testMode
|
|
7343
7591
|
}) {
|
|
7344
7592
|
const isCustomOutput = generator.isCustomOutput === true;
|
|
7345
|
-
const normalizedOutputDir =
|
|
7593
|
+
const normalizedOutputDir = path3.normalize(outputDir);
|
|
7346
7594
|
let userRuntimeImport = isCustomOutput ? "./runtime" : "@prisma/client/runtime";
|
|
7347
7595
|
let userOutputDir = isCustomOutput ? normalizedOutputDir : await getDefaultOutdir(normalizedOutputDir);
|
|
7348
7596
|
if (testMode && runtimeBase) {
|
|
7349
7597
|
userOutputDir = outputDir;
|
|
7350
|
-
userRuntimeImport =
|
|
7598
|
+
userRuntimeImport = pathToPosix4(runtimeBase);
|
|
7351
7599
|
}
|
|
7352
7600
|
if (isCustomOutput) {
|
|
7353
7601
|
await verifyOutputDirectory(userOutputDir, datamodel, schemaPath);
|
|
7354
7602
|
}
|
|
7355
|
-
const userPackageRoot = await packageUp({ cwd:
|
|
7356
|
-
const userProjectRoot = userPackageRoot ?
|
|
7603
|
+
const userPackageRoot = await packageUp({ cwd: path3.dirname(userOutputDir) });
|
|
7604
|
+
const userProjectRoot = userPackageRoot ? path3.dirname(userPackageRoot) : process.cwd();
|
|
7357
7605
|
return {
|
|
7358
7606
|
runtimeBase: userRuntimeImport,
|
|
7359
7607
|
outputDir: userOutputDir,
|
|
@@ -7363,7 +7611,7 @@ async function getGenerationDirs({
|
|
|
7363
7611
|
async function verifyOutputDirectory(directory, datamodel, schemaPath) {
|
|
7364
7612
|
let content;
|
|
7365
7613
|
try {
|
|
7366
|
-
content = await fs.readFile(
|
|
7614
|
+
content = await fs.readFile(path3.join(directory, "package.json"), "utf8");
|
|
7367
7615
|
} catch (e) {
|
|
7368
7616
|
if (e.code === "ENOENT") {
|
|
7369
7617
|
return;
|
|
@@ -7406,17 +7654,43 @@ function findOutputPathDeclaration(datamodel) {
|
|
|
7406
7654
|
}
|
|
7407
7655
|
return null;
|
|
7408
7656
|
}
|
|
7657
|
+
function getNodeRuntimeName(engineType) {
|
|
7658
|
+
if (engineType === ClientEngineType3.Binary) {
|
|
7659
|
+
return "binary";
|
|
7660
|
+
}
|
|
7661
|
+
if (engineType === ClientEngineType3.Library) {
|
|
7662
|
+
return "library";
|
|
7663
|
+
}
|
|
7664
|
+
if (engineType === ClientEngineType3.Client) {
|
|
7665
|
+
return "client";
|
|
7666
|
+
}
|
|
7667
|
+
assertNever3(engineType, "Unknown engine type");
|
|
7668
|
+
}
|
|
7409
7669
|
async function copyRuntimeFiles({ from, to, runtimeName, sourceMaps }) {
|
|
7410
|
-
const files = [
|
|
7670
|
+
const files = [
|
|
7671
|
+
// library.d.ts is always included, as it contains the actual runtime type
|
|
7672
|
+
// definitions. Rest of the `runtime.d.ts` files just re-export everything
|
|
7673
|
+
// from `library.d.ts`
|
|
7674
|
+
"library.d.ts",
|
|
7675
|
+
"index-browser.js",
|
|
7676
|
+
"index-browser.d.ts",
|
|
7677
|
+
"edge.js",
|
|
7678
|
+
"edge-esm.js",
|
|
7679
|
+
"react-native.js",
|
|
7680
|
+
"wasm-engine-edge.js",
|
|
7681
|
+
"wasm-compiler-edge.js"
|
|
7682
|
+
];
|
|
7411
7683
|
files.push(`${runtimeName}.js`);
|
|
7412
|
-
|
|
7684
|
+
if (runtimeName !== "library") {
|
|
7685
|
+
files.push(`${runtimeName}.d.ts`);
|
|
7686
|
+
}
|
|
7413
7687
|
if (sourceMaps) {
|
|
7414
7688
|
files.push(...files.filter((file4) => file4.endsWith(".js")).map((file4) => `${file4}.map`));
|
|
7415
7689
|
}
|
|
7416
7690
|
await Promise.all(
|
|
7417
7691
|
files.map(async (file4) => {
|
|
7418
|
-
const sourcePath =
|
|
7419
|
-
const targetPath =
|
|
7692
|
+
const sourcePath = path3.join(from, file4);
|
|
7693
|
+
const targetPath = path3.join(to, file4);
|
|
7420
7694
|
if (file4.endsWith(".js")) {
|
|
7421
7695
|
const content = await fs.readFile(sourcePath, "utf-8");
|
|
7422
7696
|
await fs.writeFile(targetPath, addPreamble(content));
|
|
@@ -7426,6 +7700,18 @@ async function copyRuntimeFiles({ from, to, runtimeName, sourceMaps }) {
|
|
|
7426
7700
|
})
|
|
7427
7701
|
);
|
|
7428
7702
|
}
|
|
7703
|
+
async function deleteOutputDir(outputDir) {
|
|
7704
|
+
try {
|
|
7705
|
+
debug(`attempting to delete ${outputDir} recursively`);
|
|
7706
|
+
if (__require(`${outputDir}/package.json`).name?.startsWith(GENERATED_PACKAGE_NAME_PREFIX)) {
|
|
7707
|
+
await fs.rmdir(outputDir, { recursive: true }).catch(() => {
|
|
7708
|
+
debug(`failed to delete ${outputDir} recursively`);
|
|
7709
|
+
});
|
|
7710
|
+
}
|
|
7711
|
+
} catch {
|
|
7712
|
+
debug(`failed to delete ${outputDir} recursively, not found`);
|
|
7713
|
+
}
|
|
7714
|
+
}
|
|
7429
7715
|
function getUniquePackageName(datamodel) {
|
|
7430
7716
|
const hash = createHash("sha256");
|
|
7431
7717
|
hash.write(datamodel);
|
|
@@ -7434,24 +7720,26 @@ function getUniquePackageName(datamodel) {
|
|
|
7434
7720
|
var GENERATED_PACKAGE_NAME_PREFIX = "prisma-client-";
|
|
7435
7721
|
|
|
7436
7722
|
// src/generator.ts
|
|
7437
|
-
import
|
|
7723
|
+
import path7 from "node:path";
|
|
7724
|
+
import { Debug as Debug3 } from "@prisma/debug";
|
|
7438
7725
|
import { enginesVersion } from "@prisma/engines-version";
|
|
7439
|
-
import { parseEnvValue } from "@prisma/internals";
|
|
7726
|
+
import { ClientEngineType as ClientEngineType4, getClientEngineType as getClientEngineType3, parseEnvValue } from "@prisma/internals";
|
|
7727
|
+
import { match } from "ts-pattern";
|
|
7440
7728
|
|
|
7441
7729
|
// package.json
|
|
7442
|
-
var version = "6.
|
|
7730
|
+
var version = "6.20.0-dev.1";
|
|
7443
7731
|
|
|
7444
7732
|
// src/resolvePrismaClient.ts
|
|
7445
7733
|
import fs2 from "node:fs/promises";
|
|
7446
|
-
import
|
|
7734
|
+
import path6 from "node:path";
|
|
7447
7735
|
import { detect, getCommand } from "@antfu/ni";
|
|
7448
|
-
import { Debug } from "@prisma/debug";
|
|
7736
|
+
import { Debug as Debug2 } from "@prisma/debug";
|
|
7449
7737
|
import { longestCommonPathPrefix, resolvePkg } from "@prisma/internals";
|
|
7450
7738
|
|
|
7451
7739
|
// ../../node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.js
|
|
7452
7740
|
var import_cross_spawn = __toESM(require_cross_spawn(), 1);
|
|
7453
7741
|
import { Buffer as Buffer3 } from "node:buffer";
|
|
7454
|
-
import
|
|
7742
|
+
import path5 from "node:path";
|
|
7455
7743
|
import childProcess from "node:child_process";
|
|
7456
7744
|
import process6 from "node:process";
|
|
7457
7745
|
|
|
@@ -7470,7 +7758,7 @@ function stripFinalNewline(input) {
|
|
|
7470
7758
|
|
|
7471
7759
|
// ../../node_modules/.pnpm/npm-run-path@5.3.0/node_modules/npm-run-path/index.js
|
|
7472
7760
|
import process2 from "node:process";
|
|
7473
|
-
import
|
|
7761
|
+
import path4 from "node:path";
|
|
7474
7762
|
import { fileURLToPath } from "node:url";
|
|
7475
7763
|
|
|
7476
7764
|
// ../../node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js
|
|
@@ -7494,7 +7782,7 @@ var npmRunPath = ({
|
|
|
7494
7782
|
addExecPath = true
|
|
7495
7783
|
} = {}) => {
|
|
7496
7784
|
const cwdString = cwd instanceof URL ? fileURLToPath(cwd) : cwd;
|
|
7497
|
-
const cwdPath =
|
|
7785
|
+
const cwdPath = path4.resolve(cwdString);
|
|
7498
7786
|
const result = [];
|
|
7499
7787
|
if (preferLocal) {
|
|
7500
7788
|
applyPreferLocal(result, cwdPath);
|
|
@@ -7502,19 +7790,19 @@ var npmRunPath = ({
|
|
|
7502
7790
|
if (addExecPath) {
|
|
7503
7791
|
applyExecPath(result, execPath, cwdPath);
|
|
7504
7792
|
}
|
|
7505
|
-
return [...result, pathOption].join(
|
|
7793
|
+
return [...result, pathOption].join(path4.delimiter);
|
|
7506
7794
|
};
|
|
7507
7795
|
var applyPreferLocal = (result, cwdPath) => {
|
|
7508
7796
|
let previous;
|
|
7509
7797
|
while (previous !== cwdPath) {
|
|
7510
|
-
result.push(
|
|
7798
|
+
result.push(path4.join(cwdPath, "node_modules/.bin"));
|
|
7511
7799
|
previous = cwdPath;
|
|
7512
|
-
cwdPath =
|
|
7800
|
+
cwdPath = path4.resolve(cwdPath, "..");
|
|
7513
7801
|
}
|
|
7514
7802
|
};
|
|
7515
7803
|
var applyExecPath = (result, execPath, cwdPath) => {
|
|
7516
7804
|
const execPathString = execPath instanceof URL ? fileURLToPath(execPath) : execPath;
|
|
7517
|
-
result.push(
|
|
7805
|
+
result.push(path4.resolve(cwdPath, execPathString, ".."));
|
|
7518
7806
|
};
|
|
7519
7807
|
var npmRunPathEnv = ({ env = process2.env, ...options } = {}) => {
|
|
7520
7808
|
env = { ...env };
|
|
@@ -8876,7 +9164,7 @@ var handleArguments = (file4, args, options = {}) => {
|
|
|
8876
9164
|
};
|
|
8877
9165
|
options.env = getEnv(options);
|
|
8878
9166
|
options.stdio = normalizeStdio(options);
|
|
8879
|
-
if (process6.platform === "win32" &&
|
|
9167
|
+
if (process6.platform === "win32" && path5.basename(file4, ".exe") === "cmd") {
|
|
8880
9168
|
args.unshift("/q");
|
|
8881
9169
|
}
|
|
8882
9170
|
return { file: file4, args, options, parsed };
|
|
@@ -9053,10 +9341,10 @@ function execaCommand(command, options) {
|
|
|
9053
9341
|
}
|
|
9054
9342
|
|
|
9055
9343
|
// src/resolvePrismaClient.ts
|
|
9056
|
-
var
|
|
9344
|
+
var debug2 = Debug2("prisma:generator");
|
|
9057
9345
|
async function resolvePrismaClient(baseDir) {
|
|
9058
9346
|
const prismaClientDir = await findPrismaClientDir(baseDir);
|
|
9059
|
-
|
|
9347
|
+
debug2("baseDir", baseDir);
|
|
9060
9348
|
if (!prismaClientDir) {
|
|
9061
9349
|
throw new Error(
|
|
9062
9350
|
`Could not resolve @prisma/client.
|
|
@@ -9069,12 +9357,12 @@ Please try to install it with ${bold(
|
|
|
9069
9357
|
}
|
|
9070
9358
|
async function resolveOrInstallPrismaClient(baseDir, version2) {
|
|
9071
9359
|
let prismaClientDir = await findPrismaClientDir(baseDir);
|
|
9072
|
-
|
|
9360
|
+
debug2("baseDir", baseDir);
|
|
9073
9361
|
if (prismaClientDir) {
|
|
9074
9362
|
return prismaClientDir;
|
|
9075
9363
|
}
|
|
9076
9364
|
let projectRoot = longestCommonPathPrefix(baseDir, process.cwd());
|
|
9077
|
-
|
|
9365
|
+
debug2("projectRoot", projectRoot);
|
|
9078
9366
|
const warningTag = `${bold("Warning:")} ${dim("[Prisma auto-install on generate]")}`;
|
|
9079
9367
|
if (projectRoot === void 0) {
|
|
9080
9368
|
console.warn(
|
|
@@ -9087,7 +9375,7 @@ async function resolveOrInstallPrismaClient(baseDir, version2) {
|
|
|
9087
9375
|
projectRoot = baseDir;
|
|
9088
9376
|
}
|
|
9089
9377
|
try {
|
|
9090
|
-
await fs2.stat(
|
|
9378
|
+
await fs2.stat(path6.join(projectRoot, "package.json"));
|
|
9091
9379
|
} catch (err) {
|
|
9092
9380
|
if (err.code === "ENOENT") {
|
|
9093
9381
|
console.warn(
|
|
@@ -9119,7 +9407,7 @@ async function resolveOrInstallPrismaClient(baseDir, version2) {
|
|
|
9119
9407
|
await runPackageCmd(projectRoot, "add", `prisma@${version2}`, "-D", "--silent");
|
|
9120
9408
|
}
|
|
9121
9409
|
await runPackageCmd(projectRoot, "add", `@prisma/client@${version2}`, "--silent");
|
|
9122
|
-
prismaClientDir = await findPrismaClientDir(
|
|
9410
|
+
prismaClientDir = await findPrismaClientDir(path6.join(".", baseDir));
|
|
9123
9411
|
if (!prismaClientDir) {
|
|
9124
9412
|
throw new Error(
|
|
9125
9413
|
`Could not resolve @prisma/client despite the installation that we just tried.
|
|
@@ -9139,11 +9427,11 @@ async function findPrismaClientDir(baseDir) {
|
|
|
9139
9427
|
const cliDir = await resolvePkg("prisma", resolveOpts);
|
|
9140
9428
|
const clientDir = await resolvePkg("@prisma/client", resolveOpts);
|
|
9141
9429
|
const resolvedClientDir = clientDir && await fs2.realpath(clientDir);
|
|
9142
|
-
|
|
9143
|
-
|
|
9430
|
+
debug2("prismaCliDir", cliDir);
|
|
9431
|
+
debug2("prismaClientDir", clientDir);
|
|
9144
9432
|
if (cliDir === void 0) return resolvedClientDir;
|
|
9145
9433
|
if (clientDir === void 0) return resolvedClientDir;
|
|
9146
|
-
const relDir =
|
|
9434
|
+
const relDir = path6.relative(cliDir, clientDir).split(path6.sep);
|
|
9147
9435
|
if (relDir[0] !== ".." || relDir[1] === "..") return void 0;
|
|
9148
9436
|
return resolvedClientDir;
|
|
9149
9437
|
}
|
|
@@ -9165,6 +9453,7 @@ async function runPackageCmd(cwd, cmd, ...args) {
|
|
|
9165
9453
|
}
|
|
9166
9454
|
|
|
9167
9455
|
// src/generator.ts
|
|
9456
|
+
var debug3 = Debug3("prisma:client:generator");
|
|
9168
9457
|
var PrismaClientJsGenerator = class {
|
|
9169
9458
|
name = "prisma-client-js";
|
|
9170
9459
|
#shouldResolvePrismaClient;
|
|
@@ -9181,12 +9470,14 @@ var PrismaClientJsGenerator = class {
|
|
|
9181
9470
|
this.#runtimePath = runtimePath;
|
|
9182
9471
|
}
|
|
9183
9472
|
async getManifest(config) {
|
|
9473
|
+
const requiresEngines = match(getClientEngineType3(config)).with(ClientEngineType4.Library, () => ["libqueryEngine"]).with(ClientEngineType4.Binary, () => ["queryEngine"]).with(ClientEngineType4.Client, () => []).exhaustive();
|
|
9474
|
+
debug3("requiresEngines", requiresEngines);
|
|
9184
9475
|
const defaultOutput = this.#shouldResolvePrismaClient ? await this.#getPrismaClientPath(config) : ".prisma/client";
|
|
9185
9476
|
return {
|
|
9186
9477
|
defaultOutput,
|
|
9187
9478
|
prettyName: "Prisma Client",
|
|
9188
9479
|
version,
|
|
9189
|
-
requiresEngines
|
|
9480
|
+
requiresEngines,
|
|
9190
9481
|
requiresEngineVersion: enginesVersion
|
|
9191
9482
|
};
|
|
9192
9483
|
}
|
|
@@ -9197,6 +9488,7 @@ var PrismaClientJsGenerator = class {
|
|
|
9197
9488
|
schemaPath: options.schemaPath,
|
|
9198
9489
|
binaryPaths: options.binaryPaths,
|
|
9199
9490
|
datasources: options.datasources,
|
|
9491
|
+
envPaths: options.envPaths,
|
|
9200
9492
|
outputDir,
|
|
9201
9493
|
copyRuntime: Boolean(options.generator.config.copyRuntime),
|
|
9202
9494
|
copyRuntimeSourceMaps: Boolean(process.env.PRISMA_COPY_RUNTIME_SOURCEMAPS),
|
|
@@ -9207,6 +9499,7 @@ var PrismaClientJsGenerator = class {
|
|
|
9207
9499
|
clientVersion: version,
|
|
9208
9500
|
activeProvider: options.datasources[0]?.activeProvider,
|
|
9209
9501
|
postinstall: options.postinstall,
|
|
9502
|
+
copyEngine: !options.noEngine,
|
|
9210
9503
|
typedSql: options.typedSql
|
|
9211
9504
|
});
|
|
9212
9505
|
}
|
|
@@ -9214,14 +9507,14 @@ var PrismaClientJsGenerator = class {
|
|
|
9214
9507
|
if (this.#cachedPrismaClientPath) {
|
|
9215
9508
|
return this.#cachedPrismaClientPath;
|
|
9216
9509
|
}
|
|
9217
|
-
this.#cachedPrismaClientPath = await this.#resolveOrInstallPrismaClient(
|
|
9510
|
+
this.#cachedPrismaClientPath = await this.#resolveOrInstallPrismaClient(path7.dirname(config.sourceFilePath));
|
|
9218
9511
|
return this.#cachedPrismaClientPath;
|
|
9219
9512
|
}
|
|
9220
9513
|
async #getRuntimePath(config) {
|
|
9221
9514
|
if (this.#runtimePath) {
|
|
9222
9515
|
return this.#runtimePath;
|
|
9223
9516
|
}
|
|
9224
|
-
this.#runtimePath =
|
|
9517
|
+
this.#runtimePath = path7.join(await this.#getPrismaClientPath(config), "runtime");
|
|
9225
9518
|
return this.#runtimePath;
|
|
9226
9519
|
}
|
|
9227
9520
|
async #resolveOrInstallPrismaClient(baseDir) {
|
|
@@ -9234,7 +9527,7 @@ var PrismaClientJsGenerator = class {
|
|
|
9234
9527
|
};
|
|
9235
9528
|
|
|
9236
9529
|
// src/utils/types/dmmfToTypes.ts
|
|
9237
|
-
import
|
|
9530
|
+
import path8 from "node:path";
|
|
9238
9531
|
function dmmfToTypes(dmmf) {
|
|
9239
9532
|
return new TSClient({
|
|
9240
9533
|
dmmf,
|
|
@@ -9244,7 +9537,7 @@ function dmmfToTypes(dmmf) {
|
|
|
9244
9537
|
runtimeBase: "@prisma/client",
|
|
9245
9538
|
runtimeNameJs: "library",
|
|
9246
9539
|
runtimeNameTs: "library",
|
|
9247
|
-
runtimeSourcePath:
|
|
9540
|
+
runtimeSourcePath: path8.join(__dirname, "../../../runtime"),
|
|
9248
9541
|
schemaPath: "",
|
|
9249
9542
|
outputDir: "",
|
|
9250
9543
|
activeProvider: "",
|
|
@@ -9262,7 +9555,11 @@ function dmmfToTypes(dmmf) {
|
|
|
9262
9555
|
datamodel: "",
|
|
9263
9556
|
browser: false,
|
|
9264
9557
|
edge: false,
|
|
9265
|
-
wasm: false
|
|
9558
|
+
wasm: false,
|
|
9559
|
+
envPaths: {
|
|
9560
|
+
rootEnvPath: null,
|
|
9561
|
+
schemaEnvPath: void 0
|
|
9562
|
+
}
|
|
9266
9563
|
}).toTS();
|
|
9267
9564
|
}
|
|
9268
9565
|
export {
|