@prisma/internals 5.23.0-dev.3 → 5.23.0-dev.31
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/{chunk-4ILHL6B6.js → chunk-2NKS77KZ.js} +5 -5
- package/dist/{chunk-INHGTPT5.js → chunk-3RTZP252.js} +14 -14
- package/dist/{chunk-BATSRJXK.js → chunk-4URKTYJN.js} +8 -8
- package/dist/{chunk-QEVSPE5U.js → chunk-4ZWQEFR7.js} +5 -5
- package/dist/{chunk-5I4BOTBV.js → chunk-5MCWLJSR.js} +3 -9
- package/dist/{chunk-7NNOHWLC.js → chunk-5YHOO7GQ.js} +837 -177
- package/dist/{chunk-IABMG3F4.js → chunk-77IC3DNO.js} +5 -5
- package/dist/{chunk-5UACJAAB.js → chunk-A4XQ4XQQ.js} +13 -13
- package/dist/{chunk-RAJSVWMK.js → chunk-BF23BTR5.js} +14 -14
- package/dist/{chunk-WMIBAVWZ.js → chunk-C47SCASR.js} +5 -5
- package/dist/{chunk-J3JE5NVO.js → chunk-CZDIXJEO.js} +56 -32
- package/dist/{chunk-U5YRV2DX.js → chunk-DLOPZF44.js} +12 -12
- package/dist/{chunk-ARF6SWJF.js → chunk-EFCETLMO.js} +61 -172
- package/dist/{chunk-LIB5PV7H.js → chunk-EJGKMYNQ.js} +5 -5
- package/dist/{chunk-OSOXVAZB.js → chunk-HPF5G47V.js} +9 -9
- package/dist/{chunk-IAEMHQAC.js → chunk-I4467NNA.js} +5 -5
- package/dist/{chunk-WJNKNGND.js → chunk-IVMOQ76O.js} +13 -13
- package/dist/{chunk-KRKPM7DP.js → chunk-JVFUHMFK.js} +5 -5
- package/dist/{chunk-4NFLAUKD.js → chunk-KQOJB3ZW.js} +70 -70
- package/dist/{chunk-3U2ANLD3.js → chunk-MGZOEY6N.js} +6 -6
- package/dist/{chunk-CSRUIX22.js → chunk-POKKMERM.js} +11 -11
- package/dist/{chunk-PK7HIANT.js → chunk-Q2A737XO.js} +7 -7
- package/dist/{chunk-ZMMFFAZY.js → chunk-QAT3BYWE.js} +5 -5
- package/dist/{chunk-4M4LPJPC.js → chunk-RRXVYT7O.js} +5 -5
- package/dist/{chunk-FTS2IEWX.js → chunk-S57RMXZW.js} +5 -5
- package/dist/{chunk-XLYQ6PQW.js → chunk-SLBBRUQS.js} +15 -15
- package/dist/{chunk-KVN73FD7.js → chunk-SW5AQHTQ.js} +11 -11
- package/dist/{chunk-ZY4F5GPM.js → chunk-TMKC3ODZ.js} +5 -5
- package/dist/{chunk-CCFQQATH.js → chunk-TUVTMPMA.js} +5 -5
- package/dist/{chunk-WCRKL55L.js → chunk-V2ZF7ETH.js} +7 -7
- package/dist/{chunk-YDZVEVUG.js → chunk-VRT7T6MF.js} +73 -73
- package/dist/{chunk-SZKPXBSP.js → chunk-WKA72AGK.js} +12 -12
- package/dist/{chunk-ZA3RMW2P.js → chunk-ZKAW5JSN.js} +5 -8
- package/dist/cli/checkUnsupportedDataProxy.js +25 -25
- package/dist/cli/getSchema.js +30 -30
- package/dist/cli/hashes.js +25 -25
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +24 -24
- package/dist/engine-commands/getConfig.js +12 -12
- package/dist/engine-commands/getDmmf.js +9 -9
- package/dist/engine-commands/index.js +33 -33
- package/dist/engine-commands/lintSchema.js +8 -8
- package/dist/engine-commands/mergeSchemas.js +9 -9
- package/dist/engine-commands/queryEngineCommons.js +6 -6
- package/dist/engine-commands/relativizePathInPSLError.js +2 -2
- package/dist/engine-commands/validate.js +9 -9
- package/dist/errorReporting.js +6 -6
- package/dist/get-generators/generatorResolvers/generatorResolvers.js +24 -24
- package/dist/get-generators/generatorResolvers/prisma-client-js/auto-installation/getPackageCmd.js +3 -3
- package/dist/get-generators/generatorResolvers/prisma-client-js/auto-installation/runPackageCmd.js +4 -4
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +24 -24
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/isYarnUsed.js +3 -3
- package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +25 -25
- package/dist/get-generators/getGenerators.js +27 -27
- package/dist/getPackedPackage.js +2 -2
- package/dist/index.js +58 -58
- package/dist/{multipart-parser-LCETWFPE.js → multipart-parser-32AROPTR.js} +9 -6
- package/dist/sendPanic.js +24 -24
- package/dist/utils/cloudflareD1.js +2 -2
- package/dist/utils/getCommandWithExecutor.js +3 -3
- package/dist/utils/getEnvPaths.js +24 -24
- package/dist/utils/getGitHubIssueUrl.js +3 -3
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/handlePanic.js +24 -24
- package/dist/utils/isCurrentBinInstalledGlobally.d.ts +1 -1
- package/dist/utils/isCurrentBinInstalledGlobally.js +2 -2
- package/dist/utils/loadEnvFile.js +24 -24
- package/dist/wasm.js +4 -4
- package/package.json +11 -11
- package/dist/chunk-2DXAGCPS.js +0 -177
- package/dist/chunk-5XRQ7ONW.js +0 -122
- package/dist/chunk-QIVUAERL.js +0 -2202
- package/dist/chunk-QJZIYUVB.js +0 -110
- package/dist/chunk-TFSZCVKC.js +0 -166
- package/dist/chunk-V2VWODV3.js +0 -54
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkYarnVersion.d.ts +0 -9
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkYarnVersion.js +0 -132
|
@@ -26,11 +26,10 @@ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__g
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS2 = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export2(
|
|
29
|
+
var chunk_EFCETLMO_exports = {};
|
|
30
|
+
__export2(chunk_EFCETLMO_exports, {
|
|
31
31
|
checkTypeScriptVersion: () => checkTypeScriptVersion,
|
|
32
32
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
|
33
|
-
checkYarnVersion: () => checkYarnVersion,
|
|
34
33
|
debug: () => debug5,
|
|
35
34
|
forbiddenCmdWithDataProxyFlagMessage: () => forbiddenCmdWithDataProxyFlagMessage,
|
|
36
35
|
formatSchema: () => formatSchema,
|
|
@@ -56,10 +55,10 @@ __export2(chunk_ARF6SWJF_exports, {
|
|
|
56
55
|
sendPanic: () => sendPanic,
|
|
57
56
|
skipIndex: () => skipIndex
|
|
58
57
|
});
|
|
59
|
-
module.exports = __toCommonJS2(
|
|
60
|
-
var
|
|
61
|
-
var
|
|
62
|
-
var
|
|
58
|
+
module.exports = __toCommonJS2(chunk_EFCETLMO_exports);
|
|
59
|
+
var import_chunk_77IC3DNO = require("./chunk-77IC3DNO.js");
|
|
60
|
+
var import_chunk_MGZOEY6N = require("./chunk-MGZOEY6N.js");
|
|
61
|
+
var import_chunk_S57RMXZW = require("./chunk-S57RMXZW.js");
|
|
63
62
|
var import_chunk_EUTJYQDW = require("./chunk-EUTJYQDW.js");
|
|
64
63
|
var import_chunk_IPKE37QC = require("./chunk-IPKE37QC.js");
|
|
65
64
|
var import_chunk_KEBDP2C3 = require("./chunk-KEBDP2C3.js");
|
|
@@ -77,26 +76,25 @@ var import_chunk_2MWIMEFK = require("./chunk-2MWIMEFK.js");
|
|
|
77
76
|
var import_chunk_L6GBFCXG = require("./chunk-L6GBFCXG.js");
|
|
78
77
|
var import_chunk_KDHESRKE = require("./chunk-KDHESRKE.js");
|
|
79
78
|
var import_chunk_J77ZIDXB = require("./chunk-J77ZIDXB.js");
|
|
80
|
-
var
|
|
79
|
+
var import_chunk_SLBBRUQS = require("./chunk-SLBBRUQS.js");
|
|
81
80
|
var import_chunk_EPJYKNCQ = require("./chunk-EPJYKNCQ.js");
|
|
82
81
|
var import_chunk_ODI3VNBD = require("./chunk-ODI3VNBD.js");
|
|
83
82
|
var import_chunk_TSJICM5S = require("./chunk-TSJICM5S.js");
|
|
84
|
-
var
|
|
85
|
-
var
|
|
86
|
-
var
|
|
87
|
-
var
|
|
83
|
+
var import_chunk_JVFUHMFK = require("./chunk-JVFUHMFK.js");
|
|
84
|
+
var import_chunk_DLOPZF44 = require("./chunk-DLOPZF44.js");
|
|
85
|
+
var import_chunk_BF23BTR5 = require("./chunk-BF23BTR5.js");
|
|
86
|
+
var import_chunk_POKKMERM = require("./chunk-POKKMERM.js");
|
|
88
87
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
|
89
88
|
var import_chunk_H3T4L34H = require("./chunk-H3T4L34H.js");
|
|
90
|
-
var
|
|
89
|
+
var import_chunk_TUVTMPMA = require("./chunk-TUVTMPMA.js");
|
|
91
90
|
var import_chunk_MUPZUVSI = require("./chunk-MUPZUVSI.js");
|
|
92
91
|
var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
|
|
93
92
|
var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
|
|
94
|
-
var import_chunk_7XNZDY2V = require("./chunk-7XNZDY2V.js");
|
|
95
93
|
var import_chunk_M3GBKLGE = require("./chunk-M3GBKLGE.js");
|
|
96
94
|
var import_chunk_635TMBAP = require("./chunk-635TMBAP.js");
|
|
97
95
|
var import_chunk_IOIAK7V7 = require("./chunk-IOIAK7V7.js");
|
|
98
|
-
var
|
|
99
|
-
var
|
|
96
|
+
var import_chunk_KQOJB3ZW = require("./chunk-KQOJB3ZW.js");
|
|
97
|
+
var import_chunk_CZDIXJEO = require("./chunk-CZDIXJEO.js");
|
|
100
98
|
var import_chunk_FUUQ6FJ4 = require("./chunk-FUUQ6FJ4.js");
|
|
101
99
|
var import_chunk_KKMREGHN = require("./chunk-KKMREGHN.js");
|
|
102
100
|
var import_chunk_AZNLB67U = require("./chunk-AZNLB67U.js");
|
|
@@ -440,7 +438,7 @@ var require_readdir_glob = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
440
438
|
module2.exports = readdirGlob;
|
|
441
439
|
var fs8 = (0, import_chunk_WWAWV7DQ.__require)("fs");
|
|
442
440
|
var { EventEmitter } = (0, import_chunk_WWAWV7DQ.__require)("events");
|
|
443
|
-
var { Minimatch } = (0,
|
|
441
|
+
var { Minimatch } = (0, import_chunk_CZDIXJEO.require_minimatch)();
|
|
444
442
|
var { resolve } = (0, import_chunk_WWAWV7DQ.__require)("path");
|
|
445
443
|
function readdir(dir2, strict) {
|
|
446
444
|
return new Promise((resolve2, reject2) => {
|
|
@@ -455,12 +453,16 @@ var require_readdir_glob = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
455
453
|
}
|
|
456
454
|
break;
|
|
457
455
|
case "ENOTSUP":
|
|
456
|
+
// Operation not supported
|
|
458
457
|
case "ENOENT":
|
|
458
|
+
// No such file or directory
|
|
459
459
|
case "ENAMETOOLONG":
|
|
460
|
+
// Filename too long
|
|
460
461
|
case "UNKNOWN":
|
|
461
462
|
resolve2([]);
|
|
462
463
|
break;
|
|
463
464
|
case "ELOOP":
|
|
465
|
+
// Too many levels of symbolic links
|
|
464
466
|
default:
|
|
465
467
|
reject2(err);
|
|
466
468
|
break;
|
|
@@ -3619,7 +3621,7 @@ var require_stream_writable = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
3619
3621
|
var Duplex;
|
|
3620
3622
|
Writable.WritableState = WritableState;
|
|
3621
3623
|
var util = Object.create(require_util());
|
|
3622
|
-
util.inherits = (0,
|
|
3624
|
+
util.inherits = (0, import_chunk_CZDIXJEO.require_inherits)();
|
|
3623
3625
|
var internalUtil = {
|
|
3624
3626
|
deprecate: require_node()
|
|
3625
3627
|
};
|
|
@@ -4057,7 +4059,7 @@ var require_stream_duplex = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
4057
4059
|
};
|
|
4058
4060
|
module2.exports = Duplex;
|
|
4059
4061
|
var util = Object.create(require_util());
|
|
4060
|
-
util.inherits = (0,
|
|
4062
|
+
util.inherits = (0, import_chunk_CZDIXJEO.require_inherits)();
|
|
4061
4063
|
var Readable = require_stream_readable();
|
|
4062
4064
|
var Writable = require_stream_writable();
|
|
4063
4065
|
util.inherits(Duplex, Readable);
|
|
@@ -4378,7 +4380,7 @@ var require_stream_readable = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
4378
4380
|
return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
|
|
4379
4381
|
}
|
|
4380
4382
|
var util = Object.create(require_util());
|
|
4381
|
-
util.inherits = (0,
|
|
4383
|
+
util.inherits = (0, import_chunk_CZDIXJEO.require_inherits)();
|
|
4382
4384
|
var debugUtil = (0, import_chunk_WWAWV7DQ.__require)("util");
|
|
4383
4385
|
var debug8 = void 0;
|
|
4384
4386
|
if (debugUtil && debugUtil.debuglog) {
|
|
@@ -5045,7 +5047,7 @@ var require_stream_transform = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
5045
5047
|
module2.exports = Transform;
|
|
5046
5048
|
var Duplex = require_stream_duplex();
|
|
5047
5049
|
var util = Object.create(require_util());
|
|
5048
|
-
util.inherits = (0,
|
|
5050
|
+
util.inherits = (0, import_chunk_CZDIXJEO.require_inherits)();
|
|
5049
5051
|
util.inherits(Transform, Duplex);
|
|
5050
5052
|
function afterTransform(er, data) {
|
|
5051
5053
|
var ts = this._transformState;
|
|
@@ -5143,7 +5145,7 @@ var require_stream_passthrough = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
5143
5145
|
module2.exports = PassThrough;
|
|
5144
5146
|
var Transform = require_stream_transform();
|
|
5145
5147
|
var util = Object.create(require_util());
|
|
5146
|
-
util.inherits = (0,
|
|
5148
|
+
util.inherits = (0, import_chunk_CZDIXJEO.require_inherits)();
|
|
5147
5149
|
util.inherits(PassThrough, Transform);
|
|
5148
5150
|
function PassThrough(options2) {
|
|
5149
5151
|
if (!(this instanceof PassThrough)) return new PassThrough(options2);
|
|
@@ -6429,7 +6431,7 @@ var require_stream_writable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
6429
6431
|
var ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END;
|
|
6430
6432
|
var ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING;
|
|
6431
6433
|
var errorOrDestroy = destroyImpl.errorOrDestroy;
|
|
6432
|
-
(0,
|
|
6434
|
+
(0, import_chunk_CZDIXJEO.require_inherits)()(Writable, Stream);
|
|
6433
6435
|
function nop() {
|
|
6434
6436
|
}
|
|
6435
6437
|
function WritableState(options2, stream, isDuplex) {
|
|
@@ -6871,7 +6873,7 @@ var require_stream_duplex2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
6871
6873
|
module2.exports = Duplex;
|
|
6872
6874
|
var Readable = require_stream_readable2();
|
|
6873
6875
|
var Writable = require_stream_writable2();
|
|
6874
|
-
(0,
|
|
6876
|
+
(0, import_chunk_CZDIXJEO.require_inherits)()(Duplex, Readable);
|
|
6875
6877
|
{
|
|
6876
6878
|
keys = objectKeys(Writable.prototype);
|
|
6877
6879
|
for (v = 0; v < keys.length; v++) {
|
|
@@ -7648,7 +7650,7 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
7648
7650
|
var StringDecoder;
|
|
7649
7651
|
var createReadableStreamAsyncIterator;
|
|
7650
7652
|
var from;
|
|
7651
|
-
(0,
|
|
7653
|
+
(0, import_chunk_CZDIXJEO.require_inherits)()(Readable, Stream);
|
|
7652
7654
|
var errorOrDestroy = destroyImpl.errorOrDestroy;
|
|
7653
7655
|
var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
|
|
7654
7656
|
function prependListener(emitter, event, fn) {
|
|
@@ -8353,7 +8355,7 @@ var require_stream_transform2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
8353
8355
|
var ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING;
|
|
8354
8356
|
var ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0;
|
|
8355
8357
|
var Duplex = require_stream_duplex2();
|
|
8356
|
-
(0,
|
|
8358
|
+
(0, import_chunk_CZDIXJEO.require_inherits)()(Transform, Duplex);
|
|
8357
8359
|
function afterTransform(er, data) {
|
|
8358
8360
|
var ts = this._transformState;
|
|
8359
8361
|
ts.transforming = false;
|
|
@@ -8447,7 +8449,7 @@ var require_stream_passthrough2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
8447
8449
|
"use strict";
|
|
8448
8450
|
module2.exports = PassThrough;
|
|
8449
8451
|
var Transform = require_stream_transform2();
|
|
8450
|
-
(0,
|
|
8452
|
+
(0, import_chunk_CZDIXJEO.require_inherits)()(PassThrough, Transform);
|
|
8451
8453
|
function PassThrough(options2) {
|
|
8452
8454
|
if (!(this instanceof PassThrough)) return new PassThrough(options2);
|
|
8453
8455
|
Transform.call(this, options2);
|
|
@@ -9321,7 +9323,7 @@ var require_file = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
9321
9323
|
var difference = require_difference();
|
|
9322
9324
|
var union = require_union();
|
|
9323
9325
|
var isPlainObject = require_isPlainObject();
|
|
9324
|
-
var glob = (0,
|
|
9326
|
+
var glob = (0, import_chunk_CZDIXJEO.require_glob)();
|
|
9325
9327
|
var file = module2.exports = {};
|
|
9326
9328
|
var pathSeparatorRe = /[\/\\]/g;
|
|
9327
9329
|
var processPatterns = function(patterns, fn) {
|
|
@@ -14571,6 +14573,8 @@ var require_dist = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14571
14573
|
this.inc("patch", identifier, identifierBase);
|
|
14572
14574
|
this.inc("pre", identifier, identifierBase);
|
|
14573
14575
|
break;
|
|
14576
|
+
// If the input is a non-prerelease version, this acts the same as
|
|
14577
|
+
// prepatch.
|
|
14574
14578
|
case "prerelease":
|
|
14575
14579
|
if (this.prerelease.length === 0) {
|
|
14576
14580
|
this.inc("patch", identifier, identifierBase);
|
|
@@ -14598,6 +14602,8 @@ var require_dist = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
14598
14602
|
}
|
|
14599
14603
|
this.prerelease = [];
|
|
14600
14604
|
break;
|
|
14605
|
+
// This probably shouldn't be used publicly.
|
|
14606
|
+
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
14601
14607
|
case "pre": {
|
|
14602
14608
|
const base = Number(identifierBase) ? 1 : 0;
|
|
14603
14609
|
if (!identifier && identifierBase === false) {
|
|
@@ -15478,7 +15484,6 @@ var require_tmp = (0, import_chunk_WWAWV7DQ.__commonJS)({
|
|
|
15478
15484
|
}
|
|
15479
15485
|
});
|
|
15480
15486
|
var import_find_up = (0, import_chunk_WWAWV7DQ.__toESM)(require_find_up());
|
|
15481
|
-
var import_execa = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_7XNZDY2V.require_execa)());
|
|
15482
15487
|
var readFile = (0, import_util.promisify)(import_fs3.default.readFile);
|
|
15483
15488
|
var stat = (0, import_util.promisify)(import_fs3.default.stat);
|
|
15484
15489
|
var debug2 = (0, import_debug3.Debug)("prisma:getSchema");
|
|
@@ -15517,7 +15522,7 @@ async function readSchemaFromDirectory(schemaPath2) {
|
|
|
15517
15522
|
}
|
|
15518
15523
|
const files = await (0, import_schema_files_loader.loadSchemaFiles)(schemaPath2);
|
|
15519
15524
|
debug2("Loading config");
|
|
15520
|
-
const config2 = await (0,
|
|
15525
|
+
const config2 = await (0, import_chunk_BF23BTR5.getConfig)({
|
|
15521
15526
|
datamodel: files,
|
|
15522
15527
|
ignoreEnvVarErrors: true
|
|
15523
15528
|
});
|
|
@@ -15584,14 +15589,9 @@ async function getSchemaWithPathInternal(schemaPathFromArgs, { cwd, argumentName
|
|
|
15584
15589
|
if (defaultResult.ok) {
|
|
15585
15590
|
return defaultResult;
|
|
15586
15591
|
}
|
|
15587
|
-
const yarnResult = await getSchemaFromYarn1Workspace(cwd, defaultResult.error.failures);
|
|
15588
|
-
if (yarnResult.ok) {
|
|
15589
|
-
return yarnResult;
|
|
15590
|
-
}
|
|
15591
|
-
const finalError = yarnResult.error.kind === "Yarn1WorkspaceSchemaNotFound" ? defaultResult.error : yarnResult.error;
|
|
15592
15592
|
return {
|
|
15593
15593
|
ok: false,
|
|
15594
|
-
error:
|
|
15594
|
+
error: defaultResult.error
|
|
15595
15595
|
};
|
|
15596
15596
|
}
|
|
15597
15597
|
function renderLookupError(error) {
|
|
@@ -15626,7 +15626,7 @@ function renderDefaultLookupError(error, cwd) {
|
|
|
15626
15626
|
return parts.join("\n");
|
|
15627
15627
|
}
|
|
15628
15628
|
async function getPrismaConfigFromPackageJson(cwd) {
|
|
15629
|
-
const pkgJson = await (0,
|
|
15629
|
+
const pkgJson = await (0, import_chunk_CZDIXJEO.readPackageUp)({ cwd, normalize: false });
|
|
15630
15630
|
const prismaPropertyFromPkgJson = pkgJson?.packageJson?.prisma;
|
|
15631
15631
|
if (!pkgJson) {
|
|
15632
15632
|
return null;
|
|
@@ -15666,47 +15666,6 @@ async function getSchemaFromPackageJson(cwd) {
|
|
|
15666
15666
|
}
|
|
15667
15667
|
return lookupResult;
|
|
15668
15668
|
}
|
|
15669
|
-
async function getSchemaFromYarn1Workspace(cwd, pastFailures) {
|
|
15670
|
-
if (!process.env.npm_config_user_agent?.includes("yarn")) {
|
|
15671
|
-
return { ok: false, error: { kind: "Yarn1WorkspaceSchemaNotFound" } };
|
|
15672
|
-
}
|
|
15673
|
-
let workspaces;
|
|
15674
|
-
try {
|
|
15675
|
-
const { stdout: version3 } = await import_execa.default.command("yarn --version", {
|
|
15676
|
-
cwd
|
|
15677
|
-
});
|
|
15678
|
-
if (version3.startsWith("2")) {
|
|
15679
|
-
return { ok: false, error: { kind: "Yarn1WorkspaceSchemaNotFound" } };
|
|
15680
|
-
}
|
|
15681
|
-
const { stdout } = await import_execa.default.command("yarn workspaces info --json", {
|
|
15682
|
-
cwd
|
|
15683
|
-
});
|
|
15684
|
-
const json = getJson(stdout);
|
|
15685
|
-
workspaces = Object.values(json);
|
|
15686
|
-
} catch {
|
|
15687
|
-
return { ok: false, error: { kind: "Yarn1WorkspaceSchemaNotFound" } };
|
|
15688
|
-
}
|
|
15689
|
-
const workspaceRootDir = await findWorkspaceRoot(cwd);
|
|
15690
|
-
if (!workspaceRootDir) {
|
|
15691
|
-
return { ok: false, error: { kind: "Yarn1WorkspaceSchemaNotFound" } };
|
|
15692
|
-
}
|
|
15693
|
-
for (const workspace of workspaces) {
|
|
15694
|
-
const workspacePath = import_path2.default.join(workspaceRootDir, workspace.location);
|
|
15695
|
-
const workspaceSchema = await tryWorkspacePath(workspacePath, pastFailures);
|
|
15696
|
-
if (workspaceSchema.ok) {
|
|
15697
|
-
return workspaceSchema;
|
|
15698
|
-
}
|
|
15699
|
-
}
|
|
15700
|
-
const rootPathSchema = await tryWorkspacePath(workspaceRootDir, pastFailures);
|
|
15701
|
-
return rootPathSchema;
|
|
15702
|
-
}
|
|
15703
|
-
async function tryWorkspacePath(cwd, pastFailures) {
|
|
15704
|
-
const pkgJson = await getSchemaFromPackageJson(cwd);
|
|
15705
|
-
if (pkgJson.ok) {
|
|
15706
|
-
return pkgJson;
|
|
15707
|
-
}
|
|
15708
|
-
return getDefaultSchema(cwd, pastFailures);
|
|
15709
|
-
}
|
|
15710
15669
|
async function getDefaultSchema(cwd, failures = []) {
|
|
15711
15670
|
const schemaPrisma = {
|
|
15712
15671
|
schemaPath: {
|
|
@@ -15785,44 +15744,6 @@ async function getSchema(schemaPathFromArgs) {
|
|
|
15785
15744
|
const schemaPathResult = await getSchemaWithPath(schemaPathFromArgs);
|
|
15786
15745
|
return schemaPathResult.schemas;
|
|
15787
15746
|
}
|
|
15788
|
-
function getJson(stdout) {
|
|
15789
|
-
const firstCurly = stdout.indexOf("{");
|
|
15790
|
-
const lastCurly = stdout.lastIndexOf("}");
|
|
15791
|
-
const sliced = stdout.slice(firstCurly, lastCurly + 1);
|
|
15792
|
-
return JSON.parse(sliced);
|
|
15793
|
-
}
|
|
15794
|
-
function isPkgJsonWorkspaceRoot(pkgJson) {
|
|
15795
|
-
const workspaces = pkgJson.workspaces;
|
|
15796
|
-
if (!workspaces) {
|
|
15797
|
-
return false;
|
|
15798
|
-
}
|
|
15799
|
-
return Array.isArray(workspaces) || workspaces.packages !== void 0;
|
|
15800
|
-
}
|
|
15801
|
-
async function isNearestPkgJsonWorkspaceRoot(cwd) {
|
|
15802
|
-
const pkgJson = await (0, import_chunk_J3JE5NVO.readPackageUp)({ cwd, normalize: false });
|
|
15803
|
-
if (!pkgJson) {
|
|
15804
|
-
return null;
|
|
15805
|
-
}
|
|
15806
|
-
return {
|
|
15807
|
-
isRoot: isPkgJsonWorkspaceRoot(pkgJson.packageJson),
|
|
15808
|
-
path: pkgJson.path
|
|
15809
|
-
};
|
|
15810
|
-
}
|
|
15811
|
-
async function findWorkspaceRoot(cwd) {
|
|
15812
|
-
let pkgJson = await isNearestPkgJsonWorkspaceRoot(cwd);
|
|
15813
|
-
if (!pkgJson) {
|
|
15814
|
-
return null;
|
|
15815
|
-
}
|
|
15816
|
-
if (pkgJson.isRoot === true) {
|
|
15817
|
-
return import_path2.default.dirname(pkgJson.path);
|
|
15818
|
-
}
|
|
15819
|
-
const pkgJsonParentDir = import_path2.default.dirname(import_path2.default.dirname(pkgJson.path));
|
|
15820
|
-
pkgJson = await isNearestPkgJsonWorkspaceRoot(pkgJsonParentDir);
|
|
15821
|
-
if (!pkgJson || pkgJson.isRoot === false) {
|
|
15822
|
-
return null;
|
|
15823
|
-
}
|
|
15824
|
-
return import_path2.default.dirname(pkgJson.path);
|
|
15825
|
-
}
|
|
15826
15747
|
var debug3 = (0, import_debug2.default)("prisma:loadEnv");
|
|
15827
15748
|
async function getEnvPaths(schemaPath2, opts = { cwd: process.cwd() }) {
|
|
15828
15749
|
const rootEnvPath = getProjectRootEnvPath({ cwd: opts.cwd }) ?? null;
|
|
@@ -15909,8 +15830,8 @@ async function checkUnsupportedDataProxyMessage(command, args, implicitSchema) {
|
|
|
15909
15830
|
if (argName.includes("schema")) {
|
|
15910
15831
|
await loadEnvFile({ schemaPath: argValue, printMessage: false });
|
|
15911
15832
|
const datamodel = await import_fs.default.promises.readFile(argValue, "utf-8");
|
|
15912
|
-
const config2 = await (0,
|
|
15913
|
-
const url = (0,
|
|
15833
|
+
const config2 = await (0, import_chunk_BF23BTR5.getConfig)({ datamodel, ignoreEnvVarErrors: true });
|
|
15834
|
+
const url = (0, import_chunk_BF23BTR5.resolveUrl)((0, import_chunk_BF23BTR5.getEffectiveUrl)(config2.datasources[0]));
|
|
15914
15835
|
if (url?.startsWith("prisma://")) {
|
|
15915
15836
|
return forbiddenCmdWithDataProxyFlagMessage(command);
|
|
15916
15837
|
}
|
|
@@ -15931,7 +15852,7 @@ function getCLIPathHash() {
|
|
|
15931
15852
|
const cliPath = process.argv[1];
|
|
15932
15853
|
return import_crypto.default.createHash("sha256").update(cliPath).digest("hex").substring(0, 8);
|
|
15933
15854
|
}
|
|
15934
|
-
var import_p_map = (0, import_chunk_WWAWV7DQ.__toESM)((0,
|
|
15855
|
+
var import_p_map = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_CZDIXJEO.require_p_map)());
|
|
15935
15856
|
var debug4 = (0, import_debug6.default)("prisma:generator");
|
|
15936
15857
|
async function checkTypeScriptVersion() {
|
|
15937
15858
|
const minVersion = "4.1.0";
|
|
@@ -15957,42 +15878,10 @@ async function checkTypeScriptVersion() {
|
|
|
15957
15878
|
} catch (e) {
|
|
15958
15879
|
}
|
|
15959
15880
|
}
|
|
15960
|
-
function checkYarnVersion() {
|
|
15961
|
-
if (process.env.npm_config_user_agent) {
|
|
15962
|
-
const match = parseUserAgentString(process.env.npm_config_user_agent);
|
|
15963
|
-
if (match) {
|
|
15964
|
-
const { agent, major, minor, patch } = match;
|
|
15965
|
-
if (agent === "yarn" && major === 1) {
|
|
15966
|
-
const currentYarnVersion = `${major}.${minor}.${patch}`;
|
|
15967
|
-
const minYarnVersion = "1.19.2";
|
|
15968
|
-
if ((0, import_chunk_EUTJYQDW.semverLt)(currentYarnVersion, minYarnVersion)) {
|
|
15969
|
-
import_chunk_AZNLB67U.logger_exports.warn(
|
|
15970
|
-
`Your ${(0, import_chunk_PG5FDKSF.bold)("yarn")} has version ${currentYarnVersion}, which is outdated. Please update it to ${(0, import_chunk_PG5FDKSF.bold)(
|
|
15971
|
-
minYarnVersion
|
|
15972
|
-
)} or ${(0, import_chunk_PG5FDKSF.bold)("newer")} in order to use Prisma.`
|
|
15973
|
-
);
|
|
15974
|
-
}
|
|
15975
|
-
}
|
|
15976
|
-
}
|
|
15977
|
-
}
|
|
15978
|
-
}
|
|
15979
|
-
function parseUserAgentString(str) {
|
|
15980
|
-
const userAgentRegex = /(\w+)\/(\d+)\.(\d+)\.(\d+)/;
|
|
15981
|
-
const match = userAgentRegex.exec(str);
|
|
15982
|
-
if (match) {
|
|
15983
|
-
const agent = match[1];
|
|
15984
|
-
const major = parseInt(match[2]);
|
|
15985
|
-
const minor = parseInt(match[3]);
|
|
15986
|
-
const patch = parseInt(match[4]);
|
|
15987
|
-
return { agent, major, minor, patch };
|
|
15988
|
-
}
|
|
15989
|
-
return null;
|
|
15990
|
-
}
|
|
15991
15881
|
var debug5 = (0, import_debug5.default)("prisma:generator");
|
|
15992
15882
|
async function prismaClientResolver(baseDir, version3) {
|
|
15993
15883
|
let prismaClientDir = await (0, import_chunk_KEBDP2C3.findPrismaClientDir)(baseDir);
|
|
15994
15884
|
debug5("baseDir", baseDir);
|
|
15995
|
-
checkYarnVersion();
|
|
15996
15885
|
await checkTypeScriptVersion();
|
|
15997
15886
|
if (!prismaClientDir && !process.env.PRISMA_GENERATE_SKIP_AUTOINSTALL) {
|
|
15998
15887
|
let projectRoot = (0, import_chunk_J77ZIDXB.longestCommonPathPrefix)(baseDir, process.cwd());
|
|
@@ -16018,30 +15907,30 @@ async function prismaClientResolver(baseDir, version3) {
|
|
|
16018
15907
|
);
|
|
16019
15908
|
}
|
|
16020
15909
|
const prismaCliDir = await (0, import_chunk_FUUQ6FJ4.resolvePkg)("prisma", { basedir: baseDir });
|
|
16021
|
-
if (process.platform === "win32" && await (0,
|
|
15910
|
+
if (process.platform === "win32" && await (0, import_chunk_S57RMXZW.isYarnUsed)(baseDir)) {
|
|
16022
15911
|
const hasCli = (s2) => prismaCliDir !== void 0 ? s2 : "";
|
|
16023
15912
|
const missingCli = (s2) => prismaCliDir === void 0 ? s2 : "";
|
|
16024
15913
|
throw new Error(
|
|
16025
15914
|
`Could not resolve ${missingCli(`${(0, import_chunk_PG5FDKSF.bold)("prisma")} and `)}${(0, import_chunk_PG5FDKSF.bold)(
|
|
16026
15915
|
"@prisma/client"
|
|
16027
15916
|
)} in the current project. Please install ${hasCli("it")}${missingCli("them")} with ${missingCli(
|
|
16028
|
-
`${(0, import_chunk_PG5FDKSF.bold)((0, import_chunk_PG5FDKSF.green)(`${await (0,
|
|
16029
|
-
)}${(0, import_chunk_PG5FDKSF.bold)((0, import_chunk_PG5FDKSF.green)(`${await (0,
|
|
16030
|
-
await (0,
|
|
15917
|
+
`${(0, import_chunk_PG5FDKSF.bold)((0, import_chunk_PG5FDKSF.green)(`${await (0, import_chunk_MGZOEY6N.getPackageCmd)(baseDir, "add", "prisma", "-D")}`))} and `
|
|
15918
|
+
)}${(0, import_chunk_PG5FDKSF.bold)((0, import_chunk_PG5FDKSF.green)(`${await (0, import_chunk_MGZOEY6N.getPackageCmd)(baseDir, "add", "@prisma/client")}`))}, and rerun ${(0, import_chunk_PG5FDKSF.bold)(
|
|
15919
|
+
await (0, import_chunk_MGZOEY6N.getPackageCmd)(baseDir, "execute", "prisma generate")
|
|
16031
15920
|
)} \u{1F64F}.`
|
|
16032
15921
|
);
|
|
16033
15922
|
}
|
|
16034
15923
|
if (!prismaCliDir) {
|
|
16035
|
-
await (0,
|
|
15924
|
+
await (0, import_chunk_77IC3DNO.runPackageCmd)(projectRoot, "add", `prisma@${version3 ?? "latest"}`, "-D", "--silent");
|
|
16036
15925
|
}
|
|
16037
|
-
await (0,
|
|
15926
|
+
await (0, import_chunk_77IC3DNO.runPackageCmd)(projectRoot, "add", `@prisma/client@${version3 ?? "latest"}`, "--silent");
|
|
16038
15927
|
prismaClientDir = await (0, import_chunk_KEBDP2C3.findPrismaClientDir)(import_path4.default.join(".", baseDir));
|
|
16039
15928
|
if (!prismaClientDir) {
|
|
16040
15929
|
throw new Error(
|
|
16041
15930
|
`Could not resolve @prisma/client despite the installation that we just tried.
|
|
16042
15931
|
Please try to install it by hand with ${(0, import_chunk_PG5FDKSF.bold)(
|
|
16043
|
-
(0, import_chunk_PG5FDKSF.green)(`${await (0,
|
|
16044
|
-
)} and rerun ${(0, import_chunk_PG5FDKSF.bold)(await (0,
|
|
15932
|
+
(0, import_chunk_PG5FDKSF.green)(`${await (0, import_chunk_MGZOEY6N.getPackageCmd)(baseDir, "add", "@prisma/client")}`)
|
|
15933
|
+
)} and rerun ${(0, import_chunk_PG5FDKSF.bold)(await (0, import_chunk_MGZOEY6N.getPackageCmd)(baseDir, "execute", "prisma generate"))} \u{1F64F}.`
|
|
16045
15934
|
);
|
|
16046
15935
|
}
|
|
16047
15936
|
console.info(
|
|
@@ -16053,7 +15942,7 @@ Please try to install it by hand with ${(0, import_chunk_PG5FDKSF.bold)(
|
|
|
16053
15942
|
throw new Error(
|
|
16054
15943
|
`Could not resolve @prisma/client.
|
|
16055
15944
|
Please try to install it with ${(0, import_chunk_PG5FDKSF.bold)((0, import_chunk_PG5FDKSF.green)("npm install @prisma/client"))} and rerun ${(0, import_chunk_PG5FDKSF.bold)(
|
|
16056
|
-
await (0,
|
|
15945
|
+
await (0, import_chunk_MGZOEY6N.getPackageCmd)(baseDir, "execute", "prisma generate")
|
|
16057
15946
|
)} \u{1F64F}.`
|
|
16058
15947
|
);
|
|
16059
15948
|
}
|
|
@@ -16114,7 +16003,7 @@ async function getGenerators(options) {
|
|
|
16114
16003
|
prismaPath = binaryPathsWithEngineType[queryEngineBinaryType][binaryTarget];
|
|
16115
16004
|
}
|
|
16116
16005
|
}
|
|
16117
|
-
const config = await (0,
|
|
16006
|
+
const config = await (0, import_chunk_BF23BTR5.getConfig)({
|
|
16118
16007
|
datamodel: schemas,
|
|
16119
16008
|
datamodelPath: schemaPath,
|
|
16120
16009
|
prismaPath,
|
|
@@ -16125,7 +16014,7 @@ async function getGenerators(options) {
|
|
|
16125
16014
|
}
|
|
16126
16015
|
(0, import_chunk_5FJ3MENK.printConfigWarnings)(config.warnings);
|
|
16127
16016
|
const previewFeatures = (0, import_chunk_TSJICM5S.extractPreviewFeatures)(config);
|
|
16128
|
-
const dmmf = await (0,
|
|
16017
|
+
const dmmf = await (0, import_chunk_POKKMERM.getDMMF)({
|
|
16129
16018
|
datamodel: schemas,
|
|
16130
16019
|
datamodelPath: schemaPath,
|
|
16131
16020
|
prismaPath,
|
|
@@ -16186,7 +16075,7 @@ The generator needs to either define the \`defaultOutput\` path in the manifest
|
|
|
16186
16075
|
fromEnvVar: "null"
|
|
16187
16076
|
};
|
|
16188
16077
|
}
|
|
16189
|
-
const datamodel = (0,
|
|
16078
|
+
const datamodel = (0, import_chunk_DLOPZF44.mergeSchemas)({ schemas });
|
|
16190
16079
|
const envPaths2 = await getEnvPaths(schemaPath, { cwd: generator.output.value });
|
|
16191
16080
|
const options2 = {
|
|
16192
16081
|
datamodel,
|
|
@@ -16269,7 +16158,7 @@ generator gen {
|
|
|
16269
16158
|
debug6({ generatorBinaryPaths });
|
|
16270
16159
|
generator.setBinaryPaths(generatorBinaryPaths);
|
|
16271
16160
|
if (engineVersion !== version && generator.options && generator.manifest.requiresEngines.includes(queryEngineType) && generatorBinaryPaths[queryEngineType] && generatorBinaryPaths[queryEngineType]?.[binaryTarget]) {
|
|
16272
|
-
const customDmmf = await (0,
|
|
16161
|
+
const customDmmf = await (0, import_chunk_POKKMERM.getDMMF)({
|
|
16273
16162
|
datamodel: schemas,
|
|
16274
16163
|
datamodelPath: schemaPath,
|
|
16275
16164
|
prismaPath: generatorBinaryPaths[queryEngineType]?.[binaryTarget],
|
|
@@ -16437,16 +16326,16 @@ async function sendPanic({
|
|
|
16437
16326
|
sqlDump: void 0,
|
|
16438
16327
|
dbVersion
|
|
16439
16328
|
};
|
|
16440
|
-
const signedUrl = await (0,
|
|
16329
|
+
const signedUrl = await (0, import_chunk_KQOJB3ZW.createErrorReport)(params);
|
|
16441
16330
|
try {
|
|
16442
16331
|
if (error.schemaPath) {
|
|
16443
16332
|
const zip = await makeErrorZip(error);
|
|
16444
|
-
await (0,
|
|
16333
|
+
await (0, import_chunk_KQOJB3ZW.uploadZip)(zip, signedUrl);
|
|
16445
16334
|
}
|
|
16446
16335
|
} catch (zipUploadError) {
|
|
16447
16336
|
console.error(`Error uploading zip file: ${zipUploadError.message}`);
|
|
16448
16337
|
}
|
|
16449
|
-
const id = await (0,
|
|
16338
|
+
const id = await (0, import_chunk_KQOJB3ZW.makeErrorReportCompleted)(signedUrl);
|
|
16450
16339
|
return id;
|
|
16451
16340
|
}
|
|
16452
16341
|
function concatSchemaForReport(schemaFiles) {
|
|
@@ -16553,7 +16442,7 @@ ${(0, import_chunk_PG5FDKSF.bold)("Thanks a lot for your help! \u{1F64F}")}`);
|
|
|
16553
16442
|
console.error(`${(0, import_chunk_PG5FDKSF.gray)("Error report submission failed due to: ")}`, error2);
|
|
16554
16443
|
}
|
|
16555
16444
|
}
|
|
16556
|
-
await (0,
|
|
16445
|
+
await (0, import_chunk_SLBBRUQS.wouldYouLikeToCreateANewIssue)({
|
|
16557
16446
|
prompt: !shouldSubmitReport,
|
|
16558
16447
|
error,
|
|
16559
16448
|
cliVersion: cliVersion2,
|
|
@@ -16567,7 +16456,7 @@ async function formatSchema({ schemas: schemas2 }, inputFormattingOptions) {
|
|
|
16567
16456
|
if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
|
|
16568
16457
|
handleFormatPanic(
|
|
16569
16458
|
() => {
|
|
16570
|
-
|
|
16459
|
+
import_chunk_TUVTMPMA.prismaSchemaWasm.debug_panic();
|
|
16571
16460
|
},
|
|
16572
16461
|
{ schemas: schemas2 }
|
|
16573
16462
|
);
|
|
@@ -16587,12 +16476,12 @@ async function formatSchema({ schemas: schemas2 }, inputFormattingOptions) {
|
|
|
16587
16476
|
() => {
|
|
16588
16477
|
const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas2), documentFormattingParams);
|
|
16589
16478
|
const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
|
|
16590
|
-
const lintDiagnostics2 = (0,
|
|
16479
|
+
const lintDiagnostics2 = (0, import_chunk_JVFUHMFK.lintSchema)({ schemas: formattedMultipleSchemas2 });
|
|
16591
16480
|
return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
|
|
16592
16481
|
},
|
|
16593
16482
|
{ schemas: schemas2 }
|
|
16594
16483
|
);
|
|
16595
|
-
const lintWarnings = (0,
|
|
16484
|
+
const lintWarnings = (0, import_chunk_JVFUHMFK.getLintWarningsAsText)(lintDiagnostics);
|
|
16596
16485
|
if (lintWarnings && import_chunk_AZNLB67U.logger_exports.should.warn()) {
|
|
16597
16486
|
console.warn(lintWarnings);
|
|
16598
16487
|
}
|
|
@@ -16622,7 +16511,7 @@ function handleFormatPanic(tryCb, { schemas: schemas2 }) {
|
|
|
16622
16511
|
}
|
|
16623
16512
|
}
|
|
16624
16513
|
function formatWasm(schema, documentFormattingParams) {
|
|
16625
|
-
const formattedSchema =
|
|
16514
|
+
const formattedSchema = import_chunk_TUVTMPMA.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
|
|
16626
16515
|
return formattedSchema;
|
|
16627
16516
|
}
|
|
16628
16517
|
/*! Bundled license information:
|
|
@@ -16,15 +16,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_EJGKMYNQ_exports = {};
|
|
20
|
+
__export(chunk_EJGKMYNQ_exports, {
|
|
21
21
|
addVersionDetailsToErrorMessage: () => addVersionDetailsToErrorMessage
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(chunk_EJGKMYNQ_exports);
|
|
24
|
+
var import_chunk_QAT3BYWE = require("./chunk-QAT3BYWE.js");
|
|
25
25
|
var import_chunk_QN6PSQY7 = require("./chunk-QN6PSQY7.js");
|
|
26
26
|
function addVersionDetailsToErrorMessage(message) {
|
|
27
|
-
const rows = [["Prisma CLI Version",
|
|
27
|
+
const rows = [["Prisma CLI Version", import_chunk_QAT3BYWE.version]];
|
|
28
28
|
return `${message}
|
|
29
29
|
|
|
30
30
|
${(0, import_chunk_QN6PSQY7.formatTable)(rows)}`;
|
|
@@ -26,24 +26,24 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_HPF5G47V_exports = {};
|
|
30
|
+
__export(chunk_HPF5G47V_exports, {
|
|
31
31
|
locateLocalCloudflareD1: () => locateLocalCloudflareD1
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_HPF5G47V_exports);
|
|
34
34
|
var import_chunk_H3T4L34H = require("./chunk-H3T4L34H.js");
|
|
35
35
|
var import_chunk_KKMREGHN = require("./chunk-KKMREGHN.js");
|
|
36
36
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
|
37
|
-
var
|
|
38
|
-
var
|
|
37
|
+
var import_node_path = __toESM(require("node:path"));
|
|
38
|
+
var import_node_process = __toESM(require("node:process"));
|
|
39
39
|
var import_fast_glob = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_KKMREGHN.require_out)());
|
|
40
40
|
var import_globby = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_KKMREGHN.require_globby)());
|
|
41
|
-
var defaultD1DirPath =
|
|
41
|
+
var defaultD1DirPath = import_node_path.default.join(".wrangler", "state", "v3", "d1", "miniflare-D1DatabaseObject");
|
|
42
42
|
async function locateLocalCloudflareD1({ arg }) {
|
|
43
|
-
const cwd =
|
|
44
|
-
const d1DirPath =
|
|
43
|
+
const cwd = import_node_process.default.cwd();
|
|
44
|
+
const d1DirPath = import_node_path.default.posix.join(cwd, defaultD1DirPath);
|
|
45
45
|
const pathConverted = (0, import_fast_glob.convertPathToPattern)(d1DirPath);
|
|
46
|
-
const d1Databases = await (0, import_globby.default)(
|
|
46
|
+
const d1Databases = await (0, import_globby.default)(import_node_path.default.posix.join(pathConverted, "*.sqlite"), {});
|
|
47
47
|
if (d1Databases.length === 0) {
|
|
48
48
|
throw new Error(
|
|
49
49
|
`No Cloudflare D1 databases found in ${defaultD1DirPath}. Did you run \`wrangler d1 create <DATABASE_NAME>\` and \`wrangler dev\`?`
|
|
@@ -26,15 +26,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_I4467NNA_exports = {};
|
|
30
|
+
__export(chunk_I4467NNA_exports, {
|
|
31
31
|
createDebugErrorType: () => createDebugErrorType,
|
|
32
32
|
createSchemaValidationError: () => createSchemaValidationError,
|
|
33
33
|
parseQueryEngineError: () => parseQueryEngineError,
|
|
34
34
|
unlinkTempDatamodelPath: () => unlinkTempDatamodelPath
|
|
35
35
|
});
|
|
36
|
-
module.exports = __toCommonJS(
|
|
37
|
-
var
|
|
36
|
+
module.exports = __toCommonJS(chunk_I4467NNA_exports);
|
|
37
|
+
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
|
38
38
|
var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
|
|
39
39
|
var import_chunk_H3T4L34H = require("./chunk-H3T4L34H.js");
|
|
40
40
|
var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
|
|
@@ -71,7 +71,7 @@ function parseQueryEngineError({ errorOutput, reason }) {
|
|
|
71
71
|
() => ({ _tag: "unparsed", message: errorOutput, reason })
|
|
72
72
|
),
|
|
73
73
|
(0, import_chunk_7MD6344A.map)((errorOutputAsJSON) => {
|
|
74
|
-
const defaultMessage = (0, import_chunk_PG5FDKSF.red)((0, import_chunk_PG5FDKSF.bold)((0,
|
|
74
|
+
const defaultMessage = (0, import_chunk_PG5FDKSF.red)((0, import_chunk_PG5FDKSF.bold)((0, import_chunk_C47SCASR.relativizePathInPSLError)(errorOutputAsJSON.message)));
|
|
75
75
|
const getConfigErrorInit = (0, import_chunk_H3T4L34H.$)(errorOutputAsJSON).with({ error_code: "P1012" }, (eJSON) => {
|
|
76
76
|
return {
|
|
77
77
|
reason: createSchemaValidationError(reason),
|