heading-case 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +442 -191
- package/package.json +21 -17
- package/dist/rslib-runtime.js +0 -38
package/dist/index.js
CHANGED
|
@@ -1,13 +1,51 @@
|
|
|
1
|
-
import * as __rspack_external_fs from "fs";
|
|
2
|
-
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
3
1
|
import { execFileSync } from "node:child_process";
|
|
4
2
|
import node_fs from "node:fs";
|
|
3
|
+
import node_util from "node:util";
|
|
5
4
|
import node_process from "node:process";
|
|
6
5
|
import node_os from "node:os";
|
|
7
6
|
import node_tty from "node:tty";
|
|
8
|
-
import
|
|
7
|
+
import * as __rspack_external_fs from "fs";
|
|
8
|
+
import { readdir, readdirSync, realpath, realpathSync, stat as external_fs_stat, statSync } from "fs";
|
|
9
|
+
import { basename, dirname, isAbsolute, normalize, posix, relative as external_path_relative, resolve, sep } from "path";
|
|
9
10
|
import { fileURLToPath } from "url";
|
|
10
11
|
import { createRequire } from "module";
|
|
12
|
+
var __webpack_modules__ = {};
|
|
13
|
+
var __webpack_module_cache__ = {};
|
|
14
|
+
function __webpack_require__(moduleId) {
|
|
15
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
16
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
17
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
18
|
+
exports: {}
|
|
19
|
+
};
|
|
20
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
21
|
+
return module.exports;
|
|
22
|
+
}
|
|
23
|
+
__webpack_require__.m = __webpack_modules__;
|
|
24
|
+
(()=>{
|
|
25
|
+
__webpack_require__.n = (module)=>{
|
|
26
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
27
|
+
__webpack_require__.d(getter, {
|
|
28
|
+
a: getter
|
|
29
|
+
});
|
|
30
|
+
return getter;
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
33
|
+
(()=>{
|
|
34
|
+
__webpack_require__.d = (exports, definition)=>{
|
|
35
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: definition[key]
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
(()=>{
|
|
42
|
+
__webpack_require__.add = function(modules) {
|
|
43
|
+
Object.assign(__webpack_require__.m, modules);
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
(()=>{
|
|
47
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
48
|
+
})();
|
|
11
49
|
__webpack_require__.add({
|
|
12
50
|
"./node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js" (module) {
|
|
13
51
|
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
@@ -75,9 +113,9 @@ __webpack_require__.add({
|
|
|
75
113
|
module.exports = createColors();
|
|
76
114
|
module.exports.createColors = createColors;
|
|
77
115
|
},
|
|
78
|
-
"./node_modules/.pnpm/picomatch@4.0.
|
|
79
|
-
const pico = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.
|
|
80
|
-
const utils = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.
|
|
116
|
+
"./node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
117
|
+
const pico = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/picomatch.js");
|
|
118
|
+
const utils = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js");
|
|
81
119
|
function picomatch(glob, options, returnState = false) {
|
|
82
120
|
if (options && (null === options.windows || void 0 === options.windows)) options = {
|
|
83
121
|
...options,
|
|
@@ -88,9 +126,10 @@ __webpack_require__.add({
|
|
|
88
126
|
Object.assign(picomatch, pico);
|
|
89
127
|
module.exports = picomatch;
|
|
90
128
|
},
|
|
91
|
-
"./node_modules/.pnpm/picomatch@4.0.
|
|
129
|
+
"./node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js" (module) {
|
|
92
130
|
const WIN_SLASH = '\\\\/';
|
|
93
131
|
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
132
|
+
const DEFAULT_MAX_EXTGLOB_RECURSION = 0;
|
|
94
133
|
const DOT_LITERAL = '\\.';
|
|
95
134
|
const PLUS_LITERAL = '\\+';
|
|
96
135
|
const QMARK_LITERAL = '\\?';
|
|
@@ -141,6 +180,7 @@ __webpack_require__.add({
|
|
|
141
180
|
SEP: '\\'
|
|
142
181
|
};
|
|
143
182
|
const POSIX_REGEX_SOURCE = {
|
|
183
|
+
__proto__: null,
|
|
144
184
|
alnum: 'a-zA-Z0-9',
|
|
145
185
|
alpha: 'a-zA-Z',
|
|
146
186
|
ascii: '\\x00-\\x7F',
|
|
@@ -157,6 +197,7 @@ __webpack_require__.add({
|
|
|
157
197
|
xdigit: 'A-Fa-f0-9'
|
|
158
198
|
};
|
|
159
199
|
module.exports = {
|
|
200
|
+
DEFAULT_MAX_EXTGLOB_RECURSION,
|
|
160
201
|
MAX_LENGTH: 65536,
|
|
161
202
|
POSIX_REGEX_SOURCE,
|
|
162
203
|
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
@@ -248,9 +289,9 @@ __webpack_require__.add({
|
|
|
248
289
|
}
|
|
249
290
|
};
|
|
250
291
|
},
|
|
251
|
-
"./node_modules/.pnpm/picomatch@4.0.
|
|
252
|
-
const constants = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.
|
|
253
|
-
const utils = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.
|
|
292
|
+
"./node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/parse.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
293
|
+
const constants = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js");
|
|
294
|
+
const utils = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js");
|
|
254
295
|
const { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants;
|
|
255
296
|
const expandRange = (args, options)=>{
|
|
256
297
|
if ('function' == typeof options.expandRange) return options.expandRange(...args, options);
|
|
@@ -264,6 +305,189 @@ __webpack_require__.add({
|
|
|
264
305
|
return value;
|
|
265
306
|
};
|
|
266
307
|
const syntaxError = (type, char)=>`Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
308
|
+
const splitTopLevel = (input)=>{
|
|
309
|
+
const parts = [];
|
|
310
|
+
let bracket = 0;
|
|
311
|
+
let paren = 0;
|
|
312
|
+
let quote = 0;
|
|
313
|
+
let value = '';
|
|
314
|
+
let escaped = false;
|
|
315
|
+
for (const ch of input){
|
|
316
|
+
if (true === escaped) {
|
|
317
|
+
value += ch;
|
|
318
|
+
escaped = false;
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
if ('\\' === ch) {
|
|
322
|
+
value += ch;
|
|
323
|
+
escaped = true;
|
|
324
|
+
continue;
|
|
325
|
+
}
|
|
326
|
+
if ('"' === ch) {
|
|
327
|
+
quote = 1 === quote ? 0 : 1;
|
|
328
|
+
value += ch;
|
|
329
|
+
continue;
|
|
330
|
+
}
|
|
331
|
+
if (0 === quote) {
|
|
332
|
+
if ('[' === ch) bracket++;
|
|
333
|
+
else if (']' === ch && bracket > 0) bracket--;
|
|
334
|
+
else if (0 === bracket) {
|
|
335
|
+
if ('(' === ch) paren++;
|
|
336
|
+
else if (')' === ch && paren > 0) paren--;
|
|
337
|
+
else if ('|' === ch && 0 === paren) {
|
|
338
|
+
parts.push(value);
|
|
339
|
+
value = '';
|
|
340
|
+
continue;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
value += ch;
|
|
345
|
+
}
|
|
346
|
+
parts.push(value);
|
|
347
|
+
return parts;
|
|
348
|
+
};
|
|
349
|
+
const isPlainBranch = (branch)=>{
|
|
350
|
+
let escaped = false;
|
|
351
|
+
for (const ch of branch){
|
|
352
|
+
if (true === escaped) {
|
|
353
|
+
escaped = false;
|
|
354
|
+
continue;
|
|
355
|
+
}
|
|
356
|
+
if ('\\' === ch) {
|
|
357
|
+
escaped = true;
|
|
358
|
+
continue;
|
|
359
|
+
}
|
|
360
|
+
if (/[?*+@!()[\]{}]/.test(ch)) return false;
|
|
361
|
+
}
|
|
362
|
+
return true;
|
|
363
|
+
};
|
|
364
|
+
const normalizeSimpleBranch = (branch)=>{
|
|
365
|
+
let value = branch.trim();
|
|
366
|
+
let changed = true;
|
|
367
|
+
while(true === changed){
|
|
368
|
+
changed = false;
|
|
369
|
+
if (/^@\([^\\()[\]{}|]+\)$/.test(value)) {
|
|
370
|
+
value = value.slice(2, -1);
|
|
371
|
+
changed = true;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
if (!isPlainBranch(value)) return;
|
|
375
|
+
return value.replace(/\\(.)/g, '$1');
|
|
376
|
+
};
|
|
377
|
+
const hasRepeatedCharPrefixOverlap = (branches)=>{
|
|
378
|
+
const values = branches.map(normalizeSimpleBranch).filter(Boolean);
|
|
379
|
+
for(let i = 0; i < values.length; i++)for(let j = i + 1; j < values.length; j++){
|
|
380
|
+
const a = values[i];
|
|
381
|
+
const b = values[j];
|
|
382
|
+
const char = a[0];
|
|
383
|
+
if (char && a === char.repeat(a.length) && b === char.repeat(b.length)) {
|
|
384
|
+
if (a === b || a.startsWith(b) || b.startsWith(a)) return true;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
return false;
|
|
388
|
+
};
|
|
389
|
+
const parseRepeatedExtglob = (pattern, requireEnd = true)=>{
|
|
390
|
+
if ('+' !== pattern[0] && '*' !== pattern[0] || '(' !== pattern[1]) return;
|
|
391
|
+
let bracket = 0;
|
|
392
|
+
let paren = 0;
|
|
393
|
+
let quote = 0;
|
|
394
|
+
let escaped = false;
|
|
395
|
+
for(let i = 1; i < pattern.length; i++){
|
|
396
|
+
const ch = pattern[i];
|
|
397
|
+
if (true === escaped) {
|
|
398
|
+
escaped = false;
|
|
399
|
+
continue;
|
|
400
|
+
}
|
|
401
|
+
if ('\\' === ch) {
|
|
402
|
+
escaped = true;
|
|
403
|
+
continue;
|
|
404
|
+
}
|
|
405
|
+
if ('"' === ch) {
|
|
406
|
+
quote = 1 === quote ? 0 : 1;
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
if (1 !== quote) {
|
|
410
|
+
if ('[' === ch) {
|
|
411
|
+
bracket++;
|
|
412
|
+
continue;
|
|
413
|
+
}
|
|
414
|
+
if (']' === ch && bracket > 0) {
|
|
415
|
+
bracket--;
|
|
416
|
+
continue;
|
|
417
|
+
}
|
|
418
|
+
if (!(bracket > 0)) {
|
|
419
|
+
if ('(' === ch) {
|
|
420
|
+
paren++;
|
|
421
|
+
continue;
|
|
422
|
+
}
|
|
423
|
+
if (')' === ch) {
|
|
424
|
+
paren--;
|
|
425
|
+
if (0 === paren) {
|
|
426
|
+
if (true === requireEnd && i !== pattern.length - 1) return;
|
|
427
|
+
return {
|
|
428
|
+
type: pattern[0],
|
|
429
|
+
body: pattern.slice(2, i),
|
|
430
|
+
end: i
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
const getStarExtglobSequenceOutput = (pattern)=>{
|
|
439
|
+
let index = 0;
|
|
440
|
+
const chars = [];
|
|
441
|
+
while(index < pattern.length){
|
|
442
|
+
const match = parseRepeatedExtglob(pattern.slice(index), false);
|
|
443
|
+
if (!match || '*' !== match.type) return;
|
|
444
|
+
const branches = splitTopLevel(match.body).map((branch)=>branch.trim());
|
|
445
|
+
if (1 !== branches.length) return;
|
|
446
|
+
const branch = normalizeSimpleBranch(branches[0]);
|
|
447
|
+
if (!branch || 1 !== branch.length) return;
|
|
448
|
+
chars.push(branch);
|
|
449
|
+
index += match.end + 1;
|
|
450
|
+
}
|
|
451
|
+
if (chars.length < 1) return;
|
|
452
|
+
const source = 1 === chars.length ? utils.escapeRegex(chars[0]) : `[${chars.map((ch)=>utils.escapeRegex(ch)).join('')}]`;
|
|
453
|
+
return `${source}*`;
|
|
454
|
+
};
|
|
455
|
+
const repeatedExtglobRecursion = (pattern)=>{
|
|
456
|
+
let depth = 0;
|
|
457
|
+
let value = pattern.trim();
|
|
458
|
+
let match = parseRepeatedExtglob(value);
|
|
459
|
+
while(match){
|
|
460
|
+
depth++;
|
|
461
|
+
value = match.body.trim();
|
|
462
|
+
match = parseRepeatedExtglob(value);
|
|
463
|
+
}
|
|
464
|
+
return depth;
|
|
465
|
+
};
|
|
466
|
+
const analyzeRepeatedExtglob = (body, options)=>{
|
|
467
|
+
if (false === options.maxExtglobRecursion) return {
|
|
468
|
+
risky: false
|
|
469
|
+
};
|
|
470
|
+
const max = 'number' == typeof options.maxExtglobRecursion ? options.maxExtglobRecursion : constants.DEFAULT_MAX_EXTGLOB_RECURSION;
|
|
471
|
+
const branches = splitTopLevel(body).map((branch)=>branch.trim());
|
|
472
|
+
if (branches.length > 1) {
|
|
473
|
+
if (branches.some((branch)=>'' === branch) || branches.some((branch)=>/^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) return {
|
|
474
|
+
risky: true
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
for (const branch of branches){
|
|
478
|
+
const safeOutput = getStarExtglobSequenceOutput(branch);
|
|
479
|
+
if (safeOutput) return {
|
|
480
|
+
risky: true,
|
|
481
|
+
safeOutput
|
|
482
|
+
};
|
|
483
|
+
if (repeatedExtglobRecursion(branch) > max) return {
|
|
484
|
+
risky: true
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
return {
|
|
488
|
+
risky: false
|
|
489
|
+
};
|
|
490
|
+
};
|
|
267
491
|
const parse = (input, options)=>{
|
|
268
492
|
if ('string' != typeof input) throw new TypeError('Expected a string');
|
|
269
493
|
input = REPLACEMENTS[input] || input;
|
|
@@ -379,6 +603,8 @@ __webpack_require__.add({
|
|
|
379
603
|
token.prev = prev;
|
|
380
604
|
token.parens = state.parens;
|
|
381
605
|
token.output = state.output;
|
|
606
|
+
token.startIndex = state.index;
|
|
607
|
+
token.tokensIndex = tokens.length;
|
|
382
608
|
const output = (opts.capture ? '(' : '') + token.open;
|
|
383
609
|
increment('parens');
|
|
384
610
|
push({
|
|
@@ -395,6 +621,31 @@ __webpack_require__.add({
|
|
|
395
621
|
extglobs.push(token);
|
|
396
622
|
};
|
|
397
623
|
const extglobClose = (token)=>{
|
|
624
|
+
const literal = input.slice(token.startIndex, state.index + 1);
|
|
625
|
+
const body = input.slice(token.startIndex + 2, state.index);
|
|
626
|
+
const analysis = analyzeRepeatedExtglob(body, opts);
|
|
627
|
+
if (('plus' === token.type || 'star' === token.type) && analysis.risky) {
|
|
628
|
+
const safeOutput = analysis.safeOutput ? (token.output ? '' : ONE_CHAR) + (opts.capture ? `(${analysis.safeOutput})` : analysis.safeOutput) : void 0;
|
|
629
|
+
const open = tokens[token.tokensIndex];
|
|
630
|
+
open.type = 'text';
|
|
631
|
+
open.value = literal;
|
|
632
|
+
open.output = safeOutput || utils.escapeRegex(literal);
|
|
633
|
+
for(let i = token.tokensIndex + 1; i < tokens.length; i++){
|
|
634
|
+
tokens[i].value = '';
|
|
635
|
+
tokens[i].output = '';
|
|
636
|
+
delete tokens[i].suffix;
|
|
637
|
+
}
|
|
638
|
+
state.output = token.output + open.output;
|
|
639
|
+
state.backtrack = true;
|
|
640
|
+
push({
|
|
641
|
+
type: 'paren',
|
|
642
|
+
extglob: true,
|
|
643
|
+
value,
|
|
644
|
+
output: ''
|
|
645
|
+
});
|
|
646
|
+
decrement('parens');
|
|
647
|
+
return;
|
|
648
|
+
}
|
|
398
649
|
let output = token.close + (opts.capture ? ')' : '');
|
|
399
650
|
let rest;
|
|
400
651
|
if ('negate' === token.type) {
|
|
@@ -1036,11 +1287,11 @@ __webpack_require__.add({
|
|
|
1036
1287
|
};
|
|
1037
1288
|
module.exports = parse;
|
|
1038
1289
|
},
|
|
1039
|
-
"./node_modules/.pnpm/picomatch@4.0.
|
|
1040
|
-
const scan = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.
|
|
1041
|
-
const parse = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.
|
|
1042
|
-
const utils = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.
|
|
1043
|
-
const constants = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.
|
|
1290
|
+
"./node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/picomatch.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
1291
|
+
const scan = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/scan.js");
|
|
1292
|
+
const parse = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/parse.js");
|
|
1293
|
+
const utils = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js");
|
|
1294
|
+
const constants = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js");
|
|
1044
1295
|
const isObject = (val)=>val && 'object' == typeof val && !Array.isArray(val);
|
|
1045
1296
|
const picomatch = (glob, options, returnState = false)=>{
|
|
1046
1297
|
if (Array.isArray(glob)) {
|
|
@@ -1169,9 +1420,9 @@ __webpack_require__.add({
|
|
|
1169
1420
|
picomatch.constants = constants;
|
|
1170
1421
|
module.exports = picomatch;
|
|
1171
1422
|
},
|
|
1172
|
-
"./node_modules/.pnpm/picomatch@4.0.
|
|
1173
|
-
const utils = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.
|
|
1174
|
-
const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.
|
|
1423
|
+
"./node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/scan.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
1424
|
+
const utils = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js");
|
|
1425
|
+
const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js");
|
|
1175
1426
|
const isPathSeparator = (code)=>code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
|
1176
1427
|
const depth = (token)=>{
|
|
1177
1428
|
if (true !== token.isPrefix) token.depth = token.isGlobstar ? 1 / 0 : 1;
|
|
@@ -1437,8 +1688,8 @@ __webpack_require__.add({
|
|
|
1437
1688
|
};
|
|
1438
1689
|
module.exports = scan;
|
|
1439
1690
|
},
|
|
1440
|
-
"./node_modules/.pnpm/picomatch@4.0.
|
|
1441
|
-
const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.
|
|
1691
|
+
"./node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/utils.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
1692
|
+
const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/lib/constants.js");
|
|
1442
1693
|
exports.isObject = (val)=>null !== val && 'object' == typeof val && !Array.isArray(val);
|
|
1443
1694
|
exports.hasRegexChars = (str)=>REGEX_SPECIAL_CHARS.test(str);
|
|
1444
1695
|
exports.isRegexChar = (str)=>1 === str.length && exports.hasRegexChars(str);
|
|
@@ -1482,6 +1733,29 @@ __webpack_require__.add({
|
|
|
1482
1733
|
};
|
|
1483
1734
|
}
|
|
1484
1735
|
});
|
|
1736
|
+
function checkNodeVersion() {
|
|
1737
|
+
const { versions } = process;
|
|
1738
|
+
if ("styleText" in node_util || !versions.node || versions.bun || versions.deno) return;
|
|
1739
|
+
throw new Error(`Unsupported Node.js version: "${process.versions.node || 'unknown'}". Expected Node.js >= 20.`);
|
|
1740
|
+
}
|
|
1741
|
+
checkNodeVersion();
|
|
1742
|
+
const createStyler = (style)=>(text)=>node_util.styleText(style, String(text));
|
|
1743
|
+
const color = {
|
|
1744
|
+
dim: createStyler('dim'),
|
|
1745
|
+
red: createStyler('red'),
|
|
1746
|
+
bold: createStyler('bold'),
|
|
1747
|
+
blue: createStyler('blue'),
|
|
1748
|
+
cyan: createStyler('cyan'),
|
|
1749
|
+
gray: createStyler('gray'),
|
|
1750
|
+
black: createStyler('black'),
|
|
1751
|
+
green: createStyler('green'),
|
|
1752
|
+
white: createStyler('white'),
|
|
1753
|
+
reset: createStyler('reset'),
|
|
1754
|
+
yellow: createStyler('yellow'),
|
|
1755
|
+
magenta: createStyler('magenta'),
|
|
1756
|
+
underline: createStyler('underline'),
|
|
1757
|
+
strikethrough: createStyler('strikethrough')
|
|
1758
|
+
};
|
|
1485
1759
|
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : node_process.argv) {
|
|
1486
1760
|
const prefix = flag.startsWith('-') ? '' : 1 === flag.length ? '-' : '--';
|
|
1487
1761
|
const position = argv.indexOf(prefix + flag);
|
|
@@ -1588,24 +1862,6 @@ let errorStackRegExp = /at [^\r\n]{0,200}:\d+:\d+[\s\)]*$/;
|
|
|
1588
1862
|
let anonymousErrorStackRegExp = /at [^\r\n]{0,200}\(<anonymous>\)$/;
|
|
1589
1863
|
let indexErrorStackRegExp = /at [^\r\n]{0,200}\(index\s\d+\)$/;
|
|
1590
1864
|
let isErrorStackMessage = (message)=>errorStackRegExp.test(message) || anonymousErrorStackRegExp.test(message) || indexErrorStackRegExp.test(message);
|
|
1591
|
-
let formatter = (open, close, replace = open)=>colorLevel >= 2 ? (input)=>{
|
|
1592
|
-
let string = '' + input;
|
|
1593
|
-
let index = string.indexOf(close, open.length);
|
|
1594
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
1595
|
-
} : String;
|
|
1596
|
-
let replaceClose = (string, close, replace, index)=>{
|
|
1597
|
-
let start = string.substring(0, index) + replace;
|
|
1598
|
-
let end = string.substring(index + close.length);
|
|
1599
|
-
let nextIndex = end.indexOf(close);
|
|
1600
|
-
return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;
|
|
1601
|
-
};
|
|
1602
|
-
const bold = formatter('\x1b[1m', '\x1b[22m', '\x1b[22m\x1b[1m');
|
|
1603
|
-
const red = formatter('\x1b[31m', '\x1b[39m');
|
|
1604
|
-
const green = formatter('\x1b[32m', '\x1b[39m');
|
|
1605
|
-
const yellow = formatter('\x1b[33m', '\x1b[39m');
|
|
1606
|
-
const magenta = formatter('\x1b[35m', '\x1b[39m');
|
|
1607
|
-
const cyan = formatter('\x1b[36m', '\x1b[39m');
|
|
1608
|
-
const gray = formatter('\x1b[90m', '\x1b[39m');
|
|
1609
1865
|
let startColor = [
|
|
1610
1866
|
189,
|
|
1611
1867
|
255,
|
|
@@ -1618,7 +1874,7 @@ let endColor = [
|
|
|
1618
1874
|
];
|
|
1619
1875
|
let isWord = (char)=>!/[\s\n]/.test(char);
|
|
1620
1876
|
let gradient = (message)=>{
|
|
1621
|
-
if (colorLevel < 3) return 2 === colorLevel ?
|
|
1877
|
+
if (colorLevel < 3) return 2 === colorLevel ? color.cyan(message) : message;
|
|
1622
1878
|
let chars = [
|
|
1623
1879
|
...message
|
|
1624
1880
|
];
|
|
@@ -1638,7 +1894,7 @@ let gradient = (message)=>{
|
|
|
1638
1894
|
}
|
|
1639
1895
|
output += `\x1b[38;2;${Math.round(r)};${Math.round(g)};${Math.round(b)}m${char}\x1b[39m`;
|
|
1640
1896
|
}
|
|
1641
|
-
return bold(output);
|
|
1897
|
+
return color.bold(output);
|
|
1642
1898
|
};
|
|
1643
1899
|
let LOG_LEVEL = {
|
|
1644
1900
|
silent: -1,
|
|
@@ -1652,32 +1908,32 @@ let LOG_TYPES = {
|
|
|
1652
1908
|
error: {
|
|
1653
1909
|
label: 'error',
|
|
1654
1910
|
level: 'error',
|
|
1655
|
-
color: red
|
|
1911
|
+
color: color.red
|
|
1656
1912
|
},
|
|
1657
1913
|
warn: {
|
|
1658
1914
|
label: 'warn',
|
|
1659
1915
|
level: 'warn',
|
|
1660
|
-
color: yellow
|
|
1916
|
+
color: color.yellow
|
|
1661
1917
|
},
|
|
1662
1918
|
info: {
|
|
1663
1919
|
label: 'info',
|
|
1664
1920
|
level: 'info',
|
|
1665
|
-
color: cyan
|
|
1921
|
+
color: color.cyan
|
|
1666
1922
|
},
|
|
1667
1923
|
start: {
|
|
1668
1924
|
label: 'start',
|
|
1669
1925
|
level: 'info',
|
|
1670
|
-
color: cyan
|
|
1926
|
+
color: color.cyan
|
|
1671
1927
|
},
|
|
1672
1928
|
ready: {
|
|
1673
1929
|
label: 'ready',
|
|
1674
1930
|
level: 'info',
|
|
1675
|
-
color: green
|
|
1931
|
+
color: color.green
|
|
1676
1932
|
},
|
|
1677
1933
|
success: {
|
|
1678
1934
|
label: 'success',
|
|
1679
1935
|
level: 'info',
|
|
1680
|
-
color: green
|
|
1936
|
+
color: color.green
|
|
1681
1937
|
},
|
|
1682
1938
|
log: {
|
|
1683
1939
|
level: 'info'
|
|
@@ -1685,43 +1941,45 @@ let LOG_TYPES = {
|
|
|
1685
1941
|
debug: {
|
|
1686
1942
|
label: 'debug',
|
|
1687
1943
|
level: 'verbose',
|
|
1688
|
-
color: magenta
|
|
1944
|
+
color: color.magenta
|
|
1689
1945
|
}
|
|
1690
1946
|
};
|
|
1691
1947
|
const normalizeErrorMessage = (err)=>{
|
|
1692
1948
|
if (err.stack) {
|
|
1693
1949
|
let [name, ...rest] = err.stack.split('\n');
|
|
1694
1950
|
if (name.startsWith('Error: ')) name = name.slice(7);
|
|
1695
|
-
return `${name}\n${gray(rest.join('\n'))}`;
|
|
1951
|
+
return `${name}\n${color.gray(rest.join('\n'))}`;
|
|
1696
1952
|
}
|
|
1697
1953
|
return err.message;
|
|
1698
1954
|
};
|
|
1699
1955
|
let createLogger = (options = {})=>{
|
|
1700
|
-
|
|
1956
|
+
const { level = 'info', prefix, console: console1 = globalThis.console } = options;
|
|
1957
|
+
let maxLevel = level;
|
|
1701
1958
|
let log = (type, message, ...args)=>{
|
|
1702
1959
|
let logType = LOG_TYPES[type];
|
|
1703
1960
|
const { level } = logType;
|
|
1704
1961
|
if (LOG_LEVEL[level] > LOG_LEVEL[maxLevel]) return;
|
|
1705
|
-
if (null == message) return
|
|
1962
|
+
if (null == message) return console1.log();
|
|
1706
1963
|
let label = '';
|
|
1707
1964
|
let text = '';
|
|
1708
1965
|
if ('label' in logType) {
|
|
1709
1966
|
label = (logType.label || '').padEnd(7);
|
|
1710
|
-
label = bold(logType.color ? logType.color(label) : label);
|
|
1967
|
+
label = color.bold(logType.color ? logType.color(label) : label);
|
|
1711
1968
|
}
|
|
1712
1969
|
if (message instanceof Error) {
|
|
1713
1970
|
text += normalizeErrorMessage(message);
|
|
1714
1971
|
const { cause } = message;
|
|
1715
1972
|
if (cause) {
|
|
1716
|
-
text += yellow('\n [cause]: ');
|
|
1973
|
+
text += color.yellow('\n [cause]: ');
|
|
1717
1974
|
text += cause instanceof Error ? normalizeErrorMessage(cause) : String(cause);
|
|
1718
1975
|
}
|
|
1719
1976
|
} else if ('error' === level && 'string' == typeof message) {
|
|
1720
1977
|
let lines = message.split('\n');
|
|
1721
|
-
text = lines.map((line)=>isErrorStackMessage(line) ? gray(line) : line).join('\n');
|
|
1978
|
+
text = lines.map((line)=>isErrorStackMessage(line) ? color.gray(line) : line).join('\n');
|
|
1722
1979
|
} else text = `${message}`;
|
|
1980
|
+
if (prefix) text = `${prefix} ${text}`;
|
|
1723
1981
|
const method = 'error' === level || 'warn' === level ? level : 'log';
|
|
1724
|
-
|
|
1982
|
+
console1[method](label.length ? `${label} ${text}` : text, ...args);
|
|
1725
1983
|
};
|
|
1726
1984
|
let logger = {
|
|
1727
1985
|
greet: (message)=>log('log', gradient(message))
|
|
@@ -1735,6 +1993,11 @@ let createLogger = (options = {})=>{
|
|
|
1735
1993
|
maxLevel = val;
|
|
1736
1994
|
}
|
|
1737
1995
|
});
|
|
1996
|
+
Object.defineProperty(logger, 'options', {
|
|
1997
|
+
get: ()=>({
|
|
1998
|
+
...options
|
|
1999
|
+
})
|
|
2000
|
+
});
|
|
1738
2001
|
logger.override = (customLogger)=>{
|
|
1739
2002
|
Object.assign(logger, customLogger);
|
|
1740
2003
|
};
|
|
@@ -2226,38 +2489,38 @@ var Builder = class {
|
|
|
2226
2489
|
return this;
|
|
2227
2490
|
}
|
|
2228
2491
|
};
|
|
2229
|
-
const picomatch = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.
|
|
2492
|
+
const picomatch = __webpack_require__("./node_modules/.pnpm/picomatch@4.0.4/node_modules/picomatch/index.js");
|
|
2230
2493
|
const isReadonlyArray = Array.isArray;
|
|
2494
|
+
const BACKSLASHES = /\\/g;
|
|
2231
2495
|
const isWin = "win32" === process.platform;
|
|
2232
2496
|
const ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
|
|
2233
2497
|
function getPartialMatcher(patterns, options = {}) {
|
|
2234
2498
|
const patternsCount = patterns.length;
|
|
2235
2499
|
const patternsParts = Array(patternsCount);
|
|
2236
2500
|
const matchers = Array(patternsCount);
|
|
2237
|
-
|
|
2238
|
-
for(
|
|
2501
|
+
let i, j;
|
|
2502
|
+
for(i = 0; i < patternsCount; i++){
|
|
2239
2503
|
const parts = splitPattern(patterns[i]);
|
|
2240
2504
|
patternsParts[i] = parts;
|
|
2241
2505
|
const partsCount = parts.length;
|
|
2242
2506
|
const partMatchers = Array(partsCount);
|
|
2243
|
-
for(
|
|
2507
|
+
for(j = 0; j < partsCount; j++)partMatchers[j] = picomatch(parts[j], options);
|
|
2244
2508
|
matchers[i] = partMatchers;
|
|
2245
2509
|
}
|
|
2246
2510
|
return (input)=>{
|
|
2247
2511
|
const inputParts = input.split("/");
|
|
2248
2512
|
if (".." === inputParts[0] && ONLY_PARENT_DIRECTORIES.test(input)) return true;
|
|
2249
|
-
for(
|
|
2513
|
+
for(i = 0; i < patternsCount; i++){
|
|
2250
2514
|
const patternParts = patternsParts[i];
|
|
2251
2515
|
const matcher = matchers[i];
|
|
2252
2516
|
const inputPatternCount = inputParts.length;
|
|
2253
2517
|
const minParts = Math.min(inputPatternCount, patternParts.length);
|
|
2254
|
-
|
|
2518
|
+
j = 0;
|
|
2255
2519
|
while(j < minParts){
|
|
2256
2520
|
const part = patternParts[j];
|
|
2257
2521
|
if (part.includes("/")) return true;
|
|
2258
|
-
|
|
2259
|
-
if (!
|
|
2260
|
-
if (globstarEnabled && "**" === part) return true;
|
|
2522
|
+
if (!matcher[j](inputParts[j])) break;
|
|
2523
|
+
if (!options.noglobstar && "**" === part) return true;
|
|
2261
2524
|
j++;
|
|
2262
2525
|
}
|
|
2263
2526
|
if (j === inputPatternCount) return true;
|
|
@@ -2270,7 +2533,7 @@ const isRoot = isWin ? (p)=>WIN32_ROOT_DIR.test(p) : (p)=>"/" === p;
|
|
|
2270
2533
|
function buildFormat(cwd, root, absolute) {
|
|
2271
2534
|
if (cwd === root || root.startsWith(`${cwd}/`)) {
|
|
2272
2535
|
if (absolute) {
|
|
2273
|
-
const start =
|
|
2536
|
+
const start = cwd.length + +!isRoot(cwd);
|
|
2274
2537
|
return (p, isDir)=>p.slice(start, isDir ? -1 : void 0) || ".";
|
|
2275
2538
|
}
|
|
2276
2539
|
const prefix = root.slice(cwd.length + 1);
|
|
@@ -2291,24 +2554,23 @@ function buildRelative(cwd, root) {
|
|
|
2291
2554
|
}
|
|
2292
2555
|
return (p)=>{
|
|
2293
2556
|
const result = posix.relative(cwd, `${root}/${p}`);
|
|
2294
|
-
|
|
2295
|
-
return result || ".";
|
|
2557
|
+
return "/" === p[p.length - 1] && "" !== result ? `${result}/` : result || ".";
|
|
2296
2558
|
};
|
|
2297
2559
|
}
|
|
2298
2560
|
const splitPatternOptions = {
|
|
2299
2561
|
parts: true
|
|
2300
2562
|
};
|
|
2301
|
-
function splitPattern(path
|
|
2563
|
+
function splitPattern(path) {
|
|
2302
2564
|
var _result$parts;
|
|
2303
|
-
const result = picomatch.scan(path
|
|
2565
|
+
const result = picomatch.scan(path, splitPatternOptions);
|
|
2304
2566
|
return (null == (_result$parts = result.parts) ? void 0 : _result$parts.length) ? result.parts : [
|
|
2305
|
-
path
|
|
2567
|
+
path
|
|
2306
2568
|
];
|
|
2307
2569
|
}
|
|
2308
2570
|
const POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g;
|
|
2309
2571
|
const WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g;
|
|
2310
|
-
const escapePosixPath = (path
|
|
2311
|
-
const escapeWin32Path = (path
|
|
2572
|
+
const escapePosixPath = (path)=>path.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
2573
|
+
const escapeWin32Path = (path)=>path.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
2312
2574
|
const escapePath = isWin ? escapeWin32Path : escapePosixPath;
|
|
2313
2575
|
function isDynamicPattern(pattern, options) {
|
|
2314
2576
|
if ((null == options ? void 0 : options.caseSensitiveMatch) === false) return true;
|
|
@@ -2318,27 +2580,33 @@ function isDynamicPattern(pattern, options) {
|
|
|
2318
2580
|
function dist_log(...tasks) {
|
|
2319
2581
|
console.log(`[tinyglobby ${/* @__PURE__ */ new Date().toLocaleTimeString("es")}]`, ...tasks);
|
|
2320
2582
|
}
|
|
2583
|
+
function ensureStringArray(value) {
|
|
2584
|
+
return "string" == typeof value ? [
|
|
2585
|
+
value
|
|
2586
|
+
] : null != value ? value : [];
|
|
2587
|
+
}
|
|
2321
2588
|
const PARENT_DIRECTORY = /^(\/?\.\.)+/;
|
|
2322
2589
|
const ESCAPING_BACKSLASHES = /\\(?=[()[\]{}!*+?@|])/g;
|
|
2323
|
-
|
|
2324
|
-
|
|
2590
|
+
function normalizePattern(pattern, opts, props, isIgnore) {
|
|
2591
|
+
var _PARENT_DIRECTORY$exe;
|
|
2592
|
+
const cwd = opts.cwd;
|
|
2325
2593
|
let result = pattern;
|
|
2326
|
-
if (
|
|
2327
|
-
if (
|
|
2594
|
+
if ("/" === pattern[pattern.length - 1]) result = pattern.slice(0, -1);
|
|
2595
|
+
if ("*" !== result[result.length - 1] && opts.expandDirectories) result += "/**";
|
|
2328
2596
|
const escapedCwd = escapePath(cwd);
|
|
2329
|
-
result =
|
|
2330
|
-
const
|
|
2597
|
+
result = isAbsolute(result.replace(ESCAPING_BACKSLASHES, "")) ? posix.relative(escapedCwd, result) : posix.normalize(result);
|
|
2598
|
+
const parentDir = null == (_PARENT_DIRECTORY$exe = PARENT_DIRECTORY.exec(result)) ? void 0 : _PARENT_DIRECTORY$exe[0];
|
|
2331
2599
|
const parts = splitPattern(result);
|
|
2332
|
-
if (
|
|
2333
|
-
const n = (
|
|
2600
|
+
if (parentDir) {
|
|
2601
|
+
const n = (parentDir.length + 1) / 3;
|
|
2334
2602
|
let i = 0;
|
|
2335
2603
|
const cwdParts = escapedCwd.split("/");
|
|
2336
2604
|
while(i < n && parts[i + n] === cwdParts[cwdParts.length + i - n]){
|
|
2337
2605
|
result = result.slice(0, (n - i - 1) * 3) + result.slice((n - i) * 3 + parts[i + n].length + 1) || ".";
|
|
2338
2606
|
i++;
|
|
2339
2607
|
}
|
|
2340
|
-
const potentialRoot = posix.join(cwd,
|
|
2341
|
-
if (
|
|
2608
|
+
const potentialRoot = posix.join(cwd, parentDir.slice(3 * i));
|
|
2609
|
+
if ("." !== potentialRoot[0] && props.root.length > potentialRoot.length) {
|
|
2342
2610
|
props.root = potentialRoot;
|
|
2343
2611
|
props.depthOffset = -n + i;
|
|
2344
2612
|
}
|
|
@@ -2353,7 +2621,7 @@ function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
|
|
|
2353
2621
|
newCommonPath.pop();
|
|
2354
2622
|
break;
|
|
2355
2623
|
}
|
|
2356
|
-
if (part !== props.commonPath[i] || isDynamicPattern(part)
|
|
2624
|
+
if (i === parts.length - 1 || part !== props.commonPath[i] || isDynamicPattern(part)) break;
|
|
2357
2625
|
newCommonPath.push(part);
|
|
2358
2626
|
}
|
|
2359
2627
|
props.depthOffset = newCommonPath.length;
|
|
@@ -2362,147 +2630,129 @@ function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
|
|
|
2362
2630
|
}
|
|
2363
2631
|
return result;
|
|
2364
2632
|
}
|
|
2365
|
-
function processPatterns(
|
|
2366
|
-
"**/*"
|
|
2367
|
-
], ignore = [], expandDirectories = true }, cwd, props) {
|
|
2368
|
-
if ("string" == typeof patterns) patterns = [
|
|
2369
|
-
patterns
|
|
2370
|
-
];
|
|
2371
|
-
if ("string" == typeof ignore) ignore = [
|
|
2372
|
-
ignore
|
|
2373
|
-
];
|
|
2633
|
+
function processPatterns(options, patterns, props) {
|
|
2374
2634
|
const matchPatterns = [];
|
|
2375
2635
|
const ignorePatterns = [];
|
|
2376
|
-
for (const pattern of ignore)if (pattern) {
|
|
2377
|
-
if ("!" !== pattern[0] || "(" === pattern[1]) ignorePatterns.push(normalizePattern(pattern,
|
|
2636
|
+
for (const pattern of options.ignore)if (pattern) {
|
|
2637
|
+
if ("!" !== pattern[0] || "(" === pattern[1]) ignorePatterns.push(normalizePattern(pattern, options, props, true));
|
|
2378
2638
|
}
|
|
2379
2639
|
for (const pattern of patterns)if (pattern) {
|
|
2380
|
-
if ("!" !== pattern[0] || "(" === pattern[1]) matchPatterns.push(normalizePattern(pattern,
|
|
2381
|
-
else if ("!" !== pattern[1] || "(" === pattern[2]) ignorePatterns.push(normalizePattern(pattern.slice(1),
|
|
2640
|
+
if ("!" !== pattern[0] || "(" === pattern[1]) matchPatterns.push(normalizePattern(pattern, options, props, false));
|
|
2641
|
+
else if ("!" !== pattern[1] || "(" === pattern[2]) ignorePatterns.push(normalizePattern(pattern.slice(1), options, props, true));
|
|
2382
2642
|
}
|
|
2383
2643
|
return {
|
|
2384
2644
|
match: matchPatterns,
|
|
2385
2645
|
ignore: ignorePatterns
|
|
2386
2646
|
};
|
|
2387
2647
|
}
|
|
2388
|
-
function
|
|
2389
|
-
|
|
2390
|
-
const path$1 = paths[i];
|
|
2391
|
-
paths[i] = relative(path$1);
|
|
2392
|
-
}
|
|
2393
|
-
return paths;
|
|
2394
|
-
}
|
|
2395
|
-
function normalizeCwd(cwd) {
|
|
2396
|
-
if (!cwd) return process.cwd().replace(BACKSLASHES, "/");
|
|
2397
|
-
if (cwd instanceof URL) return fileURLToPath(cwd).replace(BACKSLASHES, "/");
|
|
2398
|
-
return path_0.resolve(cwd).replace(BACKSLASHES, "/");
|
|
2399
|
-
}
|
|
2400
|
-
function getCrawler(patterns, inputOptions = {}) {
|
|
2401
|
-
const options = process.env.TINYGLOBBY_DEBUG ? {
|
|
2402
|
-
...inputOptions,
|
|
2403
|
-
debug: true
|
|
2404
|
-
} : inputOptions;
|
|
2405
|
-
const cwd = normalizeCwd(options.cwd);
|
|
2406
|
-
if (options.debug) dist_log("globbing with:", {
|
|
2407
|
-
patterns,
|
|
2408
|
-
options,
|
|
2409
|
-
cwd
|
|
2410
|
-
});
|
|
2411
|
-
if (Array.isArray(patterns) && 0 === patterns.length) return [
|
|
2412
|
-
{
|
|
2413
|
-
sync: ()=>[],
|
|
2414
|
-
withPromise: async ()=>[]
|
|
2415
|
-
},
|
|
2416
|
-
false
|
|
2417
|
-
];
|
|
2648
|
+
function buildCrawler(options, patterns) {
|
|
2649
|
+
const cwd = options.cwd;
|
|
2418
2650
|
const props = {
|
|
2419
2651
|
root: cwd,
|
|
2420
|
-
commonPath: null,
|
|
2421
2652
|
depthOffset: 0
|
|
2422
2653
|
};
|
|
2423
|
-
const processed = processPatterns(
|
|
2424
|
-
...options,
|
|
2425
|
-
patterns
|
|
2426
|
-
}, cwd, props);
|
|
2654
|
+
const processed = processPatterns(options, patterns, props);
|
|
2427
2655
|
if (options.debug) dist_log("internal processing patterns:", processed);
|
|
2656
|
+
const { absolute, caseSensitiveMatch, debug, dot, followSymbolicLinks, onlyDirectories } = options;
|
|
2657
|
+
const root = props.root.replace(BACKSLASHES, "");
|
|
2428
2658
|
const matchOptions = {
|
|
2429
|
-
dot
|
|
2659
|
+
dot,
|
|
2430
2660
|
nobrace: false === options.braceExpansion,
|
|
2431
|
-
nocase:
|
|
2661
|
+
nocase: !caseSensitiveMatch,
|
|
2432
2662
|
noextglob: false === options.extglob,
|
|
2433
2663
|
noglobstar: false === options.globstar,
|
|
2434
2664
|
posix: true
|
|
2435
2665
|
};
|
|
2436
|
-
const matcher = picomatch(processed.match,
|
|
2437
|
-
...matchOptions,
|
|
2438
|
-
ignore: processed.ignore
|
|
2439
|
-
});
|
|
2666
|
+
const matcher = picomatch(processed.match, matchOptions);
|
|
2440
2667
|
const ignore = picomatch(processed.ignore, matchOptions);
|
|
2441
2668
|
const partialMatcher = getPartialMatcher(processed.match, matchOptions);
|
|
2442
|
-
const format = buildFormat(cwd,
|
|
2443
|
-
const
|
|
2444
|
-
const
|
|
2669
|
+
const format = buildFormat(cwd, root, absolute);
|
|
2670
|
+
const excludeFormatter = absolute ? format : buildFormat(cwd, root, true);
|
|
2671
|
+
const excludePredicate = (_, p)=>{
|
|
2672
|
+
const relativePath = excludeFormatter(p, true);
|
|
2673
|
+
return "." !== relativePath && !partialMatcher(relativePath) || ignore(relativePath);
|
|
2674
|
+
};
|
|
2675
|
+
let maxDepth;
|
|
2676
|
+
if (void 0 !== options.deep) maxDepth = Math.round(options.deep - props.depthOffset);
|
|
2677
|
+
const crawler = new Builder({
|
|
2445
2678
|
filters: [
|
|
2446
|
-
|
|
2447
|
-
const path
|
|
2448
|
-
const matches = matcher(path
|
|
2449
|
-
if (matches) dist_log(`matched ${path
|
|
2679
|
+
debug ? (p, isDirectory)=>{
|
|
2680
|
+
const path = format(p, isDirectory);
|
|
2681
|
+
const matches = matcher(path) && !ignore(path);
|
|
2682
|
+
if (matches) dist_log(`matched ${path}`);
|
|
2450
2683
|
return matches;
|
|
2451
|
-
} : (p, isDirectory)=>
|
|
2684
|
+
} : (p, isDirectory)=>{
|
|
2685
|
+
const path = format(p, isDirectory);
|
|
2686
|
+
return matcher(path) && !ignore(path);
|
|
2687
|
+
}
|
|
2452
2688
|
],
|
|
2453
|
-
exclude:
|
|
2454
|
-
const
|
|
2455
|
-
|
|
2456
|
-
skipped ? dist_log(`skipped ${p}`) : dist_log(`crawling ${p}`);
|
|
2689
|
+
exclude: debug ? (_, p)=>{
|
|
2690
|
+
const skipped = excludePredicate(_, p);
|
|
2691
|
+
dist_log(`${skipped ? "skipped" : "crawling"} ${p}`);
|
|
2457
2692
|
return skipped;
|
|
2458
|
-
} :
|
|
2459
|
-
|
|
2460
|
-
return "." !== relativePath && !partialMatcher(relativePath) || ignore(relativePath);
|
|
2461
|
-
},
|
|
2462
|
-
fs: options.fs ? {
|
|
2463
|
-
readdir: options.fs.readdir || __rspack_external_fs["default"].readdir,
|
|
2464
|
-
readdirSync: options.fs.readdirSync || __rspack_external_fs["default"].readdirSync,
|
|
2465
|
-
realpath: options.fs.realpath || __rspack_external_fs["default"].realpath,
|
|
2466
|
-
realpathSync: options.fs.realpathSync || __rspack_external_fs["default"].realpathSync,
|
|
2467
|
-
stat: options.fs.stat || __rspack_external_fs["default"].stat,
|
|
2468
|
-
statSync: options.fs.statSync || __rspack_external_fs["default"].statSync
|
|
2469
|
-
} : void 0,
|
|
2693
|
+
} : excludePredicate,
|
|
2694
|
+
fs: options.fs,
|
|
2470
2695
|
pathSeparator: "/",
|
|
2471
|
-
relativePaths:
|
|
2472
|
-
|
|
2696
|
+
relativePaths: !absolute,
|
|
2697
|
+
resolvePaths: absolute,
|
|
2698
|
+
includeBasePath: absolute,
|
|
2699
|
+
resolveSymlinks: followSymbolicLinks,
|
|
2700
|
+
excludeSymlinks: !followSymbolicLinks,
|
|
2701
|
+
excludeFiles: onlyDirectories,
|
|
2702
|
+
includeDirs: onlyDirectories || !options.onlyFiles,
|
|
2703
|
+
maxDepth,
|
|
2473
2704
|
signal: options.signal
|
|
2474
|
-
};
|
|
2475
|
-
if (
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
fdirOptions.includeBasePath = true;
|
|
2480
|
-
}
|
|
2481
|
-
if (false === options.followSymbolicLinks) {
|
|
2482
|
-
fdirOptions.resolveSymlinks = false;
|
|
2483
|
-
fdirOptions.excludeSymlinks = true;
|
|
2484
|
-
}
|
|
2485
|
-
if (options.onlyDirectories) {
|
|
2486
|
-
fdirOptions.excludeFiles = true;
|
|
2487
|
-
fdirOptions.includeDirs = true;
|
|
2488
|
-
} else if (false === options.onlyFiles) fdirOptions.includeDirs = true;
|
|
2489
|
-
props.root = props.root.replace(BACKSLASHES, "");
|
|
2490
|
-
const root = props.root;
|
|
2491
|
-
if (options.debug) dist_log("internal properties:", props);
|
|
2492
|
-
const relative = cwd !== root && !options.absolute && buildRelative(cwd, props.root);
|
|
2705
|
+
}).crawl(root);
|
|
2706
|
+
if (options.debug) dist_log("internal properties:", {
|
|
2707
|
+
...props,
|
|
2708
|
+
root
|
|
2709
|
+
});
|
|
2493
2710
|
return [
|
|
2494
|
-
|
|
2495
|
-
|
|
2711
|
+
crawler,
|
|
2712
|
+
cwd !== root && !absolute && buildRelative(cwd, root)
|
|
2496
2713
|
];
|
|
2497
2714
|
}
|
|
2498
|
-
|
|
2499
|
-
if (
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2715
|
+
function formatPaths(paths, mapper) {
|
|
2716
|
+
if (mapper) for(let i = paths.length - 1; i >= 0; i--)paths[i] = mapper(paths[i]);
|
|
2717
|
+
return paths;
|
|
2718
|
+
}
|
|
2719
|
+
const defaultOptions = {
|
|
2720
|
+
caseSensitiveMatch: true,
|
|
2721
|
+
cwd: process.cwd(),
|
|
2722
|
+
debug: !!process.env.TINYGLOBBY_DEBUG,
|
|
2723
|
+
expandDirectories: true,
|
|
2724
|
+
followSymbolicLinks: true,
|
|
2725
|
+
onlyFiles: true
|
|
2726
|
+
};
|
|
2727
|
+
function getOptions(options) {
|
|
2728
|
+
const opts = {
|
|
2729
|
+
...defaultOptions,
|
|
2730
|
+
...options
|
|
2731
|
+
};
|
|
2732
|
+
opts.cwd = (opts.cwd instanceof URL ? fileURLToPath(opts.cwd) : resolve(opts.cwd)).replace(BACKSLASHES, "/");
|
|
2733
|
+
opts.ignore = ensureStringArray(opts.ignore);
|
|
2734
|
+
opts.fs && (opts.fs = {
|
|
2735
|
+
readdir: opts.fs.readdir || readdir,
|
|
2736
|
+
readdirSync: opts.fs.readdirSync || readdirSync,
|
|
2737
|
+
realpath: opts.fs.realpath || realpath,
|
|
2738
|
+
realpathSync: opts.fs.realpathSync || realpathSync,
|
|
2739
|
+
stat: opts.fs.stat || external_fs_stat,
|
|
2740
|
+
statSync: opts.fs.statSync || statSync
|
|
2741
|
+
});
|
|
2742
|
+
if (opts.debug) dist_log("globbing with options:", opts);
|
|
2743
|
+
return opts;
|
|
2744
|
+
}
|
|
2745
|
+
function getCrawler(globInput, inputOptions = {}) {
|
|
2746
|
+
var _ref;
|
|
2747
|
+
if (globInput && (null == inputOptions ? void 0 : inputOptions.patterns)) throw new Error("Cannot pass patterns as both an argument and an option");
|
|
2748
|
+
const isModern = isReadonlyArray(globInput) || "string" == typeof globInput;
|
|
2749
|
+
const patterns = ensureStringArray(null != (_ref = isModern ? globInput : globInput.patterns) ? _ref : "**/*");
|
|
2750
|
+
const options = getOptions(isModern ? inputOptions : globInput);
|
|
2751
|
+
return patterns.length > 0 ? buildCrawler(options, patterns) : [];
|
|
2752
|
+
}
|
|
2753
|
+
async function glob(globInput, options) {
|
|
2754
|
+
const [crawler, relative] = getCrawler(globInput, options);
|
|
2755
|
+
return crawler ? formatPaths(await crawler.withPromise(), relative) : [];
|
|
2506
2756
|
}
|
|
2507
2757
|
var abbreviates_namespaceObject = JSON.parse('{"abi":"ABI","amd":"AMD","api":"API","ast":"AST","bom":"BOM","bsd":"BSD","cdn":"CDN","cjs":"CJS","cli":"CLI","cncf":"CNCF","cors":"CORS","cpu":"CPU","crud":"CRUD","csrf":"CSRF","css":"CSS","csv":"CSV","db2":"DB2","dns":"DNS","dom":"DOM","dos":"DOS","es6":"ES6","esm":"ESM","fbi":"FBI","ftp":"FTP","ftps":"FTPS","gcc":"GCC","gcp":"GCP","glsl":"GLSL","gorm":"GORM","gpl":"GPL","gps":"GPS","gpu":"GPU","gre":"GRE","gui":"GUI","hdmi":"HDMI","hmr":"HMR","html":"HTML","http":"HTTP","https":"HTTPS","iife":"IIFE","iot":"IoT","ipc":"IPC","ipfs":"IPFS","ipmi":"IPMI","jdbc":"JDBC","jdk":"JDK","jit":"JIT","jpeg":"JPEG","jpg":"JPG","jre":"JRE","jsf":"JSF","json":"JSON","jsonp":"JSONP","jsp":"JSP","jwt":"JWT","kcp":"KCP","kde":"KDE","kpi":"KPI","lfu":"LFU","llvm":"LLVM","lru":"LRU","lts":"LTS","mdn":"MDN","mdx":"MDX","mvc":"MVC","mvp":"MVP","mvvm":"MVVM","nft":"NFT","odbc":"ODBC","ont":"ONT","orm":"ORM","oss":"OSS","pdf":"PDF","pdo":"PDO","posix":"POSIX","pwa":"PWA","qemu":"QEMU","qgis":"QGIS","quic":"QUIC","rfc":"RFC","rom":"ROM","rpc":"RPC","rss":"RSS","rss3":"RSS3","sdk":"SDK","seo":"SEO","sip":"SIP","smtp":"SMTP","sql":"SQL","sre":"SRE","ssg":"SSG","ssh":"SSH","sso":"SSO","ssr":"SSR","stp":"STP","svg":"SVG","svn":"SVN","tcp":"TCP","tls":"TLS","toml":"TOML","tsc":"TSC","udp":"UDP","umd":"UMD","uri":"URI","url":"URL","usb":"USB","vlan":"VLAN","vnc":"VNC","vpn":"VPN","vps":"VPS","wgsl":"WGSL","wlan":"WLAN","wsa":"WSA","wsl":"WSL","xhtml":"XHTML","xml":"XML","xss":"XSS","yaml":"YAML"}');
|
|
2508
2758
|
var brands_namespaceObject = JSON.parse('{"airbnb":"Airbnb","alphago":"AlphaGo","bitbucket":"Bitbucket","bytedance":"ByteDance","circleci":"CircleCI","cloudflare":"Cloudflare","freecodecamp":"freeCodeCamp","gitea":"Gitea","gitee":"Gitee","github":"GitHub","gitlab":"GitLab","gitops":"GitOps","gitpod":"Gitpod","hp":"HP","ibm":"IBM","jsdelivr":"jsDelivr","kfc":"KFC","leetcode":"LeetCode","linkedin":"LinkedIn","mcdonald":"McDonald","nvidia":"NVIDIA","pagerduty":"PagerDuty","producthunt":"Product Hunt","stackblitz":"StackBlitz","stackit":"STACKIT","stackoverflow":"Stack Overflow","unjs":"UnJS","v2ex":"V2EX","vuefes":"Vue Fes","youtube":"YouTube"}');
|
|
@@ -2519,6 +2769,7 @@ const dict = [
|
|
|
2519
2769
|
'Agent Skills',
|
|
2520
2770
|
'API Report File',
|
|
2521
2771
|
'App Router',
|
|
2772
|
+
'Babel',
|
|
2522
2773
|
'Create React App',
|
|
2523
2774
|
'Cloudflare Pages',
|
|
2524
2775
|
'CSS Modules',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "heading-case",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"repository": "https://github.com/rstackjs/heading-case",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -15,32 +15,36 @@
|
|
|
15
15
|
},
|
|
16
16
|
"module": "./dist/index.mjs",
|
|
17
17
|
"types": "./dist/index.d.ts",
|
|
18
|
-
"files": [
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
19
21
|
"scripts": {
|
|
20
|
-
"build": "rslib
|
|
21
|
-
"dev": "rslib
|
|
22
|
-
"lint": "
|
|
23
|
-
"lint:write": "
|
|
24
|
-
"prepare": "simple-git-hooks &&
|
|
25
|
-
"test": "
|
|
22
|
+
"build": "rslib",
|
|
23
|
+
"dev": "rslib -w",
|
|
24
|
+
"lint": "rslint && prettier -c .",
|
|
25
|
+
"lint:write": "rslint --fix && prettier -w .",
|
|
26
|
+
"prepare": "simple-git-hooks && rslib",
|
|
27
|
+
"test": "rstest",
|
|
26
28
|
"bump": "npx bumpp"
|
|
27
29
|
},
|
|
28
30
|
"simple-git-hooks": {
|
|
29
|
-
"pre-commit": "
|
|
31
|
+
"pre-commit": "pnpm run lint:write"
|
|
30
32
|
},
|
|
31
33
|
"devDependencies": {
|
|
32
|
-
"@
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"
|
|
34
|
+
"@rslib/core": "^0.21.5",
|
|
35
|
+
"@rslint/core": "^0.5.3",
|
|
36
|
+
"@rstest/core": "^0.10.2",
|
|
37
|
+
"@types/node": "^24.12.4",
|
|
38
|
+
"case-police": "^2.2.1",
|
|
36
39
|
"pathe": "^2.0.3",
|
|
37
40
|
"picocolors": "^1.1.1",
|
|
38
|
-
"
|
|
41
|
+
"prettier": "^3.8.3",
|
|
42
|
+
"rslog": "^2.1.1",
|
|
39
43
|
"simple-git-hooks": "^2.13.1",
|
|
40
|
-
"tinyglobby": "^0.2.
|
|
41
|
-
"typescript": "^
|
|
44
|
+
"tinyglobby": "^0.2.16",
|
|
45
|
+
"typescript": "^6.0.3"
|
|
42
46
|
},
|
|
43
|
-
"packageManager": "pnpm@
|
|
47
|
+
"packageManager": "pnpm@11.2.2",
|
|
44
48
|
"publishConfig": {
|
|
45
49
|
"access": "public",
|
|
46
50
|
"registry": "https://registry.npmjs.org/"
|
package/dist/rslib-runtime.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
var __webpack_modules__ = {};
|
|
2
|
-
var __webpack_module_cache__ = {};
|
|
3
|
-
function __webpack_require__(moduleId) {
|
|
4
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
5
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
6
|
-
var module = __webpack_module_cache__[moduleId] = {
|
|
7
|
-
exports: {}
|
|
8
|
-
};
|
|
9
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
10
|
-
return module.exports;
|
|
11
|
-
}
|
|
12
|
-
__webpack_require__.m = __webpack_modules__;
|
|
13
|
-
(()=>{
|
|
14
|
-
__webpack_require__.add = function(modules) {
|
|
15
|
-
Object.assign(__webpack_require__.m, modules);
|
|
16
|
-
};
|
|
17
|
-
})();
|
|
18
|
-
(()=>{
|
|
19
|
-
__webpack_require__.n = (module)=>{
|
|
20
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
21
|
-
__webpack_require__.d(getter, {
|
|
22
|
-
a: getter
|
|
23
|
-
});
|
|
24
|
-
return getter;
|
|
25
|
-
};
|
|
26
|
-
})();
|
|
27
|
-
(()=>{
|
|
28
|
-
__webpack_require__.d = (exports, definition)=>{
|
|
29
|
-
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
get: definition[key]
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
(()=>{
|
|
36
|
-
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
37
|
-
})();
|
|
38
|
-
export { __webpack_require__ };
|