@arcote.tech/arc-cli 0.4.2 → 0.4.6
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 +2127 -234
- package/package.json +1 -1
- package/src/builder/module-builder.ts +15 -1
- package/src/platform/server.ts +3 -0
- package/src/platform/shared.ts +20 -3
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ var __export = (target, all) => {
|
|
|
29
29
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
30
30
|
var __require = import.meta.require;
|
|
31
31
|
|
|
32
|
-
//
|
|
32
|
+
// node_modules/commander/lib/error.js
|
|
33
33
|
var require_error = __commonJS((exports) => {
|
|
34
34
|
class CommanderError extends Error {
|
|
35
35
|
constructor(exitCode, code, message) {
|
|
@@ -53,7 +53,7 @@ var require_error = __commonJS((exports) => {
|
|
|
53
53
|
exports.InvalidArgumentError = InvalidArgumentError;
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
//
|
|
56
|
+
// node_modules/commander/lib/argument.js
|
|
57
57
|
var require_argument = __commonJS((exports) => {
|
|
58
58
|
var { InvalidArgumentError } = require_error();
|
|
59
59
|
|
|
@@ -132,7 +132,7 @@ var require_argument = __commonJS((exports) => {
|
|
|
132
132
|
exports.humanReadableArgName = humanReadableArgName;
|
|
133
133
|
});
|
|
134
134
|
|
|
135
|
-
//
|
|
135
|
+
// node_modules/commander/lib/help.js
|
|
136
136
|
var require_help = __commonJS((exports) => {
|
|
137
137
|
var { humanReadableArgName } = require_argument();
|
|
138
138
|
|
|
@@ -379,7 +379,7 @@ var require_help = __commonJS((exports) => {
|
|
|
379
379
|
exports.Help = Help;
|
|
380
380
|
});
|
|
381
381
|
|
|
382
|
-
//
|
|
382
|
+
// node_modules/commander/lib/option.js
|
|
383
383
|
var require_option = __commonJS((exports) => {
|
|
384
384
|
var { InvalidArgumentError } = require_error();
|
|
385
385
|
|
|
@@ -531,7 +531,7 @@ var require_option = __commonJS((exports) => {
|
|
|
531
531
|
exports.DualOptions = DualOptions;
|
|
532
532
|
});
|
|
533
533
|
|
|
534
|
-
//
|
|
534
|
+
// node_modules/commander/lib/suggestSimilar.js
|
|
535
535
|
var require_suggestSimilar = __commonJS((exports) => {
|
|
536
536
|
var maxDistance = 3;
|
|
537
537
|
function editDistance(a, b) {
|
|
@@ -604,7 +604,7 @@ var require_suggestSimilar = __commonJS((exports) => {
|
|
|
604
604
|
exports.suggestSimilar = suggestSimilar;
|
|
605
605
|
});
|
|
606
606
|
|
|
607
|
-
//
|
|
607
|
+
// node_modules/commander/lib/command.js
|
|
608
608
|
var require_command = __commonJS((exports) => {
|
|
609
609
|
var EventEmitter = __require("node:events").EventEmitter;
|
|
610
610
|
var childProcess = __require("node:child_process");
|
|
@@ -1787,7 +1787,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1787
1787
|
exports.Command = Command;
|
|
1788
1788
|
});
|
|
1789
1789
|
|
|
1790
|
-
//
|
|
1790
|
+
// node_modules/commander/index.js
|
|
1791
1791
|
var require_commander = __commonJS((exports, module) => {
|
|
1792
1792
|
var { Argument } = require_argument();
|
|
1793
1793
|
var { Command } = require_command();
|
|
@@ -4153,11 +4153,12 @@ var require_brace_expansion = __commonJS((exports, module) => {
|
|
|
4153
4153
|
}
|
|
4154
4154
|
});
|
|
4155
4155
|
|
|
4156
|
-
//
|
|
4156
|
+
// node_modules/chokidar/node_modules/readdirp/node_modules/picomatch/lib/constants.js
|
|
4157
4157
|
var require_constants = __commonJS((exports, module) => {
|
|
4158
4158
|
var path4 = __require("node:path");
|
|
4159
4159
|
var WIN_SLASH = "\\\\/";
|
|
4160
4160
|
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
4161
|
+
var DEFAULT_MAX_EXTGLOB_RECURSION = 0;
|
|
4161
4162
|
var DOT_LITERAL = "\\.";
|
|
4162
4163
|
var PLUS_LITERAL = "\\+";
|
|
4163
4164
|
var QMARK_LITERAL = "\\?";
|
|
@@ -4205,6 +4206,7 @@ var require_constants = __commonJS((exports, module) => {
|
|
|
4205
4206
|
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
|
|
4206
4207
|
};
|
|
4207
4208
|
var POSIX_REGEX_SOURCE = {
|
|
4209
|
+
__proto__: null,
|
|
4208
4210
|
alnum: "a-zA-Z0-9",
|
|
4209
4211
|
alpha: "a-zA-Z",
|
|
4210
4212
|
ascii: "\\x00-\\x7F",
|
|
@@ -4221,6 +4223,7 @@ var require_constants = __commonJS((exports, module) => {
|
|
|
4221
4223
|
xdigit: "A-Fa-f0-9"
|
|
4222
4224
|
};
|
|
4223
4225
|
module.exports = {
|
|
4226
|
+
DEFAULT_MAX_EXTGLOB_RECURSION,
|
|
4224
4227
|
MAX_LENGTH: 1024 * 64,
|
|
4225
4228
|
POSIX_REGEX_SOURCE,
|
|
4226
4229
|
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
@@ -4230,6 +4233,7 @@ var require_constants = __commonJS((exports, module) => {
|
|
|
4230
4233
|
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
|
4231
4234
|
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
4232
4235
|
REPLACEMENTS: {
|
|
4236
|
+
__proto__: null,
|
|
4233
4237
|
"***": "*",
|
|
4234
4238
|
"**/**": "**",
|
|
4235
4239
|
"**/**/**": "**"
|
|
@@ -4293,7 +4297,7 @@ var require_constants = __commonJS((exports, module) => {
|
|
|
4293
4297
|
};
|
|
4294
4298
|
});
|
|
4295
4299
|
|
|
4296
|
-
//
|
|
4300
|
+
// node_modules/chokidar/node_modules/readdirp/node_modules/picomatch/lib/utils.js
|
|
4297
4301
|
var require_utils = __commonJS((exports) => {
|
|
4298
4302
|
var path4 = __require("node:path");
|
|
4299
4303
|
var win322 = process.platform === "win32";
|
|
@@ -4353,7 +4357,7 @@ var require_utils = __commonJS((exports) => {
|
|
|
4353
4357
|
};
|
|
4354
4358
|
});
|
|
4355
4359
|
|
|
4356
|
-
//
|
|
4360
|
+
// node_modules/chokidar/node_modules/readdirp/node_modules/picomatch/lib/scan.js
|
|
4357
4361
|
var require_scan = __commonJS((exports, module) => {
|
|
4358
4362
|
var utils = require_utils();
|
|
4359
4363
|
var {
|
|
@@ -4668,7 +4672,7 @@ var require_scan = __commonJS((exports, module) => {
|
|
|
4668
4672
|
module.exports = scan;
|
|
4669
4673
|
});
|
|
4670
4674
|
|
|
4671
|
-
//
|
|
4675
|
+
// node_modules/chokidar/node_modules/readdirp/node_modules/picomatch/lib/parse.js
|
|
4672
4676
|
var require_parse = __commonJS((exports, module) => {
|
|
4673
4677
|
var constants = require_constants();
|
|
4674
4678
|
var utils = require_utils();
|
|
@@ -4695,6 +4699,213 @@ var require_parse = __commonJS((exports, module) => {
|
|
|
4695
4699
|
var syntaxError = (type, char) => {
|
|
4696
4700
|
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
4697
4701
|
};
|
|
4702
|
+
var splitTopLevel = (input) => {
|
|
4703
|
+
const parts = [];
|
|
4704
|
+
let bracket = 0;
|
|
4705
|
+
let paren = 0;
|
|
4706
|
+
let quote = 0;
|
|
4707
|
+
let value = "";
|
|
4708
|
+
let escaped = false;
|
|
4709
|
+
for (const ch of input) {
|
|
4710
|
+
if (escaped === true) {
|
|
4711
|
+
value += ch;
|
|
4712
|
+
escaped = false;
|
|
4713
|
+
continue;
|
|
4714
|
+
}
|
|
4715
|
+
if (ch === "\\") {
|
|
4716
|
+
value += ch;
|
|
4717
|
+
escaped = true;
|
|
4718
|
+
continue;
|
|
4719
|
+
}
|
|
4720
|
+
if (ch === '"') {
|
|
4721
|
+
quote = quote === 1 ? 0 : 1;
|
|
4722
|
+
value += ch;
|
|
4723
|
+
continue;
|
|
4724
|
+
}
|
|
4725
|
+
if (quote === 0) {
|
|
4726
|
+
if (ch === "[") {
|
|
4727
|
+
bracket++;
|
|
4728
|
+
} else if (ch === "]" && bracket > 0) {
|
|
4729
|
+
bracket--;
|
|
4730
|
+
} else if (bracket === 0) {
|
|
4731
|
+
if (ch === "(") {
|
|
4732
|
+
paren++;
|
|
4733
|
+
} else if (ch === ")" && paren > 0) {
|
|
4734
|
+
paren--;
|
|
4735
|
+
} else if (ch === "|" && paren === 0) {
|
|
4736
|
+
parts.push(value);
|
|
4737
|
+
value = "";
|
|
4738
|
+
continue;
|
|
4739
|
+
}
|
|
4740
|
+
}
|
|
4741
|
+
}
|
|
4742
|
+
value += ch;
|
|
4743
|
+
}
|
|
4744
|
+
parts.push(value);
|
|
4745
|
+
return parts;
|
|
4746
|
+
};
|
|
4747
|
+
var isPlainBranch = (branch) => {
|
|
4748
|
+
let escaped = false;
|
|
4749
|
+
for (const ch of branch) {
|
|
4750
|
+
if (escaped === true) {
|
|
4751
|
+
escaped = false;
|
|
4752
|
+
continue;
|
|
4753
|
+
}
|
|
4754
|
+
if (ch === "\\") {
|
|
4755
|
+
escaped = true;
|
|
4756
|
+
continue;
|
|
4757
|
+
}
|
|
4758
|
+
if (/[?*+@!()[\]{}]/.test(ch)) {
|
|
4759
|
+
return false;
|
|
4760
|
+
}
|
|
4761
|
+
}
|
|
4762
|
+
return true;
|
|
4763
|
+
};
|
|
4764
|
+
var normalizeSimpleBranch = (branch) => {
|
|
4765
|
+
let value = branch.trim();
|
|
4766
|
+
let changed = true;
|
|
4767
|
+
while (changed === true) {
|
|
4768
|
+
changed = false;
|
|
4769
|
+
if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
|
|
4770
|
+
value = value.slice(2, -1);
|
|
4771
|
+
changed = true;
|
|
4772
|
+
}
|
|
4773
|
+
}
|
|
4774
|
+
if (!isPlainBranch(value)) {
|
|
4775
|
+
return;
|
|
4776
|
+
}
|
|
4777
|
+
return value.replace(/\\(.)/g, "$1");
|
|
4778
|
+
};
|
|
4779
|
+
var hasRepeatedCharPrefixOverlap = (branches) => {
|
|
4780
|
+
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
4781
|
+
for (let i = 0;i < values.length; i++) {
|
|
4782
|
+
for (let j = i + 1;j < values.length; j++) {
|
|
4783
|
+
const a = values[i];
|
|
4784
|
+
const b = values[j];
|
|
4785
|
+
const char = a[0];
|
|
4786
|
+
if (!char || a !== char.repeat(a.length) || b !== char.repeat(b.length)) {
|
|
4787
|
+
continue;
|
|
4788
|
+
}
|
|
4789
|
+
if (a === b || a.startsWith(b) || b.startsWith(a)) {
|
|
4790
|
+
return true;
|
|
4791
|
+
}
|
|
4792
|
+
}
|
|
4793
|
+
}
|
|
4794
|
+
return false;
|
|
4795
|
+
};
|
|
4796
|
+
var parseRepeatedExtglob = (pattern, requireEnd = true) => {
|
|
4797
|
+
if (pattern[0] !== "+" && pattern[0] !== "*" || pattern[1] !== "(") {
|
|
4798
|
+
return;
|
|
4799
|
+
}
|
|
4800
|
+
let bracket = 0;
|
|
4801
|
+
let paren = 0;
|
|
4802
|
+
let quote = 0;
|
|
4803
|
+
let escaped = false;
|
|
4804
|
+
for (let i = 1;i < pattern.length; i++) {
|
|
4805
|
+
const ch = pattern[i];
|
|
4806
|
+
if (escaped === true) {
|
|
4807
|
+
escaped = false;
|
|
4808
|
+
continue;
|
|
4809
|
+
}
|
|
4810
|
+
if (ch === "\\") {
|
|
4811
|
+
escaped = true;
|
|
4812
|
+
continue;
|
|
4813
|
+
}
|
|
4814
|
+
if (ch === '"') {
|
|
4815
|
+
quote = quote === 1 ? 0 : 1;
|
|
4816
|
+
continue;
|
|
4817
|
+
}
|
|
4818
|
+
if (quote === 1) {
|
|
4819
|
+
continue;
|
|
4820
|
+
}
|
|
4821
|
+
if (ch === "[") {
|
|
4822
|
+
bracket++;
|
|
4823
|
+
continue;
|
|
4824
|
+
}
|
|
4825
|
+
if (ch === "]" && bracket > 0) {
|
|
4826
|
+
bracket--;
|
|
4827
|
+
continue;
|
|
4828
|
+
}
|
|
4829
|
+
if (bracket > 0) {
|
|
4830
|
+
continue;
|
|
4831
|
+
}
|
|
4832
|
+
if (ch === "(") {
|
|
4833
|
+
paren++;
|
|
4834
|
+
continue;
|
|
4835
|
+
}
|
|
4836
|
+
if (ch === ")") {
|
|
4837
|
+
paren--;
|
|
4838
|
+
if (paren === 0) {
|
|
4839
|
+
if (requireEnd === true && i !== pattern.length - 1) {
|
|
4840
|
+
return;
|
|
4841
|
+
}
|
|
4842
|
+
return {
|
|
4843
|
+
type: pattern[0],
|
|
4844
|
+
body: pattern.slice(2, i),
|
|
4845
|
+
end: i
|
|
4846
|
+
};
|
|
4847
|
+
}
|
|
4848
|
+
}
|
|
4849
|
+
}
|
|
4850
|
+
};
|
|
4851
|
+
var getStarExtglobSequenceOutput = (pattern) => {
|
|
4852
|
+
let index = 0;
|
|
4853
|
+
const chars = [];
|
|
4854
|
+
while (index < pattern.length) {
|
|
4855
|
+
const match2 = parseRepeatedExtglob(pattern.slice(index), false);
|
|
4856
|
+
if (!match2 || match2.type !== "*") {
|
|
4857
|
+
return;
|
|
4858
|
+
}
|
|
4859
|
+
const branches = splitTopLevel(match2.body).map((branch2) => branch2.trim());
|
|
4860
|
+
if (branches.length !== 1) {
|
|
4861
|
+
return;
|
|
4862
|
+
}
|
|
4863
|
+
const branch = normalizeSimpleBranch(branches[0]);
|
|
4864
|
+
if (!branch || branch.length !== 1) {
|
|
4865
|
+
return;
|
|
4866
|
+
}
|
|
4867
|
+
chars.push(branch);
|
|
4868
|
+
index += match2.end + 1;
|
|
4869
|
+
}
|
|
4870
|
+
if (chars.length < 1) {
|
|
4871
|
+
return;
|
|
4872
|
+
}
|
|
4873
|
+
const source = chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`;
|
|
4874
|
+
return `${source}*`;
|
|
4875
|
+
};
|
|
4876
|
+
var repeatedExtglobRecursion = (pattern) => {
|
|
4877
|
+
let depth = 0;
|
|
4878
|
+
let value = pattern.trim();
|
|
4879
|
+
let match2 = parseRepeatedExtglob(value);
|
|
4880
|
+
while (match2) {
|
|
4881
|
+
depth++;
|
|
4882
|
+
value = match2.body.trim();
|
|
4883
|
+
match2 = parseRepeatedExtglob(value);
|
|
4884
|
+
}
|
|
4885
|
+
return depth;
|
|
4886
|
+
};
|
|
4887
|
+
var analyzeRepeatedExtglob = (body, options) => {
|
|
4888
|
+
if (options.maxExtglobRecursion === false) {
|
|
4889
|
+
return { risky: false };
|
|
4890
|
+
}
|
|
4891
|
+
const max = typeof options.maxExtglobRecursion === "number" ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
|
|
4892
|
+
const branches = splitTopLevel(body).map((branch) => branch.trim());
|
|
4893
|
+
if (branches.length > 1) {
|
|
4894
|
+
if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) {
|
|
4895
|
+
return { risky: true };
|
|
4896
|
+
}
|
|
4897
|
+
}
|
|
4898
|
+
for (const branch of branches) {
|
|
4899
|
+
const safeOutput = getStarExtglobSequenceOutput(branch);
|
|
4900
|
+
if (safeOutput) {
|
|
4901
|
+
return { risky: true, safeOutput };
|
|
4902
|
+
}
|
|
4903
|
+
if (repeatedExtglobRecursion(branch) > max) {
|
|
4904
|
+
return { risky: true };
|
|
4905
|
+
}
|
|
4906
|
+
}
|
|
4907
|
+
return { risky: false };
|
|
4908
|
+
};
|
|
4698
4909
|
var parse = (input, options) => {
|
|
4699
4910
|
if (typeof input !== "string") {
|
|
4700
4911
|
throw new TypeError("Expected a string");
|
|
@@ -4827,6 +5038,8 @@ var require_parse = __commonJS((exports, module) => {
|
|
|
4827
5038
|
token.prev = prev;
|
|
4828
5039
|
token.parens = state.parens;
|
|
4829
5040
|
token.output = state.output;
|
|
5041
|
+
token.startIndex = state.index;
|
|
5042
|
+
token.tokensIndex = tokens.length;
|
|
4830
5043
|
const output = (opts.capture ? "(" : "") + token.open;
|
|
4831
5044
|
increment("parens");
|
|
4832
5045
|
push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
|
|
@@ -4834,6 +5047,26 @@ var require_parse = __commonJS((exports, module) => {
|
|
|
4834
5047
|
extglobs.push(token);
|
|
4835
5048
|
};
|
|
4836
5049
|
const extglobClose = (token) => {
|
|
5050
|
+
const literal = input.slice(token.startIndex, state.index + 1);
|
|
5051
|
+
const body = input.slice(token.startIndex + 2, state.index);
|
|
5052
|
+
const analysis = analyzeRepeatedExtglob(body, opts);
|
|
5053
|
+
if ((token.type === "plus" || token.type === "star") && analysis.risky) {
|
|
5054
|
+
const safeOutput = analysis.safeOutput ? (token.output ? "" : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : undefined;
|
|
5055
|
+
const open = tokens[token.tokensIndex];
|
|
5056
|
+
open.type = "text";
|
|
5057
|
+
open.value = literal;
|
|
5058
|
+
open.output = safeOutput || utils.escapeRegex(literal);
|
|
5059
|
+
for (let i = token.tokensIndex + 1;i < tokens.length; i++) {
|
|
5060
|
+
tokens[i].value = "";
|
|
5061
|
+
tokens[i].output = "";
|
|
5062
|
+
delete tokens[i].suffix;
|
|
5063
|
+
}
|
|
5064
|
+
state.output = token.output + open.output;
|
|
5065
|
+
state.backtrack = true;
|
|
5066
|
+
push({ type: "paren", extglob: true, value, output: "" });
|
|
5067
|
+
decrement("parens");
|
|
5068
|
+
return;
|
|
5069
|
+
}
|
|
4837
5070
|
let output = token.close + (opts.capture ? ")" : "");
|
|
4838
5071
|
let rest;
|
|
4839
5072
|
if (token.type === "negate") {
|
|
@@ -5446,7 +5679,7 @@ var require_parse = __commonJS((exports, module) => {
|
|
|
5446
5679
|
module.exports = parse;
|
|
5447
5680
|
});
|
|
5448
5681
|
|
|
5449
|
-
//
|
|
5682
|
+
// node_modules/chokidar/node_modules/readdirp/node_modules/picomatch/lib/picomatch.js
|
|
5450
5683
|
var require_picomatch = __commonJS((exports, module) => {
|
|
5451
5684
|
var path4 = __require("node:path");
|
|
5452
5685
|
var scan = require_scan();
|
|
@@ -5587,7 +5820,7 @@ var require_picomatch = __commonJS((exports, module) => {
|
|
|
5587
5820
|
module.exports = picomatch;
|
|
5588
5821
|
});
|
|
5589
5822
|
|
|
5590
|
-
//
|
|
5823
|
+
// node_modules/chokidar/node_modules/readdirp/index.js
|
|
5591
5824
|
var require_readdirp = __commonJS((exports, module) => {
|
|
5592
5825
|
var fs2 = __require("node:fs");
|
|
5593
5826
|
var { Readable } = __require("node:stream");
|
|
@@ -5724,98 +5957,1532 @@ var require_readdirp = __commonJS((exports, module) => {
|
|
|
5724
5957
|
this.reading = false;
|
|
5725
5958
|
}
|
|
5726
5959
|
}
|
|
5727
|
-
async _exploreDir(path4, depth) {
|
|
5728
|
-
let files;
|
|
5729
|
-
try {
|
|
5730
|
-
files = await readdir2(path4, this._rdOptions);
|
|
5731
|
-
} catch (error) {
|
|
5732
|
-
this._onError(error);
|
|
5733
|
-
}
|
|
5734
|
-
return { files, depth, path: path4 };
|
|
5960
|
+
async _exploreDir(path4, depth) {
|
|
5961
|
+
let files;
|
|
5962
|
+
try {
|
|
5963
|
+
files = await readdir2(path4, this._rdOptions);
|
|
5964
|
+
} catch (error) {
|
|
5965
|
+
this._onError(error);
|
|
5966
|
+
}
|
|
5967
|
+
return { files, depth, path: path4 };
|
|
5968
|
+
}
|
|
5969
|
+
async _formatEntry(dirent, path4) {
|
|
5970
|
+
let entry;
|
|
5971
|
+
try {
|
|
5972
|
+
const basename2 = this._isDirent ? dirent.name : dirent;
|
|
5973
|
+
const fullPath = sysPath.resolve(sysPath.join(path4, basename2));
|
|
5974
|
+
entry = { path: sysPath.relative(this._root, fullPath), fullPath, basename: basename2 };
|
|
5975
|
+
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
5976
|
+
} catch (err) {
|
|
5977
|
+
this._onError(err);
|
|
5978
|
+
}
|
|
5979
|
+
return entry;
|
|
5980
|
+
}
|
|
5981
|
+
_onError(err) {
|
|
5982
|
+
if (isNormalFlowError(err) && !this.destroyed) {
|
|
5983
|
+
this.emit("warn", err);
|
|
5984
|
+
} else {
|
|
5985
|
+
this.destroy(err);
|
|
5986
|
+
}
|
|
5987
|
+
}
|
|
5988
|
+
async _getEntryType(entry) {
|
|
5989
|
+
const stats = entry && entry[this._statsProp];
|
|
5990
|
+
if (!stats) {
|
|
5991
|
+
return;
|
|
5992
|
+
}
|
|
5993
|
+
if (stats.isFile()) {
|
|
5994
|
+
return "file";
|
|
5995
|
+
}
|
|
5996
|
+
if (stats.isDirectory()) {
|
|
5997
|
+
return "directory";
|
|
5998
|
+
}
|
|
5999
|
+
if (stats && stats.isSymbolicLink()) {
|
|
6000
|
+
const full = entry.fullPath;
|
|
6001
|
+
try {
|
|
6002
|
+
const entryRealPath = await realpath2(full);
|
|
6003
|
+
const entryRealPathStats = await lstat2(entryRealPath);
|
|
6004
|
+
if (entryRealPathStats.isFile()) {
|
|
6005
|
+
return "file";
|
|
6006
|
+
}
|
|
6007
|
+
if (entryRealPathStats.isDirectory()) {
|
|
6008
|
+
const len = entryRealPath.length;
|
|
6009
|
+
if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath.sep) {
|
|
6010
|
+
const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
|
|
6011
|
+
recursiveError.code = RECURSIVE_ERROR_CODE;
|
|
6012
|
+
return this._onError(recursiveError);
|
|
6013
|
+
}
|
|
6014
|
+
return "directory";
|
|
6015
|
+
}
|
|
6016
|
+
} catch (error) {
|
|
6017
|
+
this._onError(error);
|
|
6018
|
+
}
|
|
6019
|
+
}
|
|
6020
|
+
}
|
|
6021
|
+
_includeAsFile(entry) {
|
|
6022
|
+
const stats = entry && entry[this._statsProp];
|
|
6023
|
+
return stats && this._wantsEverything && !stats.isDirectory();
|
|
6024
|
+
}
|
|
6025
|
+
}
|
|
6026
|
+
var readdirp = (root, options = {}) => {
|
|
6027
|
+
let type = options.entryType || options.type;
|
|
6028
|
+
if (type === "both")
|
|
6029
|
+
type = FILE_DIR_TYPE;
|
|
6030
|
+
if (type)
|
|
6031
|
+
options.type = type;
|
|
6032
|
+
if (!root) {
|
|
6033
|
+
throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
|
|
6034
|
+
} else if (typeof root !== "string") {
|
|
6035
|
+
throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
|
|
6036
|
+
} else if (type && !ALL_TYPES.includes(type)) {
|
|
6037
|
+
throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
|
|
6038
|
+
}
|
|
6039
|
+
options.root = root;
|
|
6040
|
+
return new ReaddirpStream(options);
|
|
6041
|
+
};
|
|
6042
|
+
var readdirpPromise = (root, options = {}) => {
|
|
6043
|
+
return new Promise((resolve, reject) => {
|
|
6044
|
+
const files = [];
|
|
6045
|
+
readdirp(root, options).on("data", (entry) => files.push(entry)).on("end", () => resolve(files)).on("error", (error) => reject(error));
|
|
6046
|
+
});
|
|
6047
|
+
};
|
|
6048
|
+
readdirp.promise = readdirpPromise;
|
|
6049
|
+
readdirp.ReaddirpStream = ReaddirpStream;
|
|
6050
|
+
readdirp.default = readdirp;
|
|
6051
|
+
module.exports = readdirp;
|
|
6052
|
+
});
|
|
6053
|
+
|
|
6054
|
+
// ../../node_modules/picomatch/lib/constants.js
|
|
6055
|
+
var require_constants2 = __commonJS((exports, module) => {
|
|
6056
|
+
var path4 = __require("node:path");
|
|
6057
|
+
var WIN_SLASH = "\\\\/";
|
|
6058
|
+
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
6059
|
+
var DOT_LITERAL = "\\.";
|
|
6060
|
+
var PLUS_LITERAL = "\\+";
|
|
6061
|
+
var QMARK_LITERAL = "\\?";
|
|
6062
|
+
var SLASH_LITERAL = "\\/";
|
|
6063
|
+
var ONE_CHAR = "(?=.)";
|
|
6064
|
+
var QMARK = "[^/]";
|
|
6065
|
+
var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
|
|
6066
|
+
var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
|
|
6067
|
+
var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
|
|
6068
|
+
var NO_DOT = `(?!${DOT_LITERAL})`;
|
|
6069
|
+
var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
|
|
6070
|
+
var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
|
|
6071
|
+
var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
|
|
6072
|
+
var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
|
|
6073
|
+
var STAR = `${QMARK}*?`;
|
|
6074
|
+
var POSIX_CHARS = {
|
|
6075
|
+
DOT_LITERAL,
|
|
6076
|
+
PLUS_LITERAL,
|
|
6077
|
+
QMARK_LITERAL,
|
|
6078
|
+
SLASH_LITERAL,
|
|
6079
|
+
ONE_CHAR,
|
|
6080
|
+
QMARK,
|
|
6081
|
+
END_ANCHOR,
|
|
6082
|
+
DOTS_SLASH,
|
|
6083
|
+
NO_DOT,
|
|
6084
|
+
NO_DOTS,
|
|
6085
|
+
NO_DOT_SLASH,
|
|
6086
|
+
NO_DOTS_SLASH,
|
|
6087
|
+
QMARK_NO_DOT,
|
|
6088
|
+
STAR,
|
|
6089
|
+
START_ANCHOR
|
|
6090
|
+
};
|
|
6091
|
+
var WINDOWS_CHARS = {
|
|
6092
|
+
...POSIX_CHARS,
|
|
6093
|
+
SLASH_LITERAL: `[${WIN_SLASH}]`,
|
|
6094
|
+
QMARK: WIN_NO_SLASH,
|
|
6095
|
+
STAR: `${WIN_NO_SLASH}*?`,
|
|
6096
|
+
DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
|
|
6097
|
+
NO_DOT: `(?!${DOT_LITERAL})`,
|
|
6098
|
+
NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
6099
|
+
NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
|
|
6100
|
+
NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
6101
|
+
QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
|
|
6102
|
+
START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
|
|
6103
|
+
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
|
|
6104
|
+
};
|
|
6105
|
+
var POSIX_REGEX_SOURCE = {
|
|
6106
|
+
alnum: "a-zA-Z0-9",
|
|
6107
|
+
alpha: "a-zA-Z",
|
|
6108
|
+
ascii: "\\x00-\\x7F",
|
|
6109
|
+
blank: " \\t",
|
|
6110
|
+
cntrl: "\\x00-\\x1F\\x7F",
|
|
6111
|
+
digit: "0-9",
|
|
6112
|
+
graph: "\\x21-\\x7E",
|
|
6113
|
+
lower: "a-z",
|
|
6114
|
+
print: "\\x20-\\x7E ",
|
|
6115
|
+
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
|
|
6116
|
+
space: " \\t\\r\\n\\v\\f",
|
|
6117
|
+
upper: "A-Z",
|
|
6118
|
+
word: "A-Za-z0-9_",
|
|
6119
|
+
xdigit: "A-Fa-f0-9"
|
|
6120
|
+
};
|
|
6121
|
+
module.exports = {
|
|
6122
|
+
MAX_LENGTH: 1024 * 64,
|
|
6123
|
+
POSIX_REGEX_SOURCE,
|
|
6124
|
+
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
6125
|
+
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
6126
|
+
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
|
6127
|
+
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
|
6128
|
+
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
|
6129
|
+
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
6130
|
+
REPLACEMENTS: {
|
|
6131
|
+
"***": "*",
|
|
6132
|
+
"**/**": "**",
|
|
6133
|
+
"**/**/**": "**"
|
|
6134
|
+
},
|
|
6135
|
+
CHAR_0: 48,
|
|
6136
|
+
CHAR_9: 57,
|
|
6137
|
+
CHAR_UPPERCASE_A: 65,
|
|
6138
|
+
CHAR_LOWERCASE_A: 97,
|
|
6139
|
+
CHAR_UPPERCASE_Z: 90,
|
|
6140
|
+
CHAR_LOWERCASE_Z: 122,
|
|
6141
|
+
CHAR_LEFT_PARENTHESES: 40,
|
|
6142
|
+
CHAR_RIGHT_PARENTHESES: 41,
|
|
6143
|
+
CHAR_ASTERISK: 42,
|
|
6144
|
+
CHAR_AMPERSAND: 38,
|
|
6145
|
+
CHAR_AT: 64,
|
|
6146
|
+
CHAR_BACKWARD_SLASH: 92,
|
|
6147
|
+
CHAR_CARRIAGE_RETURN: 13,
|
|
6148
|
+
CHAR_CIRCUMFLEX_ACCENT: 94,
|
|
6149
|
+
CHAR_COLON: 58,
|
|
6150
|
+
CHAR_COMMA: 44,
|
|
6151
|
+
CHAR_DOT: 46,
|
|
6152
|
+
CHAR_DOUBLE_QUOTE: 34,
|
|
6153
|
+
CHAR_EQUAL: 61,
|
|
6154
|
+
CHAR_EXCLAMATION_MARK: 33,
|
|
6155
|
+
CHAR_FORM_FEED: 12,
|
|
6156
|
+
CHAR_FORWARD_SLASH: 47,
|
|
6157
|
+
CHAR_GRAVE_ACCENT: 96,
|
|
6158
|
+
CHAR_HASH: 35,
|
|
6159
|
+
CHAR_HYPHEN_MINUS: 45,
|
|
6160
|
+
CHAR_LEFT_ANGLE_BRACKET: 60,
|
|
6161
|
+
CHAR_LEFT_CURLY_BRACE: 123,
|
|
6162
|
+
CHAR_LEFT_SQUARE_BRACKET: 91,
|
|
6163
|
+
CHAR_LINE_FEED: 10,
|
|
6164
|
+
CHAR_NO_BREAK_SPACE: 160,
|
|
6165
|
+
CHAR_PERCENT: 37,
|
|
6166
|
+
CHAR_PLUS: 43,
|
|
6167
|
+
CHAR_QUESTION_MARK: 63,
|
|
6168
|
+
CHAR_RIGHT_ANGLE_BRACKET: 62,
|
|
6169
|
+
CHAR_RIGHT_CURLY_BRACE: 125,
|
|
6170
|
+
CHAR_RIGHT_SQUARE_BRACKET: 93,
|
|
6171
|
+
CHAR_SEMICOLON: 59,
|
|
6172
|
+
CHAR_SINGLE_QUOTE: 39,
|
|
6173
|
+
CHAR_SPACE: 32,
|
|
6174
|
+
CHAR_TAB: 9,
|
|
6175
|
+
CHAR_UNDERSCORE: 95,
|
|
6176
|
+
CHAR_VERTICAL_LINE: 124,
|
|
6177
|
+
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
6178
|
+
SEP: path4.sep,
|
|
6179
|
+
extglobChars(chars) {
|
|
6180
|
+
return {
|
|
6181
|
+
"!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
|
|
6182
|
+
"?": { type: "qmark", open: "(?:", close: ")?" },
|
|
6183
|
+
"+": { type: "plus", open: "(?:", close: ")+" },
|
|
6184
|
+
"*": { type: "star", open: "(?:", close: ")*" },
|
|
6185
|
+
"@": { type: "at", open: "(?:", close: ")" }
|
|
6186
|
+
};
|
|
6187
|
+
},
|
|
6188
|
+
globChars(win322) {
|
|
6189
|
+
return win322 === true ? WINDOWS_CHARS : POSIX_CHARS;
|
|
6190
|
+
}
|
|
6191
|
+
};
|
|
6192
|
+
});
|
|
6193
|
+
|
|
6194
|
+
// ../../node_modules/picomatch/lib/utils.js
|
|
6195
|
+
var require_utils2 = __commonJS((exports) => {
|
|
6196
|
+
var path4 = __require("node:path");
|
|
6197
|
+
var win322 = process.platform === "win32";
|
|
6198
|
+
var {
|
|
6199
|
+
REGEX_BACKSLASH,
|
|
6200
|
+
REGEX_REMOVE_BACKSLASH,
|
|
6201
|
+
REGEX_SPECIAL_CHARS,
|
|
6202
|
+
REGEX_SPECIAL_CHARS_GLOBAL
|
|
6203
|
+
} = require_constants2();
|
|
6204
|
+
exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
6205
|
+
exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
|
|
6206
|
+
exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
|
|
6207
|
+
exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
|
|
6208
|
+
exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
|
|
6209
|
+
exports.removeBackslashes = (str) => {
|
|
6210
|
+
return str.replace(REGEX_REMOVE_BACKSLASH, (match2) => {
|
|
6211
|
+
return match2 === "\\" ? "" : match2;
|
|
6212
|
+
});
|
|
6213
|
+
};
|
|
6214
|
+
exports.supportsLookbehinds = () => {
|
|
6215
|
+
const segs = process.version.slice(1).split(".").map(Number);
|
|
6216
|
+
if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
|
|
6217
|
+
return true;
|
|
6218
|
+
}
|
|
6219
|
+
return false;
|
|
6220
|
+
};
|
|
6221
|
+
exports.isWindows = (options) => {
|
|
6222
|
+
if (options && typeof options.windows === "boolean") {
|
|
6223
|
+
return options.windows;
|
|
6224
|
+
}
|
|
6225
|
+
return win322 === true || path4.sep === "\\";
|
|
6226
|
+
};
|
|
6227
|
+
exports.escapeLast = (input, char, lastIdx) => {
|
|
6228
|
+
const idx = input.lastIndexOf(char, lastIdx);
|
|
6229
|
+
if (idx === -1)
|
|
6230
|
+
return input;
|
|
6231
|
+
if (input[idx - 1] === "\\")
|
|
6232
|
+
return exports.escapeLast(input, char, idx - 1);
|
|
6233
|
+
return `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
|
6234
|
+
};
|
|
6235
|
+
exports.removePrefix = (input, state = {}) => {
|
|
6236
|
+
let output = input;
|
|
6237
|
+
if (output.startsWith("./")) {
|
|
6238
|
+
output = output.slice(2);
|
|
6239
|
+
state.prefix = "./";
|
|
6240
|
+
}
|
|
6241
|
+
return output;
|
|
6242
|
+
};
|
|
6243
|
+
exports.wrapOutput = (input, state = {}, options = {}) => {
|
|
6244
|
+
const prepend = options.contains ? "" : "^";
|
|
6245
|
+
const append = options.contains ? "" : "$";
|
|
6246
|
+
let output = `${prepend}(?:${input})${append}`;
|
|
6247
|
+
if (state.negated === true) {
|
|
6248
|
+
output = `(?:^(?!${output}).*$)`;
|
|
6249
|
+
}
|
|
6250
|
+
return output;
|
|
6251
|
+
};
|
|
6252
|
+
});
|
|
6253
|
+
|
|
6254
|
+
// ../../node_modules/picomatch/lib/scan.js
|
|
6255
|
+
var require_scan2 = __commonJS((exports, module) => {
|
|
6256
|
+
var utils = require_utils2();
|
|
6257
|
+
var {
|
|
6258
|
+
CHAR_ASTERISK,
|
|
6259
|
+
CHAR_AT,
|
|
6260
|
+
CHAR_BACKWARD_SLASH,
|
|
6261
|
+
CHAR_COMMA,
|
|
6262
|
+
CHAR_DOT,
|
|
6263
|
+
CHAR_EXCLAMATION_MARK,
|
|
6264
|
+
CHAR_FORWARD_SLASH,
|
|
6265
|
+
CHAR_LEFT_CURLY_BRACE,
|
|
6266
|
+
CHAR_LEFT_PARENTHESES,
|
|
6267
|
+
CHAR_LEFT_SQUARE_BRACKET,
|
|
6268
|
+
CHAR_PLUS,
|
|
6269
|
+
CHAR_QUESTION_MARK,
|
|
6270
|
+
CHAR_RIGHT_CURLY_BRACE,
|
|
6271
|
+
CHAR_RIGHT_PARENTHESES,
|
|
6272
|
+
CHAR_RIGHT_SQUARE_BRACKET
|
|
6273
|
+
} = require_constants2();
|
|
6274
|
+
var isPathSeparator = (code) => {
|
|
6275
|
+
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
|
6276
|
+
};
|
|
6277
|
+
var depth = (token) => {
|
|
6278
|
+
if (token.isPrefix !== true) {
|
|
6279
|
+
token.depth = token.isGlobstar ? Infinity : 1;
|
|
6280
|
+
}
|
|
6281
|
+
};
|
|
6282
|
+
var scan = (input, options) => {
|
|
6283
|
+
const opts = options || {};
|
|
6284
|
+
const length = input.length - 1;
|
|
6285
|
+
const scanToEnd = opts.parts === true || opts.scanToEnd === true;
|
|
6286
|
+
const slashes = [];
|
|
6287
|
+
const tokens = [];
|
|
6288
|
+
const parts = [];
|
|
6289
|
+
let str = input;
|
|
6290
|
+
let index = -1;
|
|
6291
|
+
let start = 0;
|
|
6292
|
+
let lastIndex = 0;
|
|
6293
|
+
let isBrace = false;
|
|
6294
|
+
let isBracket = false;
|
|
6295
|
+
let isGlob = false;
|
|
6296
|
+
let isExtglob = false;
|
|
6297
|
+
let isGlobstar = false;
|
|
6298
|
+
let braceEscaped = false;
|
|
6299
|
+
let backslashes = false;
|
|
6300
|
+
let negated = false;
|
|
6301
|
+
let negatedExtglob = false;
|
|
6302
|
+
let finished = false;
|
|
6303
|
+
let braces = 0;
|
|
6304
|
+
let prev;
|
|
6305
|
+
let code;
|
|
6306
|
+
let token = { value: "", depth: 0, isGlob: false };
|
|
6307
|
+
const eos = () => index >= length;
|
|
6308
|
+
const peek = () => str.charCodeAt(index + 1);
|
|
6309
|
+
const advance = () => {
|
|
6310
|
+
prev = code;
|
|
6311
|
+
return str.charCodeAt(++index);
|
|
6312
|
+
};
|
|
6313
|
+
while (index < length) {
|
|
6314
|
+
code = advance();
|
|
6315
|
+
let next;
|
|
6316
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
6317
|
+
backslashes = token.backslashes = true;
|
|
6318
|
+
code = advance();
|
|
6319
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
6320
|
+
braceEscaped = true;
|
|
6321
|
+
}
|
|
6322
|
+
continue;
|
|
6323
|
+
}
|
|
6324
|
+
if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
|
|
6325
|
+
braces++;
|
|
6326
|
+
while (eos() !== true && (code = advance())) {
|
|
6327
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
6328
|
+
backslashes = token.backslashes = true;
|
|
6329
|
+
advance();
|
|
6330
|
+
continue;
|
|
6331
|
+
}
|
|
6332
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
6333
|
+
braces++;
|
|
6334
|
+
continue;
|
|
6335
|
+
}
|
|
6336
|
+
if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
|
|
6337
|
+
isBrace = token.isBrace = true;
|
|
6338
|
+
isGlob = token.isGlob = true;
|
|
6339
|
+
finished = true;
|
|
6340
|
+
if (scanToEnd === true) {
|
|
6341
|
+
continue;
|
|
6342
|
+
}
|
|
6343
|
+
break;
|
|
6344
|
+
}
|
|
6345
|
+
if (braceEscaped !== true && code === CHAR_COMMA) {
|
|
6346
|
+
isBrace = token.isBrace = true;
|
|
6347
|
+
isGlob = token.isGlob = true;
|
|
6348
|
+
finished = true;
|
|
6349
|
+
if (scanToEnd === true) {
|
|
6350
|
+
continue;
|
|
6351
|
+
}
|
|
6352
|
+
break;
|
|
6353
|
+
}
|
|
6354
|
+
if (code === CHAR_RIGHT_CURLY_BRACE) {
|
|
6355
|
+
braces--;
|
|
6356
|
+
if (braces === 0) {
|
|
6357
|
+
braceEscaped = false;
|
|
6358
|
+
isBrace = token.isBrace = true;
|
|
6359
|
+
finished = true;
|
|
6360
|
+
break;
|
|
6361
|
+
}
|
|
6362
|
+
}
|
|
6363
|
+
}
|
|
6364
|
+
if (scanToEnd === true) {
|
|
6365
|
+
continue;
|
|
6366
|
+
}
|
|
6367
|
+
break;
|
|
6368
|
+
}
|
|
6369
|
+
if (code === CHAR_FORWARD_SLASH) {
|
|
6370
|
+
slashes.push(index);
|
|
6371
|
+
tokens.push(token);
|
|
6372
|
+
token = { value: "", depth: 0, isGlob: false };
|
|
6373
|
+
if (finished === true)
|
|
6374
|
+
continue;
|
|
6375
|
+
if (prev === CHAR_DOT && index === start + 1) {
|
|
6376
|
+
start += 2;
|
|
6377
|
+
continue;
|
|
6378
|
+
}
|
|
6379
|
+
lastIndex = index + 1;
|
|
6380
|
+
continue;
|
|
6381
|
+
}
|
|
6382
|
+
if (opts.noext !== true) {
|
|
6383
|
+
const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
|
|
6384
|
+
if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
|
|
6385
|
+
isGlob = token.isGlob = true;
|
|
6386
|
+
isExtglob = token.isExtglob = true;
|
|
6387
|
+
finished = true;
|
|
6388
|
+
if (code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
6389
|
+
negatedExtglob = true;
|
|
6390
|
+
}
|
|
6391
|
+
if (scanToEnd === true) {
|
|
6392
|
+
while (eos() !== true && (code = advance())) {
|
|
6393
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
6394
|
+
backslashes = token.backslashes = true;
|
|
6395
|
+
code = advance();
|
|
6396
|
+
continue;
|
|
6397
|
+
}
|
|
6398
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
6399
|
+
isGlob = token.isGlob = true;
|
|
6400
|
+
finished = true;
|
|
6401
|
+
break;
|
|
6402
|
+
}
|
|
6403
|
+
}
|
|
6404
|
+
continue;
|
|
6405
|
+
}
|
|
6406
|
+
break;
|
|
6407
|
+
}
|
|
6408
|
+
}
|
|
6409
|
+
if (code === CHAR_ASTERISK) {
|
|
6410
|
+
if (prev === CHAR_ASTERISK)
|
|
6411
|
+
isGlobstar = token.isGlobstar = true;
|
|
6412
|
+
isGlob = token.isGlob = true;
|
|
6413
|
+
finished = true;
|
|
6414
|
+
if (scanToEnd === true) {
|
|
6415
|
+
continue;
|
|
6416
|
+
}
|
|
6417
|
+
break;
|
|
6418
|
+
}
|
|
6419
|
+
if (code === CHAR_QUESTION_MARK) {
|
|
6420
|
+
isGlob = token.isGlob = true;
|
|
6421
|
+
finished = true;
|
|
6422
|
+
if (scanToEnd === true) {
|
|
6423
|
+
continue;
|
|
6424
|
+
}
|
|
6425
|
+
break;
|
|
6426
|
+
}
|
|
6427
|
+
if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
|
6428
|
+
while (eos() !== true && (next = advance())) {
|
|
6429
|
+
if (next === CHAR_BACKWARD_SLASH) {
|
|
6430
|
+
backslashes = token.backslashes = true;
|
|
6431
|
+
advance();
|
|
6432
|
+
continue;
|
|
6433
|
+
}
|
|
6434
|
+
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
6435
|
+
isBracket = token.isBracket = true;
|
|
6436
|
+
isGlob = token.isGlob = true;
|
|
6437
|
+
finished = true;
|
|
6438
|
+
break;
|
|
6439
|
+
}
|
|
6440
|
+
}
|
|
6441
|
+
if (scanToEnd === true) {
|
|
6442
|
+
continue;
|
|
6443
|
+
}
|
|
6444
|
+
break;
|
|
6445
|
+
}
|
|
6446
|
+
if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
6447
|
+
negated = token.negated = true;
|
|
6448
|
+
start++;
|
|
6449
|
+
continue;
|
|
6450
|
+
}
|
|
6451
|
+
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
|
|
6452
|
+
isGlob = token.isGlob = true;
|
|
6453
|
+
if (scanToEnd === true) {
|
|
6454
|
+
while (eos() !== true && (code = advance())) {
|
|
6455
|
+
if (code === CHAR_LEFT_PARENTHESES) {
|
|
6456
|
+
backslashes = token.backslashes = true;
|
|
6457
|
+
code = advance();
|
|
6458
|
+
continue;
|
|
6459
|
+
}
|
|
6460
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
6461
|
+
finished = true;
|
|
6462
|
+
break;
|
|
6463
|
+
}
|
|
6464
|
+
}
|
|
6465
|
+
continue;
|
|
6466
|
+
}
|
|
6467
|
+
break;
|
|
6468
|
+
}
|
|
6469
|
+
if (isGlob === true) {
|
|
6470
|
+
finished = true;
|
|
6471
|
+
if (scanToEnd === true) {
|
|
6472
|
+
continue;
|
|
6473
|
+
}
|
|
6474
|
+
break;
|
|
6475
|
+
}
|
|
6476
|
+
}
|
|
6477
|
+
if (opts.noext === true) {
|
|
6478
|
+
isExtglob = false;
|
|
6479
|
+
isGlob = false;
|
|
6480
|
+
}
|
|
6481
|
+
let base2 = str;
|
|
6482
|
+
let prefix = "";
|
|
6483
|
+
let glob2 = "";
|
|
6484
|
+
if (start > 0) {
|
|
6485
|
+
prefix = str.slice(0, start);
|
|
6486
|
+
str = str.slice(start);
|
|
6487
|
+
lastIndex -= start;
|
|
6488
|
+
}
|
|
6489
|
+
if (base2 && isGlob === true && lastIndex > 0) {
|
|
6490
|
+
base2 = str.slice(0, lastIndex);
|
|
6491
|
+
glob2 = str.slice(lastIndex);
|
|
6492
|
+
} else if (isGlob === true) {
|
|
6493
|
+
base2 = "";
|
|
6494
|
+
glob2 = str;
|
|
6495
|
+
} else {
|
|
6496
|
+
base2 = str;
|
|
6497
|
+
}
|
|
6498
|
+
if (base2 && base2 !== "" && base2 !== "/" && base2 !== str) {
|
|
6499
|
+
if (isPathSeparator(base2.charCodeAt(base2.length - 1))) {
|
|
6500
|
+
base2 = base2.slice(0, -1);
|
|
6501
|
+
}
|
|
6502
|
+
}
|
|
6503
|
+
if (opts.unescape === true) {
|
|
6504
|
+
if (glob2)
|
|
6505
|
+
glob2 = utils.removeBackslashes(glob2);
|
|
6506
|
+
if (base2 && backslashes === true) {
|
|
6507
|
+
base2 = utils.removeBackslashes(base2);
|
|
6508
|
+
}
|
|
6509
|
+
}
|
|
6510
|
+
const state = {
|
|
6511
|
+
prefix,
|
|
6512
|
+
input,
|
|
6513
|
+
start,
|
|
6514
|
+
base: base2,
|
|
6515
|
+
glob: glob2,
|
|
6516
|
+
isBrace,
|
|
6517
|
+
isBracket,
|
|
6518
|
+
isGlob,
|
|
6519
|
+
isExtglob,
|
|
6520
|
+
isGlobstar,
|
|
6521
|
+
negated,
|
|
6522
|
+
negatedExtglob
|
|
6523
|
+
};
|
|
6524
|
+
if (opts.tokens === true) {
|
|
6525
|
+
state.maxDepth = 0;
|
|
6526
|
+
if (!isPathSeparator(code)) {
|
|
6527
|
+
tokens.push(token);
|
|
6528
|
+
}
|
|
6529
|
+
state.tokens = tokens;
|
|
6530
|
+
}
|
|
6531
|
+
if (opts.parts === true || opts.tokens === true) {
|
|
6532
|
+
let prevIndex;
|
|
6533
|
+
for (let idx = 0;idx < slashes.length; idx++) {
|
|
6534
|
+
const n = prevIndex ? prevIndex + 1 : start;
|
|
6535
|
+
const i = slashes[idx];
|
|
6536
|
+
const value = input.slice(n, i);
|
|
6537
|
+
if (opts.tokens) {
|
|
6538
|
+
if (idx === 0 && start !== 0) {
|
|
6539
|
+
tokens[idx].isPrefix = true;
|
|
6540
|
+
tokens[idx].value = prefix;
|
|
6541
|
+
} else {
|
|
6542
|
+
tokens[idx].value = value;
|
|
6543
|
+
}
|
|
6544
|
+
depth(tokens[idx]);
|
|
6545
|
+
state.maxDepth += tokens[idx].depth;
|
|
6546
|
+
}
|
|
6547
|
+
if (idx !== 0 || value !== "") {
|
|
6548
|
+
parts.push(value);
|
|
6549
|
+
}
|
|
6550
|
+
prevIndex = i;
|
|
6551
|
+
}
|
|
6552
|
+
if (prevIndex && prevIndex + 1 < input.length) {
|
|
6553
|
+
const value = input.slice(prevIndex + 1);
|
|
6554
|
+
parts.push(value);
|
|
6555
|
+
if (opts.tokens) {
|
|
6556
|
+
tokens[tokens.length - 1].value = value;
|
|
6557
|
+
depth(tokens[tokens.length - 1]);
|
|
6558
|
+
state.maxDepth += tokens[tokens.length - 1].depth;
|
|
6559
|
+
}
|
|
6560
|
+
}
|
|
6561
|
+
state.slashes = slashes;
|
|
6562
|
+
state.parts = parts;
|
|
6563
|
+
}
|
|
6564
|
+
return state;
|
|
6565
|
+
};
|
|
6566
|
+
module.exports = scan;
|
|
6567
|
+
});
|
|
6568
|
+
|
|
6569
|
+
// ../../node_modules/picomatch/lib/parse.js
|
|
6570
|
+
var require_parse2 = __commonJS((exports, module) => {
|
|
6571
|
+
var constants = require_constants2();
|
|
6572
|
+
var utils = require_utils2();
|
|
6573
|
+
var {
|
|
6574
|
+
MAX_LENGTH,
|
|
6575
|
+
POSIX_REGEX_SOURCE,
|
|
6576
|
+
REGEX_NON_SPECIAL_CHARS,
|
|
6577
|
+
REGEX_SPECIAL_CHARS_BACKREF,
|
|
6578
|
+
REPLACEMENTS
|
|
6579
|
+
} = constants;
|
|
6580
|
+
var expandRange = (args, options) => {
|
|
6581
|
+
if (typeof options.expandRange === "function") {
|
|
6582
|
+
return options.expandRange(...args, options);
|
|
6583
|
+
}
|
|
6584
|
+
args.sort();
|
|
6585
|
+
const value = `[${args.join("-")}]`;
|
|
6586
|
+
try {
|
|
6587
|
+
new RegExp(value);
|
|
6588
|
+
} catch (ex) {
|
|
6589
|
+
return args.map((v) => utils.escapeRegex(v)).join("..");
|
|
6590
|
+
}
|
|
6591
|
+
return value;
|
|
6592
|
+
};
|
|
6593
|
+
var syntaxError = (type, char) => {
|
|
6594
|
+
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
6595
|
+
};
|
|
6596
|
+
var parse = (input, options) => {
|
|
6597
|
+
if (typeof input !== "string") {
|
|
6598
|
+
throw new TypeError("Expected a string");
|
|
6599
|
+
}
|
|
6600
|
+
input = REPLACEMENTS[input] || input;
|
|
6601
|
+
const opts = { ...options };
|
|
6602
|
+
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
6603
|
+
let len = input.length;
|
|
6604
|
+
if (len > max) {
|
|
6605
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
6606
|
+
}
|
|
6607
|
+
const bos = { type: "bos", value: "", output: opts.prepend || "" };
|
|
6608
|
+
const tokens = [bos];
|
|
6609
|
+
const capture = opts.capture ? "" : "?:";
|
|
6610
|
+
const win322 = utils.isWindows(options);
|
|
6611
|
+
const PLATFORM_CHARS = constants.globChars(win322);
|
|
6612
|
+
const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
|
|
6613
|
+
const {
|
|
6614
|
+
DOT_LITERAL,
|
|
6615
|
+
PLUS_LITERAL,
|
|
6616
|
+
SLASH_LITERAL,
|
|
6617
|
+
ONE_CHAR,
|
|
6618
|
+
DOTS_SLASH,
|
|
6619
|
+
NO_DOT,
|
|
6620
|
+
NO_DOT_SLASH,
|
|
6621
|
+
NO_DOTS_SLASH,
|
|
6622
|
+
QMARK,
|
|
6623
|
+
QMARK_NO_DOT,
|
|
6624
|
+
STAR,
|
|
6625
|
+
START_ANCHOR
|
|
6626
|
+
} = PLATFORM_CHARS;
|
|
6627
|
+
const globstar = (opts2) => {
|
|
6628
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
6629
|
+
};
|
|
6630
|
+
const nodot = opts.dot ? "" : NO_DOT;
|
|
6631
|
+
const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
|
|
6632
|
+
let star3 = opts.bash === true ? globstar(opts) : STAR;
|
|
6633
|
+
if (opts.capture) {
|
|
6634
|
+
star3 = `(${star3})`;
|
|
6635
|
+
}
|
|
6636
|
+
if (typeof opts.noext === "boolean") {
|
|
6637
|
+
opts.noextglob = opts.noext;
|
|
6638
|
+
}
|
|
6639
|
+
const state = {
|
|
6640
|
+
input,
|
|
6641
|
+
index: -1,
|
|
6642
|
+
start: 0,
|
|
6643
|
+
dot: opts.dot === true,
|
|
6644
|
+
consumed: "",
|
|
6645
|
+
output: "",
|
|
6646
|
+
prefix: "",
|
|
6647
|
+
backtrack: false,
|
|
6648
|
+
negated: false,
|
|
6649
|
+
brackets: 0,
|
|
6650
|
+
braces: 0,
|
|
6651
|
+
parens: 0,
|
|
6652
|
+
quotes: 0,
|
|
6653
|
+
globstar: false,
|
|
6654
|
+
tokens
|
|
6655
|
+
};
|
|
6656
|
+
input = utils.removePrefix(input, state);
|
|
6657
|
+
len = input.length;
|
|
6658
|
+
const extglobs = [];
|
|
6659
|
+
const braces = [];
|
|
6660
|
+
const stack = [];
|
|
6661
|
+
let prev = bos;
|
|
6662
|
+
let value;
|
|
6663
|
+
const eos = () => state.index === len - 1;
|
|
6664
|
+
const peek = state.peek = (n = 1) => input[state.index + n];
|
|
6665
|
+
const advance = state.advance = () => input[++state.index] || "";
|
|
6666
|
+
const remaining = () => input.slice(state.index + 1);
|
|
6667
|
+
const consume = (value2 = "", num = 0) => {
|
|
6668
|
+
state.consumed += value2;
|
|
6669
|
+
state.index += num;
|
|
6670
|
+
};
|
|
6671
|
+
const append = (token) => {
|
|
6672
|
+
state.output += token.output != null ? token.output : token.value;
|
|
6673
|
+
consume(token.value);
|
|
6674
|
+
};
|
|
6675
|
+
const negate = () => {
|
|
6676
|
+
let count = 1;
|
|
6677
|
+
while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
|
|
6678
|
+
advance();
|
|
6679
|
+
state.start++;
|
|
6680
|
+
count++;
|
|
6681
|
+
}
|
|
6682
|
+
if (count % 2 === 0) {
|
|
6683
|
+
return false;
|
|
6684
|
+
}
|
|
6685
|
+
state.negated = true;
|
|
6686
|
+
state.start++;
|
|
6687
|
+
return true;
|
|
6688
|
+
};
|
|
6689
|
+
const increment = (type) => {
|
|
6690
|
+
state[type]++;
|
|
6691
|
+
stack.push(type);
|
|
6692
|
+
};
|
|
6693
|
+
const decrement = (type) => {
|
|
6694
|
+
state[type]--;
|
|
6695
|
+
stack.pop();
|
|
6696
|
+
};
|
|
6697
|
+
const push = (tok) => {
|
|
6698
|
+
if (prev.type === "globstar") {
|
|
6699
|
+
const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
|
|
6700
|
+
const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
|
|
6701
|
+
if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
|
|
6702
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
6703
|
+
prev.type = "star";
|
|
6704
|
+
prev.value = "*";
|
|
6705
|
+
prev.output = star3;
|
|
6706
|
+
state.output += prev.output;
|
|
6707
|
+
}
|
|
6708
|
+
}
|
|
6709
|
+
if (extglobs.length && tok.type !== "paren") {
|
|
6710
|
+
extglobs[extglobs.length - 1].inner += tok.value;
|
|
6711
|
+
}
|
|
6712
|
+
if (tok.value || tok.output)
|
|
6713
|
+
append(tok);
|
|
6714
|
+
if (prev && prev.type === "text" && tok.type === "text") {
|
|
6715
|
+
prev.value += tok.value;
|
|
6716
|
+
prev.output = (prev.output || "") + tok.value;
|
|
6717
|
+
return;
|
|
6718
|
+
}
|
|
6719
|
+
tok.prev = prev;
|
|
6720
|
+
tokens.push(tok);
|
|
6721
|
+
prev = tok;
|
|
6722
|
+
};
|
|
6723
|
+
const extglobOpen = (type, value2) => {
|
|
6724
|
+
const token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
|
|
6725
|
+
token.prev = prev;
|
|
6726
|
+
token.parens = state.parens;
|
|
6727
|
+
token.output = state.output;
|
|
6728
|
+
const output = (opts.capture ? "(" : "") + token.open;
|
|
6729
|
+
increment("parens");
|
|
6730
|
+
push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
|
|
6731
|
+
push({ type: "paren", extglob: true, value: advance(), output });
|
|
6732
|
+
extglobs.push(token);
|
|
6733
|
+
};
|
|
6734
|
+
const extglobClose = (token) => {
|
|
6735
|
+
let output = token.close + (opts.capture ? ")" : "");
|
|
6736
|
+
let rest;
|
|
6737
|
+
if (token.type === "negate") {
|
|
6738
|
+
let extglobStar = star3;
|
|
6739
|
+
if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
|
|
6740
|
+
extglobStar = globstar(opts);
|
|
6741
|
+
}
|
|
6742
|
+
if (extglobStar !== star3 || eos() || /^\)+$/.test(remaining())) {
|
|
6743
|
+
output = token.close = `)$))${extglobStar}`;
|
|
6744
|
+
}
|
|
6745
|
+
if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
6746
|
+
const expression = parse(rest, { ...options, fastpaths: false }).output;
|
|
6747
|
+
output = token.close = `)${expression})${extglobStar})`;
|
|
6748
|
+
}
|
|
6749
|
+
if (token.prev.type === "bos") {
|
|
6750
|
+
state.negatedExtglob = true;
|
|
6751
|
+
}
|
|
6752
|
+
}
|
|
6753
|
+
push({ type: "paren", extglob: true, value, output });
|
|
6754
|
+
decrement("parens");
|
|
6755
|
+
};
|
|
6756
|
+
if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
6757
|
+
let backslashes = false;
|
|
6758
|
+
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
|
|
6759
|
+
if (first === "\\") {
|
|
6760
|
+
backslashes = true;
|
|
6761
|
+
return m;
|
|
6762
|
+
}
|
|
6763
|
+
if (first === "?") {
|
|
6764
|
+
if (esc) {
|
|
6765
|
+
return esc + first + (rest ? QMARK.repeat(rest.length) : "");
|
|
6766
|
+
}
|
|
6767
|
+
if (index === 0) {
|
|
6768
|
+
return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
|
|
6769
|
+
}
|
|
6770
|
+
return QMARK.repeat(chars.length);
|
|
6771
|
+
}
|
|
6772
|
+
if (first === ".") {
|
|
6773
|
+
return DOT_LITERAL.repeat(chars.length);
|
|
6774
|
+
}
|
|
6775
|
+
if (first === "*") {
|
|
6776
|
+
if (esc) {
|
|
6777
|
+
return esc + first + (rest ? star3 : "");
|
|
6778
|
+
}
|
|
6779
|
+
return star3;
|
|
6780
|
+
}
|
|
6781
|
+
return esc ? m : `\\${m}`;
|
|
6782
|
+
});
|
|
6783
|
+
if (backslashes === true) {
|
|
6784
|
+
if (opts.unescape === true) {
|
|
6785
|
+
output = output.replace(/\\/g, "");
|
|
6786
|
+
} else {
|
|
6787
|
+
output = output.replace(/\\+/g, (m) => {
|
|
6788
|
+
return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
|
|
6789
|
+
});
|
|
6790
|
+
}
|
|
6791
|
+
}
|
|
6792
|
+
if (output === input && opts.contains === true) {
|
|
6793
|
+
state.output = input;
|
|
6794
|
+
return state;
|
|
6795
|
+
}
|
|
6796
|
+
state.output = utils.wrapOutput(output, state, options);
|
|
6797
|
+
return state;
|
|
6798
|
+
}
|
|
6799
|
+
while (!eos()) {
|
|
6800
|
+
value = advance();
|
|
6801
|
+
if (value === "\x00") {
|
|
6802
|
+
continue;
|
|
6803
|
+
}
|
|
6804
|
+
if (value === "\\") {
|
|
6805
|
+
const next = peek();
|
|
6806
|
+
if (next === "/" && opts.bash !== true) {
|
|
6807
|
+
continue;
|
|
6808
|
+
}
|
|
6809
|
+
if (next === "." || next === ";") {
|
|
6810
|
+
continue;
|
|
6811
|
+
}
|
|
6812
|
+
if (!next) {
|
|
6813
|
+
value += "\\";
|
|
6814
|
+
push({ type: "text", value });
|
|
6815
|
+
continue;
|
|
6816
|
+
}
|
|
6817
|
+
const match2 = /^\\+/.exec(remaining());
|
|
6818
|
+
let slashes = 0;
|
|
6819
|
+
if (match2 && match2[0].length > 2) {
|
|
6820
|
+
slashes = match2[0].length;
|
|
6821
|
+
state.index += slashes;
|
|
6822
|
+
if (slashes % 2 !== 0) {
|
|
6823
|
+
value += "\\";
|
|
6824
|
+
}
|
|
6825
|
+
}
|
|
6826
|
+
if (opts.unescape === true) {
|
|
6827
|
+
value = advance();
|
|
6828
|
+
} else {
|
|
6829
|
+
value += advance();
|
|
6830
|
+
}
|
|
6831
|
+
if (state.brackets === 0) {
|
|
6832
|
+
push({ type: "text", value });
|
|
6833
|
+
continue;
|
|
6834
|
+
}
|
|
6835
|
+
}
|
|
6836
|
+
if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
|
|
6837
|
+
if (opts.posix !== false && value === ":") {
|
|
6838
|
+
const inner = prev.value.slice(1);
|
|
6839
|
+
if (inner.includes("[")) {
|
|
6840
|
+
prev.posix = true;
|
|
6841
|
+
if (inner.includes(":")) {
|
|
6842
|
+
const idx = prev.value.lastIndexOf("[");
|
|
6843
|
+
const pre = prev.value.slice(0, idx);
|
|
6844
|
+
const rest2 = prev.value.slice(idx + 2);
|
|
6845
|
+
const posix2 = POSIX_REGEX_SOURCE[rest2];
|
|
6846
|
+
if (posix2) {
|
|
6847
|
+
prev.value = pre + posix2;
|
|
6848
|
+
state.backtrack = true;
|
|
6849
|
+
advance();
|
|
6850
|
+
if (!bos.output && tokens.indexOf(prev) === 1) {
|
|
6851
|
+
bos.output = ONE_CHAR;
|
|
6852
|
+
}
|
|
6853
|
+
continue;
|
|
6854
|
+
}
|
|
6855
|
+
}
|
|
6856
|
+
}
|
|
6857
|
+
}
|
|
6858
|
+
if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
|
|
6859
|
+
value = `\\${value}`;
|
|
6860
|
+
}
|
|
6861
|
+
if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
|
|
6862
|
+
value = `\\${value}`;
|
|
6863
|
+
}
|
|
6864
|
+
if (opts.posix === true && value === "!" && prev.value === "[") {
|
|
6865
|
+
value = "^";
|
|
6866
|
+
}
|
|
6867
|
+
prev.value += value;
|
|
6868
|
+
append({ value });
|
|
6869
|
+
continue;
|
|
6870
|
+
}
|
|
6871
|
+
if (state.quotes === 1 && value !== '"') {
|
|
6872
|
+
value = utils.escapeRegex(value);
|
|
6873
|
+
prev.value += value;
|
|
6874
|
+
append({ value });
|
|
6875
|
+
continue;
|
|
6876
|
+
}
|
|
6877
|
+
if (value === '"') {
|
|
6878
|
+
state.quotes = state.quotes === 1 ? 0 : 1;
|
|
6879
|
+
if (opts.keepQuotes === true) {
|
|
6880
|
+
push({ type: "text", value });
|
|
6881
|
+
}
|
|
6882
|
+
continue;
|
|
6883
|
+
}
|
|
6884
|
+
if (value === "(") {
|
|
6885
|
+
increment("parens");
|
|
6886
|
+
push({ type: "paren", value });
|
|
6887
|
+
continue;
|
|
6888
|
+
}
|
|
6889
|
+
if (value === ")") {
|
|
6890
|
+
if (state.parens === 0 && opts.strictBrackets === true) {
|
|
6891
|
+
throw new SyntaxError(syntaxError("opening", "("));
|
|
6892
|
+
}
|
|
6893
|
+
const extglob = extglobs[extglobs.length - 1];
|
|
6894
|
+
if (extglob && state.parens === extglob.parens + 1) {
|
|
6895
|
+
extglobClose(extglobs.pop());
|
|
6896
|
+
continue;
|
|
6897
|
+
}
|
|
6898
|
+
push({ type: "paren", value, output: state.parens ? ")" : "\\)" });
|
|
6899
|
+
decrement("parens");
|
|
6900
|
+
continue;
|
|
6901
|
+
}
|
|
6902
|
+
if (value === "[") {
|
|
6903
|
+
if (opts.nobracket === true || !remaining().includes("]")) {
|
|
6904
|
+
if (opts.nobracket !== true && opts.strictBrackets === true) {
|
|
6905
|
+
throw new SyntaxError(syntaxError("closing", "]"));
|
|
6906
|
+
}
|
|
6907
|
+
value = `\\${value}`;
|
|
6908
|
+
} else {
|
|
6909
|
+
increment("brackets");
|
|
6910
|
+
}
|
|
6911
|
+
push({ type: "bracket", value });
|
|
6912
|
+
continue;
|
|
6913
|
+
}
|
|
6914
|
+
if (value === "]") {
|
|
6915
|
+
if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
|
|
6916
|
+
push({ type: "text", value, output: `\\${value}` });
|
|
6917
|
+
continue;
|
|
6918
|
+
}
|
|
6919
|
+
if (state.brackets === 0) {
|
|
6920
|
+
if (opts.strictBrackets === true) {
|
|
6921
|
+
throw new SyntaxError(syntaxError("opening", "["));
|
|
6922
|
+
}
|
|
6923
|
+
push({ type: "text", value, output: `\\${value}` });
|
|
6924
|
+
continue;
|
|
6925
|
+
}
|
|
6926
|
+
decrement("brackets");
|
|
6927
|
+
const prevValue = prev.value.slice(1);
|
|
6928
|
+
if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
|
|
6929
|
+
value = `/${value}`;
|
|
6930
|
+
}
|
|
6931
|
+
prev.value += value;
|
|
6932
|
+
append({ value });
|
|
6933
|
+
if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
|
|
6934
|
+
continue;
|
|
6935
|
+
}
|
|
6936
|
+
const escaped = utils.escapeRegex(prev.value);
|
|
6937
|
+
state.output = state.output.slice(0, -prev.value.length);
|
|
6938
|
+
if (opts.literalBrackets === true) {
|
|
6939
|
+
state.output += escaped;
|
|
6940
|
+
prev.value = escaped;
|
|
6941
|
+
continue;
|
|
6942
|
+
}
|
|
6943
|
+
prev.value = `(${capture}${escaped}|${prev.value})`;
|
|
6944
|
+
state.output += prev.value;
|
|
6945
|
+
continue;
|
|
6946
|
+
}
|
|
6947
|
+
if (value === "{" && opts.nobrace !== true) {
|
|
6948
|
+
increment("braces");
|
|
6949
|
+
const open = {
|
|
6950
|
+
type: "brace",
|
|
6951
|
+
value,
|
|
6952
|
+
output: "(",
|
|
6953
|
+
outputIndex: state.output.length,
|
|
6954
|
+
tokensIndex: state.tokens.length
|
|
6955
|
+
};
|
|
6956
|
+
braces.push(open);
|
|
6957
|
+
push(open);
|
|
6958
|
+
continue;
|
|
6959
|
+
}
|
|
6960
|
+
if (value === "}") {
|
|
6961
|
+
const brace = braces[braces.length - 1];
|
|
6962
|
+
if (opts.nobrace === true || !brace) {
|
|
6963
|
+
push({ type: "text", value, output: value });
|
|
6964
|
+
continue;
|
|
6965
|
+
}
|
|
6966
|
+
let output = ")";
|
|
6967
|
+
if (brace.dots === true) {
|
|
6968
|
+
const arr = tokens.slice();
|
|
6969
|
+
const range = [];
|
|
6970
|
+
for (let i = arr.length - 1;i >= 0; i--) {
|
|
6971
|
+
tokens.pop();
|
|
6972
|
+
if (arr[i].type === "brace") {
|
|
6973
|
+
break;
|
|
6974
|
+
}
|
|
6975
|
+
if (arr[i].type !== "dots") {
|
|
6976
|
+
range.unshift(arr[i].value);
|
|
6977
|
+
}
|
|
6978
|
+
}
|
|
6979
|
+
output = expandRange(range, opts);
|
|
6980
|
+
state.backtrack = true;
|
|
6981
|
+
}
|
|
6982
|
+
if (brace.comma !== true && brace.dots !== true) {
|
|
6983
|
+
const out = state.output.slice(0, brace.outputIndex);
|
|
6984
|
+
const toks = state.tokens.slice(brace.tokensIndex);
|
|
6985
|
+
brace.value = brace.output = "\\{";
|
|
6986
|
+
value = output = "\\}";
|
|
6987
|
+
state.output = out;
|
|
6988
|
+
for (const t of toks) {
|
|
6989
|
+
state.output += t.output || t.value;
|
|
6990
|
+
}
|
|
6991
|
+
}
|
|
6992
|
+
push({ type: "brace", value, output });
|
|
6993
|
+
decrement("braces");
|
|
6994
|
+
braces.pop();
|
|
6995
|
+
continue;
|
|
6996
|
+
}
|
|
6997
|
+
if (value === "|") {
|
|
6998
|
+
if (extglobs.length > 0) {
|
|
6999
|
+
extglobs[extglobs.length - 1].conditions++;
|
|
7000
|
+
}
|
|
7001
|
+
push({ type: "text", value });
|
|
7002
|
+
continue;
|
|
7003
|
+
}
|
|
7004
|
+
if (value === ",") {
|
|
7005
|
+
let output = value;
|
|
7006
|
+
const brace = braces[braces.length - 1];
|
|
7007
|
+
if (brace && stack[stack.length - 1] === "braces") {
|
|
7008
|
+
brace.comma = true;
|
|
7009
|
+
output = "|";
|
|
7010
|
+
}
|
|
7011
|
+
push({ type: "comma", value, output });
|
|
7012
|
+
continue;
|
|
7013
|
+
}
|
|
7014
|
+
if (value === "/") {
|
|
7015
|
+
if (prev.type === "dot" && state.index === state.start + 1) {
|
|
7016
|
+
state.start = state.index + 1;
|
|
7017
|
+
state.consumed = "";
|
|
7018
|
+
state.output = "";
|
|
7019
|
+
tokens.pop();
|
|
7020
|
+
prev = bos;
|
|
7021
|
+
continue;
|
|
7022
|
+
}
|
|
7023
|
+
push({ type: "slash", value, output: SLASH_LITERAL });
|
|
7024
|
+
continue;
|
|
7025
|
+
}
|
|
7026
|
+
if (value === ".") {
|
|
7027
|
+
if (state.braces > 0 && prev.type === "dot") {
|
|
7028
|
+
if (prev.value === ".")
|
|
7029
|
+
prev.output = DOT_LITERAL;
|
|
7030
|
+
const brace = braces[braces.length - 1];
|
|
7031
|
+
prev.type = "dots";
|
|
7032
|
+
prev.output += value;
|
|
7033
|
+
prev.value += value;
|
|
7034
|
+
brace.dots = true;
|
|
7035
|
+
continue;
|
|
7036
|
+
}
|
|
7037
|
+
if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
|
|
7038
|
+
push({ type: "text", value, output: DOT_LITERAL });
|
|
7039
|
+
continue;
|
|
7040
|
+
}
|
|
7041
|
+
push({ type: "dot", value, output: DOT_LITERAL });
|
|
7042
|
+
continue;
|
|
7043
|
+
}
|
|
7044
|
+
if (value === "?") {
|
|
7045
|
+
const isGroup = prev && prev.value === "(";
|
|
7046
|
+
if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
7047
|
+
extglobOpen("qmark", value);
|
|
7048
|
+
continue;
|
|
7049
|
+
}
|
|
7050
|
+
if (prev && prev.type === "paren") {
|
|
7051
|
+
const next = peek();
|
|
7052
|
+
let output = value;
|
|
7053
|
+
if (next === "<" && !utils.supportsLookbehinds()) {
|
|
7054
|
+
throw new Error("Node.js v10 or higher is required for regex lookbehinds");
|
|
7055
|
+
}
|
|
7056
|
+
if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
|
|
7057
|
+
output = `\\${value}`;
|
|
7058
|
+
}
|
|
7059
|
+
push({ type: "text", value, output });
|
|
7060
|
+
continue;
|
|
7061
|
+
}
|
|
7062
|
+
if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
|
|
7063
|
+
push({ type: "qmark", value, output: QMARK_NO_DOT });
|
|
7064
|
+
continue;
|
|
7065
|
+
}
|
|
7066
|
+
push({ type: "qmark", value, output: QMARK });
|
|
7067
|
+
continue;
|
|
7068
|
+
}
|
|
7069
|
+
if (value === "!") {
|
|
7070
|
+
if (opts.noextglob !== true && peek() === "(") {
|
|
7071
|
+
if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
|
|
7072
|
+
extglobOpen("negate", value);
|
|
7073
|
+
continue;
|
|
7074
|
+
}
|
|
7075
|
+
}
|
|
7076
|
+
if (opts.nonegate !== true && state.index === 0) {
|
|
7077
|
+
negate();
|
|
7078
|
+
continue;
|
|
7079
|
+
}
|
|
7080
|
+
}
|
|
7081
|
+
if (value === "+") {
|
|
7082
|
+
if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
7083
|
+
extglobOpen("plus", value);
|
|
7084
|
+
continue;
|
|
7085
|
+
}
|
|
7086
|
+
if (prev && prev.value === "(" || opts.regex === false) {
|
|
7087
|
+
push({ type: "plus", value, output: PLUS_LITERAL });
|
|
7088
|
+
continue;
|
|
7089
|
+
}
|
|
7090
|
+
if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
|
|
7091
|
+
push({ type: "plus", value });
|
|
7092
|
+
continue;
|
|
7093
|
+
}
|
|
7094
|
+
push({ type: "plus", value: PLUS_LITERAL });
|
|
7095
|
+
continue;
|
|
7096
|
+
}
|
|
7097
|
+
if (value === "@") {
|
|
7098
|
+
if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
7099
|
+
push({ type: "at", extglob: true, value, output: "" });
|
|
7100
|
+
continue;
|
|
7101
|
+
}
|
|
7102
|
+
push({ type: "text", value });
|
|
7103
|
+
continue;
|
|
7104
|
+
}
|
|
7105
|
+
if (value !== "*") {
|
|
7106
|
+
if (value === "$" || value === "^") {
|
|
7107
|
+
value = `\\${value}`;
|
|
7108
|
+
}
|
|
7109
|
+
const match2 = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
7110
|
+
if (match2) {
|
|
7111
|
+
value += match2[0];
|
|
7112
|
+
state.index += match2[0].length;
|
|
7113
|
+
}
|
|
7114
|
+
push({ type: "text", value });
|
|
7115
|
+
continue;
|
|
7116
|
+
}
|
|
7117
|
+
if (prev && (prev.type === "globstar" || prev.star === true)) {
|
|
7118
|
+
prev.type = "star";
|
|
7119
|
+
prev.star = true;
|
|
7120
|
+
prev.value += value;
|
|
7121
|
+
prev.output = star3;
|
|
7122
|
+
state.backtrack = true;
|
|
7123
|
+
state.globstar = true;
|
|
7124
|
+
consume(value);
|
|
7125
|
+
continue;
|
|
7126
|
+
}
|
|
7127
|
+
let rest = remaining();
|
|
7128
|
+
if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
|
|
7129
|
+
extglobOpen("star", value);
|
|
7130
|
+
continue;
|
|
7131
|
+
}
|
|
7132
|
+
if (prev.type === "star") {
|
|
7133
|
+
if (opts.noglobstar === true) {
|
|
7134
|
+
consume(value);
|
|
7135
|
+
continue;
|
|
7136
|
+
}
|
|
7137
|
+
const prior = prev.prev;
|
|
7138
|
+
const before = prior.prev;
|
|
7139
|
+
const isStart = prior.type === "slash" || prior.type === "bos";
|
|
7140
|
+
const afterStar = before && (before.type === "star" || before.type === "globstar");
|
|
7141
|
+
if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
|
|
7142
|
+
push({ type: "star", value, output: "" });
|
|
7143
|
+
continue;
|
|
7144
|
+
}
|
|
7145
|
+
const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
|
|
7146
|
+
const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
|
|
7147
|
+
if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
|
|
7148
|
+
push({ type: "star", value, output: "" });
|
|
7149
|
+
continue;
|
|
7150
|
+
}
|
|
7151
|
+
while (rest.slice(0, 3) === "/**") {
|
|
7152
|
+
const after = input[state.index + 4];
|
|
7153
|
+
if (after && after !== "/") {
|
|
7154
|
+
break;
|
|
7155
|
+
}
|
|
7156
|
+
rest = rest.slice(3);
|
|
7157
|
+
consume("/**", 3);
|
|
7158
|
+
}
|
|
7159
|
+
if (prior.type === "bos" && eos()) {
|
|
7160
|
+
prev.type = "globstar";
|
|
7161
|
+
prev.value += value;
|
|
7162
|
+
prev.output = globstar(opts);
|
|
7163
|
+
state.output = prev.output;
|
|
7164
|
+
state.globstar = true;
|
|
7165
|
+
consume(value);
|
|
7166
|
+
continue;
|
|
7167
|
+
}
|
|
7168
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
|
|
7169
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
7170
|
+
prior.output = `(?:${prior.output}`;
|
|
7171
|
+
prev.type = "globstar";
|
|
7172
|
+
prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
|
|
7173
|
+
prev.value += value;
|
|
7174
|
+
state.globstar = true;
|
|
7175
|
+
state.output += prior.output + prev.output;
|
|
7176
|
+
consume(value);
|
|
7177
|
+
continue;
|
|
7178
|
+
}
|
|
7179
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
|
|
7180
|
+
const end = rest[1] !== undefined ? "|$" : "";
|
|
7181
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
7182
|
+
prior.output = `(?:${prior.output}`;
|
|
7183
|
+
prev.type = "globstar";
|
|
7184
|
+
prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
|
|
7185
|
+
prev.value += value;
|
|
7186
|
+
state.output += prior.output + prev.output;
|
|
7187
|
+
state.globstar = true;
|
|
7188
|
+
consume(value + advance());
|
|
7189
|
+
push({ type: "slash", value: "/", output: "" });
|
|
7190
|
+
continue;
|
|
7191
|
+
}
|
|
7192
|
+
if (prior.type === "bos" && rest[0] === "/") {
|
|
7193
|
+
prev.type = "globstar";
|
|
7194
|
+
prev.value += value;
|
|
7195
|
+
prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
|
|
7196
|
+
state.output = prev.output;
|
|
7197
|
+
state.globstar = true;
|
|
7198
|
+
consume(value + advance());
|
|
7199
|
+
push({ type: "slash", value: "/", output: "" });
|
|
7200
|
+
continue;
|
|
7201
|
+
}
|
|
7202
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
7203
|
+
prev.type = "globstar";
|
|
7204
|
+
prev.output = globstar(opts);
|
|
7205
|
+
prev.value += value;
|
|
7206
|
+
state.output += prev.output;
|
|
7207
|
+
state.globstar = true;
|
|
7208
|
+
consume(value);
|
|
7209
|
+
continue;
|
|
7210
|
+
}
|
|
7211
|
+
const token = { type: "star", value, output: star3 };
|
|
7212
|
+
if (opts.bash === true) {
|
|
7213
|
+
token.output = ".*?";
|
|
7214
|
+
if (prev.type === "bos" || prev.type === "slash") {
|
|
7215
|
+
token.output = nodot + token.output;
|
|
7216
|
+
}
|
|
7217
|
+
push(token);
|
|
7218
|
+
continue;
|
|
7219
|
+
}
|
|
7220
|
+
if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
|
|
7221
|
+
token.output = value;
|
|
7222
|
+
push(token);
|
|
7223
|
+
continue;
|
|
7224
|
+
}
|
|
7225
|
+
if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
|
|
7226
|
+
if (prev.type === "dot") {
|
|
7227
|
+
state.output += NO_DOT_SLASH;
|
|
7228
|
+
prev.output += NO_DOT_SLASH;
|
|
7229
|
+
} else if (opts.dot === true) {
|
|
7230
|
+
state.output += NO_DOTS_SLASH;
|
|
7231
|
+
prev.output += NO_DOTS_SLASH;
|
|
7232
|
+
} else {
|
|
7233
|
+
state.output += nodot;
|
|
7234
|
+
prev.output += nodot;
|
|
7235
|
+
}
|
|
7236
|
+
if (peek() !== "*") {
|
|
7237
|
+
state.output += ONE_CHAR;
|
|
7238
|
+
prev.output += ONE_CHAR;
|
|
7239
|
+
}
|
|
7240
|
+
}
|
|
7241
|
+
push(token);
|
|
7242
|
+
}
|
|
7243
|
+
while (state.brackets > 0) {
|
|
7244
|
+
if (opts.strictBrackets === true)
|
|
7245
|
+
throw new SyntaxError(syntaxError("closing", "]"));
|
|
7246
|
+
state.output = utils.escapeLast(state.output, "[");
|
|
7247
|
+
decrement("brackets");
|
|
7248
|
+
}
|
|
7249
|
+
while (state.parens > 0) {
|
|
7250
|
+
if (opts.strictBrackets === true)
|
|
7251
|
+
throw new SyntaxError(syntaxError("closing", ")"));
|
|
7252
|
+
state.output = utils.escapeLast(state.output, "(");
|
|
7253
|
+
decrement("parens");
|
|
7254
|
+
}
|
|
7255
|
+
while (state.braces > 0) {
|
|
7256
|
+
if (opts.strictBrackets === true)
|
|
7257
|
+
throw new SyntaxError(syntaxError("closing", "}"));
|
|
7258
|
+
state.output = utils.escapeLast(state.output, "{");
|
|
7259
|
+
decrement("braces");
|
|
7260
|
+
}
|
|
7261
|
+
if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
|
|
7262
|
+
push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` });
|
|
7263
|
+
}
|
|
7264
|
+
if (state.backtrack === true) {
|
|
7265
|
+
state.output = "";
|
|
7266
|
+
for (const token of state.tokens) {
|
|
7267
|
+
state.output += token.output != null ? token.output : token.value;
|
|
7268
|
+
if (token.suffix) {
|
|
7269
|
+
state.output += token.suffix;
|
|
7270
|
+
}
|
|
7271
|
+
}
|
|
7272
|
+
}
|
|
7273
|
+
return state;
|
|
7274
|
+
};
|
|
7275
|
+
parse.fastpaths = (input, options) => {
|
|
7276
|
+
const opts = { ...options };
|
|
7277
|
+
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
7278
|
+
const len = input.length;
|
|
7279
|
+
if (len > max) {
|
|
7280
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
7281
|
+
}
|
|
7282
|
+
input = REPLACEMENTS[input] || input;
|
|
7283
|
+
const win322 = utils.isWindows(options);
|
|
7284
|
+
const {
|
|
7285
|
+
DOT_LITERAL,
|
|
7286
|
+
SLASH_LITERAL,
|
|
7287
|
+
ONE_CHAR,
|
|
7288
|
+
DOTS_SLASH,
|
|
7289
|
+
NO_DOT,
|
|
7290
|
+
NO_DOTS,
|
|
7291
|
+
NO_DOTS_SLASH,
|
|
7292
|
+
STAR,
|
|
7293
|
+
START_ANCHOR
|
|
7294
|
+
} = constants.globChars(win322);
|
|
7295
|
+
const nodot = opts.dot ? NO_DOTS : NO_DOT;
|
|
7296
|
+
const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
|
7297
|
+
const capture = opts.capture ? "" : "?:";
|
|
7298
|
+
const state = { negated: false, prefix: "" };
|
|
7299
|
+
let star3 = opts.bash === true ? ".*?" : STAR;
|
|
7300
|
+
if (opts.capture) {
|
|
7301
|
+
star3 = `(${star3})`;
|
|
7302
|
+
}
|
|
7303
|
+
const globstar = (opts2) => {
|
|
7304
|
+
if (opts2.noglobstar === true)
|
|
7305
|
+
return star3;
|
|
7306
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
7307
|
+
};
|
|
7308
|
+
const create = (str) => {
|
|
7309
|
+
switch (str) {
|
|
7310
|
+
case "*":
|
|
7311
|
+
return `${nodot}${ONE_CHAR}${star3}`;
|
|
7312
|
+
case ".*":
|
|
7313
|
+
return `${DOT_LITERAL}${ONE_CHAR}${star3}`;
|
|
7314
|
+
case "*.*":
|
|
7315
|
+
return `${nodot}${star3}${DOT_LITERAL}${ONE_CHAR}${star3}`;
|
|
7316
|
+
case "*/*":
|
|
7317
|
+
return `${nodot}${star3}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star3}`;
|
|
7318
|
+
case "**":
|
|
7319
|
+
return nodot + globstar(opts);
|
|
7320
|
+
case "**/*":
|
|
7321
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star3}`;
|
|
7322
|
+
case "**/*.*":
|
|
7323
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star3}${DOT_LITERAL}${ONE_CHAR}${star3}`;
|
|
7324
|
+
case "**/.*":
|
|
7325
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star3}`;
|
|
7326
|
+
default: {
|
|
7327
|
+
const match2 = /^(.*?)\.(\w+)$/.exec(str);
|
|
7328
|
+
if (!match2)
|
|
7329
|
+
return;
|
|
7330
|
+
const source2 = create(match2[1]);
|
|
7331
|
+
if (!source2)
|
|
7332
|
+
return;
|
|
7333
|
+
return source2 + DOT_LITERAL + match2[2];
|
|
7334
|
+
}
|
|
7335
|
+
}
|
|
7336
|
+
};
|
|
7337
|
+
const output = utils.removePrefix(input, state);
|
|
7338
|
+
let source = create(output);
|
|
7339
|
+
if (source && opts.strictSlashes !== true) {
|
|
7340
|
+
source += `${SLASH_LITERAL}?`;
|
|
7341
|
+
}
|
|
7342
|
+
return source;
|
|
7343
|
+
};
|
|
7344
|
+
module.exports = parse;
|
|
7345
|
+
});
|
|
7346
|
+
|
|
7347
|
+
// ../../node_modules/picomatch/lib/picomatch.js
|
|
7348
|
+
var require_picomatch2 = __commonJS((exports, module) => {
|
|
7349
|
+
var path4 = __require("node:path");
|
|
7350
|
+
var scan = require_scan2();
|
|
7351
|
+
var parse = require_parse2();
|
|
7352
|
+
var utils = require_utils2();
|
|
7353
|
+
var constants = require_constants2();
|
|
7354
|
+
var isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
|
|
7355
|
+
var picomatch = (glob2, options, returnState = false) => {
|
|
7356
|
+
if (Array.isArray(glob2)) {
|
|
7357
|
+
const fns = glob2.map((input) => picomatch(input, options, returnState));
|
|
7358
|
+
const arrayMatcher = (str) => {
|
|
7359
|
+
for (const isMatch of fns) {
|
|
7360
|
+
const state2 = isMatch(str);
|
|
7361
|
+
if (state2)
|
|
7362
|
+
return state2;
|
|
7363
|
+
}
|
|
7364
|
+
return false;
|
|
7365
|
+
};
|
|
7366
|
+
return arrayMatcher;
|
|
7367
|
+
}
|
|
7368
|
+
const isState = isObject(glob2) && glob2.tokens && glob2.input;
|
|
7369
|
+
if (glob2 === "" || typeof glob2 !== "string" && !isState) {
|
|
7370
|
+
throw new TypeError("Expected pattern to be a non-empty string");
|
|
7371
|
+
}
|
|
7372
|
+
const opts = options || {};
|
|
7373
|
+
const posix2 = utils.isWindows(options);
|
|
7374
|
+
const regex2 = isState ? picomatch.compileRe(glob2, options) : picomatch.makeRe(glob2, options, false, true);
|
|
7375
|
+
const state = regex2.state;
|
|
7376
|
+
delete regex2.state;
|
|
7377
|
+
let isIgnored = () => false;
|
|
7378
|
+
if (opts.ignore) {
|
|
7379
|
+
const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
|
7380
|
+
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
7381
|
+
}
|
|
7382
|
+
const matcher = (input, returnObject = false) => {
|
|
7383
|
+
const { isMatch, match: match2, output } = picomatch.test(input, regex2, options, { glob: glob2, posix: posix2 });
|
|
7384
|
+
const result = { glob: glob2, state, regex: regex2, posix: posix2, input, output, match: match2, isMatch };
|
|
7385
|
+
if (typeof opts.onResult === "function") {
|
|
7386
|
+
opts.onResult(result);
|
|
7387
|
+
}
|
|
7388
|
+
if (isMatch === false) {
|
|
7389
|
+
result.isMatch = false;
|
|
7390
|
+
return returnObject ? result : false;
|
|
7391
|
+
}
|
|
7392
|
+
if (isIgnored(input)) {
|
|
7393
|
+
if (typeof opts.onIgnore === "function") {
|
|
7394
|
+
opts.onIgnore(result);
|
|
7395
|
+
}
|
|
7396
|
+
result.isMatch = false;
|
|
7397
|
+
return returnObject ? result : false;
|
|
7398
|
+
}
|
|
7399
|
+
if (typeof opts.onMatch === "function") {
|
|
7400
|
+
opts.onMatch(result);
|
|
7401
|
+
}
|
|
7402
|
+
return returnObject ? result : true;
|
|
7403
|
+
};
|
|
7404
|
+
if (returnState) {
|
|
7405
|
+
matcher.state = state;
|
|
7406
|
+
}
|
|
7407
|
+
return matcher;
|
|
7408
|
+
};
|
|
7409
|
+
picomatch.test = (input, regex2, options, { glob: glob2, posix: posix2 } = {}) => {
|
|
7410
|
+
if (typeof input !== "string") {
|
|
7411
|
+
throw new TypeError("Expected input to be a string");
|
|
7412
|
+
}
|
|
7413
|
+
if (input === "") {
|
|
7414
|
+
return { isMatch: false, output: "" };
|
|
5735
7415
|
}
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
} catch (err) {
|
|
5744
|
-
this._onError(err);
|
|
5745
|
-
}
|
|
5746
|
-
return entry;
|
|
7416
|
+
const opts = options || {};
|
|
7417
|
+
const format2 = opts.format || (posix2 ? utils.toPosixSlashes : null);
|
|
7418
|
+
let match2 = input === glob2;
|
|
7419
|
+
let output = match2 && format2 ? format2(input) : input;
|
|
7420
|
+
if (match2 === false) {
|
|
7421
|
+
output = format2 ? format2(input) : input;
|
|
7422
|
+
match2 = output === glob2;
|
|
5747
7423
|
}
|
|
5748
|
-
|
|
5749
|
-
if (
|
|
5750
|
-
|
|
7424
|
+
if (match2 === false || opts.capture === true) {
|
|
7425
|
+
if (opts.matchBase === true || opts.basename === true) {
|
|
7426
|
+
match2 = picomatch.matchBase(input, regex2, options, posix2);
|
|
5751
7427
|
} else {
|
|
5752
|
-
|
|
7428
|
+
match2 = regex2.exec(output);
|
|
5753
7429
|
}
|
|
5754
7430
|
}
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5761
|
-
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
if (entryRealPathStats.isFile()) {
|
|
5772
|
-
return "file";
|
|
5773
|
-
}
|
|
5774
|
-
if (entryRealPathStats.isDirectory()) {
|
|
5775
|
-
const len = entryRealPath.length;
|
|
5776
|
-
if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath.sep) {
|
|
5777
|
-
const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
|
|
5778
|
-
recursiveError.code = RECURSIVE_ERROR_CODE;
|
|
5779
|
-
return this._onError(recursiveError);
|
|
5780
|
-
}
|
|
5781
|
-
return "directory";
|
|
5782
|
-
}
|
|
5783
|
-
} catch (error) {
|
|
5784
|
-
this._onError(error);
|
|
5785
|
-
}
|
|
5786
|
-
}
|
|
7431
|
+
return { isMatch: Boolean(match2), match: match2, output };
|
|
7432
|
+
};
|
|
7433
|
+
picomatch.matchBase = (input, glob2, options, posix2 = utils.isWindows(options)) => {
|
|
7434
|
+
const regex2 = glob2 instanceof RegExp ? glob2 : picomatch.makeRe(glob2, options);
|
|
7435
|
+
return regex2.test(path4.basename(input));
|
|
7436
|
+
};
|
|
7437
|
+
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
7438
|
+
picomatch.parse = (pattern, options) => {
|
|
7439
|
+
if (Array.isArray(pattern))
|
|
7440
|
+
return pattern.map((p) => picomatch.parse(p, options));
|
|
7441
|
+
return parse(pattern, { ...options, fastpaths: false });
|
|
7442
|
+
};
|
|
7443
|
+
picomatch.scan = (input, options) => scan(input, options);
|
|
7444
|
+
picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
|
|
7445
|
+
if (returnOutput === true) {
|
|
7446
|
+
return state.output;
|
|
5787
7447
|
}
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
7448
|
+
const opts = options || {};
|
|
7449
|
+
const prepend = opts.contains ? "" : "^";
|
|
7450
|
+
const append = opts.contains ? "" : "$";
|
|
7451
|
+
let source = `${prepend}(?:${state.output})${append}`;
|
|
7452
|
+
if (state && state.negated === true) {
|
|
7453
|
+
source = `^(?!${source}).*$`;
|
|
5791
7454
|
}
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
if (type === "both")
|
|
5796
|
-
type = FILE_DIR_TYPE;
|
|
5797
|
-
if (type)
|
|
5798
|
-
options.type = type;
|
|
5799
|
-
if (!root) {
|
|
5800
|
-
throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
|
|
5801
|
-
} else if (typeof root !== "string") {
|
|
5802
|
-
throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
|
|
5803
|
-
} else if (type && !ALL_TYPES.includes(type)) {
|
|
5804
|
-
throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
|
|
7455
|
+
const regex2 = picomatch.toRegex(source, options);
|
|
7456
|
+
if (returnState === true) {
|
|
7457
|
+
regex2.state = state;
|
|
5805
7458
|
}
|
|
5806
|
-
|
|
5807
|
-
return new ReaddirpStream(options);
|
|
7459
|
+
return regex2;
|
|
5808
7460
|
};
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
}
|
|
7461
|
+
picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
|
|
7462
|
+
if (!input || typeof input !== "string") {
|
|
7463
|
+
throw new TypeError("Expected a non-empty string");
|
|
7464
|
+
}
|
|
7465
|
+
let parsed = { negated: false, fastpaths: true };
|
|
7466
|
+
if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
|
|
7467
|
+
parsed.output = parse.fastpaths(input, options);
|
|
7468
|
+
}
|
|
7469
|
+
if (!parsed.output) {
|
|
7470
|
+
parsed = parse(input, options);
|
|
7471
|
+
}
|
|
7472
|
+
return picomatch.compileRe(parsed, options, returnOutput, returnState);
|
|
5814
7473
|
};
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
7474
|
+
picomatch.toRegex = (source, options) => {
|
|
7475
|
+
try {
|
|
7476
|
+
const opts = options || {};
|
|
7477
|
+
return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
|
|
7478
|
+
} catch (err) {
|
|
7479
|
+
if (options && options.debug === true)
|
|
7480
|
+
throw err;
|
|
7481
|
+
return /$^/;
|
|
7482
|
+
}
|
|
7483
|
+
};
|
|
7484
|
+
picomatch.constants = constants;
|
|
7485
|
+
module.exports = picomatch;
|
|
5819
7486
|
});
|
|
5820
7487
|
|
|
5821
7488
|
// ../../node_modules/normalize-path/index.js
|
|
@@ -5854,7 +7521,7 @@ var require_normalize_path = __commonJS((exports, module) => {
|
|
|
5854
7521
|
// ../../node_modules/anymatch/index.js
|
|
5855
7522
|
var require_anymatch = __commonJS((exports, module) => {
|
|
5856
7523
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5857
|
-
var picomatch =
|
|
7524
|
+
var picomatch = require_picomatch2();
|
|
5858
7525
|
var normalizePath = require_normalize_path();
|
|
5859
7526
|
var BANG = "!";
|
|
5860
7527
|
var DEFAULT_OPTIONS = { returnIndex: false };
|
|
@@ -6072,7 +7739,7 @@ var require_is_glob = __commonJS((exports, module) => {
|
|
|
6072
7739
|
};
|
|
6073
7740
|
});
|
|
6074
7741
|
|
|
6075
|
-
//
|
|
7742
|
+
// node_modules/chokidar/node_modules/glob-parent/index.js
|
|
6076
7743
|
var require_glob_parent = __commonJS((exports, module) => {
|
|
6077
7744
|
var isGlob = require_is_glob();
|
|
6078
7745
|
var pathPosixDirname = __require("node:path").posix.dirname;
|
|
@@ -6099,7 +7766,7 @@ var require_glob_parent = __commonJS((exports, module) => {
|
|
|
6099
7766
|
});
|
|
6100
7767
|
|
|
6101
7768
|
// ../../node_modules/braces/lib/utils.js
|
|
6102
|
-
var
|
|
7769
|
+
var require_utils3 = __commonJS((exports) => {
|
|
6103
7770
|
exports.isInteger = (num) => {
|
|
6104
7771
|
if (typeof num === "number") {
|
|
6105
7772
|
return Number.isInteger(num);
|
|
@@ -6187,7 +7854,7 @@ var require_utils2 = __commonJS((exports) => {
|
|
|
6187
7854
|
|
|
6188
7855
|
// ../../node_modules/braces/lib/stringify.js
|
|
6189
7856
|
var require_stringify = __commonJS((exports, module) => {
|
|
6190
|
-
var utils =
|
|
7857
|
+
var utils = require_utils3();
|
|
6191
7858
|
module.exports = (ast, options = {}) => {
|
|
6192
7859
|
const stringify = (node, parent = {}) => {
|
|
6193
7860
|
const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
|
|
@@ -6659,7 +8326,7 @@ var require_fill_range = __commonJS((exports, module) => {
|
|
|
6659
8326
|
// ../../node_modules/braces/lib/compile.js
|
|
6660
8327
|
var require_compile = __commonJS((exports, module) => {
|
|
6661
8328
|
var fill = require_fill_range();
|
|
6662
|
-
var utils =
|
|
8329
|
+
var utils = require_utils3();
|
|
6663
8330
|
var compile = (ast, options = {}) => {
|
|
6664
8331
|
const walk = (node, parent = {}) => {
|
|
6665
8332
|
const invalidBlock = utils.isInvalidBrace(parent);
|
|
@@ -6709,7 +8376,7 @@ var require_compile = __commonJS((exports, module) => {
|
|
|
6709
8376
|
var require_expand = __commonJS((exports, module) => {
|
|
6710
8377
|
var fill = require_fill_range();
|
|
6711
8378
|
var stringify = require_stringify();
|
|
6712
|
-
var utils =
|
|
8379
|
+
var utils = require_utils3();
|
|
6713
8380
|
var append = (queue = "", stash = "", enclose = false) => {
|
|
6714
8381
|
const result = [];
|
|
6715
8382
|
queue = [].concat(queue);
|
|
@@ -6800,7 +8467,7 @@ var require_expand = __commonJS((exports, module) => {
|
|
|
6800
8467
|
});
|
|
6801
8468
|
|
|
6802
8469
|
// ../../node_modules/braces/lib/constants.js
|
|
6803
|
-
var
|
|
8470
|
+
var require_constants3 = __commonJS((exports, module) => {
|
|
6804
8471
|
module.exports = {
|
|
6805
8472
|
MAX_LENGTH: 1e4,
|
|
6806
8473
|
CHAR_0: "0",
|
|
@@ -6852,7 +8519,7 @@ var require_constants2 = __commonJS((exports, module) => {
|
|
|
6852
8519
|
});
|
|
6853
8520
|
|
|
6854
8521
|
// ../../node_modules/braces/lib/parse.js
|
|
6855
|
-
var
|
|
8522
|
+
var require_parse3 = __commonJS((exports, module) => {
|
|
6856
8523
|
var stringify = require_stringify();
|
|
6857
8524
|
var {
|
|
6858
8525
|
MAX_LENGTH,
|
|
@@ -6870,7 +8537,7 @@ var require_parse2 = __commonJS((exports, module) => {
|
|
|
6870
8537
|
CHAR_SINGLE_QUOTE,
|
|
6871
8538
|
CHAR_NO_BREAK_SPACE,
|
|
6872
8539
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE
|
|
6873
|
-
} =
|
|
8540
|
+
} = require_constants3();
|
|
6874
8541
|
var parse = (input, options = {}) => {
|
|
6875
8542
|
if (typeof input !== "string") {
|
|
6876
8543
|
throw new TypeError("Expected a string");
|
|
@@ -7083,7 +8750,7 @@ var require_braces = __commonJS((exports, module) => {
|
|
|
7083
8750
|
var stringify = require_stringify();
|
|
7084
8751
|
var compile = require_compile();
|
|
7085
8752
|
var expand2 = require_expand();
|
|
7086
|
-
var parse =
|
|
8753
|
+
var parse = require_parse3();
|
|
7087
8754
|
var braces = (input, options = {}) => {
|
|
7088
8755
|
let output = [];
|
|
7089
8756
|
if (Array.isArray(input)) {
|
|
@@ -7413,8 +9080,8 @@ var require_is_binary_path = __commonJS((exports, module) => {
|
|
|
7413
9080
|
module.exports = (filePath) => extensions.has(path4.extname(filePath).slice(1).toLowerCase());
|
|
7414
9081
|
});
|
|
7415
9082
|
|
|
7416
|
-
//
|
|
7417
|
-
var
|
|
9083
|
+
// node_modules/chokidar/lib/constants.js
|
|
9084
|
+
var require_constants4 = __commonJS((exports) => {
|
|
7418
9085
|
var { sep: sep2 } = __require("node:path");
|
|
7419
9086
|
var { platform: platform3 } = process;
|
|
7420
9087
|
var os2 = __require("node:os");
|
|
@@ -7473,7 +9140,7 @@ var require_constants3 = __commonJS((exports) => {
|
|
|
7473
9140
|
exports.isIBMi = os2.type() === "OS400";
|
|
7474
9141
|
});
|
|
7475
9142
|
|
|
7476
|
-
//
|
|
9143
|
+
// node_modules/chokidar/lib/nodefs-handler.js
|
|
7477
9144
|
var require_nodefs_handler = __commonJS((exports, module) => {
|
|
7478
9145
|
var fs2 = __require("node:fs");
|
|
7479
9146
|
var sysPath = __require("node:path");
|
|
@@ -7496,7 +9163,7 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
7496
9163
|
STR_END,
|
|
7497
9164
|
BRACE_START,
|
|
7498
9165
|
STAR
|
|
7499
|
-
} =
|
|
9166
|
+
} = require_constants4();
|
|
7500
9167
|
var THROTTLE_MODE_WATCH = "watch";
|
|
7501
9168
|
var open = promisify(fs2.open);
|
|
7502
9169
|
var stat = promisify(fs2.stat);
|
|
@@ -8003,7 +9670,7 @@ var require_fsevents2 = __commonJS((exports) => {
|
|
|
8003
9670
|
exports.constants = events;
|
|
8004
9671
|
});
|
|
8005
9672
|
|
|
8006
|
-
//
|
|
9673
|
+
// node_modules/chokidar/lib/fsevents-handler.js
|
|
8007
9674
|
var require_fsevents_handler = __commonJS((exports, module) => {
|
|
8008
9675
|
var fs2 = __require("node:fs");
|
|
8009
9676
|
var sysPath = __require("node:path");
|
|
@@ -8048,7 +9715,7 @@ var require_fsevents_handler = __commonJS((exports, module) => {
|
|
|
8048
9715
|
FUNCTION_TYPE,
|
|
8049
9716
|
EMPTY_FN,
|
|
8050
9717
|
IDENTITY_FN
|
|
8051
|
-
} =
|
|
9718
|
+
} = require_constants4();
|
|
8052
9719
|
var Depth = (value) => isNaN(value) ? {} : { depth: value };
|
|
8053
9720
|
var stat = promisify(fs2.stat);
|
|
8054
9721
|
var lstat2 = promisify(fs2.lstat);
|
|
@@ -8373,7 +10040,7 @@ var require_fsevents_handler = __commonJS((exports, module) => {
|
|
|
8373
10040
|
module.exports.canUse = canUse;
|
|
8374
10041
|
});
|
|
8375
10042
|
|
|
8376
|
-
//
|
|
10043
|
+
// node_modules/chokidar/index.js
|
|
8377
10044
|
var require_chokidar = __commonJS((exports) => {
|
|
8378
10045
|
var { EventEmitter: EventEmitter3 } = __require("node:events");
|
|
8379
10046
|
var fs2 = __require("node:fs");
|
|
@@ -8420,7 +10087,7 @@ var require_chokidar = __commonJS((exports) => {
|
|
|
8420
10087
|
isWindows: isWindows4,
|
|
8421
10088
|
isMacos,
|
|
8422
10089
|
isIBMi
|
|
8423
|
-
} =
|
|
10090
|
+
} = require_constants4();
|
|
8424
10091
|
var stat = promisify(fs2.stat);
|
|
8425
10092
|
var readdir2 = promisify(fs2.readdir);
|
|
8426
10093
|
var arrify = (value = []) => Array.isArray(value) ? value : [value];
|
|
@@ -10005,7 +11672,7 @@ var require_timespan = __commonJS((exports, module) => {
|
|
|
10005
11672
|
});
|
|
10006
11673
|
|
|
10007
11674
|
// ../../node_modules/semver/internal/constants.js
|
|
10008
|
-
var
|
|
11675
|
+
var require_constants5 = __commonJS((exports, module) => {
|
|
10009
11676
|
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
10010
11677
|
var MAX_LENGTH = 256;
|
|
10011
11678
|
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
@@ -10044,7 +11711,7 @@ var require_re = __commonJS((exports, module) => {
|
|
|
10044
11711
|
MAX_SAFE_COMPONENT_LENGTH,
|
|
10045
11712
|
MAX_SAFE_BUILD_LENGTH,
|
|
10046
11713
|
MAX_LENGTH
|
|
10047
|
-
} =
|
|
11714
|
+
} = require_constants5();
|
|
10048
11715
|
var debug = require_debug();
|
|
10049
11716
|
exports = module.exports = {};
|
|
10050
11717
|
var re = exports.re = [];
|
|
@@ -10164,7 +11831,7 @@ var require_identifiers = __commonJS((exports, module) => {
|
|
|
10164
11831
|
// ../../node_modules/semver/classes/semver.js
|
|
10165
11832
|
var require_semver = __commonJS((exports, module) => {
|
|
10166
11833
|
var debug = require_debug();
|
|
10167
|
-
var { MAX_LENGTH, MAX_SAFE_INTEGER } =
|
|
11834
|
+
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants5();
|
|
10168
11835
|
var { safeRe: re, t } = require_re();
|
|
10169
11836
|
var parseOptions = require_parse_options();
|
|
10170
11837
|
var { compareIdentifiers } = require_identifiers();
|
|
@@ -10431,7 +12098,7 @@ var require_semver = __commonJS((exports, module) => {
|
|
|
10431
12098
|
});
|
|
10432
12099
|
|
|
10433
12100
|
// ../../node_modules/semver/functions/parse.js
|
|
10434
|
-
var
|
|
12101
|
+
var require_parse4 = __commonJS((exports, module) => {
|
|
10435
12102
|
var SemVer = require_semver();
|
|
10436
12103
|
var parse = (version, options, throwErrors = false) => {
|
|
10437
12104
|
if (version instanceof SemVer) {
|
|
@@ -10451,7 +12118,7 @@ var require_parse3 = __commonJS((exports, module) => {
|
|
|
10451
12118
|
|
|
10452
12119
|
// ../../node_modules/semver/functions/valid.js
|
|
10453
12120
|
var require_valid = __commonJS((exports, module) => {
|
|
10454
|
-
var parse =
|
|
12121
|
+
var parse = require_parse4();
|
|
10455
12122
|
var valid = (version, options) => {
|
|
10456
12123
|
const v = parse(version, options);
|
|
10457
12124
|
return v ? v.version : null;
|
|
@@ -10461,7 +12128,7 @@ var require_valid = __commonJS((exports, module) => {
|
|
|
10461
12128
|
|
|
10462
12129
|
// ../../node_modules/semver/functions/clean.js
|
|
10463
12130
|
var require_clean = __commonJS((exports, module) => {
|
|
10464
|
-
var parse =
|
|
12131
|
+
var parse = require_parse4();
|
|
10465
12132
|
var clean = (version, options) => {
|
|
10466
12133
|
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
10467
12134
|
return s ? s.version : null;
|
|
@@ -10489,7 +12156,7 @@ var require_inc = __commonJS((exports, module) => {
|
|
|
10489
12156
|
|
|
10490
12157
|
// ../../node_modules/semver/functions/diff.js
|
|
10491
12158
|
var require_diff = __commonJS((exports, module) => {
|
|
10492
|
-
var parse =
|
|
12159
|
+
var parse = require_parse4();
|
|
10493
12160
|
var diff = (version1, version2) => {
|
|
10494
12161
|
const v1 = parse(version1, null, true);
|
|
10495
12162
|
const v2 = parse(version2, null, true);
|
|
@@ -10551,7 +12218,7 @@ var require_patch = __commonJS((exports, module) => {
|
|
|
10551
12218
|
|
|
10552
12219
|
// ../../node_modules/semver/functions/prerelease.js
|
|
10553
12220
|
var require_prerelease = __commonJS((exports, module) => {
|
|
10554
|
-
var parse =
|
|
12221
|
+
var parse = require_parse4();
|
|
10555
12222
|
var prerelease = (version, options) => {
|
|
10556
12223
|
const parsed = parse(version, options);
|
|
10557
12224
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
@@ -10697,7 +12364,7 @@ var require_cmp = __commonJS((exports, module) => {
|
|
|
10697
12364
|
// ../../node_modules/semver/functions/coerce.js
|
|
10698
12365
|
var require_coerce = __commonJS((exports, module) => {
|
|
10699
12366
|
var SemVer = require_semver();
|
|
10700
|
-
var parse =
|
|
12367
|
+
var parse = require_parse4();
|
|
10701
12368
|
var { safeRe: re, t } = require_re();
|
|
10702
12369
|
var coerce = (version, options) => {
|
|
10703
12370
|
if (version instanceof SemVer) {
|
|
@@ -10927,7 +12594,7 @@ var require_range = __commonJS((exports, module) => {
|
|
|
10927
12594
|
tildeTrimReplace,
|
|
10928
12595
|
caretTrimReplace
|
|
10929
12596
|
} = require_re();
|
|
10930
|
-
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } =
|
|
12597
|
+
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants5();
|
|
10931
12598
|
var isNullSet = (c) => c.value === "<0.0.0-0";
|
|
10932
12599
|
var isAny = (c) => c.value === "";
|
|
10933
12600
|
var isSatisfiable = (comparators, options) => {
|
|
@@ -11698,10 +13365,10 @@ var require_subset = __commonJS((exports, module) => {
|
|
|
11698
13365
|
// ../../node_modules/semver/index.js
|
|
11699
13366
|
var require_semver2 = __commonJS((exports, module) => {
|
|
11700
13367
|
var internalRe = require_re();
|
|
11701
|
-
var constants =
|
|
13368
|
+
var constants = require_constants5();
|
|
11702
13369
|
var SemVer = require_semver();
|
|
11703
13370
|
var identifiers = require_identifiers();
|
|
11704
|
-
var parse =
|
|
13371
|
+
var parse = require_parse4();
|
|
11705
13372
|
var valid = require_valid();
|
|
11706
13373
|
var clean = require_clean();
|
|
11707
13374
|
var inc = require_inc();
|
|
@@ -12744,8 +14411,8 @@ function isBaseMapInstance(obj) {
|
|
|
12744
14411
|
return Object.getPrototypeOf(obj) === Map.prototype;
|
|
12745
14412
|
}
|
|
12746
14413
|
function latest(proxyDraft) {
|
|
12747
|
-
var
|
|
12748
|
-
return (
|
|
14414
|
+
var _a2;
|
|
14415
|
+
return (_a2 = proxyDraft.copy) !== null && _a2 !== undefined ? _a2 : proxyDraft.original;
|
|
12749
14416
|
}
|
|
12750
14417
|
function isDraft(target) {
|
|
12751
14418
|
return !!getProxyDraft(target);
|
|
@@ -12756,9 +14423,9 @@ function getProxyDraft(value) {
|
|
|
12756
14423
|
return value === null || value === undefined ? undefined : value[PROXY_DRAFT];
|
|
12757
14424
|
}
|
|
12758
14425
|
function getValue(value) {
|
|
12759
|
-
var
|
|
14426
|
+
var _a2;
|
|
12760
14427
|
const proxyDraft = getProxyDraft(value);
|
|
12761
|
-
return proxyDraft ? (
|
|
14428
|
+
return proxyDraft ? (_a2 = proxyDraft.copy) !== null && _a2 !== undefined ? _a2 : proxyDraft.original : value;
|
|
12762
14429
|
}
|
|
12763
14430
|
function isDraftable(value, options) {
|
|
12764
14431
|
if (!value || typeof value !== "object")
|
|
@@ -12955,8 +14622,8 @@ function cloneIfNeeded(target) {
|
|
|
12955
14622
|
return isDraft(target) ? deepClone(target) : target;
|
|
12956
14623
|
}
|
|
12957
14624
|
function markChanged(proxyDraft) {
|
|
12958
|
-
var
|
|
12959
|
-
proxyDraft.assignedMap = (
|
|
14625
|
+
var _a2;
|
|
14626
|
+
proxyDraft.assignedMap = (_a2 = proxyDraft.assignedMap) !== null && _a2 !== undefined ? _a2 : new Map;
|
|
12960
14627
|
if (!proxyDraft.operated) {
|
|
12961
14628
|
proxyDraft.operated = true;
|
|
12962
14629
|
if (proxyDraft.parent) {
|
|
@@ -13059,11 +14726,11 @@ function handleValue(target, handledSet, options) {
|
|
|
13059
14726
|
const setMap = isSet ? new Map : undefined;
|
|
13060
14727
|
handledSet.add(target);
|
|
13061
14728
|
forEach(target, (key, value) => {
|
|
13062
|
-
var
|
|
14729
|
+
var _a2;
|
|
13063
14730
|
if (isDraft(value)) {
|
|
13064
14731
|
const proxyDraft = getProxyDraft(value);
|
|
13065
14732
|
ensureShallowCopy(proxyDraft);
|
|
13066
|
-
const updatedValue = ((
|
|
14733
|
+
const updatedValue = ((_a2 = proxyDraft.assignedMap) === null || _a2 === undefined ? undefined : _a2.size) || proxyDraft.operated ? proxyDraft.copy : proxyDraft.original;
|
|
13067
14734
|
set(isSet ? setMap : target, key, updatedValue);
|
|
13068
14735
|
} else {
|
|
13069
14736
|
handleValue(value, handledSet, options);
|
|
@@ -13111,7 +14778,7 @@ function markFinalization(target, key, value, generatePatches) {
|
|
|
13111
14778
|
proxyDraft.callbacks = [];
|
|
13112
14779
|
}
|
|
13113
14780
|
proxyDraft.callbacks.push((patches, inversePatches) => {
|
|
13114
|
-
var
|
|
14781
|
+
var _a2;
|
|
13115
14782
|
const copy = target.type === 3 ? target.setMap : target.copy;
|
|
13116
14783
|
if (isEqual(get(copy, key), value)) {
|
|
13117
14784
|
let updatedValue = proxyDraft.original;
|
|
@@ -13121,7 +14788,7 @@ function markFinalization(target, key, value, generatePatches) {
|
|
|
13121
14788
|
finalizeSetValue(target);
|
|
13122
14789
|
finalizePatches(target, generatePatches, patches, inversePatches);
|
|
13123
14790
|
if (target.options.enableAutoFreeze) {
|
|
13124
|
-
target.options.updatedValues = (
|
|
14791
|
+
target.options.updatedValues = (_a2 = target.options.updatedValues) !== null && _a2 !== undefined ? _a2 : new WeakMap;
|
|
13125
14792
|
target.options.updatedValues.set(updatedValue, proxyDraft.original);
|
|
13126
14793
|
}
|
|
13127
14794
|
set(copy, key, updatedValue);
|
|
@@ -13282,7 +14949,7 @@ function createDraft(createDraftOptions) {
|
|
|
13282
14949
|
if (parentDraft) {
|
|
13283
14950
|
const target = parentDraft;
|
|
13284
14951
|
target.finalities.draft.push((patches, inversePatches) => {
|
|
13285
|
-
var
|
|
14952
|
+
var _a2, _b;
|
|
13286
14953
|
const oldProxyDraft = getProxyDraft(proxy);
|
|
13287
14954
|
let copy = target.type === 3 ? target.setMap : target.copy;
|
|
13288
14955
|
const draft = get(copy, key);
|
|
@@ -13295,7 +14962,7 @@ function createDraft(createDraftOptions) {
|
|
|
13295
14962
|
finalizeSetValue(proxyDraft2);
|
|
13296
14963
|
finalizePatches(proxyDraft2, generatePatches, patches, inversePatches);
|
|
13297
14964
|
if (target.options.enableAutoFreeze) {
|
|
13298
|
-
target.options.updatedValues = (
|
|
14965
|
+
target.options.updatedValues = (_a2 = target.options.updatedValues) !== null && _a2 !== undefined ? _a2 : new WeakMap;
|
|
13299
14966
|
target.options.updatedValues.set(updatedValue, proxyDraft2.original);
|
|
13300
14967
|
}
|
|
13301
14968
|
set(copy, key, updatedValue);
|
|
@@ -13314,9 +14981,9 @@ function createDraft(createDraftOptions) {
|
|
|
13314
14981
|
return proxy;
|
|
13315
14982
|
}
|
|
13316
14983
|
function finalizeDraft(result, returnedValue, patches, inversePatches, enableAutoFreeze) {
|
|
13317
|
-
var
|
|
14984
|
+
var _a2;
|
|
13318
14985
|
const proxyDraft = getProxyDraft(result);
|
|
13319
|
-
const original = (
|
|
14986
|
+
const original = (_a2 = proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.original) !== null && _a2 !== undefined ? _a2 : result;
|
|
13320
14987
|
const hasReturnedValue = !!returnedValue.length;
|
|
13321
14988
|
if (proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.operated) {
|
|
13322
14989
|
while (proxyDraft.finalities.draft.length > 0) {
|
|
@@ -13337,7 +15004,7 @@ function finalizeDraft(result, returnedValue, patches, inversePatches, enableAut
|
|
|
13337
15004
|
];
|
|
13338
15005
|
}
|
|
13339
15006
|
function draftify(baseState, options) {
|
|
13340
|
-
var
|
|
15007
|
+
var _a2;
|
|
13341
15008
|
const finalities = {
|
|
13342
15009
|
draft: [],
|
|
13343
15010
|
revoke: [],
|
|
@@ -13350,7 +15017,7 @@ function draftify(baseState, options) {
|
|
|
13350
15017
|
patches = [];
|
|
13351
15018
|
inversePatches = [];
|
|
13352
15019
|
}
|
|
13353
|
-
const isMutable = ((
|
|
15020
|
+
const isMutable = ((_a2 = options.mark) === null || _a2 === undefined ? undefined : _a2.call(options, baseState, dataTypes)) === dataTypes.mutable || !isDraftable(baseState, options);
|
|
13354
15021
|
const draft = isMutable ? baseState : createDraft({
|
|
13355
15022
|
original: baseState,
|
|
13356
15023
|
parentDraft: null,
|
|
@@ -13394,7 +15061,7 @@ function handleReturnValue(options) {
|
|
|
13394
15061
|
}
|
|
13395
15062
|
}
|
|
13396
15063
|
function getCurrent(target) {
|
|
13397
|
-
var
|
|
15064
|
+
var _a2;
|
|
13398
15065
|
const proxyDraft = getProxyDraft(target);
|
|
13399
15066
|
if (!isDraftable(target, proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.options))
|
|
13400
15067
|
return target;
|
|
@@ -13426,7 +15093,7 @@ function getCurrent(target) {
|
|
|
13426
15093
|
}
|
|
13427
15094
|
});
|
|
13428
15095
|
if (type === 3) {
|
|
13429
|
-
const value = (
|
|
15096
|
+
const value = (_a2 = proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.original) !== null && _a2 !== undefined ? _a2 : currentValue;
|
|
13430
15097
|
return !isBaseSetInstance(value) ? new (Object.getPrototypeOf(value)).constructor(currentValue) : new Set(currentValue);
|
|
13431
15098
|
}
|
|
13432
15099
|
return currentValue;
|
|
@@ -15824,14 +17491,14 @@ var Operation, PROXY_DRAFT, RAW_RETURN_SYMBOL, iteratorSymbol, dataTypes, intern
|
|
|
15824
17491
|
throw new Error(`Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.`);
|
|
15825
17492
|
}
|
|
15826
17493
|
}, mapHandler, mapHandlerKeys, getNextIterator = (target, iterator, { isValuesIterator }) => () => {
|
|
15827
|
-
var
|
|
17494
|
+
var _a2, _b;
|
|
15828
17495
|
const result = iterator.next();
|
|
15829
17496
|
if (result.done)
|
|
15830
17497
|
return result;
|
|
15831
17498
|
const key = result.value;
|
|
15832
17499
|
let value = target.setMap.get(key);
|
|
15833
17500
|
const currentDraft = getProxyDraft(value);
|
|
15834
|
-
const mutable = ((_b = (
|
|
17501
|
+
const mutable = ((_b = (_a2 = target.options).mark) === null || _b === undefined ? undefined : _b.call(_a2, value, dataTypes)) === dataTypes.mutable;
|
|
15835
17502
|
if (target.options.strict) {
|
|
15836
17503
|
checkReadable(key, target.options, mutable);
|
|
15837
17504
|
}
|
|
@@ -15857,7 +17524,7 @@ var Operation, PROXY_DRAFT, RAW_RETURN_SYMBOL, iteratorSymbol, dataTypes, intern
|
|
|
15857
17524
|
throw new Error(`Invalid options: ${String(arg)}, 'options' should be an object.`);
|
|
15858
17525
|
}
|
|
15859
17526
|
return function create(arg0, arg1, arg2) {
|
|
15860
|
-
var
|
|
17527
|
+
var _a2, _b, _c;
|
|
15861
17528
|
if (typeof arg0 === "function" && typeof arg1 !== "function") {
|
|
15862
17529
|
return function(base22, ...args) {
|
|
15863
17530
|
return create(base22, (draft2) => arg0.call(this, draft2, ...args), arg1);
|
|
@@ -15886,7 +17553,7 @@ var Operation, PROXY_DRAFT, RAW_RETURN_SYMBOL, iteratorSymbol, dataTypes, intern
|
|
|
15886
17553
|
}
|
|
15887
17554
|
return;
|
|
15888
17555
|
} : options.mark;
|
|
15889
|
-
const enablePatches = (
|
|
17556
|
+
const enablePatches = (_a2 = options.enablePatches) !== null && _a2 !== undefined ? _a2 : false;
|
|
15890
17557
|
const strict = (_b = options.strict) !== null && _b !== undefined ? _b : false;
|
|
15891
17558
|
const enableAutoFreeze = (_c = options.enableAutoFreeze) !== null && _c !== undefined ? _c : false;
|
|
15892
17559
|
const _options = {
|
|
@@ -16038,10 +17705,10 @@ var init_dist = __esm(() => {
|
|
|
16038
17705
|
});
|
|
16039
17706
|
},
|
|
16040
17707
|
get(key) {
|
|
16041
|
-
var
|
|
17708
|
+
var _a2, _b;
|
|
16042
17709
|
const target = getProxyDraft(this);
|
|
16043
17710
|
const value = latest(target).get(key);
|
|
16044
|
-
const mutable = ((_b = (
|
|
17711
|
+
const mutable = ((_b = (_a2 = target.options).mark) === null || _b === undefined ? undefined : _b.call(_a2, value, dataTypes)) === dataTypes.mutable;
|
|
16045
17712
|
if (target.options.strict) {
|
|
16046
17713
|
checkReadable(value, target.options, mutable);
|
|
16047
17714
|
}
|
|
@@ -16224,8 +17891,8 @@ var init_dist = __esm(() => {
|
|
|
16224
17891
|
setHandlerKeys = Reflect.ownKeys(setHandler);
|
|
16225
17892
|
proxyHandler = {
|
|
16226
17893
|
get(target, key, receiver) {
|
|
16227
|
-
var
|
|
16228
|
-
const copy = (
|
|
17894
|
+
var _a2, _b;
|
|
17895
|
+
const copy = (_a2 = target.copy) === null || _a2 === undefined ? undefined : _a2[key];
|
|
16229
17896
|
if (copy && target.finalities.draftsCache.has(copy)) {
|
|
16230
17897
|
return copy;
|
|
16231
17898
|
}
|
|
@@ -16291,7 +17958,7 @@ var init_dist = __esm(() => {
|
|
|
16291
17958
|
return value;
|
|
16292
17959
|
},
|
|
16293
17960
|
set(target, key, value) {
|
|
16294
|
-
var
|
|
17961
|
+
var _a2;
|
|
16295
17962
|
if (target.type === 3 || target.type === 2) {
|
|
16296
17963
|
throw new Error(`Map/Set draft does not support any property assignment.`);
|
|
16297
17964
|
}
|
|
@@ -16308,7 +17975,7 @@ var init_dist = __esm(() => {
|
|
|
16308
17975
|
const currentProxyDraft = getProxyDraft(current);
|
|
16309
17976
|
if (currentProxyDraft && isEqual(currentProxyDraft.original, value)) {
|
|
16310
17977
|
target.copy[key] = value;
|
|
16311
|
-
target.assignedMap = (
|
|
17978
|
+
target.assignedMap = (_a2 = target.assignedMap) !== null && _a2 !== undefined ? _a2 : new Map;
|
|
16312
17979
|
target.assignedMap.set(key, false);
|
|
16313
17980
|
return true;
|
|
16314
17981
|
}
|
|
@@ -16353,7 +18020,7 @@ var init_dist = __esm(() => {
|
|
|
16353
18020
|
throw new Error(`Cannot call 'defineProperty()' on drafts`);
|
|
16354
18021
|
},
|
|
16355
18022
|
deleteProperty(target, key) {
|
|
16356
|
-
var
|
|
18023
|
+
var _a2;
|
|
16357
18024
|
if (target.type === 1) {
|
|
16358
18025
|
return proxyHandler.set.call(this, target, key, undefined, target.proxy);
|
|
16359
18026
|
}
|
|
@@ -16362,7 +18029,7 @@ var init_dist = __esm(() => {
|
|
|
16362
18029
|
markChanged(target);
|
|
16363
18030
|
target.assignedMap.set(key, false);
|
|
16364
18031
|
} else {
|
|
16365
|
-
target.assignedMap = (
|
|
18032
|
+
target.assignedMap = (_a2 = target.assignedMap) !== null && _a2 !== undefined ? _a2 : new Map;
|
|
16366
18033
|
target.assignedMap.delete(key);
|
|
16367
18034
|
}
|
|
16368
18035
|
if (target.copy)
|
|
@@ -17481,7 +19148,7 @@ var init_dist = __esm(() => {
|
|
|
17481
19148
|
};
|
|
17482
19149
|
});
|
|
17483
19150
|
|
|
17484
|
-
//
|
|
19151
|
+
// node_modules/commander/esm.mjs
|
|
17485
19152
|
var import__ = __toESM(require_commander(), 1);
|
|
17486
19153
|
var {
|
|
17487
19154
|
program,
|
|
@@ -17497,10 +19164,10 @@ var {
|
|
|
17497
19164
|
Help
|
|
17498
19165
|
} = import__.default;
|
|
17499
19166
|
|
|
17500
|
-
//
|
|
19167
|
+
// node_modules/find-up/index.js
|
|
17501
19168
|
import path2 from "node:path";
|
|
17502
19169
|
|
|
17503
|
-
//
|
|
19170
|
+
// node_modules/find-up/node_modules/locate-path/index.js
|
|
17504
19171
|
import process2 from "node:process";
|
|
17505
19172
|
import path from "node:path";
|
|
17506
19173
|
import fs, { promises as fsPromises } from "node:fs";
|
|
@@ -17546,7 +19213,7 @@ function toPath2(urlOrPath) {
|
|
|
17546
19213
|
return urlOrPath instanceof URL ? fileURLToPath2(urlOrPath) : urlOrPath;
|
|
17547
19214
|
}
|
|
17548
19215
|
|
|
17549
|
-
//
|
|
19216
|
+
// node_modules/find-up/index.js
|
|
17550
19217
|
var findUpStop = Symbol("findUpStop");
|
|
17551
19218
|
function findUpMultipleSync(name, options = {}) {
|
|
17552
19219
|
let directory = path2.resolve(toPath2(options.cwd) ?? "");
|
|
@@ -19755,8 +21422,35 @@ var unescape = (s, { windowsPathsNoEscape = false } = {}) => {
|
|
|
19755
21422
|
};
|
|
19756
21423
|
|
|
19757
21424
|
// node_modules/glob/node_modules/minimatch/dist/esm/ast.js
|
|
21425
|
+
var _a;
|
|
19758
21426
|
var types = new Set(["!", "?", "+", "*", "@"]);
|
|
19759
21427
|
var isExtglobType = (c) => types.has(c);
|
|
21428
|
+
var isExtglobAST = (c) => isExtglobType(c.type);
|
|
21429
|
+
var adoptionMap = new Map([
|
|
21430
|
+
["!", ["@"]],
|
|
21431
|
+
["?", ["?", "@"]],
|
|
21432
|
+
["@", ["@"]],
|
|
21433
|
+
["*", ["*", "+", "?", "@"]],
|
|
21434
|
+
["+", ["+", "@"]]
|
|
21435
|
+
]);
|
|
21436
|
+
var adoptionWithSpaceMap = new Map([
|
|
21437
|
+
["!", ["?"]],
|
|
21438
|
+
["@", ["?"]],
|
|
21439
|
+
["+", ["?", "*"]]
|
|
21440
|
+
]);
|
|
21441
|
+
var adoptionAnyMap = new Map([
|
|
21442
|
+
["!", ["?", "@"]],
|
|
21443
|
+
["?", ["?", "@"]],
|
|
21444
|
+
["@", ["?", "@"]],
|
|
21445
|
+
["*", ["*", "+", "?", "@"]],
|
|
21446
|
+
["+", ["+", "@", "?", "*"]]
|
|
21447
|
+
]);
|
|
21448
|
+
var usurpMap = new Map([
|
|
21449
|
+
["!", new Map([["!", "@"]])],
|
|
21450
|
+
["?", new Map([["*", "*"], ["+", "*"]])],
|
|
21451
|
+
["@", new Map([["!", "!"], ["?", "?"], ["@", "@"], ["*", "*"], ["+", "+"]])],
|
|
21452
|
+
["+", new Map([["?", "*"], ["*", "*"]])]
|
|
21453
|
+
]);
|
|
19760
21454
|
var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
|
19761
21455
|
var startNoDot = "(?!\\.)";
|
|
19762
21456
|
var addPatternStart = new Set(["[", "."]);
|
|
@@ -19844,7 +21538,7 @@ class AST {
|
|
|
19844
21538
|
for (const p of parts) {
|
|
19845
21539
|
if (p === "")
|
|
19846
21540
|
continue;
|
|
19847
|
-
if (typeof p !== "string" && !(p instanceof
|
|
21541
|
+
if (typeof p !== "string" && !(p instanceof _a && p.#parent === this)) {
|
|
19848
21542
|
throw new Error("invalid part: " + p);
|
|
19849
21543
|
}
|
|
19850
21544
|
this.#parts.push(p);
|
|
@@ -19869,7 +21563,7 @@ class AST {
|
|
|
19869
21563
|
const p = this.#parent;
|
|
19870
21564
|
for (let i = 0;i < this.#parentIndex; i++) {
|
|
19871
21565
|
const pp = p.#parts[i];
|
|
19872
|
-
if (!(pp instanceof
|
|
21566
|
+
if (!(pp instanceof _a && pp.type === "!")) {
|
|
19873
21567
|
return false;
|
|
19874
21568
|
}
|
|
19875
21569
|
}
|
|
@@ -19894,13 +21588,14 @@ class AST {
|
|
|
19894
21588
|
this.push(part.clone(this));
|
|
19895
21589
|
}
|
|
19896
21590
|
clone(parent) {
|
|
19897
|
-
const c = new
|
|
21591
|
+
const c = new _a(this.type, parent);
|
|
19898
21592
|
for (const p of this.#parts) {
|
|
19899
21593
|
c.copyIn(p);
|
|
19900
21594
|
}
|
|
19901
21595
|
return c;
|
|
19902
21596
|
}
|
|
19903
|
-
static #parseAST(str, ast, pos, opt) {
|
|
21597
|
+
static #parseAST(str, ast, pos, opt, extDepth) {
|
|
21598
|
+
const maxDepth = opt.maxExtglobRecursion ?? 2;
|
|
19904
21599
|
let escaping = false;
|
|
19905
21600
|
let inBrace = false;
|
|
19906
21601
|
let braceStart = -1;
|
|
@@ -19932,11 +21627,12 @@ class AST {
|
|
|
19932
21627
|
acc2 += c;
|
|
19933
21628
|
continue;
|
|
19934
21629
|
}
|
|
19935
|
-
|
|
21630
|
+
const doRecurse = !opt.noext && isExtglobType(c) && str.charAt(i2) === "(" && extDepth <= maxDepth;
|
|
21631
|
+
if (doRecurse) {
|
|
19936
21632
|
ast.push(acc2);
|
|
19937
21633
|
acc2 = "";
|
|
19938
|
-
const ext = new
|
|
19939
|
-
i2 =
|
|
21634
|
+
const ext = new _a(c, ast);
|
|
21635
|
+
i2 = _a.#parseAST(str, ext, i2, opt, extDepth + 1);
|
|
19940
21636
|
ast.push(ext);
|
|
19941
21637
|
continue;
|
|
19942
21638
|
}
|
|
@@ -19946,7 +21642,7 @@ class AST {
|
|
|
19946
21642
|
return i2;
|
|
19947
21643
|
}
|
|
19948
21644
|
let i = pos + 1;
|
|
19949
|
-
let part = new
|
|
21645
|
+
let part = new _a(null, ast);
|
|
19950
21646
|
const parts = [];
|
|
19951
21647
|
let acc = "";
|
|
19952
21648
|
while (i < str.length) {
|
|
@@ -19973,19 +21669,21 @@ class AST {
|
|
|
19973
21669
|
acc += c;
|
|
19974
21670
|
continue;
|
|
19975
21671
|
}
|
|
19976
|
-
|
|
21672
|
+
const doRecurse = isExtglobType(c) && str.charAt(i) === "(" && (extDepth <= maxDepth || ast && ast.#canAdoptType(c));
|
|
21673
|
+
if (doRecurse) {
|
|
21674
|
+
const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
|
|
19977
21675
|
part.push(acc);
|
|
19978
21676
|
acc = "";
|
|
19979
|
-
const ext = new
|
|
21677
|
+
const ext = new _a(c, part);
|
|
19980
21678
|
part.push(ext);
|
|
19981
|
-
i =
|
|
21679
|
+
i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd);
|
|
19982
21680
|
continue;
|
|
19983
21681
|
}
|
|
19984
21682
|
if (c === "|") {
|
|
19985
21683
|
part.push(acc);
|
|
19986
21684
|
acc = "";
|
|
19987
21685
|
parts.push(part);
|
|
19988
|
-
part = new
|
|
21686
|
+
part = new _a(null, ast);
|
|
19989
21687
|
continue;
|
|
19990
21688
|
}
|
|
19991
21689
|
if (c === ")") {
|
|
@@ -20004,9 +21702,101 @@ class AST {
|
|
|
20004
21702
|
ast.#parts = [str.substring(pos - 1)];
|
|
20005
21703
|
return i;
|
|
20006
21704
|
}
|
|
21705
|
+
#canAdoptWithSpace(child) {
|
|
21706
|
+
return this.#canAdopt(child, adoptionWithSpaceMap);
|
|
21707
|
+
}
|
|
21708
|
+
#canAdopt(child, map = adoptionMap) {
|
|
21709
|
+
if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) {
|
|
21710
|
+
return false;
|
|
21711
|
+
}
|
|
21712
|
+
const gc = child.#parts[0];
|
|
21713
|
+
if (!gc || typeof gc !== "object" || gc.type === null) {
|
|
21714
|
+
return false;
|
|
21715
|
+
}
|
|
21716
|
+
return this.#canAdoptType(gc.type, map);
|
|
21717
|
+
}
|
|
21718
|
+
#canAdoptType(c, map = adoptionAnyMap) {
|
|
21719
|
+
return !!map.get(this.type)?.includes(c);
|
|
21720
|
+
}
|
|
21721
|
+
#adoptWithSpace(child, index) {
|
|
21722
|
+
const gc = child.#parts[0];
|
|
21723
|
+
const blank = new _a(null, gc, this.options);
|
|
21724
|
+
blank.#parts.push("");
|
|
21725
|
+
gc.push(blank);
|
|
21726
|
+
this.#adopt(child, index);
|
|
21727
|
+
}
|
|
21728
|
+
#adopt(child, index) {
|
|
21729
|
+
const gc = child.#parts[0];
|
|
21730
|
+
this.#parts.splice(index, 1, ...gc.#parts);
|
|
21731
|
+
for (const p of gc.#parts) {
|
|
21732
|
+
if (typeof p === "object")
|
|
21733
|
+
p.#parent = this;
|
|
21734
|
+
}
|
|
21735
|
+
this.#toString = undefined;
|
|
21736
|
+
}
|
|
21737
|
+
#canUsurpType(c) {
|
|
21738
|
+
const m = usurpMap.get(this.type);
|
|
21739
|
+
return !!m?.has(c);
|
|
21740
|
+
}
|
|
21741
|
+
#canUsurp(child) {
|
|
21742
|
+
if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) {
|
|
21743
|
+
return false;
|
|
21744
|
+
}
|
|
21745
|
+
const gc = child.#parts[0];
|
|
21746
|
+
if (!gc || typeof gc !== "object" || gc.type === null) {
|
|
21747
|
+
return false;
|
|
21748
|
+
}
|
|
21749
|
+
return this.#canUsurpType(gc.type);
|
|
21750
|
+
}
|
|
21751
|
+
#usurp(child) {
|
|
21752
|
+
const m = usurpMap.get(this.type);
|
|
21753
|
+
const gc = child.#parts[0];
|
|
21754
|
+
const nt = m?.get(gc.type);
|
|
21755
|
+
if (!nt)
|
|
21756
|
+
return false;
|
|
21757
|
+
this.#parts = gc.#parts;
|
|
21758
|
+
for (const p of this.#parts) {
|
|
21759
|
+
if (typeof p === "object")
|
|
21760
|
+
p.#parent = this;
|
|
21761
|
+
}
|
|
21762
|
+
this.type = nt;
|
|
21763
|
+
this.#toString = undefined;
|
|
21764
|
+
this.#emptyExt = false;
|
|
21765
|
+
}
|
|
21766
|
+
#flatten() {
|
|
21767
|
+
if (!isExtglobAST(this)) {
|
|
21768
|
+
for (const p of this.#parts) {
|
|
21769
|
+
if (typeof p === "object")
|
|
21770
|
+
p.#flatten();
|
|
21771
|
+
}
|
|
21772
|
+
} else {
|
|
21773
|
+
let iterations = 0;
|
|
21774
|
+
let done = false;
|
|
21775
|
+
do {
|
|
21776
|
+
done = true;
|
|
21777
|
+
for (let i = 0;i < this.#parts.length; i++) {
|
|
21778
|
+
const c = this.#parts[i];
|
|
21779
|
+
if (typeof c === "object") {
|
|
21780
|
+
c.#flatten();
|
|
21781
|
+
if (this.#canAdopt(c)) {
|
|
21782
|
+
done = false;
|
|
21783
|
+
this.#adopt(c, i);
|
|
21784
|
+
} else if (this.#canAdoptWithSpace(c)) {
|
|
21785
|
+
done = false;
|
|
21786
|
+
this.#adoptWithSpace(c, i);
|
|
21787
|
+
} else if (this.#canUsurp(c)) {
|
|
21788
|
+
done = false;
|
|
21789
|
+
this.#usurp(c);
|
|
21790
|
+
}
|
|
21791
|
+
}
|
|
21792
|
+
}
|
|
21793
|
+
} while (!done && ++iterations < 10);
|
|
21794
|
+
}
|
|
21795
|
+
this.#toString = undefined;
|
|
21796
|
+
}
|
|
20007
21797
|
static fromGlob(pattern, options = {}) {
|
|
20008
|
-
const ast = new
|
|
20009
|
-
|
|
21798
|
+
const ast = new _a(null, undefined, options);
|
|
21799
|
+
_a.#parseAST(pattern, ast, 0, options, 0);
|
|
20010
21800
|
return ast;
|
|
20011
21801
|
}
|
|
20012
21802
|
toMMPattern() {
|
|
@@ -20029,12 +21819,14 @@ class AST {
|
|
|
20029
21819
|
}
|
|
20030
21820
|
toRegExpSource(allowDot) {
|
|
20031
21821
|
const dot = allowDot ?? !!this.#options.dot;
|
|
20032
|
-
if (this.#root === this)
|
|
21822
|
+
if (this.#root === this) {
|
|
21823
|
+
this.#flatten();
|
|
20033
21824
|
this.#fillNegs();
|
|
20034
|
-
|
|
21825
|
+
}
|
|
21826
|
+
if (!isExtglobAST(this)) {
|
|
20035
21827
|
const noEmpty = this.isStart() && this.isEnd();
|
|
20036
21828
|
const src = this.#parts.map((p) => {
|
|
20037
|
-
const [re, _, hasMagic, uflag] = typeof p === "string" ?
|
|
21829
|
+
const [re, _, hasMagic, uflag] = typeof p === "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
|
|
20038
21830
|
this.#hasMagic = this.#hasMagic || hasMagic;
|
|
20039
21831
|
this.#uflag = this.#uflag || uflag;
|
|
20040
21832
|
return re;
|
|
@@ -20068,9 +21860,10 @@ class AST {
|
|
|
20068
21860
|
let body = this.#partsToRegExp(dot);
|
|
20069
21861
|
if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
|
|
20070
21862
|
const s = this.toString();
|
|
20071
|
-
|
|
20072
|
-
|
|
20073
|
-
|
|
21863
|
+
const me = this;
|
|
21864
|
+
me.#parts = [s];
|
|
21865
|
+
me.type = null;
|
|
21866
|
+
me.#hasMagic = undefined;
|
|
20074
21867
|
return [s, unescape(this.toString()), false, false];
|
|
20075
21868
|
}
|
|
20076
21869
|
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true);
|
|
@@ -20108,11 +21901,13 @@ class AST {
|
|
|
20108
21901
|
let escaping = false;
|
|
20109
21902
|
let re = "";
|
|
20110
21903
|
let uflag = false;
|
|
21904
|
+
let inStar = false;
|
|
20111
21905
|
for (let i = 0;i < glob.length; i++) {
|
|
20112
21906
|
const c = glob.charAt(i);
|
|
20113
21907
|
if (escaping) {
|
|
20114
21908
|
escaping = false;
|
|
20115
21909
|
re += (reSpecials.has(c) ? "\\" : "") + c;
|
|
21910
|
+
inStar = false;
|
|
20116
21911
|
continue;
|
|
20117
21912
|
}
|
|
20118
21913
|
if (c === "\\") {
|
|
@@ -20130,16 +21925,19 @@ class AST {
|
|
|
20130
21925
|
uflag = uflag || needUflag;
|
|
20131
21926
|
i += consumed - 1;
|
|
20132
21927
|
hasMagic = hasMagic || magic;
|
|
21928
|
+
inStar = false;
|
|
20133
21929
|
continue;
|
|
20134
21930
|
}
|
|
20135
21931
|
}
|
|
20136
21932
|
if (c === "*") {
|
|
20137
|
-
if (
|
|
20138
|
-
|
|
20139
|
-
|
|
20140
|
-
|
|
21933
|
+
if (inStar)
|
|
21934
|
+
continue;
|
|
21935
|
+
inStar = true;
|
|
21936
|
+
re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
|
|
20141
21937
|
hasMagic = true;
|
|
20142
21938
|
continue;
|
|
21939
|
+
} else {
|
|
21940
|
+
inStar = false;
|
|
20143
21941
|
}
|
|
20144
21942
|
if (c === "?") {
|
|
20145
21943
|
re += qmark;
|
|
@@ -20151,6 +21949,7 @@ class AST {
|
|
|
20151
21949
|
return [re, unescape(glob), !!hasMagic, uflag];
|
|
20152
21950
|
}
|
|
20153
21951
|
}
|
|
21952
|
+
_a = AST;
|
|
20154
21953
|
|
|
20155
21954
|
// node_modules/glob/node_modules/minimatch/dist/esm/escape.js
|
|
20156
21955
|
var escape = (s, { windowsPathsNoEscape = false } = {}) => {
|
|
@@ -20305,11 +22104,13 @@ class Minimatch {
|
|
|
20305
22104
|
isWindows;
|
|
20306
22105
|
platform;
|
|
20307
22106
|
windowsNoMagicRoot;
|
|
22107
|
+
maxGlobstarRecursion;
|
|
20308
22108
|
regexp;
|
|
20309
22109
|
constructor(pattern, options = {}) {
|
|
20310
22110
|
assertValidPattern(pattern);
|
|
20311
22111
|
options = options || {};
|
|
20312
22112
|
this.options = options;
|
|
22113
|
+
this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;
|
|
20313
22114
|
this.pattern = pattern;
|
|
20314
22115
|
this.platform = options.platform || defaultPlatform;
|
|
20315
22116
|
this.isWindows = this.platform === "win32";
|
|
@@ -20604,7 +22405,8 @@ class Minimatch {
|
|
|
20604
22405
|
this.negate = negate;
|
|
20605
22406
|
}
|
|
20606
22407
|
matchOne(file, pattern, partial = false) {
|
|
20607
|
-
|
|
22408
|
+
let fileStartIndex = 0;
|
|
22409
|
+
let patternStartIndex = 0;
|
|
20608
22410
|
if (this.isWindows) {
|
|
20609
22411
|
const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
|
|
20610
22412
|
const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
|
|
@@ -20613,14 +22415,14 @@ class Minimatch {
|
|
|
20613
22415
|
const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined;
|
|
20614
22416
|
const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined;
|
|
20615
22417
|
if (typeof fdi === "number" && typeof pdi === "number") {
|
|
20616
|
-
const [fd, pd] = [
|
|
22418
|
+
const [fd, pd] = [
|
|
22419
|
+
file[fdi],
|
|
22420
|
+
pattern[pdi]
|
|
22421
|
+
];
|
|
20617
22422
|
if (fd.toLowerCase() === pd.toLowerCase()) {
|
|
20618
22423
|
pattern[pdi] = fd;
|
|
20619
|
-
|
|
20620
|
-
|
|
20621
|
-
} else if (fdi > pdi) {
|
|
20622
|
-
file = file.slice(fdi);
|
|
20623
|
-
}
|
|
22424
|
+
patternStartIndex = pdi;
|
|
22425
|
+
fileStartIndex = fdi;
|
|
20624
22426
|
}
|
|
20625
22427
|
}
|
|
20626
22428
|
}
|
|
@@ -20628,53 +22430,118 @@ class Minimatch {
|
|
|
20628
22430
|
if (optimizationLevel >= 2) {
|
|
20629
22431
|
file = this.levelTwoFileOptimize(file);
|
|
20630
22432
|
}
|
|
20631
|
-
|
|
20632
|
-
|
|
20633
|
-
|
|
20634
|
-
|
|
20635
|
-
|
|
20636
|
-
|
|
20637
|
-
|
|
20638
|
-
|
|
22433
|
+
if (pattern.includes(GLOBSTAR)) {
|
|
22434
|
+
return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
|
|
22435
|
+
}
|
|
22436
|
+
return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
|
|
22437
|
+
}
|
|
22438
|
+
#matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
|
|
22439
|
+
const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
|
|
22440
|
+
const lastgs = pattern.lastIndexOf(GLOBSTAR);
|
|
22441
|
+
const [head, body, tail] = partial ? [
|
|
22442
|
+
pattern.slice(patternIndex, firstgs),
|
|
22443
|
+
pattern.slice(firstgs + 1),
|
|
22444
|
+
[]
|
|
22445
|
+
] : [
|
|
22446
|
+
pattern.slice(patternIndex, firstgs),
|
|
22447
|
+
pattern.slice(firstgs + 1, lastgs),
|
|
22448
|
+
pattern.slice(lastgs + 1)
|
|
22449
|
+
];
|
|
22450
|
+
if (head.length) {
|
|
22451
|
+
const fileHead = file.slice(fileIndex, fileIndex + head.length);
|
|
22452
|
+
if (!this.#matchOne(fileHead, head, partial, 0, 0))
|
|
20639
22453
|
return false;
|
|
20640
|
-
|
|
20641
|
-
|
|
20642
|
-
|
|
20643
|
-
|
|
20644
|
-
|
|
20645
|
-
|
|
20646
|
-
|
|
20647
|
-
|
|
20648
|
-
|
|
20649
|
-
|
|
20650
|
-
|
|
20651
|
-
return
|
|
22454
|
+
fileIndex += head.length;
|
|
22455
|
+
}
|
|
22456
|
+
let fileTailMatch = 0;
|
|
22457
|
+
if (tail.length) {
|
|
22458
|
+
if (tail.length + fileIndex > file.length)
|
|
22459
|
+
return false;
|
|
22460
|
+
let tailStart = file.length - tail.length;
|
|
22461
|
+
if (this.#matchOne(file, tail, partial, tailStart, 0)) {
|
|
22462
|
+
fileTailMatch = tail.length;
|
|
22463
|
+
} else {
|
|
22464
|
+
if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
|
|
22465
|
+
return false;
|
|
20652
22466
|
}
|
|
20653
|
-
|
|
20654
|
-
|
|
20655
|
-
|
|
20656
|
-
|
|
20657
|
-
|
|
20658
|
-
|
|
20659
|
-
|
|
20660
|
-
|
|
20661
|
-
|
|
20662
|
-
|
|
20663
|
-
|
|
20664
|
-
|
|
20665
|
-
|
|
20666
|
-
fr++;
|
|
20667
|
-
}
|
|
22467
|
+
tailStart--;
|
|
22468
|
+
if (!this.#matchOne(file, tail, partial, tailStart, 0))
|
|
22469
|
+
return false;
|
|
22470
|
+
fileTailMatch = tail.length + 1;
|
|
22471
|
+
}
|
|
22472
|
+
}
|
|
22473
|
+
if (!body.length) {
|
|
22474
|
+
let sawSome = !!fileTailMatch;
|
|
22475
|
+
for (let i2 = fileIndex;i2 < file.length - fileTailMatch; i2++) {
|
|
22476
|
+
const f = String(file[i2]);
|
|
22477
|
+
sawSome = true;
|
|
22478
|
+
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
|
|
22479
|
+
return false;
|
|
20668
22480
|
}
|
|
20669
|
-
|
|
20670
|
-
|
|
20671
|
-
|
|
20672
|
-
|
|
20673
|
-
|
|
20674
|
-
|
|
22481
|
+
}
|
|
22482
|
+
return partial || sawSome;
|
|
22483
|
+
}
|
|
22484
|
+
const bodySegments = [[[], 0]];
|
|
22485
|
+
let currentBody = bodySegments[0];
|
|
22486
|
+
let nonGsParts = 0;
|
|
22487
|
+
const nonGsPartsSums = [0];
|
|
22488
|
+
for (const b of body) {
|
|
22489
|
+
if (b === GLOBSTAR) {
|
|
22490
|
+
nonGsPartsSums.push(nonGsParts);
|
|
22491
|
+
currentBody = [[], 0];
|
|
22492
|
+
bodySegments.push(currentBody);
|
|
22493
|
+
} else {
|
|
22494
|
+
currentBody[0].push(b);
|
|
22495
|
+
nonGsParts++;
|
|
22496
|
+
}
|
|
22497
|
+
}
|
|
22498
|
+
let i = bodySegments.length - 1;
|
|
22499
|
+
const fileLength = file.length - fileTailMatch;
|
|
22500
|
+
for (const b of bodySegments) {
|
|
22501
|
+
b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
|
|
22502
|
+
}
|
|
22503
|
+
return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
|
|
22504
|
+
}
|
|
22505
|
+
#matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
|
|
22506
|
+
const bs = bodySegments[bodyIndex];
|
|
22507
|
+
if (!bs) {
|
|
22508
|
+
for (let i = fileIndex;i < file.length; i++) {
|
|
22509
|
+
sawTail = true;
|
|
22510
|
+
const f = file[i];
|
|
22511
|
+
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
|
|
22512
|
+
return false;
|
|
20675
22513
|
}
|
|
22514
|
+
}
|
|
22515
|
+
return sawTail;
|
|
22516
|
+
}
|
|
22517
|
+
const [body, after] = bs;
|
|
22518
|
+
while (fileIndex <= after) {
|
|
22519
|
+
const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
|
|
22520
|
+
if (m && globStarDepth < this.maxGlobstarRecursion) {
|
|
22521
|
+
const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
|
|
22522
|
+
if (sub !== false)
|
|
22523
|
+
return sub;
|
|
22524
|
+
}
|
|
22525
|
+
const f = file[fileIndex];
|
|
22526
|
+
if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
|
|
20676
22527
|
return false;
|
|
20677
22528
|
}
|
|
22529
|
+
fileIndex++;
|
|
22530
|
+
}
|
|
22531
|
+
return partial || null;
|
|
22532
|
+
}
|
|
22533
|
+
#matchOne(file, pattern, partial, fileIndex, patternIndex) {
|
|
22534
|
+
let fi;
|
|
22535
|
+
let pi;
|
|
22536
|
+
let pl;
|
|
22537
|
+
let fl;
|
|
22538
|
+
for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length;fi < fl && pi < pl; fi++, pi++) {
|
|
22539
|
+
this.debug("matchOne loop");
|
|
22540
|
+
let p = pattern[pi];
|
|
22541
|
+
let f = file[fi];
|
|
22542
|
+
this.debug(pattern, p, f);
|
|
22543
|
+
if (p === false || p === GLOBSTAR)
|
|
22544
|
+
return false;
|
|
20678
22545
|
let hit;
|
|
20679
22546
|
if (typeof p === "string") {
|
|
20680
22547
|
hit = f === p;
|
|
@@ -25806,6 +27673,9 @@ var SHELL_EXTERNALS = [
|
|
|
25806
27673
|
"@arcote.tech/arc",
|
|
25807
27674
|
"@arcote.tech/arc-ds",
|
|
25808
27675
|
"@arcote.tech/arc-react",
|
|
27676
|
+
"@arcote.tech/arc-auth",
|
|
27677
|
+
"@arcote.tech/arc-utils",
|
|
27678
|
+
"@arcote.tech/arc-workspace",
|
|
25809
27679
|
"@arcote.tech/platform"
|
|
25810
27680
|
];
|
|
25811
27681
|
function discoverPackages(rootDir) {
|
|
@@ -25890,6 +27760,14 @@ async function buildPackages(rootDir, outDir, packages) {
|
|
|
25890
27760
|
}
|
|
25891
27761
|
console.log(` Bundling ${entrypoints.length} package(s)...`);
|
|
25892
27762
|
const i18nCollector = new Map;
|
|
27763
|
+
const arcExternalPlugin = {
|
|
27764
|
+
name: "arc-external",
|
|
27765
|
+
setup(build2) {
|
|
27766
|
+
build2.onResolve({ filter: /^@arcote\.tech\// }, (args) => {
|
|
27767
|
+
return { path: args.path, external: true };
|
|
27768
|
+
});
|
|
27769
|
+
}
|
|
27770
|
+
};
|
|
25893
27771
|
const result = await Bun.build({
|
|
25894
27772
|
entrypoints,
|
|
25895
27773
|
outdir: outDir,
|
|
@@ -25897,7 +27775,7 @@ async function buildPackages(rootDir, outDir, packages) {
|
|
|
25897
27775
|
format: "esm",
|
|
25898
27776
|
target: "browser",
|
|
25899
27777
|
external: SHELL_EXTERNALS,
|
|
25900
|
-
plugins: [i18nExtractPlugin(i18nCollector, rootDir)],
|
|
27778
|
+
plugins: [arcExternalPlugin, i18nExtractPlugin(i18nCollector, rootDir)],
|
|
25901
27779
|
naming: "[name].[ext]",
|
|
25902
27780
|
define: {
|
|
25903
27781
|
ONLY_SERVER: "false",
|
|
@@ -26128,6 +28006,9 @@ export const { createPortal, flushSync } = ReactDOM;`
|
|
|
26128
28006
|
["arc", "@arcote.tech/arc"],
|
|
26129
28007
|
["arc-ds", "@arcote.tech/arc-ds"],
|
|
26130
28008
|
["arc-react", "@arcote.tech/arc-react"],
|
|
28009
|
+
["arc-auth", "@arcote.tech/arc-auth"],
|
|
28010
|
+
["arc-utils", "@arcote.tech/arc-utils"],
|
|
28011
|
+
["arc-workspace", "@arcote.tech/arc-workspace"],
|
|
26131
28012
|
["platform", "@arcote.tech/platform"]
|
|
26132
28013
|
];
|
|
26133
28014
|
const arcEps = [];
|
|
@@ -26150,7 +28031,12 @@ export const { createPortal, flushSync } = ReactDOM;`
|
|
|
26150
28031
|
"react/jsx-runtime",
|
|
26151
28032
|
"react/jsx-dev-runtime",
|
|
26152
28033
|
"react-dom/client"
|
|
26153
|
-
]
|
|
28034
|
+
],
|
|
28035
|
+
define: {
|
|
28036
|
+
ONLY_SERVER: "false",
|
|
28037
|
+
ONLY_BROWSER: "true",
|
|
28038
|
+
ONLY_CLIENT: "true"
|
|
28039
|
+
}
|
|
26154
28040
|
});
|
|
26155
28041
|
if (!r2.success) {
|
|
26156
28042
|
for (const l of r2.logs)
|
|
@@ -26167,6 +28053,10 @@ async function loadServerContext(packages) {
|
|
|
26167
28053
|
globalThis.ONLY_SERVER = true;
|
|
26168
28054
|
globalThis.ONLY_BROWSER = false;
|
|
26169
28055
|
globalThis.ONLY_CLIENT = false;
|
|
28056
|
+
const platformDir = join7(process.cwd(), "node_modules", "@arcote.tech", "platform");
|
|
28057
|
+
const platformPkg = JSON.parse(readFileSync6(join7(platformDir, "package.json"), "utf-8"));
|
|
28058
|
+
const platformEntry = join7(platformDir, platformPkg.main ?? "src/index.ts");
|
|
28059
|
+
await import(platformEntry);
|
|
26170
28060
|
for (const ctx of ctxPackages) {
|
|
26171
28061
|
const serverDist = join7(ctx.path, "dist", "server", "main", "index.js");
|
|
26172
28062
|
if (!existsSync6(serverDist)) {
|
|
@@ -26179,7 +28069,7 @@ async function loadServerContext(packages) {
|
|
|
26179
28069
|
err(`Failed to load server context from ${ctx.name}: ${e}`);
|
|
26180
28070
|
}
|
|
26181
28071
|
}
|
|
26182
|
-
const { getContext } = await import(
|
|
28072
|
+
const { getContext } = await import(platformEntry);
|
|
26183
28073
|
return getContext() ?? null;
|
|
26184
28074
|
}
|
|
26185
28075
|
|
|
@@ -27608,6 +29498,9 @@ function generateShellHtml(appName, manifest) {
|
|
|
27608
29498
|
"@arcote.tech/arc": "/shell/arc.js",
|
|
27609
29499
|
"@arcote.tech/arc-ds": "/shell/arc-ds.js",
|
|
27610
29500
|
"@arcote.tech/arc-react": "/shell/arc-react.js",
|
|
29501
|
+
"@arcote.tech/arc-auth": "/shell/arc-auth.js",
|
|
29502
|
+
"@arcote.tech/arc-utils": "/shell/arc-utils.js",
|
|
29503
|
+
"@arcote.tech/arc-workspace": "/shell/arc-workspace.js",
|
|
27611
29504
|
"@arcote.tech/platform": "/shell/platform.js"
|
|
27612
29505
|
}
|
|
27613
29506
|
};
|