@prisma/cli-init 0.0.0-dev.202506200250 → 0.0.0-dev.202506210310
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.
|
@@ -756,8 +756,8 @@ import { setTimeout } from "timers/promises";
|
|
|
756
756
|
// ../../common/stuff/with-resolvers.ts
|
|
757
757
|
function withResolvers(options) {
|
|
758
758
|
let succeed, fail;
|
|
759
|
-
const promise = new Promise((
|
|
760
|
-
succeed =
|
|
759
|
+
const promise = new Promise((resolve2, reject) => {
|
|
760
|
+
succeed = resolve2;
|
|
761
761
|
fail = reject;
|
|
762
762
|
});
|
|
763
763
|
let failOnce = (reason) => {
|
|
@@ -856,7 +856,7 @@ var K = P?.name || "";
|
|
|
856
856
|
|
|
857
857
|
// ../../dev/server/src/filesystem.ts
|
|
858
858
|
import { createWriteStream, WriteStream } from "fs";
|
|
859
|
-
import { access, chmod, constants, mkdir, readdir, readFile, writeFile } from "fs/promises";
|
|
859
|
+
import { access, chmod, constants, mkdir, readdir, readFile, rm, writeFile } from "fs/promises";
|
|
860
860
|
import { promisify } from "util";
|
|
861
861
|
import { unzip } from "zlib";
|
|
862
862
|
|
|
@@ -916,6 +916,483 @@ function envPaths(name, { suffix = "nodejs" } = {}) {
|
|
|
916
916
|
return linux(name);
|
|
917
917
|
}
|
|
918
918
|
|
|
919
|
+
// ../../node_modules/.pnpm/grammex@3.1.10/node_modules/grammex/dist/utils.js
|
|
920
|
+
var isArray = (value) => {
|
|
921
|
+
return Array.isArray(value);
|
|
922
|
+
};
|
|
923
|
+
var isFunction = (value) => {
|
|
924
|
+
return typeof value === "function";
|
|
925
|
+
};
|
|
926
|
+
var isFunctionNullary = (value) => {
|
|
927
|
+
return value.length === 0;
|
|
928
|
+
};
|
|
929
|
+
var isFunctionStrictlyNullaryOrUnary = (() => {
|
|
930
|
+
const { toString } = Function.prototype;
|
|
931
|
+
const re = /(?:^\(\s*(?:[^,.()]|\.(?!\.\.))*\s*\)\s*=>|^\s*[a-zA-Z$_][a-zA-Z0-9$_]*\s*=>)/;
|
|
932
|
+
return (value) => {
|
|
933
|
+
return (value.length === 0 || value.length === 1) && re.test(toString.call(value));
|
|
934
|
+
};
|
|
935
|
+
})();
|
|
936
|
+
var isNumber = (value) => {
|
|
937
|
+
return typeof value === "number";
|
|
938
|
+
};
|
|
939
|
+
var isObject = (value) => {
|
|
940
|
+
return typeof value === "object" && value !== null;
|
|
941
|
+
};
|
|
942
|
+
var isRegExp = (value) => {
|
|
943
|
+
return value instanceof RegExp;
|
|
944
|
+
};
|
|
945
|
+
var isRegExpCapturing = /* @__PURE__ */ (() => {
|
|
946
|
+
const sourceRe = /\\\(|\((?!\?(?::|=|!|<=|<!))/;
|
|
947
|
+
return (re) => {
|
|
948
|
+
return sourceRe.test(re.source);
|
|
949
|
+
};
|
|
950
|
+
})();
|
|
951
|
+
var isRegExpStatic = /* @__PURE__ */ (() => {
|
|
952
|
+
const sourceRe = /^[a-zA-Z0-9_-]+$/;
|
|
953
|
+
return (re) => {
|
|
954
|
+
return sourceRe.test(re.source) && !re.flags.includes("i");
|
|
955
|
+
};
|
|
956
|
+
})();
|
|
957
|
+
var isString = (value) => {
|
|
958
|
+
return typeof value === "string";
|
|
959
|
+
};
|
|
960
|
+
var isUndefined = (value) => {
|
|
961
|
+
return value === void 0;
|
|
962
|
+
};
|
|
963
|
+
var memoize = (fn) => {
|
|
964
|
+
const cache = /* @__PURE__ */ new Map();
|
|
965
|
+
return (arg) => {
|
|
966
|
+
const cached = cache.get(arg);
|
|
967
|
+
if (cached !== void 0)
|
|
968
|
+
return cached;
|
|
969
|
+
const value = fn(arg);
|
|
970
|
+
cache.set(arg, value);
|
|
971
|
+
return value;
|
|
972
|
+
};
|
|
973
|
+
};
|
|
974
|
+
|
|
975
|
+
// ../../node_modules/.pnpm/grammex@3.1.10/node_modules/grammex/dist/index.js
|
|
976
|
+
var parse = (input, rule, options = {}) => {
|
|
977
|
+
const state = { cache: {}, input, index: 0, indexBacktrackMax: 0, options, output: [] };
|
|
978
|
+
const matched = resolve(rule)(state);
|
|
979
|
+
const indexMax = Math.max(state.index, state.indexBacktrackMax);
|
|
980
|
+
if (matched && state.index === input.length) {
|
|
981
|
+
return state.output;
|
|
982
|
+
} else {
|
|
983
|
+
throw new Error(`Failed to parse at index ${indexMax}`);
|
|
984
|
+
}
|
|
985
|
+
};
|
|
986
|
+
var match = (target, handler) => {
|
|
987
|
+
if (isArray(target)) {
|
|
988
|
+
return chars(target, handler);
|
|
989
|
+
} else if (isString(target)) {
|
|
990
|
+
return string2(target, handler);
|
|
991
|
+
} else {
|
|
992
|
+
return regex2(target, handler);
|
|
993
|
+
}
|
|
994
|
+
};
|
|
995
|
+
var chars = (target, handler) => {
|
|
996
|
+
const charCodes = {};
|
|
997
|
+
for (const char of target) {
|
|
998
|
+
if (char.length !== 1)
|
|
999
|
+
throw new Error(`Invalid character: "${char}"`);
|
|
1000
|
+
const charCode = char.charCodeAt(0);
|
|
1001
|
+
charCodes[charCode] = true;
|
|
1002
|
+
}
|
|
1003
|
+
return (state) => {
|
|
1004
|
+
const input = state.input;
|
|
1005
|
+
let indexStart = state.index;
|
|
1006
|
+
let indexEnd = indexStart;
|
|
1007
|
+
while (indexEnd < input.length) {
|
|
1008
|
+
const charCode = input.charCodeAt(indexEnd);
|
|
1009
|
+
if (!(charCode in charCodes))
|
|
1010
|
+
break;
|
|
1011
|
+
indexEnd += 1;
|
|
1012
|
+
}
|
|
1013
|
+
if (indexEnd > indexStart) {
|
|
1014
|
+
if (!isUndefined(handler) && !state.options.silent) {
|
|
1015
|
+
const target2 = input.slice(indexStart, indexEnd);
|
|
1016
|
+
const output = isFunction(handler) ? handler(target2, input, `${indexStart}`) : handler;
|
|
1017
|
+
if (!isUndefined(output)) {
|
|
1018
|
+
state.output.push(output);
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
state.index = indexEnd;
|
|
1022
|
+
}
|
|
1023
|
+
return true;
|
|
1024
|
+
};
|
|
1025
|
+
};
|
|
1026
|
+
var regex2 = (target, handler) => {
|
|
1027
|
+
if (isRegExpStatic(target)) {
|
|
1028
|
+
return string2(target.source, handler);
|
|
1029
|
+
} else {
|
|
1030
|
+
const source = target.source;
|
|
1031
|
+
const flags = target.flags.replace(/y|$/, "y");
|
|
1032
|
+
const re = new RegExp(source, flags);
|
|
1033
|
+
if (isRegExpCapturing(target) && isFunction(handler) && !isFunctionStrictlyNullaryOrUnary(handler)) {
|
|
1034
|
+
return regexCapturing(re, handler);
|
|
1035
|
+
} else {
|
|
1036
|
+
return regexNonCapturing(re, handler);
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
};
|
|
1040
|
+
var regexCapturing = (re, handler) => {
|
|
1041
|
+
return (state) => {
|
|
1042
|
+
const indexStart = state.index;
|
|
1043
|
+
const input = state.input;
|
|
1044
|
+
re.lastIndex = indexStart;
|
|
1045
|
+
const match2 = re.exec(input);
|
|
1046
|
+
if (match2) {
|
|
1047
|
+
const indexEnd = re.lastIndex;
|
|
1048
|
+
if (!state.options.silent) {
|
|
1049
|
+
const output = handler(...match2, input, `${indexStart}`);
|
|
1050
|
+
if (!isUndefined(output)) {
|
|
1051
|
+
state.output.push(output);
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
state.index = indexEnd;
|
|
1055
|
+
return true;
|
|
1056
|
+
} else {
|
|
1057
|
+
return false;
|
|
1058
|
+
}
|
|
1059
|
+
};
|
|
1060
|
+
};
|
|
1061
|
+
var regexNonCapturing = (re, handler) => {
|
|
1062
|
+
return (state) => {
|
|
1063
|
+
const indexStart = state.index;
|
|
1064
|
+
const input = state.input;
|
|
1065
|
+
re.lastIndex = indexStart;
|
|
1066
|
+
const matched = re.test(input);
|
|
1067
|
+
if (matched) {
|
|
1068
|
+
const indexEnd = re.lastIndex;
|
|
1069
|
+
if (!isUndefined(handler) && !state.options.silent) {
|
|
1070
|
+
const output = isFunction(handler) ? handler(input.slice(indexStart, indexEnd), input, `${indexStart}`) : handler;
|
|
1071
|
+
if (!isUndefined(output)) {
|
|
1072
|
+
state.output.push(output);
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
state.index = indexEnd;
|
|
1076
|
+
return true;
|
|
1077
|
+
} else {
|
|
1078
|
+
return false;
|
|
1079
|
+
}
|
|
1080
|
+
};
|
|
1081
|
+
};
|
|
1082
|
+
var string2 = (target, handler) => {
|
|
1083
|
+
return (state) => {
|
|
1084
|
+
const indexStart = state.index;
|
|
1085
|
+
const input = state.input;
|
|
1086
|
+
const matched = input.startsWith(target, indexStart);
|
|
1087
|
+
if (matched) {
|
|
1088
|
+
if (!isUndefined(handler) && !state.options.silent) {
|
|
1089
|
+
const output = isFunction(handler) ? handler(target, input, `${indexStart}`) : handler;
|
|
1090
|
+
if (!isUndefined(output)) {
|
|
1091
|
+
state.output.push(output);
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
state.index += target.length;
|
|
1095
|
+
return true;
|
|
1096
|
+
} else {
|
|
1097
|
+
return false;
|
|
1098
|
+
}
|
|
1099
|
+
};
|
|
1100
|
+
};
|
|
1101
|
+
var repeat = (rule, min, max, handler) => {
|
|
1102
|
+
const erule = resolve(rule);
|
|
1103
|
+
const isBacktrackable = min > 1;
|
|
1104
|
+
return memoizable(handleable(backtrackable((state) => {
|
|
1105
|
+
let repetitions = 0;
|
|
1106
|
+
while (repetitions < max) {
|
|
1107
|
+
const index = state.index;
|
|
1108
|
+
const matched = erule(state);
|
|
1109
|
+
if (!matched)
|
|
1110
|
+
break;
|
|
1111
|
+
repetitions += 1;
|
|
1112
|
+
if (state.index === index)
|
|
1113
|
+
break;
|
|
1114
|
+
}
|
|
1115
|
+
return repetitions >= min;
|
|
1116
|
+
}, isBacktrackable), handler));
|
|
1117
|
+
};
|
|
1118
|
+
var optional2 = (rule, handler) => {
|
|
1119
|
+
return repeat(rule, 0, 1, handler);
|
|
1120
|
+
};
|
|
1121
|
+
var star = (rule, handler) => {
|
|
1122
|
+
return repeat(rule, 0, Infinity, handler);
|
|
1123
|
+
};
|
|
1124
|
+
var and = (rules, handler) => {
|
|
1125
|
+
const erules = rules.map(resolve);
|
|
1126
|
+
return memoizable(handleable(backtrackable((state) => {
|
|
1127
|
+
for (let i2 = 0, l2 = erules.length; i2 < l2; i2++) {
|
|
1128
|
+
if (!erules[i2](state))
|
|
1129
|
+
return false;
|
|
1130
|
+
}
|
|
1131
|
+
return true;
|
|
1132
|
+
}), handler));
|
|
1133
|
+
};
|
|
1134
|
+
var or = (rules, handler) => {
|
|
1135
|
+
const erules = rules.map(resolve);
|
|
1136
|
+
return memoizable(handleable((state) => {
|
|
1137
|
+
for (let i2 = 0, l2 = erules.length; i2 < l2; i2++) {
|
|
1138
|
+
if (erules[i2](state))
|
|
1139
|
+
return true;
|
|
1140
|
+
}
|
|
1141
|
+
return false;
|
|
1142
|
+
}, handler));
|
|
1143
|
+
};
|
|
1144
|
+
var backtrackable = (rule, enabled = true, force = false) => {
|
|
1145
|
+
const erule = resolve(rule);
|
|
1146
|
+
if (!enabled)
|
|
1147
|
+
return erule;
|
|
1148
|
+
return (state) => {
|
|
1149
|
+
const index = state.index;
|
|
1150
|
+
const length = state.output.length;
|
|
1151
|
+
const matched = erule(state);
|
|
1152
|
+
if (!matched && !force) {
|
|
1153
|
+
state.indexBacktrackMax = Math.max(state.indexBacktrackMax, state.index);
|
|
1154
|
+
}
|
|
1155
|
+
if (!matched || force) {
|
|
1156
|
+
state.index = index;
|
|
1157
|
+
if (state.output.length !== length) {
|
|
1158
|
+
state.output.length = length;
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
return matched;
|
|
1162
|
+
};
|
|
1163
|
+
};
|
|
1164
|
+
var handleable = (rule, handler) => {
|
|
1165
|
+
const erule = resolve(rule);
|
|
1166
|
+
if (!handler)
|
|
1167
|
+
return erule;
|
|
1168
|
+
return (state) => {
|
|
1169
|
+
if (state.options.silent)
|
|
1170
|
+
return erule(state);
|
|
1171
|
+
const length = state.output.length;
|
|
1172
|
+
const matched = erule(state);
|
|
1173
|
+
if (matched) {
|
|
1174
|
+
const outputs = state.output.splice(length, Infinity);
|
|
1175
|
+
const output = handler(outputs);
|
|
1176
|
+
if (!isUndefined(output)) {
|
|
1177
|
+
state.output.push(output);
|
|
1178
|
+
}
|
|
1179
|
+
return true;
|
|
1180
|
+
} else {
|
|
1181
|
+
return false;
|
|
1182
|
+
}
|
|
1183
|
+
};
|
|
1184
|
+
};
|
|
1185
|
+
var memoizable = /* @__PURE__ */ (() => {
|
|
1186
|
+
let RULE_ID = 0;
|
|
1187
|
+
return (rule) => {
|
|
1188
|
+
const erule = resolve(rule);
|
|
1189
|
+
const ruleId = RULE_ID += 1;
|
|
1190
|
+
return (state) => {
|
|
1191
|
+
var _a;
|
|
1192
|
+
if (state.options.memoization === false)
|
|
1193
|
+
return erule(state);
|
|
1194
|
+
const indexStart = state.index;
|
|
1195
|
+
const cache = (_a = state.cache)[ruleId] || (_a[ruleId] = { indexMax: -1, queue: [] });
|
|
1196
|
+
const cacheQueue = cache.queue;
|
|
1197
|
+
const isPotentiallyCached = indexStart <= cache.indexMax;
|
|
1198
|
+
if (isPotentiallyCached) {
|
|
1199
|
+
const cacheStore = cache.store || (cache.store = /* @__PURE__ */ new Map());
|
|
1200
|
+
if (cacheQueue.length) {
|
|
1201
|
+
for (let i2 = 0, l2 = cacheQueue.length; i2 < l2; i2 += 2) {
|
|
1202
|
+
const key = cacheQueue[i2 * 2];
|
|
1203
|
+
const value = cacheQueue[i2 * 2 + 1];
|
|
1204
|
+
cacheStore.set(key, value);
|
|
1205
|
+
}
|
|
1206
|
+
cacheQueue.length = 0;
|
|
1207
|
+
}
|
|
1208
|
+
const cached = cacheStore.get(indexStart);
|
|
1209
|
+
if (cached === false) {
|
|
1210
|
+
return false;
|
|
1211
|
+
} else if (isNumber(cached)) {
|
|
1212
|
+
state.index = cached;
|
|
1213
|
+
return true;
|
|
1214
|
+
} else if (cached) {
|
|
1215
|
+
state.index = cached.index;
|
|
1216
|
+
if (cached.output?.length) {
|
|
1217
|
+
state.output.push(...cached.output);
|
|
1218
|
+
}
|
|
1219
|
+
return true;
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
const lengthStart = state.output.length;
|
|
1223
|
+
const matched = erule(state);
|
|
1224
|
+
cache.indexMax = Math.max(cache.indexMax, indexStart);
|
|
1225
|
+
if (matched) {
|
|
1226
|
+
const indexEnd = state.index;
|
|
1227
|
+
const lengthEnd = state.output.length;
|
|
1228
|
+
if (lengthEnd > lengthStart) {
|
|
1229
|
+
const output = state.output.slice(lengthStart, lengthEnd);
|
|
1230
|
+
cacheQueue.push(indexStart, { index: indexEnd, output });
|
|
1231
|
+
} else {
|
|
1232
|
+
cacheQueue.push(indexStart, indexEnd);
|
|
1233
|
+
}
|
|
1234
|
+
return true;
|
|
1235
|
+
} else {
|
|
1236
|
+
cacheQueue.push(indexStart, false);
|
|
1237
|
+
return false;
|
|
1238
|
+
}
|
|
1239
|
+
};
|
|
1240
|
+
};
|
|
1241
|
+
})();
|
|
1242
|
+
var lazy = (getter) => {
|
|
1243
|
+
let erule;
|
|
1244
|
+
return (state) => {
|
|
1245
|
+
erule || (erule = resolve(getter()));
|
|
1246
|
+
return erule(state);
|
|
1247
|
+
};
|
|
1248
|
+
};
|
|
1249
|
+
var resolve = memoize((rule) => {
|
|
1250
|
+
if (isFunction(rule)) {
|
|
1251
|
+
if (isFunctionNullary(rule)) {
|
|
1252
|
+
return lazy(rule);
|
|
1253
|
+
} else {
|
|
1254
|
+
return rule;
|
|
1255
|
+
}
|
|
1256
|
+
}
|
|
1257
|
+
if (isString(rule) || isRegExp(rule)) {
|
|
1258
|
+
return match(rule);
|
|
1259
|
+
}
|
|
1260
|
+
if (isArray(rule)) {
|
|
1261
|
+
return and(rule);
|
|
1262
|
+
}
|
|
1263
|
+
if (isObject(rule)) {
|
|
1264
|
+
return or(Object.values(rule));
|
|
1265
|
+
}
|
|
1266
|
+
throw new Error("Invalid rule");
|
|
1267
|
+
});
|
|
1268
|
+
|
|
1269
|
+
// ../../node_modules/.pnpm/zeptomatch@2.0.2/node_modules/zeptomatch/dist/utils.js
|
|
1270
|
+
var identity = (value) => {
|
|
1271
|
+
return value;
|
|
1272
|
+
};
|
|
1273
|
+
var makeParser = (grammar) => {
|
|
1274
|
+
return (input) => {
|
|
1275
|
+
return parse(input, grammar, { memoization: false }).join("");
|
|
1276
|
+
};
|
|
1277
|
+
};
|
|
1278
|
+
var memoize2 = (fn) => {
|
|
1279
|
+
const cache = {};
|
|
1280
|
+
return (arg) => {
|
|
1281
|
+
return cache[arg] ?? (cache[arg] = fn(arg));
|
|
1282
|
+
};
|
|
1283
|
+
};
|
|
1284
|
+
|
|
1285
|
+
// ../../node_modules/.pnpm/zeptomatch@2.0.2/node_modules/zeptomatch/dist/range.js
|
|
1286
|
+
var ALPHABET = "abcdefghijklmnopqrstuvwxyz";
|
|
1287
|
+
var int2alpha = (int) => {
|
|
1288
|
+
let alpha = "";
|
|
1289
|
+
while (int > 0) {
|
|
1290
|
+
const reminder = (int - 1) % 26;
|
|
1291
|
+
alpha = ALPHABET[reminder] + alpha;
|
|
1292
|
+
int = Math.floor((int - 1) / 26);
|
|
1293
|
+
}
|
|
1294
|
+
return alpha;
|
|
1295
|
+
};
|
|
1296
|
+
var alpha2int = (str) => {
|
|
1297
|
+
let int = 0;
|
|
1298
|
+
for (let i2 = 0, l2 = str.length; i2 < l2; i2++) {
|
|
1299
|
+
int = int * 26 + ALPHABET.indexOf(str[i2]) + 1;
|
|
1300
|
+
}
|
|
1301
|
+
return int;
|
|
1302
|
+
};
|
|
1303
|
+
var makeRangeInt = (start, end) => {
|
|
1304
|
+
if (end < start)
|
|
1305
|
+
return makeRangeInt(end, start);
|
|
1306
|
+
const range = [];
|
|
1307
|
+
while (start <= end) {
|
|
1308
|
+
range.push(start++);
|
|
1309
|
+
}
|
|
1310
|
+
return range;
|
|
1311
|
+
};
|
|
1312
|
+
var makeRangePaddedInt = (start, end, paddingLength) => {
|
|
1313
|
+
return makeRangeInt(start, end).map((int) => String(int).padStart(paddingLength, "0"));
|
|
1314
|
+
};
|
|
1315
|
+
var makeRangeAlpha = (start, end) => {
|
|
1316
|
+
return makeRangeInt(alpha2int(start), alpha2int(end)).map(int2alpha);
|
|
1317
|
+
};
|
|
1318
|
+
|
|
1319
|
+
// ../../node_modules/.pnpm/zeptomatch@2.0.2/node_modules/zeptomatch/dist/convert/grammar.js
|
|
1320
|
+
var Escaped = match(/\\./, identity);
|
|
1321
|
+
var Escape = match(/[$.*+?^(){}[\]\|]/, (char) => `\\${char}`);
|
|
1322
|
+
var Slash = match(/[\\/]/, "[\\\\/]");
|
|
1323
|
+
var Passthrough = match(/./, identity);
|
|
1324
|
+
var NegationOdd = match(/^(?:!!)*!(.*)$/, (_2, glob) => `(?!^${parser_default(glob)}$).*?`);
|
|
1325
|
+
var NegationEven = match(/^(!!)+/, "");
|
|
1326
|
+
var Negation = or([NegationOdd, NegationEven]);
|
|
1327
|
+
var StarStarBetween = match(/\/(\*\*\/)+/, "(?:[\\\\/].+[\\\\/]|[\\\\/])");
|
|
1328
|
+
var StarStarStart = match(/^(\*\*\/)+/, "(?:^|.*[\\\\/])");
|
|
1329
|
+
var StarStarEnd = match(/\/(\*\*)$/, "(?:[\\\\/].*|$)");
|
|
1330
|
+
var StarStarNone = match(/\*\*/, ".*");
|
|
1331
|
+
var StarStar = or([StarStarBetween, StarStarStart, StarStarEnd, StarStarNone]);
|
|
1332
|
+
var StarDouble = match(/\*\/(?!\*\*\/|\*$)/, "[^\\\\/]*[\\\\/]");
|
|
1333
|
+
var StarSingle = match(/\*/, "[^\\\\/]*");
|
|
1334
|
+
var Star = or([StarDouble, StarSingle]);
|
|
1335
|
+
var Question = match("?", "[^\\\\/]");
|
|
1336
|
+
var ClassOpen = match("[", identity);
|
|
1337
|
+
var ClassClose = match("]", identity);
|
|
1338
|
+
var ClassNegation = match(/[!^]/, "^\\\\/");
|
|
1339
|
+
var ClassRange = match(/[a-z]-[a-z]|[0-9]-[0-9]/i, identity);
|
|
1340
|
+
var ClassEscape = match(/[$.*+?^(){}[\|]/, (char) => `\\${char}`);
|
|
1341
|
+
var ClassPassthrough = match(/[^\]]/, identity);
|
|
1342
|
+
var ClassValue = or([Escaped, ClassEscape, ClassRange, ClassPassthrough]);
|
|
1343
|
+
var Class = and([ClassOpen, optional2(ClassNegation), star(ClassValue), ClassClose]);
|
|
1344
|
+
var RangeOpen = match("{", "(?:");
|
|
1345
|
+
var RangeClose = match("}", ")");
|
|
1346
|
+
var RangeNumeric = match(/(\d+)\.\.(\d+)/, (_2, $1, $2) => makeRangePaddedInt(+$1, +$2, Math.min($1.length, $2.length)).join("|"));
|
|
1347
|
+
var RangeAlphaLower = match(/([a-z]+)\.\.([a-z]+)/, (_2, $1, $2) => makeRangeAlpha($1, $2).join("|"));
|
|
1348
|
+
var RangeAlphaUpper = match(/([A-Z]+)\.\.([A-Z]+)/, (_2, $1, $2) => makeRangeAlpha($1.toLowerCase(), $2.toLowerCase()).join("|").toUpperCase());
|
|
1349
|
+
var RangeValue = or([RangeNumeric, RangeAlphaLower, RangeAlphaUpper]);
|
|
1350
|
+
var Range = and([RangeOpen, RangeValue, RangeClose]);
|
|
1351
|
+
var BracesOpen = match("{", "(?:");
|
|
1352
|
+
var BracesClose = match("}", ")");
|
|
1353
|
+
var BracesComma = match(",", "|");
|
|
1354
|
+
var BracesEscape = match(/[$.*+?^(){[\]\|]/, (char) => `\\${char}`);
|
|
1355
|
+
var BracesPassthrough = match(/[^}]/, identity);
|
|
1356
|
+
var BracesNested = lazy(() => Braces);
|
|
1357
|
+
var BracesValue = or([StarStar, Star, Question, Class, Range, BracesNested, Escaped, BracesEscape, BracesComma, BracesPassthrough]);
|
|
1358
|
+
var Braces = and([BracesOpen, star(BracesValue), BracesClose]);
|
|
1359
|
+
var Grammar = star(or([Negation, StarStar, Star, Question, Class, Range, Braces, Escaped, Escape, Slash, Passthrough]));
|
|
1360
|
+
var grammar_default = Grammar;
|
|
1361
|
+
|
|
1362
|
+
// ../../node_modules/.pnpm/zeptomatch@2.0.2/node_modules/zeptomatch/dist/convert/parser.js
|
|
1363
|
+
var parser = makeParser(grammar_default);
|
|
1364
|
+
var parser_default = parser;
|
|
1365
|
+
|
|
1366
|
+
// ../../node_modules/.pnpm/zeptomatch@2.0.2/node_modules/zeptomatch/dist/normalize/grammar.js
|
|
1367
|
+
var Escaped2 = match(/\\./, identity);
|
|
1368
|
+
var Passthrough2 = match(/./, identity);
|
|
1369
|
+
var StarStarStar = match(/\*\*\*+/, "*");
|
|
1370
|
+
var StarStarNoLeft = match(/([^/{[(!])\*\*/, (_2, $1) => `${$1}*`);
|
|
1371
|
+
var StarStarNoRight = match(/(^|.)\*\*(?=[^*/)\]}])/, (_2, $1) => `${$1}*`);
|
|
1372
|
+
var Grammar2 = star(or([Escaped2, StarStarStar, StarStarNoLeft, StarStarNoRight, Passthrough2]));
|
|
1373
|
+
var grammar_default2 = Grammar2;
|
|
1374
|
+
|
|
1375
|
+
// ../../node_modules/.pnpm/zeptomatch@2.0.2/node_modules/zeptomatch/dist/normalize/parser.js
|
|
1376
|
+
var parser2 = makeParser(grammar_default2);
|
|
1377
|
+
var parser_default2 = parser2;
|
|
1378
|
+
|
|
1379
|
+
// ../../node_modules/.pnpm/zeptomatch@2.0.2/node_modules/zeptomatch/dist/index.js
|
|
1380
|
+
var zeptomatch = (glob, path2) => {
|
|
1381
|
+
if (Array.isArray(glob)) {
|
|
1382
|
+
const res = glob.map(zeptomatch.compile);
|
|
1383
|
+
const isMatch = res.some((re) => re.test(path2));
|
|
1384
|
+
return isMatch;
|
|
1385
|
+
} else {
|
|
1386
|
+
const re = zeptomatch.compile(glob);
|
|
1387
|
+
const isMatch = re.test(path2);
|
|
1388
|
+
return isMatch;
|
|
1389
|
+
}
|
|
1390
|
+
};
|
|
1391
|
+
zeptomatch.compile = memoize2((glob) => {
|
|
1392
|
+
return new RegExp(`^${parser_default(parser_default2(glob))}[\\\\/]?$`, "s");
|
|
1393
|
+
});
|
|
1394
|
+
var dist_default = zeptomatch;
|
|
1395
|
+
|
|
919
1396
|
// ../../dev/server/src/filesystem.ts
|
|
920
1397
|
var GLOBAL_DIR_ROOT_PATH = envPaths("prisma-dev");
|
|
921
1398
|
var unzipAsync = promisify(unzip);
|
|
@@ -960,11 +1437,11 @@ async function readFileAsText(path2) {
|
|
|
960
1437
|
async function ensureDirectory(path2) {
|
|
961
1438
|
await mkdir(path2, { recursive: true });
|
|
962
1439
|
}
|
|
963
|
-
async function readDirectoryNames(path2) {
|
|
1440
|
+
async function readDirectoryNames(path2, globs) {
|
|
964
1441
|
try {
|
|
965
1442
|
const dirents = await readdir(path2, { withFileTypes: true });
|
|
966
1443
|
return dirents.reduce((names, dirent) => {
|
|
967
|
-
if (dirent.isDirectory() && !dirent.name.startsWith(".")) {
|
|
1444
|
+
if (dirent.isDirectory() && !dirent.name.startsWith(".") && (!globs || dist_default(globs, dirent.name))) {
|
|
968
1445
|
names.push(dirent.name);
|
|
969
1446
|
}
|
|
970
1447
|
return names;
|
|
@@ -1064,7 +1541,7 @@ var Engine = class _Engine {
|
|
|
1064
1541
|
if (this.#session != null) {
|
|
1065
1542
|
return await this.#session;
|
|
1066
1543
|
}
|
|
1067
|
-
const { promise: session, reject, resolve } = withResolvers();
|
|
1544
|
+
const { promise: session, reject, resolve: resolve2 } = withResolvers();
|
|
1068
1545
|
this.#session = session;
|
|
1069
1546
|
const engineBinaryPath = PRISMA_DEV_FORCE_ENGINE_BINARY_PATH || await this.#getEngineBinaryPath();
|
|
1070
1547
|
if (this.#options.debug) {
|
|
@@ -1108,7 +1585,7 @@ Received data: ${data}`
|
|
|
1108
1585
|
)
|
|
1109
1586
|
);
|
|
1110
1587
|
}
|
|
1111
|
-
|
|
1588
|
+
resolve2({ childProcess, url: `http://${ip}:${port}` });
|
|
1112
1589
|
};
|
|
1113
1590
|
const errorListener = (error) => {
|
|
1114
1591
|
this.#session = null;
|
|
@@ -344,7 +344,7 @@ import internals5 from "@prisma/internals";
|
|
|
344
344
|
import * as Checkpoint from "checkpoint-client";
|
|
345
345
|
|
|
346
346
|
// package.json
|
|
347
|
-
var version = "0.0.0-dev.
|
|
347
|
+
var version = "0.0.0-dev.202506210310";
|
|
348
348
|
|
|
349
349
|
// src/platform/_lib/userAgent.ts
|
|
350
350
|
var debug = Debug("prisma:cli:platform:_lib:userAgent");
|
package/dist/index.js
CHANGED
|
@@ -21,14 +21,14 @@ import {
|
|
|
21
21
|
url,
|
|
22
22
|
withResolvers,
|
|
23
23
|
y
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-XE2LPBET.js";
|
|
25
25
|
import {
|
|
26
26
|
credentialsFile,
|
|
27
27
|
poll,
|
|
28
28
|
printPpgInitOutput,
|
|
29
29
|
requestOrThrow,
|
|
30
30
|
successMessage
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-YE6OKIGR.js";
|
|
32
32
|
import {
|
|
33
33
|
__commonJS,
|
|
34
34
|
__require,
|
|
@@ -2645,7 +2645,7 @@ async function getApp(port, dbServer, serverState) {
|
|
|
2645
2645
|
const { debug } = serverState;
|
|
2646
2646
|
const [{ Hono }, { accelerateRoute }, { utilityRoute }] = await Promise.all([
|
|
2647
2647
|
import("hono/tiny"),
|
|
2648
|
-
import("./accelerate-
|
|
2648
|
+
import("./accelerate-TY7QIZCU.js"),
|
|
2649
2649
|
import("./utility-W6LOZZIT.js")
|
|
2650
2650
|
]);
|
|
2651
2651
|
const app = new Hono();
|
|
@@ -2787,12 +2787,12 @@ ${JSON.stringify(issues, null, 2)}`);
|
|
|
2787
2787
|
});
|
|
2788
2788
|
}
|
|
2789
2789
|
static async scan(options) {
|
|
2790
|
-
const { debug } = options ?? {};
|
|
2790
|
+
const { debug, globs } = options ?? {};
|
|
2791
2791
|
const dataDirsPath = join(getDataDirPath(DEFAULT_NAME), "..");
|
|
2792
2792
|
if (debug) {
|
|
2793
2793
|
console.debug(`[State] scanning for server states in: ${dataDirsPath}`);
|
|
2794
2794
|
}
|
|
2795
|
-
const names = await readDirectoryNames(dataDirsPath);
|
|
2795
|
+
const names = await readDirectoryNames(dataDirsPath, globs);
|
|
2796
2796
|
if (debug) {
|
|
2797
2797
|
console.debug(`[State] found server names: ${JSON.stringify(names)}`);
|
|
2798
2798
|
}
|
|
@@ -2905,6 +2905,13 @@ var StatefulServerState = class _StatefulServerState extends ServerState {
|
|
|
2905
2905
|
throw error;
|
|
2906
2906
|
}
|
|
2907
2907
|
}
|
|
2908
|
+
async killProcess() {
|
|
2909
|
+
const { pid, status } = await getServerStatus(this, { debug: this.debug });
|
|
2910
|
+
if (pid == null || status !== "running" && status !== "starting_up") {
|
|
2911
|
+
return false;
|
|
2912
|
+
}
|
|
2913
|
+
return y.kill?.(pid, "SIGTERM") || false;
|
|
2914
|
+
}
|
|
2908
2915
|
async writeServerDump(exports) {
|
|
2909
2916
|
this.#serverDump = {
|
|
2910
2917
|
name: this.name,
|
|
@@ -2919,19 +2926,21 @@ var StatefulServerState = class _StatefulServerState extends ServerState {
|
|
|
2919
2926
|
`, { encoding: "utf-8" });
|
|
2920
2927
|
}
|
|
2921
2928
|
};
|
|
2922
|
-
async function getServerStatus(
|
|
2929
|
+
async function getServerStatus(nameOrState, options) {
|
|
2923
2930
|
const { debug, onlyMetadata } = options || {};
|
|
2931
|
+
const name = typeof nameOrState === "string" ? nameOrState : nameOrState.name;
|
|
2932
|
+
const givenState = typeof nameOrState !== "string" ? nameOrState : void 0;
|
|
2924
2933
|
const baseResult = {
|
|
2925
|
-
databasePort: -1,
|
|
2926
|
-
exports:
|
|
2934
|
+
databasePort: givenState?.databasePort ?? -1,
|
|
2935
|
+
exports: givenState?.exports,
|
|
2927
2936
|
name,
|
|
2928
|
-
pid:
|
|
2929
|
-
port: -1,
|
|
2930
|
-
shadowDatabasePort: -1,
|
|
2937
|
+
pid: givenState?.pid,
|
|
2938
|
+
port: givenState?.port ?? -1,
|
|
2939
|
+
shadowDatabasePort: givenState?.shadowDatabasePort ?? -1,
|
|
2931
2940
|
version: "1"
|
|
2932
2941
|
};
|
|
2933
2942
|
try {
|
|
2934
|
-
const serverState = await ServerState.fromServerDump({ debug, name });
|
|
2943
|
+
const serverState = givenState || await ServerState.fromServerDump({ debug, name });
|
|
2935
2944
|
if (!serverState) {
|
|
2936
2945
|
if (debug) {
|
|
2937
2946
|
console.debug(`[State] no server state found for name: ${name}`);
|
|
@@ -2979,14 +2988,14 @@ async function getServerStatus(name, options) {
|
|
|
2979
2988
|
return { ...baseResult, status: "not_running" };
|
|
2980
2989
|
}
|
|
2981
2990
|
const health = await healthResponse.json();
|
|
2982
|
-
if (health.name !==
|
|
2991
|
+
if (health.name !== nameOrState) {
|
|
2983
2992
|
if (debug) {
|
|
2984
2993
|
console.debug(`[State] server state for "${name}" has mismatched health response: ${JSON.stringify(health)}`);
|
|
2985
2994
|
}
|
|
2986
2995
|
return { ...baseResult, status: "unknown" };
|
|
2987
2996
|
}
|
|
2988
2997
|
if (debug) {
|
|
2989
|
-
console.debug(`[State] server state for "${
|
|
2998
|
+
console.debug(`[State] server state for "${nameOrState}" is live: ${JSON.stringify(health)}`);
|
|
2990
2999
|
}
|
|
2991
3000
|
return { ...baseResult, status: "running" };
|
|
2992
3001
|
} catch (error) {
|
|
@@ -3399,7 +3408,7 @@ var Init = class _Init {
|
|
|
3399
3408
|
let generatedSchema;
|
|
3400
3409
|
let generatedName;
|
|
3401
3410
|
if (isPpgCommand) {
|
|
3402
|
-
const PlatformCommands = await import("./_-
|
|
3411
|
+
const PlatformCommands = await import("./_-4N6R32AT.js");
|
|
3403
3412
|
const credentials = await credentialsFile.load();
|
|
3404
3413
|
if (internals.isError(credentials))
|
|
3405
3414
|
throw credentials;
|