@lage-run/globby 14.2.0 → 14.2.2
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/CHANGELOG.json +45 -1
- package/CHANGELOG.md +18 -2
- package/dts-bundle.config.js +3 -2
- package/lib/index.js +383 -208
- package/package.json +4 -3
- package/tsconfig.json +3 -2
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,51 @@
|
|
|
2
2
|
"name": "@lage-run/globby",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Sat, 24 Jan 2026 09:00:58 GMT",
|
|
6
|
+
"version": "14.2.2",
|
|
7
|
+
"tag": "@lage-run/globby_v14.2.2",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "elcraig@microsoft.com",
|
|
12
|
+
"package": "@lage-run/globby",
|
|
13
|
+
"commit": "092607a7d55561a9342ab3265ccab0142dd59b9b",
|
|
14
|
+
"comment": "Add explicit module boundary types and update typescript version"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"none": [
|
|
18
|
+
{
|
|
19
|
+
"author": "elcraig@microsoft.com",
|
|
20
|
+
"package": "@lage-run/globby",
|
|
21
|
+
"commit": "092607a7d55561a9342ab3265ccab0142dd59b9b",
|
|
22
|
+
"comment": "Update tsconfig internals for dts bundle setup"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"author": "elcraig@microsoft.com",
|
|
26
|
+
"package": "@lage-run/globby",
|
|
27
|
+
"commit": "092607a7d55561a9342ab3265ccab0142dd59b9b",
|
|
28
|
+
"comment": "Add missing devDependencies"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"date": "Wed, 02 Apr 2025 08:10:04 GMT",
|
|
35
|
+
"version": "14.2.1",
|
|
36
|
+
"tag": "@lage-run/globby_v14.2.1",
|
|
37
|
+
"comments": {
|
|
38
|
+
"patch": [
|
|
39
|
+
{
|
|
40
|
+
"author": "email not defined",
|
|
41
|
+
"package": "@lage-run/globby",
|
|
42
|
+
"commit": "54e957d6b93381285d67ff8c23e134770b7a1512",
|
|
43
|
+
"comment": "Bundle with esbuild ^0.25.0"
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"date": "Wed, 02 Oct 2024 20:26:19 GMT",
|
|
6
50
|
"version": "14.2.0",
|
|
7
51
|
"tag": "@lage-run/globby_v14.2.0",
|
|
8
52
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
# Change Log - @lage-run/globby
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Sat, 24 Jan 2026 09:00:58 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 14.2.2
|
|
8
|
+
|
|
9
|
+
Sat, 24 Jan 2026 09:00:58 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- Add explicit module boundary types and update typescript version (elcraig@microsoft.com)
|
|
14
|
+
|
|
15
|
+
## 14.2.1
|
|
16
|
+
|
|
17
|
+
Wed, 02 Apr 2025 08:10:04 GMT
|
|
18
|
+
|
|
19
|
+
### Patches
|
|
20
|
+
|
|
21
|
+
- Bundle with esbuild ^0.25.0 (email not defined)
|
|
22
|
+
|
|
7
23
|
## 14.2.0
|
|
8
24
|
|
|
9
|
-
Wed, 02 Oct 2024 20:
|
|
25
|
+
Wed, 02 Oct 2024 20:26:19 GMT
|
|
10
26
|
|
|
11
27
|
### Minor changes
|
|
12
28
|
|
package/dts-bundle.config.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
const path = require("path");
|
|
3
3
|
|
|
4
4
|
/** @type {import('dts-bundle-generator/config-schema').BundlerConfig} */
|
|
5
|
-
|
|
5
|
+
const config = {
|
|
6
6
|
compilationOptions: {
|
|
7
|
-
preferredConfigPath:
|
|
7
|
+
preferredConfigPath: require.resolve("@lage-run/monorepo-scripts/config/tsconfig.dts-bundle.json"),
|
|
8
8
|
},
|
|
9
9
|
entries: [
|
|
10
10
|
{
|
|
@@ -23,3 +23,4 @@ module.exports = {
|
|
|
23
23
|
},
|
|
24
24
|
],
|
|
25
25
|
};
|
|
26
|
+
module.exports = config;
|
package/lib/index.js
CHANGED
|
@@ -352,7 +352,7 @@ var require_utils = __commonJS({
|
|
|
352
352
|
return (Number(max) - Number(min)) / Number(step) >= limit;
|
|
353
353
|
};
|
|
354
354
|
exports2.escapeNode = (block, n = 0, type) => {
|
|
355
|
-
|
|
355
|
+
const node = block.nodes[n];
|
|
356
356
|
if (!node) return;
|
|
357
357
|
if (type && node.type === type || node.type === "open" || node.type === "close") {
|
|
358
358
|
if (node.escaped !== true) {
|
|
@@ -397,8 +397,14 @@ var require_utils = __commonJS({
|
|
|
397
397
|
const result = [];
|
|
398
398
|
const flat = (arr) => {
|
|
399
399
|
for (let i = 0; i < arr.length; i++) {
|
|
400
|
-
|
|
401
|
-
Array.isArray(ele)
|
|
400
|
+
const ele = arr[i];
|
|
401
|
+
if (Array.isArray(ele)) {
|
|
402
|
+
flat(ele);
|
|
403
|
+
continue;
|
|
404
|
+
}
|
|
405
|
+
if (ele !== void 0) {
|
|
406
|
+
result.push(ele);
|
|
407
|
+
}
|
|
402
408
|
}
|
|
403
409
|
return result;
|
|
404
410
|
};
|
|
@@ -414,9 +420,9 @@ var require_stringify = __commonJS({
|
|
|
414
420
|
"use strict";
|
|
415
421
|
var utils = require_utils();
|
|
416
422
|
module2.exports = (ast, options = {}) => {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
423
|
+
const stringify = (node, parent = {}) => {
|
|
424
|
+
const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
|
|
425
|
+
const invalidNode = node.invalid === true && options.escapeInvalid === true;
|
|
420
426
|
let output = "";
|
|
421
427
|
if (node.value) {
|
|
422
428
|
if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
|
|
@@ -428,7 +434,7 @@ var require_stringify = __commonJS({
|
|
|
428
434
|
return node.value;
|
|
429
435
|
}
|
|
430
436
|
if (node.nodes) {
|
|
431
|
-
for (
|
|
437
|
+
for (const child of node.nodes) {
|
|
432
438
|
output += stringify(child);
|
|
433
439
|
}
|
|
434
440
|
}
|
|
@@ -714,7 +720,7 @@ var require_fill_range = __commonJS({
|
|
|
714
720
|
while (input.length < maxLength) input = "0" + input;
|
|
715
721
|
return negative ? "-" + input : input;
|
|
716
722
|
};
|
|
717
|
-
var toSequence = (parts, options) => {
|
|
723
|
+
var toSequence = (parts, options, maxLen) => {
|
|
718
724
|
parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
719
725
|
parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
720
726
|
let prefix = options.capture ? "" : "?:";
|
|
@@ -722,10 +728,10 @@ var require_fill_range = __commonJS({
|
|
|
722
728
|
let negatives = "";
|
|
723
729
|
let result;
|
|
724
730
|
if (parts.positives.length) {
|
|
725
|
-
positives = parts.positives.join("|");
|
|
731
|
+
positives = parts.positives.map((v) => toMaxLen(String(v), maxLen)).join("|");
|
|
726
732
|
}
|
|
727
733
|
if (parts.negatives.length) {
|
|
728
|
-
negatives = `-(${prefix}${parts.negatives.join("|")})`;
|
|
734
|
+
negatives = `-(${prefix}${parts.negatives.map((v) => toMaxLen(String(v), maxLen)).join("|")})`;
|
|
729
735
|
}
|
|
730
736
|
if (positives && negatives) {
|
|
731
737
|
result = `${positives}|${negatives}`;
|
|
@@ -802,7 +808,7 @@ var require_fill_range = __commonJS({
|
|
|
802
808
|
index++;
|
|
803
809
|
}
|
|
804
810
|
if (options.toRegex === true) {
|
|
805
|
-
return step > 1 ? toSequence(parts, options) : toRegex(range, null, { wrap: false, ...options });
|
|
811
|
+
return step > 1 ? toSequence(parts, options, maxLen) : toRegex(range, null, { wrap: false, ...options });
|
|
806
812
|
}
|
|
807
813
|
return range;
|
|
808
814
|
};
|
|
@@ -867,16 +873,17 @@ var require_compile = __commonJS({
|
|
|
867
873
|
var fill = require_fill_range();
|
|
868
874
|
var utils = require_utils();
|
|
869
875
|
var compile = (ast, options = {}) => {
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
876
|
+
const walk = (node, parent = {}) => {
|
|
877
|
+
const invalidBlock = utils.isInvalidBrace(parent);
|
|
878
|
+
const invalidNode = node.invalid === true && options.escapeInvalid === true;
|
|
879
|
+
const invalid = invalidBlock === true || invalidNode === true;
|
|
880
|
+
const prefix = options.escapeInvalid === true ? "\\" : "";
|
|
875
881
|
let output = "";
|
|
876
882
|
if (node.isOpen === true) {
|
|
877
883
|
return prefix + node.value;
|
|
878
884
|
}
|
|
879
885
|
if (node.isClose === true) {
|
|
886
|
+
console.log("node.isClose", prefix, node.value);
|
|
880
887
|
return prefix + node.value;
|
|
881
888
|
}
|
|
882
889
|
if (node.type === "open") {
|
|
@@ -892,14 +899,14 @@ var require_compile = __commonJS({
|
|
|
892
899
|
return node.value;
|
|
893
900
|
}
|
|
894
901
|
if (node.nodes && node.ranges > 0) {
|
|
895
|
-
|
|
896
|
-
|
|
902
|
+
const args = utils.reduce(node.nodes);
|
|
903
|
+
const range = fill(...args, { ...options, wrap: false, toRegex: true, strictZeros: true });
|
|
897
904
|
if (range.length !== 0) {
|
|
898
905
|
return args.length > 1 && range.length > 1 ? `(${range})` : range;
|
|
899
906
|
}
|
|
900
907
|
}
|
|
901
908
|
if (node.nodes) {
|
|
902
|
-
for (
|
|
909
|
+
for (const child of node.nodes) {
|
|
903
910
|
output += walk(child, node);
|
|
904
911
|
}
|
|
905
912
|
}
|
|
@@ -919,16 +926,16 @@ var require_expand = __commonJS({
|
|
|
919
926
|
var stringify = require_stringify();
|
|
920
927
|
var utils = require_utils();
|
|
921
928
|
var append = (queue = "", stash = "", enclose = false) => {
|
|
922
|
-
|
|
929
|
+
const result = [];
|
|
923
930
|
queue = [].concat(queue);
|
|
924
931
|
stash = [].concat(stash);
|
|
925
932
|
if (!stash.length) return queue;
|
|
926
933
|
if (!queue.length) {
|
|
927
934
|
return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash;
|
|
928
935
|
}
|
|
929
|
-
for (
|
|
936
|
+
for (const item of queue) {
|
|
930
937
|
if (Array.isArray(item)) {
|
|
931
|
-
for (
|
|
938
|
+
for (const value of item) {
|
|
932
939
|
result.push(append(value, stash, enclose));
|
|
933
940
|
}
|
|
934
941
|
} else {
|
|
@@ -941,8 +948,8 @@ var require_expand = __commonJS({
|
|
|
941
948
|
return utils.flatten(result);
|
|
942
949
|
};
|
|
943
950
|
var expand = (ast, options = {}) => {
|
|
944
|
-
|
|
945
|
-
|
|
951
|
+
const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
|
|
952
|
+
const walk = (node, parent = {}) => {
|
|
946
953
|
node.queue = [];
|
|
947
954
|
let p = parent;
|
|
948
955
|
let q = parent.queue;
|
|
@@ -959,7 +966,7 @@ var require_expand = __commonJS({
|
|
|
959
966
|
return;
|
|
960
967
|
}
|
|
961
968
|
if (node.nodes && node.ranges > 0) {
|
|
962
|
-
|
|
969
|
+
const args = utils.reduce(node.nodes);
|
|
963
970
|
if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
|
|
964
971
|
throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
|
|
965
972
|
}
|
|
@@ -971,7 +978,7 @@ var require_expand = __commonJS({
|
|
|
971
978
|
node.nodes = [];
|
|
972
979
|
return;
|
|
973
980
|
}
|
|
974
|
-
|
|
981
|
+
const enclose = utils.encloseBrace(node);
|
|
975
982
|
let queue = node.queue;
|
|
976
983
|
let block = node;
|
|
977
984
|
while (block.type !== "brace" && block.type !== "root" && block.parent) {
|
|
@@ -979,7 +986,7 @@ var require_expand = __commonJS({
|
|
|
979
986
|
queue = block.queue;
|
|
980
987
|
}
|
|
981
988
|
for (let i = 0; i < node.nodes.length; i++) {
|
|
982
|
-
|
|
989
|
+
const child = node.nodes[i];
|
|
983
990
|
if (child.type === "comma" && node.type === "brace") {
|
|
984
991
|
if (i === 1) queue.push("");
|
|
985
992
|
queue.push("");
|
|
@@ -1010,7 +1017,7 @@ var require_constants = __commonJS({
|
|
|
1010
1017
|
"../../node_modules/braces/lib/constants.js"(exports2, module2) {
|
|
1011
1018
|
"use strict";
|
|
1012
1019
|
module2.exports = {
|
|
1013
|
-
MAX_LENGTH:
|
|
1020
|
+
MAX_LENGTH: 1e4,
|
|
1014
1021
|
// Digits
|
|
1015
1022
|
CHAR_0: "0",
|
|
1016
1023
|
/* 0 */
|
|
@@ -1144,21 +1151,20 @@ var require_parse = __commonJS({
|
|
|
1144
1151
|
if (typeof input !== "string") {
|
|
1145
1152
|
throw new TypeError("Expected a string");
|
|
1146
1153
|
}
|
|
1147
|
-
|
|
1148
|
-
|
|
1154
|
+
const opts = options || {};
|
|
1155
|
+
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
1149
1156
|
if (input.length > max) {
|
|
1150
1157
|
throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
|
|
1151
1158
|
}
|
|
1152
|
-
|
|
1153
|
-
|
|
1159
|
+
const ast = { type: "root", input, nodes: [] };
|
|
1160
|
+
const stack = [ast];
|
|
1154
1161
|
let block = ast;
|
|
1155
1162
|
let prev = ast;
|
|
1156
1163
|
let brackets = 0;
|
|
1157
|
-
|
|
1164
|
+
const length = input.length;
|
|
1158
1165
|
let index = 0;
|
|
1159
1166
|
let depth = 0;
|
|
1160
1167
|
let value;
|
|
1161
|
-
let memo = {};
|
|
1162
1168
|
const advance = () => input[index++];
|
|
1163
1169
|
const push = (node) => {
|
|
1164
1170
|
if (node.type === "text" && prev.type === "dot") {
|
|
@@ -1191,7 +1197,6 @@ var require_parse = __commonJS({
|
|
|
1191
1197
|
}
|
|
1192
1198
|
if (value === CHAR_LEFT_SQUARE_BRACKET) {
|
|
1193
1199
|
brackets++;
|
|
1194
|
-
let closed = true;
|
|
1195
1200
|
let next;
|
|
1196
1201
|
while (index < length && (next = advance())) {
|
|
1197
1202
|
value += next;
|
|
@@ -1230,7 +1235,7 @@ var require_parse = __commonJS({
|
|
|
1230
1235
|
continue;
|
|
1231
1236
|
}
|
|
1232
1237
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
1233
|
-
|
|
1238
|
+
const open = value;
|
|
1234
1239
|
let next;
|
|
1235
1240
|
if (options.keepQuotes !== true) {
|
|
1236
1241
|
value = "";
|
|
@@ -1251,8 +1256,8 @@ var require_parse = __commonJS({
|
|
|
1251
1256
|
}
|
|
1252
1257
|
if (value === CHAR_LEFT_CURLY_BRACE) {
|
|
1253
1258
|
depth++;
|
|
1254
|
-
|
|
1255
|
-
|
|
1259
|
+
const dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
|
|
1260
|
+
const brace = {
|
|
1256
1261
|
type: "brace",
|
|
1257
1262
|
open: true,
|
|
1258
1263
|
close: false,
|
|
@@ -1272,7 +1277,7 @@ var require_parse = __commonJS({
|
|
|
1272
1277
|
push({ type: "text", value });
|
|
1273
1278
|
continue;
|
|
1274
1279
|
}
|
|
1275
|
-
|
|
1280
|
+
const type = "close";
|
|
1276
1281
|
block = stack.pop();
|
|
1277
1282
|
block.close = true;
|
|
1278
1283
|
push({ type, value });
|
|
@@ -1283,7 +1288,7 @@ var require_parse = __commonJS({
|
|
|
1283
1288
|
if (value === CHAR_COMMA && depth > 0) {
|
|
1284
1289
|
if (block.ranges > 0) {
|
|
1285
1290
|
block.ranges = 0;
|
|
1286
|
-
|
|
1291
|
+
const open = block.nodes.shift();
|
|
1287
1292
|
block.nodes = [open, { type: "text", value: stringify(block) }];
|
|
1288
1293
|
}
|
|
1289
1294
|
push({ type: "comma", value });
|
|
@@ -1291,7 +1296,7 @@ var require_parse = __commonJS({
|
|
|
1291
1296
|
continue;
|
|
1292
1297
|
}
|
|
1293
1298
|
if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
|
|
1294
|
-
|
|
1299
|
+
const siblings = block.nodes;
|
|
1295
1300
|
if (depth === 0 || siblings.length === 0) {
|
|
1296
1301
|
push({ type: "text", value });
|
|
1297
1302
|
continue;
|
|
@@ -1312,7 +1317,7 @@ var require_parse = __commonJS({
|
|
|
1312
1317
|
}
|
|
1313
1318
|
if (prev.type === "range") {
|
|
1314
1319
|
siblings.pop();
|
|
1315
|
-
|
|
1320
|
+
const before = siblings[siblings.length - 1];
|
|
1316
1321
|
before.value += prev.value + value;
|
|
1317
1322
|
prev = before;
|
|
1318
1323
|
block.ranges--;
|
|
@@ -1334,8 +1339,8 @@ var require_parse = __commonJS({
|
|
|
1334
1339
|
node.invalid = true;
|
|
1335
1340
|
}
|
|
1336
1341
|
});
|
|
1337
|
-
|
|
1338
|
-
|
|
1342
|
+
const parent = stack[stack.length - 1];
|
|
1343
|
+
const index2 = parent.nodes.indexOf(block);
|
|
1339
1344
|
parent.nodes.splice(index2, 1, ...block.nodes);
|
|
1340
1345
|
}
|
|
1341
1346
|
} while (stack.length > 0);
|
|
@@ -1357,8 +1362,8 @@ var require_braces = __commonJS({
|
|
|
1357
1362
|
var braces = (input, options = {}) => {
|
|
1358
1363
|
let output = [];
|
|
1359
1364
|
if (Array.isArray(input)) {
|
|
1360
|
-
for (
|
|
1361
|
-
|
|
1365
|
+
for (const pattern of input) {
|
|
1366
|
+
const result = braces.create(pattern, options);
|
|
1362
1367
|
if (Array.isArray(result)) {
|
|
1363
1368
|
output.push(...result);
|
|
1364
1369
|
} else {
|
|
@@ -2919,15 +2924,19 @@ var require_picomatch2 = __commonJS({
|
|
|
2919
2924
|
}
|
|
2920
2925
|
});
|
|
2921
2926
|
|
|
2922
|
-
// ../../node_modules/
|
|
2927
|
+
// ../../node_modules/micromatch/index.js
|
|
2923
2928
|
var require_micromatch = __commonJS({
|
|
2924
|
-
"../../node_modules/
|
|
2929
|
+
"../../node_modules/micromatch/index.js"(exports2, module2) {
|
|
2925
2930
|
"use strict";
|
|
2926
2931
|
var util = require("util");
|
|
2927
2932
|
var braces = require_braces();
|
|
2928
2933
|
var picomatch = require_picomatch2();
|
|
2929
2934
|
var utils = require_utils2();
|
|
2930
|
-
var isEmptyString = (
|
|
2935
|
+
var isEmptyString = (v) => v === "" || v === "./";
|
|
2936
|
+
var hasBraces = (v) => {
|
|
2937
|
+
const index = v.indexOf("{");
|
|
2938
|
+
return index > -1 && v.indexOf("}", index) > -1;
|
|
2939
|
+
};
|
|
2931
2940
|
var micromatch = (list, patterns, options) => {
|
|
2932
2941
|
patterns = [].concat(patterns);
|
|
2933
2942
|
list = [].concat(list);
|
|
@@ -3062,7 +3071,7 @@ var require_micromatch = __commonJS({
|
|
|
3062
3071
|
};
|
|
3063
3072
|
micromatch.braces = (pattern, options) => {
|
|
3064
3073
|
if (typeof pattern !== "string") throw new TypeError("Expected a string");
|
|
3065
|
-
if (options && options.nobrace === true ||
|
|
3074
|
+
if (options && options.nobrace === true || !hasBraces(pattern)) {
|
|
3066
3075
|
return [pattern];
|
|
3067
3076
|
}
|
|
3068
3077
|
return braces(pattern, options);
|
|
@@ -3071,6 +3080,7 @@ var require_micromatch = __commonJS({
|
|
|
3071
3080
|
if (typeof pattern !== "string") throw new TypeError("Expected a string");
|
|
3072
3081
|
return micromatch.braces(pattern, { ...options, expand: true });
|
|
3073
3082
|
};
|
|
3083
|
+
micromatch.hasBraces = hasBraces;
|
|
3074
3084
|
module2.exports = micromatch;
|
|
3075
3085
|
}
|
|
3076
3086
|
});
|
|
@@ -3080,7 +3090,7 @@ var require_pattern = __commonJS({
|
|
|
3080
3090
|
"../../node_modules/fast-glob/out/utils/pattern.js"(exports2) {
|
|
3081
3091
|
"use strict";
|
|
3082
3092
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
3083
|
-
exports2.removeDuplicateSlashes = exports2.matchAny = exports2.convertPatternsToRe = exports2.makeRe = exports2.getPatternParts = exports2.expandBraceExpansion = exports2.expandPatternsWithBraceExpansion = exports2.isAffectDepthOfReadingPattern = exports2.endsWithSlashGlobStar = exports2.hasGlobStar = exports2.getBaseDirectory = exports2.isPatternRelatedToParentDirectory = exports2.getPatternsOutsideCurrentDirectory = exports2.getPatternsInsideCurrentDirectory = exports2.getPositivePatterns = exports2.getNegativePatterns = exports2.isPositivePattern = exports2.isNegativePattern = exports2.convertToNegativePattern = exports2.convertToPositivePattern = exports2.isDynamicPattern = exports2.isStaticPattern = void 0;
|
|
3093
|
+
exports2.isAbsolute = exports2.partitionAbsoluteAndRelative = exports2.removeDuplicateSlashes = exports2.matchAny = exports2.convertPatternsToRe = exports2.makeRe = exports2.getPatternParts = exports2.expandBraceExpansion = exports2.expandPatternsWithBraceExpansion = exports2.isAffectDepthOfReadingPattern = exports2.endsWithSlashGlobStar = exports2.hasGlobStar = exports2.getBaseDirectory = exports2.isPatternRelatedToParentDirectory = exports2.getPatternsOutsideCurrentDirectory = exports2.getPatternsInsideCurrentDirectory = exports2.getPositivePatterns = exports2.getNegativePatterns = exports2.isPositivePattern = exports2.isNegativePattern = exports2.convertToNegativePattern = exports2.convertToPositivePattern = exports2.isDynamicPattern = exports2.isStaticPattern = void 0;
|
|
3084
3094
|
var path2 = require("path");
|
|
3085
3095
|
var globParent = require_glob_parent();
|
|
3086
3096
|
var micromatch = require_micromatch();
|
|
@@ -3220,6 +3230,23 @@ var require_pattern = __commonJS({
|
|
|
3220
3230
|
return pattern.replace(DOUBLE_SLASH_RE, "/");
|
|
3221
3231
|
}
|
|
3222
3232
|
exports2.removeDuplicateSlashes = removeDuplicateSlashes;
|
|
3233
|
+
function partitionAbsoluteAndRelative(patterns) {
|
|
3234
|
+
const absolute = [];
|
|
3235
|
+
const relative = [];
|
|
3236
|
+
for (const pattern of patterns) {
|
|
3237
|
+
if (isAbsolute(pattern)) {
|
|
3238
|
+
absolute.push(pattern);
|
|
3239
|
+
} else {
|
|
3240
|
+
relative.push(pattern);
|
|
3241
|
+
}
|
|
3242
|
+
}
|
|
3243
|
+
return [absolute, relative];
|
|
3244
|
+
}
|
|
3245
|
+
exports2.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
|
|
3246
|
+
function isAbsolute(pattern) {
|
|
3247
|
+
return path2.isAbsolute(pattern);
|
|
3248
|
+
}
|
|
3249
|
+
exports2.isAbsolute = isAbsolute;
|
|
3223
3250
|
}
|
|
3224
3251
|
});
|
|
3225
3252
|
|
|
@@ -4072,14 +4099,14 @@ var require_queue = __commonJS({
|
|
|
4072
4099
|
"../../node_modules/fastq/queue.js"(exports2, module2) {
|
|
4073
4100
|
"use strict";
|
|
4074
4101
|
var reusify = require_reusify();
|
|
4075
|
-
function fastqueue(context, worker,
|
|
4102
|
+
function fastqueue(context, worker, _concurrency) {
|
|
4076
4103
|
if (typeof context === "function") {
|
|
4077
|
-
|
|
4104
|
+
_concurrency = worker;
|
|
4078
4105
|
worker = context;
|
|
4079
4106
|
context = null;
|
|
4080
4107
|
}
|
|
4081
|
-
if (
|
|
4082
|
-
throw new Error("fastqueue concurrency must be greater than 1");
|
|
4108
|
+
if (!(_concurrency >= 1)) {
|
|
4109
|
+
throw new Error("fastqueue concurrency must be equal to or greater than 1");
|
|
4083
4110
|
}
|
|
4084
4111
|
var cache2 = reusify(Task);
|
|
4085
4112
|
var queueHead = null;
|
|
@@ -4092,7 +4119,20 @@ var require_queue = __commonJS({
|
|
|
4092
4119
|
saturated: noop2,
|
|
4093
4120
|
pause,
|
|
4094
4121
|
paused: false,
|
|
4095
|
-
concurrency
|
|
4122
|
+
get concurrency() {
|
|
4123
|
+
return _concurrency;
|
|
4124
|
+
},
|
|
4125
|
+
set concurrency(value) {
|
|
4126
|
+
if (!(value >= 1)) {
|
|
4127
|
+
throw new Error("fastqueue concurrency must be equal to or greater than 1");
|
|
4128
|
+
}
|
|
4129
|
+
_concurrency = value;
|
|
4130
|
+
if (self.paused) return;
|
|
4131
|
+
for (; queueHead && _running < _concurrency; ) {
|
|
4132
|
+
_running++;
|
|
4133
|
+
release();
|
|
4134
|
+
}
|
|
4135
|
+
},
|
|
4096
4136
|
running,
|
|
4097
4137
|
resume,
|
|
4098
4138
|
idle,
|
|
@@ -4102,7 +4142,8 @@ var require_queue = __commonJS({
|
|
|
4102
4142
|
empty: noop2,
|
|
4103
4143
|
kill,
|
|
4104
4144
|
killAndDrain,
|
|
4105
|
-
error
|
|
4145
|
+
error,
|
|
4146
|
+
abort
|
|
4106
4147
|
};
|
|
4107
4148
|
return self;
|
|
4108
4149
|
function running() {
|
|
@@ -4132,7 +4173,12 @@ var require_queue = __commonJS({
|
|
|
4132
4173
|
function resume() {
|
|
4133
4174
|
if (!self.paused) return;
|
|
4134
4175
|
self.paused = false;
|
|
4135
|
-
|
|
4176
|
+
if (queueHead === null) {
|
|
4177
|
+
_running++;
|
|
4178
|
+
release();
|
|
4179
|
+
return;
|
|
4180
|
+
}
|
|
4181
|
+
for (; queueHead && _running < _concurrency; ) {
|
|
4136
4182
|
_running++;
|
|
4137
4183
|
release();
|
|
4138
4184
|
}
|
|
@@ -4147,7 +4193,7 @@ var require_queue = __commonJS({
|
|
|
4147
4193
|
current.value = value;
|
|
4148
4194
|
current.callback = done || noop2;
|
|
4149
4195
|
current.errorHandler = errorHandler;
|
|
4150
|
-
if (_running
|
|
4196
|
+
if (_running >= _concurrency || self.paused) {
|
|
4151
4197
|
if (queueTail) {
|
|
4152
4198
|
queueTail.next = current;
|
|
4153
4199
|
queueTail = current;
|
|
@@ -4167,7 +4213,8 @@ var require_queue = __commonJS({
|
|
|
4167
4213
|
current.release = release;
|
|
4168
4214
|
current.value = value;
|
|
4169
4215
|
current.callback = done || noop2;
|
|
4170
|
-
|
|
4216
|
+
current.errorHandler = errorHandler;
|
|
4217
|
+
if (_running >= _concurrency || self.paused) {
|
|
4171
4218
|
if (queueHead) {
|
|
4172
4219
|
current.next = queueHead;
|
|
4173
4220
|
queueHead = current;
|
|
@@ -4186,7 +4233,7 @@ var require_queue = __commonJS({
|
|
|
4186
4233
|
cache2.release(holder);
|
|
4187
4234
|
}
|
|
4188
4235
|
var next = queueHead;
|
|
4189
|
-
if (next) {
|
|
4236
|
+
if (next && _running <= _concurrency) {
|
|
4190
4237
|
if (!self.paused) {
|
|
4191
4238
|
if (queueTail === queueHead) {
|
|
4192
4239
|
queueTail = null;
|
|
@@ -4215,6 +4262,28 @@ var require_queue = __commonJS({
|
|
|
4215
4262
|
self.drain();
|
|
4216
4263
|
self.drain = noop2;
|
|
4217
4264
|
}
|
|
4265
|
+
function abort() {
|
|
4266
|
+
var current = queueHead;
|
|
4267
|
+
queueHead = null;
|
|
4268
|
+
queueTail = null;
|
|
4269
|
+
while (current) {
|
|
4270
|
+
var next = current.next;
|
|
4271
|
+
var callback = current.callback;
|
|
4272
|
+
var errorHandler2 = current.errorHandler;
|
|
4273
|
+
var val = current.value;
|
|
4274
|
+
var context2 = current.context;
|
|
4275
|
+
current.value = null;
|
|
4276
|
+
current.callback = noop2;
|
|
4277
|
+
current.errorHandler = null;
|
|
4278
|
+
if (errorHandler2) {
|
|
4279
|
+
errorHandler2(new Error("abort"), val);
|
|
4280
|
+
}
|
|
4281
|
+
callback.call(context2, new Error("abort"));
|
|
4282
|
+
current.release(current);
|
|
4283
|
+
current = next;
|
|
4284
|
+
}
|
|
4285
|
+
self.drain = noop2;
|
|
4286
|
+
}
|
|
4218
4287
|
function error(handler) {
|
|
4219
4288
|
errorHandler = handler;
|
|
4220
4289
|
}
|
|
@@ -4242,9 +4311,9 @@ var require_queue = __commonJS({
|
|
|
4242
4311
|
self.release(self);
|
|
4243
4312
|
};
|
|
4244
4313
|
}
|
|
4245
|
-
function queueAsPromised(context, worker,
|
|
4314
|
+
function queueAsPromised(context, worker, _concurrency) {
|
|
4246
4315
|
if (typeof context === "function") {
|
|
4247
|
-
|
|
4316
|
+
_concurrency = worker;
|
|
4248
4317
|
worker = context;
|
|
4249
4318
|
context = null;
|
|
4250
4319
|
}
|
|
@@ -4253,7 +4322,7 @@ var require_queue = __commonJS({
|
|
|
4253
4322
|
cb(null, res);
|
|
4254
4323
|
}, cb);
|
|
4255
4324
|
}
|
|
4256
|
-
var queue = fastqueue(context, asyncWrapper,
|
|
4325
|
+
var queue = fastqueue(context, asyncWrapper, _concurrency);
|
|
4257
4326
|
var pushCb = queue.push;
|
|
4258
4327
|
var unshiftCb = queue.unshift;
|
|
4259
4328
|
queue.push = push;
|
|
@@ -4287,17 +4356,19 @@ var require_queue = __commonJS({
|
|
|
4287
4356
|
return p;
|
|
4288
4357
|
}
|
|
4289
4358
|
function drained() {
|
|
4290
|
-
if (queue.idle()) {
|
|
4291
|
-
return new Promise(function(resolve) {
|
|
4292
|
-
resolve();
|
|
4293
|
-
});
|
|
4294
|
-
}
|
|
4295
|
-
var previousDrain = queue.drain;
|
|
4296
4359
|
var p = new Promise(function(resolve) {
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4360
|
+
process.nextTick(function() {
|
|
4361
|
+
if (queue.idle()) {
|
|
4362
|
+
resolve();
|
|
4363
|
+
} else {
|
|
4364
|
+
var previousDrain = queue.drain;
|
|
4365
|
+
queue.drain = function() {
|
|
4366
|
+
if (typeof previousDrain === "function") previousDrain();
|
|
4367
|
+
resolve();
|
|
4368
|
+
queue.drain = previousDrain;
|
|
4369
|
+
};
|
|
4370
|
+
}
|
|
4371
|
+
});
|
|
4301
4372
|
});
|
|
4302
4373
|
return p;
|
|
4303
4374
|
}
|
|
@@ -4995,11 +5066,19 @@ var require_entry = __commonJS({
|
|
|
4995
5066
|
this.index = /* @__PURE__ */ new Map();
|
|
4996
5067
|
}
|
|
4997
5068
|
getFilter(positive, negative) {
|
|
4998
|
-
const
|
|
4999
|
-
const
|
|
5000
|
-
|
|
5069
|
+
const [absoluteNegative, relativeNegative] = utils.pattern.partitionAbsoluteAndRelative(negative);
|
|
5070
|
+
const patterns = {
|
|
5071
|
+
positive: {
|
|
5072
|
+
all: utils.pattern.convertPatternsToRe(positive, this._micromatchOptions)
|
|
5073
|
+
},
|
|
5074
|
+
negative: {
|
|
5075
|
+
absolute: utils.pattern.convertPatternsToRe(absoluteNegative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true })),
|
|
5076
|
+
relative: utils.pattern.convertPatternsToRe(relativeNegative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true }))
|
|
5077
|
+
}
|
|
5078
|
+
};
|
|
5079
|
+
return (entry) => this._filter(entry, patterns);
|
|
5001
5080
|
}
|
|
5002
|
-
_filter(entry,
|
|
5081
|
+
_filter(entry, patterns) {
|
|
5003
5082
|
const filepath = utils.path.removeLeadingDotSegment(entry.path);
|
|
5004
5083
|
if (this._settings.unique && this._isDuplicateEntry(filepath)) {
|
|
5005
5084
|
return false;
|
|
@@ -5007,11 +5086,7 @@ var require_entry = __commonJS({
|
|
|
5007
5086
|
if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
|
|
5008
5087
|
return false;
|
|
5009
5088
|
}
|
|
5010
|
-
|
|
5011
|
-
return false;
|
|
5012
|
-
}
|
|
5013
|
-
const isDirectory2 = entry.dirent.isDirectory();
|
|
5014
|
-
const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory2) && !this._isMatchToPatterns(filepath, negativeRe, isDirectory2);
|
|
5089
|
+
const isMatched = this._isMatchToPatternsSet(filepath, patterns, entry.dirent.isDirectory());
|
|
5015
5090
|
if (this._settings.unique && isMatched) {
|
|
5016
5091
|
this._createIndexRecord(filepath);
|
|
5017
5092
|
}
|
|
@@ -5029,14 +5104,32 @@ var require_entry = __commonJS({
|
|
|
5029
5104
|
_onlyDirectoryFilter(entry) {
|
|
5030
5105
|
return this._settings.onlyDirectories && !entry.dirent.isDirectory();
|
|
5031
5106
|
}
|
|
5032
|
-
|
|
5033
|
-
|
|
5107
|
+
_isMatchToPatternsSet(filepath, patterns, isDirectory2) {
|
|
5108
|
+
const isMatched = this._isMatchToPatterns(filepath, patterns.positive.all, isDirectory2);
|
|
5109
|
+
if (!isMatched) {
|
|
5034
5110
|
return false;
|
|
5035
5111
|
}
|
|
5036
|
-
const
|
|
5037
|
-
|
|
5112
|
+
const isMatchedByRelativeNegative = this._isMatchToPatterns(filepath, patterns.negative.relative, isDirectory2);
|
|
5113
|
+
if (isMatchedByRelativeNegative) {
|
|
5114
|
+
return false;
|
|
5115
|
+
}
|
|
5116
|
+
const isMatchedByAbsoluteNegative = this._isMatchToAbsoluteNegative(filepath, patterns.negative.absolute, isDirectory2);
|
|
5117
|
+
if (isMatchedByAbsoluteNegative) {
|
|
5118
|
+
return false;
|
|
5119
|
+
}
|
|
5120
|
+
return true;
|
|
5121
|
+
}
|
|
5122
|
+
_isMatchToAbsoluteNegative(filepath, patternsRe, isDirectory2) {
|
|
5123
|
+
if (patternsRe.length === 0) {
|
|
5124
|
+
return false;
|
|
5125
|
+
}
|
|
5126
|
+
const fullpath = utils.path.makeAbsolute(this._settings.cwd, filepath);
|
|
5127
|
+
return this._isMatchToPatterns(fullpath, patternsRe, isDirectory2);
|
|
5038
5128
|
}
|
|
5039
5129
|
_isMatchToPatterns(filepath, patternsRe, isDirectory2) {
|
|
5130
|
+
if (patternsRe.length === 0) {
|
|
5131
|
+
return false;
|
|
5132
|
+
}
|
|
5040
5133
|
const isMatched = utils.pattern.matchAny(filepath, patternsRe);
|
|
5041
5134
|
if (!isMatched && isDirectory2) {
|
|
5042
5135
|
return utils.pattern.matchAny(filepath + "/", patternsRe);
|
|
@@ -5462,6 +5555,7 @@ var require_ignore = __commonJS({
|
|
|
5462
5555
|
function makeArray(subject) {
|
|
5463
5556
|
return Array.isArray(subject) ? subject : [subject];
|
|
5464
5557
|
}
|
|
5558
|
+
var UNDEFINED = void 0;
|
|
5465
5559
|
var EMPTY = "";
|
|
5466
5560
|
var SPACE = " ";
|
|
5467
5561
|
var ESCAPE = "\\";
|
|
@@ -5470,14 +5564,18 @@ var require_ignore = __commonJS({
|
|
|
5470
5564
|
var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
|
|
5471
5565
|
var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
|
|
5472
5566
|
var REGEX_SPLITALL_CRLF = /\r?\n/g;
|
|
5473
|
-
var REGEX_TEST_INVALID_PATH =
|
|
5567
|
+
var REGEX_TEST_INVALID_PATH = /^\.{0,2}\/|^\.{1,2}$/;
|
|
5568
|
+
var REGEX_TEST_TRAILING_SLASH = /\/$/;
|
|
5474
5569
|
var SLASH = "/";
|
|
5475
5570
|
var TMP_KEY_IGNORE = "node-ignore";
|
|
5476
5571
|
if (typeof Symbol !== "undefined") {
|
|
5477
5572
|
TMP_KEY_IGNORE = Symbol.for("node-ignore");
|
|
5478
5573
|
}
|
|
5479
5574
|
var KEY_IGNORE = TMP_KEY_IGNORE;
|
|
5480
|
-
var define = (object, key, value) =>
|
|
5575
|
+
var define = (object, key, value) => {
|
|
5576
|
+
Object.defineProperty(object, key, { value });
|
|
5577
|
+
return value;
|
|
5578
|
+
};
|
|
5481
5579
|
var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;
|
|
5482
5580
|
var RETURN_FALSE = () => false;
|
|
5483
5581
|
var sanitizeRange = (range) => range.replace(
|
|
@@ -5490,7 +5588,7 @@ var require_ignore = __commonJS({
|
|
|
5490
5588
|
};
|
|
5491
5589
|
var REPLACERS = [
|
|
5492
5590
|
[
|
|
5493
|
-
//
|
|
5591
|
+
// Remove BOM
|
|
5494
5592
|
// TODO:
|
|
5495
5593
|
// Other similar zero-width characters?
|
|
5496
5594
|
/^\uFEFF/,
|
|
@@ -5500,14 +5598,21 @@ var require_ignore = __commonJS({
|
|
|
5500
5598
|
[
|
|
5501
5599
|
// (a\ ) -> (a )
|
|
5502
5600
|
// (a ) -> (a)
|
|
5601
|
+
// (a ) -> (a)
|
|
5503
5602
|
// (a \ ) -> (a )
|
|
5504
|
-
|
|
5505
|
-
(
|
|
5603
|
+
/((?:\\\\)*?)(\\?\s+)$/,
|
|
5604
|
+
(_, m1, m2) => m1 + (m2.indexOf("\\") === 0 ? SPACE : EMPTY)
|
|
5506
5605
|
],
|
|
5507
|
-
//
|
|
5606
|
+
// Replace (\ ) with ' '
|
|
5607
|
+
// (\ ) -> ' '
|
|
5608
|
+
// (\\ ) -> '\\ '
|
|
5609
|
+
// (\\\ ) -> '\\ '
|
|
5508
5610
|
[
|
|
5509
|
-
|
|
5510
|
-
() =>
|
|
5611
|
+
/(\\+?)\s/g,
|
|
5612
|
+
(_, m1) => {
|
|
5613
|
+
const { length } = m1;
|
|
5614
|
+
return m1.slice(0, length - length % 2) + SPACE;
|
|
5615
|
+
}
|
|
5511
5616
|
],
|
|
5512
5617
|
// Escape metacharacters
|
|
5513
5618
|
// which is written down by users but means special for regular expressions.
|
|
@@ -5627,55 +5732,147 @@ var require_ignore = __commonJS({
|
|
|
5627
5732
|
// 'js/' will not match 'a.js'
|
|
5628
5733
|
// 'js' will match 'a.js' and 'a.js/'
|
|
5629
5734
|
(match) => /\/$/.test(match) ? `${match}$` : `${match}(?=$|\\/$)`
|
|
5630
|
-
],
|
|
5631
|
-
// trailing wildcard
|
|
5632
|
-
[
|
|
5633
|
-
/(\^|\\\/)?\\\*$/,
|
|
5634
|
-
(_, p1) => {
|
|
5635
|
-
const prefix = p1 ? `${p1}[^/]+` : "[^/]*";
|
|
5636
|
-
return `${prefix}(?=$|\\/$)`;
|
|
5637
|
-
}
|
|
5638
5735
|
]
|
|
5639
5736
|
];
|
|
5640
|
-
var
|
|
5641
|
-
var
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
)
|
|
5648
|
-
|
|
5737
|
+
var REGEX_REPLACE_TRAILING_WILDCARD = /(^|\\\/)?\\\*$/;
|
|
5738
|
+
var MODE_IGNORE = "regex";
|
|
5739
|
+
var MODE_CHECK_IGNORE = "checkRegex";
|
|
5740
|
+
var UNDERSCORE = "_";
|
|
5741
|
+
var TRAILING_WILD_CARD_REPLACERS = {
|
|
5742
|
+
[MODE_IGNORE](_, p1) {
|
|
5743
|
+
const prefix = p1 ? `${p1}[^/]+` : "[^/]*";
|
|
5744
|
+
return `${prefix}(?=$|\\/$)`;
|
|
5745
|
+
},
|
|
5746
|
+
[MODE_CHECK_IGNORE](_, p1) {
|
|
5747
|
+
const prefix = p1 ? `${p1}[^/]*` : "[^/]*";
|
|
5748
|
+
return `${prefix}(?=$|\\/$)`;
|
|
5649
5749
|
}
|
|
5650
|
-
return ignoreCase ? new RegExp(source, "i") : new RegExp(source);
|
|
5651
5750
|
};
|
|
5751
|
+
var makeRegexPrefix = (pattern) => REPLACERS.reduce(
|
|
5752
|
+
(prev, [matcher, replacer]) => prev.replace(matcher, replacer.bind(pattern)),
|
|
5753
|
+
pattern
|
|
5754
|
+
);
|
|
5652
5755
|
var isString = (subject) => typeof subject === "string";
|
|
5653
5756
|
var checkPattern = (pattern) => pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) && pattern.indexOf("#") !== 0;
|
|
5654
|
-
var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF);
|
|
5757
|
+
var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF).filter(Boolean);
|
|
5655
5758
|
var IgnoreRule = class {
|
|
5656
|
-
constructor(
|
|
5657
|
-
this.origin = origin;
|
|
5759
|
+
constructor(pattern, mark, body, ignoreCase, negative, prefix) {
|
|
5658
5760
|
this.pattern = pattern;
|
|
5761
|
+
this.mark = mark;
|
|
5659
5762
|
this.negative = negative;
|
|
5660
|
-
this
|
|
5763
|
+
define(this, "body", body);
|
|
5764
|
+
define(this, "ignoreCase", ignoreCase);
|
|
5765
|
+
define(this, "regexPrefix", prefix);
|
|
5766
|
+
}
|
|
5767
|
+
get regex() {
|
|
5768
|
+
const key = UNDERSCORE + MODE_IGNORE;
|
|
5769
|
+
if (this[key]) {
|
|
5770
|
+
return this[key];
|
|
5771
|
+
}
|
|
5772
|
+
return this._make(MODE_IGNORE, key);
|
|
5773
|
+
}
|
|
5774
|
+
get checkRegex() {
|
|
5775
|
+
const key = UNDERSCORE + MODE_CHECK_IGNORE;
|
|
5776
|
+
if (this[key]) {
|
|
5777
|
+
return this[key];
|
|
5778
|
+
}
|
|
5779
|
+
return this._make(MODE_CHECK_IGNORE, key);
|
|
5780
|
+
}
|
|
5781
|
+
_make(mode, key) {
|
|
5782
|
+
const str = this.regexPrefix.replace(
|
|
5783
|
+
REGEX_REPLACE_TRAILING_WILDCARD,
|
|
5784
|
+
// It does not need to bind pattern
|
|
5785
|
+
TRAILING_WILD_CARD_REPLACERS[mode]
|
|
5786
|
+
);
|
|
5787
|
+
const regex = this.ignoreCase ? new RegExp(str, "i") : new RegExp(str);
|
|
5788
|
+
return define(this, key, regex);
|
|
5661
5789
|
}
|
|
5662
5790
|
};
|
|
5663
|
-
var createRule = (
|
|
5664
|
-
|
|
5791
|
+
var createRule = ({
|
|
5792
|
+
pattern,
|
|
5793
|
+
mark
|
|
5794
|
+
}, ignoreCase) => {
|
|
5665
5795
|
let negative = false;
|
|
5666
|
-
|
|
5796
|
+
let body = pattern;
|
|
5797
|
+
if (body.indexOf("!") === 0) {
|
|
5667
5798
|
negative = true;
|
|
5668
|
-
|
|
5799
|
+
body = body.substr(1);
|
|
5669
5800
|
}
|
|
5670
|
-
|
|
5671
|
-
const
|
|
5801
|
+
body = body.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#");
|
|
5802
|
+
const regexPrefix = makeRegexPrefix(body);
|
|
5672
5803
|
return new IgnoreRule(
|
|
5673
|
-
origin,
|
|
5674
5804
|
pattern,
|
|
5805
|
+
mark,
|
|
5806
|
+
body,
|
|
5807
|
+
ignoreCase,
|
|
5675
5808
|
negative,
|
|
5676
|
-
|
|
5809
|
+
regexPrefix
|
|
5677
5810
|
);
|
|
5678
5811
|
};
|
|
5812
|
+
var RuleManager = class {
|
|
5813
|
+
constructor(ignoreCase) {
|
|
5814
|
+
this._ignoreCase = ignoreCase;
|
|
5815
|
+
this._rules = [];
|
|
5816
|
+
}
|
|
5817
|
+
_add(pattern) {
|
|
5818
|
+
if (pattern && pattern[KEY_IGNORE]) {
|
|
5819
|
+
this._rules = this._rules.concat(pattern._rules._rules);
|
|
5820
|
+
this._added = true;
|
|
5821
|
+
return;
|
|
5822
|
+
}
|
|
5823
|
+
if (isString(pattern)) {
|
|
5824
|
+
pattern = {
|
|
5825
|
+
pattern
|
|
5826
|
+
};
|
|
5827
|
+
}
|
|
5828
|
+
if (checkPattern(pattern.pattern)) {
|
|
5829
|
+
const rule = createRule(pattern, this._ignoreCase);
|
|
5830
|
+
this._added = true;
|
|
5831
|
+
this._rules.push(rule);
|
|
5832
|
+
}
|
|
5833
|
+
}
|
|
5834
|
+
// @param {Array<string> | string | Ignore} pattern
|
|
5835
|
+
add(pattern) {
|
|
5836
|
+
this._added = false;
|
|
5837
|
+
makeArray(
|
|
5838
|
+
isString(pattern) ? splitPattern(pattern) : pattern
|
|
5839
|
+
).forEach(this._add, this);
|
|
5840
|
+
return this._added;
|
|
5841
|
+
}
|
|
5842
|
+
// Test one single path without recursively checking parent directories
|
|
5843
|
+
//
|
|
5844
|
+
// - checkUnignored `boolean` whether should check if the path is unignored,
|
|
5845
|
+
// setting `checkUnignored` to `false` could reduce additional
|
|
5846
|
+
// path matching.
|
|
5847
|
+
// - check `string` either `MODE_IGNORE` or `MODE_CHECK_IGNORE`
|
|
5848
|
+
// @returns {TestResult} true if a file is ignored
|
|
5849
|
+
test(path2, checkUnignored, mode) {
|
|
5850
|
+
let ignored = false;
|
|
5851
|
+
let unignored = false;
|
|
5852
|
+
let matchedRule;
|
|
5853
|
+
this._rules.forEach((rule) => {
|
|
5854
|
+
const { negative } = rule;
|
|
5855
|
+
if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
|
|
5856
|
+
return;
|
|
5857
|
+
}
|
|
5858
|
+
const matched = rule[mode].test(path2);
|
|
5859
|
+
if (!matched) {
|
|
5860
|
+
return;
|
|
5861
|
+
}
|
|
5862
|
+
ignored = !negative;
|
|
5863
|
+
unignored = negative;
|
|
5864
|
+
matchedRule = negative ? UNDEFINED : rule;
|
|
5865
|
+
});
|
|
5866
|
+
const ret = {
|
|
5867
|
+
ignored,
|
|
5868
|
+
unignored
|
|
5869
|
+
};
|
|
5870
|
+
if (matchedRule) {
|
|
5871
|
+
ret.rule = matchedRule;
|
|
5872
|
+
}
|
|
5873
|
+
return ret;
|
|
5874
|
+
}
|
|
5875
|
+
};
|
|
5679
5876
|
var throwError = (message, Ctor) => {
|
|
5680
5877
|
throw new Ctor(message);
|
|
5681
5878
|
};
|
|
@@ -5708,34 +5905,16 @@ var require_ignore = __commonJS({
|
|
|
5708
5905
|
allowRelativePaths = false
|
|
5709
5906
|
} = {}) {
|
|
5710
5907
|
define(this, KEY_IGNORE, true);
|
|
5711
|
-
this._rules =
|
|
5712
|
-
this.
|
|
5713
|
-
this._allowRelativePaths = allowRelativePaths;
|
|
5908
|
+
this._rules = new RuleManager(ignoreCase);
|
|
5909
|
+
this._strictPathCheck = !allowRelativePaths;
|
|
5714
5910
|
this._initCache();
|
|
5715
5911
|
}
|
|
5716
5912
|
_initCache() {
|
|
5717
5913
|
this._ignoreCache = /* @__PURE__ */ Object.create(null);
|
|
5718
5914
|
this._testCache = /* @__PURE__ */ Object.create(null);
|
|
5719
5915
|
}
|
|
5720
|
-
_addPattern(pattern) {
|
|
5721
|
-
if (pattern && pattern[KEY_IGNORE]) {
|
|
5722
|
-
this._rules = this._rules.concat(pattern._rules);
|
|
5723
|
-
this._added = true;
|
|
5724
|
-
return;
|
|
5725
|
-
}
|
|
5726
|
-
if (checkPattern(pattern)) {
|
|
5727
|
-
const rule = createRule(pattern, this._ignoreCase);
|
|
5728
|
-
this._added = true;
|
|
5729
|
-
this._rules.push(rule);
|
|
5730
|
-
}
|
|
5731
|
-
}
|
|
5732
|
-
// @param {Array<string> | string | Ignore} pattern
|
|
5733
5916
|
add(pattern) {
|
|
5734
|
-
this.
|
|
5735
|
-
makeArray(
|
|
5736
|
-
isString(pattern) ? splitPattern(pattern) : pattern
|
|
5737
|
-
).forEach(this._addPattern, this);
|
|
5738
|
-
if (this._added) {
|
|
5917
|
+
if (this._rules.add(pattern)) {
|
|
5739
5918
|
this._initCache();
|
|
5740
5919
|
}
|
|
5741
5920
|
return this;
|
|
@@ -5744,58 +5923,45 @@ var require_ignore = __commonJS({
|
|
|
5744
5923
|
addPattern(pattern) {
|
|
5745
5924
|
return this.add(pattern);
|
|
5746
5925
|
}
|
|
5747
|
-
// | ignored : unignored
|
|
5748
|
-
// negative | 0:0 | 0:1 | 1:0 | 1:1
|
|
5749
|
-
// -------- | ------- | ------- | ------- | --------
|
|
5750
|
-
// 0 | TEST | TEST | SKIP | X
|
|
5751
|
-
// 1 | TESTIF | SKIP | TEST | X
|
|
5752
|
-
// - SKIP: always skip
|
|
5753
|
-
// - TEST: always test
|
|
5754
|
-
// - TESTIF: only test if checkUnignored
|
|
5755
|
-
// - X: that never happen
|
|
5756
|
-
// @param {boolean} whether should check if the path is unignored,
|
|
5757
|
-
// setting `checkUnignored` to `false` could reduce additional
|
|
5758
|
-
// path matching.
|
|
5759
|
-
// @returns {TestResult} true if a file is ignored
|
|
5760
|
-
_testOne(path2, checkUnignored) {
|
|
5761
|
-
let ignored = false;
|
|
5762
|
-
let unignored = false;
|
|
5763
|
-
this._rules.forEach((rule) => {
|
|
5764
|
-
const { negative } = rule;
|
|
5765
|
-
if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
|
|
5766
|
-
return;
|
|
5767
|
-
}
|
|
5768
|
-
const matched = rule.regex.test(path2);
|
|
5769
|
-
if (matched) {
|
|
5770
|
-
ignored = !negative;
|
|
5771
|
-
unignored = negative;
|
|
5772
|
-
}
|
|
5773
|
-
});
|
|
5774
|
-
return {
|
|
5775
|
-
ignored,
|
|
5776
|
-
unignored
|
|
5777
|
-
};
|
|
5778
|
-
}
|
|
5779
5926
|
// @returns {TestResult}
|
|
5780
5927
|
_test(originalPath, cache2, checkUnignored, slices) {
|
|
5781
5928
|
const path2 = originalPath && checkPath.convert(originalPath);
|
|
5782
5929
|
checkPath(
|
|
5783
5930
|
path2,
|
|
5784
5931
|
originalPath,
|
|
5785
|
-
this.
|
|
5932
|
+
this._strictPathCheck ? throwError : RETURN_FALSE
|
|
5786
5933
|
);
|
|
5787
5934
|
return this._t(path2, cache2, checkUnignored, slices);
|
|
5788
5935
|
}
|
|
5936
|
+
checkIgnore(path2) {
|
|
5937
|
+
if (!REGEX_TEST_TRAILING_SLASH.test(path2)) {
|
|
5938
|
+
return this.test(path2);
|
|
5939
|
+
}
|
|
5940
|
+
const slices = path2.split(SLASH).filter(Boolean);
|
|
5941
|
+
slices.pop();
|
|
5942
|
+
if (slices.length) {
|
|
5943
|
+
const parent = this._t(
|
|
5944
|
+
slices.join(SLASH) + SLASH,
|
|
5945
|
+
this._testCache,
|
|
5946
|
+
true,
|
|
5947
|
+
slices
|
|
5948
|
+
);
|
|
5949
|
+
if (parent.ignored) {
|
|
5950
|
+
return parent;
|
|
5951
|
+
}
|
|
5952
|
+
}
|
|
5953
|
+
return this._rules.test(path2, false, MODE_CHECK_IGNORE);
|
|
5954
|
+
}
|
|
5789
5955
|
_t(path2, cache2, checkUnignored, slices) {
|
|
5790
5956
|
if (path2 in cache2) {
|
|
5791
5957
|
return cache2[path2];
|
|
5792
5958
|
}
|
|
5793
5959
|
if (!slices) {
|
|
5794
|
-
slices = path2.split(SLASH);
|
|
5960
|
+
slices = path2.split(SLASH).filter(Boolean);
|
|
5795
5961
|
}
|
|
5796
5962
|
slices.pop();
|
|
5797
5963
|
if (!slices.length) {
|
|
5798
|
-
return cache2[path2] = this.
|
|
5964
|
+
return cache2[path2] = this._rules.test(path2, checkUnignored, MODE_IGNORE);
|
|
5799
5965
|
}
|
|
5800
5966
|
const parent = this._t(
|
|
5801
5967
|
slices.join(SLASH) + SLASH,
|
|
@@ -5803,7 +5969,7 @@ var require_ignore = __commonJS({
|
|
|
5803
5969
|
checkUnignored,
|
|
5804
5970
|
slices
|
|
5805
5971
|
);
|
|
5806
|
-
return cache2[path2] = parent.ignored ? parent : this.
|
|
5972
|
+
return cache2[path2] = parent.ignored ? parent : this._rules.test(path2, checkUnignored, MODE_IGNORE);
|
|
5807
5973
|
}
|
|
5808
5974
|
ignores(path2) {
|
|
5809
5975
|
return this._test(path2, this._ignoreCache, false).ignored;
|
|
@@ -5821,32 +5987,36 @@ var require_ignore = __commonJS({
|
|
|
5821
5987
|
};
|
|
5822
5988
|
var factory = (options) => new Ignore(options);
|
|
5823
5989
|
var isPathValid = (path2) => checkPath(path2 && checkPath.convert(path2), path2, RETURN_FALSE);
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5990
|
+
var setupWindows = () => {
|
|
5991
|
+
const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
|
|
5992
|
+
checkPath.convert = makePosix;
|
|
5993
|
+
const REGEX_TEST_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
|
|
5994
|
+
checkPath.isNotRelative = (path2) => REGEX_TEST_WINDOWS_PATH_ABSOLUTE.test(path2) || isNotRelative(path2);
|
|
5995
|
+
};
|
|
5827
5996
|
if (
|
|
5828
5997
|
// Detect `process` so that it can run in browsers.
|
|
5829
|
-
typeof process !== "undefined" &&
|
|
5998
|
+
typeof process !== "undefined" && process.platform === "win32"
|
|
5830
5999
|
) {
|
|
5831
|
-
|
|
5832
|
-
checkPath.convert = makePosix;
|
|
5833
|
-
const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
|
|
5834
|
-
checkPath.isNotRelative = (path2) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path2) || isNotRelative(path2);
|
|
6000
|
+
setupWindows();
|
|
5835
6001
|
}
|
|
6002
|
+
module2.exports = factory;
|
|
6003
|
+
factory.default = factory;
|
|
6004
|
+
module2.exports.isPathValid = isPathValid;
|
|
6005
|
+
define(module2.exports, Symbol.for("setupWindows"), setupWindows);
|
|
5836
6006
|
}
|
|
5837
6007
|
});
|
|
5838
6008
|
|
|
5839
6009
|
// src/index.mts
|
|
5840
|
-
var
|
|
5841
|
-
__export(
|
|
6010
|
+
var index_exports = {};
|
|
6011
|
+
__export(index_exports, {
|
|
5842
6012
|
glob: () => glob,
|
|
5843
6013
|
globAsync: () => globAsync
|
|
5844
6014
|
});
|
|
5845
|
-
module.exports = __toCommonJS(
|
|
6015
|
+
module.exports = __toCommonJS(index_exports);
|
|
5846
6016
|
|
|
5847
6017
|
// ../../node_modules/globby/index.js
|
|
5848
6018
|
var import_node_process2 = __toESM(require("process"), 1);
|
|
5849
|
-
var
|
|
6019
|
+
var import_node_fs3 = __toESM(require("fs"), 1);
|
|
5850
6020
|
var import_node_path2 = __toESM(require("path"), 1);
|
|
5851
6021
|
|
|
5852
6022
|
// ../../node_modules/@sindresorhus/merge-streams/index.js
|
|
@@ -6038,13 +6208,14 @@ var PASSTHROUGH_LISTENERS_PER_STREAM = 1;
|
|
|
6038
6208
|
var import_fast_glob2 = __toESM(require_out4(), 1);
|
|
6039
6209
|
|
|
6040
6210
|
// ../../node_modules/globby/node_modules/path-type/index.js
|
|
6041
|
-
var
|
|
6211
|
+
var import_node_fs = __toESM(require("fs"), 1);
|
|
6212
|
+
var import_promises2 = __toESM(require("fs/promises"), 1);
|
|
6042
6213
|
async function isType(fsStatType, statsMethodName, filePath) {
|
|
6043
6214
|
if (typeof filePath !== "string") {
|
|
6044
6215
|
throw new TypeError(`Expected a string, got ${typeof filePath}`);
|
|
6045
6216
|
}
|
|
6046
6217
|
try {
|
|
6047
|
-
const stats = await
|
|
6218
|
+
const stats = await import_promises2.default[fsStatType](filePath);
|
|
6048
6219
|
return stats[statsMethodName]();
|
|
6049
6220
|
} catch (error) {
|
|
6050
6221
|
if (error.code === "ENOENT") {
|
|
@@ -6058,7 +6229,7 @@ function isTypeSync(fsStatType, statsMethodName, filePath) {
|
|
|
6058
6229
|
throw new TypeError(`Expected a string, got ${typeof filePath}`);
|
|
6059
6230
|
}
|
|
6060
6231
|
try {
|
|
6061
|
-
return
|
|
6232
|
+
return import_node_fs.default[fsStatType](filePath)[statsMethodName]();
|
|
6062
6233
|
} catch (error) {
|
|
6063
6234
|
if (error.code === "ENOENT") {
|
|
6064
6235
|
return false;
|
|
@@ -6066,23 +6237,27 @@ function isTypeSync(fsStatType, statsMethodName, filePath) {
|
|
|
6066
6237
|
throw error;
|
|
6067
6238
|
}
|
|
6068
6239
|
}
|
|
6069
|
-
var isFile = isType.bind(
|
|
6070
|
-
var isDirectory = isType.bind(
|
|
6071
|
-
var isSymlink = isType.bind(
|
|
6072
|
-
var isFileSync = isTypeSync.bind(
|
|
6073
|
-
var isDirectorySync = isTypeSync.bind(
|
|
6074
|
-
var isSymlinkSync = isTypeSync.bind(
|
|
6240
|
+
var isFile = isType.bind(void 0, "stat", "isFile");
|
|
6241
|
+
var isDirectory = isType.bind(void 0, "stat", "isDirectory");
|
|
6242
|
+
var isSymlink = isType.bind(void 0, "lstat", "isSymbolicLink");
|
|
6243
|
+
var isFileSync = isTypeSync.bind(void 0, "statSync", "isFile");
|
|
6244
|
+
var isDirectorySync = isTypeSync.bind(void 0, "statSync", "isDirectory");
|
|
6245
|
+
var isSymlinkSync = isTypeSync.bind(void 0, "lstatSync", "isSymbolicLink");
|
|
6075
6246
|
|
|
6076
6247
|
// ../../node_modules/unicorn-magic/node.js
|
|
6248
|
+
var import_node_util = require("util");
|
|
6249
|
+
var import_node_child_process = require("child_process");
|
|
6077
6250
|
var import_node_url = require("url");
|
|
6251
|
+
var execFileOriginal = (0, import_node_util.promisify)(import_node_child_process.execFile);
|
|
6078
6252
|
function toPath(urlOrPath) {
|
|
6079
6253
|
return urlOrPath instanceof URL ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath;
|
|
6080
6254
|
}
|
|
6255
|
+
var TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
|
|
6081
6256
|
|
|
6082
6257
|
// ../../node_modules/globby/ignore.js
|
|
6083
6258
|
var import_node_process = __toESM(require("process"), 1);
|
|
6084
|
-
var
|
|
6085
|
-
var
|
|
6259
|
+
var import_node_fs2 = __toESM(require("fs"), 1);
|
|
6260
|
+
var import_promises3 = __toESM(require("fs/promises"), 1);
|
|
6086
6261
|
var import_node_path = __toESM(require("path"), 1);
|
|
6087
6262
|
var import_fast_glob = __toESM(require_out4(), 1);
|
|
6088
6263
|
var import_ignore = __toESM(require_ignore(), 1);
|
|
@@ -6153,7 +6328,7 @@ var isIgnoredByIgnoreFiles = async (patterns, options) => {
|
|
|
6153
6328
|
const files = await Promise.all(
|
|
6154
6329
|
paths.map(async (filePath) => ({
|
|
6155
6330
|
filePath,
|
|
6156
|
-
content: await
|
|
6331
|
+
content: await import_promises3.default.readFile(filePath, "utf8")
|
|
6157
6332
|
}))
|
|
6158
6333
|
);
|
|
6159
6334
|
return getIsIgnoredPredicate(files, cwd);
|
|
@@ -6169,7 +6344,7 @@ var isIgnoredByIgnoreFilesSync = (patterns, options) => {
|
|
|
6169
6344
|
});
|
|
6170
6345
|
const files = paths.map((filePath) => ({
|
|
6171
6346
|
filePath,
|
|
6172
|
-
content:
|
|
6347
|
+
content: import_node_fs2.default.readFileSync(filePath, "utf8")
|
|
6173
6348
|
}));
|
|
6174
6349
|
return getIsIgnoredPredicate(files, cwd);
|
|
6175
6350
|
};
|
|
@@ -6214,7 +6389,7 @@ var checkCwdOption = (cwd) => {
|
|
|
6214
6389
|
}
|
|
6215
6390
|
let stat;
|
|
6216
6391
|
try {
|
|
6217
|
-
stat =
|
|
6392
|
+
stat = import_node_fs3.default.statSync(cwd);
|
|
6218
6393
|
} catch {
|
|
6219
6394
|
return;
|
|
6220
6395
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lage-run/globby",
|
|
3
|
-
"version": "14.2.
|
|
3
|
+
"version": "14.2.2",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"transpile": "esbuild src/index.mts --bundle --platform=node --target=node14 --format=cjs --outfile=lib/index.js",
|
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
},
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"devDependencies": {
|
|
11
|
+
"@lage-run/monorepo-scripts": "^1.0.0",
|
|
11
12
|
"dts-bundle-generator": "^9.5.1",
|
|
12
|
-
"esbuild": "^0.
|
|
13
|
+
"esbuild": "^0.25.0",
|
|
13
14
|
"globby": "^14.0.2",
|
|
14
|
-
"typescript": "~5.
|
|
15
|
+
"typescript": "~5.9.3"
|
|
15
16
|
},
|
|
16
17
|
"exports": {
|
|
17
18
|
".": {
|
package/tsconfig.json
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"outDir": "./lib",
|
|
5
5
|
"emitDeclarationOnly": true,
|
|
6
|
-
"module": "Node16"
|
|
6
|
+
"module": "Node16",
|
|
7
|
+
"moduleResolution": "Node16",
|
|
8
|
+
"lib": ["ES2020"]
|
|
7
9
|
},
|
|
8
|
-
"files": [],
|
|
9
10
|
"include": ["src/index.mts"],
|
|
10
11
|
"exclude": ["lib/**/*.mts"]
|
|
11
12
|
}
|