@vercel/python 16.0.0 → 17.0.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/index.js +345 -1888
- package/package.json +4 -5
package/dist/index.js
CHANGED
|
@@ -5,7 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
8
|
var __commonJS = (cb, mod) => function __require() {
|
|
10
9
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
11
10
|
};
|
|
@@ -30,32 +29,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
29
|
mod
|
|
31
30
|
));
|
|
32
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
33
|
-
var __publicField = (obj, key, value) => {
|
|
34
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
35
|
-
return value;
|
|
36
|
-
};
|
|
37
|
-
var __accessCheck = (obj, member, msg) => {
|
|
38
|
-
if (!member.has(obj))
|
|
39
|
-
throw TypeError("Cannot " + msg);
|
|
40
|
-
};
|
|
41
|
-
var __privateGet = (obj, member, getter) => {
|
|
42
|
-
__accessCheck(obj, member, "read from private field");
|
|
43
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
44
|
-
};
|
|
45
|
-
var __privateAdd = (obj, member, value) => {
|
|
46
|
-
if (member.has(obj))
|
|
47
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
48
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
49
|
-
};
|
|
50
|
-
var __privateSet = (obj, member, value, setter) => {
|
|
51
|
-
__accessCheck(obj, member, "write to private field");
|
|
52
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
53
|
-
return value;
|
|
54
|
-
};
|
|
55
|
-
var __privateMethod = (obj, member, method) => {
|
|
56
|
-
__accessCheck(obj, member, "access private method");
|
|
57
|
-
return method;
|
|
58
|
-
};
|
|
59
32
|
|
|
60
33
|
// ../../node_modules/.pnpm/nice-try@1.0.5/node_modules/nice-try/src/index.js
|
|
61
34
|
var require_src = __commonJS({
|
|
@@ -76,7 +49,7 @@ var require_windows = __commonJS({
|
|
|
76
49
|
module2.exports = isexe;
|
|
77
50
|
isexe.sync = sync;
|
|
78
51
|
var fs19 = require("fs");
|
|
79
|
-
function checkPathExt(
|
|
52
|
+
function checkPathExt(path, options) {
|
|
80
53
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
81
54
|
if (!pathext) {
|
|
82
55
|
return true;
|
|
@@ -87,25 +60,25 @@ var require_windows = __commonJS({
|
|
|
87
60
|
}
|
|
88
61
|
for (var i = 0; i < pathext.length; i++) {
|
|
89
62
|
var p = pathext[i].toLowerCase();
|
|
90
|
-
if (p &&
|
|
63
|
+
if (p && path.substr(-p.length).toLowerCase() === p) {
|
|
91
64
|
return true;
|
|
92
65
|
}
|
|
93
66
|
}
|
|
94
67
|
return false;
|
|
95
68
|
}
|
|
96
|
-
function checkStat(stat,
|
|
69
|
+
function checkStat(stat, path, options) {
|
|
97
70
|
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
98
71
|
return false;
|
|
99
72
|
}
|
|
100
|
-
return checkPathExt(
|
|
73
|
+
return checkPathExt(path, options);
|
|
101
74
|
}
|
|
102
|
-
function isexe(
|
|
103
|
-
fs19.stat(
|
|
104
|
-
cb(er, er ? false : checkStat(stat,
|
|
75
|
+
function isexe(path, options, cb) {
|
|
76
|
+
fs19.stat(path, function(er, stat) {
|
|
77
|
+
cb(er, er ? false : checkStat(stat, path, options));
|
|
105
78
|
});
|
|
106
79
|
}
|
|
107
|
-
function sync(
|
|
108
|
-
return checkStat(fs19.statSync(
|
|
80
|
+
function sync(path, options) {
|
|
81
|
+
return checkStat(fs19.statSync(path), path, options);
|
|
109
82
|
}
|
|
110
83
|
}
|
|
111
84
|
});
|
|
@@ -116,13 +89,13 @@ var require_mode = __commonJS({
|
|
|
116
89
|
module2.exports = isexe;
|
|
117
90
|
isexe.sync = sync;
|
|
118
91
|
var fs19 = require("fs");
|
|
119
|
-
function isexe(
|
|
120
|
-
fs19.stat(
|
|
92
|
+
function isexe(path, options, cb) {
|
|
93
|
+
fs19.stat(path, function(er, stat) {
|
|
121
94
|
cb(er, er ? false : checkStat(stat, options));
|
|
122
95
|
});
|
|
123
96
|
}
|
|
124
|
-
function sync(
|
|
125
|
-
return checkStat(fs19.statSync(
|
|
97
|
+
function sync(path, options) {
|
|
98
|
+
return checkStat(fs19.statSync(path), options);
|
|
126
99
|
}
|
|
127
100
|
function checkStat(stat, options) {
|
|
128
101
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -155,7 +128,7 @@ var require_isexe = __commonJS({
|
|
|
155
128
|
}
|
|
156
129
|
module2.exports = isexe;
|
|
157
130
|
isexe.sync = sync;
|
|
158
|
-
function isexe(
|
|
131
|
+
function isexe(path, options, cb) {
|
|
159
132
|
if (typeof options === "function") {
|
|
160
133
|
cb = options;
|
|
161
134
|
options = {};
|
|
@@ -165,7 +138,7 @@ var require_isexe = __commonJS({
|
|
|
165
138
|
throw new TypeError("callback not provided");
|
|
166
139
|
}
|
|
167
140
|
return new Promise(function(resolve4, reject) {
|
|
168
|
-
isexe(
|
|
141
|
+
isexe(path, options || {}, function(er, is) {
|
|
169
142
|
if (er) {
|
|
170
143
|
reject(er);
|
|
171
144
|
} else {
|
|
@@ -174,7 +147,7 @@ var require_isexe = __commonJS({
|
|
|
174
147
|
});
|
|
175
148
|
});
|
|
176
149
|
}
|
|
177
|
-
core(
|
|
150
|
+
core(path, options || {}, function(er, is) {
|
|
178
151
|
if (er) {
|
|
179
152
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
180
153
|
er = null;
|
|
@@ -184,9 +157,9 @@ var require_isexe = __commonJS({
|
|
|
184
157
|
cb(er, is);
|
|
185
158
|
});
|
|
186
159
|
}
|
|
187
|
-
function sync(
|
|
160
|
+
function sync(path, options) {
|
|
188
161
|
try {
|
|
189
|
-
return core.sync(
|
|
162
|
+
return core.sync(path, options || {});
|
|
190
163
|
} catch (er) {
|
|
191
164
|
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
192
165
|
return false;
|
|
@@ -204,7 +177,7 @@ var require_which = __commonJS({
|
|
|
204
177
|
module2.exports = which2;
|
|
205
178
|
which2.sync = whichSync;
|
|
206
179
|
var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
207
|
-
var
|
|
180
|
+
var path = require("path");
|
|
208
181
|
var COLON = isWindows ? ";" : ":";
|
|
209
182
|
var isexe = require_isexe();
|
|
210
183
|
function getNotFoundError(cmd) {
|
|
@@ -253,7 +226,7 @@ var require_which = __commonJS({
|
|
|
253
226
|
var pathPart = pathEnv[i];
|
|
254
227
|
if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
|
|
255
228
|
pathPart = pathPart.slice(1, -1);
|
|
256
|
-
var p =
|
|
229
|
+
var p = path.join(pathPart, cmd);
|
|
257
230
|
if (!pathPart && /^\.[\\\/]/.test(cmd)) {
|
|
258
231
|
p = cmd.slice(0, 2) + p;
|
|
259
232
|
}
|
|
@@ -261,13 +234,13 @@ var require_which = __commonJS({
|
|
|
261
234
|
(function E(ii, ll) {
|
|
262
235
|
if (ii === ll)
|
|
263
236
|
return F(i + 1, l);
|
|
264
|
-
var
|
|
265
|
-
isexe(p +
|
|
237
|
+
var ext = pathExt[ii];
|
|
238
|
+
isexe(p + ext, { pathExt: pathExtExe }, function(er, is) {
|
|
266
239
|
if (!er && is) {
|
|
267
240
|
if (opt.all)
|
|
268
|
-
found.push(p +
|
|
241
|
+
found.push(p + ext);
|
|
269
242
|
else
|
|
270
|
-
return cb(null, p +
|
|
243
|
+
return cb(null, p + ext);
|
|
271
244
|
}
|
|
272
245
|
return E(ii + 1, ll);
|
|
273
246
|
});
|
|
@@ -285,7 +258,7 @@ var require_which = __commonJS({
|
|
|
285
258
|
var pathPart = pathEnv[i];
|
|
286
259
|
if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
|
|
287
260
|
pathPart = pathPart.slice(1, -1);
|
|
288
|
-
var p =
|
|
261
|
+
var p = path.join(pathPart, cmd);
|
|
289
262
|
if (!pathPart && /^\.[\\\/]/.test(cmd)) {
|
|
290
263
|
p = cmd.slice(0, 2) + p;
|
|
291
264
|
}
|
|
@@ -333,7 +306,7 @@ var require_path_key = __commonJS({
|
|
|
333
306
|
var require_resolveCommand = __commonJS({
|
|
334
307
|
"../../node_modules/.pnpm/cross-spawn@6.0.5/node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module2) {
|
|
335
308
|
"use strict";
|
|
336
|
-
var
|
|
309
|
+
var path = require("path");
|
|
337
310
|
var which2 = require_which();
|
|
338
311
|
var pathKey = require_path_key()();
|
|
339
312
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -349,14 +322,14 @@ var require_resolveCommand = __commonJS({
|
|
|
349
322
|
try {
|
|
350
323
|
resolved = which2.sync(parsed.command, {
|
|
351
324
|
path: (parsed.options.env || process.env)[pathKey],
|
|
352
|
-
pathExt: withoutPathExt ?
|
|
325
|
+
pathExt: withoutPathExt ? path.delimiter : void 0
|
|
353
326
|
});
|
|
354
327
|
} catch (e) {
|
|
355
328
|
} finally {
|
|
356
329
|
process.chdir(cwd);
|
|
357
330
|
}
|
|
358
331
|
if (resolved) {
|
|
359
|
-
resolved =
|
|
332
|
+
resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
|
|
360
333
|
}
|
|
361
334
|
return resolved;
|
|
362
335
|
}
|
|
@@ -406,11 +379,11 @@ var require_shebang_command = __commonJS({
|
|
|
406
379
|
"use strict";
|
|
407
380
|
var shebangRegex = require_shebang_regex();
|
|
408
381
|
module2.exports = function(str) {
|
|
409
|
-
var
|
|
410
|
-
if (!
|
|
382
|
+
var match = str.match(shebangRegex);
|
|
383
|
+
if (!match) {
|
|
411
384
|
return null;
|
|
412
385
|
}
|
|
413
|
-
var arr =
|
|
386
|
+
var arr = match[0].replace(/#! ?/, "").split(" ");
|
|
414
387
|
var bin = arr[0].split("/").pop();
|
|
415
388
|
var arg = arr[1];
|
|
416
389
|
return bin === "env" ? arg : bin + (arg ? " " + arg : "");
|
|
@@ -836,10 +809,10 @@ var require_semver = __commonJS({
|
|
|
836
809
|
}
|
|
837
810
|
}
|
|
838
811
|
exports.compareIdentifiers = compareIdentifiers;
|
|
839
|
-
var
|
|
812
|
+
var numeric = /^[0-9]+$/;
|
|
840
813
|
function compareIdentifiers(a, b) {
|
|
841
|
-
var anum =
|
|
842
|
-
var bnum =
|
|
814
|
+
var anum = numeric.test(a);
|
|
815
|
+
var bnum = numeric.test(b);
|
|
843
816
|
if (anum && bnum) {
|
|
844
817
|
a = +a;
|
|
845
818
|
b = +b;
|
|
@@ -902,12 +875,12 @@ var require_semver = __commonJS({
|
|
|
902
875
|
function neq(a, b, loose) {
|
|
903
876
|
return compare(a, b, loose) !== 0;
|
|
904
877
|
}
|
|
905
|
-
exports.gte =
|
|
906
|
-
function
|
|
878
|
+
exports.gte = gte;
|
|
879
|
+
function gte(a, b, loose) {
|
|
907
880
|
return compare(a, b, loose) >= 0;
|
|
908
881
|
}
|
|
909
|
-
exports.lte =
|
|
910
|
-
function
|
|
882
|
+
exports.lte = lte;
|
|
883
|
+
function lte(a, b, loose) {
|
|
911
884
|
return compare(a, b, loose) <= 0;
|
|
912
885
|
}
|
|
913
886
|
exports.cmp = cmp;
|
|
@@ -934,11 +907,11 @@ var require_semver = __commonJS({
|
|
|
934
907
|
case ">":
|
|
935
908
|
return gt(a, b, loose);
|
|
936
909
|
case ">=":
|
|
937
|
-
return
|
|
910
|
+
return gte(a, b, loose);
|
|
938
911
|
case "<":
|
|
939
912
|
return lt(a, b, loose);
|
|
940
913
|
case "<=":
|
|
941
|
-
return
|
|
914
|
+
return lte(a, b, loose);
|
|
942
915
|
default:
|
|
943
916
|
throw new TypeError("Invalid operator: " + op);
|
|
944
917
|
}
|
|
@@ -1030,32 +1003,32 @@ var require_semver = __commonJS({
|
|
|
1030
1003
|
return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
|
|
1031
1004
|
};
|
|
1032
1005
|
exports.Range = Range;
|
|
1033
|
-
function Range(
|
|
1006
|
+
function Range(range, options) {
|
|
1034
1007
|
if (!options || typeof options !== "object") {
|
|
1035
1008
|
options = {
|
|
1036
1009
|
loose: !!options,
|
|
1037
1010
|
includePrerelease: false
|
|
1038
1011
|
};
|
|
1039
1012
|
}
|
|
1040
|
-
if (
|
|
1041
|
-
if (
|
|
1042
|
-
return
|
|
1013
|
+
if (range instanceof Range) {
|
|
1014
|
+
if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
|
|
1015
|
+
return range;
|
|
1043
1016
|
} else {
|
|
1044
|
-
return new Range(
|
|
1017
|
+
return new Range(range.raw, options);
|
|
1045
1018
|
}
|
|
1046
1019
|
}
|
|
1047
|
-
if (
|
|
1048
|
-
return new Range(
|
|
1020
|
+
if (range instanceof Comparator) {
|
|
1021
|
+
return new Range(range.value, options);
|
|
1049
1022
|
}
|
|
1050
1023
|
if (!(this instanceof Range)) {
|
|
1051
|
-
return new Range(
|
|
1024
|
+
return new Range(range, options);
|
|
1052
1025
|
}
|
|
1053
1026
|
this.options = options;
|
|
1054
1027
|
this.loose = !!options.loose;
|
|
1055
1028
|
this.includePrerelease = !!options.includePrerelease;
|
|
1056
|
-
this.raw =
|
|
1057
|
-
this.set = this.raw.split("||").map(function(
|
|
1058
|
-
return this.parseRange(
|
|
1029
|
+
this.raw = range.trim().split(/\s+/).join(" ");
|
|
1030
|
+
this.set = this.raw.split("||").map(function(range2) {
|
|
1031
|
+
return this.parseRange(range2.trim());
|
|
1059
1032
|
}, this).filter(function(c) {
|
|
1060
1033
|
return c.length;
|
|
1061
1034
|
});
|
|
@@ -1073,17 +1046,17 @@ var require_semver = __commonJS({
|
|
|
1073
1046
|
Range.prototype.toString = function() {
|
|
1074
1047
|
return this.range;
|
|
1075
1048
|
};
|
|
1076
|
-
Range.prototype.parseRange = function(
|
|
1049
|
+
Range.prototype.parseRange = function(range) {
|
|
1077
1050
|
var loose = this.options.loose;
|
|
1078
1051
|
var hr = loose ? safeRe[HYPHENRANGELOOSE] : safeRe[HYPHENRANGE];
|
|
1079
|
-
|
|
1080
|
-
debug18("hyphen replace",
|
|
1081
|
-
|
|
1082
|
-
debug18("comparator trim",
|
|
1083
|
-
|
|
1084
|
-
|
|
1052
|
+
range = range.replace(hr, hyphenReplace);
|
|
1053
|
+
debug18("hyphen replace", range);
|
|
1054
|
+
range = range.replace(safeRe[COMPARATORTRIM], comparatorTrimReplace);
|
|
1055
|
+
debug18("comparator trim", range, safeRe[COMPARATORTRIM]);
|
|
1056
|
+
range = range.replace(safeRe[TILDETRIM], tildeTrimReplace);
|
|
1057
|
+
range = range.replace(safeRe[CARETTRIM], caretTrimReplace);
|
|
1085
1058
|
var compRe = loose ? safeRe[COMPARATORLOOSE] : safeRe[COMPARATOR];
|
|
1086
|
-
var set =
|
|
1059
|
+
var set = range.split(" ").map(function(comp) {
|
|
1087
1060
|
return parseComparator(comp, this.options);
|
|
1088
1061
|
}, this).join(" ").split(/\s+/);
|
|
1089
1062
|
if (this.options.loose) {
|
|
@@ -1096,13 +1069,13 @@ var require_semver = __commonJS({
|
|
|
1096
1069
|
}, this);
|
|
1097
1070
|
return set;
|
|
1098
1071
|
};
|
|
1099
|
-
Range.prototype.intersects = function(
|
|
1100
|
-
if (!(
|
|
1072
|
+
Range.prototype.intersects = function(range, options) {
|
|
1073
|
+
if (!(range instanceof Range)) {
|
|
1101
1074
|
throw new TypeError("a Range is required");
|
|
1102
1075
|
}
|
|
1103
1076
|
return this.set.some(function(thisComparators) {
|
|
1104
1077
|
return thisComparators.every(function(thisComparator) {
|
|
1105
|
-
return
|
|
1078
|
+
return range.set.some(function(rangeComparators) {
|
|
1106
1079
|
return rangeComparators.every(function(rangeComparator) {
|
|
1107
1080
|
return thisComparator.intersects(rangeComparator, options);
|
|
1108
1081
|
});
|
|
@@ -1111,8 +1084,8 @@ var require_semver = __commonJS({
|
|
|
1111
1084
|
});
|
|
1112
1085
|
};
|
|
1113
1086
|
exports.toComparators = toComparators;
|
|
1114
|
-
function toComparators(
|
|
1115
|
-
return new Range(
|
|
1087
|
+
function toComparators(range, options) {
|
|
1088
|
+
return new Range(range, options).set.map(function(comp) {
|
|
1116
1089
|
return comp.map(function(c) {
|
|
1117
1090
|
return c.value;
|
|
1118
1091
|
}).join(" ").trim().split(" ");
|
|
@@ -1329,20 +1302,20 @@ var require_semver = __commonJS({
|
|
|
1329
1302
|
return true;
|
|
1330
1303
|
}
|
|
1331
1304
|
exports.satisfies = satisfies;
|
|
1332
|
-
function satisfies(version2,
|
|
1305
|
+
function satisfies(version2, range, options) {
|
|
1333
1306
|
try {
|
|
1334
|
-
|
|
1307
|
+
range = new Range(range, options);
|
|
1335
1308
|
} catch (er) {
|
|
1336
1309
|
return false;
|
|
1337
1310
|
}
|
|
1338
|
-
return
|
|
1311
|
+
return range.test(version2);
|
|
1339
1312
|
}
|
|
1340
1313
|
exports.maxSatisfying = maxSatisfying;
|
|
1341
|
-
function maxSatisfying(versions,
|
|
1314
|
+
function maxSatisfying(versions, range, options) {
|
|
1342
1315
|
var max = null;
|
|
1343
1316
|
var maxSV = null;
|
|
1344
1317
|
try {
|
|
1345
|
-
var rangeObj = new Range(
|
|
1318
|
+
var rangeObj = new Range(range, options);
|
|
1346
1319
|
} catch (er) {
|
|
1347
1320
|
return null;
|
|
1348
1321
|
}
|
|
@@ -1357,11 +1330,11 @@ var require_semver = __commonJS({
|
|
|
1357
1330
|
return max;
|
|
1358
1331
|
}
|
|
1359
1332
|
exports.minSatisfying = minSatisfying;
|
|
1360
|
-
function minSatisfying(versions,
|
|
1333
|
+
function minSatisfying(versions, range, options) {
|
|
1361
1334
|
var min = null;
|
|
1362
1335
|
var minSV = null;
|
|
1363
1336
|
try {
|
|
1364
|
-
var rangeObj = new Range(
|
|
1337
|
+
var rangeObj = new Range(range, options);
|
|
1365
1338
|
} catch (er) {
|
|
1366
1339
|
return null;
|
|
1367
1340
|
}
|
|
@@ -1376,19 +1349,19 @@ var require_semver = __commonJS({
|
|
|
1376
1349
|
return min;
|
|
1377
1350
|
}
|
|
1378
1351
|
exports.minVersion = minVersion;
|
|
1379
|
-
function minVersion(
|
|
1380
|
-
|
|
1352
|
+
function minVersion(range, loose) {
|
|
1353
|
+
range = new Range(range, loose);
|
|
1381
1354
|
var minver = new SemVer("0.0.0");
|
|
1382
|
-
if (
|
|
1355
|
+
if (range.test(minver)) {
|
|
1383
1356
|
return minver;
|
|
1384
1357
|
}
|
|
1385
1358
|
minver = new SemVer("0.0.0-0");
|
|
1386
|
-
if (
|
|
1359
|
+
if (range.test(minver)) {
|
|
1387
1360
|
return minver;
|
|
1388
1361
|
}
|
|
1389
1362
|
minver = null;
|
|
1390
|
-
for (var i2 = 0; i2 <
|
|
1391
|
-
var comparators =
|
|
1363
|
+
for (var i2 = 0; i2 < range.set.length; ++i2) {
|
|
1364
|
+
var comparators = range.set[i2];
|
|
1392
1365
|
comparators.forEach(function(comparator) {
|
|
1393
1366
|
var compver = new SemVer(comparator.semver.version);
|
|
1394
1367
|
switch (comparator.operator) {
|
|
@@ -1413,43 +1386,43 @@ var require_semver = __commonJS({
|
|
|
1413
1386
|
}
|
|
1414
1387
|
});
|
|
1415
1388
|
}
|
|
1416
|
-
if (minver &&
|
|
1389
|
+
if (minver && range.test(minver)) {
|
|
1417
1390
|
return minver;
|
|
1418
1391
|
}
|
|
1419
1392
|
return null;
|
|
1420
1393
|
}
|
|
1421
1394
|
exports.validRange = validRange;
|
|
1422
|
-
function validRange(
|
|
1395
|
+
function validRange(range, options) {
|
|
1423
1396
|
try {
|
|
1424
|
-
return new Range(
|
|
1397
|
+
return new Range(range, options).range || "*";
|
|
1425
1398
|
} catch (er) {
|
|
1426
1399
|
return null;
|
|
1427
1400
|
}
|
|
1428
1401
|
}
|
|
1429
1402
|
exports.ltr = ltr;
|
|
1430
|
-
function ltr(version2,
|
|
1431
|
-
return outside(version2,
|
|
1403
|
+
function ltr(version2, range, options) {
|
|
1404
|
+
return outside(version2, range, "<", options);
|
|
1432
1405
|
}
|
|
1433
1406
|
exports.gtr = gtr;
|
|
1434
|
-
function gtr(version2,
|
|
1435
|
-
return outside(version2,
|
|
1407
|
+
function gtr(version2, range, options) {
|
|
1408
|
+
return outside(version2, range, ">", options);
|
|
1436
1409
|
}
|
|
1437
1410
|
exports.outside = outside;
|
|
1438
|
-
function outside(version2,
|
|
1411
|
+
function outside(version2, range, hilo, options) {
|
|
1439
1412
|
version2 = new SemVer(version2, options);
|
|
1440
|
-
|
|
1413
|
+
range = new Range(range, options);
|
|
1441
1414
|
var gtfn, ltefn, ltfn, comp, ecomp;
|
|
1442
1415
|
switch (hilo) {
|
|
1443
1416
|
case ">":
|
|
1444
1417
|
gtfn = gt;
|
|
1445
|
-
ltefn =
|
|
1418
|
+
ltefn = lte;
|
|
1446
1419
|
ltfn = lt;
|
|
1447
1420
|
comp = ">";
|
|
1448
1421
|
ecomp = ">=";
|
|
1449
1422
|
break;
|
|
1450
1423
|
case "<":
|
|
1451
1424
|
gtfn = lt;
|
|
1452
|
-
ltefn =
|
|
1425
|
+
ltefn = gte;
|
|
1453
1426
|
ltfn = gt;
|
|
1454
1427
|
comp = "<";
|
|
1455
1428
|
ecomp = "<=";
|
|
@@ -1457,11 +1430,11 @@ var require_semver = __commonJS({
|
|
|
1457
1430
|
default:
|
|
1458
1431
|
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
1459
1432
|
}
|
|
1460
|
-
if (satisfies(version2,
|
|
1433
|
+
if (satisfies(version2, range, options)) {
|
|
1461
1434
|
return false;
|
|
1462
1435
|
}
|
|
1463
|
-
for (var i2 = 0; i2 <
|
|
1464
|
-
var comparators =
|
|
1436
|
+
for (var i2 = 0; i2 < range.set.length; ++i2) {
|
|
1437
|
+
var comparators = range.set[i2];
|
|
1465
1438
|
var high = null;
|
|
1466
1439
|
var low = null;
|
|
1467
1440
|
comparators.forEach(function(comparator) {
|
|
@@ -1506,11 +1479,11 @@ var require_semver = __commonJS({
|
|
|
1506
1479
|
if (typeof version2 !== "string") {
|
|
1507
1480
|
return null;
|
|
1508
1481
|
}
|
|
1509
|
-
var
|
|
1510
|
-
if (
|
|
1482
|
+
var match = version2.match(safeRe[COERCE]);
|
|
1483
|
+
if (match == null) {
|
|
1511
1484
|
return null;
|
|
1512
1485
|
}
|
|
1513
|
-
return parse2(
|
|
1486
|
+
return parse2(match[1] + "." + (match[2] || "0") + "." + (match[3] || "0"));
|
|
1514
1487
|
}
|
|
1515
1488
|
}
|
|
1516
1489
|
});
|
|
@@ -1519,10 +1492,10 @@ var require_semver = __commonJS({
|
|
|
1519
1492
|
var require_parse = __commonJS({
|
|
1520
1493
|
"../../node_modules/.pnpm/cross-spawn@6.0.5/node_modules/cross-spawn/lib/parse.js"(exports, module2) {
|
|
1521
1494
|
"use strict";
|
|
1522
|
-
var
|
|
1495
|
+
var path = require("path");
|
|
1523
1496
|
var niceTry = require_src();
|
|
1524
1497
|
var resolveCommand = require_resolveCommand();
|
|
1525
|
-
var
|
|
1498
|
+
var escape = require_escape();
|
|
1526
1499
|
var readShebang = require_readShebang();
|
|
1527
1500
|
var semver2 = require_semver();
|
|
1528
1501
|
var isWin3 = process.platform === "win32";
|
|
@@ -1547,9 +1520,9 @@ var require_parse = __commonJS({
|
|
|
1547
1520
|
const needsShell = !isExecutableRegExp.test(commandFile);
|
|
1548
1521
|
if (parsed.options.forceShell || needsShell) {
|
|
1549
1522
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
1550
|
-
parsed.command =
|
|
1551
|
-
parsed.command =
|
|
1552
|
-
parsed.args = parsed.args.map((arg) =>
|
|
1523
|
+
parsed.command = path.normalize(parsed.command);
|
|
1524
|
+
parsed.command = escape.command(parsed.command);
|
|
1525
|
+
parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
|
|
1553
1526
|
const shellCommand = [parsed.command].concat(parsed.args).join(" ");
|
|
1554
1527
|
parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`];
|
|
1555
1528
|
parsed.command = process.env.comspec || "cmd.exe";
|
|
@@ -1700,7 +1673,7 @@ var require_strip_eof = __commonJS({
|
|
|
1700
1673
|
var require_npm_run_path = __commonJS({
|
|
1701
1674
|
"../../node_modules/.pnpm/npm-run-path@2.0.2/node_modules/npm-run-path/index.js"(exports, module2) {
|
|
1702
1675
|
"use strict";
|
|
1703
|
-
var
|
|
1676
|
+
var path = require("path");
|
|
1704
1677
|
var pathKey = require_path_key();
|
|
1705
1678
|
module2.exports = (opts) => {
|
|
1706
1679
|
opts = Object.assign({
|
|
@@ -1708,24 +1681,24 @@ var require_npm_run_path = __commonJS({
|
|
|
1708
1681
|
path: process.env[pathKey()]
|
|
1709
1682
|
}, opts);
|
|
1710
1683
|
let prev;
|
|
1711
|
-
let pth =
|
|
1684
|
+
let pth = path.resolve(opts.cwd);
|
|
1712
1685
|
const ret = [];
|
|
1713
1686
|
while (prev !== pth) {
|
|
1714
|
-
ret.push(
|
|
1687
|
+
ret.push(path.join(pth, "node_modules/.bin"));
|
|
1715
1688
|
prev = pth;
|
|
1716
|
-
pth =
|
|
1689
|
+
pth = path.resolve(pth, "..");
|
|
1717
1690
|
}
|
|
1718
|
-
ret.push(
|
|
1719
|
-
return ret.concat(opts.path).join(
|
|
1691
|
+
ret.push(path.dirname(process.execPath));
|
|
1692
|
+
return ret.concat(opts.path).join(path.delimiter);
|
|
1720
1693
|
};
|
|
1721
1694
|
module2.exports.env = (opts) => {
|
|
1722
1695
|
opts = Object.assign({
|
|
1723
1696
|
env: process.env
|
|
1724
1697
|
}, opts);
|
|
1725
1698
|
const env = Object.assign({}, opts.env);
|
|
1726
|
-
const
|
|
1727
|
-
opts.path = env[
|
|
1728
|
-
env[
|
|
1699
|
+
const path2 = pathKey({ env });
|
|
1700
|
+
opts.path = env[path2];
|
|
1701
|
+
env[path2] = module2.exports(opts);
|
|
1729
1702
|
return env;
|
|
1730
1703
|
};
|
|
1731
1704
|
}
|
|
@@ -2387,7 +2360,7 @@ var require_stdio = __commonJS({
|
|
|
2387
2360
|
var require_execa = __commonJS({
|
|
2388
2361
|
"../../node_modules/.pnpm/execa@1.0.0/node_modules/execa/index.js"(exports, module2) {
|
|
2389
2362
|
"use strict";
|
|
2390
|
-
var
|
|
2363
|
+
var path = require("path");
|
|
2391
2364
|
var childProcess = require("child_process");
|
|
2392
2365
|
var crossSpawn = require_cross_spawn();
|
|
2393
2366
|
var stripEof = require_strip_eof();
|
|
@@ -2440,7 +2413,7 @@ var require_execa = __commonJS({
|
|
|
2440
2413
|
if (opts.detached) {
|
|
2441
2414
|
opts.cleanup = false;
|
|
2442
2415
|
}
|
|
2443
|
-
if (process.platform === "win32" &&
|
|
2416
|
+
if (process.platform === "win32" && path.basename(parsed.command) === "cmd.exe") {
|
|
2444
2417
|
parsed.args.unshift("/q");
|
|
2445
2418
|
}
|
|
2446
2419
|
return {
|
|
@@ -2991,7 +2964,7 @@ var require_specifier = __commonJS({
|
|
|
2991
2964
|
RANGE_PATTERN,
|
|
2992
2965
|
parse: parse2,
|
|
2993
2966
|
satisfies,
|
|
2994
|
-
filter
|
|
2967
|
+
filter,
|
|
2995
2968
|
validRange,
|
|
2996
2969
|
maxSatisfying,
|
|
2997
2970
|
minSatisfying
|
|
@@ -3002,7 +2975,7 @@ var require_specifier = __commonJS({
|
|
|
3002
2975
|
if (!ranges.trim()) {
|
|
3003
2976
|
return [];
|
|
3004
2977
|
}
|
|
3005
|
-
const specifiers = ranges.split(",").map((
|
|
2978
|
+
const specifiers = ranges.split(",").map((range) => rangeRegex.exec(range.trim()) || {}).map(({ groups }) => {
|
|
3006
2979
|
if (!groups) {
|
|
3007
2980
|
return null;
|
|
3008
2981
|
}
|
|
@@ -3034,19 +3007,19 @@ var require_specifier = __commonJS({
|
|
|
3034
3007
|
}
|
|
3035
3008
|
return specifiers;
|
|
3036
3009
|
}
|
|
3037
|
-
function
|
|
3010
|
+
function filter(versions, specifier, options = {}) {
|
|
3038
3011
|
const filtered = pick(versions, specifier, options);
|
|
3039
3012
|
if (filtered.length === 0 && options.prereleases === void 0) {
|
|
3040
3013
|
return pick(versions, specifier, { prereleases: true });
|
|
3041
3014
|
}
|
|
3042
3015
|
return filtered;
|
|
3043
3016
|
}
|
|
3044
|
-
function maxSatisfying(versions,
|
|
3045
|
-
const found =
|
|
3017
|
+
function maxSatisfying(versions, range, options) {
|
|
3018
|
+
const found = filter(versions, range, options).sort(Operator.compare);
|
|
3046
3019
|
return found.length === 0 ? null : found[found.length - 1];
|
|
3047
3020
|
}
|
|
3048
|
-
function minSatisfying(versions,
|
|
3049
|
-
const found =
|
|
3021
|
+
function minSatisfying(versions, range, options) {
|
|
3022
|
+
const found = filter(versions, range, options).sort(Operator.compare);
|
|
3050
3023
|
return found.length === 0 ? null : found[0];
|
|
3051
3024
|
}
|
|
3052
3025
|
function pick(versions, specifier, options) {
|
|
@@ -3282,7 +3255,7 @@ var require_pep440 = __commonJS({
|
|
|
3282
3255
|
var { valid: valid2, clean, explain, parse: parse2 } = require_version();
|
|
3283
3256
|
var { lt, le, eq, ne, ge: ge2, gt, compare, rcompare } = require_operator();
|
|
3284
3257
|
var {
|
|
3285
|
-
filter
|
|
3258
|
+
filter,
|
|
3286
3259
|
maxSatisfying,
|
|
3287
3260
|
minSatisfying,
|
|
3288
3261
|
RANGE_PATTERN,
|
|
@@ -3309,7 +3282,7 @@ var require_pep440 = __commonJS({
|
|
|
3309
3282
|
compare,
|
|
3310
3283
|
rcompare,
|
|
3311
3284
|
// range
|
|
3312
|
-
filter
|
|
3285
|
+
filter,
|
|
3313
3286
|
maxSatisfying,
|
|
3314
3287
|
minSatisfying,
|
|
3315
3288
|
RANGE_PATTERN,
|
|
@@ -3328,9 +3301,9 @@ var require_pep440 = __commonJS({
|
|
|
3328
3301
|
var require_lib = __commonJS({
|
|
3329
3302
|
"../../node_modules/.pnpm/which@3.0.0/node_modules/which/lib/index.js"(exports, module2) {
|
|
3330
3303
|
var isexe = require_isexe();
|
|
3331
|
-
var { join: join21, delimiter: delimiter2, sep:
|
|
3304
|
+
var { join: join21, delimiter: delimiter2, sep: sep5, posix: posix4 } = require("path");
|
|
3332
3305
|
var isWindows = process.platform === "win32";
|
|
3333
|
-
var rSlash = new RegExp(`[${posix4.sep}${
|
|
3306
|
+
var rSlash = new RegExp(`[${posix4.sep}${sep5 === posix4.sep ? "" : sep5}]`.replace(/(\\)/g, "\\$1"));
|
|
3334
3307
|
var rRel = new RegExp(`^\\.${rSlash.source}`);
|
|
3335
3308
|
var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
3336
3309
|
var getPathInfo = (cmd, {
|
|
@@ -3364,8 +3337,8 @@ var require_lib = __commonJS({
|
|
|
3364
3337
|
const found = [];
|
|
3365
3338
|
for (const envPart of pathEnv) {
|
|
3366
3339
|
const p = getPathPart(envPart, cmd);
|
|
3367
|
-
for (const
|
|
3368
|
-
const withExt = p +
|
|
3340
|
+
for (const ext of pathExt) {
|
|
3341
|
+
const withExt = p + ext;
|
|
3369
3342
|
const is = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true });
|
|
3370
3343
|
if (is) {
|
|
3371
3344
|
if (!opt.all) {
|
|
@@ -3388,8 +3361,8 @@ var require_lib = __commonJS({
|
|
|
3388
3361
|
const found = [];
|
|
3389
3362
|
for (const pathEnvPart of pathEnv) {
|
|
3390
3363
|
const p = getPathPart(pathEnvPart, cmd);
|
|
3391
|
-
for (const
|
|
3392
|
-
const withExt = p +
|
|
3364
|
+
for (const ext of pathExt) {
|
|
3365
|
+
const withExt = p + ext;
|
|
3393
3366
|
const is = isexe.sync(withExt, { pathExt: pathExtExe, ignoreErrors: true });
|
|
3394
3367
|
if (is) {
|
|
3395
3368
|
if (!opt.all) {
|
|
@@ -3833,10 +3806,10 @@ var require_semver2 = __commonJS({
|
|
|
3833
3806
|
}
|
|
3834
3807
|
}
|
|
3835
3808
|
exports.compareIdentifiers = compareIdentifiers;
|
|
3836
|
-
var
|
|
3809
|
+
var numeric = /^[0-9]+$/;
|
|
3837
3810
|
function compareIdentifiers(a, b) {
|
|
3838
|
-
var anum =
|
|
3839
|
-
var bnum =
|
|
3811
|
+
var anum = numeric.test(a);
|
|
3812
|
+
var bnum = numeric.test(b);
|
|
3840
3813
|
if (anum && bnum) {
|
|
3841
3814
|
a = +a;
|
|
3842
3815
|
b = +b;
|
|
@@ -3905,12 +3878,12 @@ var require_semver2 = __commonJS({
|
|
|
3905
3878
|
function neq(a, b, loose) {
|
|
3906
3879
|
return compare(a, b, loose) !== 0;
|
|
3907
3880
|
}
|
|
3908
|
-
exports.gte =
|
|
3909
|
-
function
|
|
3881
|
+
exports.gte = gte;
|
|
3882
|
+
function gte(a, b, loose) {
|
|
3910
3883
|
return compare(a, b, loose) >= 0;
|
|
3911
3884
|
}
|
|
3912
|
-
exports.lte =
|
|
3913
|
-
function
|
|
3885
|
+
exports.lte = lte;
|
|
3886
|
+
function lte(a, b, loose) {
|
|
3914
3887
|
return compare(a, b, loose) <= 0;
|
|
3915
3888
|
}
|
|
3916
3889
|
exports.cmp = cmp;
|
|
@@ -3937,11 +3910,11 @@ var require_semver2 = __commonJS({
|
|
|
3937
3910
|
case ">":
|
|
3938
3911
|
return gt(a, b, loose);
|
|
3939
3912
|
case ">=":
|
|
3940
|
-
return
|
|
3913
|
+
return gte(a, b, loose);
|
|
3941
3914
|
case "<":
|
|
3942
3915
|
return lt(a, b, loose);
|
|
3943
3916
|
case "<=":
|
|
3944
|
-
return
|
|
3917
|
+
return lte(a, b, loose);
|
|
3945
3918
|
default:
|
|
3946
3919
|
throw new TypeError("Invalid operator: " + op);
|
|
3947
3920
|
}
|
|
@@ -4043,32 +4016,32 @@ var require_semver2 = __commonJS({
|
|
|
4043
4016
|
return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
|
|
4044
4017
|
};
|
|
4045
4018
|
exports.Range = Range;
|
|
4046
|
-
function Range(
|
|
4019
|
+
function Range(range, options) {
|
|
4047
4020
|
if (!options || typeof options !== "object") {
|
|
4048
4021
|
options = {
|
|
4049
4022
|
loose: !!options,
|
|
4050
4023
|
includePrerelease: false
|
|
4051
4024
|
};
|
|
4052
4025
|
}
|
|
4053
|
-
if (
|
|
4054
|
-
if (
|
|
4055
|
-
return
|
|
4026
|
+
if (range instanceof Range) {
|
|
4027
|
+
if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
|
|
4028
|
+
return range;
|
|
4056
4029
|
} else {
|
|
4057
|
-
return new Range(
|
|
4030
|
+
return new Range(range.raw, options);
|
|
4058
4031
|
}
|
|
4059
4032
|
}
|
|
4060
|
-
if (
|
|
4061
|
-
return new Range(
|
|
4033
|
+
if (range instanceof Comparator) {
|
|
4034
|
+
return new Range(range.value, options);
|
|
4062
4035
|
}
|
|
4063
4036
|
if (!(this instanceof Range)) {
|
|
4064
|
-
return new Range(
|
|
4037
|
+
return new Range(range, options);
|
|
4065
4038
|
}
|
|
4066
4039
|
this.options = options;
|
|
4067
4040
|
this.loose = !!options.loose;
|
|
4068
4041
|
this.includePrerelease = !!options.includePrerelease;
|
|
4069
|
-
this.raw =
|
|
4070
|
-
this.set = this.raw.split("||").map(function(
|
|
4071
|
-
return this.parseRange(
|
|
4042
|
+
this.raw = range.trim().split(/\s+/).join(" ");
|
|
4043
|
+
this.set = this.raw.split("||").map(function(range2) {
|
|
4044
|
+
return this.parseRange(range2.trim());
|
|
4072
4045
|
}, this).filter(function(c) {
|
|
4073
4046
|
return c.length;
|
|
4074
4047
|
});
|
|
@@ -4086,18 +4059,18 @@ var require_semver2 = __commonJS({
|
|
|
4086
4059
|
Range.prototype.toString = function() {
|
|
4087
4060
|
return this.range;
|
|
4088
4061
|
};
|
|
4089
|
-
Range.prototype.parseRange = function(
|
|
4062
|
+
Range.prototype.parseRange = function(range) {
|
|
4090
4063
|
var loose = this.options.loose;
|
|
4091
4064
|
var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE];
|
|
4092
|
-
|
|
4093
|
-
debug18("hyphen replace",
|
|
4094
|
-
|
|
4095
|
-
debug18("comparator trim",
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4065
|
+
range = range.replace(hr, hyphenReplace);
|
|
4066
|
+
debug18("hyphen replace", range);
|
|
4067
|
+
range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
4068
|
+
debug18("comparator trim", range, safeRe[t.COMPARATORTRIM]);
|
|
4069
|
+
range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace);
|
|
4070
|
+
range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace);
|
|
4071
|
+
range = range.split(/\s+/).join(" ");
|
|
4099
4072
|
var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR];
|
|
4100
|
-
var set =
|
|
4073
|
+
var set = range.split(" ").map(function(comp) {
|
|
4101
4074
|
return parseComparator(comp, this.options);
|
|
4102
4075
|
}, this).join(" ").split(/\s+/);
|
|
4103
4076
|
if (this.options.loose) {
|
|
@@ -4110,12 +4083,12 @@ var require_semver2 = __commonJS({
|
|
|
4110
4083
|
}, this);
|
|
4111
4084
|
return set;
|
|
4112
4085
|
};
|
|
4113
|
-
Range.prototype.intersects = function(
|
|
4114
|
-
if (!(
|
|
4086
|
+
Range.prototype.intersects = function(range, options) {
|
|
4087
|
+
if (!(range instanceof Range)) {
|
|
4115
4088
|
throw new TypeError("a Range is required");
|
|
4116
4089
|
}
|
|
4117
4090
|
return this.set.some(function(thisComparators) {
|
|
4118
|
-
return isSatisfiable(thisComparators, options) &&
|
|
4091
|
+
return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) {
|
|
4119
4092
|
return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) {
|
|
4120
4093
|
return rangeComparators.every(function(rangeComparator) {
|
|
4121
4094
|
return thisComparator.intersects(rangeComparator, options);
|
|
@@ -4137,8 +4110,8 @@ var require_semver2 = __commonJS({
|
|
|
4137
4110
|
return result;
|
|
4138
4111
|
}
|
|
4139
4112
|
exports.toComparators = toComparators;
|
|
4140
|
-
function toComparators(
|
|
4141
|
-
return new Range(
|
|
4113
|
+
function toComparators(range, options) {
|
|
4114
|
+
return new Range(range, options).set.map(function(comp) {
|
|
4142
4115
|
return comp.map(function(c) {
|
|
4143
4116
|
return c.value;
|
|
4144
4117
|
}).join(" ").trim().split(" ");
|
|
@@ -4360,20 +4333,20 @@ var require_semver2 = __commonJS({
|
|
|
4360
4333
|
return true;
|
|
4361
4334
|
}
|
|
4362
4335
|
exports.satisfies = satisfies;
|
|
4363
|
-
function satisfies(version2,
|
|
4336
|
+
function satisfies(version2, range, options) {
|
|
4364
4337
|
try {
|
|
4365
|
-
|
|
4338
|
+
range = new Range(range, options);
|
|
4366
4339
|
} catch (er) {
|
|
4367
4340
|
return false;
|
|
4368
4341
|
}
|
|
4369
|
-
return
|
|
4342
|
+
return range.test(version2);
|
|
4370
4343
|
}
|
|
4371
4344
|
exports.maxSatisfying = maxSatisfying;
|
|
4372
|
-
function maxSatisfying(versions,
|
|
4345
|
+
function maxSatisfying(versions, range, options) {
|
|
4373
4346
|
var max = null;
|
|
4374
4347
|
var maxSV = null;
|
|
4375
4348
|
try {
|
|
4376
|
-
var rangeObj = new Range(
|
|
4349
|
+
var rangeObj = new Range(range, options);
|
|
4377
4350
|
} catch (er) {
|
|
4378
4351
|
return null;
|
|
4379
4352
|
}
|
|
@@ -4388,11 +4361,11 @@ var require_semver2 = __commonJS({
|
|
|
4388
4361
|
return max;
|
|
4389
4362
|
}
|
|
4390
4363
|
exports.minSatisfying = minSatisfying;
|
|
4391
|
-
function minSatisfying(versions,
|
|
4364
|
+
function minSatisfying(versions, range, options) {
|
|
4392
4365
|
var min = null;
|
|
4393
4366
|
var minSV = null;
|
|
4394
4367
|
try {
|
|
4395
|
-
var rangeObj = new Range(
|
|
4368
|
+
var rangeObj = new Range(range, options);
|
|
4396
4369
|
} catch (er) {
|
|
4397
4370
|
return null;
|
|
4398
4371
|
}
|
|
@@ -4407,19 +4380,19 @@ var require_semver2 = __commonJS({
|
|
|
4407
4380
|
return min;
|
|
4408
4381
|
}
|
|
4409
4382
|
exports.minVersion = minVersion;
|
|
4410
|
-
function minVersion(
|
|
4411
|
-
|
|
4383
|
+
function minVersion(range, loose) {
|
|
4384
|
+
range = new Range(range, loose);
|
|
4412
4385
|
var minver = new SemVer("0.0.0");
|
|
4413
|
-
if (
|
|
4386
|
+
if (range.test(minver)) {
|
|
4414
4387
|
return minver;
|
|
4415
4388
|
}
|
|
4416
4389
|
minver = new SemVer("0.0.0-0");
|
|
4417
|
-
if (
|
|
4390
|
+
if (range.test(minver)) {
|
|
4418
4391
|
return minver;
|
|
4419
4392
|
}
|
|
4420
4393
|
minver = null;
|
|
4421
|
-
for (var i2 = 0; i2 <
|
|
4422
|
-
var comparators =
|
|
4394
|
+
for (var i2 = 0; i2 < range.set.length; ++i2) {
|
|
4395
|
+
var comparators = range.set[i2];
|
|
4423
4396
|
comparators.forEach(function(comparator) {
|
|
4424
4397
|
var compver = new SemVer(comparator.semver.version);
|
|
4425
4398
|
switch (comparator.operator) {
|
|
@@ -4444,43 +4417,43 @@ var require_semver2 = __commonJS({
|
|
|
4444
4417
|
}
|
|
4445
4418
|
});
|
|
4446
4419
|
}
|
|
4447
|
-
if (minver &&
|
|
4420
|
+
if (minver && range.test(minver)) {
|
|
4448
4421
|
return minver;
|
|
4449
4422
|
}
|
|
4450
4423
|
return null;
|
|
4451
4424
|
}
|
|
4452
4425
|
exports.validRange = validRange;
|
|
4453
|
-
function validRange(
|
|
4426
|
+
function validRange(range, options) {
|
|
4454
4427
|
try {
|
|
4455
|
-
return new Range(
|
|
4428
|
+
return new Range(range, options).range || "*";
|
|
4456
4429
|
} catch (er) {
|
|
4457
4430
|
return null;
|
|
4458
4431
|
}
|
|
4459
4432
|
}
|
|
4460
4433
|
exports.ltr = ltr;
|
|
4461
|
-
function ltr(version2,
|
|
4462
|
-
return outside(version2,
|
|
4434
|
+
function ltr(version2, range, options) {
|
|
4435
|
+
return outside(version2, range, "<", options);
|
|
4463
4436
|
}
|
|
4464
4437
|
exports.gtr = gtr;
|
|
4465
|
-
function gtr(version2,
|
|
4466
|
-
return outside(version2,
|
|
4438
|
+
function gtr(version2, range, options) {
|
|
4439
|
+
return outside(version2, range, ">", options);
|
|
4467
4440
|
}
|
|
4468
4441
|
exports.outside = outside;
|
|
4469
|
-
function outside(version2,
|
|
4442
|
+
function outside(version2, range, hilo, options) {
|
|
4470
4443
|
version2 = new SemVer(version2, options);
|
|
4471
|
-
|
|
4444
|
+
range = new Range(range, options);
|
|
4472
4445
|
var gtfn, ltefn, ltfn, comp, ecomp;
|
|
4473
4446
|
switch (hilo) {
|
|
4474
4447
|
case ">":
|
|
4475
4448
|
gtfn = gt;
|
|
4476
|
-
ltefn =
|
|
4449
|
+
ltefn = lte;
|
|
4477
4450
|
ltfn = lt;
|
|
4478
4451
|
comp = ">";
|
|
4479
4452
|
ecomp = ">=";
|
|
4480
4453
|
break;
|
|
4481
4454
|
case "<":
|
|
4482
4455
|
gtfn = lt;
|
|
4483
|
-
ltefn =
|
|
4456
|
+
ltefn = gte;
|
|
4484
4457
|
ltfn = gt;
|
|
4485
4458
|
comp = "<";
|
|
4486
4459
|
ecomp = "<=";
|
|
@@ -4488,11 +4461,11 @@ var require_semver2 = __commonJS({
|
|
|
4488
4461
|
default:
|
|
4489
4462
|
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
4490
4463
|
}
|
|
4491
|
-
if (satisfies(version2,
|
|
4464
|
+
if (satisfies(version2, range, options)) {
|
|
4492
4465
|
return false;
|
|
4493
4466
|
}
|
|
4494
|
-
for (var i2 = 0; i2 <
|
|
4495
|
-
var comparators =
|
|
4467
|
+
for (var i2 = 0; i2 < range.set.length; ++i2) {
|
|
4468
|
+
var comparators = range.set[i2];
|
|
4496
4469
|
var high = null;
|
|
4497
4470
|
var low = null;
|
|
4498
4471
|
comparators.forEach(function(comparator) {
|
|
@@ -4541,23 +4514,23 @@ var require_semver2 = __commonJS({
|
|
|
4541
4514
|
return null;
|
|
4542
4515
|
}
|
|
4543
4516
|
options = options || {};
|
|
4544
|
-
var
|
|
4517
|
+
var match = null;
|
|
4545
4518
|
if (!options.rtl) {
|
|
4546
|
-
|
|
4519
|
+
match = version2.match(safeRe[t.COERCE]);
|
|
4547
4520
|
} else {
|
|
4548
4521
|
var next;
|
|
4549
|
-
while ((next = safeRe[t.COERCERTL].exec(version2)) && (!
|
|
4550
|
-
if (!
|
|
4551
|
-
|
|
4522
|
+
while ((next = safeRe[t.COERCERTL].exec(version2)) && (!match || match.index + match[0].length !== version2.length)) {
|
|
4523
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) {
|
|
4524
|
+
match = next;
|
|
4552
4525
|
}
|
|
4553
4526
|
safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
|
|
4554
4527
|
}
|
|
4555
4528
|
safeRe[t.COERCERTL].lastIndex = -1;
|
|
4556
4529
|
}
|
|
4557
|
-
if (
|
|
4530
|
+
if (match === null) {
|
|
4558
4531
|
return null;
|
|
4559
4532
|
}
|
|
4560
|
-
return parse2(
|
|
4533
|
+
return parse2(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options);
|
|
4561
4534
|
}
|
|
4562
4535
|
}
|
|
4563
4536
|
});
|
|
@@ -4593,16 +4566,16 @@ var require_filesystem = __commonJS({
|
|
|
4593
4566
|
var LDD_PATH = "/usr/bin/ldd";
|
|
4594
4567
|
var SELF_PATH = "/proc/self/exe";
|
|
4595
4568
|
var MAX_LENGTH = 2048;
|
|
4596
|
-
var readFileSync2 = (
|
|
4597
|
-
const fd = fs19.openSync(
|
|
4569
|
+
var readFileSync2 = (path) => {
|
|
4570
|
+
const fd = fs19.openSync(path, "r");
|
|
4598
4571
|
const buffer = Buffer.alloc(MAX_LENGTH);
|
|
4599
4572
|
const bytesRead = fs19.readSync(fd, buffer, 0, MAX_LENGTH, 0);
|
|
4600
4573
|
fs19.close(fd, () => {
|
|
4601
4574
|
});
|
|
4602
4575
|
return buffer.subarray(0, bytesRead);
|
|
4603
4576
|
};
|
|
4604
|
-
var readFile2 = (
|
|
4605
|
-
fs19.open(
|
|
4577
|
+
var readFile2 = (path) => new Promise((resolve4, reject) => {
|
|
4578
|
+
fs19.open(path, "r", (err, fd) => {
|
|
4606
4579
|
if (err) {
|
|
4607
4580
|
reject(err);
|
|
4608
4581
|
} else {
|
|
@@ -4721,11 +4694,11 @@ var require_detect_libc = __commonJS({
|
|
|
4721
4694
|
}
|
|
4722
4695
|
return null;
|
|
4723
4696
|
};
|
|
4724
|
-
var familyFromInterpreterPath = (
|
|
4725
|
-
if (
|
|
4726
|
-
if (
|
|
4697
|
+
var familyFromInterpreterPath = (path) => {
|
|
4698
|
+
if (path) {
|
|
4699
|
+
if (path.includes("/ld-musl-")) {
|
|
4727
4700
|
return MUSL2;
|
|
4728
|
-
} else if (
|
|
4701
|
+
} else if (path.includes("/ld-linux-")) {
|
|
4729
4702
|
return GLIBC;
|
|
4730
4703
|
}
|
|
4731
4704
|
}
|
|
@@ -4772,8 +4745,8 @@ var require_detect_libc = __commonJS({
|
|
|
4772
4745
|
cachedFamilyInterpreter = null;
|
|
4773
4746
|
try {
|
|
4774
4747
|
const selfContent = await readFile2(SELF_PATH);
|
|
4775
|
-
const
|
|
4776
|
-
cachedFamilyInterpreter = familyFromInterpreterPath(
|
|
4748
|
+
const path = interpreterPath(selfContent);
|
|
4749
|
+
cachedFamilyInterpreter = familyFromInterpreterPath(path);
|
|
4777
4750
|
} catch (e) {
|
|
4778
4751
|
}
|
|
4779
4752
|
return cachedFamilyInterpreter;
|
|
@@ -4785,8 +4758,8 @@ var require_detect_libc = __commonJS({
|
|
|
4785
4758
|
cachedFamilyInterpreter = null;
|
|
4786
4759
|
try {
|
|
4787
4760
|
const selfContent = readFileSync2(SELF_PATH);
|
|
4788
|
-
const
|
|
4789
|
-
cachedFamilyInterpreter = familyFromInterpreterPath(
|
|
4761
|
+
const path = interpreterPath(selfContent);
|
|
4762
|
+
cachedFamilyInterpreter = familyFromInterpreterPath(path);
|
|
4790
4763
|
} catch (e) {
|
|
4791
4764
|
}
|
|
4792
4765
|
return cachedFamilyInterpreter;
|
|
@@ -5056,1591 +5029,10 @@ __export(src_exports, {
|
|
|
5056
5029
|
module.exports = __toCommonJS(src_exports);
|
|
5057
5030
|
var import_assert = __toESM(require("assert"));
|
|
5058
5031
|
var import_fs20 = __toESM(require("fs"));
|
|
5059
|
-
|
|
5060
|
-
// ../../node_modules/.pnpm/@isaacs+balanced-match@4.0.1/node_modules/@isaacs/balanced-match/dist/esm/index.js
|
|
5061
|
-
var balanced = (a, b, str) => {
|
|
5062
|
-
const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
|
|
5063
|
-
const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
|
|
5064
|
-
const r = ma !== null && mb != null && range(ma, mb, str);
|
|
5065
|
-
return r && {
|
|
5066
|
-
start: r[0],
|
|
5067
|
-
end: r[1],
|
|
5068
|
-
pre: str.slice(0, r[0]),
|
|
5069
|
-
body: str.slice(r[0] + ma.length, r[1]),
|
|
5070
|
-
post: str.slice(r[1] + mb.length)
|
|
5071
|
-
};
|
|
5072
|
-
};
|
|
5073
|
-
var maybeMatch = (reg, str) => {
|
|
5074
|
-
const m = str.match(reg);
|
|
5075
|
-
return m ? m[0] : null;
|
|
5076
|
-
};
|
|
5077
|
-
var range = (a, b, str) => {
|
|
5078
|
-
let begs, beg, left, right = void 0, result;
|
|
5079
|
-
let ai = str.indexOf(a);
|
|
5080
|
-
let bi = str.indexOf(b, ai + 1);
|
|
5081
|
-
let i = ai;
|
|
5082
|
-
if (ai >= 0 && bi > 0) {
|
|
5083
|
-
if (a === b) {
|
|
5084
|
-
return [ai, bi];
|
|
5085
|
-
}
|
|
5086
|
-
begs = [];
|
|
5087
|
-
left = str.length;
|
|
5088
|
-
while (i >= 0 && !result) {
|
|
5089
|
-
if (i === ai) {
|
|
5090
|
-
begs.push(i);
|
|
5091
|
-
ai = str.indexOf(a, i + 1);
|
|
5092
|
-
} else if (begs.length === 1) {
|
|
5093
|
-
const r = begs.pop();
|
|
5094
|
-
if (r !== void 0)
|
|
5095
|
-
result = [r, bi];
|
|
5096
|
-
} else {
|
|
5097
|
-
beg = begs.pop();
|
|
5098
|
-
if (beg !== void 0 && beg < left) {
|
|
5099
|
-
left = beg;
|
|
5100
|
-
right = bi;
|
|
5101
|
-
}
|
|
5102
|
-
bi = str.indexOf(b, i + 1);
|
|
5103
|
-
}
|
|
5104
|
-
i = ai < bi && ai >= 0 ? ai : bi;
|
|
5105
|
-
}
|
|
5106
|
-
if (begs.length && right !== void 0) {
|
|
5107
|
-
result = [left, right];
|
|
5108
|
-
}
|
|
5109
|
-
}
|
|
5110
|
-
return result;
|
|
5111
|
-
};
|
|
5112
|
-
|
|
5113
|
-
// ../../node_modules/.pnpm/@isaacs+brace-expansion@5.0.1/node_modules/@isaacs/brace-expansion/dist/esm/index.js
|
|
5114
|
-
var escSlash = "\0SLASH" + Math.random() + "\0";
|
|
5115
|
-
var escOpen = "\0OPEN" + Math.random() + "\0";
|
|
5116
|
-
var escClose = "\0CLOSE" + Math.random() + "\0";
|
|
5117
|
-
var escComma = "\0COMMA" + Math.random() + "\0";
|
|
5118
|
-
var escPeriod = "\0PERIOD" + Math.random() + "\0";
|
|
5119
|
-
var escSlashPattern = new RegExp(escSlash, "g");
|
|
5120
|
-
var escOpenPattern = new RegExp(escOpen, "g");
|
|
5121
|
-
var escClosePattern = new RegExp(escClose, "g");
|
|
5122
|
-
var escCommaPattern = new RegExp(escComma, "g");
|
|
5123
|
-
var escPeriodPattern = new RegExp(escPeriod, "g");
|
|
5124
|
-
var slashPattern = /\\\\/g;
|
|
5125
|
-
var openPattern = /\\{/g;
|
|
5126
|
-
var closePattern = /\\}/g;
|
|
5127
|
-
var commaPattern = /\\,/g;
|
|
5128
|
-
var periodPattern = /\\./g;
|
|
5129
|
-
var EXPANSION_MAX = 1e5;
|
|
5130
|
-
function numeric(str) {
|
|
5131
|
-
return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
|
|
5132
|
-
}
|
|
5133
|
-
function escapeBraces(str) {
|
|
5134
|
-
return str.replace(slashPattern, escSlash).replace(openPattern, escOpen).replace(closePattern, escClose).replace(commaPattern, escComma).replace(periodPattern, escPeriod);
|
|
5135
|
-
}
|
|
5136
|
-
function unescapeBraces(str) {
|
|
5137
|
-
return str.replace(escSlashPattern, "\\").replace(escOpenPattern, "{").replace(escClosePattern, "}").replace(escCommaPattern, ",").replace(escPeriodPattern, ".");
|
|
5138
|
-
}
|
|
5139
|
-
function parseCommaParts(str) {
|
|
5140
|
-
if (!str) {
|
|
5141
|
-
return [""];
|
|
5142
|
-
}
|
|
5143
|
-
const parts = [];
|
|
5144
|
-
const m = balanced("{", "}", str);
|
|
5145
|
-
if (!m) {
|
|
5146
|
-
return str.split(",");
|
|
5147
|
-
}
|
|
5148
|
-
const { pre, body, post } = m;
|
|
5149
|
-
const p = pre.split(",");
|
|
5150
|
-
p[p.length - 1] += "{" + body + "}";
|
|
5151
|
-
const postParts = parseCommaParts(post);
|
|
5152
|
-
if (post.length) {
|
|
5153
|
-
;
|
|
5154
|
-
p[p.length - 1] += postParts.shift();
|
|
5155
|
-
p.push.apply(p, postParts);
|
|
5156
|
-
}
|
|
5157
|
-
parts.push.apply(parts, p);
|
|
5158
|
-
return parts;
|
|
5159
|
-
}
|
|
5160
|
-
function expand(str, options = {}) {
|
|
5161
|
-
if (!str) {
|
|
5162
|
-
return [];
|
|
5163
|
-
}
|
|
5164
|
-
const { max = EXPANSION_MAX } = options;
|
|
5165
|
-
if (str.slice(0, 2) === "{}") {
|
|
5166
|
-
str = "\\{\\}" + str.slice(2);
|
|
5167
|
-
}
|
|
5168
|
-
return expand_(escapeBraces(str), max, true).map(unescapeBraces);
|
|
5169
|
-
}
|
|
5170
|
-
function embrace(str) {
|
|
5171
|
-
return "{" + str + "}";
|
|
5172
|
-
}
|
|
5173
|
-
function isPadded(el) {
|
|
5174
|
-
return /^-?0\d/.test(el);
|
|
5175
|
-
}
|
|
5176
|
-
function lte(i, y) {
|
|
5177
|
-
return i <= y;
|
|
5178
|
-
}
|
|
5179
|
-
function gte(i, y) {
|
|
5180
|
-
return i >= y;
|
|
5181
|
-
}
|
|
5182
|
-
function expand_(str, max, isTop) {
|
|
5183
|
-
const expansions = [];
|
|
5184
|
-
const m = balanced("{", "}", str);
|
|
5185
|
-
if (!m)
|
|
5186
|
-
return [str];
|
|
5187
|
-
const pre = m.pre;
|
|
5188
|
-
const post = m.post.length ? expand_(m.post, max, false) : [""];
|
|
5189
|
-
if (/\$$/.test(m.pre)) {
|
|
5190
|
-
for (let k = 0; k < post.length && k < max; k++) {
|
|
5191
|
-
const expansion = pre + "{" + m.body + "}" + post[k];
|
|
5192
|
-
expansions.push(expansion);
|
|
5193
|
-
}
|
|
5194
|
-
} else {
|
|
5195
|
-
const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
|
5196
|
-
const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
|
5197
|
-
const isSequence = isNumericSequence || isAlphaSequence;
|
|
5198
|
-
const isOptions = m.body.indexOf(",") >= 0;
|
|
5199
|
-
if (!isSequence && !isOptions) {
|
|
5200
|
-
if (m.post.match(/,(?!,).*\}/)) {
|
|
5201
|
-
str = m.pre + "{" + m.body + escClose + m.post;
|
|
5202
|
-
return expand_(str, max, true);
|
|
5203
|
-
}
|
|
5204
|
-
return [str];
|
|
5205
|
-
}
|
|
5206
|
-
let n;
|
|
5207
|
-
if (isSequence) {
|
|
5208
|
-
n = m.body.split(/\.\./);
|
|
5209
|
-
} else {
|
|
5210
|
-
n = parseCommaParts(m.body);
|
|
5211
|
-
if (n.length === 1 && n[0] !== void 0) {
|
|
5212
|
-
n = expand_(n[0], max, false).map(embrace);
|
|
5213
|
-
if (n.length === 1) {
|
|
5214
|
-
return post.map((p) => m.pre + n[0] + p);
|
|
5215
|
-
}
|
|
5216
|
-
}
|
|
5217
|
-
}
|
|
5218
|
-
let N;
|
|
5219
|
-
if (isSequence && n[0] !== void 0 && n[1] !== void 0) {
|
|
5220
|
-
const x = numeric(n[0]);
|
|
5221
|
-
const y = numeric(n[1]);
|
|
5222
|
-
const width = Math.max(n[0].length, n[1].length);
|
|
5223
|
-
let incr = n.length === 3 && n[2] !== void 0 ? Math.abs(numeric(n[2])) : 1;
|
|
5224
|
-
let test = lte;
|
|
5225
|
-
const reverse = y < x;
|
|
5226
|
-
if (reverse) {
|
|
5227
|
-
incr *= -1;
|
|
5228
|
-
test = gte;
|
|
5229
|
-
}
|
|
5230
|
-
const pad = n.some(isPadded);
|
|
5231
|
-
N = [];
|
|
5232
|
-
for (let i = x; test(i, y); i += incr) {
|
|
5233
|
-
let c;
|
|
5234
|
-
if (isAlphaSequence) {
|
|
5235
|
-
c = String.fromCharCode(i);
|
|
5236
|
-
if (c === "\\") {
|
|
5237
|
-
c = "";
|
|
5238
|
-
}
|
|
5239
|
-
} else {
|
|
5240
|
-
c = String(i);
|
|
5241
|
-
if (pad) {
|
|
5242
|
-
const need = width - c.length;
|
|
5243
|
-
if (need > 0) {
|
|
5244
|
-
const z = new Array(need + 1).join("0");
|
|
5245
|
-
if (i < 0) {
|
|
5246
|
-
c = "-" + z + c.slice(1);
|
|
5247
|
-
} else {
|
|
5248
|
-
c = z + c;
|
|
5249
|
-
}
|
|
5250
|
-
}
|
|
5251
|
-
}
|
|
5252
|
-
}
|
|
5253
|
-
N.push(c);
|
|
5254
|
-
}
|
|
5255
|
-
} else {
|
|
5256
|
-
N = [];
|
|
5257
|
-
for (let j = 0; j < n.length; j++) {
|
|
5258
|
-
N.push.apply(N, expand_(n[j], max, false));
|
|
5259
|
-
}
|
|
5260
|
-
}
|
|
5261
|
-
for (let j = 0; j < N.length; j++) {
|
|
5262
|
-
for (let k = 0; k < post.length && expansions.length < max; k++) {
|
|
5263
|
-
const expansion = pre + N[j] + post[k];
|
|
5264
|
-
if (!isTop || isSequence || expansion) {
|
|
5265
|
-
expansions.push(expansion);
|
|
5266
|
-
}
|
|
5267
|
-
}
|
|
5268
|
-
}
|
|
5269
|
-
}
|
|
5270
|
-
return expansions;
|
|
5271
|
-
}
|
|
5272
|
-
|
|
5273
|
-
// ../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/assert-valid-pattern.js
|
|
5274
|
-
var MAX_PATTERN_LENGTH = 1024 * 64;
|
|
5275
|
-
var assertValidPattern = (pattern) => {
|
|
5276
|
-
if (typeof pattern !== "string") {
|
|
5277
|
-
throw new TypeError("invalid pattern");
|
|
5278
|
-
}
|
|
5279
|
-
if (pattern.length > MAX_PATTERN_LENGTH) {
|
|
5280
|
-
throw new TypeError("pattern is too long");
|
|
5281
|
-
}
|
|
5282
|
-
};
|
|
5283
|
-
|
|
5284
|
-
// ../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/brace-expressions.js
|
|
5285
|
-
var posixClasses = {
|
|
5286
|
-
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
|
|
5287
|
-
"[:alpha:]": ["\\p{L}\\p{Nl}", true],
|
|
5288
|
-
"[:ascii:]": ["\\x00-\\x7f", false],
|
|
5289
|
-
"[:blank:]": ["\\p{Zs}\\t", true],
|
|
5290
|
-
"[:cntrl:]": ["\\p{Cc}", true],
|
|
5291
|
-
"[:digit:]": ["\\p{Nd}", true],
|
|
5292
|
-
"[:graph:]": ["\\p{Z}\\p{C}", true, true],
|
|
5293
|
-
"[:lower:]": ["\\p{Ll}", true],
|
|
5294
|
-
"[:print:]": ["\\p{C}", true],
|
|
5295
|
-
"[:punct:]": ["\\p{P}", true],
|
|
5296
|
-
"[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true],
|
|
5297
|
-
"[:upper:]": ["\\p{Lu}", true],
|
|
5298
|
-
"[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true],
|
|
5299
|
-
"[:xdigit:]": ["A-Fa-f0-9", false]
|
|
5300
|
-
};
|
|
5301
|
-
var braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&");
|
|
5302
|
-
var regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
5303
|
-
var rangesToString = (ranges) => ranges.join("");
|
|
5304
|
-
var parseClass = (glob2, position) => {
|
|
5305
|
-
const pos = position;
|
|
5306
|
-
if (glob2.charAt(pos) !== "[") {
|
|
5307
|
-
throw new Error("not in a brace expression");
|
|
5308
|
-
}
|
|
5309
|
-
const ranges = [];
|
|
5310
|
-
const negs = [];
|
|
5311
|
-
let i = pos + 1;
|
|
5312
|
-
let sawStart = false;
|
|
5313
|
-
let uflag = false;
|
|
5314
|
-
let escaping = false;
|
|
5315
|
-
let negate = false;
|
|
5316
|
-
let endPos = pos;
|
|
5317
|
-
let rangeStart = "";
|
|
5318
|
-
WHILE:
|
|
5319
|
-
while (i < glob2.length) {
|
|
5320
|
-
const c = glob2.charAt(i);
|
|
5321
|
-
if ((c === "!" || c === "^") && i === pos + 1) {
|
|
5322
|
-
negate = true;
|
|
5323
|
-
i++;
|
|
5324
|
-
continue;
|
|
5325
|
-
}
|
|
5326
|
-
if (c === "]" && sawStart && !escaping) {
|
|
5327
|
-
endPos = i + 1;
|
|
5328
|
-
break;
|
|
5329
|
-
}
|
|
5330
|
-
sawStart = true;
|
|
5331
|
-
if (c === "\\") {
|
|
5332
|
-
if (!escaping) {
|
|
5333
|
-
escaping = true;
|
|
5334
|
-
i++;
|
|
5335
|
-
continue;
|
|
5336
|
-
}
|
|
5337
|
-
}
|
|
5338
|
-
if (c === "[" && !escaping) {
|
|
5339
|
-
for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
|
|
5340
|
-
if (glob2.startsWith(cls, i)) {
|
|
5341
|
-
if (rangeStart) {
|
|
5342
|
-
return ["$.", false, glob2.length - pos, true];
|
|
5343
|
-
}
|
|
5344
|
-
i += cls.length;
|
|
5345
|
-
if (neg)
|
|
5346
|
-
negs.push(unip);
|
|
5347
|
-
else
|
|
5348
|
-
ranges.push(unip);
|
|
5349
|
-
uflag = uflag || u;
|
|
5350
|
-
continue WHILE;
|
|
5351
|
-
}
|
|
5352
|
-
}
|
|
5353
|
-
}
|
|
5354
|
-
escaping = false;
|
|
5355
|
-
if (rangeStart) {
|
|
5356
|
-
if (c > rangeStart) {
|
|
5357
|
-
ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c));
|
|
5358
|
-
} else if (c === rangeStart) {
|
|
5359
|
-
ranges.push(braceEscape(c));
|
|
5360
|
-
}
|
|
5361
|
-
rangeStart = "";
|
|
5362
|
-
i++;
|
|
5363
|
-
continue;
|
|
5364
|
-
}
|
|
5365
|
-
if (glob2.startsWith("-]", i + 1)) {
|
|
5366
|
-
ranges.push(braceEscape(c + "-"));
|
|
5367
|
-
i += 2;
|
|
5368
|
-
continue;
|
|
5369
|
-
}
|
|
5370
|
-
if (glob2.startsWith("-", i + 1)) {
|
|
5371
|
-
rangeStart = c;
|
|
5372
|
-
i += 2;
|
|
5373
|
-
continue;
|
|
5374
|
-
}
|
|
5375
|
-
ranges.push(braceEscape(c));
|
|
5376
|
-
i++;
|
|
5377
|
-
}
|
|
5378
|
-
if (endPos < i) {
|
|
5379
|
-
return ["", false, 0, false];
|
|
5380
|
-
}
|
|
5381
|
-
if (!ranges.length && !negs.length) {
|
|
5382
|
-
return ["$.", false, glob2.length - pos, true];
|
|
5383
|
-
}
|
|
5384
|
-
if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
|
|
5385
|
-
const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
|
|
5386
|
-
return [regexpEscape(r), false, endPos - pos, false];
|
|
5387
|
-
}
|
|
5388
|
-
const sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]";
|
|
5389
|
-
const snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
|
|
5390
|
-
const comb = ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs;
|
|
5391
|
-
return [comb, uflag, endPos - pos, true];
|
|
5392
|
-
};
|
|
5393
|
-
|
|
5394
|
-
// ../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/unescape.js
|
|
5395
|
-
var unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}) => {
|
|
5396
|
-
if (magicalBraces) {
|
|
5397
|
-
return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
|
|
5398
|
-
}
|
|
5399
|
-
return windowsPathsNoEscape ? s.replace(/\[([^\/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\{}])\]/g, "$1$2").replace(/\\([^\/{}])/g, "$1");
|
|
5400
|
-
};
|
|
5401
|
-
|
|
5402
|
-
// ../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/ast.js
|
|
5403
|
-
var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
|
|
5404
|
-
var isExtglobType = (c) => types.has(c);
|
|
5405
|
-
var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
|
5406
|
-
var startNoDot = "(?!\\.)";
|
|
5407
|
-
var addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
|
|
5408
|
-
var justDots = /* @__PURE__ */ new Set(["..", "."]);
|
|
5409
|
-
var reSpecials = new Set("().*{}+?[]^$\\!");
|
|
5410
|
-
var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
5411
|
-
var qmark = "[^/]";
|
|
5412
|
-
var star = qmark + "*?";
|
|
5413
|
-
var starNoEmpty = qmark + "+?";
|
|
5414
|
-
var _root, _hasMagic, _uflag, _parts, _parent, _parentIndex, _negs, _filledNegs, _options, _toString, _emptyExt, _fillNegs, fillNegs_fn, _parseAST, parseAST_fn, _partsToRegExp, partsToRegExp_fn, _parseGlob, parseGlob_fn;
|
|
5415
|
-
var _AST = class _AST {
|
|
5416
|
-
constructor(type, parent, options = {}) {
|
|
5417
|
-
__privateAdd(this, _fillNegs);
|
|
5418
|
-
__privateAdd(this, _partsToRegExp);
|
|
5419
|
-
__publicField(this, "type");
|
|
5420
|
-
__privateAdd(this, _root, void 0);
|
|
5421
|
-
__privateAdd(this, _hasMagic, void 0);
|
|
5422
|
-
__privateAdd(this, _uflag, false);
|
|
5423
|
-
__privateAdd(this, _parts, []);
|
|
5424
|
-
__privateAdd(this, _parent, void 0);
|
|
5425
|
-
__privateAdd(this, _parentIndex, void 0);
|
|
5426
|
-
__privateAdd(this, _negs, void 0);
|
|
5427
|
-
__privateAdd(this, _filledNegs, false);
|
|
5428
|
-
__privateAdd(this, _options, void 0);
|
|
5429
|
-
__privateAdd(this, _toString, void 0);
|
|
5430
|
-
// set to true if it's an extglob with no children
|
|
5431
|
-
// (which really means one child of '')
|
|
5432
|
-
__privateAdd(this, _emptyExt, false);
|
|
5433
|
-
this.type = type;
|
|
5434
|
-
if (type)
|
|
5435
|
-
__privateSet(this, _hasMagic, true);
|
|
5436
|
-
__privateSet(this, _parent, parent);
|
|
5437
|
-
__privateSet(this, _root, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _root) : this);
|
|
5438
|
-
__privateSet(this, _options, __privateGet(this, _root) === this ? options : __privateGet(__privateGet(this, _root), _options));
|
|
5439
|
-
__privateSet(this, _negs, __privateGet(this, _root) === this ? [] : __privateGet(__privateGet(this, _root), _negs));
|
|
5440
|
-
if (type === "!" && !__privateGet(__privateGet(this, _root), _filledNegs))
|
|
5441
|
-
__privateGet(this, _negs).push(this);
|
|
5442
|
-
__privateSet(this, _parentIndex, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0);
|
|
5443
|
-
}
|
|
5444
|
-
get hasMagic() {
|
|
5445
|
-
if (__privateGet(this, _hasMagic) !== void 0)
|
|
5446
|
-
return __privateGet(this, _hasMagic);
|
|
5447
|
-
for (const p of __privateGet(this, _parts)) {
|
|
5448
|
-
if (typeof p === "string")
|
|
5449
|
-
continue;
|
|
5450
|
-
if (p.type || p.hasMagic)
|
|
5451
|
-
return __privateSet(this, _hasMagic, true);
|
|
5452
|
-
}
|
|
5453
|
-
return __privateGet(this, _hasMagic);
|
|
5454
|
-
}
|
|
5455
|
-
// reconstructs the pattern
|
|
5456
|
-
toString() {
|
|
5457
|
-
if (__privateGet(this, _toString) !== void 0)
|
|
5458
|
-
return __privateGet(this, _toString);
|
|
5459
|
-
if (!this.type) {
|
|
5460
|
-
return __privateSet(this, _toString, __privateGet(this, _parts).map((p) => String(p)).join(""));
|
|
5461
|
-
} else {
|
|
5462
|
-
return __privateSet(this, _toString, this.type + "(" + __privateGet(this, _parts).map((p) => String(p)).join("|") + ")");
|
|
5463
|
-
}
|
|
5464
|
-
}
|
|
5465
|
-
push(...parts) {
|
|
5466
|
-
for (const p of parts) {
|
|
5467
|
-
if (p === "")
|
|
5468
|
-
continue;
|
|
5469
|
-
if (typeof p !== "string" && !(p instanceof _AST && __privateGet(p, _parent) === this)) {
|
|
5470
|
-
throw new Error("invalid part: " + p);
|
|
5471
|
-
}
|
|
5472
|
-
__privateGet(this, _parts).push(p);
|
|
5473
|
-
}
|
|
5474
|
-
}
|
|
5475
|
-
toJSON() {
|
|
5476
|
-
const ret = this.type === null ? __privateGet(this, _parts).slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...__privateGet(this, _parts).map((p) => p.toJSON())];
|
|
5477
|
-
if (this.isStart() && !this.type)
|
|
5478
|
-
ret.unshift([]);
|
|
5479
|
-
if (this.isEnd() && (this === __privateGet(this, _root) || __privateGet(__privateGet(this, _root), _filledNegs) && __privateGet(this, _parent)?.type === "!")) {
|
|
5480
|
-
ret.push({});
|
|
5481
|
-
}
|
|
5482
|
-
return ret;
|
|
5483
|
-
}
|
|
5484
|
-
isStart() {
|
|
5485
|
-
if (__privateGet(this, _root) === this)
|
|
5486
|
-
return true;
|
|
5487
|
-
if (!__privateGet(this, _parent)?.isStart())
|
|
5488
|
-
return false;
|
|
5489
|
-
if (__privateGet(this, _parentIndex) === 0)
|
|
5490
|
-
return true;
|
|
5491
|
-
const p = __privateGet(this, _parent);
|
|
5492
|
-
for (let i = 0; i < __privateGet(this, _parentIndex); i++) {
|
|
5493
|
-
const pp = __privateGet(p, _parts)[i];
|
|
5494
|
-
if (!(pp instanceof _AST && pp.type === "!")) {
|
|
5495
|
-
return false;
|
|
5496
|
-
}
|
|
5497
|
-
}
|
|
5498
|
-
return true;
|
|
5499
|
-
}
|
|
5500
|
-
isEnd() {
|
|
5501
|
-
if (__privateGet(this, _root) === this)
|
|
5502
|
-
return true;
|
|
5503
|
-
if (__privateGet(this, _parent)?.type === "!")
|
|
5504
|
-
return true;
|
|
5505
|
-
if (!__privateGet(this, _parent)?.isEnd())
|
|
5506
|
-
return false;
|
|
5507
|
-
if (!this.type)
|
|
5508
|
-
return __privateGet(this, _parent)?.isEnd();
|
|
5509
|
-
const pl = __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0;
|
|
5510
|
-
return __privateGet(this, _parentIndex) === pl - 1;
|
|
5511
|
-
}
|
|
5512
|
-
copyIn(part) {
|
|
5513
|
-
if (typeof part === "string")
|
|
5514
|
-
this.push(part);
|
|
5515
|
-
else
|
|
5516
|
-
this.push(part.clone(this));
|
|
5517
|
-
}
|
|
5518
|
-
clone(parent) {
|
|
5519
|
-
const c = new _AST(this.type, parent);
|
|
5520
|
-
for (const p of __privateGet(this, _parts)) {
|
|
5521
|
-
c.copyIn(p);
|
|
5522
|
-
}
|
|
5523
|
-
return c;
|
|
5524
|
-
}
|
|
5525
|
-
static fromGlob(pattern, options = {}) {
|
|
5526
|
-
var _a;
|
|
5527
|
-
const ast = new _AST(null, void 0, options);
|
|
5528
|
-
__privateMethod(_a = _AST, _parseAST, parseAST_fn).call(_a, pattern, ast, 0, options);
|
|
5529
|
-
return ast;
|
|
5530
|
-
}
|
|
5531
|
-
// returns the regular expression if there's magic, or the unescaped
|
|
5532
|
-
// string if not.
|
|
5533
|
-
toMMPattern() {
|
|
5534
|
-
if (this !== __privateGet(this, _root))
|
|
5535
|
-
return __privateGet(this, _root).toMMPattern();
|
|
5536
|
-
const glob2 = this.toString();
|
|
5537
|
-
const [re, body, hasMagic, uflag] = this.toRegExpSource();
|
|
5538
|
-
const anyMagic = hasMagic || __privateGet(this, _hasMagic) || __privateGet(this, _options).nocase && !__privateGet(this, _options).nocaseMagicOnly && glob2.toUpperCase() !== glob2.toLowerCase();
|
|
5539
|
-
if (!anyMagic) {
|
|
5540
|
-
return body;
|
|
5541
|
-
}
|
|
5542
|
-
const flags = (__privateGet(this, _options).nocase ? "i" : "") + (uflag ? "u" : "");
|
|
5543
|
-
return Object.assign(new RegExp(`^${re}$`, flags), {
|
|
5544
|
-
_src: re,
|
|
5545
|
-
_glob: glob2
|
|
5546
|
-
});
|
|
5547
|
-
}
|
|
5548
|
-
get options() {
|
|
5549
|
-
return __privateGet(this, _options);
|
|
5550
|
-
}
|
|
5551
|
-
// returns the string match, the regexp source, whether there's magic
|
|
5552
|
-
// in the regexp (so a regular expression is required) and whether or
|
|
5553
|
-
// not the uflag is needed for the regular expression (for posix classes)
|
|
5554
|
-
// TODO: instead of injecting the start/end at this point, just return
|
|
5555
|
-
// the BODY of the regexp, along with the start/end portions suitable
|
|
5556
|
-
// for binding the start/end in either a joined full-path makeRe context
|
|
5557
|
-
// (where we bind to (^|/), or a standalone matchPart context (where
|
|
5558
|
-
// we bind to ^, and not /). Otherwise slashes get duped!
|
|
5559
|
-
//
|
|
5560
|
-
// In part-matching mode, the start is:
|
|
5561
|
-
// - if not isStart: nothing
|
|
5562
|
-
// - if traversal possible, but not allowed: ^(?!\.\.?$)
|
|
5563
|
-
// - if dots allowed or not possible: ^
|
|
5564
|
-
// - if dots possible and not allowed: ^(?!\.)
|
|
5565
|
-
// end is:
|
|
5566
|
-
// - if not isEnd(): nothing
|
|
5567
|
-
// - else: $
|
|
5568
|
-
//
|
|
5569
|
-
// In full-path matching mode, we put the slash at the START of the
|
|
5570
|
-
// pattern, so start is:
|
|
5571
|
-
// - if first pattern: same as part-matching mode
|
|
5572
|
-
// - if not isStart(): nothing
|
|
5573
|
-
// - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
|
|
5574
|
-
// - if dots allowed or not possible: /
|
|
5575
|
-
// - if dots possible and not allowed: /(?!\.)
|
|
5576
|
-
// end is:
|
|
5577
|
-
// - if last pattern, same as part-matching mode
|
|
5578
|
-
// - else nothing
|
|
5579
|
-
//
|
|
5580
|
-
// Always put the (?:$|/) on negated tails, though, because that has to be
|
|
5581
|
-
// there to bind the end of the negated pattern portion, and it's easier to
|
|
5582
|
-
// just stick it in now rather than try to inject it later in the middle of
|
|
5583
|
-
// the pattern.
|
|
5584
|
-
//
|
|
5585
|
-
// We can just always return the same end, and leave it up to the caller
|
|
5586
|
-
// to know whether it's going to be used joined or in parts.
|
|
5587
|
-
// And, if the start is adjusted slightly, can do the same there:
|
|
5588
|
-
// - if not isStart: nothing
|
|
5589
|
-
// - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
|
|
5590
|
-
// - if dots allowed or not possible: (?:/|^)
|
|
5591
|
-
// - if dots possible and not allowed: (?:/|^)(?!\.)
|
|
5592
|
-
//
|
|
5593
|
-
// But it's better to have a simpler binding without a conditional, for
|
|
5594
|
-
// performance, so probably better to return both start options.
|
|
5595
|
-
//
|
|
5596
|
-
// Then the caller just ignores the end if it's not the first pattern,
|
|
5597
|
-
// and the start always gets applied.
|
|
5598
|
-
//
|
|
5599
|
-
// But that's always going to be $ if it's the ending pattern, or nothing,
|
|
5600
|
-
// so the caller can just attach $ at the end of the pattern when building.
|
|
5601
|
-
//
|
|
5602
|
-
// So the todo is:
|
|
5603
|
-
// - better detect what kind of start is needed
|
|
5604
|
-
// - return both flavors of starting pattern
|
|
5605
|
-
// - attach $ at the end of the pattern when creating the actual RegExp
|
|
5606
|
-
//
|
|
5607
|
-
// Ah, but wait, no, that all only applies to the root when the first pattern
|
|
5608
|
-
// is not an extglob. If the first pattern IS an extglob, then we need all
|
|
5609
|
-
// that dot prevention biz to live in the extglob portions, because eg
|
|
5610
|
-
// +(*|.x*) can match .xy but not .yx.
|
|
5611
|
-
//
|
|
5612
|
-
// So, return the two flavors if it's #root and the first child is not an
|
|
5613
|
-
// AST, otherwise leave it to the child AST to handle it, and there,
|
|
5614
|
-
// use the (?:^|/) style of start binding.
|
|
5615
|
-
//
|
|
5616
|
-
// Even simplified further:
|
|
5617
|
-
// - Since the start for a join is eg /(?!\.) and the start for a part
|
|
5618
|
-
// is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
|
|
5619
|
-
// or start or whatever) and prepend ^ or / at the Regexp construction.
|
|
5620
|
-
toRegExpSource(allowDot) {
|
|
5621
|
-
const dot = allowDot ?? !!__privateGet(this, _options).dot;
|
|
5622
|
-
if (__privateGet(this, _root) === this)
|
|
5623
|
-
__privateMethod(this, _fillNegs, fillNegs_fn).call(this);
|
|
5624
|
-
if (!this.type) {
|
|
5625
|
-
const noEmpty = this.isStart() && this.isEnd() && !__privateGet(this, _parts).some((s) => typeof s !== "string");
|
|
5626
|
-
const src = __privateGet(this, _parts).map((p) => {
|
|
5627
|
-
var _a;
|
|
5628
|
-
const [re, _, hasMagic, uflag] = typeof p === "string" ? __privateMethod(_a = _AST, _parseGlob, parseGlob_fn).call(_a, p, __privateGet(this, _hasMagic), noEmpty) : p.toRegExpSource(allowDot);
|
|
5629
|
-
__privateSet(this, _hasMagic, __privateGet(this, _hasMagic) || hasMagic);
|
|
5630
|
-
__privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
|
|
5631
|
-
return re;
|
|
5632
|
-
}).join("");
|
|
5633
|
-
let start2 = "";
|
|
5634
|
-
if (this.isStart()) {
|
|
5635
|
-
if (typeof __privateGet(this, _parts)[0] === "string") {
|
|
5636
|
-
const dotTravAllowed = __privateGet(this, _parts).length === 1 && justDots.has(__privateGet(this, _parts)[0]);
|
|
5637
|
-
if (!dotTravAllowed) {
|
|
5638
|
-
const aps = addPatternStart;
|
|
5639
|
-
const needNoTrav = (
|
|
5640
|
-
// dots are allowed, and the pattern starts with [ or .
|
|
5641
|
-
dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or .
|
|
5642
|
-
src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or .
|
|
5643
|
-
src.startsWith("\\.\\.") && aps.has(src.charAt(4))
|
|
5644
|
-
);
|
|
5645
|
-
const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
|
|
5646
|
-
start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
|
|
5647
|
-
}
|
|
5648
|
-
}
|
|
5649
|
-
}
|
|
5650
|
-
let end = "";
|
|
5651
|
-
if (this.isEnd() && __privateGet(__privateGet(this, _root), _filledNegs) && __privateGet(this, _parent)?.type === "!") {
|
|
5652
|
-
end = "(?:$|\\/)";
|
|
5653
|
-
}
|
|
5654
|
-
const final2 = start2 + src + end;
|
|
5655
|
-
return [
|
|
5656
|
-
final2,
|
|
5657
|
-
unescape(src),
|
|
5658
|
-
__privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
|
|
5659
|
-
__privateGet(this, _uflag)
|
|
5660
|
-
];
|
|
5661
|
-
}
|
|
5662
|
-
const repeated = this.type === "*" || this.type === "+";
|
|
5663
|
-
const start = this.type === "!" ? "(?:(?!(?:" : "(?:";
|
|
5664
|
-
let body = __privateMethod(this, _partsToRegExp, partsToRegExp_fn).call(this, dot);
|
|
5665
|
-
if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
|
|
5666
|
-
const s = this.toString();
|
|
5667
|
-
__privateSet(this, _parts, [s]);
|
|
5668
|
-
this.type = null;
|
|
5669
|
-
__privateSet(this, _hasMagic, void 0);
|
|
5670
|
-
return [s, unescape(this.toString()), false, false];
|
|
5671
|
-
}
|
|
5672
|
-
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : __privateMethod(this, _partsToRegExp, partsToRegExp_fn).call(this, true);
|
|
5673
|
-
if (bodyDotAllowed === body) {
|
|
5674
|
-
bodyDotAllowed = "";
|
|
5675
|
-
}
|
|
5676
|
-
if (bodyDotAllowed) {
|
|
5677
|
-
body = `(?:${body})(?:${bodyDotAllowed})*?`;
|
|
5678
|
-
}
|
|
5679
|
-
let final = "";
|
|
5680
|
-
if (this.type === "!" && __privateGet(this, _emptyExt)) {
|
|
5681
|
-
final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
|
|
5682
|
-
} else {
|
|
5683
|
-
const close = this.type === "!" ? (
|
|
5684
|
-
// !() must match something,but !(x) can match ''
|
|
5685
|
-
"))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + star + ")"
|
|
5686
|
-
) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`;
|
|
5687
|
-
final = start + body + close;
|
|
5688
|
-
}
|
|
5689
|
-
return [
|
|
5690
|
-
final,
|
|
5691
|
-
unescape(body),
|
|
5692
|
-
__privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
|
|
5693
|
-
__privateGet(this, _uflag)
|
|
5694
|
-
];
|
|
5695
|
-
}
|
|
5696
|
-
};
|
|
5697
|
-
_root = new WeakMap();
|
|
5698
|
-
_hasMagic = new WeakMap();
|
|
5699
|
-
_uflag = new WeakMap();
|
|
5700
|
-
_parts = new WeakMap();
|
|
5701
|
-
_parent = new WeakMap();
|
|
5702
|
-
_parentIndex = new WeakMap();
|
|
5703
|
-
_negs = new WeakMap();
|
|
5704
|
-
_filledNegs = new WeakMap();
|
|
5705
|
-
_options = new WeakMap();
|
|
5706
|
-
_toString = new WeakMap();
|
|
5707
|
-
_emptyExt = new WeakMap();
|
|
5708
|
-
_fillNegs = new WeakSet();
|
|
5709
|
-
fillNegs_fn = function() {
|
|
5710
|
-
if (this !== __privateGet(this, _root))
|
|
5711
|
-
throw new Error("should only call on root");
|
|
5712
|
-
if (__privateGet(this, _filledNegs))
|
|
5713
|
-
return this;
|
|
5714
|
-
this.toString();
|
|
5715
|
-
__privateSet(this, _filledNegs, true);
|
|
5716
|
-
let n;
|
|
5717
|
-
while (n = __privateGet(this, _negs).pop()) {
|
|
5718
|
-
if (n.type !== "!")
|
|
5719
|
-
continue;
|
|
5720
|
-
let p = n;
|
|
5721
|
-
let pp = __privateGet(p, _parent);
|
|
5722
|
-
while (pp) {
|
|
5723
|
-
for (let i = __privateGet(p, _parentIndex) + 1; !pp.type && i < __privateGet(pp, _parts).length; i++) {
|
|
5724
|
-
for (const part of __privateGet(n, _parts)) {
|
|
5725
|
-
if (typeof part === "string") {
|
|
5726
|
-
throw new Error("string part in extglob AST??");
|
|
5727
|
-
}
|
|
5728
|
-
part.copyIn(__privateGet(pp, _parts)[i]);
|
|
5729
|
-
}
|
|
5730
|
-
}
|
|
5731
|
-
p = pp;
|
|
5732
|
-
pp = __privateGet(p, _parent);
|
|
5733
|
-
}
|
|
5734
|
-
}
|
|
5735
|
-
return this;
|
|
5736
|
-
};
|
|
5737
|
-
_parseAST = new WeakSet();
|
|
5738
|
-
parseAST_fn = function(str, ast, pos, opt) {
|
|
5739
|
-
var _a, _b;
|
|
5740
|
-
let escaping = false;
|
|
5741
|
-
let inBrace = false;
|
|
5742
|
-
let braceStart = -1;
|
|
5743
|
-
let braceNeg = false;
|
|
5744
|
-
if (ast.type === null) {
|
|
5745
|
-
let i2 = pos;
|
|
5746
|
-
let acc2 = "";
|
|
5747
|
-
while (i2 < str.length) {
|
|
5748
|
-
const c = str.charAt(i2++);
|
|
5749
|
-
if (escaping || c === "\\") {
|
|
5750
|
-
escaping = !escaping;
|
|
5751
|
-
acc2 += c;
|
|
5752
|
-
continue;
|
|
5753
|
-
}
|
|
5754
|
-
if (inBrace) {
|
|
5755
|
-
if (i2 === braceStart + 1) {
|
|
5756
|
-
if (c === "^" || c === "!") {
|
|
5757
|
-
braceNeg = true;
|
|
5758
|
-
}
|
|
5759
|
-
} else if (c === "]" && !(i2 === braceStart + 2 && braceNeg)) {
|
|
5760
|
-
inBrace = false;
|
|
5761
|
-
}
|
|
5762
|
-
acc2 += c;
|
|
5763
|
-
continue;
|
|
5764
|
-
} else if (c === "[") {
|
|
5765
|
-
inBrace = true;
|
|
5766
|
-
braceStart = i2;
|
|
5767
|
-
braceNeg = false;
|
|
5768
|
-
acc2 += c;
|
|
5769
|
-
continue;
|
|
5770
|
-
}
|
|
5771
|
-
if (!opt.noext && isExtglobType(c) && str.charAt(i2) === "(") {
|
|
5772
|
-
ast.push(acc2);
|
|
5773
|
-
acc2 = "";
|
|
5774
|
-
const ext2 = new _AST(c, ast);
|
|
5775
|
-
i2 = __privateMethod(_a = _AST, _parseAST, parseAST_fn).call(_a, str, ext2, i2, opt);
|
|
5776
|
-
ast.push(ext2);
|
|
5777
|
-
continue;
|
|
5778
|
-
}
|
|
5779
|
-
acc2 += c;
|
|
5780
|
-
}
|
|
5781
|
-
ast.push(acc2);
|
|
5782
|
-
return i2;
|
|
5783
|
-
}
|
|
5784
|
-
let i = pos + 1;
|
|
5785
|
-
let part = new _AST(null, ast);
|
|
5786
|
-
const parts = [];
|
|
5787
|
-
let acc = "";
|
|
5788
|
-
while (i < str.length) {
|
|
5789
|
-
const c = str.charAt(i++);
|
|
5790
|
-
if (escaping || c === "\\") {
|
|
5791
|
-
escaping = !escaping;
|
|
5792
|
-
acc += c;
|
|
5793
|
-
continue;
|
|
5794
|
-
}
|
|
5795
|
-
if (inBrace) {
|
|
5796
|
-
if (i === braceStart + 1) {
|
|
5797
|
-
if (c === "^" || c === "!") {
|
|
5798
|
-
braceNeg = true;
|
|
5799
|
-
}
|
|
5800
|
-
} else if (c === "]" && !(i === braceStart + 2 && braceNeg)) {
|
|
5801
|
-
inBrace = false;
|
|
5802
|
-
}
|
|
5803
|
-
acc += c;
|
|
5804
|
-
continue;
|
|
5805
|
-
} else if (c === "[") {
|
|
5806
|
-
inBrace = true;
|
|
5807
|
-
braceStart = i;
|
|
5808
|
-
braceNeg = false;
|
|
5809
|
-
acc += c;
|
|
5810
|
-
continue;
|
|
5811
|
-
}
|
|
5812
|
-
if (isExtglobType(c) && str.charAt(i) === "(") {
|
|
5813
|
-
part.push(acc);
|
|
5814
|
-
acc = "";
|
|
5815
|
-
const ext2 = new _AST(c, part);
|
|
5816
|
-
part.push(ext2);
|
|
5817
|
-
i = __privateMethod(_b = _AST, _parseAST, parseAST_fn).call(_b, str, ext2, i, opt);
|
|
5818
|
-
continue;
|
|
5819
|
-
}
|
|
5820
|
-
if (c === "|") {
|
|
5821
|
-
part.push(acc);
|
|
5822
|
-
acc = "";
|
|
5823
|
-
parts.push(part);
|
|
5824
|
-
part = new _AST(null, ast);
|
|
5825
|
-
continue;
|
|
5826
|
-
}
|
|
5827
|
-
if (c === ")") {
|
|
5828
|
-
if (acc === "" && __privateGet(ast, _parts).length === 0) {
|
|
5829
|
-
__privateSet(ast, _emptyExt, true);
|
|
5830
|
-
}
|
|
5831
|
-
part.push(acc);
|
|
5832
|
-
acc = "";
|
|
5833
|
-
ast.push(...parts, part);
|
|
5834
|
-
return i;
|
|
5835
|
-
}
|
|
5836
|
-
acc += c;
|
|
5837
|
-
}
|
|
5838
|
-
ast.type = null;
|
|
5839
|
-
__privateSet(ast, _hasMagic, void 0);
|
|
5840
|
-
__privateSet(ast, _parts, [str.substring(pos - 1)]);
|
|
5841
|
-
return i;
|
|
5842
|
-
};
|
|
5843
|
-
_partsToRegExp = new WeakSet();
|
|
5844
|
-
partsToRegExp_fn = function(dot) {
|
|
5845
|
-
return __privateGet(this, _parts).map((p) => {
|
|
5846
|
-
if (typeof p === "string") {
|
|
5847
|
-
throw new Error("string type in extglob ast??");
|
|
5848
|
-
}
|
|
5849
|
-
const [re, _, _hasMagic2, uflag] = p.toRegExpSource(dot);
|
|
5850
|
-
__privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
|
|
5851
|
-
return re;
|
|
5852
|
-
}).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
|
|
5853
|
-
};
|
|
5854
|
-
_parseGlob = new WeakSet();
|
|
5855
|
-
parseGlob_fn = function(glob2, hasMagic, noEmpty = false) {
|
|
5856
|
-
let escaping = false;
|
|
5857
|
-
let re = "";
|
|
5858
|
-
let uflag = false;
|
|
5859
|
-
for (let i = 0; i < glob2.length; i++) {
|
|
5860
|
-
const c = glob2.charAt(i);
|
|
5861
|
-
if (escaping) {
|
|
5862
|
-
escaping = false;
|
|
5863
|
-
re += (reSpecials.has(c) ? "\\" : "") + c;
|
|
5864
|
-
continue;
|
|
5865
|
-
}
|
|
5866
|
-
if (c === "\\") {
|
|
5867
|
-
if (i === glob2.length - 1) {
|
|
5868
|
-
re += "\\\\";
|
|
5869
|
-
} else {
|
|
5870
|
-
escaping = true;
|
|
5871
|
-
}
|
|
5872
|
-
continue;
|
|
5873
|
-
}
|
|
5874
|
-
if (c === "[") {
|
|
5875
|
-
const [src, needUflag, consumed, magic] = parseClass(glob2, i);
|
|
5876
|
-
if (consumed) {
|
|
5877
|
-
re += src;
|
|
5878
|
-
uflag = uflag || needUflag;
|
|
5879
|
-
i += consumed - 1;
|
|
5880
|
-
hasMagic = hasMagic || magic;
|
|
5881
|
-
continue;
|
|
5882
|
-
}
|
|
5883
|
-
}
|
|
5884
|
-
if (c === "*") {
|
|
5885
|
-
re += noEmpty && glob2 === "*" ? starNoEmpty : star;
|
|
5886
|
-
hasMagic = true;
|
|
5887
|
-
continue;
|
|
5888
|
-
}
|
|
5889
|
-
if (c === "?") {
|
|
5890
|
-
re += qmark;
|
|
5891
|
-
hasMagic = true;
|
|
5892
|
-
continue;
|
|
5893
|
-
}
|
|
5894
|
-
re += regExpEscape(c);
|
|
5895
|
-
}
|
|
5896
|
-
return [re, unescape(glob2), !!hasMagic, uflag];
|
|
5897
|
-
};
|
|
5898
|
-
__privateAdd(_AST, _parseAST);
|
|
5899
|
-
__privateAdd(_AST, _parseGlob);
|
|
5900
|
-
var AST = _AST;
|
|
5901
|
-
|
|
5902
|
-
// ../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/escape.js
|
|
5903
|
-
var escape = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => {
|
|
5904
|
-
if (magicalBraces) {
|
|
5905
|
-
return windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&");
|
|
5906
|
-
}
|
|
5907
|
-
return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
|
|
5908
|
-
};
|
|
5909
|
-
|
|
5910
|
-
// ../../node_modules/.pnpm/minimatch@10.1.1/node_modules/minimatch/dist/esm/index.js
|
|
5911
|
-
var minimatch = (p, pattern, options = {}) => {
|
|
5912
|
-
assertValidPattern(pattern);
|
|
5913
|
-
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
5914
|
-
return false;
|
|
5915
|
-
}
|
|
5916
|
-
return new Minimatch(pattern, options).match(p);
|
|
5917
|
-
};
|
|
5918
|
-
var starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
|
|
5919
|
-
var starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2);
|
|
5920
|
-
var starDotExtTestDot = (ext2) => (f) => f.endsWith(ext2);
|
|
5921
|
-
var starDotExtTestNocase = (ext2) => {
|
|
5922
|
-
ext2 = ext2.toLowerCase();
|
|
5923
|
-
return (f) => !f.startsWith(".") && f.toLowerCase().endsWith(ext2);
|
|
5924
|
-
};
|
|
5925
|
-
var starDotExtTestNocaseDot = (ext2) => {
|
|
5926
|
-
ext2 = ext2.toLowerCase();
|
|
5927
|
-
return (f) => f.toLowerCase().endsWith(ext2);
|
|
5928
|
-
};
|
|
5929
|
-
var starDotStarRE = /^\*+\.\*+$/;
|
|
5930
|
-
var starDotStarTest = (f) => !f.startsWith(".") && f.includes(".");
|
|
5931
|
-
var starDotStarTestDot = (f) => f !== "." && f !== ".." && f.includes(".");
|
|
5932
|
-
var dotStarRE = /^\.\*+$/;
|
|
5933
|
-
var dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith(".");
|
|
5934
|
-
var starRE = /^\*+$/;
|
|
5935
|
-
var starTest = (f) => f.length !== 0 && !f.startsWith(".");
|
|
5936
|
-
var starTestDot = (f) => f.length !== 0 && f !== "." && f !== "..";
|
|
5937
|
-
var qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
|
|
5938
|
-
var qmarksTestNocase = ([$0, ext2 = ""]) => {
|
|
5939
|
-
const noext = qmarksTestNoExt([$0]);
|
|
5940
|
-
if (!ext2)
|
|
5941
|
-
return noext;
|
|
5942
|
-
ext2 = ext2.toLowerCase();
|
|
5943
|
-
return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
|
|
5944
|
-
};
|
|
5945
|
-
var qmarksTestNocaseDot = ([$0, ext2 = ""]) => {
|
|
5946
|
-
const noext = qmarksTestNoExtDot([$0]);
|
|
5947
|
-
if (!ext2)
|
|
5948
|
-
return noext;
|
|
5949
|
-
ext2 = ext2.toLowerCase();
|
|
5950
|
-
return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
|
|
5951
|
-
};
|
|
5952
|
-
var qmarksTestDot = ([$0, ext2 = ""]) => {
|
|
5953
|
-
const noext = qmarksTestNoExtDot([$0]);
|
|
5954
|
-
return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
|
|
5955
|
-
};
|
|
5956
|
-
var qmarksTest = ([$0, ext2 = ""]) => {
|
|
5957
|
-
const noext = qmarksTestNoExt([$0]);
|
|
5958
|
-
return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
|
|
5959
|
-
};
|
|
5960
|
-
var qmarksTestNoExt = ([$0]) => {
|
|
5961
|
-
const len = $0.length;
|
|
5962
|
-
return (f) => f.length === len && !f.startsWith(".");
|
|
5963
|
-
};
|
|
5964
|
-
var qmarksTestNoExtDot = ([$0]) => {
|
|
5965
|
-
const len = $0.length;
|
|
5966
|
-
return (f) => f.length === len && f !== "." && f !== "..";
|
|
5967
|
-
};
|
|
5968
|
-
var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
|
|
5969
|
-
var path = {
|
|
5970
|
-
win32: { sep: "\\" },
|
|
5971
|
-
posix: { sep: "/" }
|
|
5972
|
-
};
|
|
5973
|
-
var sep = defaultPlatform === "win32" ? path.win32.sep : path.posix.sep;
|
|
5974
|
-
minimatch.sep = sep;
|
|
5975
|
-
var GLOBSTAR = Symbol("globstar **");
|
|
5976
|
-
minimatch.GLOBSTAR = GLOBSTAR;
|
|
5977
|
-
var qmark2 = "[^/]";
|
|
5978
|
-
var star2 = qmark2 + "*?";
|
|
5979
|
-
var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
|
|
5980
|
-
var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
|
|
5981
|
-
var filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
|
|
5982
|
-
minimatch.filter = filter;
|
|
5983
|
-
var ext = (a, b = {}) => Object.assign({}, a, b);
|
|
5984
|
-
var defaults = (def) => {
|
|
5985
|
-
if (!def || typeof def !== "object" || !Object.keys(def).length) {
|
|
5986
|
-
return minimatch;
|
|
5987
|
-
}
|
|
5988
|
-
const orig = minimatch;
|
|
5989
|
-
const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
|
|
5990
|
-
return Object.assign(m, {
|
|
5991
|
-
Minimatch: class Minimatch extends orig.Minimatch {
|
|
5992
|
-
constructor(pattern, options = {}) {
|
|
5993
|
-
super(pattern, ext(def, options));
|
|
5994
|
-
}
|
|
5995
|
-
static defaults(options) {
|
|
5996
|
-
return orig.defaults(ext(def, options)).Minimatch;
|
|
5997
|
-
}
|
|
5998
|
-
},
|
|
5999
|
-
AST: class AST extends orig.AST {
|
|
6000
|
-
/* c8 ignore start */
|
|
6001
|
-
constructor(type, parent, options = {}) {
|
|
6002
|
-
super(type, parent, ext(def, options));
|
|
6003
|
-
}
|
|
6004
|
-
/* c8 ignore stop */
|
|
6005
|
-
static fromGlob(pattern, options = {}) {
|
|
6006
|
-
return orig.AST.fromGlob(pattern, ext(def, options));
|
|
6007
|
-
}
|
|
6008
|
-
},
|
|
6009
|
-
unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
|
|
6010
|
-
escape: (s, options = {}) => orig.escape(s, ext(def, options)),
|
|
6011
|
-
filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
|
|
6012
|
-
defaults: (options) => orig.defaults(ext(def, options)),
|
|
6013
|
-
makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
|
|
6014
|
-
braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
|
|
6015
|
-
match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
|
|
6016
|
-
sep: orig.sep,
|
|
6017
|
-
GLOBSTAR
|
|
6018
|
-
});
|
|
6019
|
-
};
|
|
6020
|
-
minimatch.defaults = defaults;
|
|
6021
|
-
var braceExpand = (pattern, options = {}) => {
|
|
6022
|
-
assertValidPattern(pattern);
|
|
6023
|
-
if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
|
|
6024
|
-
return [pattern];
|
|
6025
|
-
}
|
|
6026
|
-
return expand(pattern);
|
|
6027
|
-
};
|
|
6028
|
-
minimatch.braceExpand = braceExpand;
|
|
6029
|
-
var makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
|
|
6030
|
-
minimatch.makeRe = makeRe;
|
|
6031
|
-
var match = (list, pattern, options = {}) => {
|
|
6032
|
-
const mm = new Minimatch(pattern, options);
|
|
6033
|
-
list = list.filter((f) => mm.match(f));
|
|
6034
|
-
if (mm.options.nonull && !list.length) {
|
|
6035
|
-
list.push(pattern);
|
|
6036
|
-
}
|
|
6037
|
-
return list;
|
|
6038
|
-
};
|
|
6039
|
-
minimatch.match = match;
|
|
6040
|
-
var globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
|
|
6041
|
-
var regExpEscape2 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
6042
|
-
var Minimatch = class {
|
|
6043
|
-
constructor(pattern, options = {}) {
|
|
6044
|
-
__publicField(this, "options");
|
|
6045
|
-
__publicField(this, "set");
|
|
6046
|
-
__publicField(this, "pattern");
|
|
6047
|
-
__publicField(this, "windowsPathsNoEscape");
|
|
6048
|
-
__publicField(this, "nonegate");
|
|
6049
|
-
__publicField(this, "negate");
|
|
6050
|
-
__publicField(this, "comment");
|
|
6051
|
-
__publicField(this, "empty");
|
|
6052
|
-
__publicField(this, "preserveMultipleSlashes");
|
|
6053
|
-
__publicField(this, "partial");
|
|
6054
|
-
__publicField(this, "globSet");
|
|
6055
|
-
__publicField(this, "globParts");
|
|
6056
|
-
__publicField(this, "nocase");
|
|
6057
|
-
__publicField(this, "isWindows");
|
|
6058
|
-
__publicField(this, "platform");
|
|
6059
|
-
__publicField(this, "windowsNoMagicRoot");
|
|
6060
|
-
__publicField(this, "regexp");
|
|
6061
|
-
assertValidPattern(pattern);
|
|
6062
|
-
options = options || {};
|
|
6063
|
-
this.options = options;
|
|
6064
|
-
this.pattern = pattern;
|
|
6065
|
-
this.platform = options.platform || defaultPlatform;
|
|
6066
|
-
this.isWindows = this.platform === "win32";
|
|
6067
|
-
this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
|
|
6068
|
-
if (this.windowsPathsNoEscape) {
|
|
6069
|
-
this.pattern = this.pattern.replace(/\\/g, "/");
|
|
6070
|
-
}
|
|
6071
|
-
this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
|
|
6072
|
-
this.regexp = null;
|
|
6073
|
-
this.negate = false;
|
|
6074
|
-
this.nonegate = !!options.nonegate;
|
|
6075
|
-
this.comment = false;
|
|
6076
|
-
this.empty = false;
|
|
6077
|
-
this.partial = !!options.partial;
|
|
6078
|
-
this.nocase = !!this.options.nocase;
|
|
6079
|
-
this.windowsNoMagicRoot = options.windowsNoMagicRoot !== void 0 ? options.windowsNoMagicRoot : !!(this.isWindows && this.nocase);
|
|
6080
|
-
this.globSet = [];
|
|
6081
|
-
this.globParts = [];
|
|
6082
|
-
this.set = [];
|
|
6083
|
-
this.make();
|
|
6084
|
-
}
|
|
6085
|
-
hasMagic() {
|
|
6086
|
-
if (this.options.magicalBraces && this.set.length > 1) {
|
|
6087
|
-
return true;
|
|
6088
|
-
}
|
|
6089
|
-
for (const pattern of this.set) {
|
|
6090
|
-
for (const part of pattern) {
|
|
6091
|
-
if (typeof part !== "string")
|
|
6092
|
-
return true;
|
|
6093
|
-
}
|
|
6094
|
-
}
|
|
6095
|
-
return false;
|
|
6096
|
-
}
|
|
6097
|
-
debug(..._) {
|
|
6098
|
-
}
|
|
6099
|
-
make() {
|
|
6100
|
-
const pattern = this.pattern;
|
|
6101
|
-
const options = this.options;
|
|
6102
|
-
if (!options.nocomment && pattern.charAt(0) === "#") {
|
|
6103
|
-
this.comment = true;
|
|
6104
|
-
return;
|
|
6105
|
-
}
|
|
6106
|
-
if (!pattern) {
|
|
6107
|
-
this.empty = true;
|
|
6108
|
-
return;
|
|
6109
|
-
}
|
|
6110
|
-
this.parseNegate();
|
|
6111
|
-
this.globSet = [...new Set(this.braceExpand())];
|
|
6112
|
-
if (options.debug) {
|
|
6113
|
-
this.debug = (...args) => console.error(...args);
|
|
6114
|
-
}
|
|
6115
|
-
this.debug(this.pattern, this.globSet);
|
|
6116
|
-
const rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
|
|
6117
|
-
this.globParts = this.preprocess(rawGlobParts);
|
|
6118
|
-
this.debug(this.pattern, this.globParts);
|
|
6119
|
-
let set = this.globParts.map((s, _, __) => {
|
|
6120
|
-
if (this.isWindows && this.windowsNoMagicRoot) {
|
|
6121
|
-
const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
|
|
6122
|
-
const isDrive = /^[a-z]:/i.test(s[0]);
|
|
6123
|
-
if (isUNC) {
|
|
6124
|
-
return [...s.slice(0, 4), ...s.slice(4).map((ss) => this.parse(ss))];
|
|
6125
|
-
} else if (isDrive) {
|
|
6126
|
-
return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
|
|
6127
|
-
}
|
|
6128
|
-
}
|
|
6129
|
-
return s.map((ss) => this.parse(ss));
|
|
6130
|
-
});
|
|
6131
|
-
this.debug(this.pattern, set);
|
|
6132
|
-
this.set = set.filter((s) => s.indexOf(false) === -1);
|
|
6133
|
-
if (this.isWindows) {
|
|
6134
|
-
for (let i = 0; i < this.set.length; i++) {
|
|
6135
|
-
const p = this.set[i];
|
|
6136
|
-
if (p[0] === "" && p[1] === "" && this.globParts[i][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) {
|
|
6137
|
-
p[2] = "?";
|
|
6138
|
-
}
|
|
6139
|
-
}
|
|
6140
|
-
}
|
|
6141
|
-
this.debug(this.pattern, this.set);
|
|
6142
|
-
}
|
|
6143
|
-
// various transforms to equivalent pattern sets that are
|
|
6144
|
-
// faster to process in a filesystem walk. The goal is to
|
|
6145
|
-
// eliminate what we can, and push all ** patterns as far
|
|
6146
|
-
// to the right as possible, even if it increases the number
|
|
6147
|
-
// of patterns that we have to process.
|
|
6148
|
-
preprocess(globParts) {
|
|
6149
|
-
if (this.options.noglobstar) {
|
|
6150
|
-
for (let i = 0; i < globParts.length; i++) {
|
|
6151
|
-
for (let j = 0; j < globParts[i].length; j++) {
|
|
6152
|
-
if (globParts[i][j] === "**") {
|
|
6153
|
-
globParts[i][j] = "*";
|
|
6154
|
-
}
|
|
6155
|
-
}
|
|
6156
|
-
}
|
|
6157
|
-
}
|
|
6158
|
-
const { optimizationLevel = 1 } = this.options;
|
|
6159
|
-
if (optimizationLevel >= 2) {
|
|
6160
|
-
globParts = this.firstPhasePreProcess(globParts);
|
|
6161
|
-
globParts = this.secondPhasePreProcess(globParts);
|
|
6162
|
-
} else if (optimizationLevel >= 1) {
|
|
6163
|
-
globParts = this.levelOneOptimize(globParts);
|
|
6164
|
-
} else {
|
|
6165
|
-
globParts = this.adjascentGlobstarOptimize(globParts);
|
|
6166
|
-
}
|
|
6167
|
-
return globParts;
|
|
6168
|
-
}
|
|
6169
|
-
// just get rid of adjascent ** portions
|
|
6170
|
-
adjascentGlobstarOptimize(globParts) {
|
|
6171
|
-
return globParts.map((parts) => {
|
|
6172
|
-
let gs = -1;
|
|
6173
|
-
while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
|
|
6174
|
-
let i = gs;
|
|
6175
|
-
while (parts[i + 1] === "**") {
|
|
6176
|
-
i++;
|
|
6177
|
-
}
|
|
6178
|
-
if (i !== gs) {
|
|
6179
|
-
parts.splice(gs, i - gs);
|
|
6180
|
-
}
|
|
6181
|
-
}
|
|
6182
|
-
return parts;
|
|
6183
|
-
});
|
|
6184
|
-
}
|
|
6185
|
-
// get rid of adjascent ** and resolve .. portions
|
|
6186
|
-
levelOneOptimize(globParts) {
|
|
6187
|
-
return globParts.map((parts) => {
|
|
6188
|
-
parts = parts.reduce((set, part) => {
|
|
6189
|
-
const prev = set[set.length - 1];
|
|
6190
|
-
if (part === "**" && prev === "**") {
|
|
6191
|
-
return set;
|
|
6192
|
-
}
|
|
6193
|
-
if (part === "..") {
|
|
6194
|
-
if (prev && prev !== ".." && prev !== "." && prev !== "**") {
|
|
6195
|
-
set.pop();
|
|
6196
|
-
return set;
|
|
6197
|
-
}
|
|
6198
|
-
}
|
|
6199
|
-
set.push(part);
|
|
6200
|
-
return set;
|
|
6201
|
-
}, []);
|
|
6202
|
-
return parts.length === 0 ? [""] : parts;
|
|
6203
|
-
});
|
|
6204
|
-
}
|
|
6205
|
-
levelTwoFileOptimize(parts) {
|
|
6206
|
-
if (!Array.isArray(parts)) {
|
|
6207
|
-
parts = this.slashSplit(parts);
|
|
6208
|
-
}
|
|
6209
|
-
let didSomething = false;
|
|
6210
|
-
do {
|
|
6211
|
-
didSomething = false;
|
|
6212
|
-
if (!this.preserveMultipleSlashes) {
|
|
6213
|
-
for (let i = 1; i < parts.length - 1; i++) {
|
|
6214
|
-
const p = parts[i];
|
|
6215
|
-
if (i === 1 && p === "" && parts[0] === "")
|
|
6216
|
-
continue;
|
|
6217
|
-
if (p === "." || p === "") {
|
|
6218
|
-
didSomething = true;
|
|
6219
|
-
parts.splice(i, 1);
|
|
6220
|
-
i--;
|
|
6221
|
-
}
|
|
6222
|
-
}
|
|
6223
|
-
if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
|
|
6224
|
-
didSomething = true;
|
|
6225
|
-
parts.pop();
|
|
6226
|
-
}
|
|
6227
|
-
}
|
|
6228
|
-
let dd = 0;
|
|
6229
|
-
while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
|
|
6230
|
-
const p = parts[dd - 1];
|
|
6231
|
-
if (p && p !== "." && p !== ".." && p !== "**") {
|
|
6232
|
-
didSomething = true;
|
|
6233
|
-
parts.splice(dd - 1, 2);
|
|
6234
|
-
dd -= 2;
|
|
6235
|
-
}
|
|
6236
|
-
}
|
|
6237
|
-
} while (didSomething);
|
|
6238
|
-
return parts.length === 0 ? [""] : parts;
|
|
6239
|
-
}
|
|
6240
|
-
// First phase: single-pattern processing
|
|
6241
|
-
// <pre> is 1 or more portions
|
|
6242
|
-
// <rest> is 1 or more portions
|
|
6243
|
-
// <p> is any portion other than ., .., '', or **
|
|
6244
|
-
// <e> is . or ''
|
|
6245
|
-
//
|
|
6246
|
-
// **/.. is *brutal* for filesystem walking performance, because
|
|
6247
|
-
// it effectively resets the recursive walk each time it occurs,
|
|
6248
|
-
// and ** cannot be reduced out by a .. pattern part like a regexp
|
|
6249
|
-
// or most strings (other than .., ., and '') can be.
|
|
6250
|
-
//
|
|
6251
|
-
// <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
|
|
6252
|
-
// <pre>/<e>/<rest> -> <pre>/<rest>
|
|
6253
|
-
// <pre>/<p>/../<rest> -> <pre>/<rest>
|
|
6254
|
-
// **/**/<rest> -> **/<rest>
|
|
6255
|
-
//
|
|
6256
|
-
// **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
|
|
6257
|
-
// this WOULD be allowed if ** did follow symlinks, or * didn't
|
|
6258
|
-
firstPhasePreProcess(globParts) {
|
|
6259
|
-
let didSomething = false;
|
|
6260
|
-
do {
|
|
6261
|
-
didSomething = false;
|
|
6262
|
-
for (let parts of globParts) {
|
|
6263
|
-
let gs = -1;
|
|
6264
|
-
while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
|
|
6265
|
-
let gss = gs;
|
|
6266
|
-
while (parts[gss + 1] === "**") {
|
|
6267
|
-
gss++;
|
|
6268
|
-
}
|
|
6269
|
-
if (gss > gs) {
|
|
6270
|
-
parts.splice(gs + 1, gss - gs);
|
|
6271
|
-
}
|
|
6272
|
-
let next = parts[gs + 1];
|
|
6273
|
-
const p = parts[gs + 2];
|
|
6274
|
-
const p2 = parts[gs + 3];
|
|
6275
|
-
if (next !== "..")
|
|
6276
|
-
continue;
|
|
6277
|
-
if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..") {
|
|
6278
|
-
continue;
|
|
6279
|
-
}
|
|
6280
|
-
didSomething = true;
|
|
6281
|
-
parts.splice(gs, 1);
|
|
6282
|
-
const other = parts.slice(0);
|
|
6283
|
-
other[gs] = "**";
|
|
6284
|
-
globParts.push(other);
|
|
6285
|
-
gs--;
|
|
6286
|
-
}
|
|
6287
|
-
if (!this.preserveMultipleSlashes) {
|
|
6288
|
-
for (let i = 1; i < parts.length - 1; i++) {
|
|
6289
|
-
const p = parts[i];
|
|
6290
|
-
if (i === 1 && p === "" && parts[0] === "")
|
|
6291
|
-
continue;
|
|
6292
|
-
if (p === "." || p === "") {
|
|
6293
|
-
didSomething = true;
|
|
6294
|
-
parts.splice(i, 1);
|
|
6295
|
-
i--;
|
|
6296
|
-
}
|
|
6297
|
-
}
|
|
6298
|
-
if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
|
|
6299
|
-
didSomething = true;
|
|
6300
|
-
parts.pop();
|
|
6301
|
-
}
|
|
6302
|
-
}
|
|
6303
|
-
let dd = 0;
|
|
6304
|
-
while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
|
|
6305
|
-
const p = parts[dd - 1];
|
|
6306
|
-
if (p && p !== "." && p !== ".." && p !== "**") {
|
|
6307
|
-
didSomething = true;
|
|
6308
|
-
const needDot = dd === 1 && parts[dd + 1] === "**";
|
|
6309
|
-
const splin = needDot ? ["."] : [];
|
|
6310
|
-
parts.splice(dd - 1, 2, ...splin);
|
|
6311
|
-
if (parts.length === 0)
|
|
6312
|
-
parts.push("");
|
|
6313
|
-
dd -= 2;
|
|
6314
|
-
}
|
|
6315
|
-
}
|
|
6316
|
-
}
|
|
6317
|
-
} while (didSomething);
|
|
6318
|
-
return globParts;
|
|
6319
|
-
}
|
|
6320
|
-
// second phase: multi-pattern dedupes
|
|
6321
|
-
// {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
|
|
6322
|
-
// {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
|
|
6323
|
-
// {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
|
|
6324
|
-
//
|
|
6325
|
-
// {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
|
|
6326
|
-
// ^-- not valid because ** doens't follow symlinks
|
|
6327
|
-
secondPhasePreProcess(globParts) {
|
|
6328
|
-
for (let i = 0; i < globParts.length - 1; i++) {
|
|
6329
|
-
for (let j = i + 1; j < globParts.length; j++) {
|
|
6330
|
-
const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
|
|
6331
|
-
if (matched) {
|
|
6332
|
-
globParts[i] = [];
|
|
6333
|
-
globParts[j] = matched;
|
|
6334
|
-
break;
|
|
6335
|
-
}
|
|
6336
|
-
}
|
|
6337
|
-
}
|
|
6338
|
-
return globParts.filter((gs) => gs.length);
|
|
6339
|
-
}
|
|
6340
|
-
partsMatch(a, b, emptyGSMatch = false) {
|
|
6341
|
-
let ai = 0;
|
|
6342
|
-
let bi = 0;
|
|
6343
|
-
let result = [];
|
|
6344
|
-
let which2 = "";
|
|
6345
|
-
while (ai < a.length && bi < b.length) {
|
|
6346
|
-
if (a[ai] === b[bi]) {
|
|
6347
|
-
result.push(which2 === "b" ? b[bi] : a[ai]);
|
|
6348
|
-
ai++;
|
|
6349
|
-
bi++;
|
|
6350
|
-
} else if (emptyGSMatch && a[ai] === "**" && b[bi] === a[ai + 1]) {
|
|
6351
|
-
result.push(a[ai]);
|
|
6352
|
-
ai++;
|
|
6353
|
-
} else if (emptyGSMatch && b[bi] === "**" && a[ai] === b[bi + 1]) {
|
|
6354
|
-
result.push(b[bi]);
|
|
6355
|
-
bi++;
|
|
6356
|
-
} else if (a[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
|
|
6357
|
-
if (which2 === "b")
|
|
6358
|
-
return false;
|
|
6359
|
-
which2 = "a";
|
|
6360
|
-
result.push(a[ai]);
|
|
6361
|
-
ai++;
|
|
6362
|
-
bi++;
|
|
6363
|
-
} else if (b[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
|
|
6364
|
-
if (which2 === "a")
|
|
6365
|
-
return false;
|
|
6366
|
-
which2 = "b";
|
|
6367
|
-
result.push(b[bi]);
|
|
6368
|
-
ai++;
|
|
6369
|
-
bi++;
|
|
6370
|
-
} else {
|
|
6371
|
-
return false;
|
|
6372
|
-
}
|
|
6373
|
-
}
|
|
6374
|
-
return a.length === b.length && result;
|
|
6375
|
-
}
|
|
6376
|
-
parseNegate() {
|
|
6377
|
-
if (this.nonegate)
|
|
6378
|
-
return;
|
|
6379
|
-
const pattern = this.pattern;
|
|
6380
|
-
let negate = false;
|
|
6381
|
-
let negateOffset = 0;
|
|
6382
|
-
for (let i = 0; i < pattern.length && pattern.charAt(i) === "!"; i++) {
|
|
6383
|
-
negate = !negate;
|
|
6384
|
-
negateOffset++;
|
|
6385
|
-
}
|
|
6386
|
-
if (negateOffset)
|
|
6387
|
-
this.pattern = pattern.slice(negateOffset);
|
|
6388
|
-
this.negate = negate;
|
|
6389
|
-
}
|
|
6390
|
-
// set partial to true to test if, for example,
|
|
6391
|
-
// "/a/b" matches the start of "/*/b/*/d"
|
|
6392
|
-
// Partial means, if you run out of file before you run
|
|
6393
|
-
// out of pattern, then that's fine, as long as all
|
|
6394
|
-
// the parts match.
|
|
6395
|
-
matchOne(file, pattern, partial = false) {
|
|
6396
|
-
const options = this.options;
|
|
6397
|
-
if (this.isWindows) {
|
|
6398
|
-
const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
|
|
6399
|
-
const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
|
|
6400
|
-
const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]);
|
|
6401
|
-
const patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]);
|
|
6402
|
-
const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
|
|
6403
|
-
const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
|
|
6404
|
-
if (typeof fdi === "number" && typeof pdi === "number") {
|
|
6405
|
-
const [fd, pd] = [file[fdi], pattern[pdi]];
|
|
6406
|
-
if (fd.toLowerCase() === pd.toLowerCase()) {
|
|
6407
|
-
pattern[pdi] = fd;
|
|
6408
|
-
if (pdi > fdi) {
|
|
6409
|
-
pattern = pattern.slice(pdi);
|
|
6410
|
-
} else if (fdi > pdi) {
|
|
6411
|
-
file = file.slice(fdi);
|
|
6412
|
-
}
|
|
6413
|
-
}
|
|
6414
|
-
}
|
|
6415
|
-
}
|
|
6416
|
-
const { optimizationLevel = 1 } = this.options;
|
|
6417
|
-
if (optimizationLevel >= 2) {
|
|
6418
|
-
file = this.levelTwoFileOptimize(file);
|
|
6419
|
-
}
|
|
6420
|
-
this.debug("matchOne", this, { file, pattern });
|
|
6421
|
-
this.debug("matchOne", file.length, pattern.length);
|
|
6422
|
-
for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
|
|
6423
|
-
this.debug("matchOne loop");
|
|
6424
|
-
var p = pattern[pi];
|
|
6425
|
-
var f = file[fi];
|
|
6426
|
-
this.debug(pattern, p, f);
|
|
6427
|
-
if (p === false) {
|
|
6428
|
-
return false;
|
|
6429
|
-
}
|
|
6430
|
-
if (p === GLOBSTAR) {
|
|
6431
|
-
this.debug("GLOBSTAR", [pattern, p, f]);
|
|
6432
|
-
var fr = fi;
|
|
6433
|
-
var pr = pi + 1;
|
|
6434
|
-
if (pr === pl) {
|
|
6435
|
-
this.debug("** at the end");
|
|
6436
|
-
for (; fi < fl; fi++) {
|
|
6437
|
-
if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
|
|
6438
|
-
return false;
|
|
6439
|
-
}
|
|
6440
|
-
return true;
|
|
6441
|
-
}
|
|
6442
|
-
while (fr < fl) {
|
|
6443
|
-
var swallowee = file[fr];
|
|
6444
|
-
this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
|
|
6445
|
-
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
|
|
6446
|
-
this.debug("globstar found match!", fr, fl, swallowee);
|
|
6447
|
-
return true;
|
|
6448
|
-
} else {
|
|
6449
|
-
if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
|
|
6450
|
-
this.debug("dot detected!", file, fr, pattern, pr);
|
|
6451
|
-
break;
|
|
6452
|
-
}
|
|
6453
|
-
this.debug("globstar swallow a segment, and continue");
|
|
6454
|
-
fr++;
|
|
6455
|
-
}
|
|
6456
|
-
}
|
|
6457
|
-
if (partial) {
|
|
6458
|
-
this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
|
|
6459
|
-
if (fr === fl) {
|
|
6460
|
-
return true;
|
|
6461
|
-
}
|
|
6462
|
-
}
|
|
6463
|
-
return false;
|
|
6464
|
-
}
|
|
6465
|
-
let hit;
|
|
6466
|
-
if (typeof p === "string") {
|
|
6467
|
-
hit = f === p;
|
|
6468
|
-
this.debug("string match", p, f, hit);
|
|
6469
|
-
} else {
|
|
6470
|
-
hit = p.test(f);
|
|
6471
|
-
this.debug("pattern match", p, f, hit);
|
|
6472
|
-
}
|
|
6473
|
-
if (!hit)
|
|
6474
|
-
return false;
|
|
6475
|
-
}
|
|
6476
|
-
if (fi === fl && pi === pl) {
|
|
6477
|
-
return true;
|
|
6478
|
-
} else if (fi === fl) {
|
|
6479
|
-
return partial;
|
|
6480
|
-
} else if (pi === pl) {
|
|
6481
|
-
return fi === fl - 1 && file[fi] === "";
|
|
6482
|
-
} else {
|
|
6483
|
-
throw new Error("wtf?");
|
|
6484
|
-
}
|
|
6485
|
-
}
|
|
6486
|
-
braceExpand() {
|
|
6487
|
-
return braceExpand(this.pattern, this.options);
|
|
6488
|
-
}
|
|
6489
|
-
parse(pattern) {
|
|
6490
|
-
assertValidPattern(pattern);
|
|
6491
|
-
const options = this.options;
|
|
6492
|
-
if (pattern === "**")
|
|
6493
|
-
return GLOBSTAR;
|
|
6494
|
-
if (pattern === "")
|
|
6495
|
-
return "";
|
|
6496
|
-
let m;
|
|
6497
|
-
let fastTest = null;
|
|
6498
|
-
if (m = pattern.match(starRE)) {
|
|
6499
|
-
fastTest = options.dot ? starTestDot : starTest;
|
|
6500
|
-
} else if (m = pattern.match(starDotExtRE)) {
|
|
6501
|
-
fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m[1]);
|
|
6502
|
-
} else if (m = pattern.match(qmarksRE)) {
|
|
6503
|
-
fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m);
|
|
6504
|
-
} else if (m = pattern.match(starDotStarRE)) {
|
|
6505
|
-
fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
|
|
6506
|
-
} else if (m = pattern.match(dotStarRE)) {
|
|
6507
|
-
fastTest = dotStarTest;
|
|
6508
|
-
}
|
|
6509
|
-
const re = AST.fromGlob(pattern, this.options).toMMPattern();
|
|
6510
|
-
if (fastTest && typeof re === "object") {
|
|
6511
|
-
Reflect.defineProperty(re, "test", { value: fastTest });
|
|
6512
|
-
}
|
|
6513
|
-
return re;
|
|
6514
|
-
}
|
|
6515
|
-
makeRe() {
|
|
6516
|
-
if (this.regexp || this.regexp === false)
|
|
6517
|
-
return this.regexp;
|
|
6518
|
-
const set = this.set;
|
|
6519
|
-
if (!set.length) {
|
|
6520
|
-
this.regexp = false;
|
|
6521
|
-
return this.regexp;
|
|
6522
|
-
}
|
|
6523
|
-
const options = this.options;
|
|
6524
|
-
const twoStar = options.noglobstar ? star2 : options.dot ? twoStarDot : twoStarNoDot;
|
|
6525
|
-
const flags = new Set(options.nocase ? ["i"] : []);
|
|
6526
|
-
let re = set.map((pattern) => {
|
|
6527
|
-
const pp = pattern.map((p) => {
|
|
6528
|
-
if (p instanceof RegExp) {
|
|
6529
|
-
for (const f of p.flags.split(""))
|
|
6530
|
-
flags.add(f);
|
|
6531
|
-
}
|
|
6532
|
-
return typeof p === "string" ? regExpEscape2(p) : p === GLOBSTAR ? GLOBSTAR : p._src;
|
|
6533
|
-
});
|
|
6534
|
-
pp.forEach((p, i) => {
|
|
6535
|
-
const next = pp[i + 1];
|
|
6536
|
-
const prev = pp[i - 1];
|
|
6537
|
-
if (p !== GLOBSTAR || prev === GLOBSTAR) {
|
|
6538
|
-
return;
|
|
6539
|
-
}
|
|
6540
|
-
if (prev === void 0) {
|
|
6541
|
-
if (next !== void 0 && next !== GLOBSTAR) {
|
|
6542
|
-
pp[i + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
|
|
6543
|
-
} else {
|
|
6544
|
-
pp[i] = twoStar;
|
|
6545
|
-
}
|
|
6546
|
-
} else if (next === void 0) {
|
|
6547
|
-
pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + ")?";
|
|
6548
|
-
} else if (next !== GLOBSTAR) {
|
|
6549
|
-
pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
|
|
6550
|
-
pp[i + 1] = GLOBSTAR;
|
|
6551
|
-
}
|
|
6552
|
-
});
|
|
6553
|
-
const filtered = pp.filter((p) => p !== GLOBSTAR);
|
|
6554
|
-
if (this.partial && filtered.length >= 1) {
|
|
6555
|
-
const prefixes = [];
|
|
6556
|
-
for (let i = 1; i <= filtered.length; i++) {
|
|
6557
|
-
prefixes.push(filtered.slice(0, i).join("/"));
|
|
6558
|
-
}
|
|
6559
|
-
return "(?:" + prefixes.join("|") + ")";
|
|
6560
|
-
}
|
|
6561
|
-
return filtered.join("/");
|
|
6562
|
-
}).join("|");
|
|
6563
|
-
const [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
|
|
6564
|
-
re = "^" + open + re + close + "$";
|
|
6565
|
-
if (this.partial) {
|
|
6566
|
-
re = "^(?:\\/|" + open + re.slice(1, -1) + close + ")$";
|
|
6567
|
-
}
|
|
6568
|
-
if (this.negate)
|
|
6569
|
-
re = "^(?!" + re + ").+$";
|
|
6570
|
-
try {
|
|
6571
|
-
this.regexp = new RegExp(re, [...flags].join(""));
|
|
6572
|
-
} catch (ex) {
|
|
6573
|
-
this.regexp = false;
|
|
6574
|
-
}
|
|
6575
|
-
return this.regexp;
|
|
6576
|
-
}
|
|
6577
|
-
slashSplit(p) {
|
|
6578
|
-
if (this.preserveMultipleSlashes) {
|
|
6579
|
-
return p.split("/");
|
|
6580
|
-
} else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
|
|
6581
|
-
return ["", ...p.split(/\/+/)];
|
|
6582
|
-
} else {
|
|
6583
|
-
return p.split(/\/+/);
|
|
6584
|
-
}
|
|
6585
|
-
}
|
|
6586
|
-
match(f, partial = this.partial) {
|
|
6587
|
-
this.debug("match", f, this.pattern);
|
|
6588
|
-
if (this.comment) {
|
|
6589
|
-
return false;
|
|
6590
|
-
}
|
|
6591
|
-
if (this.empty) {
|
|
6592
|
-
return f === "";
|
|
6593
|
-
}
|
|
6594
|
-
if (f === "/" && partial) {
|
|
6595
|
-
return true;
|
|
6596
|
-
}
|
|
6597
|
-
const options = this.options;
|
|
6598
|
-
if (this.isWindows) {
|
|
6599
|
-
f = f.split("\\").join("/");
|
|
6600
|
-
}
|
|
6601
|
-
const ff = this.slashSplit(f);
|
|
6602
|
-
this.debug(this.pattern, "split", ff);
|
|
6603
|
-
const set = this.set;
|
|
6604
|
-
this.debug(this.pattern, "set", set);
|
|
6605
|
-
let filename = ff[ff.length - 1];
|
|
6606
|
-
if (!filename) {
|
|
6607
|
-
for (let i = ff.length - 2; !filename && i >= 0; i--) {
|
|
6608
|
-
filename = ff[i];
|
|
6609
|
-
}
|
|
6610
|
-
}
|
|
6611
|
-
for (let i = 0; i < set.length; i++) {
|
|
6612
|
-
const pattern = set[i];
|
|
6613
|
-
let file = ff;
|
|
6614
|
-
if (options.matchBase && pattern.length === 1) {
|
|
6615
|
-
file = [filename];
|
|
6616
|
-
}
|
|
6617
|
-
const hit = this.matchOne(file, pattern, partial);
|
|
6618
|
-
if (hit) {
|
|
6619
|
-
if (options.flipNegate) {
|
|
6620
|
-
return true;
|
|
6621
|
-
}
|
|
6622
|
-
return !this.negate;
|
|
6623
|
-
}
|
|
6624
|
-
}
|
|
6625
|
-
if (options.flipNegate) {
|
|
6626
|
-
return false;
|
|
6627
|
-
}
|
|
6628
|
-
return this.negate;
|
|
6629
|
-
}
|
|
6630
|
-
static defaults(def) {
|
|
6631
|
-
return minimatch.defaults(def).Minimatch;
|
|
6632
|
-
}
|
|
6633
|
-
};
|
|
6634
|
-
minimatch.AST = AST;
|
|
6635
|
-
minimatch.Minimatch = Minimatch;
|
|
6636
|
-
minimatch.escape = escape;
|
|
6637
|
-
minimatch.unescape = unescape;
|
|
6638
|
-
|
|
6639
|
-
// src/index.ts
|
|
6640
5032
|
var import_path21 = require("path");
|
|
6641
5033
|
|
|
6642
5034
|
// src/package-versions.ts
|
|
6643
|
-
var VERCEL_RUNTIME_VERSION = "0.23.
|
|
5035
|
+
var VERCEL_RUNTIME_VERSION = "0.23.1";
|
|
6644
5036
|
var VERCEL_WORKERS_VERSION = "0.0.25";
|
|
6645
5037
|
|
|
6646
5038
|
// src/conditional-vendoring.ts
|
|
@@ -7511,8 +5903,8 @@ function createVenvEnv(venvPath, baseEnv = process.env, uvCacheDir) {
|
|
|
7511
5903
|
async function readVenvPythonVersion(pyvenvCfgPath) {
|
|
7512
5904
|
try {
|
|
7513
5905
|
const content = await import_fs3.default.promises.readFile(pyvenvCfgPath, "utf-8");
|
|
7514
|
-
const
|
|
7515
|
-
return
|
|
5906
|
+
const match = content.match(/^version\s*=\s*(\d+)\.(\d+)/m);
|
|
5907
|
+
return match ? `${match[1]}.${match[2]}` : null;
|
|
7516
5908
|
} catch {
|
|
7517
5909
|
return null;
|
|
7518
5910
|
}
|
|
@@ -8814,11 +7206,11 @@ async function getPackagesReachableOnPlatform(lockFile, projectName, pythonMajor
|
|
|
8814
7206
|
}
|
|
8815
7207
|
return visited;
|
|
8816
7208
|
}
|
|
8817
|
-
async function calculateBundleSize(files,
|
|
7209
|
+
async function calculateBundleSize(files, filter) {
|
|
8818
7210
|
let knownSize = 0;
|
|
8819
7211
|
const statPromises = [];
|
|
8820
7212
|
for (const filePath of Object.keys(files)) {
|
|
8821
|
-
if (
|
|
7213
|
+
if (filter && !filter(filePath))
|
|
8822
7214
|
continue;
|
|
8823
7215
|
const file = files[filePath];
|
|
8824
7216
|
if ("fsPath" in file && file.fsPath) {
|
|
@@ -9258,11 +7650,11 @@ Add this to your pyproject.toml:
|
|
|
9258
7650
|
entrypoint = "${moduleAttr}"`;
|
|
9259
7651
|
}
|
|
9260
7652
|
async function resolveModuleAttrEntrypoint(workPath, value) {
|
|
9261
|
-
const
|
|
9262
|
-
if (!
|
|
7653
|
+
const match = value.match(/([A-Za-z_][\w.]*)\s*:\s*([A-Za-z_][\w]*)/);
|
|
7654
|
+
if (!match)
|
|
9263
7655
|
return null;
|
|
9264
|
-
const modulePath =
|
|
9265
|
-
const variableName =
|
|
7656
|
+
const modulePath = match[1];
|
|
7657
|
+
const variableName = match[2];
|
|
9266
7658
|
const relPath = modulePath.replace(/\./g, "/");
|
|
9267
7659
|
const candidates = [`${relPath}.py`, `${relPath}/__init__.py`];
|
|
9268
7660
|
for (const candidate of candidates) {
|
|
@@ -9312,11 +7704,11 @@ async function getPyprojectEntrypointWithDiagnostics(workPath) {
|
|
|
9312
7704
|
const appScript = scripts?.app;
|
|
9313
7705
|
if (typeof appScript !== "string")
|
|
9314
7706
|
return { entrypoint: null };
|
|
9315
|
-
const
|
|
9316
|
-
if (!
|
|
7707
|
+
const match = appScript.match(/([A-Za-z_][\w.]*)\s*:\s*([A-Za-z_][\w]*)/);
|
|
7708
|
+
if (!match)
|
|
9317
7709
|
return { entrypoint: null, appScript };
|
|
9318
|
-
const modulePath =
|
|
9319
|
-
const variableName =
|
|
7710
|
+
const modulePath = match[1];
|
|
7711
|
+
const variableName = match[2];
|
|
9320
7712
|
const relPath = modulePath.replace(/\./g, "/");
|
|
9321
7713
|
const candidates = [`${relPath}.py`, `${relPath}/__init__.py`];
|
|
9322
7714
|
for (const candidate of candidates) {
|
|
@@ -9696,6 +8088,28 @@ function moduleColonFuncToCronPath(serviceName, moduleFunction) {
|
|
|
9696
8088
|
return (0, import_build_utils12.getInternalServiceCronPath)(serviceName, entrypointPath, funcPart);
|
|
9697
8089
|
}
|
|
9698
8090
|
|
|
8091
|
+
// src/schedules.ts
|
|
8092
|
+
function getGeneratedScheduleHandlerPath(outputPath) {
|
|
8093
|
+
return `_vc_schedule_handlers/${outputPath.replace(/[^A-Za-z0-9]+/g, "_")}.py`;
|
|
8094
|
+
}
|
|
8095
|
+
function createScheduleHandlerModule(sourceFilesByScheduleName) {
|
|
8096
|
+
const entries = Array.from(
|
|
8097
|
+
sourceFilesByScheduleName,
|
|
8098
|
+
([name, sourceFile]) => ` ${JSON.stringify(name)}: os.path.join(_root, ${JSON.stringify(sourceFile)}),`
|
|
8099
|
+
);
|
|
8100
|
+
return [
|
|
8101
|
+
"import os.path",
|
|
8102
|
+
"",
|
|
8103
|
+
"from vercel_runtime.schedules import create_schedule_scripts_app",
|
|
8104
|
+
"",
|
|
8105
|
+
"_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))",
|
|
8106
|
+
"app = create_schedule_scripts_app({",
|
|
8107
|
+
...entries,
|
|
8108
|
+
"})",
|
|
8109
|
+
""
|
|
8110
|
+
].join("\n");
|
|
8111
|
+
}
|
|
8112
|
+
|
|
9699
8113
|
// src/start-dev-server.ts
|
|
9700
8114
|
var import_child_process2 = require("child_process");
|
|
9701
8115
|
var import_fs13 = require("fs");
|
|
@@ -9717,14 +8131,14 @@ var import_fs10 = __toESM(require("fs"));
|
|
|
9717
8131
|
var MODULE_ATTR_RE = /^([A-Za-z_][\w]*(?:\.[A-Za-z_][\w]*)*):([A-Za-z_][\w]*)$/;
|
|
9718
8132
|
var MODULE_RE = /^[A-Za-z_][\w]*(?:\.[A-Za-z_][\w]*)*$/;
|
|
9719
8133
|
function parseModuleEntrypoint(value) {
|
|
9720
|
-
const
|
|
9721
|
-
if (!
|
|
8134
|
+
const match = MODULE_ATTR_RE.exec(value);
|
|
8135
|
+
if (!match) {
|
|
9722
8136
|
return null;
|
|
9723
8137
|
}
|
|
9724
8138
|
return {
|
|
9725
|
-
moduleName:
|
|
9726
|
-
variableName:
|
|
9727
|
-
filePath: `${
|
|
8139
|
+
moduleName: match[1],
|
|
8140
|
+
variableName: match[2],
|
|
8141
|
+
filePath: `${match[1].replace(/\./g, "/")}.py`
|
|
9728
8142
|
};
|
|
9729
8143
|
}
|
|
9730
8144
|
function parseBareModuleEntrypoint(value) {
|
|
@@ -10014,13 +8428,13 @@ async function getApschedulerPreviewConfig(workPath) {
|
|
|
10014
8428
|
'"tool.vercel.apscheduler.previews.idle_timeout" must be a duration such as "30m"'
|
|
10015
8429
|
);
|
|
10016
8430
|
}
|
|
10017
|
-
const
|
|
10018
|
-
if (!
|
|
8431
|
+
const match = /^([1-9]\d*)([smhd])$/.exec(rawPreviews.idle_timeout);
|
|
8432
|
+
if (!match) {
|
|
10019
8433
|
throw apschedulerError(
|
|
10020
8434
|
'"tool.vercel.apscheduler.previews.idle_timeout" must be a positive duration using s, m, h, or d (for example "30m")'
|
|
10021
8435
|
);
|
|
10022
8436
|
}
|
|
10023
|
-
const idleTimeoutSeconds = Number(
|
|
8437
|
+
const idleTimeoutSeconds = Number(match[1]) * APSCHEDULER_DURATION_UNITS[match[2]];
|
|
10024
8438
|
if (!Number.isSafeInteger(idleTimeoutSeconds)) {
|
|
10025
8439
|
throw apschedulerError(
|
|
10026
8440
|
'"tool.vercel.apscheduler.previews.idle_timeout" is too large'
|
|
@@ -10244,7 +8658,7 @@ function parseLegacyTopics(name, value) {
|
|
|
10244
8658
|
return value;
|
|
10245
8659
|
}
|
|
10246
8660
|
function parseLegacyTriggerDefaults(subscriber, config) {
|
|
10247
|
-
const
|
|
8661
|
+
const defaults = {};
|
|
10248
8662
|
for (const {
|
|
10249
8663
|
field,
|
|
10250
8664
|
output,
|
|
@@ -10260,9 +8674,9 @@ function parseLegacyTriggerDefaults(subscriber, config) {
|
|
|
10260
8674
|
`subscriber "${subscriber}" field "${field}" must be ${expected}`
|
|
10261
8675
|
);
|
|
10262
8676
|
}
|
|
10263
|
-
|
|
8677
|
+
defaults[output] = value;
|
|
10264
8678
|
}
|
|
10265
|
-
return
|
|
8679
|
+
return defaults;
|
|
10266
8680
|
}
|
|
10267
8681
|
function parseTopicPatterns(name, value) {
|
|
10268
8682
|
if (value === void 0) {
|
|
@@ -10471,7 +8885,7 @@ function parseIntrospectedSubscription(kind, subscriberName, index, value) {
|
|
|
10471
8885
|
};
|
|
10472
8886
|
}
|
|
10473
8887
|
function parseTriggerDefaults(label, subscription) {
|
|
10474
|
-
const
|
|
8888
|
+
const defaults = {};
|
|
10475
8889
|
for (const { field, output, isValid, expected } of TRIGGER_NUMBER_FIELDS) {
|
|
10476
8890
|
const value = subscription[field];
|
|
10477
8891
|
if (value === void 0 || value === null) {
|
|
@@ -10480,9 +8894,9 @@ function parseTriggerDefaults(label, subscription) {
|
|
|
10480
8894
|
if (typeof value !== "number" || !isValid(value)) {
|
|
10481
8895
|
throw subscriberError(`${label} field "${field}" must be ${expected}`);
|
|
10482
8896
|
}
|
|
10483
|
-
|
|
8897
|
+
defaults[output] = value;
|
|
10484
8898
|
}
|
|
10485
|
-
return
|
|
8899
|
+
return defaults;
|
|
10486
8900
|
}
|
|
10487
8901
|
function getQueueWildcardPrefix(pattern) {
|
|
10488
8902
|
if (pattern.endsWith("*")) {
|
|
@@ -13269,37 +11683,26 @@ function getTargetPlatform(isDev) {
|
|
|
13269
11683
|
}
|
|
13270
11684
|
return { uvPlatform: UV_LINUX_TARGET, architecture: "x86_64" };
|
|
13271
11685
|
}
|
|
13272
|
-
function getMatchingFunction(config, entrypoint) {
|
|
13273
|
-
if (!
|
|
11686
|
+
function getMatchingFunction(config, entrypoint, isScheduleEntrypoint = false) {
|
|
11687
|
+
if (!entrypoint) {
|
|
13274
11688
|
return;
|
|
13275
11689
|
}
|
|
13276
|
-
const
|
|
13277
|
-
|
|
13278
|
-
sources.add(entrypoint.slice(0, -".py".length));
|
|
13279
|
-
}
|
|
13280
|
-
for (const sourceFile of sources) {
|
|
13281
|
-
for (const [pattern, functionConfig] of Object.entries(config.functions)) {
|
|
13282
|
-
if (sourceFile === pattern || minimatch(sourceFile, pattern)) {
|
|
13283
|
-
return { sourceFile, functionConfig };
|
|
13284
|
-
}
|
|
13285
|
-
}
|
|
13286
|
-
}
|
|
13287
|
-
return;
|
|
11690
|
+
const candidates = entrypoint.endsWith(".py") && !isScheduleEntrypoint ? [entrypoint, entrypoint.slice(0, -".py".length)] : [entrypoint];
|
|
11691
|
+
return (0, import_build_utils24.findMatchingFunction)(config?.functions, candidates);
|
|
13288
11692
|
}
|
|
13289
11693
|
function normalizeGlobs(value) {
|
|
13290
11694
|
return Array.isArray(value) ? value.filter((item) => typeof item === "string") : typeof value === "string" ? [value] : [];
|
|
13291
11695
|
}
|
|
13292
11696
|
async function getPythonLambdaOptions({
|
|
13293
11697
|
config,
|
|
13294
|
-
entrypoint
|
|
11698
|
+
entrypoint,
|
|
11699
|
+
isScheduleEntrypoint = false
|
|
13295
11700
|
}) {
|
|
13296
|
-
const
|
|
13297
|
-
if (!match2) {
|
|
13298
|
-
return {};
|
|
13299
|
-
}
|
|
11701
|
+
const match = getMatchingFunction(config, entrypoint, isScheduleEntrypoint);
|
|
13300
11702
|
const lambdaOptions = await (0, import_build_utils24.getLambdaOptionsFromFunction)({
|
|
13301
|
-
sourceFile:
|
|
13302
|
-
config
|
|
11703
|
+
sourceFile: match?.sourceFile ?? entrypoint,
|
|
11704
|
+
config,
|
|
11705
|
+
isScheduleEntrypoint
|
|
13303
11706
|
});
|
|
13304
11707
|
delete lambdaOptions.architecture;
|
|
13305
11708
|
return lambdaOptions;
|
|
@@ -14021,6 +12424,8 @@ var build = async ({
|
|
|
14021
12424
|
throw err;
|
|
14022
12425
|
}
|
|
14023
12426
|
let detected;
|
|
12427
|
+
const scheduleFunction = config?.scheduleFunction;
|
|
12428
|
+
const scheduleEntrypoint = scheduleFunction?.entrypoints[0];
|
|
14024
12429
|
const handlerFunction = typeof config?.handlerFunction === "string" ? config.handlerFunction : void 0;
|
|
14025
12430
|
if (isPyprojectEntrypoint) {
|
|
14026
12431
|
const declared = await getVercelToolsEntrypoint(workPath, repoRootPath);
|
|
@@ -14033,6 +12438,13 @@ var build = async ({
|
|
|
14033
12438
|
});
|
|
14034
12439
|
}
|
|
14035
12440
|
entrypoint = void 0;
|
|
12441
|
+
} else if (scheduleEntrypoint) {
|
|
12442
|
+
detected = {
|
|
12443
|
+
entrypoint: {
|
|
12444
|
+
entrypoint: scheduleEntrypoint.sourceFile,
|
|
12445
|
+
variableName: ""
|
|
12446
|
+
}
|
|
12447
|
+
};
|
|
14036
12448
|
} else {
|
|
14037
12449
|
detected = await detectPythonEntrypoint(
|
|
14038
12450
|
config.framework,
|
|
@@ -14376,7 +12788,6 @@ var build = async ({
|
|
|
14376
12788
|
let runtimeTrampoline;
|
|
14377
12789
|
if (entrypoint) {
|
|
14378
12790
|
(0, import_build_utils24.debug)("Entrypoint is", entrypoint);
|
|
14379
|
-
const moduleName = entrypointToModule(entrypoint);
|
|
14380
12791
|
if (handlerFunction) {
|
|
14381
12792
|
const entrypointPath = (0, import_path21.join)(workPath, entrypoint);
|
|
14382
12793
|
const source = await import_fs20.default.promises.readFile(entrypointPath, "utf-8");
|
|
@@ -14388,32 +12799,35 @@ var build = async ({
|
|
|
14388
12799
|
});
|
|
14389
12800
|
}
|
|
14390
12801
|
}
|
|
14391
|
-
|
|
14392
|
-
|
|
14393
|
-
|
|
14394
|
-
|
|
14395
|
-
|
|
14396
|
-
|
|
14397
|
-
|
|
14398
|
-
|
|
14399
|
-
|
|
14400
|
-
|
|
14401
|
-
|
|
14402
|
-
|
|
14403
|
-
|
|
14404
|
-
|
|
14405
|
-
const
|
|
14406
|
-
|
|
14407
|
-
|
|
12802
|
+
if (!scheduleEntrypoint) {
|
|
12803
|
+
const moduleName = entrypointToModule(entrypoint);
|
|
12804
|
+
const suffix = meta.isDev && !entrypoint.endsWith(".py") ? ".py" : "";
|
|
12805
|
+
const entrypointWithSuffix = `${entrypoint}${suffix}`;
|
|
12806
|
+
(0, import_build_utils24.debug)("Entrypoint with suffix is", entrypointWithSuffix);
|
|
12807
|
+
crons = await getServiceCrons({
|
|
12808
|
+
service,
|
|
12809
|
+
entrypoint,
|
|
12810
|
+
rawEntrypoint,
|
|
12811
|
+
handlerFunction,
|
|
12812
|
+
pythonBin: getVenvPythonBin(venvPath),
|
|
12813
|
+
env: pythonEnv,
|
|
12814
|
+
workPath
|
|
12815
|
+
});
|
|
12816
|
+
const extraTrampolineEnv = [];
|
|
12817
|
+
if (crons?.length) {
|
|
12818
|
+
const json = JSON.stringify(buildCronRouteTable(crons));
|
|
12819
|
+
(0, import_assert.default)(!json.includes("\\"), `backslash in cron route table: ${json}`);
|
|
12820
|
+
extraTrampolineEnv.push(`"__VC_CRON_ROUTES": '${json}'`);
|
|
12821
|
+
}
|
|
12822
|
+
const variableName = resolved?.variableName ?? "";
|
|
12823
|
+
runtimeTrampoline = createRuntimeTrampoline({
|
|
12824
|
+
moduleName,
|
|
12825
|
+
entrypoint: entrypointWithSuffix,
|
|
12826
|
+
vendorDir,
|
|
12827
|
+
variableName,
|
|
12828
|
+
extraEnv: extraTrampolineEnv
|
|
12829
|
+
});
|
|
14408
12830
|
}
|
|
14409
|
-
const variableName = resolved?.variableName ?? "";
|
|
14410
|
-
runtimeTrampoline = createRuntimeTrampoline({
|
|
14411
|
-
moduleName,
|
|
14412
|
-
entrypoint: entrypointWithSuffix,
|
|
14413
|
-
vendorDir,
|
|
14414
|
-
variableName,
|
|
14415
|
-
extraEnv: extraTrampolineEnv
|
|
14416
|
-
});
|
|
14417
12831
|
}
|
|
14418
12832
|
const compileAllEnabled = shouldCompileAll({
|
|
14419
12833
|
isDev: meta.isDev,
|
|
@@ -14448,7 +12862,8 @@ var build = async ({
|
|
|
14448
12862
|
}
|
|
14449
12863
|
const functionConfig = getMatchingFunction(
|
|
14450
12864
|
config,
|
|
14451
|
-
entrypoint
|
|
12865
|
+
entrypoint,
|
|
12866
|
+
scheduleEntrypoint !== void 0
|
|
14452
12867
|
)?.functionConfig;
|
|
14453
12868
|
const includeFilesPatterns = [
|
|
14454
12869
|
...normalizeGlobs(config?.includeFiles),
|
|
@@ -14694,6 +13109,48 @@ var build = async ({
|
|
|
14694
13109
|
);
|
|
14695
13110
|
}
|
|
14696
13111
|
}
|
|
13112
|
+
if (scheduleFunction && scheduleEntrypoint) {
|
|
13113
|
+
const lambdaOptions = await getPythonLambdaOptions({
|
|
13114
|
+
config,
|
|
13115
|
+
entrypoint: scheduleEntrypoint.sourceFile,
|
|
13116
|
+
isScheduleEntrypoint: true
|
|
13117
|
+
});
|
|
13118
|
+
const generatedPath = getGeneratedScheduleHandlerPath(
|
|
13119
|
+
scheduleFunction.outputPath
|
|
13120
|
+
);
|
|
13121
|
+
const sourceFilesByScheduleName = /* @__PURE__ */ new Map();
|
|
13122
|
+
for (const { sourceFile, scheduleNames } of scheduleFunction.entrypoints) {
|
|
13123
|
+
for (const name of scheduleNames) {
|
|
13124
|
+
sourceFilesByScheduleName.set(name, sourceFile);
|
|
13125
|
+
}
|
|
13126
|
+
}
|
|
13127
|
+
const scheduleLambda = new import_build_utils24.Lambda({
|
|
13128
|
+
files: {
|
|
13129
|
+
...files,
|
|
13130
|
+
[generatedPath]: new import_build_utils24.FileBlob({
|
|
13131
|
+
data: createScheduleHandlerModule(sourceFilesByScheduleName)
|
|
13132
|
+
}),
|
|
13133
|
+
[`${handlerPyFilename}.py`]: new import_build_utils24.FileBlob({
|
|
13134
|
+
data: createRuntimeTrampoline({
|
|
13135
|
+
moduleName: generatedPythonPathToModule(generatedPath),
|
|
13136
|
+
entrypoint: generatedPath,
|
|
13137
|
+
vendorDir,
|
|
13138
|
+
variableName: "app"
|
|
13139
|
+
})
|
|
13140
|
+
})
|
|
13141
|
+
},
|
|
13142
|
+
handler: `${handlerPyFilename}.vc_handler`,
|
|
13143
|
+
runtime: pythonVersion.runtime,
|
|
13144
|
+
...lambdaOptions,
|
|
13145
|
+
architecture: target.architecture,
|
|
13146
|
+
environment: { ...lambdaEnv },
|
|
13147
|
+
supportsResponseStreaming: true
|
|
13148
|
+
});
|
|
13149
|
+
return {
|
|
13150
|
+
resultVersion: 2,
|
|
13151
|
+
result: { output: { [scheduleFunction.outputPath]: scheduleLambda } }
|
|
13152
|
+
};
|
|
13153
|
+
}
|
|
14697
13154
|
if (!(0, import_build_utils24.isPythonFramework)(framework) && !service?.name && !isPyprojectEntrypoint) {
|
|
14698
13155
|
(0, import_assert.default)(output, "web Lambda must exist for non-service builds");
|
|
14699
13156
|
return { resultVersion: 3, result: { output } };
|