@unpackjs/core 4.7.2 → 4.7.4
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 +4027 -139
- package/dist/index.js.LICENSE.txt +3 -1
- package/dist-types/cli/index.d.ts.map +1 -1
- package/dist-types/index.d.ts +1 -0
- package/dist-types/index.d.ts.map +1 -1
- package/dist-types/port.d.ts +2 -0
- package/dist-types/port.d.ts.map +1 -0
- package/dist-types/rspack-config/index.d.ts.map +1 -1
- package/dist-types/utils.d.ts +0 -1
- package/dist-types/utils.d.ts.map +1 -1
- package/package.json +10 -11
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
let lastTrackTime, devServerPort, lastFileInfo, logger;
|
|
2
|
+
let runtimeProcessArgs, runtimeInfo, lastTrackTime, devServerPort, lastFileInfo, logger;
|
|
3
3
|
import __rslib_shim_module__ from "node:module";
|
|
4
4
|
let require = __rslib_shim_module__.createRequire(import.meta.url);
|
|
5
5
|
import { fileURLToPath as __rspack_fileURLToPath, pathToFileURL } from "node:url";
|
|
6
|
-
import node_path, { dirname as __rspack_dirname, join, sep } from "node:path";
|
|
6
|
+
import node_path, { dirname as __rspack_dirname, basename as external_node_path_basename, dirname as external_node_path_dirname, extname, isAbsolute, join, normalize, relative as external_node_path_relative, resolve as external_node_path_resolve, sep } from "node:path";
|
|
7
7
|
import * as __rspack_external_child_process from "child_process";
|
|
8
8
|
import * as __rspack_external_fs from "fs";
|
|
9
9
|
import * as __rspack_external_os from "os";
|
|
@@ -11,22 +11,36 @@ import * as __rspack_external_path from "path";
|
|
|
11
11
|
import * as __rspack_external_url from "url";
|
|
12
12
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
13
13
|
import { Compilation, rspack } from "@rspack/core";
|
|
14
|
-
import
|
|
15
|
-
import node_fs from "node:fs";
|
|
14
|
+
import { exec, spawn, spawnSync } from "node:child_process";
|
|
15
|
+
import node_fs, { stat as external_node_fs_stat, unwatchFile, watch as external_node_fs_watch, watchFile } from "node:fs";
|
|
16
16
|
import node_readline from "node:readline";
|
|
17
17
|
import { createHash } from "node:crypto";
|
|
18
|
-
import node_os, { platform } from "node:os";
|
|
19
|
-
import
|
|
20
|
-
import {
|
|
21
|
-
import { format, promisify } from "node:util";
|
|
22
|
-
import { TraceMap, originalPositionFor } from "@jridgewell/trace-mapping";
|
|
23
|
-
import { parse } from "stacktrace-parser";
|
|
18
|
+
import node_os, { platform, type as external_node_os_type } from "node:os";
|
|
19
|
+
import { createRequire } from "module";
|
|
20
|
+
import { format as external_node_util_format, promisify } from "node:util";
|
|
24
21
|
import node_zlib from "node:zlib";
|
|
25
|
-
import
|
|
26
|
-
import { expand } from "dotenv-expand";
|
|
22
|
+
import node_net from "node:net";
|
|
27
23
|
import { RspackDevServer } from "@rspack/dev-server";
|
|
28
|
-
import {
|
|
29
|
-
import
|
|
24
|
+
import { EventEmitter } from "node:events";
|
|
25
|
+
import { lstat, open as promises_open, readdir, realpath as promises_realpath, stat as promises_stat } from "node:fs/promises";
|
|
26
|
+
import { Readable } from "node:stream";
|
|
27
|
+
function toArr(any) {
|
|
28
|
+
return null == any ? [] : Array.isArray(any) ? any : [
|
|
29
|
+
any
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
function removeBrackets(v) {
|
|
33
|
+
return v.replace(/[<[].+/, "").trim();
|
|
34
|
+
}
|
|
35
|
+
function findLongest(arr) {
|
|
36
|
+
return arr.sort((a, b)=>a.length > b.length ? -1 : 1)[0];
|
|
37
|
+
}
|
|
38
|
+
function padRight(str, length) {
|
|
39
|
+
return str.length >= length ? str : `${str}${" ".repeat(length - str.length)}`;
|
|
40
|
+
}
|
|
41
|
+
function camelcaseOptionName(name) {
|
|
42
|
+
return name.split(".").map((v, i)=>0 === i ? v.replaceAll(/([a-z])-([a-z])/g, (_, p1, p2)=>p1 + p2.toUpperCase()) : v).join(".");
|
|
43
|
+
}
|
|
30
44
|
__webpack_require__.add({
|
|
31
45
|
"../../node_modules/.pnpm/clone-deep@4.0.1/node_modules/clone-deep/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
32
46
|
let clone = __webpack_require__("../../node_modules/.pnpm/shallow-clone@3.0.1/node_modules/shallow-clone/index.js"), typeOf = __webpack_require__("../../node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.js"), isPlainObject = __webpack_require__("../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js");
|
|
@@ -51,6 +65,36 @@ __webpack_require__.add({
|
|
|
51
65
|
}
|
|
52
66
|
};
|
|
53
67
|
},
|
|
68
|
+
"../../node_modules/.pnpm/dotenv-expand@12.0.3/node_modules/dotenv-expand/lib/main.js" (module) {
|
|
69
|
+
function _resolveEscapeSequences(value) {
|
|
70
|
+
return value.replace(/\\\$/g, '$');
|
|
71
|
+
}
|
|
72
|
+
module.exports.expand = function(options) {
|
|
73
|
+
let runningParsed = {}, processEnv = process.env;
|
|
74
|
+
for(let key in options && null != options.processEnv && (processEnv = options.processEnv), options.parsed){
|
|
75
|
+
let value = options.parsed[key];
|
|
76
|
+
value = processEnv[key] && processEnv[key] !== value ? processEnv[key] : function(value, processEnv, runningParsed) {
|
|
77
|
+
let match, env = {
|
|
78
|
+
...runningParsed,
|
|
79
|
+
...processEnv
|
|
80
|
+
}, regex = /(?<!\\)\${([^{}]+)}|(?<!\\)\$([A-Za-z_][A-Za-z0-9_]*)/g, result = value, seen = new Set();
|
|
81
|
+
for(; null !== (match = regex.exec(result));){
|
|
82
|
+
let defaultValue, value;
|
|
83
|
+
seen.add(result);
|
|
84
|
+
let [template, bracedExpression, unbracedExpression] = match, expression = bracedExpression || unbracedExpression, opRegex = /(:\+|\+|:-|-)/, opMatch = expression.match(opRegex), splitter = opMatch ? opMatch[0] : null, r = expression.split(splitter), key = r.shift();
|
|
85
|
+
if ([
|
|
86
|
+
':+',
|
|
87
|
+
'+'
|
|
88
|
+
].includes(splitter) ? (defaultValue = env[key] ? r.join(splitter) : '', value = null) : (defaultValue = r.join(splitter), value = env[key]), (result = value ? seen.has(value) ? result.replace(template, defaultValue) : result.replace(template, value) : result.replace(template, defaultValue)) === runningParsed[key]) break;
|
|
89
|
+
regex.lastIndex = 0;
|
|
90
|
+
}
|
|
91
|
+
return result;
|
|
92
|
+
}(value, processEnv, runningParsed), options.parsed[key] = _resolveEscapeSequences(value), runningParsed[key] = _resolveEscapeSequences(value);
|
|
93
|
+
}
|
|
94
|
+
for(let processKey in options.parsed)processEnv[processKey] = options.parsed[processKey];
|
|
95
|
+
return options;
|
|
96
|
+
};
|
|
97
|
+
},
|
|
54
98
|
"../../node_modules/.pnpm/flat@5.0.2/node_modules/flat/index.js" (module) {
|
|
55
99
|
function isBuffer(obj) {
|
|
56
100
|
return obj && obj.constructor && 'function' == typeof obj.constructor.isBuffer && obj.constructor.isBuffer(obj);
|
|
@@ -558,6 +602,945 @@ __webpack_require__.add({
|
|
|
558
602
|
};
|
|
559
603
|
module.exports = createColors(), module.exports.createColors = createColors;
|
|
560
604
|
},
|
|
605
|
+
"../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
606
|
+
let pico = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.js"), utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.js");
|
|
607
|
+
function picomatch(glob, options, returnState = !1) {
|
|
608
|
+
return options && (null === options.windows || void 0 === options.windows) && (options = {
|
|
609
|
+
...options,
|
|
610
|
+
windows: utils.isWindows()
|
|
611
|
+
}), pico(glob, options, returnState);
|
|
612
|
+
}
|
|
613
|
+
Object.assign(picomatch, pico), module.exports = picomatch;
|
|
614
|
+
},
|
|
615
|
+
"../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.js" (module) {
|
|
616
|
+
let WIN_NO_SLASH = "[^\\\\/]", QMARK = '[^/]', END_ANCHOR = "(?:\\/|$)", START_ANCHOR = "(?:^|\\/)", DOTS_SLASH = `\\.{1,2}${END_ANCHOR}`, NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`, NO_DOT_SLASH = `(?!\\.{0,1}${END_ANCHOR})`, NO_DOTS_SLASH = `(?!${DOTS_SLASH})`, STAR = `${QMARK}*?`, POSIX_CHARS = {
|
|
617
|
+
DOT_LITERAL: '\\.',
|
|
618
|
+
PLUS_LITERAL: '\\+',
|
|
619
|
+
QMARK_LITERAL: '\\?',
|
|
620
|
+
SLASH_LITERAL: '\\/',
|
|
621
|
+
ONE_CHAR: '(?=.)',
|
|
622
|
+
QMARK,
|
|
623
|
+
END_ANCHOR,
|
|
624
|
+
DOTS_SLASH,
|
|
625
|
+
NO_DOT: "(?!\\.)",
|
|
626
|
+
NO_DOTS,
|
|
627
|
+
NO_DOT_SLASH,
|
|
628
|
+
NO_DOTS_SLASH,
|
|
629
|
+
QMARK_NO_DOT: "[^.\\/]",
|
|
630
|
+
STAR,
|
|
631
|
+
START_ANCHOR,
|
|
632
|
+
SEP: '/'
|
|
633
|
+
}, WINDOWS_CHARS = {
|
|
634
|
+
...POSIX_CHARS,
|
|
635
|
+
SLASH_LITERAL: "[\\\\/]",
|
|
636
|
+
QMARK: WIN_NO_SLASH,
|
|
637
|
+
STAR: `${WIN_NO_SLASH}*?`,
|
|
638
|
+
DOTS_SLASH: "\\.{1,2}(?:[\\\\/]|$)",
|
|
639
|
+
NO_DOT: "(?!\\.)",
|
|
640
|
+
NO_DOTS: "(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",
|
|
641
|
+
NO_DOT_SLASH: "(?!\\.{0,1}(?:[\\\\/]|$))",
|
|
642
|
+
NO_DOTS_SLASH: "(?!\\.{1,2}(?:[\\\\/]|$))",
|
|
643
|
+
QMARK_NO_DOT: "[^.\\\\/]",
|
|
644
|
+
START_ANCHOR: "(?:^|[\\\\/])",
|
|
645
|
+
END_ANCHOR: "(?:[\\\\/]|$)",
|
|
646
|
+
SEP: '\\'
|
|
647
|
+
};
|
|
648
|
+
module.exports = {
|
|
649
|
+
MAX_LENGTH: 65536,
|
|
650
|
+
POSIX_REGEX_SOURCE: {
|
|
651
|
+
alnum: 'a-zA-Z0-9',
|
|
652
|
+
alpha: 'a-zA-Z',
|
|
653
|
+
ascii: '\\x00-\\x7F',
|
|
654
|
+
blank: ' \\t',
|
|
655
|
+
cntrl: '\\x00-\\x1F\\x7F',
|
|
656
|
+
digit: '0-9',
|
|
657
|
+
graph: '\\x21-\\x7E',
|
|
658
|
+
lower: 'a-z',
|
|
659
|
+
print: '\\x20-\\x7E ',
|
|
660
|
+
punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
|
|
661
|
+
space: ' \\t\\r\\n\\v\\f',
|
|
662
|
+
upper: 'A-Z',
|
|
663
|
+
word: 'A-Za-z0-9_',
|
|
664
|
+
xdigit: 'A-Fa-f0-9'
|
|
665
|
+
},
|
|
666
|
+
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
667
|
+
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
668
|
+
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
|
669
|
+
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
|
670
|
+
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
|
671
|
+
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
672
|
+
REPLACEMENTS: {
|
|
673
|
+
__proto__: null,
|
|
674
|
+
'***': '*',
|
|
675
|
+
'**/**': '**',
|
|
676
|
+
'**/**/**': '**'
|
|
677
|
+
},
|
|
678
|
+
CHAR_0: 48,
|
|
679
|
+
CHAR_9: 57,
|
|
680
|
+
CHAR_UPPERCASE_A: 65,
|
|
681
|
+
CHAR_LOWERCASE_A: 97,
|
|
682
|
+
CHAR_UPPERCASE_Z: 90,
|
|
683
|
+
CHAR_LOWERCASE_Z: 122,
|
|
684
|
+
CHAR_LEFT_PARENTHESES: 40,
|
|
685
|
+
CHAR_RIGHT_PARENTHESES: 41,
|
|
686
|
+
CHAR_ASTERISK: 42,
|
|
687
|
+
CHAR_AMPERSAND: 38,
|
|
688
|
+
CHAR_AT: 64,
|
|
689
|
+
CHAR_BACKWARD_SLASH: 92,
|
|
690
|
+
CHAR_CARRIAGE_RETURN: 13,
|
|
691
|
+
CHAR_CIRCUMFLEX_ACCENT: 94,
|
|
692
|
+
CHAR_COLON: 58,
|
|
693
|
+
CHAR_COMMA: 44,
|
|
694
|
+
CHAR_DOT: 46,
|
|
695
|
+
CHAR_DOUBLE_QUOTE: 34,
|
|
696
|
+
CHAR_EQUAL: 61,
|
|
697
|
+
CHAR_EXCLAMATION_MARK: 33,
|
|
698
|
+
CHAR_FORM_FEED: 12,
|
|
699
|
+
CHAR_FORWARD_SLASH: 47,
|
|
700
|
+
CHAR_GRAVE_ACCENT: 96,
|
|
701
|
+
CHAR_HASH: 35,
|
|
702
|
+
CHAR_HYPHEN_MINUS: 45,
|
|
703
|
+
CHAR_LEFT_ANGLE_BRACKET: 60,
|
|
704
|
+
CHAR_LEFT_CURLY_BRACE: 123,
|
|
705
|
+
CHAR_LEFT_SQUARE_BRACKET: 91,
|
|
706
|
+
CHAR_LINE_FEED: 10,
|
|
707
|
+
CHAR_NO_BREAK_SPACE: 160,
|
|
708
|
+
CHAR_PERCENT: 37,
|
|
709
|
+
CHAR_PLUS: 43,
|
|
710
|
+
CHAR_QUESTION_MARK: 63,
|
|
711
|
+
CHAR_RIGHT_ANGLE_BRACKET: 62,
|
|
712
|
+
CHAR_RIGHT_CURLY_BRACE: 125,
|
|
713
|
+
CHAR_RIGHT_SQUARE_BRACKET: 93,
|
|
714
|
+
CHAR_SEMICOLON: 59,
|
|
715
|
+
CHAR_SINGLE_QUOTE: 39,
|
|
716
|
+
CHAR_SPACE: 32,
|
|
717
|
+
CHAR_TAB: 9,
|
|
718
|
+
CHAR_UNDERSCORE: 95,
|
|
719
|
+
CHAR_VERTICAL_LINE: 124,
|
|
720
|
+
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
721
|
+
extglobChars: (chars)=>({
|
|
722
|
+
'!': {
|
|
723
|
+
type: 'negate',
|
|
724
|
+
open: '(?:(?!(?:',
|
|
725
|
+
close: `))${chars.STAR})`
|
|
726
|
+
},
|
|
727
|
+
'?': {
|
|
728
|
+
type: 'qmark',
|
|
729
|
+
open: '(?:',
|
|
730
|
+
close: ')?'
|
|
731
|
+
},
|
|
732
|
+
'+': {
|
|
733
|
+
type: 'plus',
|
|
734
|
+
open: '(?:',
|
|
735
|
+
close: ')+'
|
|
736
|
+
},
|
|
737
|
+
'*': {
|
|
738
|
+
type: 'star',
|
|
739
|
+
open: '(?:',
|
|
740
|
+
close: ')*'
|
|
741
|
+
},
|
|
742
|
+
'@': {
|
|
743
|
+
type: 'at',
|
|
744
|
+
open: '(?:',
|
|
745
|
+
close: ')'
|
|
746
|
+
}
|
|
747
|
+
}),
|
|
748
|
+
globChars: (win32)=>!0 === win32 ? WINDOWS_CHARS : POSIX_CHARS
|
|
749
|
+
};
|
|
750
|
+
},
|
|
751
|
+
"../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/parse.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
752
|
+
let constants = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.js"), utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.js"), { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants, expandRange = (args, options)=>{
|
|
753
|
+
if ('function' == typeof options.expandRange) return options.expandRange(...args, options);
|
|
754
|
+
args.sort();
|
|
755
|
+
let value = `[${args.join('-')}]`;
|
|
756
|
+
try {
|
|
757
|
+
new RegExp(value);
|
|
758
|
+
} catch (ex) {
|
|
759
|
+
return args.map((v)=>utils.escapeRegex(v)).join('..');
|
|
760
|
+
}
|
|
761
|
+
return value;
|
|
762
|
+
}, syntaxError = (type, char)=>`Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`, parse = (input, options)=>{
|
|
763
|
+
let value;
|
|
764
|
+
if ('string' != typeof input) throw TypeError('Expected a string');
|
|
765
|
+
input = REPLACEMENTS[input] || input;
|
|
766
|
+
let opts = {
|
|
767
|
+
...options
|
|
768
|
+
}, max = 'number' == typeof opts.maxLength ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH, len = input.length;
|
|
769
|
+
if (len > max) throw SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
770
|
+
let bos = {
|
|
771
|
+
type: 'bos',
|
|
772
|
+
value: '',
|
|
773
|
+
output: opts.prepend || ''
|
|
774
|
+
}, tokens = [
|
|
775
|
+
bos
|
|
776
|
+
], capture = opts.capture ? '' : '?:', PLATFORM_CHARS = constants.globChars(opts.windows), EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS), { DOT_LITERAL, PLUS_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK, QMARK_NO_DOT, STAR, START_ANCHOR } = PLATFORM_CHARS, globstar = (opts)=>`(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`, nodot = opts.dot ? '' : NO_DOT, qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT, star = !0 === opts.bash ? globstar(opts) : STAR;
|
|
777
|
+
opts.capture && (star = `(${star})`), 'boolean' == typeof opts.noext && (opts.noextglob = opts.noext);
|
|
778
|
+
let state = {
|
|
779
|
+
input,
|
|
780
|
+
index: -1,
|
|
781
|
+
start: 0,
|
|
782
|
+
dot: !0 === opts.dot,
|
|
783
|
+
consumed: '',
|
|
784
|
+
output: '',
|
|
785
|
+
prefix: '',
|
|
786
|
+
backtrack: !1,
|
|
787
|
+
negated: !1,
|
|
788
|
+
brackets: 0,
|
|
789
|
+
braces: 0,
|
|
790
|
+
parens: 0,
|
|
791
|
+
quotes: 0,
|
|
792
|
+
globstar: !1,
|
|
793
|
+
tokens
|
|
794
|
+
};
|
|
795
|
+
len = (input = utils.removePrefix(input, state)).length;
|
|
796
|
+
let extglobs = [], braces = [], stack = [], prev = bos, eos = ()=>state.index === len - 1, peek = state.peek = (n = 1)=>input[state.index + n], advance = state.advance = ()=>input[++state.index] || '', remaining = ()=>input.slice(state.index + 1), consume = (value = '', num = 0)=>{
|
|
797
|
+
state.consumed += value, state.index += num;
|
|
798
|
+
}, append = (token)=>{
|
|
799
|
+
state.output += null != token.output ? token.output : token.value, consume(token.value);
|
|
800
|
+
}, negate = ()=>{
|
|
801
|
+
let count = 1;
|
|
802
|
+
for(; '!' === peek() && ('(' !== peek(2) || '?' === peek(3));)advance(), state.start++, count++;
|
|
803
|
+
return count % 2 != 0 && (state.negated = !0, state.start++, !0);
|
|
804
|
+
}, increment = (type)=>{
|
|
805
|
+
state[type]++, stack.push(type);
|
|
806
|
+
}, decrement = (type)=>{
|
|
807
|
+
state[type]--, stack.pop();
|
|
808
|
+
}, push = (tok)=>{
|
|
809
|
+
if ('globstar' === prev.type) {
|
|
810
|
+
let isBrace = state.braces > 0 && ('comma' === tok.type || 'brace' === tok.type), isExtglob = !0 === tok.extglob || extglobs.length && ('pipe' === tok.type || 'paren' === tok.type);
|
|
811
|
+
'slash' === tok.type || 'paren' === tok.type || isBrace || isExtglob || (state.output = state.output.slice(0, -prev.output.length), prev.type = 'star', prev.value = '*', prev.output = star, state.output += prev.output);
|
|
812
|
+
}
|
|
813
|
+
if (extglobs.length && 'paren' !== tok.type && (extglobs[extglobs.length - 1].inner += tok.value), (tok.value || tok.output) && append(tok), prev && 'text' === prev.type && 'text' === tok.type) {
|
|
814
|
+
prev.output = (prev.output || prev.value) + tok.value, prev.value += tok.value;
|
|
815
|
+
return;
|
|
816
|
+
}
|
|
817
|
+
tok.prev = prev, tokens.push(tok), prev = tok;
|
|
818
|
+
}, extglobOpen = (type, value)=>{
|
|
819
|
+
let token = {
|
|
820
|
+
...EXTGLOB_CHARS[value],
|
|
821
|
+
conditions: 1,
|
|
822
|
+
inner: ''
|
|
823
|
+
};
|
|
824
|
+
token.prev = prev, token.parens = state.parens, token.output = state.output;
|
|
825
|
+
let output = (opts.capture ? '(' : '') + token.open;
|
|
826
|
+
increment('parens'), push({
|
|
827
|
+
type,
|
|
828
|
+
value,
|
|
829
|
+
output: state.output ? '' : ONE_CHAR
|
|
830
|
+
}), push({
|
|
831
|
+
type: 'paren',
|
|
832
|
+
extglob: !0,
|
|
833
|
+
value: advance(),
|
|
834
|
+
output
|
|
835
|
+
}), extglobs.push(token);
|
|
836
|
+
}, extglobClose = (token)=>{
|
|
837
|
+
let rest, output = token.close + (opts.capture ? ')' : '');
|
|
838
|
+
if ('negate' === token.type) {
|
|
839
|
+
let extglobStar = star;
|
|
840
|
+
if (token.inner && token.inner.length > 1 && token.inner.includes('/') && (extglobStar = globstar(opts)), (extglobStar !== star || eos() || /^\)+$/.test(remaining())) && (output = token.close = `)$))${extglobStar}`), token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
841
|
+
let expression = parse(rest, {
|
|
842
|
+
...options,
|
|
843
|
+
fastpaths: !1
|
|
844
|
+
}).output;
|
|
845
|
+
output = token.close = `)${expression})${extglobStar})`;
|
|
846
|
+
}
|
|
847
|
+
'bos' === token.prev.type && (state.negatedExtglob = !0);
|
|
848
|
+
}
|
|
849
|
+
push({
|
|
850
|
+
type: 'paren',
|
|
851
|
+
extglob: !0,
|
|
852
|
+
value,
|
|
853
|
+
output
|
|
854
|
+
}), decrement('parens');
|
|
855
|
+
};
|
|
856
|
+
if (!1 !== opts.fastpaths && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
857
|
+
let backslashes = !1, output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index)=>'\\' === first ? (backslashes = !0, m) : '?' === first ? esc ? esc + first + (rest ? QMARK.repeat(rest.length) : '') : 0 === index ? qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '') : QMARK.repeat(chars.length) : '.' === first ? DOT_LITERAL.repeat(chars.length) : '*' === first ? esc ? esc + first + (rest ? star : '') : star : esc ? m : `\\${m}`);
|
|
858
|
+
return (!0 === backslashes && (output = !0 === opts.unescape ? output.replace(/\\/g, '') : output.replace(/\\+/g, (m)=>m.length % 2 == 0 ? '\\\\' : m ? '\\' : '')), output === input && !0 === opts.contains) ? state.output = input : state.output = utils.wrapOutput(output, state, options), state;
|
|
859
|
+
}
|
|
860
|
+
for(; !eos();){
|
|
861
|
+
if ('\u0000' === (value = advance())) continue;
|
|
862
|
+
if ('\\' === value) {
|
|
863
|
+
let next = peek();
|
|
864
|
+
if ('/' === next && !0 !== opts.bash || '.' === next || ';' === next) continue;
|
|
865
|
+
if (!next) {
|
|
866
|
+
push({
|
|
867
|
+
type: 'text',
|
|
868
|
+
value: value += '\\'
|
|
869
|
+
});
|
|
870
|
+
continue;
|
|
871
|
+
}
|
|
872
|
+
let match = /^\\+/.exec(remaining()), slashes = 0;
|
|
873
|
+
if (match && match[0].length > 2 && (slashes = match[0].length, state.index += slashes, slashes % 2 != 0 && (value += '\\')), !0 === opts.unescape ? value = advance() : value += advance(), 0 === state.brackets) {
|
|
874
|
+
push({
|
|
875
|
+
type: 'text',
|
|
876
|
+
value
|
|
877
|
+
});
|
|
878
|
+
continue;
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
if (state.brackets > 0 && (']' !== value || '[' === prev.value || '[^' === prev.value)) {
|
|
882
|
+
if (!1 !== opts.posix && ':' === value) {
|
|
883
|
+
let inner = prev.value.slice(1);
|
|
884
|
+
if (inner.includes('[') && (prev.posix = !0, inner.includes(':'))) {
|
|
885
|
+
let idx = prev.value.lastIndexOf('['), pre = prev.value.slice(0, idx), posix = POSIX_REGEX_SOURCE[prev.value.slice(idx + 2)];
|
|
886
|
+
if (posix) {
|
|
887
|
+
prev.value = pre + posix, state.backtrack = !0, advance(), bos.output || 1 !== tokens.indexOf(prev) || (bos.output = ONE_CHAR);
|
|
888
|
+
continue;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
('[' === value && ':' !== peek() || '-' === value && ']' === peek()) && (value = `\\${value}`), ']' === value && ('[' === prev.value || '[^' === prev.value) && (value = `\\${value}`), !0 === opts.posix && '!' === value && '[' === prev.value && (value = '^'), prev.value += value, append({
|
|
893
|
+
value
|
|
894
|
+
});
|
|
895
|
+
continue;
|
|
896
|
+
}
|
|
897
|
+
if (1 === state.quotes && '"' !== value) {
|
|
898
|
+
value = utils.escapeRegex(value), prev.value += value, append({
|
|
899
|
+
value
|
|
900
|
+
});
|
|
901
|
+
continue;
|
|
902
|
+
}
|
|
903
|
+
if ('"' === value) {
|
|
904
|
+
state.quotes = +(1 !== state.quotes), !0 === opts.keepQuotes && push({
|
|
905
|
+
type: 'text',
|
|
906
|
+
value
|
|
907
|
+
});
|
|
908
|
+
continue;
|
|
909
|
+
}
|
|
910
|
+
if ('(' === value) {
|
|
911
|
+
increment('parens'), push({
|
|
912
|
+
type: 'paren',
|
|
913
|
+
value
|
|
914
|
+
});
|
|
915
|
+
continue;
|
|
916
|
+
}
|
|
917
|
+
if (')' === value) {
|
|
918
|
+
if (0 === state.parens && !0 === opts.strictBrackets) throw SyntaxError(syntaxError('opening', '('));
|
|
919
|
+
let extglob = extglobs[extglobs.length - 1];
|
|
920
|
+
if (extglob && state.parens === extglob.parens + 1) {
|
|
921
|
+
extglobClose(extglobs.pop());
|
|
922
|
+
continue;
|
|
923
|
+
}
|
|
924
|
+
push({
|
|
925
|
+
type: 'paren',
|
|
926
|
+
value,
|
|
927
|
+
output: state.parens ? ')' : '\\)'
|
|
928
|
+
}), decrement('parens');
|
|
929
|
+
continue;
|
|
930
|
+
}
|
|
931
|
+
if ('[' === value) {
|
|
932
|
+
if (!0 !== opts.nobracket && remaining().includes(']')) increment('brackets');
|
|
933
|
+
else {
|
|
934
|
+
if (!0 !== opts.nobracket && !0 === opts.strictBrackets) throw SyntaxError(syntaxError('closing', ']'));
|
|
935
|
+
value = `\\${value}`;
|
|
936
|
+
}
|
|
937
|
+
push({
|
|
938
|
+
type: 'bracket',
|
|
939
|
+
value
|
|
940
|
+
});
|
|
941
|
+
continue;
|
|
942
|
+
}
|
|
943
|
+
if (']' === value) {
|
|
944
|
+
if (!0 === opts.nobracket || prev && 'bracket' === prev.type && 1 === prev.value.length) {
|
|
945
|
+
push({
|
|
946
|
+
type: 'text',
|
|
947
|
+
value,
|
|
948
|
+
output: `\\${value}`
|
|
949
|
+
});
|
|
950
|
+
continue;
|
|
951
|
+
}
|
|
952
|
+
if (0 === state.brackets) {
|
|
953
|
+
if (!0 === opts.strictBrackets) throw SyntaxError(syntaxError('opening', '['));
|
|
954
|
+
push({
|
|
955
|
+
type: 'text',
|
|
956
|
+
value,
|
|
957
|
+
output: `\\${value}`
|
|
958
|
+
});
|
|
959
|
+
continue;
|
|
960
|
+
}
|
|
961
|
+
decrement('brackets');
|
|
962
|
+
let prevValue = prev.value.slice(1);
|
|
963
|
+
if (!0 === prev.posix || '^' !== prevValue[0] || prevValue.includes('/') || (value = `/${value}`), prev.value += value, append({
|
|
964
|
+
value
|
|
965
|
+
}), !1 === opts.literalBrackets || utils.hasRegexChars(prevValue)) continue;
|
|
966
|
+
let escaped = utils.escapeRegex(prev.value);
|
|
967
|
+
if (state.output = state.output.slice(0, -prev.value.length), !0 === opts.literalBrackets) {
|
|
968
|
+
state.output += escaped, prev.value = escaped;
|
|
969
|
+
continue;
|
|
970
|
+
}
|
|
971
|
+
prev.value = `(${capture}${escaped}|${prev.value})`, state.output += prev.value;
|
|
972
|
+
continue;
|
|
973
|
+
}
|
|
974
|
+
if ('{' === value && !0 !== opts.nobrace) {
|
|
975
|
+
increment('braces');
|
|
976
|
+
let open = {
|
|
977
|
+
type: 'brace',
|
|
978
|
+
value,
|
|
979
|
+
output: '(',
|
|
980
|
+
outputIndex: state.output.length,
|
|
981
|
+
tokensIndex: state.tokens.length
|
|
982
|
+
};
|
|
983
|
+
braces.push(open), push(open);
|
|
984
|
+
continue;
|
|
985
|
+
}
|
|
986
|
+
if ('}' === value) {
|
|
987
|
+
let brace = braces[braces.length - 1];
|
|
988
|
+
if (!0 === opts.nobrace || !brace) {
|
|
989
|
+
push({
|
|
990
|
+
type: 'text',
|
|
991
|
+
value,
|
|
992
|
+
output: value
|
|
993
|
+
});
|
|
994
|
+
continue;
|
|
995
|
+
}
|
|
996
|
+
let output = ')';
|
|
997
|
+
if (!0 === brace.dots) {
|
|
998
|
+
let arr = tokens.slice(), range = [];
|
|
999
|
+
for(let i = arr.length - 1; i >= 0 && (tokens.pop(), 'brace' !== arr[i].type); i--)'dots' !== arr[i].type && range.unshift(arr[i].value);
|
|
1000
|
+
output = expandRange(range, opts), state.backtrack = !0;
|
|
1001
|
+
}
|
|
1002
|
+
if (!0 !== brace.comma && !0 !== brace.dots) {
|
|
1003
|
+
let out = state.output.slice(0, brace.outputIndex), toks = state.tokens.slice(brace.tokensIndex);
|
|
1004
|
+
for (let t of (brace.value = brace.output = '\\{', value = output = '\\}', state.output = out, toks))state.output += t.output || t.value;
|
|
1005
|
+
}
|
|
1006
|
+
push({
|
|
1007
|
+
type: 'brace',
|
|
1008
|
+
value,
|
|
1009
|
+
output
|
|
1010
|
+
}), decrement('braces'), braces.pop();
|
|
1011
|
+
continue;
|
|
1012
|
+
}
|
|
1013
|
+
if ('|' === value) {
|
|
1014
|
+
extglobs.length > 0 && extglobs[extglobs.length - 1].conditions++, push({
|
|
1015
|
+
type: 'text',
|
|
1016
|
+
value
|
|
1017
|
+
});
|
|
1018
|
+
continue;
|
|
1019
|
+
}
|
|
1020
|
+
if (',' === value) {
|
|
1021
|
+
let output = value, brace = braces[braces.length - 1];
|
|
1022
|
+
brace && 'braces' === stack[stack.length - 1] && (brace.comma = !0, output = '|'), push({
|
|
1023
|
+
type: 'comma',
|
|
1024
|
+
value,
|
|
1025
|
+
output
|
|
1026
|
+
});
|
|
1027
|
+
continue;
|
|
1028
|
+
}
|
|
1029
|
+
if ('/' === value) {
|
|
1030
|
+
if ('dot' === prev.type && state.index === state.start + 1) {
|
|
1031
|
+
state.start = state.index + 1, state.consumed = '', state.output = '', tokens.pop(), prev = bos;
|
|
1032
|
+
continue;
|
|
1033
|
+
}
|
|
1034
|
+
push({
|
|
1035
|
+
type: 'slash',
|
|
1036
|
+
value,
|
|
1037
|
+
output: SLASH_LITERAL
|
|
1038
|
+
});
|
|
1039
|
+
continue;
|
|
1040
|
+
}
|
|
1041
|
+
if ('.' === value) {
|
|
1042
|
+
if (state.braces > 0 && 'dot' === prev.type) {
|
|
1043
|
+
'.' === prev.value && (prev.output = DOT_LITERAL);
|
|
1044
|
+
let brace = braces[braces.length - 1];
|
|
1045
|
+
prev.type = 'dots', prev.output += value, prev.value += value, brace.dots = !0;
|
|
1046
|
+
continue;
|
|
1047
|
+
}
|
|
1048
|
+
if (state.braces + state.parens === 0 && 'bos' !== prev.type && 'slash' !== prev.type) {
|
|
1049
|
+
push({
|
|
1050
|
+
type: 'text',
|
|
1051
|
+
value,
|
|
1052
|
+
output: DOT_LITERAL
|
|
1053
|
+
});
|
|
1054
|
+
continue;
|
|
1055
|
+
}
|
|
1056
|
+
push({
|
|
1057
|
+
type: 'dot',
|
|
1058
|
+
value,
|
|
1059
|
+
output: DOT_LITERAL
|
|
1060
|
+
});
|
|
1061
|
+
continue;
|
|
1062
|
+
}
|
|
1063
|
+
if ('?' === value) {
|
|
1064
|
+
if (!(prev && '(' === prev.value) && !0 !== opts.noextglob && '(' === peek() && '?' !== peek(2)) {
|
|
1065
|
+
extglobOpen('qmark', value);
|
|
1066
|
+
continue;
|
|
1067
|
+
}
|
|
1068
|
+
if (prev && 'paren' === prev.type) {
|
|
1069
|
+
let next = peek(), output = value;
|
|
1070
|
+
('(' !== prev.value || /[!=<:]/.test(next)) && ('<' !== next || /<([!=]|\w+>)/.test(remaining())) || (output = `\\${value}`), push({
|
|
1071
|
+
type: 'text',
|
|
1072
|
+
value,
|
|
1073
|
+
output
|
|
1074
|
+
});
|
|
1075
|
+
continue;
|
|
1076
|
+
}
|
|
1077
|
+
if (!0 !== opts.dot && ('slash' === prev.type || 'bos' === prev.type)) {
|
|
1078
|
+
push({
|
|
1079
|
+
type: 'qmark',
|
|
1080
|
+
value,
|
|
1081
|
+
output: QMARK_NO_DOT
|
|
1082
|
+
});
|
|
1083
|
+
continue;
|
|
1084
|
+
}
|
|
1085
|
+
push({
|
|
1086
|
+
type: 'qmark',
|
|
1087
|
+
value,
|
|
1088
|
+
output: QMARK
|
|
1089
|
+
});
|
|
1090
|
+
continue;
|
|
1091
|
+
}
|
|
1092
|
+
if ('!' === value) {
|
|
1093
|
+
if (!0 !== opts.noextglob && '(' === peek() && ('?' !== peek(2) || !/[!=<:]/.test(peek(3)))) {
|
|
1094
|
+
extglobOpen('negate', value);
|
|
1095
|
+
continue;
|
|
1096
|
+
}
|
|
1097
|
+
if (!0 !== opts.nonegate && 0 === state.index) {
|
|
1098
|
+
negate();
|
|
1099
|
+
continue;
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
if ('+' === value) {
|
|
1103
|
+
if (!0 !== opts.noextglob && '(' === peek() && '?' !== peek(2)) {
|
|
1104
|
+
extglobOpen('plus', value);
|
|
1105
|
+
continue;
|
|
1106
|
+
}
|
|
1107
|
+
if (prev && '(' === prev.value || !1 === opts.regex) {
|
|
1108
|
+
push({
|
|
1109
|
+
type: 'plus',
|
|
1110
|
+
value,
|
|
1111
|
+
output: PLUS_LITERAL
|
|
1112
|
+
});
|
|
1113
|
+
continue;
|
|
1114
|
+
}
|
|
1115
|
+
if (prev && ('bracket' === prev.type || 'paren' === prev.type || 'brace' === prev.type) || state.parens > 0) {
|
|
1116
|
+
push({
|
|
1117
|
+
type: 'plus',
|
|
1118
|
+
value
|
|
1119
|
+
});
|
|
1120
|
+
continue;
|
|
1121
|
+
}
|
|
1122
|
+
push({
|
|
1123
|
+
type: 'plus',
|
|
1124
|
+
value: PLUS_LITERAL
|
|
1125
|
+
});
|
|
1126
|
+
continue;
|
|
1127
|
+
}
|
|
1128
|
+
if ('@' === value) {
|
|
1129
|
+
if (!0 !== opts.noextglob && '(' === peek() && '?' !== peek(2)) {
|
|
1130
|
+
push({
|
|
1131
|
+
type: 'at',
|
|
1132
|
+
extglob: !0,
|
|
1133
|
+
value,
|
|
1134
|
+
output: ''
|
|
1135
|
+
});
|
|
1136
|
+
continue;
|
|
1137
|
+
}
|
|
1138
|
+
push({
|
|
1139
|
+
type: 'text',
|
|
1140
|
+
value
|
|
1141
|
+
});
|
|
1142
|
+
continue;
|
|
1143
|
+
}
|
|
1144
|
+
if ('*' !== value) {
|
|
1145
|
+
('$' === value || '^' === value) && (value = `\\${value}`);
|
|
1146
|
+
let match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
1147
|
+
match && (value += match[0], state.index += match[0].length), push({
|
|
1148
|
+
type: 'text',
|
|
1149
|
+
value
|
|
1150
|
+
});
|
|
1151
|
+
continue;
|
|
1152
|
+
}
|
|
1153
|
+
if (prev && ('globstar' === prev.type || !0 === prev.star)) {
|
|
1154
|
+
prev.type = 'star', prev.star = !0, prev.value += value, prev.output = star, state.backtrack = !0, state.globstar = !0, consume(value);
|
|
1155
|
+
continue;
|
|
1156
|
+
}
|
|
1157
|
+
let rest = remaining();
|
|
1158
|
+
if (!0 !== opts.noextglob && /^\([^?]/.test(rest)) {
|
|
1159
|
+
extglobOpen('star', value);
|
|
1160
|
+
continue;
|
|
1161
|
+
}
|
|
1162
|
+
if ('star' === prev.type) {
|
|
1163
|
+
if (!0 === opts.noglobstar) {
|
|
1164
|
+
consume(value);
|
|
1165
|
+
continue;
|
|
1166
|
+
}
|
|
1167
|
+
let prior = prev.prev, before = prior.prev, isStart = 'slash' === prior.type || 'bos' === prior.type, afterStar = before && ('star' === before.type || 'globstar' === before.type);
|
|
1168
|
+
if (!0 === opts.bash && (!isStart || rest[0] && '/' !== rest[0])) {
|
|
1169
|
+
push({
|
|
1170
|
+
type: 'star',
|
|
1171
|
+
value,
|
|
1172
|
+
output: ''
|
|
1173
|
+
});
|
|
1174
|
+
continue;
|
|
1175
|
+
}
|
|
1176
|
+
let isBrace = state.braces > 0 && ('comma' === prior.type || 'brace' === prior.type), isExtglob = extglobs.length && ('pipe' === prior.type || 'paren' === prior.type);
|
|
1177
|
+
if (!isStart && 'paren' !== prior.type && !isBrace && !isExtglob) {
|
|
1178
|
+
push({
|
|
1179
|
+
type: 'star',
|
|
1180
|
+
value,
|
|
1181
|
+
output: ''
|
|
1182
|
+
});
|
|
1183
|
+
continue;
|
|
1184
|
+
}
|
|
1185
|
+
for(; '/**' === rest.slice(0, 3);){
|
|
1186
|
+
let after = input[state.index + 4];
|
|
1187
|
+
if (after && '/' !== after) break;
|
|
1188
|
+
rest = rest.slice(3), consume('/**', 3);
|
|
1189
|
+
}
|
|
1190
|
+
if ('bos' === prior.type && eos()) {
|
|
1191
|
+
prev.type = 'globstar', prev.value += value, prev.output = globstar(opts), state.output = prev.output, state.globstar = !0, consume(value);
|
|
1192
|
+
continue;
|
|
1193
|
+
}
|
|
1194
|
+
if ('slash' === prior.type && 'bos' !== prior.prev.type && !afterStar && eos()) {
|
|
1195
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length), prior.output = `(?:${prior.output}`, prev.type = 'globstar', prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'), prev.value += value, state.globstar = !0, state.output += prior.output + prev.output, consume(value);
|
|
1196
|
+
continue;
|
|
1197
|
+
}
|
|
1198
|
+
if ('slash' === prior.type && 'bos' !== prior.prev.type && '/' === rest[0]) {
|
|
1199
|
+
let end = void 0 !== rest[1] ? '|$' : '';
|
|
1200
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length), prior.output = `(?:${prior.output}`, prev.type = 'globstar', prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`, prev.value += value, state.output += prior.output + prev.output, state.globstar = !0, consume(value + advance()), push({
|
|
1201
|
+
type: 'slash',
|
|
1202
|
+
value: '/',
|
|
1203
|
+
output: ''
|
|
1204
|
+
});
|
|
1205
|
+
continue;
|
|
1206
|
+
}
|
|
1207
|
+
if ('bos' === prior.type && '/' === rest[0]) {
|
|
1208
|
+
prev.type = 'globstar', prev.value += value, prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`, state.output = prev.output, state.globstar = !0, consume(value + advance()), push({
|
|
1209
|
+
type: 'slash',
|
|
1210
|
+
value: '/',
|
|
1211
|
+
output: ''
|
|
1212
|
+
});
|
|
1213
|
+
continue;
|
|
1214
|
+
}
|
|
1215
|
+
state.output = state.output.slice(0, -prev.output.length), prev.type = 'globstar', prev.output = globstar(opts), prev.value += value, state.output += prev.output, state.globstar = !0, consume(value);
|
|
1216
|
+
continue;
|
|
1217
|
+
}
|
|
1218
|
+
let token = {
|
|
1219
|
+
type: 'star',
|
|
1220
|
+
value,
|
|
1221
|
+
output: star
|
|
1222
|
+
};
|
|
1223
|
+
if (!0 === opts.bash) {
|
|
1224
|
+
token.output = '.*?', ('bos' === prev.type || 'slash' === prev.type) && (token.output = nodot + token.output), push(token);
|
|
1225
|
+
continue;
|
|
1226
|
+
}
|
|
1227
|
+
if (prev && ('bracket' === prev.type || 'paren' === prev.type) && !0 === opts.regex) {
|
|
1228
|
+
token.output = value, push(token);
|
|
1229
|
+
continue;
|
|
1230
|
+
}
|
|
1231
|
+
(state.index === state.start || 'slash' === prev.type || 'dot' === prev.type) && ('dot' === prev.type ? (state.output += NO_DOT_SLASH, prev.output += NO_DOT_SLASH) : !0 === opts.dot ? (state.output += NO_DOTS_SLASH, prev.output += NO_DOTS_SLASH) : (state.output += nodot, prev.output += nodot), '*' !== peek() && (state.output += ONE_CHAR, prev.output += ONE_CHAR)), push(token);
|
|
1232
|
+
}
|
|
1233
|
+
for(; state.brackets > 0;){
|
|
1234
|
+
if (!0 === opts.strictBrackets) throw SyntaxError(syntaxError('closing', ']'));
|
|
1235
|
+
state.output = utils.escapeLast(state.output, '['), decrement('brackets');
|
|
1236
|
+
}
|
|
1237
|
+
for(; state.parens > 0;){
|
|
1238
|
+
if (!0 === opts.strictBrackets) throw SyntaxError(syntaxError('closing', ')'));
|
|
1239
|
+
state.output = utils.escapeLast(state.output, '('), decrement('parens');
|
|
1240
|
+
}
|
|
1241
|
+
for(; state.braces > 0;){
|
|
1242
|
+
if (!0 === opts.strictBrackets) throw SyntaxError(syntaxError('closing', '}'));
|
|
1243
|
+
state.output = utils.escapeLast(state.output, '{'), decrement('braces');
|
|
1244
|
+
}
|
|
1245
|
+
if (!0 !== opts.strictSlashes && ('star' === prev.type || 'bracket' === prev.type) && push({
|
|
1246
|
+
type: 'maybe_slash',
|
|
1247
|
+
value: '',
|
|
1248
|
+
output: `${SLASH_LITERAL}?`
|
|
1249
|
+
}), !0 === state.backtrack) for (let token of (state.output = '', state.tokens))state.output += null != token.output ? token.output : token.value, token.suffix && (state.output += token.suffix);
|
|
1250
|
+
return state;
|
|
1251
|
+
};
|
|
1252
|
+
parse.fastpaths = (input, options)=>{
|
|
1253
|
+
let opts = {
|
|
1254
|
+
...options
|
|
1255
|
+
}, max = 'number' == typeof opts.maxLength ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH, len = input.length;
|
|
1256
|
+
if (len > max) throw SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
1257
|
+
input = REPLACEMENTS[input] || input;
|
|
1258
|
+
let { DOT_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOTS, NO_DOTS_SLASH, STAR, START_ANCHOR } = constants.globChars(opts.windows), nodot = opts.dot ? NO_DOTS : NO_DOT, slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT, capture = opts.capture ? '' : '?:', star = !0 === opts.bash ? '.*?' : STAR;
|
|
1259
|
+
opts.capture && (star = `(${star})`);
|
|
1260
|
+
let globstar = (opts)=>!0 === opts.noglobstar ? star : `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`, create = (str)=>{
|
|
1261
|
+
switch(str){
|
|
1262
|
+
case '*':
|
|
1263
|
+
return `${nodot}${ONE_CHAR}${star}`;
|
|
1264
|
+
case '.*':
|
|
1265
|
+
return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1266
|
+
case '*.*':
|
|
1267
|
+
return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1268
|
+
case '*/*':
|
|
1269
|
+
return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
|
1270
|
+
case '**':
|
|
1271
|
+
return nodot + globstar(opts);
|
|
1272
|
+
case '**/*':
|
|
1273
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
|
1274
|
+
case '**/*.*':
|
|
1275
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1276
|
+
case '**/.*':
|
|
1277
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
1278
|
+
default:
|
|
1279
|
+
{
|
|
1280
|
+
let match = /^(.*?)\.(\w+)$/.exec(str);
|
|
1281
|
+
if (!match) return;
|
|
1282
|
+
let source = create(match[1]);
|
|
1283
|
+
if (!source) return;
|
|
1284
|
+
return source + DOT_LITERAL + match[2];
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
}, source = create(utils.removePrefix(input, {
|
|
1288
|
+
negated: !1,
|
|
1289
|
+
prefix: ''
|
|
1290
|
+
}));
|
|
1291
|
+
return source && !0 !== opts.strictSlashes && (source += `${SLASH_LITERAL}?`), source;
|
|
1292
|
+
}, module.exports = parse;
|
|
1293
|
+
},
|
|
1294
|
+
"../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
1295
|
+
let scan = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.js"), parse = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/parse.js"), utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.js"), constants = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.js"), picomatch = (glob, options, returnState = !1)=>{
|
|
1296
|
+
if (Array.isArray(glob)) {
|
|
1297
|
+
let fns = glob.map((input)=>picomatch(input, options, returnState));
|
|
1298
|
+
return (str)=>{
|
|
1299
|
+
for (let isMatch of fns){
|
|
1300
|
+
let state = isMatch(str);
|
|
1301
|
+
if (state) return state;
|
|
1302
|
+
}
|
|
1303
|
+
return !1;
|
|
1304
|
+
};
|
|
1305
|
+
}
|
|
1306
|
+
let isState = glob && 'object' == typeof glob && !Array.isArray(glob) && glob.tokens && glob.input;
|
|
1307
|
+
if ('' === glob || 'string' != typeof glob && !isState) throw TypeError('Expected pattern to be a non-empty string');
|
|
1308
|
+
let opts = options || {}, posix = opts.windows, regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, !1, !0), state = regex.state;
|
|
1309
|
+
delete regex.state;
|
|
1310
|
+
let isIgnored = ()=>!1;
|
|
1311
|
+
if (opts.ignore) {
|
|
1312
|
+
let ignoreOpts = {
|
|
1313
|
+
...options,
|
|
1314
|
+
ignore: null,
|
|
1315
|
+
onMatch: null,
|
|
1316
|
+
onResult: null
|
|
1317
|
+
};
|
|
1318
|
+
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
1319
|
+
}
|
|
1320
|
+
let matcher = (input, returnObject = !1)=>{
|
|
1321
|
+
let { isMatch, match, output } = picomatch.test(input, regex, options, {
|
|
1322
|
+
glob,
|
|
1323
|
+
posix
|
|
1324
|
+
}), result = {
|
|
1325
|
+
glob,
|
|
1326
|
+
state,
|
|
1327
|
+
regex,
|
|
1328
|
+
posix,
|
|
1329
|
+
input,
|
|
1330
|
+
output,
|
|
1331
|
+
match,
|
|
1332
|
+
isMatch
|
|
1333
|
+
};
|
|
1334
|
+
return ('function' == typeof opts.onResult && opts.onResult(result), !1 === isMatch) ? (result.isMatch = !1, !!returnObject && result) : isIgnored(input) ? ('function' == typeof opts.onIgnore && opts.onIgnore(result), result.isMatch = !1, !!returnObject && result) : ('function' == typeof opts.onMatch && opts.onMatch(result), !returnObject || result);
|
|
1335
|
+
};
|
|
1336
|
+
return returnState && (matcher.state = state), matcher;
|
|
1337
|
+
};
|
|
1338
|
+
picomatch.test = (input, regex, options, { glob, posix } = {})=>{
|
|
1339
|
+
if ('string' != typeof input) throw TypeError('Expected input to be a string');
|
|
1340
|
+
if ('' === input) return {
|
|
1341
|
+
isMatch: !1,
|
|
1342
|
+
output: ''
|
|
1343
|
+
};
|
|
1344
|
+
let opts = options || {}, format = opts.format || (posix ? utils.toPosixSlashes : null), match = input === glob, output = match && format ? format(input) : input;
|
|
1345
|
+
return !1 === match && (match = (output = format ? format(input) : input) === glob), (!1 === match || !0 === opts.capture) && (match = !0 === opts.matchBase || !0 === opts.basename ? picomatch.matchBase(input, regex, options, posix) : regex.exec(output)), {
|
|
1346
|
+
isMatch: !!match,
|
|
1347
|
+
match,
|
|
1348
|
+
output
|
|
1349
|
+
};
|
|
1350
|
+
}, picomatch.matchBase = (input, glob, options)=>(glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(utils.basename(input)), picomatch.isMatch = (str, patterns, options)=>picomatch(patterns, options)(str), picomatch.parse = (pattern, options)=>Array.isArray(pattern) ? pattern.map((p)=>picomatch.parse(p, options)) : parse(pattern, {
|
|
1351
|
+
...options,
|
|
1352
|
+
fastpaths: !1
|
|
1353
|
+
}), picomatch.scan = (input, options)=>scan(input, options), picomatch.compileRe = (state, options, returnOutput = !1, returnState = !1)=>{
|
|
1354
|
+
if (!0 === returnOutput) return state.output;
|
|
1355
|
+
let opts = options || {}, prepend = opts.contains ? '' : '^', append = opts.contains ? '' : '$', source = `${prepend}(?:${state.output})${append}`;
|
|
1356
|
+
state && !0 === state.negated && (source = `^(?!${source}).*$`);
|
|
1357
|
+
let regex = picomatch.toRegex(source, options);
|
|
1358
|
+
return !0 === returnState && (regex.state = state), regex;
|
|
1359
|
+
}, picomatch.makeRe = (input, options = {}, returnOutput = !1, returnState = !1)=>{
|
|
1360
|
+
if (!input || 'string' != typeof input) throw TypeError('Expected a non-empty string');
|
|
1361
|
+
let parsed = {
|
|
1362
|
+
negated: !1,
|
|
1363
|
+
fastpaths: !0
|
|
1364
|
+
};
|
|
1365
|
+
return !1 !== options.fastpaths && ('.' === input[0] || '*' === input[0]) && (parsed.output = parse.fastpaths(input, options)), parsed.output || (parsed = parse(input, options)), picomatch.compileRe(parsed, options, returnOutput, returnState);
|
|
1366
|
+
}, picomatch.toRegex = (source, options)=>{
|
|
1367
|
+
try {
|
|
1368
|
+
let opts = options || {};
|
|
1369
|
+
return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
|
|
1370
|
+
} catch (err) {
|
|
1371
|
+
if (options && !0 === options.debug) throw err;
|
|
1372
|
+
return /$^/;
|
|
1373
|
+
}
|
|
1374
|
+
}, picomatch.constants = constants, module.exports = picomatch;
|
|
1375
|
+
},
|
|
1376
|
+
"../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
1377
|
+
let utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.js"), { 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.3/node_modules/picomatch/lib/constants.js"), isPathSeparator = (code)=>code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH, depth = (token)=>{
|
|
1378
|
+
!0 !== token.isPrefix && (token.depth = token.isGlobstar ? 1 / 0 : 1);
|
|
1379
|
+
};
|
|
1380
|
+
module.exports = (input, options)=>{
|
|
1381
|
+
let prev, code, opts = options || {}, length = input.length - 1, scanToEnd = !0 === opts.parts || !0 === opts.scanToEnd, slashes = [], tokens = [], parts = [], str = input, index = -1, start = 0, lastIndex = 0, isBrace = !1, isBracket = !1, isGlob = !1, isExtglob = !1, isGlobstar = !1, braceEscaped = !1, backslashes = !1, negated = !1, negatedExtglob = !1, finished = !1, braces = 0, token = {
|
|
1382
|
+
value: '',
|
|
1383
|
+
depth: 0,
|
|
1384
|
+
isGlob: !1
|
|
1385
|
+
}, eos = ()=>index >= length, peek = ()=>str.charCodeAt(index + 1), advance = ()=>(prev = code, str.charCodeAt(++index));
|
|
1386
|
+
for(; index < length;){
|
|
1387
|
+
let next;
|
|
1388
|
+
if ((code = advance()) === CHAR_BACKWARD_SLASH) {
|
|
1389
|
+
backslashes = token.backslashes = !0, (code = advance()) === CHAR_LEFT_CURLY_BRACE && (braceEscaped = !0);
|
|
1390
|
+
continue;
|
|
1391
|
+
}
|
|
1392
|
+
if (!0 === braceEscaped || code === CHAR_LEFT_CURLY_BRACE) {
|
|
1393
|
+
for(braces++; !0 !== eos() && (code = advance());){
|
|
1394
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
1395
|
+
backslashes = token.backslashes = !0, advance();
|
|
1396
|
+
continue;
|
|
1397
|
+
}
|
|
1398
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
1399
|
+
braces++;
|
|
1400
|
+
continue;
|
|
1401
|
+
}
|
|
1402
|
+
if (!0 !== braceEscaped && code === CHAR_DOT && (code = advance()) === CHAR_DOT || !0 !== braceEscaped && code === CHAR_COMMA) {
|
|
1403
|
+
if (isBrace = token.isBrace = !0, isGlob = token.isGlob = !0, finished = !0, !0 === scanToEnd) continue;
|
|
1404
|
+
break;
|
|
1405
|
+
}
|
|
1406
|
+
if (code === CHAR_RIGHT_CURLY_BRACE && 0 == --braces) {
|
|
1407
|
+
braceEscaped = !1, isBrace = token.isBrace = !0, finished = !0;
|
|
1408
|
+
break;
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
if (!0 === scanToEnd) continue;
|
|
1412
|
+
break;
|
|
1413
|
+
}
|
|
1414
|
+
if (code === CHAR_FORWARD_SLASH) {
|
|
1415
|
+
if (slashes.push(index), tokens.push(token), token = {
|
|
1416
|
+
value: '',
|
|
1417
|
+
depth: 0,
|
|
1418
|
+
isGlob: !1
|
|
1419
|
+
}, !0 === finished) continue;
|
|
1420
|
+
if (prev === CHAR_DOT && index === start + 1) {
|
|
1421
|
+
start += 2;
|
|
1422
|
+
continue;
|
|
1423
|
+
}
|
|
1424
|
+
lastIndex = index + 1;
|
|
1425
|
+
continue;
|
|
1426
|
+
}
|
|
1427
|
+
if (!0 !== opts.noext && !0 == (code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK) && peek() === CHAR_LEFT_PARENTHESES) {
|
|
1428
|
+
if (isGlob = token.isGlob = !0, isExtglob = token.isExtglob = !0, finished = !0, code === CHAR_EXCLAMATION_MARK && index === start && (negatedExtglob = !0), !0 === scanToEnd) {
|
|
1429
|
+
for(; !0 !== eos() && (code = advance());){
|
|
1430
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
1431
|
+
backslashes = token.backslashes = !0, code = advance();
|
|
1432
|
+
continue;
|
|
1433
|
+
}
|
|
1434
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
1435
|
+
isGlob = token.isGlob = !0, finished = !0;
|
|
1436
|
+
break;
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
continue;
|
|
1440
|
+
}
|
|
1441
|
+
break;
|
|
1442
|
+
}
|
|
1443
|
+
if (code === CHAR_ASTERISK) {
|
|
1444
|
+
if (prev === CHAR_ASTERISK && (isGlobstar = token.isGlobstar = !0), isGlob = token.isGlob = !0, finished = !0, !0 === scanToEnd) continue;
|
|
1445
|
+
break;
|
|
1446
|
+
}
|
|
1447
|
+
if (code === CHAR_QUESTION_MARK) {
|
|
1448
|
+
if (isGlob = token.isGlob = !0, finished = !0, !0 === scanToEnd) continue;
|
|
1449
|
+
break;
|
|
1450
|
+
}
|
|
1451
|
+
if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
|
1452
|
+
for(; !0 !== eos() && (next = advance());){
|
|
1453
|
+
if (next === CHAR_BACKWARD_SLASH) {
|
|
1454
|
+
backslashes = token.backslashes = !0, advance();
|
|
1455
|
+
continue;
|
|
1456
|
+
}
|
|
1457
|
+
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
1458
|
+
isBracket = token.isBracket = !0, isGlob = token.isGlob = !0, finished = !0;
|
|
1459
|
+
break;
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
if (!0 === scanToEnd) continue;
|
|
1463
|
+
break;
|
|
1464
|
+
}
|
|
1465
|
+
if (!0 !== opts.nonegate && code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
1466
|
+
negated = token.negated = !0, start++;
|
|
1467
|
+
continue;
|
|
1468
|
+
}
|
|
1469
|
+
if (!0 !== opts.noparen && code === CHAR_LEFT_PARENTHESES) {
|
|
1470
|
+
if (isGlob = token.isGlob = !0, !0 === scanToEnd) {
|
|
1471
|
+
for(; !0 !== eos() && (code = advance());){
|
|
1472
|
+
if (code === CHAR_LEFT_PARENTHESES) {
|
|
1473
|
+
backslashes = token.backslashes = !0, code = advance();
|
|
1474
|
+
continue;
|
|
1475
|
+
}
|
|
1476
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
1477
|
+
finished = !0;
|
|
1478
|
+
break;
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
continue;
|
|
1482
|
+
}
|
|
1483
|
+
break;
|
|
1484
|
+
}
|
|
1485
|
+
if (!0 === isGlob) {
|
|
1486
|
+
if (finished = !0, !0 === scanToEnd) continue;
|
|
1487
|
+
break;
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
!0 === opts.noext && (isExtglob = !1, isGlob = !1);
|
|
1491
|
+
let base = str, prefix = '', glob = '';
|
|
1492
|
+
start > 0 && (prefix = str.slice(0, start), str = str.slice(start), lastIndex -= start), base && !0 === isGlob && lastIndex > 0 ? (base = str.slice(0, lastIndex), glob = str.slice(lastIndex)) : !0 === isGlob ? (base = '', glob = str) : base = str, base && '' !== base && '/' !== base && base !== str && isPathSeparator(base.charCodeAt(base.length - 1)) && (base = base.slice(0, -1)), !0 === opts.unescape && (glob && (glob = utils.removeBackslashes(glob)), base && !0 === backslashes && (base = utils.removeBackslashes(base)));
|
|
1493
|
+
let state = {
|
|
1494
|
+
prefix,
|
|
1495
|
+
input,
|
|
1496
|
+
start,
|
|
1497
|
+
base,
|
|
1498
|
+
glob,
|
|
1499
|
+
isBrace,
|
|
1500
|
+
isBracket,
|
|
1501
|
+
isGlob,
|
|
1502
|
+
isExtglob,
|
|
1503
|
+
isGlobstar,
|
|
1504
|
+
negated,
|
|
1505
|
+
negatedExtglob
|
|
1506
|
+
};
|
|
1507
|
+
if (!0 === opts.tokens && (state.maxDepth = 0, isPathSeparator(code) || tokens.push(token), state.tokens = tokens), !0 === opts.parts || !0 === opts.tokens) {
|
|
1508
|
+
let prevIndex;
|
|
1509
|
+
for(let idx = 0; idx < slashes.length; idx++){
|
|
1510
|
+
let n = prevIndex ? prevIndex + 1 : start, i = slashes[idx], value = input.slice(n, i);
|
|
1511
|
+
opts.tokens && (0 === idx && 0 !== start ? (tokens[idx].isPrefix = !0, tokens[idx].value = prefix) : tokens[idx].value = value, depth(tokens[idx]), state.maxDepth += tokens[idx].depth), (0 !== idx || '' !== value) && parts.push(value), prevIndex = i;
|
|
1512
|
+
}
|
|
1513
|
+
if (prevIndex && prevIndex + 1 < input.length) {
|
|
1514
|
+
let value = input.slice(prevIndex + 1);
|
|
1515
|
+
parts.push(value), opts.tokens && (tokens[tokens.length - 1].value = value, depth(tokens[tokens.length - 1]), state.maxDepth += tokens[tokens.length - 1].depth);
|
|
1516
|
+
}
|
|
1517
|
+
state.slashes = slashes, state.parts = parts;
|
|
1518
|
+
}
|
|
1519
|
+
return state;
|
|
1520
|
+
};
|
|
1521
|
+
},
|
|
1522
|
+
"../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
1523
|
+
let { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.js");
|
|
1524
|
+
exports.isObject = (val)=>null !== val && 'object' == typeof val && !Array.isArray(val), exports.hasRegexChars = (str)=>REGEX_SPECIAL_CHARS.test(str), exports.isRegexChar = (str)=>1 === str.length && exports.hasRegexChars(str), exports.escapeRegex = (str)=>str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'), exports.toPosixSlashes = (str)=>str.replace(REGEX_BACKSLASH, '/'), exports.isWindows = ()=>{
|
|
1525
|
+
if ("u" > typeof navigator && navigator.platform) {
|
|
1526
|
+
let platform = navigator.platform.toLowerCase();
|
|
1527
|
+
return 'win32' === platform || 'windows' === platform;
|
|
1528
|
+
}
|
|
1529
|
+
return "u" > typeof process && !!process.platform && 'win32' === process.platform;
|
|
1530
|
+
}, exports.removeBackslashes = (str)=>str.replace(REGEX_REMOVE_BACKSLASH, (match)=>'\\' === match ? '' : match), exports.escapeLast = (input, char, lastIdx)=>{
|
|
1531
|
+
let idx = input.lastIndexOf(char, lastIdx);
|
|
1532
|
+
return -1 === idx ? input : '\\' === input[idx - 1] ? exports.escapeLast(input, char, idx - 1) : `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
|
1533
|
+
}, exports.removePrefix = (input, state = {})=>{
|
|
1534
|
+
let output = input;
|
|
1535
|
+
return output.startsWith('./') && (output = output.slice(2), state.prefix = './'), output;
|
|
1536
|
+
}, exports.wrapOutput = (input, state = {}, options = {})=>{
|
|
1537
|
+
let prepend = options.contains ? '' : '^', append = options.contains ? '' : '$', output = `${prepend}(?:${input})${append}`;
|
|
1538
|
+
return !0 === state.negated && (output = `(?:^(?!${output}).*$)`), output;
|
|
1539
|
+
}, exports.basename = (path, { windows } = {})=>{
|
|
1540
|
+
let segs = path.split(windows ? /[\\/]/ : '/'), last = segs[segs.length - 1];
|
|
1541
|
+
return '' === last ? segs[segs.length - 2] : last;
|
|
1542
|
+
};
|
|
1543
|
+
},
|
|
561
1544
|
"../../node_modules/.pnpm/shallow-clone@3.0.1/node_modules/shallow-clone/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
562
1545
|
let valueOf = Symbol.prototype.valueOf, typeOf = __webpack_require__("../../node_modules/.pnpm/kind-of@6.0.3/node_modules/kind-of/index.js");
|
|
563
1546
|
module.exports = function(val, deep) {
|
|
@@ -1129,39 +2112,394 @@ __webpack_require__.add({
|
|
|
1129
2112
|
module.exports = __rspack_external_url;
|
|
1130
2113
|
}
|
|
1131
2114
|
});
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
2115
|
+
var LogColor, CACError = class extends Error {
|
|
2116
|
+
constructor(message){
|
|
2117
|
+
super(message), this.name = "CACError", "function" != typeof Error.captureStackTrace && (this.stack = Error(message).stack);
|
|
2118
|
+
}
|
|
2119
|
+
}, Option = class {
|
|
2120
|
+
rawName;
|
|
2121
|
+
description;
|
|
2122
|
+
name;
|
|
2123
|
+
names;
|
|
2124
|
+
isBoolean;
|
|
2125
|
+
required;
|
|
2126
|
+
config;
|
|
2127
|
+
negated;
|
|
2128
|
+
constructor(rawName, description, config){
|
|
2129
|
+
this.rawName = rawName, this.description = description, this.config = Object.assign({}, config), rawName = rawName.replaceAll(".*", ""), this.negated = !1, this.names = removeBrackets(rawName).split(",").map((v)=>{
|
|
2130
|
+
let name = v.trim().replace(/^-{1,2}/, "");
|
|
2131
|
+
return name.startsWith("no-") && (this.negated = !0, name = name.replace(/^no-/, "")), camelcaseOptionName(name);
|
|
2132
|
+
}).sort((a, b)=>a.length > b.length ? 1 : -1), this.name = this.names.at(-1), this.negated && null == this.config.default && (this.config.default = !0), rawName.includes("<") ? this.required = !0 : rawName.includes("[") ? this.required = !1 : this.isBoolean = !0;
|
|
2133
|
+
}
|
|
2134
|
+
};
|
|
2135
|
+
if ("u" > typeof process) {
|
|
2136
|
+
let runtimeName;
|
|
2137
|
+
runtimeName = "u" > typeof Deno && "string" == typeof Deno.version?.deno ? "deno" : "u" > typeof Bun && "string" == typeof Bun.version ? "bun" : "node", runtimeInfo = `${process.platform}-${process.arch} ${runtimeName}-${process.version}`, runtimeProcessArgs = process.argv;
|
|
2138
|
+
} else runtimeInfo = "u" < typeof navigator ? "unknown" : `${navigator.platform} ${navigator.userAgent}`;
|
|
2139
|
+
var Command = class {
|
|
2140
|
+
rawName;
|
|
2141
|
+
description;
|
|
2142
|
+
config;
|
|
2143
|
+
cli;
|
|
2144
|
+
options;
|
|
2145
|
+
aliasNames;
|
|
2146
|
+
name;
|
|
2147
|
+
args;
|
|
2148
|
+
commandAction;
|
|
2149
|
+
usageText;
|
|
2150
|
+
versionNumber;
|
|
2151
|
+
examples;
|
|
2152
|
+
helpCallback;
|
|
2153
|
+
globalCommand;
|
|
2154
|
+
constructor(rawName, description, config = {}, cli){
|
|
2155
|
+
this.rawName = rawName, this.description = description, this.config = config, this.cli = cli, this.options = [], this.aliasNames = [], this.name = removeBrackets(rawName), this.args = function(v) {
|
|
2156
|
+
let angledMatch, squareMatch, ANGLED_BRACKET_RE_GLOBAL = /<([^>]+)>/g, SQUARE_BRACKET_RE_GLOBAL = /\[([^\]]+)\]/g, res = [], parse = (match)=>{
|
|
2157
|
+
let variadic = !1, value = match[1];
|
|
2158
|
+
return value.startsWith("...") && (value = value.slice(3), variadic = !0), {
|
|
2159
|
+
required: match[0].startsWith("<"),
|
|
2160
|
+
value,
|
|
2161
|
+
variadic
|
|
2162
|
+
};
|
|
2163
|
+
};
|
|
2164
|
+
for(; angledMatch = ANGLED_BRACKET_RE_GLOBAL.exec(v);)res.push(parse(angledMatch));
|
|
2165
|
+
for(; squareMatch = SQUARE_BRACKET_RE_GLOBAL.exec(v);)res.push(parse(squareMatch));
|
|
2166
|
+
return res;
|
|
2167
|
+
}(rawName), this.examples = [];
|
|
2168
|
+
}
|
|
2169
|
+
usage(text) {
|
|
2170
|
+
return this.usageText = text, this;
|
|
2171
|
+
}
|
|
2172
|
+
allowUnknownOptions() {
|
|
2173
|
+
return this.config.allowUnknownOptions = !0, this;
|
|
2174
|
+
}
|
|
2175
|
+
ignoreOptionDefaultValue() {
|
|
2176
|
+
return this.config.ignoreOptionDefaultValue = !0, this;
|
|
2177
|
+
}
|
|
2178
|
+
version(version, customFlags = "-v, --version") {
|
|
2179
|
+
return this.versionNumber = version, this.option(customFlags, "Display version number"), this;
|
|
2180
|
+
}
|
|
2181
|
+
example(example) {
|
|
2182
|
+
return this.examples.push(example), this;
|
|
2183
|
+
}
|
|
2184
|
+
option(rawName, description, config) {
|
|
2185
|
+
let option = new Option(rawName, description, config);
|
|
2186
|
+
return this.options.push(option), this;
|
|
2187
|
+
}
|
|
2188
|
+
alias(name) {
|
|
2189
|
+
return this.aliasNames.push(name), this;
|
|
2190
|
+
}
|
|
2191
|
+
action(callback) {
|
|
2192
|
+
return this.commandAction = callback, this;
|
|
2193
|
+
}
|
|
2194
|
+
isMatched(name) {
|
|
2195
|
+
return this.name === name || this.aliasNames.includes(name);
|
|
2196
|
+
}
|
|
2197
|
+
get isDefaultCommand() {
|
|
2198
|
+
return "" === this.name || this.aliasNames.includes("!");
|
|
2199
|
+
}
|
|
2200
|
+
get isGlobalCommand() {
|
|
2201
|
+
return this instanceof GlobalCommand;
|
|
2202
|
+
}
|
|
2203
|
+
hasOption(name) {
|
|
2204
|
+
return name = name.split(".")[0], this.options.find((option)=>option.names.includes(name));
|
|
2205
|
+
}
|
|
2206
|
+
outputHelp() {
|
|
2207
|
+
let { name, commands } = this.cli, { versionNumber, options: globalOptions, helpCallback } = this.cli.globalCommand, sections = [
|
|
2208
|
+
{
|
|
2209
|
+
body: `${name}${versionNumber ? `/${versionNumber}` : ""}`
|
|
1151
2210
|
}
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
2211
|
+
];
|
|
2212
|
+
if (sections.push({
|
|
2213
|
+
title: "Usage",
|
|
2214
|
+
body: ` $ ${name} ${this.usageText || this.rawName}`
|
|
2215
|
+
}), (this.isGlobalCommand || this.isDefaultCommand) && commands.length > 0) {
|
|
2216
|
+
let longestCommandName = findLongest(commands.map((command)=>command.rawName));
|
|
2217
|
+
sections.push({
|
|
2218
|
+
title: "Commands",
|
|
2219
|
+
body: commands.map((command)=>` ${padRight(command.rawName, longestCommandName.length)} ${command.description}`).join("\n")
|
|
2220
|
+
}, {
|
|
2221
|
+
title: "For more info, run any command with the `--help` flag",
|
|
2222
|
+
body: commands.map((command)=>` $ ${name}${"" === command.name ? "" : ` ${command.name}`} --help`).join("\n")
|
|
2223
|
+
});
|
|
2224
|
+
}
|
|
2225
|
+
let options = this.isGlobalCommand ? globalOptions : [
|
|
2226
|
+
...this.options,
|
|
2227
|
+
...globalOptions || []
|
|
2228
|
+
];
|
|
2229
|
+
if (this.isGlobalCommand || this.isDefaultCommand || (options = options.filter((option)=>"version" !== option.name)), options.length > 0) {
|
|
2230
|
+
let longestOptionName = findLongest(options.map((option)=>option.rawName));
|
|
2231
|
+
sections.push({
|
|
2232
|
+
title: "Options",
|
|
2233
|
+
body: options.map((option)=>` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${void 0 === option.config.default ? "" : `(default: ${option.config.default})`}`).join("\n")
|
|
2234
|
+
});
|
|
2235
|
+
}
|
|
2236
|
+
this.examples.length > 0 && sections.push({
|
|
2237
|
+
title: "Examples",
|
|
2238
|
+
body: this.examples.map((example)=>"function" == typeof example ? example(name) : example).join("\n")
|
|
2239
|
+
}), helpCallback && (sections = helpCallback(sections) || sections), console.info(sections.map((section)=>section.title ? `${section.title}:\n${section.body}` : section.body).join("\n\n"));
|
|
2240
|
+
}
|
|
2241
|
+
outputVersion() {
|
|
2242
|
+
let { name } = this.cli, { versionNumber } = this.cli.globalCommand;
|
|
2243
|
+
versionNumber && console.info(`${name}/${versionNumber} ${runtimeInfo}`);
|
|
2244
|
+
}
|
|
2245
|
+
checkRequiredArgs() {
|
|
2246
|
+
let minimalArgsCount = this.args.filter((arg)=>arg.required).length;
|
|
2247
|
+
if (this.cli.args.length < minimalArgsCount) throw new CACError(`missing required args for command \`${this.rawName}\``);
|
|
2248
|
+
}
|
|
2249
|
+
checkUnknownOptions() {
|
|
2250
|
+
let { options, globalCommand } = this.cli;
|
|
2251
|
+
if (!this.config.allowUnknownOptions) {
|
|
2252
|
+
for (let name of Object.keys(options))if ("--" !== name && !this.hasOption(name) && !globalCommand.hasOption(name)) throw new CACError(`Unknown option \`${name.length > 1 ? `--${name}` : `-${name}`}\``);
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
checkOptionValue() {
|
|
2256
|
+
let { options: parsedOptions, globalCommand } = this.cli, options = [
|
|
2257
|
+
...globalCommand.options,
|
|
2258
|
+
...this.options
|
|
2259
|
+
];
|
|
2260
|
+
for (let option of options){
|
|
2261
|
+
let value = parsedOptions[option.name.split(".")[0]];
|
|
2262
|
+
if (option.required) {
|
|
2263
|
+
let hasNegated = options.some((o)=>o.negated && o.names.includes(option.name));
|
|
2264
|
+
if (!0 === value || !1 === value && !hasNegated) throw new CACError(`option \`${option.rawName}\` value is missing`);
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
checkUnusedArgs() {
|
|
2269
|
+
let maximumArgsCount = this.args.some((arg)=>arg.variadic) ? 1 / 0 : this.args.length;
|
|
2270
|
+
if (maximumArgsCount < this.cli.args.length) throw new CACError(`Unused args: ${this.cli.args.slice(maximumArgsCount).map((arg)=>`\`${arg}\``).join(", ")}`);
|
|
2271
|
+
}
|
|
2272
|
+
}, GlobalCommand = class extends Command {
|
|
2273
|
+
constructor(cli){
|
|
2274
|
+
super("@@global@@", "", {}, cli);
|
|
2275
|
+
}
|
|
2276
|
+
}, CAC = class extends EventTarget {
|
|
2277
|
+
name;
|
|
2278
|
+
commands;
|
|
2279
|
+
globalCommand;
|
|
2280
|
+
matchedCommand;
|
|
2281
|
+
matchedCommandName;
|
|
2282
|
+
rawArgs;
|
|
2283
|
+
args;
|
|
2284
|
+
options;
|
|
2285
|
+
showHelpOnExit;
|
|
2286
|
+
showVersionOnExit;
|
|
2287
|
+
constructor(name = ""){
|
|
2288
|
+
super(), this.name = name, this.commands = [], this.rawArgs = [], this.args = [], this.options = {}, this.globalCommand = new GlobalCommand(this), this.globalCommand.usage("<command> [options]");
|
|
2289
|
+
}
|
|
2290
|
+
usage(text) {
|
|
2291
|
+
return this.globalCommand.usage(text), this;
|
|
2292
|
+
}
|
|
2293
|
+
command(rawName, description, config) {
|
|
2294
|
+
let command = new Command(rawName, description || "", config, this);
|
|
2295
|
+
return command.globalCommand = this.globalCommand, this.commands.push(command), command;
|
|
2296
|
+
}
|
|
2297
|
+
option(rawName, description, config) {
|
|
2298
|
+
return this.globalCommand.option(rawName, description, config), this;
|
|
2299
|
+
}
|
|
2300
|
+
help(callback) {
|
|
2301
|
+
return this.globalCommand.option("-h, --help", "Display this message"), this.globalCommand.helpCallback = callback, this.showHelpOnExit = !0, this;
|
|
2302
|
+
}
|
|
2303
|
+
version(version, customFlags = "-v, --version") {
|
|
2304
|
+
return this.globalCommand.version(version, customFlags), this.showVersionOnExit = !0, this;
|
|
2305
|
+
}
|
|
2306
|
+
example(example) {
|
|
2307
|
+
return this.globalCommand.example(example), this;
|
|
2308
|
+
}
|
|
2309
|
+
outputHelp() {
|
|
2310
|
+
this.matchedCommand ? this.matchedCommand.outputHelp() : this.globalCommand.outputHelp();
|
|
2311
|
+
}
|
|
2312
|
+
outputVersion() {
|
|
2313
|
+
this.globalCommand.outputVersion();
|
|
2314
|
+
}
|
|
2315
|
+
setParsedInfo({ args, options }, matchedCommand, matchedCommandName) {
|
|
2316
|
+
return this.args = args, this.options = options, matchedCommand && (this.matchedCommand = matchedCommand), matchedCommandName && (this.matchedCommandName = matchedCommandName), this;
|
|
2317
|
+
}
|
|
2318
|
+
unsetMatchedCommand() {
|
|
2319
|
+
this.matchedCommand = void 0, this.matchedCommandName = void 0;
|
|
2320
|
+
}
|
|
2321
|
+
parse(argv, { run = !0 } = {}) {
|
|
2322
|
+
var input;
|
|
2323
|
+
let m;
|
|
2324
|
+
if (!argv) {
|
|
2325
|
+
if (!runtimeProcessArgs) throw Error("No argv provided and runtime process argv is not available.");
|
|
2326
|
+
argv = runtimeProcessArgs;
|
|
2327
|
+
}
|
|
2328
|
+
this.rawArgs = argv, this.name || (this.name = argv[1] ? (input = argv[1], (m = /([^\\/]+)$/.exec(input)) ? m[1] : "") : "cli");
|
|
2329
|
+
let shouldParse = !0;
|
|
2330
|
+
for (let command of this.commands){
|
|
2331
|
+
let parsed = this.mri(argv.slice(2), command), commandName = parsed.args[0];
|
|
2332
|
+
if (command.isMatched(commandName)) {
|
|
2333
|
+
shouldParse = !1;
|
|
2334
|
+
let parsedInfo = {
|
|
2335
|
+
...parsed,
|
|
2336
|
+
args: parsed.args.slice(1)
|
|
2337
|
+
};
|
|
2338
|
+
this.setParsedInfo(parsedInfo, command, commandName), this.dispatchEvent(new CustomEvent(`command:${commandName}`, {
|
|
2339
|
+
detail: command
|
|
2340
|
+
}));
|
|
2341
|
+
}
|
|
2342
|
+
}
|
|
2343
|
+
if (shouldParse) {
|
|
2344
|
+
for (let command of this.commands)if (command.isDefaultCommand) {
|
|
2345
|
+
shouldParse = !1;
|
|
2346
|
+
let parsed = this.mri(argv.slice(2), command);
|
|
2347
|
+
this.setParsedInfo(parsed, command), this.dispatchEvent(new CustomEvent("command:!", {
|
|
2348
|
+
detail: command
|
|
2349
|
+
}));
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
if (shouldParse) {
|
|
2353
|
+
let parsed = this.mri(argv.slice(2));
|
|
2354
|
+
this.setParsedInfo(parsed);
|
|
2355
|
+
}
|
|
2356
|
+
this.options.help && this.showHelpOnExit && (this.outputHelp(), run = !1, this.unsetMatchedCommand()), this.options.version && this.showVersionOnExit && null == this.matchedCommandName && (this.outputVersion(), run = !1, this.unsetMatchedCommand());
|
|
2357
|
+
let parsedArgv = {
|
|
2358
|
+
args: this.args,
|
|
2359
|
+
options: this.options
|
|
2360
|
+
};
|
|
2361
|
+
return run && this.runMatchedCommand(), !this.matchedCommand && this.args[0] && this.dispatchEvent(new CustomEvent("command:*", {
|
|
2362
|
+
detail: this.args[0]
|
|
2363
|
+
})), parsedArgv;
|
|
2364
|
+
}
|
|
2365
|
+
mri(argv, command) {
|
|
2366
|
+
let cliOptions = [
|
|
2367
|
+
...this.globalCommand.options,
|
|
2368
|
+
...command ? command.options : []
|
|
2369
|
+
], mriOptions = function(options) {
|
|
2370
|
+
let result = {
|
|
2371
|
+
alias: {},
|
|
2372
|
+
boolean: []
|
|
2373
|
+
};
|
|
2374
|
+
for (let [index, option] of options.entries())option.names.length > 1 && (result.alias[option.names[0]] = option.names.slice(1)), option.isBoolean && (option.negated && options.some((o, i)=>i !== index && o.names.some((name)=>option.names.includes(name)) && "boolean" == typeof o.required) || result.boolean.push(option.names[0]));
|
|
2375
|
+
return result;
|
|
2376
|
+
}(cliOptions), argsAfterDoubleDashes = [], doubleDashesIndex = argv.indexOf("--");
|
|
2377
|
+
-1 !== doubleDashesIndex && (argsAfterDoubleDashes = argv.slice(doubleDashesIndex + 1), argv = argv.slice(0, doubleDashesIndex));
|
|
2378
|
+
let parsed = function(args, opts) {
|
|
2379
|
+
opts = opts || {};
|
|
2380
|
+
var k, arr, arg, name, val, out = {
|
|
2381
|
+
_: []
|
|
2382
|
+
}, i = 0, j = 0, idx = 0, len = (args = args || []).length;
|
|
2383
|
+
let alibi = void 0 !== opts.alias, strict = void 0 !== opts.unknown, defaults = void 0 !== opts.default;
|
|
2384
|
+
if (opts.alias = opts.alias || {}, opts.string = toArr(opts.string), opts.boolean = toArr(opts.boolean), alibi) for(k in opts.alias)for(i = 0, arr = opts.alias[k] = toArr(opts.alias[k]); i < arr.length; i++)(opts.alias[arr[i]] = arr.concat(k)).splice(i, 1);
|
|
2385
|
+
for(i = opts.boolean.length; i-- > 0;)for(j = (arr = opts.alias[opts.boolean[i]] || []).length; j-- > 0;)opts.boolean.push(arr[j]);
|
|
2386
|
+
for(i = opts.string.length; i-- > 0;)for(j = (arr = opts.alias[opts.string[i]] || []).length; j-- > 0;)opts.string.push(arr[j]);
|
|
2387
|
+
if (defaults) {
|
|
2388
|
+
for(k in opts.default)if (name = typeof opts.default[k], arr = opts.alias[k] = opts.alias[k] || [], void 0 !== opts[name]) for(opts[name].push(k), i = 0; i < arr.length; i++)opts[name].push(arr[i]);
|
|
2389
|
+
}
|
|
2390
|
+
let keys = strict ? Object.keys(opts.alias) : [];
|
|
2391
|
+
for(i = 0; i < len; i++){
|
|
2392
|
+
if ("--" === (arg = args[i])) {
|
|
2393
|
+
out._ = out._.concat(args.slice(++i));
|
|
2394
|
+
break;
|
|
2395
|
+
}
|
|
2396
|
+
for(j = 0; j < arg.length && 45 === arg.charCodeAt(j); j++);
|
|
2397
|
+
if (0 === j) out._.push(arg);
|
|
2398
|
+
else if ("no-" === arg.substring(j, j + 3)) {
|
|
2399
|
+
if (name = arg.substring(j + 3), strict && !~keys.indexOf(name)) return opts.unknown(arg);
|
|
2400
|
+
out[name] = !1;
|
|
2401
|
+
} else {
|
|
2402
|
+
for(idx = j + 1; idx < arg.length && 61 !== arg.charCodeAt(idx); idx++);
|
|
2403
|
+
for(name = arg.substring(j, idx), val = arg.substring(++idx) || i + 1 === len || 45 === ("" + args[i + 1]).charCodeAt(0) || args[++i], arr = 2 === j ? [
|
|
2404
|
+
name
|
|
2405
|
+
] : name, idx = 0; idx < arr.length; idx++){
|
|
2406
|
+
if (name = arr[idx], strict && !~keys.indexOf(name)) return opts.unknown("-".repeat(j) + name);
|
|
2407
|
+
!function(out, key, val, opts) {
|
|
2408
|
+
var x, old = out[key], nxt = ~opts.string.indexOf(key) ? null == val || !0 === val ? "" : String(val) : "boolean" == typeof val ? val : ~opts.boolean.indexOf(key) ? "false" !== val && ("true" === val || (out._.push(0 * (x = +val) == 0 ? x : val), !!val)) : 0 * (x = +val) == 0 ? x : val;
|
|
2409
|
+
out[key] = null == old ? nxt : Array.isArray(old) ? old.concat(nxt) : [
|
|
2410
|
+
old,
|
|
2411
|
+
nxt
|
|
2412
|
+
];
|
|
2413
|
+
}(out, name, idx + 1 < arr.length || val, opts);
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
if (defaults) for(k in opts.default)void 0 === out[k] && (out[k] = opts.default[k]);
|
|
2418
|
+
if (alibi) for(k in out)for(arr = opts.alias[k] || []; arr.length > 0;)out[arr.shift()] = out[k];
|
|
2419
|
+
return out;
|
|
2420
|
+
}(argv, mriOptions), args = (parsed = Object.keys(parsed).reduce((res, name)=>({
|
|
2421
|
+
...res,
|
|
2422
|
+
[camelcaseOptionName(name)]: parsed[name]
|
|
2423
|
+
}), {
|
|
2424
|
+
_: []
|
|
2425
|
+
}))._, options = {
|
|
2426
|
+
"--": argsAfterDoubleDashes
|
|
2427
|
+
}, ignoreDefault = command && command.config.ignoreOptionDefaultValue ? command.config.ignoreOptionDefaultValue : this.globalCommand.config.ignoreOptionDefaultValue, transforms = Object.create(null);
|
|
2428
|
+
for (let cliOption of cliOptions){
|
|
2429
|
+
if (!ignoreDefault && void 0 !== cliOption.config.default) for (let name of cliOption.names)options[name] = cliOption.config.default;
|
|
2430
|
+
Array.isArray(cliOption.config.type) && void 0 === transforms[cliOption.name] && (transforms[cliOption.name] = Object.create(null), transforms[cliOption.name].shouldTransform = !0, transforms[cliOption.name].transformFunction = cliOption.config.type[0]);
|
|
2431
|
+
}
|
|
2432
|
+
for (let key of Object.keys(parsed))if ("_" !== key) {
|
|
2433
|
+
!function(obj, keys, val) {
|
|
2434
|
+
let current = obj;
|
|
2435
|
+
for(let i = 0; i < keys.length; i++){
|
|
2436
|
+
let key = keys[i];
|
|
2437
|
+
if (i === keys.length - 1) {
|
|
2438
|
+
current[key] = val;
|
|
2439
|
+
return;
|
|
2440
|
+
}
|
|
2441
|
+
if (null == current[key]) {
|
|
2442
|
+
let nextKeyIsArrayIndex = +keys[i + 1] > -1;
|
|
2443
|
+
current[key] = nextKeyIsArrayIndex ? [] : {};
|
|
2444
|
+
}
|
|
2445
|
+
current = current[key];
|
|
2446
|
+
}
|
|
2447
|
+
}(options, key.split("."), parsed[key]);
|
|
2448
|
+
for (let key of Object.keys(transforms)){
|
|
2449
|
+
let transform = transforms[key];
|
|
2450
|
+
transform.shouldTransform && (options[key] = [
|
|
2451
|
+
options[key]
|
|
2452
|
+
].flat(), "function" == typeof transform.transformFunction && (options[key] = options[key].map(transform.transformFunction)));
|
|
2453
|
+
}
|
|
2454
|
+
}
|
|
2455
|
+
return {
|
|
2456
|
+
args,
|
|
2457
|
+
options
|
|
2458
|
+
};
|
|
2459
|
+
}
|
|
2460
|
+
runMatchedCommand() {
|
|
2461
|
+
let { args, options, matchedCommand: command } = this;
|
|
2462
|
+
if (!command || !command.commandAction) return;
|
|
2463
|
+
command.checkUnknownOptions(), command.checkOptionValue(), command.checkRequiredArgs(), command.checkUnusedArgs();
|
|
2464
|
+
let actionArgs = [];
|
|
2465
|
+
return command.args.forEach((arg, index)=>{
|
|
2466
|
+
arg.variadic ? actionArgs.push(args.slice(index)) : actionArgs.push(args[index]);
|
|
2467
|
+
}), actionArgs.push(options), command.commandAction.apply(this, actionArgs);
|
|
2468
|
+
}
|
|
2469
|
+
};
|
|
2470
|
+
let isCI = !!process.env.CI, isTTY = !!process.stdout?.isTTY, noColor = !!process.env.NO_COLOR, forceColor = !!process.env.FORCE_COLOR, disableColor = !1;
|
|
2471
|
+
disableColor = !!noColor || !forceColor && (isCI || !isTTY);
|
|
2472
|
+
let ANSI_SGR_RE = /\x1b\[[0-9;]*m/g, ANSI_OPEN_RE = /\x1b\[([0-9;]+)m/g, COLOR_HEX = {
|
|
2473
|
+
brand: '#B39AFF',
|
|
2474
|
+
red: '#F38BA8',
|
|
2475
|
+
green: '#A6E3A1',
|
|
2476
|
+
yellow: '#F9E2AF',
|
|
2477
|
+
blue: '#89B4FA',
|
|
2478
|
+
magenta: '#EE90DB',
|
|
2479
|
+
cyan: '#89DCEB',
|
|
2480
|
+
gray: '#6C7086'
|
|
2481
|
+
}, COLOR_HEX_TO_OPEN = Object.fromEntries(Object.values(COLOR_HEX).map((hex)=>[
|
|
2482
|
+
hex,
|
|
2483
|
+
((hex)=>{
|
|
2484
|
+
let r, g, b, value = (hex || '').trim().replace(/^#/, '');
|
|
2485
|
+
if (/^[0-9a-fA-F]{3}$/.test(value)) r = Number.parseInt(value[0] + value[0], 16), g = Number.parseInt(value[1] + value[1], 16), b = Number.parseInt(value[2] + value[2], 16);
|
|
2486
|
+
else {
|
|
2487
|
+
if (!/^[0-9a-fA-F]{6}$/.test(value)) return '';
|
|
2488
|
+
r = Number.parseInt(value.slice(0, 2), 16), g = Number.parseInt(value.slice(2, 4), 16), b = Number.parseInt(value.slice(4, 6), 16);
|
|
2489
|
+
}
|
|
2490
|
+
return `\x1b[38;2;${r};${g};${b}m`;
|
|
2491
|
+
})(hex)
|
|
2492
|
+
])), hexColor = (hex)=>{
|
|
2493
|
+
if (disableColor) return (input)=>String(input);
|
|
2494
|
+
let open = COLOR_HEX_TO_OPEN[hex];
|
|
2495
|
+
return open ? (input)=>`${open}${input}\x1b[39m` : (input)=>String(input);
|
|
2496
|
+
}, ansi = (open, close)=>(input)=>disableColor ? String(input) : `${open}${input}${close}`, colors = {
|
|
2497
|
+
brand: hexColor(COLOR_HEX.brand),
|
|
2498
|
+
red: hexColor(COLOR_HEX.red),
|
|
2499
|
+
green: hexColor(COLOR_HEX.green),
|
|
2500
|
+
yellow: hexColor(COLOR_HEX.yellow),
|
|
2501
|
+
blue: hexColor(COLOR_HEX.blue),
|
|
2502
|
+
magenta: hexColor(COLOR_HEX.magenta),
|
|
1165
2503
|
cyan: hexColor(COLOR_HEX.cyan),
|
|
1166
2504
|
gray: hexColor(COLOR_HEX.gray),
|
|
1167
2505
|
bold: ansi('\x1b[1m', '\x1b[22m'),
|
|
@@ -1195,7 +2533,7 @@ function convertBasicAnsiColors(input) {
|
|
|
1195
2533
|
return `${styleSeq}${open}`;
|
|
1196
2534
|
}) : '';
|
|
1197
2535
|
}
|
|
1198
|
-
var
|
|
2536
|
+
var logger_LogColor = ((LogColor = {}).error = "red", LogColor.warn = "yellow", LogColor.info = "cyan", LogColor.ready = "green", LogColor.event = "magenta", LogColor.wait = "blue", LogColor);
|
|
1199
2537
|
let CSS_MODULES_LOCAL_IDENT_NAME = '[path][name]__[local]--[hash:5]', CSS_MODULES_EXPORTS_CONVENTION = 'camel-case', DEV_DEFAULT_FILENAME = {
|
|
1200
2538
|
js: 'js/[name].js',
|
|
1201
2539
|
jsAsync: 'js/async/[name].js',
|
|
@@ -1217,13 +2555,535 @@ let CSS_MODULES_LOCAL_IDENT_NAME = '[path][name]__[local]--[hash:5]', CSS_MODULE
|
|
|
1217
2555
|
<body>
|
|
1218
2556
|
<div id="${mountId}"></div>
|
|
1219
2557
|
</body>
|
|
1220
|
-
</html>`, JS_REGEX = /\.[jt]s$/, JSX_REGEX = /\.[jt]sx$/, SCRIPT_REGEX = /\.[jt]sx?$/, CSS_REGEX = /\.css$/i, LESS_REGEX = /\.less$/i, SASS_REGEX = /\.s[ac]ss$/i, CSS_MODULES_RESOURCE_QUERY_REGEX = /[?&]module(?:[=&]|$)
|
|
2558
|
+
</html>`, JS_REGEX = /\.[jt]s$/, JSX_REGEX = /\.[jt]sx$/, SCRIPT_REGEX = /\.[jt]sx?$/, CSS_REGEX = /\.css$/i, LESS_REGEX = /\.less$/i, SASS_REGEX = /\.s[ac]ss$/i, CSS_MODULES_RESOURCE_QUERY_REGEX = /[?&]module(?:[=&]|$)/, external_path_ = __webpack_require__("path"), external_fs_ = __webpack_require__("fs");
|
|
2559
|
+
var __require = createRequire(import.meta.url);
|
|
2560
|
+
let SLASHES_REGEX = /[\\/]/g;
|
|
2561
|
+
function convertSlashes(path, separator) {
|
|
2562
|
+
return path.replace(SLASHES_REGEX, separator);
|
|
2563
|
+
}
|
|
2564
|
+
let WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
|
|
2565
|
+
function normalizePath(path, options) {
|
|
2566
|
+
var path1;
|
|
2567
|
+
let normalized, { resolvePaths, normalizePath: normalizePath$1, pathSeparator } = options, pathNeedsCleaning = "win32" === process.platform && path.includes("/") || path.startsWith(".");
|
|
2568
|
+
return resolvePaths && (path = (0, external_path_.resolve)(path)), ((normalizePath$1 || pathNeedsCleaning) && (path1 = path, (normalized = (0, external_path_.normalize)(path1)).length > 1 && normalized[normalized.length - 1] === external_path_.sep && (normalized = normalized.substring(0, normalized.length - 1)), path = normalized), "." === path) ? "" : convertSlashes(path[path.length - 1] !== pathSeparator ? path + pathSeparator : path, pathSeparator);
|
|
2569
|
+
}
|
|
2570
|
+
function joinPathWithBasePath(filename, directoryPath) {
|
|
2571
|
+
return directoryPath + filename;
|
|
2572
|
+
}
|
|
2573
|
+
function joinPath(filename) {
|
|
2574
|
+
return filename;
|
|
2575
|
+
}
|
|
2576
|
+
let pushDirectory = (directoryPath, paths)=>{
|
|
2577
|
+
paths.push(directoryPath || ".");
|
|
2578
|
+
}, pushDirectoryFilter = (directoryPath, paths, filters)=>{
|
|
2579
|
+
let path = directoryPath || ".";
|
|
2580
|
+
filters.every((filter)=>filter(path, !0)) && paths.push(path);
|
|
2581
|
+
}, empty$2 = ()=>{}, pushFileFilterAndCount = (filename, _paths, counts, filters)=>{
|
|
2582
|
+
filters.every((filter)=>filter(filename, !1)) && counts.files++;
|
|
2583
|
+
}, pushFileFilter = (filename, paths, _counts, filters)=>{
|
|
2584
|
+
filters.every((filter)=>filter(filename, !1)) && paths.push(filename);
|
|
2585
|
+
}, pushFileCount = (_filename, _paths, counts, _filters)=>{
|
|
2586
|
+
counts.files++;
|
|
2587
|
+
}, pushFile = (filename, paths)=>{
|
|
2588
|
+
paths.push(filename);
|
|
2589
|
+
}, empty$1 = ()=>{}, getArray = (paths)=>paths, getArrayGroup = ()=>[
|
|
2590
|
+
""
|
|
2591
|
+
].slice(0, 0), groupFiles = (groups, directory, files)=>{
|
|
2592
|
+
groups.push({
|
|
2593
|
+
directory,
|
|
2594
|
+
files,
|
|
2595
|
+
dir: directory
|
|
2596
|
+
});
|
|
2597
|
+
}, empty = ()=>{}, resolveSymlinksAsync = function(path, state, callback$1) {
|
|
2598
|
+
let { queue, fs, options: { suppressErrors } } = state;
|
|
2599
|
+
queue.enqueue(), fs.realpath(path, (error, resolvedPath)=>{
|
|
2600
|
+
if (error) return queue.dequeue(suppressErrors ? null : error, state);
|
|
2601
|
+
fs.stat(resolvedPath, (error$1, stat)=>error$1 ? queue.dequeue(suppressErrors ? null : error$1, state) : stat.isDirectory() && isRecursive(path, resolvedPath, state) ? queue.dequeue(null, state) : void (callback$1(stat, resolvedPath), queue.dequeue(null, state)));
|
|
2602
|
+
});
|
|
2603
|
+
}, resolveSymlinks = function(path, state, callback$1) {
|
|
2604
|
+
let { queue, fs, options: { suppressErrors } } = state;
|
|
2605
|
+
queue.enqueue();
|
|
2606
|
+
try {
|
|
2607
|
+
let resolvedPath = fs.realpathSync(path), stat = fs.statSync(resolvedPath);
|
|
2608
|
+
if (stat.isDirectory() && isRecursive(path, resolvedPath, state)) return;
|
|
2609
|
+
callback$1(stat, resolvedPath);
|
|
2610
|
+
} catch (e) {
|
|
2611
|
+
if (!suppressErrors) throw e;
|
|
2612
|
+
}
|
|
2613
|
+
};
|
|
2614
|
+
function isRecursive(path, resolved, state) {
|
|
2615
|
+
if (state.options.useRealPaths) {
|
|
2616
|
+
var resolved1, state1;
|
|
2617
|
+
return resolved1 = resolved, (state1 = state).visited.includes(resolved1 + state1.options.pathSeparator);
|
|
2618
|
+
}
|
|
2619
|
+
let parent = (0, external_path_.dirname)(path), depth = 1;
|
|
2620
|
+
for(; parent !== state.root && depth < 2;){
|
|
2621
|
+
let resolvedPath = state.symlinks.get(parent);
|
|
2622
|
+
resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath)) ? depth++ : parent = (0, external_path_.dirname)(parent);
|
|
2623
|
+
}
|
|
2624
|
+
return state.symlinks.set(path, resolved), depth > 1;
|
|
2625
|
+
}
|
|
2626
|
+
let onlyCountsSync = (state)=>state.counts, groupsSync = (state)=>state.groups, defaultSync = (state)=>state.paths, limitFilesSync = (state)=>state.paths.slice(0, state.options.maxFiles), onlyCountsAsync = (state, error, callback$1)=>(report(error, callback$1, state.counts, state.options.suppressErrors), null), defaultAsync = (state, error, callback$1)=>(report(error, callback$1, state.paths, state.options.suppressErrors), null), limitFilesAsync = (state, error, callback$1)=>(report(error, callback$1, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors), null), groupsAsync = (state, error, callback$1)=>(report(error, callback$1, state.groups, state.options.suppressErrors), null);
|
|
2627
|
+
function report(error, callback$1, output, suppressErrors) {
|
|
2628
|
+
callback$1(error && !suppressErrors ? error : null, output);
|
|
2629
|
+
}
|
|
2630
|
+
let readdirOpts = {
|
|
2631
|
+
withFileTypes: !0
|
|
2632
|
+
}, walkAsync = (state, crawlPath, directoryPath, currentDepth, callback$1)=>{
|
|
2633
|
+
if (state.queue.enqueue(), currentDepth < 0) return state.queue.dequeue(null, state);
|
|
2634
|
+
let { fs } = state;
|
|
2635
|
+
state.visited.push(crawlPath), state.counts.directories++, fs.readdir(crawlPath || ".", readdirOpts, (error, entries = [])=>{
|
|
2636
|
+
callback$1(entries, directoryPath, currentDepth), state.queue.dequeue(state.options.suppressErrors ? null : error, state);
|
|
2637
|
+
});
|
|
2638
|
+
}, walkSync = (state, crawlPath, directoryPath, currentDepth, callback$1)=>{
|
|
2639
|
+
let { fs } = state;
|
|
2640
|
+
if (currentDepth < 0) return;
|
|
2641
|
+
state.visited.push(crawlPath), state.counts.directories++;
|
|
2642
|
+
let entries = [];
|
|
2643
|
+
try {
|
|
2644
|
+
entries = fs.readdirSync(crawlPath || ".", readdirOpts);
|
|
2645
|
+
} catch (e) {
|
|
2646
|
+
if (!state.options.suppressErrors) throw e;
|
|
2647
|
+
}
|
|
2648
|
+
callback$1(entries, directoryPath, currentDepth);
|
|
2649
|
+
};
|
|
2650
|
+
var Queue = class {
|
|
2651
|
+
count = 0;
|
|
2652
|
+
constructor(onQueueEmpty){
|
|
2653
|
+
this.onQueueEmpty = onQueueEmpty;
|
|
2654
|
+
}
|
|
2655
|
+
enqueue() {
|
|
2656
|
+
return this.count++, this.count;
|
|
2657
|
+
}
|
|
2658
|
+
dequeue(error, output) {
|
|
2659
|
+
this.onQueueEmpty && (--this.count <= 0 || error) && (this.onQueueEmpty(error, output), error && (output.controller.abort(), this.onQueueEmpty = void 0));
|
|
2660
|
+
}
|
|
2661
|
+
}, Counter = class {
|
|
2662
|
+
_files = 0;
|
|
2663
|
+
_directories = 0;
|
|
2664
|
+
set files(num) {
|
|
2665
|
+
this._files = num;
|
|
2666
|
+
}
|
|
2667
|
+
get files() {
|
|
2668
|
+
return this._files;
|
|
2669
|
+
}
|
|
2670
|
+
set directories(num) {
|
|
2671
|
+
this._directories = num;
|
|
2672
|
+
}
|
|
2673
|
+
get directories() {
|
|
2674
|
+
return this._directories;
|
|
2675
|
+
}
|
|
2676
|
+
get dirs() {
|
|
2677
|
+
return this._directories;
|
|
2678
|
+
}
|
|
2679
|
+
}, Aborter = class {
|
|
2680
|
+
aborted = !1;
|
|
2681
|
+
abort() {
|
|
2682
|
+
this.aborted = !0;
|
|
2683
|
+
}
|
|
2684
|
+
}, Walker = class {
|
|
2685
|
+
root;
|
|
2686
|
+
isSynchronous;
|
|
2687
|
+
state;
|
|
2688
|
+
joinPath;
|
|
2689
|
+
pushDirectory;
|
|
2690
|
+
pushFile;
|
|
2691
|
+
getArray;
|
|
2692
|
+
groupFiles;
|
|
2693
|
+
resolveSymlink;
|
|
2694
|
+
walkDirectory;
|
|
2695
|
+
callbackInvoker;
|
|
2696
|
+
constructor(root, options, callback$1){
|
|
2697
|
+
var path, isSynchronous;
|
|
2698
|
+
this.isSynchronous = !callback$1, this.callbackInvoker = function(options, isSynchronous) {
|
|
2699
|
+
let { onlyCounts, group, maxFiles } = options;
|
|
2700
|
+
return onlyCounts ? isSynchronous ? onlyCountsSync : onlyCountsAsync : group ? isSynchronous ? groupsSync : groupsAsync : maxFiles ? isSynchronous ? limitFilesSync : limitFilesAsync : isSynchronous ? defaultSync : defaultAsync;
|
|
2701
|
+
}(options, this.isSynchronous), this.root = normalizePath(root, options), this.state = {
|
|
2702
|
+
root: "/" === (path = this.root) || WINDOWS_ROOT_DIR_REGEX.test(path) ? this.root : this.root.slice(0, -1),
|
|
2703
|
+
paths: [
|
|
2704
|
+
""
|
|
2705
|
+
].slice(0, 0),
|
|
2706
|
+
groups: [],
|
|
2707
|
+
counts: new Counter(),
|
|
2708
|
+
options,
|
|
2709
|
+
queue: new Queue((error, state)=>this.callbackInvoker(state, error, callback$1)),
|
|
2710
|
+
symlinks: new Map(),
|
|
2711
|
+
visited: [
|
|
2712
|
+
""
|
|
2713
|
+
].slice(0, 0),
|
|
2714
|
+
controller: new Aborter(),
|
|
2715
|
+
fs: options.fs || external_fs_
|
|
2716
|
+
}, this.joinPath = function(root, options) {
|
|
2717
|
+
let { relativePaths, includeBasePath } = options;
|
|
2718
|
+
return relativePaths && root ? function(filename, directoryPath) {
|
|
2719
|
+
return directoryPath.startsWith(root) ? directoryPath.slice(root.length) + filename : convertSlashes((0, external_path_.relative)(root, directoryPath), options.pathSeparator) + options.pathSeparator + filename;
|
|
2720
|
+
} : includeBasePath ? joinPathWithBasePath : joinPath;
|
|
2721
|
+
}(this.root, options), this.pushDirectory = function(root, options) {
|
|
2722
|
+
let { includeDirs, filters, relativePaths } = options;
|
|
2723
|
+
if (!includeDirs) return empty$2;
|
|
2724
|
+
if (relativePaths) return filters && filters.length ? function(directoryPath, paths, filters) {
|
|
2725
|
+
let relativePath = directoryPath.substring(root.length) || ".";
|
|
2726
|
+
filters.every((filter)=>filter(relativePath, !0)) && paths.push(relativePath);
|
|
2727
|
+
} : function(directoryPath, paths) {
|
|
2728
|
+
paths.push(directoryPath.substring(root.length) || ".");
|
|
2729
|
+
};
|
|
2730
|
+
return filters && filters.length ? pushDirectoryFilter : pushDirectory;
|
|
2731
|
+
}(this.root, options), this.pushFile = function(options) {
|
|
2732
|
+
let { excludeFiles, filters, onlyCounts } = options;
|
|
2733
|
+
return excludeFiles ? empty$1 : filters && filters.length ? onlyCounts ? pushFileFilterAndCount : pushFileFilter : onlyCounts ? pushFileCount : pushFile;
|
|
2734
|
+
}(options), this.getArray = options.group ? getArrayGroup : getArray, this.groupFiles = options.group ? groupFiles : empty, this.resolveSymlink = (isSynchronous = this.isSynchronous, !options.resolveSymlinks || options.excludeSymlinks ? null : isSynchronous ? resolveSymlinks : resolveSymlinksAsync), this.walkDirectory = this.isSynchronous ? walkSync : walkAsync;
|
|
2735
|
+
}
|
|
2736
|
+
start() {
|
|
2737
|
+
return this.pushDirectory(this.root, this.state.paths, this.state.options.filters), this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk), this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
|
|
2738
|
+
}
|
|
2739
|
+
walk = (entries, directoryPath, depth)=>{
|
|
2740
|
+
let { paths, options: { filters, resolveSymlinks: resolveSymlinks$1, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator }, controller } = this.state;
|
|
2741
|
+
if (controller.aborted || signal && signal.aborted || maxFiles && paths.length > maxFiles) return;
|
|
2742
|
+
let files = this.getArray(this.state.paths);
|
|
2743
|
+
for(let i = 0; i < entries.length; ++i){
|
|
2744
|
+
let entry = entries[i];
|
|
2745
|
+
if (entry.isFile() || entry.isSymbolicLink() && !resolveSymlinks$1 && !excludeSymlinks) {
|
|
2746
|
+
let filename = this.joinPath(entry.name, directoryPath);
|
|
2747
|
+
this.pushFile(filename, files, this.state.counts, filters);
|
|
2748
|
+
} else if (entry.isDirectory()) {
|
|
2749
|
+
let path = directoryPath + entry.name + this.state.options.pathSeparator;
|
|
2750
|
+
if (exclude && exclude(entry.name, path)) continue;
|
|
2751
|
+
this.pushDirectory(path, paths, filters), this.walkDirectory(this.state, path, path, depth - 1, this.walk);
|
|
2752
|
+
} else if (this.resolveSymlink && entry.isSymbolicLink()) {
|
|
2753
|
+
let path = directoryPath + entry.name;
|
|
2754
|
+
this.resolveSymlink(path, this.state, (stat, resolvedPath)=>{
|
|
2755
|
+
if (stat.isDirectory()) resolvedPath = normalizePath(resolvedPath, this.state.options), exclude && exclude(entry.name, useRealPaths ? resolvedPath : path + pathSeparator) || this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path + pathSeparator, depth - 1, this.walk);
|
|
2756
|
+
else {
|
|
2757
|
+
resolvedPath = useRealPaths ? resolvedPath : path;
|
|
2758
|
+
let filename = (0, external_path_.basename)(resolvedPath), directoryPath$1 = normalizePath((0, external_path_.dirname)(resolvedPath), this.state.options);
|
|
2759
|
+
resolvedPath = this.joinPath(filename, directoryPath$1), this.pushFile(resolvedPath, files, this.state.counts, filters);
|
|
2760
|
+
}
|
|
2761
|
+
});
|
|
2762
|
+
}
|
|
2763
|
+
}
|
|
2764
|
+
this.groupFiles(this.state.groups, directoryPath, files);
|
|
2765
|
+
};
|
|
2766
|
+
};
|
|
2767
|
+
function dist_callback(root, options, callback$1) {
|
|
2768
|
+
new Walker(root, options, callback$1).start();
|
|
2769
|
+
}
|
|
2770
|
+
var APIBuilder = class {
|
|
2771
|
+
constructor(root, options){
|
|
2772
|
+
this.root = root, this.options = options;
|
|
2773
|
+
}
|
|
2774
|
+
withPromise() {
|
|
2775
|
+
var root, options;
|
|
2776
|
+
return root = this.root, options = this.options, new Promise((resolve$1, reject)=>{
|
|
2777
|
+
dist_callback(root, options, (err, output)=>{
|
|
2778
|
+
if (err) return reject(err);
|
|
2779
|
+
resolve$1(output);
|
|
2780
|
+
});
|
|
2781
|
+
});
|
|
2782
|
+
}
|
|
2783
|
+
withCallback(cb) {
|
|
2784
|
+
dist_callback(this.root, this.options, cb);
|
|
2785
|
+
}
|
|
2786
|
+
sync() {
|
|
2787
|
+
return new Walker(this.root, this.options).start();
|
|
2788
|
+
}
|
|
2789
|
+
};
|
|
2790
|
+
let pm = null;
|
|
2791
|
+
try {
|
|
2792
|
+
__require.resolve("picomatch"), pm = __require("picomatch");
|
|
2793
|
+
} catch {}
|
|
2794
|
+
var Builder = class {
|
|
2795
|
+
globCache = {};
|
|
2796
|
+
options = {
|
|
2797
|
+
maxDepth: 1 / 0,
|
|
2798
|
+
suppressErrors: !0,
|
|
2799
|
+
pathSeparator: external_path_.sep,
|
|
2800
|
+
filters: []
|
|
2801
|
+
};
|
|
2802
|
+
globFunction;
|
|
2803
|
+
constructor(options){
|
|
2804
|
+
this.options = {
|
|
2805
|
+
...this.options,
|
|
2806
|
+
...options
|
|
2807
|
+
}, this.globFunction = this.options.globFunction;
|
|
2808
|
+
}
|
|
2809
|
+
group() {
|
|
2810
|
+
return this.options.group = !0, this;
|
|
2811
|
+
}
|
|
2812
|
+
withPathSeparator(separator) {
|
|
2813
|
+
return this.options.pathSeparator = separator, this;
|
|
2814
|
+
}
|
|
2815
|
+
withBasePath() {
|
|
2816
|
+
return this.options.includeBasePath = !0, this;
|
|
2817
|
+
}
|
|
2818
|
+
withRelativePaths() {
|
|
2819
|
+
return this.options.relativePaths = !0, this;
|
|
2820
|
+
}
|
|
2821
|
+
withDirs() {
|
|
2822
|
+
return this.options.includeDirs = !0, this;
|
|
2823
|
+
}
|
|
2824
|
+
withMaxDepth(depth) {
|
|
2825
|
+
return this.options.maxDepth = depth, this;
|
|
2826
|
+
}
|
|
2827
|
+
withMaxFiles(limit) {
|
|
2828
|
+
return this.options.maxFiles = limit, this;
|
|
2829
|
+
}
|
|
2830
|
+
withFullPaths() {
|
|
2831
|
+
return this.options.resolvePaths = !0, this.options.includeBasePath = !0, this;
|
|
2832
|
+
}
|
|
2833
|
+
withErrors() {
|
|
2834
|
+
return this.options.suppressErrors = !1, this;
|
|
2835
|
+
}
|
|
2836
|
+
withSymlinks({ resolvePaths = !0 } = {}) {
|
|
2837
|
+
return this.options.resolveSymlinks = !0, this.options.useRealPaths = resolvePaths, this.withFullPaths();
|
|
2838
|
+
}
|
|
2839
|
+
withAbortSignal(signal) {
|
|
2840
|
+
return this.options.signal = signal, this;
|
|
2841
|
+
}
|
|
2842
|
+
normalize() {
|
|
2843
|
+
return this.options.normalizePath = !0, this;
|
|
2844
|
+
}
|
|
2845
|
+
filter(predicate) {
|
|
2846
|
+
return this.options.filters.push(predicate), this;
|
|
2847
|
+
}
|
|
2848
|
+
onlyDirs() {
|
|
2849
|
+
return this.options.excludeFiles = !0, this.options.includeDirs = !0, this;
|
|
2850
|
+
}
|
|
2851
|
+
exclude(predicate) {
|
|
2852
|
+
return this.options.exclude = predicate, this;
|
|
2853
|
+
}
|
|
2854
|
+
onlyCounts() {
|
|
2855
|
+
return this.options.onlyCounts = !0, this;
|
|
2856
|
+
}
|
|
2857
|
+
crawl(root) {
|
|
2858
|
+
return new APIBuilder(root || ".", this.options);
|
|
2859
|
+
}
|
|
2860
|
+
withGlobFunction(fn) {
|
|
2861
|
+
return this.globFunction = fn, this;
|
|
2862
|
+
}
|
|
2863
|
+
crawlWithOptions(root, options) {
|
|
2864
|
+
return this.options = {
|
|
2865
|
+
...this.options,
|
|
2866
|
+
...options
|
|
2867
|
+
}, new APIBuilder(root || ".", this.options);
|
|
2868
|
+
}
|
|
2869
|
+
glob(...patterns) {
|
|
2870
|
+
return this.globFunction ? this.globWithOptions(patterns) : this.globWithOptions(patterns, {
|
|
2871
|
+
dot: !0
|
|
2872
|
+
});
|
|
2873
|
+
}
|
|
2874
|
+
globWithOptions(patterns, ...options) {
|
|
2875
|
+
let globFn = this.globFunction || pm;
|
|
2876
|
+
if (!globFn) throw Error("Please specify a glob function to use glob matching.");
|
|
2877
|
+
var isMatch = this.globCache[patterns.join("\0")];
|
|
2878
|
+
return isMatch || (isMatch = globFn(patterns, ...options), this.globCache[patterns.join("\0")] = isMatch), this.options.filters.push((path)=>isMatch(path)), this;
|
|
2879
|
+
}
|
|
2880
|
+
};
|
|
2881
|
+
let external_url_ = __webpack_require__("url"), picomatch = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.js"), isReadonlyArray = Array.isArray, isWin = "win32" === process.platform, ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/, WIN32_ROOT_DIR = /^[A-Z]:\/$/i, isRoot = isWin ? (p)=>WIN32_ROOT_DIR.test(p) : (p)=>"/" === p;
|
|
2882
|
+
function buildFormat(cwd, root, absolute) {
|
|
2883
|
+
if (cwd === root || root.startsWith(`${cwd}/`)) {
|
|
2884
|
+
if (absolute) {
|
|
2885
|
+
let start = isRoot(cwd) ? cwd.length : cwd.length + 1;
|
|
2886
|
+
return (p, isDir)=>p.slice(start, isDir ? -1 : void 0) || ".";
|
|
2887
|
+
}
|
|
2888
|
+
let prefix = root.slice(cwd.length + 1);
|
|
2889
|
+
return prefix ? (p, isDir)=>{
|
|
2890
|
+
if ("." === p) return prefix;
|
|
2891
|
+
let result = `${prefix}/${p}`;
|
|
2892
|
+
return isDir ? result.slice(0, -1) : result;
|
|
2893
|
+
} : (p, isDir)=>isDir && "." !== p ? p.slice(0, -1) : p;
|
|
2894
|
+
}
|
|
2895
|
+
return absolute ? (p)=>external_path_.posix.relative(cwd, p) || "." : (p)=>external_path_.posix.relative(cwd, `${root}/${p}`) || ".";
|
|
2896
|
+
}
|
|
2897
|
+
let splitPatternOptions = {
|
|
2898
|
+
parts: !0
|
|
2899
|
+
};
|
|
2900
|
+
function splitPattern(path$1) {
|
|
2901
|
+
var _result$parts;
|
|
2902
|
+
let result = picomatch.scan(path$1, splitPatternOptions);
|
|
2903
|
+
return (null == (_result$parts = result.parts) ? void 0 : _result$parts.length) ? result.parts : [
|
|
2904
|
+
path$1
|
|
2905
|
+
];
|
|
2906
|
+
}
|
|
2907
|
+
let POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g, WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g, escapePath = isWin ? (path$1)=>path$1.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&") : (path$1)=>path$1.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
2908
|
+
function dist_log(...tasks) {
|
|
2909
|
+
console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`, ...tasks);
|
|
2910
|
+
}
|
|
2911
|
+
let PARENT_DIRECTORY = /^(\/?\.\.)+/, ESCAPING_BACKSLASHES = /\\(?=[()[\]{}!*+?@|])/g, BACKSLASHES = /\\/g;
|
|
2912
|
+
function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
|
|
2913
|
+
let result = pattern;
|
|
2914
|
+
pattern.endsWith("/") && (result = pattern.slice(0, -1)), !result.endsWith("*") && expandDirectories && (result += "/**");
|
|
2915
|
+
let escapedCwd = escapePath(cwd);
|
|
2916
|
+
result = external_path_.default.isAbsolute(result.replace(ESCAPING_BACKSLASHES, "")) ? external_path_.posix.relative(escapedCwd, result) : external_path_.posix.normalize(result);
|
|
2917
|
+
let parentDirectoryMatch = PARENT_DIRECTORY.exec(result), parts = splitPattern(result);
|
|
2918
|
+
if (null == parentDirectoryMatch ? void 0 : parentDirectoryMatch[0]) {
|
|
2919
|
+
let n = (parentDirectoryMatch[0].length + 1) / 3, i = 0, cwdParts = escapedCwd.split("/");
|
|
2920
|
+
for(; i < n && parts[i + n] === cwdParts[cwdParts.length + i - n];)result = result.slice(0, (n - i - 1) * 3) + result.slice((n - i) * 3 + parts[i + n].length + 1) || ".", i++;
|
|
2921
|
+
let potentialRoot = external_path_.posix.join(cwd, parentDirectoryMatch[0].slice(3 * i));
|
|
2922
|
+
!potentialRoot.startsWith(".") && props.root.length > potentialRoot.length && (props.root = potentialRoot, props.depthOffset = -n + i);
|
|
2923
|
+
}
|
|
2924
|
+
if (!isIgnore && props.depthOffset >= 0) {
|
|
2925
|
+
null != props.commonPath || (props.commonPath = parts);
|
|
2926
|
+
let newCommonPath = [], length = Math.min(props.commonPath.length, parts.length);
|
|
2927
|
+
for(let i = 0; i < length; i++){
|
|
2928
|
+
let part = parts[i];
|
|
2929
|
+
if ("**" === part && !parts[i + 1]) {
|
|
2930
|
+
newCommonPath.pop();
|
|
2931
|
+
break;
|
|
2932
|
+
}
|
|
2933
|
+
if (part !== props.commonPath[i] || function(pattern, options) {
|
|
2934
|
+
let scan = picomatch.scan(pattern);
|
|
2935
|
+
return scan.isGlob || scan.negated;
|
|
2936
|
+
}(part) || i === parts.length - 1) break;
|
|
2937
|
+
newCommonPath.push(part);
|
|
2938
|
+
}
|
|
2939
|
+
props.depthOffset = newCommonPath.length, props.commonPath = newCommonPath, props.root = newCommonPath.length > 0 ? external_path_.posix.join(cwd, ...newCommonPath) : cwd;
|
|
2940
|
+
}
|
|
2941
|
+
return result;
|
|
2942
|
+
}
|
|
2943
|
+
function formatPaths(paths, relative) {
|
|
2944
|
+
for(let i = paths.length - 1; i >= 0; i--){
|
|
2945
|
+
let path$1 = paths[i];
|
|
2946
|
+
paths[i] = relative(path$1);
|
|
2947
|
+
}
|
|
2948
|
+
return paths;
|
|
2949
|
+
}
|
|
2950
|
+
function getCrawler(patterns, inputOptions = {}) {
|
|
2951
|
+
var cwd;
|
|
2952
|
+
let options = process.env.TINYGLOBBY_DEBUG ? {
|
|
2953
|
+
...inputOptions,
|
|
2954
|
+
debug: !0
|
|
2955
|
+
} : inputOptions, cwd1 = (cwd = options.cwd) ? cwd instanceof URL ? (0, external_url_.fileURLToPath)(cwd).replace(BACKSLASHES, "/") : external_path_.default.resolve(cwd).replace(BACKSLASHES, "/") : process.cwd().replace(BACKSLASHES, "/");
|
|
2956
|
+
if (options.debug && dist_log("globbing with:", {
|
|
2957
|
+
patterns,
|
|
2958
|
+
options,
|
|
2959
|
+
cwd: cwd1
|
|
2960
|
+
}), Array.isArray(patterns) && 0 === patterns.length) return [
|
|
2961
|
+
{
|
|
2962
|
+
sync: ()=>[],
|
|
2963
|
+
withPromise: async ()=>[]
|
|
2964
|
+
},
|
|
2965
|
+
!1
|
|
2966
|
+
];
|
|
2967
|
+
let props = {
|
|
2968
|
+
root: cwd1,
|
|
2969
|
+
commonPath: null,
|
|
2970
|
+
depthOffset: 0
|
|
2971
|
+
}, processed = function({ patterns = [
|
|
2972
|
+
"**/*"
|
|
2973
|
+
], ignore = [], expandDirectories = !0 }, cwd, props) {
|
|
2974
|
+
"string" == typeof patterns && (patterns = [
|
|
2975
|
+
patterns
|
|
2976
|
+
]), "string" == typeof ignore && (ignore = [
|
|
2977
|
+
ignore
|
|
2978
|
+
]);
|
|
2979
|
+
let matchPatterns = [], ignorePatterns = [];
|
|
2980
|
+
for (let pattern of ignore)pattern && ("!" !== pattern[0] || "(" === pattern[1]) && ignorePatterns.push(normalizePattern(pattern, expandDirectories, cwd, props, !0));
|
|
2981
|
+
for (let pattern of patterns)pattern && ("!" !== pattern[0] || "(" === pattern[1] ? matchPatterns.push(normalizePattern(pattern, expandDirectories, cwd, props, !1)) : ("!" !== pattern[1] || "(" === pattern[2]) && ignorePatterns.push(normalizePattern(pattern.slice(1), expandDirectories, cwd, props, !0)));
|
|
2982
|
+
return {
|
|
2983
|
+
match: matchPatterns,
|
|
2984
|
+
ignore: ignorePatterns
|
|
2985
|
+
};
|
|
2986
|
+
}({
|
|
2987
|
+
...options,
|
|
2988
|
+
patterns
|
|
2989
|
+
}, cwd1, props);
|
|
2990
|
+
options.debug && dist_log("internal processing patterns:", processed);
|
|
2991
|
+
let matchOptions = {
|
|
2992
|
+
dot: options.dot,
|
|
2993
|
+
nobrace: !1 === options.braceExpansion,
|
|
2994
|
+
nocase: !1 === options.caseSensitiveMatch,
|
|
2995
|
+
noextglob: !1 === options.extglob,
|
|
2996
|
+
noglobstar: !1 === options.globstar,
|
|
2997
|
+
posix: !0
|
|
2998
|
+
}, matcher = picomatch(processed.match, {
|
|
2999
|
+
...matchOptions,
|
|
3000
|
+
ignore: processed.ignore
|
|
3001
|
+
}), ignore = picomatch(processed.ignore, matchOptions), partialMatcher = function(patterns, options = {}) {
|
|
3002
|
+
let patternsCount = patterns.length, patternsParts = Array(patternsCount), matchers = Array(patternsCount), globstarEnabled = !options.noglobstar;
|
|
3003
|
+
for(let i = 0; i < patternsCount; i++){
|
|
3004
|
+
let parts = splitPattern(patterns[i]);
|
|
3005
|
+
patternsParts[i] = parts;
|
|
3006
|
+
let partsCount = parts.length, partMatchers = Array(partsCount);
|
|
3007
|
+
for(let j = 0; j < partsCount; j++)partMatchers[j] = picomatch(parts[j], options);
|
|
3008
|
+
matchers[i] = partMatchers;
|
|
3009
|
+
}
|
|
3010
|
+
return (input)=>{
|
|
3011
|
+
let inputParts = input.split("/");
|
|
3012
|
+
if (".." === inputParts[0] && ONLY_PARENT_DIRECTORIES.test(input)) return !0;
|
|
3013
|
+
for(let i = 0; i < patterns.length; i++){
|
|
3014
|
+
let patternParts = patternsParts[i], matcher = matchers[i], inputPatternCount = inputParts.length, minParts = Math.min(inputPatternCount, patternParts.length), j = 0;
|
|
3015
|
+
for(; j < minParts;){
|
|
3016
|
+
let part = patternParts[j];
|
|
3017
|
+
if (part.includes("/")) return !0;
|
|
3018
|
+
if (!matcher[j](inputParts[j])) break;
|
|
3019
|
+
if (globstarEnabled && "**" === part) return !0;
|
|
3020
|
+
j++;
|
|
3021
|
+
}
|
|
3022
|
+
if (j === inputPatternCount) return !0;
|
|
3023
|
+
}
|
|
3024
|
+
return !1;
|
|
3025
|
+
};
|
|
3026
|
+
}(processed.match, matchOptions), format = buildFormat(cwd1, props.root, options.absolute), formatExclude = options.absolute ? format : buildFormat(cwd1, props.root, !0), fdirOptions = {
|
|
3027
|
+
filters: [
|
|
3028
|
+
options.debug ? (p, isDirectory)=>{
|
|
3029
|
+
let path$1 = format(p, isDirectory), matches = matcher(path$1);
|
|
3030
|
+
return matches && dist_log(`matched ${path$1}`), matches;
|
|
3031
|
+
} : (p, isDirectory)=>matcher(format(p, isDirectory))
|
|
3032
|
+
],
|
|
3033
|
+
exclude: options.debug ? (_, p)=>{
|
|
3034
|
+
let relativePath = formatExclude(p, !0), skipped = "." !== relativePath && !partialMatcher(relativePath) || ignore(relativePath);
|
|
3035
|
+
return skipped ? dist_log(`skipped ${p}`) : dist_log(`crawling ${p}`), skipped;
|
|
3036
|
+
} : (_, p)=>{
|
|
3037
|
+
let relativePath = formatExclude(p, !0);
|
|
3038
|
+
return "." !== relativePath && !partialMatcher(relativePath) || ignore(relativePath);
|
|
3039
|
+
},
|
|
3040
|
+
fs: options.fs ? {
|
|
3041
|
+
readdir: options.fs.readdir || external_fs_.default.readdir,
|
|
3042
|
+
readdirSync: options.fs.readdirSync || external_fs_.default.readdirSync,
|
|
3043
|
+
realpath: options.fs.realpath || external_fs_.default.realpath,
|
|
3044
|
+
realpathSync: options.fs.realpathSync || external_fs_.default.realpathSync,
|
|
3045
|
+
stat: options.fs.stat || external_fs_.default.stat,
|
|
3046
|
+
statSync: options.fs.statSync || external_fs_.default.statSync
|
|
3047
|
+
} : void 0,
|
|
3048
|
+
pathSeparator: "/",
|
|
3049
|
+
relativePaths: !0,
|
|
3050
|
+
resolveSymlinks: !0,
|
|
3051
|
+
signal: options.signal
|
|
3052
|
+
};
|
|
3053
|
+
void 0 !== options.deep && (fdirOptions.maxDepth = Math.round(options.deep - props.depthOffset)), options.absolute && (fdirOptions.relativePaths = !1, fdirOptions.resolvePaths = !0, fdirOptions.includeBasePath = !0), !1 === options.followSymbolicLinks && (fdirOptions.resolveSymlinks = !1, fdirOptions.excludeSymlinks = !0), options.onlyDirectories ? (fdirOptions.excludeFiles = !0, fdirOptions.includeDirs = !0) : !1 === options.onlyFiles && (fdirOptions.includeDirs = !0), props.root = props.root.replace(BACKSLASHES, "");
|
|
3054
|
+
let root = props.root;
|
|
3055
|
+
options.debug && dist_log("internal properties:", props);
|
|
3056
|
+
let relative = cwd1 !== root && !options.absolute && function(cwd, root) {
|
|
3057
|
+
if (root.startsWith(`${cwd}/`)) {
|
|
3058
|
+
let prefix = root.slice(cwd.length + 1);
|
|
3059
|
+
return (p)=>`${prefix}/${p}`;
|
|
3060
|
+
}
|
|
3061
|
+
return (p)=>{
|
|
3062
|
+
let result = external_path_.posix.relative(cwd, `${root}/${p}`);
|
|
3063
|
+
return p.endsWith("/") && "" !== result ? `${result}/` : result || ".";
|
|
3064
|
+
};
|
|
3065
|
+
}(cwd1, props.root);
|
|
3066
|
+
return [
|
|
3067
|
+
new Builder(fdirOptions).crawl(root),
|
|
3068
|
+
relative
|
|
3069
|
+
];
|
|
3070
|
+
}
|
|
3071
|
+
async function dist_glob(patternsOrOptions, options) {
|
|
3072
|
+
if (patternsOrOptions && (null == options ? void 0 : options.patterns)) throw Error("Cannot pass patterns as both an argument and an option");
|
|
3073
|
+
let isModern = isReadonlyArray(patternsOrOptions) || "string" == typeof patternsOrOptions, opts = isModern ? options : patternsOrOptions, [crawler, relative] = getCrawler(isModern ? patternsOrOptions : patternsOrOptions.patterns, opts);
|
|
3074
|
+
return relative ? formatPaths(await crawler.withPromise(), relative) : crawler.withPromise();
|
|
3075
|
+
}
|
|
3076
|
+
function globSync(patternsOrOptions, options) {
|
|
3077
|
+
if (patternsOrOptions && (null == options ? void 0 : options.patterns)) throw Error("Cannot pass patterns as both an argument and an option");
|
|
3078
|
+
let isModern = isReadonlyArray(patternsOrOptions) || "string" == typeof patternsOrOptions, opts = isModern ? options : patternsOrOptions, [crawler, relative] = getCrawler(isModern ? patternsOrOptions : patternsOrOptions.patterns, opts);
|
|
3079
|
+
return relative ? formatPaths(crawler.sync(), relative) : crawler.sync();
|
|
3080
|
+
}
|
|
1221
3081
|
var utils_dirname = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
|
|
1222
3082
|
let getNodeEnv = ()=>process.env.NODE_ENV, setNodeEnv = (env)=>{
|
|
1223
3083
|
process.env.NODE_ENV = env;
|
|
1224
3084
|
}, setDevServer = (isDevServer)=>{
|
|
1225
3085
|
process.env.DEV_SERVER = isDevServer ? 'true' : 'false';
|
|
1226
|
-
}, isDev = ()=>'development' === getNodeEnv(), utils_isDevServer = ()=>'true' === process.env.DEV_SERVER, utils_isProd = ()=>'production' === getNodeEnv(),
|
|
3086
|
+
}, isDev = ()=>'development' === getNodeEnv(), utils_isDevServer = ()=>'true' === process.env.DEV_SERVER, utils_isProd = ()=>'production' === getNodeEnv(), utils_isWin = ()=>'win32' === process.platform, utils_isString = (str)=>'string' == typeof str, isBoolean = (bool)=>'boolean' == typeof bool, isUndefined = (obj)=>void 0 === obj, isFunction = (func)=>'function' == typeof func, isObject = (obj)=>null !== obj && 'object' == typeof obj, isPlainObject = (obj)=>isObject(obj) && '[object Object]' === Object.prototype.toString.call(obj), isRegExp = (obj)=>'[object RegExp]' === Object.prototype.toString.call(obj), prettyTime = (seconds)=>{
|
|
1227
3087
|
let toFixed = (num, len)=>{
|
|
1228
3088
|
let factor = 10 ** len;
|
|
1229
3089
|
return Math.floor(num * factor) / factor;
|
|
@@ -1237,20 +3097,14 @@ let getNodeEnv = ()=>process.env.NODE_ENV, setNodeEnv = (env)=>{
|
|
|
1237
3097
|
}
|
|
1238
3098
|
let lastKey = pathArray.at(-1);
|
|
1239
3099
|
return void 0 === current[lastKey] && (current[lastKey] = defaultValue), current[lastKey];
|
|
1240
|
-
},
|
|
3100
|
+
}, utils_set = (target, pathArray, value)=>{
|
|
1241
3101
|
let current = target;
|
|
1242
3102
|
for(let i = 0; i < pathArray.length - 1; i++){
|
|
1243
3103
|
let currKey = pathArray[i];
|
|
1244
3104
|
current[currKey] && 'object' == typeof current[currKey] || (current[currKey] = 'string' == typeof pathArray[i + 1] ? {} : []), current = current[currKey];
|
|
1245
3105
|
}
|
|
1246
3106
|
current[pathArray.at(-1)] = value;
|
|
1247
|
-
},
|
|
1248
|
-
portfinder.getPort({
|
|
1249
|
-
port: startPort
|
|
1250
|
-
}, (_, port)=>{
|
|
1251
|
-
resolve(port);
|
|
1252
|
-
});
|
|
1253
|
-
}), normalizePublicPath = (base)=>{
|
|
3107
|
+
}, normalizePublicPath = (base)=>{
|
|
1254
3108
|
if (!base) return '/';
|
|
1255
3109
|
let normalized = base;
|
|
1256
3110
|
return normalized.startsWith('/') || (normalized = `/${normalized}`), normalized.endsWith('/') || (normalized = `${normalized}/`), normalized;
|
|
@@ -1550,7 +3404,7 @@ async function loadConfig({ cliOptions, command }) {
|
|
|
1550
3404
|
if (void 0 === (configExport = await configExport(params))) throw Error('unpack config function must return a config object.');
|
|
1551
3405
|
}
|
|
1552
3406
|
let applyOption = (path, value)=>{
|
|
1553
|
-
void 0 !== value &&
|
|
3407
|
+
void 0 !== value && utils_set(configExport, path, value);
|
|
1554
3408
|
};
|
|
1555
3409
|
return applyOption([
|
|
1556
3410
|
'server',
|
|
@@ -1638,7 +3492,225 @@ let findExists = (files)=>{
|
|
|
1638
3492
|
'.less',
|
|
1639
3493
|
'.scss',
|
|
1640
3494
|
'.sass'
|
|
1641
|
-
]
|
|
3495
|
+
];
|
|
3496
|
+
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", intToChar = new Uint8Array(64), charToInt = new Uint8Array(128);
|
|
3497
|
+
for(let i = 0; i < chars.length; i++){
|
|
3498
|
+
let c = chars.charCodeAt(i);
|
|
3499
|
+
intToChar[i] = c, charToInt[c] = i;
|
|
3500
|
+
}
|
|
3501
|
+
function decodeInteger(reader, relative) {
|
|
3502
|
+
let value = 0, shift = 0, integer = 0;
|
|
3503
|
+
do value |= (31 & (integer = charToInt[reader.next()])) << shift, shift += 5;
|
|
3504
|
+
while (32 & integer);
|
|
3505
|
+
let shouldNegate = 1 & value;
|
|
3506
|
+
return value >>>= 1, shouldNegate && (value = -2147483648 | -value), relative + value;
|
|
3507
|
+
}
|
|
3508
|
+
function encodeInteger(builder, num, relative) {
|
|
3509
|
+
let delta = num - relative;
|
|
3510
|
+
delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
|
|
3511
|
+
do {
|
|
3512
|
+
let clamped = 31 & delta;
|
|
3513
|
+
(delta >>>= 5) > 0 && (clamped |= 32), builder.write(intToChar[clamped]);
|
|
3514
|
+
}while (delta > 0);
|
|
3515
|
+
return num;
|
|
3516
|
+
}
|
|
3517
|
+
function hasMoreVlq(reader, max) {
|
|
3518
|
+
return !(reader.pos >= max) && 44 !== reader.peek();
|
|
3519
|
+
}
|
|
3520
|
+
var td = "u" > typeof TextDecoder ? new TextDecoder() : "u" > typeof Buffer ? {
|
|
3521
|
+
decode: (buf)=>Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength).toString()
|
|
3522
|
+
} : {
|
|
3523
|
+
decode (buf) {
|
|
3524
|
+
let out = "";
|
|
3525
|
+
for(let i = 0; i < buf.length; i++)out += String.fromCharCode(buf[i]);
|
|
3526
|
+
return out;
|
|
3527
|
+
}
|
|
3528
|
+
}, StringWriter = class {
|
|
3529
|
+
constructor(){
|
|
3530
|
+
this.pos = 0, this.out = "", this.buffer = new Uint8Array(16384);
|
|
3531
|
+
}
|
|
3532
|
+
write(v) {
|
|
3533
|
+
let { buffer } = this;
|
|
3534
|
+
buffer[this.pos++] = v, 16384 === this.pos && (this.out += td.decode(buffer), this.pos = 0);
|
|
3535
|
+
}
|
|
3536
|
+
flush() {
|
|
3537
|
+
let { buffer, out, pos } = this;
|
|
3538
|
+
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
|
|
3539
|
+
}
|
|
3540
|
+
}, StringReader = class {
|
|
3541
|
+
constructor(buffer){
|
|
3542
|
+
this.pos = 0, this.buffer = buffer;
|
|
3543
|
+
}
|
|
3544
|
+
next() {
|
|
3545
|
+
return this.buffer.charCodeAt(this.pos++);
|
|
3546
|
+
}
|
|
3547
|
+
peek() {
|
|
3548
|
+
return this.buffer.charCodeAt(this.pos);
|
|
3549
|
+
}
|
|
3550
|
+
indexOf(char) {
|
|
3551
|
+
let { buffer, pos } = this, idx = buffer.indexOf(char, pos);
|
|
3552
|
+
return -1 === idx ? buffer.length : idx;
|
|
3553
|
+
}
|
|
3554
|
+
};
|
|
3555
|
+
function sortComparator(a, b) {
|
|
3556
|
+
return a[0] - b[0];
|
|
3557
|
+
}
|
|
3558
|
+
let schemeRegex = /^[\w+.-]+:\/\//, urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/, fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
|
|
3559
|
+
function isAbsolutePath(input) {
|
|
3560
|
+
return input.startsWith('/');
|
|
3561
|
+
}
|
|
3562
|
+
function isRelative(input) {
|
|
3563
|
+
return /^[.?#]/.test(input);
|
|
3564
|
+
}
|
|
3565
|
+
function parseAbsoluteUrl(input) {
|
|
3566
|
+
let match = urlRegex.exec(input);
|
|
3567
|
+
return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || '');
|
|
3568
|
+
}
|
|
3569
|
+
function makeUrl(scheme, user, host, port, path, query, hash) {
|
|
3570
|
+
return {
|
|
3571
|
+
scheme,
|
|
3572
|
+
user,
|
|
3573
|
+
host,
|
|
3574
|
+
port,
|
|
3575
|
+
path,
|
|
3576
|
+
query,
|
|
3577
|
+
hash,
|
|
3578
|
+
type: 7
|
|
3579
|
+
};
|
|
3580
|
+
}
|
|
3581
|
+
function parseUrl(input) {
|
|
3582
|
+
if (input.startsWith('//')) {
|
|
3583
|
+
let url = parseAbsoluteUrl('http:' + input);
|
|
3584
|
+
return url.scheme = '', url.type = 6, url;
|
|
3585
|
+
}
|
|
3586
|
+
if (isAbsolutePath(input)) {
|
|
3587
|
+
let url = parseAbsoluteUrl('http://foo.com' + input);
|
|
3588
|
+
return url.scheme = '', url.host = '', url.type = 5, url;
|
|
3589
|
+
}
|
|
3590
|
+
if (input.startsWith('file:')) {
|
|
3591
|
+
let match, path;
|
|
3592
|
+
return path = (match = fileRegex.exec(input))[2], makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || '');
|
|
3593
|
+
}
|
|
3594
|
+
if (schemeRegex.test(input)) return parseAbsoluteUrl(input);
|
|
3595
|
+
let url = parseAbsoluteUrl('http://foo.com/' + input);
|
|
3596
|
+
return url.scheme = '', url.host = '', url.type = input ? input.startsWith('?') ? 3 : input.startsWith('#') ? 2 : 4 : 1, url;
|
|
3597
|
+
}
|
|
3598
|
+
function resolve_uri_normalizePath(url, type) {
|
|
3599
|
+
let rel = type <= 4, pieces = url.path.split('/'), pointer = 1, positive = 0, addTrailingSlash = !1;
|
|
3600
|
+
for(let i = 1; i < pieces.length; i++){
|
|
3601
|
+
let piece = pieces[i];
|
|
3602
|
+
if (!piece) {
|
|
3603
|
+
addTrailingSlash = !0;
|
|
3604
|
+
continue;
|
|
3605
|
+
}
|
|
3606
|
+
if (addTrailingSlash = !1, '.' !== piece) {
|
|
3607
|
+
if ('..' === piece) {
|
|
3608
|
+
positive ? (addTrailingSlash = !0, positive--, pointer--) : rel && (pieces[pointer++] = piece);
|
|
3609
|
+
continue;
|
|
3610
|
+
}
|
|
3611
|
+
pieces[pointer++] = piece, positive++;
|
|
3612
|
+
}
|
|
3613
|
+
}
|
|
3614
|
+
let path = '';
|
|
3615
|
+
for(let i = 1; i < pointer; i++)path += '/' + pieces[i];
|
|
3616
|
+
path && (!addTrailingSlash || path.endsWith('/..')) || (path += '/'), url.path = path;
|
|
3617
|
+
}
|
|
3618
|
+
function nextUnsortedSegmentLine(mappings, start) {
|
|
3619
|
+
for(let i = start; i < mappings.length; i++)if (!function(line) {
|
|
3620
|
+
for(let j = 1; j < line.length; j++)if (line[j][0] < line[j - 1][0]) return !1;
|
|
3621
|
+
return !0;
|
|
3622
|
+
}(mappings[i])) return i;
|
|
3623
|
+
return mappings.length;
|
|
3624
|
+
}
|
|
3625
|
+
function trace_mapping_sortComparator(a, b) {
|
|
3626
|
+
return a[0] - b[0];
|
|
3627
|
+
}
|
|
3628
|
+
var found = !1, TraceMap = class {
|
|
3629
|
+
constructor(map, mapUrl){
|
|
3630
|
+
var map1;
|
|
3631
|
+
let from, prefix, isString = "string" == typeof map;
|
|
3632
|
+
if (!isString && map._decodedMemo) return map;
|
|
3633
|
+
let parsed = "string" == typeof (map1 = map) ? JSON.parse(map1) : map1, { version, file, names, sourceRoot, sources, sourcesContent } = parsed;
|
|
3634
|
+
this.version = version, this.file = file, this.names = names || [], this.sourceRoot = sourceRoot, this.sources = sources, this.sourcesContent = sourcesContent, this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0;
|
|
3635
|
+
let resolve = (from = function(path) {
|
|
3636
|
+
if (!path) return "";
|
|
3637
|
+
let index = path.lastIndexOf("/");
|
|
3638
|
+
return path.slice(0, index + 1);
|
|
3639
|
+
}(mapUrl), prefix = sourceRoot ? sourceRoot + "/" : "", (source)=>(function(input, base) {
|
|
3640
|
+
if (!input && !base) return '';
|
|
3641
|
+
let url = parseUrl(input), inputType = url.type;
|
|
3642
|
+
if (base && 7 !== inputType) {
|
|
3643
|
+
let baseUrl = parseUrl(base), baseType = baseUrl.type;
|
|
3644
|
+
switch(inputType){
|
|
3645
|
+
case 1:
|
|
3646
|
+
url.hash = baseUrl.hash;
|
|
3647
|
+
case 2:
|
|
3648
|
+
url.query = baseUrl.query;
|
|
3649
|
+
case 3:
|
|
3650
|
+
case 4:
|
|
3651
|
+
resolve_uri_normalizePath(baseUrl, baseUrl.type), '/' === url.path ? url.path = baseUrl.path : url.path = function(path) {
|
|
3652
|
+
if (path.endsWith('/..')) return path;
|
|
3653
|
+
let index = path.lastIndexOf('/');
|
|
3654
|
+
return path.slice(0, index + 1);
|
|
3655
|
+
}(baseUrl.path) + url.path;
|
|
3656
|
+
case 5:
|
|
3657
|
+
url.user = baseUrl.user, url.host = baseUrl.host, url.port = baseUrl.port;
|
|
3658
|
+
case 6:
|
|
3659
|
+
url.scheme = baseUrl.scheme;
|
|
3660
|
+
}
|
|
3661
|
+
baseType > inputType && (inputType = baseType);
|
|
3662
|
+
}
|
|
3663
|
+
resolve_uri_normalizePath(url, inputType);
|
|
3664
|
+
let queryHash = url.query + url.hash;
|
|
3665
|
+
switch(inputType){
|
|
3666
|
+
case 2:
|
|
3667
|
+
case 3:
|
|
3668
|
+
return queryHash;
|
|
3669
|
+
case 4:
|
|
3670
|
+
{
|
|
3671
|
+
let path = url.path.slice(1);
|
|
3672
|
+
if (!path) return queryHash || '.';
|
|
3673
|
+
if (isRelative(base || input) && !isRelative(path)) return './' + path + queryHash;
|
|
3674
|
+
return path + queryHash;
|
|
3675
|
+
}
|
|
3676
|
+
case 5:
|
|
3677
|
+
return url.path + queryHash;
|
|
3678
|
+
default:
|
|
3679
|
+
return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;
|
|
3680
|
+
}
|
|
3681
|
+
})(prefix + (source || ""), from));
|
|
3682
|
+
this.resolvedSources = sources.map(resolve);
|
|
3683
|
+
let { mappings } = parsed;
|
|
3684
|
+
if ("string" == typeof mappings) this._encoded = mappings, this._decoded = void 0;
|
|
3685
|
+
else if (Array.isArray(mappings)) this._encoded = void 0, this._decoded = function(mappings, owned) {
|
|
3686
|
+
let unsortedIndex = nextUnsortedSegmentLine(mappings, 0);
|
|
3687
|
+
if (unsortedIndex === mappings.length) return mappings;
|
|
3688
|
+
owned || (mappings = mappings.slice());
|
|
3689
|
+
for(let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)){
|
|
3690
|
+
var line;
|
|
3691
|
+
mappings[i] = (line = mappings[i], owned || (line = line.slice()), line.sort(trace_mapping_sortComparator));
|
|
3692
|
+
}
|
|
3693
|
+
return mappings;
|
|
3694
|
+
}(mappings, isString);
|
|
3695
|
+
else if (parsed.sections) throw Error("TraceMap passed sectioned source map, please use FlattenMap export instead");
|
|
3696
|
+
else throw Error(`invalid source map: ${JSON.stringify(parsed)}`);
|
|
3697
|
+
this._decodedMemo = {
|
|
3698
|
+
lastKey: -1,
|
|
3699
|
+
lastNeedle: -1,
|
|
3700
|
+
lastIndex: -1
|
|
3701
|
+
}, this._bySources = void 0, this._bySourceMemos = void 0;
|
|
3702
|
+
}
|
|
3703
|
+
};
|
|
3704
|
+
function OMapping(source, line, column, name) {
|
|
3705
|
+
return {
|
|
3706
|
+
source,
|
|
3707
|
+
line,
|
|
3708
|
+
column,
|
|
3709
|
+
name
|
|
3710
|
+
};
|
|
3711
|
+
}
|
|
3712
|
+
var UNKNOWN_FUNCTION = '<unknown>', chromeRe = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|rsc|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i, chromeEvalRe = /\((\S*)(?::(\d+))(?::(\d+))\)/, winjsRe = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|rsc|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i, geckoRe = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|rsc|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i, geckoEvalRe = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i, javaScriptCoreRe = /^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i, nodeRe = /^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;
|
|
3713
|
+
let BROWSER_LOGS_ENDPOINT = '/__browser_logs__', SOURCE_REGEX = /\.(js|jsx|mjs|cjs|ts|tsx|mts|cts|vue|svelte)$/, gzip = promisify(node_zlib.gzip), numberFormatter = new Intl.NumberFormat('en', {
|
|
1642
3714
|
maximumFractionDigits: 2,
|
|
1643
3715
|
minimumFractionDigits: 2
|
|
1644
3716
|
}), displaySize = (bytes)=>`${numberFormatter.format(bytes / 1000)} kB`;
|
|
@@ -1710,56 +3782,674 @@ let COMPRESSIBLE_REGEX = /\.(?:js|css|html|json|svg|txt|xml|xhtml|wasm|manifest|
|
|
|
1710
3782
|
let publicBase = `/${rel}`.replace(/\/{2,}/g, '/').replace(/\/$/, ''), rest = trimmed.slice(key.length);
|
|
1711
3783
|
return `${publicBase}${rest}`.replace(/\/{2,}/g, '/');
|
|
1712
3784
|
}
|
|
1713
|
-
let normalized = trimmed.replace(/\\/g, '/'), firstChar = normalized[0];
|
|
1714
|
-
if ('@' === firstChar || '~' === firstChar || '#' === firstChar) {
|
|
1715
|
-
let slashIndex = normalized.indexOf('/'), aliasKey = normalized.slice(0, slashIndex);
|
|
1716
|
-
aliasEntries.map(([rawKey])=>rawKey.endsWith('/') ? rawKey.slice(0, -1) : rawKey).filter(Boolean).includes(aliasKey) || warnedMissingAliasKeys.has(aliasKey) || (warnedMissingAliasKeys.add(aliasKey), logger_logger.warn(`Unrecognized alias "${aliasKey}" in glob pattern: "${trimmed}", please ensure it is defined in "resolve.alias".`));
|
|
3785
|
+
let normalized = trimmed.replace(/\\/g, '/'), firstChar = normalized[0];
|
|
3786
|
+
if ('@' === firstChar || '~' === firstChar || '#' === firstChar) {
|
|
3787
|
+
let slashIndex = normalized.indexOf('/'), aliasKey = normalized.slice(0, slashIndex);
|
|
3788
|
+
aliasEntries.map(([rawKey])=>rawKey.endsWith('/') ? rawKey.slice(0, -1) : rawKey).filter(Boolean).includes(aliasKey) || warnedMissingAliasKeys.has(aliasKey) || (warnedMissingAliasKeys.add(aliasKey), logger_logger.warn(`Unrecognized alias "${aliasKey}" in glob pattern: "${trimmed}", please ensure it is defined in "resolve.alias".`));
|
|
3789
|
+
}
|
|
3790
|
+
return trimmed;
|
|
3791
|
+
}, SPECIAL_NO_ENTRY_DEPS = [
|
|
3792
|
+
'@iconify-icons/material-symbols'
|
|
3793
|
+
], FRAMEWORKS = [
|
|
3794
|
+
'react',
|
|
3795
|
+
'react-dom',
|
|
3796
|
+
'react-router-dom',
|
|
3797
|
+
'vue',
|
|
3798
|
+
'vue-router'
|
|
3799
|
+
], getExternalLibraryName = (pkgName)=>{
|
|
3800
|
+
let externalAlias = {
|
|
3801
|
+
'react-dom': 'ReactDOM',
|
|
3802
|
+
'react-router-dom': 'ReactRouterDOM'
|
|
3803
|
+
};
|
|
3804
|
+
return externalAlias[pkgName] ? externalAlias[pkgName] : pkgName.replace(/^@/, '').split(/[/\-.]/).filter(Boolean).map((part)=>part.charAt(0).toUpperCase() + part.slice(1)).join('');
|
|
3805
|
+
}, getExternalValue = (pkgName)=>`window ${getExternalLibraryName(pkgName)}`, MODULE_PATH_REGEX = /.*[\\/]node_modules[\\/](?!\.pnpm[\\/])(?:(@[^\\/]+)[\\/])?([^\\/]+)/, normalizeSvg = (content)=>content.replace(/<\?xml[\s\S]*?\?>/gi, '').replace(/<!DOCTYPE[\s\S]*?>/gi, '').replace(/<!--[\s\S]*?-->/g, '').trim(), extractSvgContent = (content)=>{
|
|
3806
|
+
let match = content.match(/<svg\b([^>]*)>/i), viewBoxMatch = match?.[1]?.match(/viewBox\s*=\s*["']([^"']+)["']/i);
|
|
3807
|
+
return {
|
|
3808
|
+
inner: content.replace(/^[\s\S]*?<svg\b[^>]*>/i, '').replace(/<\/svg>[\s\S]*$/i, '').trim(),
|
|
3809
|
+
viewBox: viewBoxMatch?.[1]
|
|
3810
|
+
};
|
|
3811
|
+
}, readSvgFiles = (dir, collected = [])=>{
|
|
3812
|
+
if (!node_fs.existsSync(dir)) return collected;
|
|
3813
|
+
for (let entry of node_fs.readdirSync(dir, {
|
|
3814
|
+
withFileTypes: !0
|
|
3815
|
+
})){
|
|
3816
|
+
let fullPath = node_path.join(dir, entry.name);
|
|
3817
|
+
entry.isDirectory() ? readSvgFiles(fullPath, collected) : entry.isFile() && entry.name.toLowerCase().endsWith('.svg') && collected.push(fullPath);
|
|
3818
|
+
}
|
|
3819
|
+
return collected;
|
|
3820
|
+
}, toSymbolId = (filePath, iconDir, symbolId)=>{
|
|
3821
|
+
let relative = node_path.relative(iconDir, filePath), parsed = node_path.parse(relative), dir = parsed.dir.split(node_path.sep).filter(Boolean).join('-'), name = parsed.name;
|
|
3822
|
+
if ('function' == typeof symbolId) return symbolId(name, filePath);
|
|
3823
|
+
let id = (symbolId || 'icon-[dir]-[name]').replace(/\[name\]/g, name).replace(/\[dir\]/g, dir);
|
|
3824
|
+
return id.replace(/--+/g, '-').replace(/^-+|-+$/g, '');
|
|
3825
|
+
}, BROWSERSLIST_CONFIG_FILES = [
|
|
3826
|
+
'.browserslistrc',
|
|
3827
|
+
'.browserslistrc.json',
|
|
3828
|
+
'.browserslistrc.yaml',
|
|
3829
|
+
'.browserslistrc.yml',
|
|
3830
|
+
'browserslist',
|
|
3831
|
+
'browserslist.config.js',
|
|
3832
|
+
'browserslist.config.cjs',
|
|
3833
|
+
'browserslist.config.mjs'
|
|
3834
|
+
];
|
|
3835
|
+
class BitSet {
|
|
3836
|
+
constructor(arg){
|
|
3837
|
+
this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
|
|
3838
|
+
}
|
|
3839
|
+
add(n) {
|
|
3840
|
+
this.bits[n >> 5] |= 1 << (31 & n);
|
|
3841
|
+
}
|
|
3842
|
+
has(n) {
|
|
3843
|
+
return !!(this.bits[n >> 5] & 1 << (31 & n));
|
|
3844
|
+
}
|
|
3845
|
+
}
|
|
3846
|
+
class Chunk {
|
|
3847
|
+
constructor(start, end, content){
|
|
3848
|
+
this.start = start, this.end = end, this.original = content, this.intro = '', this.outro = '', this.content = content, this.storeName = !1, this.edited = !1, this.previous = null, this.next = null;
|
|
3849
|
+
}
|
|
3850
|
+
appendLeft(content) {
|
|
3851
|
+
this.outro += content;
|
|
3852
|
+
}
|
|
3853
|
+
appendRight(content) {
|
|
3854
|
+
this.intro = this.intro + content;
|
|
3855
|
+
}
|
|
3856
|
+
clone() {
|
|
3857
|
+
let chunk = new Chunk(this.start, this.end, this.original);
|
|
3858
|
+
return chunk.intro = this.intro, chunk.outro = this.outro, chunk.content = this.content, chunk.storeName = this.storeName, chunk.edited = this.edited, chunk;
|
|
3859
|
+
}
|
|
3860
|
+
contains(index) {
|
|
3861
|
+
return this.start < index && index < this.end;
|
|
3862
|
+
}
|
|
3863
|
+
eachNext(fn) {
|
|
3864
|
+
let chunk = this;
|
|
3865
|
+
for(; chunk;)fn(chunk), chunk = chunk.next;
|
|
3866
|
+
}
|
|
3867
|
+
eachPrevious(fn) {
|
|
3868
|
+
let chunk = this;
|
|
3869
|
+
for(; chunk;)fn(chunk), chunk = chunk.previous;
|
|
3870
|
+
}
|
|
3871
|
+
edit(content, storeName, contentOnly) {
|
|
3872
|
+
return this.content = content, contentOnly || (this.intro = '', this.outro = ''), this.storeName = storeName, this.edited = !0, this;
|
|
3873
|
+
}
|
|
3874
|
+
prependLeft(content) {
|
|
3875
|
+
this.outro = content + this.outro;
|
|
3876
|
+
}
|
|
3877
|
+
prependRight(content) {
|
|
3878
|
+
this.intro = content + this.intro;
|
|
3879
|
+
}
|
|
3880
|
+
reset() {
|
|
3881
|
+
this.intro = '', this.outro = '', this.edited && (this.content = this.original, this.storeName = !1, this.edited = !1);
|
|
3882
|
+
}
|
|
3883
|
+
split(index) {
|
|
3884
|
+
let sliceIndex = index - this.start, originalBefore = this.original.slice(0, sliceIndex), originalAfter = this.original.slice(sliceIndex);
|
|
3885
|
+
this.original = originalBefore;
|
|
3886
|
+
let newChunk = new Chunk(index, this.end, originalAfter);
|
|
3887
|
+
return newChunk.outro = this.outro, this.outro = '', this.end = index, this.edited ? (newChunk.edit('', !1), this.content = '') : this.content = originalBefore, newChunk.next = this.next, newChunk.next && (newChunk.next.previous = newChunk), newChunk.previous = this, this.next = newChunk, newChunk;
|
|
3888
|
+
}
|
|
3889
|
+
toString() {
|
|
3890
|
+
return this.intro + this.content + this.outro;
|
|
3891
|
+
}
|
|
3892
|
+
trimEnd(rx) {
|
|
3893
|
+
if (this.outro = this.outro.replace(rx, ''), this.outro.length) return !0;
|
|
3894
|
+
let trimmed = this.content.replace(rx, '');
|
|
3895
|
+
return trimmed.length ? (trimmed !== this.content && (this.split(this.start + trimmed.length).edit('', void 0, !0), this.edited && this.edit(trimmed, this.storeName, !0)), !0) : (this.edit('', void 0, !0), this.intro = this.intro.replace(rx, ''), !!this.intro.length || void 0);
|
|
3896
|
+
}
|
|
3897
|
+
trimStart(rx) {
|
|
3898
|
+
if (this.intro = this.intro.replace(rx, ''), this.intro.length) return !0;
|
|
3899
|
+
let trimmed = this.content.replace(rx, '');
|
|
3900
|
+
if (trimmed.length) {
|
|
3901
|
+
if (trimmed !== this.content) {
|
|
3902
|
+
let newChunk = this.split(this.end - trimmed.length);
|
|
3903
|
+
this.edited && newChunk.edit(trimmed, this.storeName, !0), this.edit('', void 0, !0);
|
|
3904
|
+
}
|
|
3905
|
+
return !0;
|
|
3906
|
+
}
|
|
3907
|
+
if (this.edit('', void 0, !0), this.outro = this.outro.replace(rx, ''), this.outro.length) return !0;
|
|
3908
|
+
}
|
|
3909
|
+
}
|
|
3910
|
+
let btoa = "u" > typeof globalThis && 'function' == typeof globalThis.btoa ? (str)=>globalThis.btoa(unescape(encodeURIComponent(str))) : 'function' == typeof Buffer ? (str)=>Buffer.from(str, 'utf-8').toString('base64') : ()=>{
|
|
3911
|
+
throw Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');
|
|
3912
|
+
};
|
|
3913
|
+
class SourceMap {
|
|
3914
|
+
constructor(properties){
|
|
3915
|
+
this.version = 3, this.file = properties.file, this.sources = properties.sources, this.sourcesContent = properties.sourcesContent, this.names = properties.names, this.mappings = function(decoded) {
|
|
3916
|
+
let writer = new StringWriter(), sourcesIndex = 0, sourceLine = 0, sourceColumn = 0, namesIndex = 0;
|
|
3917
|
+
for(let i = 0; i < decoded.length; i++){
|
|
3918
|
+
let line = decoded[i];
|
|
3919
|
+
if (i > 0 && writer.write(59), 0 === line.length) continue;
|
|
3920
|
+
let genColumn = 0;
|
|
3921
|
+
for(let j = 0; j < line.length; j++){
|
|
3922
|
+
let segment = line[j];
|
|
3923
|
+
j > 0 && writer.write(44), genColumn = encodeInteger(writer, segment[0], genColumn), 1 !== segment.length && (sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex), sourceLine = encodeInteger(writer, segment[2], sourceLine), sourceColumn = encodeInteger(writer, segment[3], sourceColumn), 4 !== segment.length && (namesIndex = encodeInteger(writer, segment[4], namesIndex)));
|
|
3924
|
+
}
|
|
3925
|
+
}
|
|
3926
|
+
return writer.flush();
|
|
3927
|
+
}(properties.mappings), void 0 !== properties.x_google_ignoreList && (this.x_google_ignoreList = properties.x_google_ignoreList), void 0 !== properties.debugId && (this.debugId = properties.debugId);
|
|
3928
|
+
}
|
|
3929
|
+
toString() {
|
|
3930
|
+
return JSON.stringify(this);
|
|
3931
|
+
}
|
|
3932
|
+
toUrl() {
|
|
3933
|
+
return 'data:application/json;charset=utf-8;base64,' + btoa(this.toString());
|
|
3934
|
+
}
|
|
3935
|
+
}
|
|
3936
|
+
let magic_string_es_toString = Object.prototype.toString;
|
|
3937
|
+
function getLocator(source) {
|
|
3938
|
+
let originalLines = source.split('\n'), lineOffsets = [];
|
|
3939
|
+
for(let i = 0, pos = 0; i < originalLines.length; i++)lineOffsets.push(pos), pos += originalLines[i].length + 1;
|
|
3940
|
+
return function(index) {
|
|
3941
|
+
let i = 0, j = lineOffsets.length;
|
|
3942
|
+
for(; i < j;){
|
|
3943
|
+
let m = i + j >> 1;
|
|
3944
|
+
index < lineOffsets[m] ? j = m : i = m + 1;
|
|
3945
|
+
}
|
|
3946
|
+
let line = i - 1, column = index - lineOffsets[line];
|
|
3947
|
+
return {
|
|
3948
|
+
line,
|
|
3949
|
+
column
|
|
3950
|
+
};
|
|
3951
|
+
};
|
|
3952
|
+
}
|
|
3953
|
+
let wordRegex = /\w/;
|
|
3954
|
+
class Mappings {
|
|
3955
|
+
constructor(hires){
|
|
3956
|
+
this.hires = hires, this.generatedCodeLine = 0, this.generatedCodeColumn = 0, this.raw = [], this.rawSegments = this.raw[this.generatedCodeLine] = [], this.pending = null;
|
|
3957
|
+
}
|
|
3958
|
+
addEdit(sourceIndex, content, loc, nameIndex) {
|
|
3959
|
+
if (content.length) {
|
|
3960
|
+
let contentLengthMinusOne = content.length - 1, contentLineEnd = content.indexOf('\n', 0), previousContentLineEnd = -1;
|
|
3961
|
+
for(; contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd;){
|
|
3962
|
+
let segment = [
|
|
3963
|
+
this.generatedCodeColumn,
|
|
3964
|
+
sourceIndex,
|
|
3965
|
+
loc.line,
|
|
3966
|
+
loc.column
|
|
3967
|
+
];
|
|
3968
|
+
nameIndex >= 0 && segment.push(nameIndex), this.rawSegments.push(segment), this.generatedCodeLine += 1, this.raw[this.generatedCodeLine] = this.rawSegments = [], this.generatedCodeColumn = 0, previousContentLineEnd = contentLineEnd, contentLineEnd = content.indexOf('\n', contentLineEnd + 1);
|
|
3969
|
+
}
|
|
3970
|
+
let segment = [
|
|
3971
|
+
this.generatedCodeColumn,
|
|
3972
|
+
sourceIndex,
|
|
3973
|
+
loc.line,
|
|
3974
|
+
loc.column
|
|
3975
|
+
];
|
|
3976
|
+
nameIndex >= 0 && segment.push(nameIndex), this.rawSegments.push(segment), this.advance(content.slice(previousContentLineEnd + 1));
|
|
3977
|
+
} else this.pending && (this.rawSegments.push(this.pending), this.advance(content));
|
|
3978
|
+
this.pending = null;
|
|
3979
|
+
}
|
|
3980
|
+
addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {
|
|
3981
|
+
let originalCharIndex = chunk.start, first = !0, charInHiresBoundary = !1;
|
|
3982
|
+
for(; originalCharIndex < chunk.end;){
|
|
3983
|
+
if ('\n' === original[originalCharIndex]) loc.line += 1, loc.column = 0, this.generatedCodeLine += 1, this.raw[this.generatedCodeLine] = this.rawSegments = [], this.generatedCodeColumn = 0, first = !0, charInHiresBoundary = !1;
|
|
3984
|
+
else {
|
|
3985
|
+
if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
|
|
3986
|
+
let segment = [
|
|
3987
|
+
this.generatedCodeColumn,
|
|
3988
|
+
sourceIndex,
|
|
3989
|
+
loc.line,
|
|
3990
|
+
loc.column
|
|
3991
|
+
];
|
|
3992
|
+
'boundary' === this.hires ? wordRegex.test(original[originalCharIndex]) ? charInHiresBoundary || (this.rawSegments.push(segment), charInHiresBoundary = !0) : (this.rawSegments.push(segment), charInHiresBoundary = !1) : this.rawSegments.push(segment);
|
|
3993
|
+
}
|
|
3994
|
+
loc.column += 1, this.generatedCodeColumn += 1, first = !1;
|
|
3995
|
+
}
|
|
3996
|
+
originalCharIndex += 1;
|
|
3997
|
+
}
|
|
3998
|
+
this.pending = null;
|
|
3999
|
+
}
|
|
4000
|
+
advance(str) {
|
|
4001
|
+
if (!str) return;
|
|
4002
|
+
let lines = str.split('\n');
|
|
4003
|
+
if (lines.length > 1) {
|
|
4004
|
+
for(let i = 0; i < lines.length - 1; i++)this.generatedCodeLine++, this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
4005
|
+
this.generatedCodeColumn = 0;
|
|
4006
|
+
}
|
|
4007
|
+
this.generatedCodeColumn += lines[lines.length - 1].length;
|
|
4008
|
+
}
|
|
4009
|
+
}
|
|
4010
|
+
let warned = {
|
|
4011
|
+
insertLeft: !1,
|
|
4012
|
+
insertRight: !1,
|
|
4013
|
+
storeName: !1
|
|
4014
|
+
};
|
|
4015
|
+
class MagicString {
|
|
4016
|
+
constructor(string, options = {}){
|
|
4017
|
+
let chunk = new Chunk(0, string.length, string);
|
|
4018
|
+
Object.defineProperties(this, {
|
|
4019
|
+
original: {
|
|
4020
|
+
writable: !0,
|
|
4021
|
+
value: string
|
|
4022
|
+
},
|
|
4023
|
+
outro: {
|
|
4024
|
+
writable: !0,
|
|
4025
|
+
value: ''
|
|
4026
|
+
},
|
|
4027
|
+
intro: {
|
|
4028
|
+
writable: !0,
|
|
4029
|
+
value: ''
|
|
4030
|
+
},
|
|
4031
|
+
firstChunk: {
|
|
4032
|
+
writable: !0,
|
|
4033
|
+
value: chunk
|
|
4034
|
+
},
|
|
4035
|
+
lastChunk: {
|
|
4036
|
+
writable: !0,
|
|
4037
|
+
value: chunk
|
|
4038
|
+
},
|
|
4039
|
+
lastSearchedChunk: {
|
|
4040
|
+
writable: !0,
|
|
4041
|
+
value: chunk
|
|
4042
|
+
},
|
|
4043
|
+
byStart: {
|
|
4044
|
+
writable: !0,
|
|
4045
|
+
value: {}
|
|
4046
|
+
},
|
|
4047
|
+
byEnd: {
|
|
4048
|
+
writable: !0,
|
|
4049
|
+
value: {}
|
|
4050
|
+
},
|
|
4051
|
+
filename: {
|
|
4052
|
+
writable: !0,
|
|
4053
|
+
value: options.filename
|
|
4054
|
+
},
|
|
4055
|
+
indentExclusionRanges: {
|
|
4056
|
+
writable: !0,
|
|
4057
|
+
value: options.indentExclusionRanges
|
|
4058
|
+
},
|
|
4059
|
+
sourcemapLocations: {
|
|
4060
|
+
writable: !0,
|
|
4061
|
+
value: new BitSet()
|
|
4062
|
+
},
|
|
4063
|
+
storedNames: {
|
|
4064
|
+
writable: !0,
|
|
4065
|
+
value: {}
|
|
4066
|
+
},
|
|
4067
|
+
indentStr: {
|
|
4068
|
+
writable: !0,
|
|
4069
|
+
value: void 0
|
|
4070
|
+
},
|
|
4071
|
+
ignoreList: {
|
|
4072
|
+
writable: !0,
|
|
4073
|
+
value: options.ignoreList
|
|
4074
|
+
},
|
|
4075
|
+
offset: {
|
|
4076
|
+
writable: !0,
|
|
4077
|
+
value: options.offset || 0
|
|
4078
|
+
}
|
|
4079
|
+
}), this.byStart[0] = chunk, this.byEnd[string.length] = chunk;
|
|
4080
|
+
}
|
|
4081
|
+
addSourcemapLocation(char) {
|
|
4082
|
+
this.sourcemapLocations.add(char);
|
|
4083
|
+
}
|
|
4084
|
+
append(content) {
|
|
4085
|
+
if ('string' != typeof content) throw TypeError('outro content must be a string');
|
|
4086
|
+
return this.outro += content, this;
|
|
4087
|
+
}
|
|
4088
|
+
appendLeft(index, content) {
|
|
4089
|
+
if (index += this.offset, 'string' != typeof content) throw TypeError('inserted content must be a string');
|
|
4090
|
+
this._split(index);
|
|
4091
|
+
let chunk = this.byEnd[index];
|
|
4092
|
+
return chunk ? chunk.appendLeft(content) : this.intro += content, this;
|
|
4093
|
+
}
|
|
4094
|
+
appendRight(index, content) {
|
|
4095
|
+
if (index += this.offset, 'string' != typeof content) throw TypeError('inserted content must be a string');
|
|
4096
|
+
this._split(index);
|
|
4097
|
+
let chunk = this.byStart[index];
|
|
4098
|
+
return chunk ? chunk.appendRight(content) : this.outro += content, this;
|
|
4099
|
+
}
|
|
4100
|
+
clone() {
|
|
4101
|
+
let cloned = new MagicString(this.original, {
|
|
4102
|
+
filename: this.filename,
|
|
4103
|
+
offset: this.offset
|
|
4104
|
+
}), originalChunk = this.firstChunk, clonedChunk = cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone();
|
|
4105
|
+
for(; originalChunk;){
|
|
4106
|
+
cloned.byStart[clonedChunk.start] = clonedChunk, cloned.byEnd[clonedChunk.end] = clonedChunk;
|
|
4107
|
+
let nextOriginalChunk = originalChunk.next, nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
|
|
4108
|
+
nextClonedChunk && (clonedChunk.next = nextClonedChunk, nextClonedChunk.previous = clonedChunk, clonedChunk = nextClonedChunk), originalChunk = nextOriginalChunk;
|
|
4109
|
+
}
|
|
4110
|
+
return cloned.lastChunk = clonedChunk, this.indentExclusionRanges && (cloned.indentExclusionRanges = this.indentExclusionRanges.slice()), cloned.sourcemapLocations = new BitSet(this.sourcemapLocations), cloned.intro = this.intro, cloned.outro = this.outro, cloned;
|
|
4111
|
+
}
|
|
4112
|
+
generateDecodedMap(options) {
|
|
4113
|
+
options = options || {};
|
|
4114
|
+
let names = Object.keys(this.storedNames), mappings = new Mappings(options.hires), locate = getLocator(this.original);
|
|
4115
|
+
return this.intro && mappings.advance(this.intro), this.firstChunk.eachNext((chunk)=>{
|
|
4116
|
+
let loc = locate(chunk.start);
|
|
4117
|
+
chunk.intro.length && mappings.advance(chunk.intro), chunk.edited ? mappings.addEdit(0, chunk.content, loc, chunk.storeName ? names.indexOf(chunk.original) : -1) : mappings.addUneditedChunk(0, chunk, this.original, loc, this.sourcemapLocations), chunk.outro.length && mappings.advance(chunk.outro);
|
|
4118
|
+
}), this.outro && mappings.advance(this.outro), {
|
|
4119
|
+
file: options.file ? options.file.split(/[/\\]/).pop() : void 0,
|
|
4120
|
+
sources: [
|
|
4121
|
+
options.source ? function(from, to) {
|
|
4122
|
+
let fromParts = from.split(/[/\\]/), toParts = to.split(/[/\\]/);
|
|
4123
|
+
for(fromParts.pop(); fromParts[0] === toParts[0];)fromParts.shift(), toParts.shift();
|
|
4124
|
+
if (fromParts.length) {
|
|
4125
|
+
let i = fromParts.length;
|
|
4126
|
+
for(; i--;)fromParts[i] = '..';
|
|
4127
|
+
}
|
|
4128
|
+
return fromParts.concat(toParts).join('/');
|
|
4129
|
+
}(options.file || '', options.source) : options.file || ''
|
|
4130
|
+
],
|
|
4131
|
+
sourcesContent: options.includeContent ? [
|
|
4132
|
+
this.original
|
|
4133
|
+
] : void 0,
|
|
4134
|
+
names,
|
|
4135
|
+
mappings: mappings.raw,
|
|
4136
|
+
x_google_ignoreList: this.ignoreList ? [
|
|
4137
|
+
0
|
|
4138
|
+
] : void 0
|
|
4139
|
+
};
|
|
4140
|
+
}
|
|
4141
|
+
generateMap(options) {
|
|
4142
|
+
return new SourceMap(this.generateDecodedMap(options));
|
|
4143
|
+
}
|
|
4144
|
+
_ensureindentStr() {
|
|
4145
|
+
let lines, tabbed, spaced;
|
|
4146
|
+
void 0 === this.indentStr && (this.indentStr = (tabbed = (lines = this.original.split('\n')).filter((line)=>/^\t+/.test(line)), spaced = lines.filter((line)=>/^ {2,}/.test(line)), 0 === tabbed.length && 0 === spaced.length ? null : tabbed.length >= spaced.length ? '\t' : Array(spaced.reduce((previous, current)=>Math.min(/^ +/.exec(current)[0].length, previous), 1 / 0) + 1).join(' ')));
|
|
4147
|
+
}
|
|
4148
|
+
_getRawIndentString() {
|
|
4149
|
+
return this._ensureindentStr(), this.indentStr;
|
|
4150
|
+
}
|
|
4151
|
+
getIndentString() {
|
|
4152
|
+
return this._ensureindentStr(), null === this.indentStr ? '\t' : this.indentStr;
|
|
4153
|
+
}
|
|
4154
|
+
indent(indentStr, options) {
|
|
4155
|
+
var thing;
|
|
4156
|
+
let pattern = /^[^\r\n]/gm;
|
|
4157
|
+
if (thing = indentStr, '[object Object]' === magic_string_es_toString.call(thing) && (options = indentStr, indentStr = void 0), void 0 === indentStr && (this._ensureindentStr(), indentStr = this.indentStr || '\t'), '' === indentStr) return this;
|
|
4158
|
+
let isExcluded = {};
|
|
4159
|
+
(options = options || {}).exclude && ('number' == typeof options.exclude[0] ? [
|
|
4160
|
+
options.exclude
|
|
4161
|
+
] : options.exclude).forEach((exclusion)=>{
|
|
4162
|
+
for(let i = exclusion[0]; i < exclusion[1]; i += 1)isExcluded[i] = !0;
|
|
4163
|
+
});
|
|
4164
|
+
let shouldIndentNextCharacter = !1 !== options.indentStart, replacer = (match)=>shouldIndentNextCharacter ? `${indentStr}${match}` : (shouldIndentNextCharacter = !0, match);
|
|
4165
|
+
this.intro = this.intro.replace(pattern, replacer);
|
|
4166
|
+
let charIndex = 0, chunk = this.firstChunk;
|
|
4167
|
+
for(; chunk;){
|
|
4168
|
+
let end = chunk.end;
|
|
4169
|
+
if (chunk.edited) !isExcluded[charIndex] && (chunk.content = chunk.content.replace(pattern, replacer), chunk.content.length && (shouldIndentNextCharacter = '\n' === chunk.content[chunk.content.length - 1]));
|
|
4170
|
+
else for(charIndex = chunk.start; charIndex < end;){
|
|
4171
|
+
if (!isExcluded[charIndex]) {
|
|
4172
|
+
let char = this.original[charIndex];
|
|
4173
|
+
'\n' === char ? shouldIndentNextCharacter = !0 : '\r' !== char && shouldIndentNextCharacter && (shouldIndentNextCharacter = !1, charIndex === chunk.start ? chunk.prependRight(indentStr) : (this._splitChunk(chunk, charIndex), (chunk = chunk.next).prependRight(indentStr)));
|
|
4174
|
+
}
|
|
4175
|
+
charIndex += 1;
|
|
4176
|
+
}
|
|
4177
|
+
charIndex = chunk.end, chunk = chunk.next;
|
|
4178
|
+
}
|
|
4179
|
+
return this.outro = this.outro.replace(pattern, replacer), this;
|
|
4180
|
+
}
|
|
4181
|
+
insert() {
|
|
4182
|
+
throw Error('magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)');
|
|
4183
|
+
}
|
|
4184
|
+
insertLeft(index, content) {
|
|
4185
|
+
return warned.insertLeft || (console.warn('magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead'), warned.insertLeft = !0), this.appendLeft(index, content);
|
|
4186
|
+
}
|
|
4187
|
+
insertRight(index, content) {
|
|
4188
|
+
return warned.insertRight || (console.warn('magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead'), warned.insertRight = !0), this.prependRight(index, content);
|
|
4189
|
+
}
|
|
4190
|
+
move(start, end, index) {
|
|
4191
|
+
if (start += this.offset, end += this.offset, (index += this.offset) >= start && index <= end) throw Error('Cannot move a selection inside itself');
|
|
4192
|
+
this._split(start), this._split(end), this._split(index);
|
|
4193
|
+
let first = this.byStart[start], last = this.byEnd[end], oldLeft = first.previous, oldRight = last.next, newRight = this.byStart[index];
|
|
4194
|
+
if (!newRight && last === this.lastChunk) return this;
|
|
4195
|
+
let newLeft = newRight ? newRight.previous : this.lastChunk;
|
|
4196
|
+
return oldLeft && (oldLeft.next = oldRight), oldRight && (oldRight.previous = oldLeft), newLeft && (newLeft.next = first), newRight && (newRight.previous = last), first.previous || (this.firstChunk = last.next), last.next || (this.lastChunk = first.previous, this.lastChunk.next = null), first.previous = newLeft, last.next = newRight || null, newLeft || (this.firstChunk = first), newRight || (this.lastChunk = last), this;
|
|
4197
|
+
}
|
|
4198
|
+
overwrite(start, end, content, options) {
|
|
4199
|
+
return options = options || {}, this.update(start, end, content, {
|
|
4200
|
+
...options,
|
|
4201
|
+
overwrite: !options.contentOnly
|
|
4202
|
+
});
|
|
4203
|
+
}
|
|
4204
|
+
update(start, end, content, options) {
|
|
4205
|
+
if (start += this.offset, end += this.offset, 'string' != typeof content) throw TypeError('replacement content must be a string');
|
|
4206
|
+
if (0 !== this.original.length) {
|
|
4207
|
+
for(; start < 0;)start += this.original.length;
|
|
4208
|
+
for(; end < 0;)end += this.original.length;
|
|
4209
|
+
}
|
|
4210
|
+
if (end > this.original.length) throw Error('end is out of bounds');
|
|
4211
|
+
if (start === end) throw Error('Cannot overwrite a zero-length range – use appendLeft or prependRight instead');
|
|
4212
|
+
this._split(start), this._split(end), !0 === options && (warned.storeName || (console.warn('The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string'), warned.storeName = !0), options = {
|
|
4213
|
+
storeName: !0
|
|
4214
|
+
});
|
|
4215
|
+
let storeName = void 0 !== options && options.storeName, overwrite = void 0 !== options && options.overwrite;
|
|
4216
|
+
if (storeName) {
|
|
4217
|
+
let original = this.original.slice(start, end);
|
|
4218
|
+
Object.defineProperty(this.storedNames, original, {
|
|
4219
|
+
writable: !0,
|
|
4220
|
+
value: !0,
|
|
4221
|
+
enumerable: !0
|
|
4222
|
+
});
|
|
4223
|
+
}
|
|
4224
|
+
let first = this.byStart[start], last = this.byEnd[end];
|
|
4225
|
+
if (first) {
|
|
4226
|
+
let chunk = first;
|
|
4227
|
+
for(; chunk !== last;){
|
|
4228
|
+
if (chunk.next !== this.byStart[chunk.end]) throw Error('Cannot overwrite across a split point');
|
|
4229
|
+
(chunk = chunk.next).edit('', !1);
|
|
4230
|
+
}
|
|
4231
|
+
first.edit(content, storeName, !overwrite);
|
|
4232
|
+
} else {
|
|
4233
|
+
let newChunk = new Chunk(start, end, '').edit(content, storeName);
|
|
4234
|
+
last.next = newChunk, newChunk.previous = last;
|
|
4235
|
+
}
|
|
4236
|
+
return this;
|
|
4237
|
+
}
|
|
4238
|
+
prepend(content) {
|
|
4239
|
+
if ('string' != typeof content) throw TypeError('outro content must be a string');
|
|
4240
|
+
return this.intro = content + this.intro, this;
|
|
1717
4241
|
}
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
'react-dom',
|
|
1724
|
-
'react-router-dom',
|
|
1725
|
-
'vue',
|
|
1726
|
-
'vue-router'
|
|
1727
|
-
], getExternalLibraryName = (pkgName)=>{
|
|
1728
|
-
let externalAlias = {
|
|
1729
|
-
'react-dom': 'ReactDOM',
|
|
1730
|
-
'react-router-dom': 'ReactRouterDOM'
|
|
1731
|
-
};
|
|
1732
|
-
return externalAlias[pkgName] ? externalAlias[pkgName] : pkgName.replace(/^@/, '').split(/[/\-.]/).filter(Boolean).map((part)=>part.charAt(0).toUpperCase() + part.slice(1)).join('');
|
|
1733
|
-
}, getExternalValue = (pkgName)=>`window ${getExternalLibraryName(pkgName)}`, MODULE_PATH_REGEX = /.*[\\/]node_modules[\\/](?!\.pnpm[\\/])(?:(@[^\\/]+)[\\/])?([^\\/]+)/, normalizeSvg = (content)=>content.replace(/<\?xml[\s\S]*?\?>/gi, '').replace(/<!DOCTYPE[\s\S]*?>/gi, '').replace(/<!--[\s\S]*?-->/g, '').trim(), extractSvgContent = (content)=>{
|
|
1734
|
-
let match = content.match(/<svg\b([^>]*)>/i), viewBoxMatch = match?.[1]?.match(/viewBox\s*=\s*["']([^"']+)["']/i);
|
|
1735
|
-
return {
|
|
1736
|
-
inner: content.replace(/^[\s\S]*?<svg\b[^>]*>/i, '').replace(/<\/svg>[\s\S]*$/i, '').trim(),
|
|
1737
|
-
viewBox: viewBoxMatch?.[1]
|
|
1738
|
-
};
|
|
1739
|
-
}, readSvgFiles = (dir, collected = [])=>{
|
|
1740
|
-
if (!node_fs.existsSync(dir)) return collected;
|
|
1741
|
-
for (let entry of node_fs.readdirSync(dir, {
|
|
1742
|
-
withFileTypes: !0
|
|
1743
|
-
})){
|
|
1744
|
-
let fullPath = node_path.join(dir, entry.name);
|
|
1745
|
-
entry.isDirectory() ? readSvgFiles(fullPath, collected) : entry.isFile() && entry.name.toLowerCase().endsWith('.svg') && collected.push(fullPath);
|
|
4242
|
+
prependLeft(index, content) {
|
|
4243
|
+
if (index += this.offset, 'string' != typeof content) throw TypeError('inserted content must be a string');
|
|
4244
|
+
this._split(index);
|
|
4245
|
+
let chunk = this.byEnd[index];
|
|
4246
|
+
return chunk ? chunk.prependLeft(content) : this.intro = content + this.intro, this;
|
|
1746
4247
|
}
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
4248
|
+
prependRight(index, content) {
|
|
4249
|
+
if (index += this.offset, 'string' != typeof content) throw TypeError('inserted content must be a string');
|
|
4250
|
+
this._split(index);
|
|
4251
|
+
let chunk = this.byStart[index];
|
|
4252
|
+
return chunk ? chunk.prependRight(content) : this.outro = content + this.outro, this;
|
|
4253
|
+
}
|
|
4254
|
+
remove(start, end) {
|
|
4255
|
+
if (start += this.offset, end += this.offset, 0 !== this.original.length) {
|
|
4256
|
+
for(; start < 0;)start += this.original.length;
|
|
4257
|
+
for(; end < 0;)end += this.original.length;
|
|
4258
|
+
}
|
|
4259
|
+
if (start === end) return this;
|
|
4260
|
+
if (start < 0 || end > this.original.length) throw Error('Character is out of bounds');
|
|
4261
|
+
if (start > end) throw Error('end must be greater than start');
|
|
4262
|
+
this._split(start), this._split(end);
|
|
4263
|
+
let chunk = this.byStart[start];
|
|
4264
|
+
for(; chunk;)chunk.intro = '', chunk.outro = '', chunk.edit(''), chunk = end > chunk.end ? this.byStart[chunk.end] : null;
|
|
4265
|
+
return this;
|
|
4266
|
+
}
|
|
4267
|
+
reset(start, end) {
|
|
4268
|
+
if (start += this.offset, end += this.offset, 0 !== this.original.length) {
|
|
4269
|
+
for(; start < 0;)start += this.original.length;
|
|
4270
|
+
for(; end < 0;)end += this.original.length;
|
|
4271
|
+
}
|
|
4272
|
+
if (start === end) return this;
|
|
4273
|
+
if (start < 0 || end > this.original.length) throw Error('Character is out of bounds');
|
|
4274
|
+
if (start > end) throw Error('end must be greater than start');
|
|
4275
|
+
this._split(start), this._split(end);
|
|
4276
|
+
let chunk = this.byStart[start];
|
|
4277
|
+
for(; chunk;)chunk.reset(), chunk = end > chunk.end ? this.byStart[chunk.end] : null;
|
|
4278
|
+
return this;
|
|
4279
|
+
}
|
|
4280
|
+
lastChar() {
|
|
4281
|
+
if (this.outro.length) return this.outro[this.outro.length - 1];
|
|
4282
|
+
let chunk = this.lastChunk;
|
|
4283
|
+
do {
|
|
4284
|
+
if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];
|
|
4285
|
+
if (chunk.content.length) return chunk.content[chunk.content.length - 1];
|
|
4286
|
+
if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];
|
|
4287
|
+
}while (chunk = chunk.previous);
|
|
4288
|
+
return this.intro.length ? this.intro[this.intro.length - 1] : '';
|
|
4289
|
+
}
|
|
4290
|
+
lastLine() {
|
|
4291
|
+
let lineIndex = this.outro.lastIndexOf('\n');
|
|
4292
|
+
if (-1 !== lineIndex) return this.outro.substr(lineIndex + 1);
|
|
4293
|
+
let lineStr = this.outro, chunk = this.lastChunk;
|
|
4294
|
+
do {
|
|
4295
|
+
if (chunk.outro.length > 0) {
|
|
4296
|
+
if (-1 !== (lineIndex = chunk.outro.lastIndexOf('\n'))) return chunk.outro.substr(lineIndex + 1) + lineStr;
|
|
4297
|
+
lineStr = chunk.outro + lineStr;
|
|
4298
|
+
}
|
|
4299
|
+
if (chunk.content.length > 0) {
|
|
4300
|
+
if (-1 !== (lineIndex = chunk.content.lastIndexOf('\n'))) return chunk.content.substr(lineIndex + 1) + lineStr;
|
|
4301
|
+
lineStr = chunk.content + lineStr;
|
|
4302
|
+
}
|
|
4303
|
+
if (chunk.intro.length > 0) {
|
|
4304
|
+
if (-1 !== (lineIndex = chunk.intro.lastIndexOf('\n'))) return chunk.intro.substr(lineIndex + 1) + lineStr;
|
|
4305
|
+
lineStr = chunk.intro + lineStr;
|
|
4306
|
+
}
|
|
4307
|
+
}while (chunk = chunk.previous);
|
|
4308
|
+
return -1 !== (lineIndex = this.intro.lastIndexOf('\n')) ? this.intro.substr(lineIndex + 1) + lineStr : this.intro + lineStr;
|
|
4309
|
+
}
|
|
4310
|
+
slice(start = 0, end = this.original.length - this.offset) {
|
|
4311
|
+
if (start += this.offset, end += this.offset, 0 !== this.original.length) {
|
|
4312
|
+
for(; start < 0;)start += this.original.length;
|
|
4313
|
+
for(; end < 0;)end += this.original.length;
|
|
4314
|
+
}
|
|
4315
|
+
let result = '', chunk = this.firstChunk;
|
|
4316
|
+
for(; chunk && (chunk.start > start || chunk.end <= start);){
|
|
4317
|
+
if (chunk.start < end && chunk.end >= end) return result;
|
|
4318
|
+
chunk = chunk.next;
|
|
4319
|
+
}
|
|
4320
|
+
if (chunk && chunk.edited && chunk.start !== start) throw Error(`Cannot use replaced character ${start} as slice start anchor.`);
|
|
4321
|
+
let startChunk = chunk;
|
|
4322
|
+
for(; chunk;){
|
|
4323
|
+
chunk.intro && (startChunk !== chunk || chunk.start === start) && (result += chunk.intro);
|
|
4324
|
+
let containsEnd = chunk.start < end && chunk.end >= end;
|
|
4325
|
+
if (containsEnd && chunk.edited && chunk.end !== end) throw Error(`Cannot use replaced character ${end} as slice end anchor.`);
|
|
4326
|
+
let sliceStart = startChunk === chunk ? start - chunk.start : 0, sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
|
|
4327
|
+
if (result += chunk.content.slice(sliceStart, sliceEnd), chunk.outro && (!containsEnd || chunk.end === end) && (result += chunk.outro), containsEnd) break;
|
|
4328
|
+
chunk = chunk.next;
|
|
4329
|
+
}
|
|
4330
|
+
return result;
|
|
4331
|
+
}
|
|
4332
|
+
snip(start, end) {
|
|
4333
|
+
let clone = this.clone();
|
|
4334
|
+
return clone.remove(0, start), clone.remove(end, clone.original.length), clone;
|
|
4335
|
+
}
|
|
4336
|
+
_split(index) {
|
|
4337
|
+
if (this.byStart[index] || this.byEnd[index]) return;
|
|
4338
|
+
let chunk = this.lastSearchedChunk, previousChunk = chunk, searchForward = index > chunk.end;
|
|
4339
|
+
for(; chunk;){
|
|
4340
|
+
if (chunk.contains(index)) return this._splitChunk(chunk, index);
|
|
4341
|
+
if ((chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start]) === previousChunk) return;
|
|
4342
|
+
previousChunk = chunk;
|
|
4343
|
+
}
|
|
4344
|
+
}
|
|
4345
|
+
_splitChunk(chunk, index) {
|
|
4346
|
+
if (chunk.edited && chunk.content.length) {
|
|
4347
|
+
let loc = getLocator(this.original)(index);
|
|
4348
|
+
throw Error(`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`);
|
|
4349
|
+
}
|
|
4350
|
+
let newChunk = chunk.split(index);
|
|
4351
|
+
return this.byEnd[index] = chunk, this.byStart[index] = newChunk, this.byEnd[newChunk.end] = newChunk, chunk === this.lastChunk && (this.lastChunk = newChunk), this.lastSearchedChunk = chunk, !0;
|
|
4352
|
+
}
|
|
4353
|
+
toString() {
|
|
4354
|
+
let str = this.intro, chunk = this.firstChunk;
|
|
4355
|
+
for(; chunk;)str += chunk.toString(), chunk = chunk.next;
|
|
4356
|
+
return str + this.outro;
|
|
4357
|
+
}
|
|
4358
|
+
isEmpty() {
|
|
4359
|
+
let chunk = this.firstChunk;
|
|
4360
|
+
do if (chunk.intro.length && chunk.intro.trim() || chunk.content.length && chunk.content.trim() || chunk.outro.length && chunk.outro.trim()) return !1;
|
|
4361
|
+
while (chunk = chunk.next);
|
|
4362
|
+
return !0;
|
|
4363
|
+
}
|
|
4364
|
+
length() {
|
|
4365
|
+
let chunk = this.firstChunk, length = 0;
|
|
4366
|
+
do length += chunk.intro.length + chunk.content.length + chunk.outro.length;
|
|
4367
|
+
while (chunk = chunk.next);
|
|
4368
|
+
return length;
|
|
4369
|
+
}
|
|
4370
|
+
trimLines() {
|
|
4371
|
+
return this.trim('[\\r\\n]');
|
|
4372
|
+
}
|
|
4373
|
+
trim(charType) {
|
|
4374
|
+
return this.trimStart(charType).trimEnd(charType);
|
|
4375
|
+
}
|
|
4376
|
+
trimEndAborted(charType) {
|
|
4377
|
+
let rx = RegExp((charType || '\\s') + '+$');
|
|
4378
|
+
if (this.outro = this.outro.replace(rx, ''), this.outro.length) return !0;
|
|
4379
|
+
let chunk = this.lastChunk;
|
|
4380
|
+
do {
|
|
4381
|
+
let end = chunk.end, aborted = chunk.trimEnd(rx);
|
|
4382
|
+
if (chunk.end !== end && (this.lastChunk === chunk && (this.lastChunk = chunk.next), this.byEnd[chunk.end] = chunk, this.byStart[chunk.next.start] = chunk.next, this.byEnd[chunk.next.end] = chunk.next), aborted) return !0;
|
|
4383
|
+
chunk = chunk.previous;
|
|
4384
|
+
}while (chunk);
|
|
4385
|
+
return !1;
|
|
4386
|
+
}
|
|
4387
|
+
trimEnd(charType) {
|
|
4388
|
+
return this.trimEndAborted(charType), this;
|
|
4389
|
+
}
|
|
4390
|
+
trimStartAborted(charType) {
|
|
4391
|
+
let rx = RegExp('^' + (charType || '\\s') + '+');
|
|
4392
|
+
if (this.intro = this.intro.replace(rx, ''), this.intro.length) return !0;
|
|
4393
|
+
let chunk = this.firstChunk;
|
|
4394
|
+
do {
|
|
4395
|
+
let end = chunk.end, aborted = chunk.trimStart(rx);
|
|
4396
|
+
if (chunk.end !== end && (chunk === this.lastChunk && (this.lastChunk = chunk.next), this.byEnd[chunk.end] = chunk, this.byStart[chunk.next.start] = chunk.next, this.byEnd[chunk.next.end] = chunk.next), aborted) return !0;
|
|
4397
|
+
chunk = chunk.next;
|
|
4398
|
+
}while (chunk);
|
|
4399
|
+
return !1;
|
|
4400
|
+
}
|
|
4401
|
+
trimStart(charType) {
|
|
4402
|
+
return this.trimStartAborted(charType), this;
|
|
4403
|
+
}
|
|
4404
|
+
hasChanged() {
|
|
4405
|
+
return this.original !== this.toString();
|
|
4406
|
+
}
|
|
4407
|
+
_replaceRegexp(searchValue, replacement) {
|
|
4408
|
+
function getReplacement(match, str) {
|
|
4409
|
+
return 'string' == typeof replacement ? replacement.replace(/\$(\$|&|\d+)/g, (_, i)=>'$' === i ? '$' : '&' === i ? match[0] : +i < match.length ? match[+i] : `$${i}`) : replacement(...match, match.index, str, match.groups);
|
|
4410
|
+
}
|
|
4411
|
+
if (searchValue.global) (function(re, str) {
|
|
4412
|
+
let match, matches = [];
|
|
4413
|
+
for(; match = re.exec(str);)matches.push(match);
|
|
4414
|
+
return matches;
|
|
4415
|
+
})(searchValue, this.original).forEach((match)=>{
|
|
4416
|
+
if (null != match.index) {
|
|
4417
|
+
let replacement = getReplacement(match, this.original);
|
|
4418
|
+
replacement !== match[0] && this.overwrite(match.index, match.index + match[0].length, replacement);
|
|
4419
|
+
}
|
|
4420
|
+
});
|
|
4421
|
+
else {
|
|
4422
|
+
let match = this.original.match(searchValue);
|
|
4423
|
+
if (match && null != match.index) {
|
|
4424
|
+
let replacement = getReplacement(match, this.original);
|
|
4425
|
+
replacement !== match[0] && this.overwrite(match.index, match.index + match[0].length, replacement);
|
|
4426
|
+
}
|
|
4427
|
+
}
|
|
4428
|
+
return this;
|
|
4429
|
+
}
|
|
4430
|
+
_replaceString(string, replacement) {
|
|
4431
|
+
let { original } = this, index = original.indexOf(string);
|
|
4432
|
+
return -1 !== index && ('function' == typeof replacement && (replacement = replacement(string, index, original)), string !== replacement && this.overwrite(index, index + string.length, replacement)), this;
|
|
4433
|
+
}
|
|
4434
|
+
replace(searchValue, replacement) {
|
|
4435
|
+
return 'string' == typeof searchValue ? this._replaceString(searchValue, replacement) : this._replaceRegexp(searchValue, replacement);
|
|
4436
|
+
}
|
|
4437
|
+
_replaceAllString(string, replacement) {
|
|
4438
|
+
let { original } = this, stringLength = string.length;
|
|
4439
|
+
for(let index = original.indexOf(string); -1 !== index; index = original.indexOf(string, index + stringLength)){
|
|
4440
|
+
let previous = original.slice(index, index + stringLength), _replacement = replacement;
|
|
4441
|
+
'function' == typeof replacement && (_replacement = replacement(previous, index, original)), previous !== _replacement && this.overwrite(index, index + stringLength, _replacement);
|
|
4442
|
+
}
|
|
4443
|
+
return this;
|
|
4444
|
+
}
|
|
4445
|
+
replaceAll(searchValue, replacement) {
|
|
4446
|
+
if ('string' == typeof searchValue) return this._replaceAllString(searchValue, replacement);
|
|
4447
|
+
if (!searchValue.global) throw TypeError('MagicString.prototype.replaceAll called with a non-global RegExp argument');
|
|
4448
|
+
return this._replaceRegexp(searchValue, replacement);
|
|
4449
|
+
}
|
|
4450
|
+
}
|
|
4451
|
+
Object.prototype.hasOwnProperty;
|
|
4452
|
+
let dist = __webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/index.js");
|
|
1763
4453
|
var dist_default = __webpack_require__.n(dist), dist_default_0 = dist_default();
|
|
1764
4454
|
let UNOCSS_CONFIG_FILES = [
|
|
1765
4455
|
'unocss.config.mjs',
|
|
@@ -1774,7 +4464,65 @@ let UNOCSS_CONFIG_FILES = [
|
|
|
1774
4464
|
if (!view) return (css)=>css;
|
|
1775
4465
|
let prefix = {};
|
|
1776
4466
|
return view.trim().replace(/(\\*)\\(["'`\\])/g, (_, bs, char)=>(prefix[char] = bs.replace(/\\\\/g, '\\'), '')), (css)=>css.replace(/["'`\\]/g, (v)=>(prefix[v] || '') + v);
|
|
1777
|
-
}, DOTENV_LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm,
|
|
4467
|
+
}, main_0 = __webpack_require__("../../node_modules/.pnpm/dotenv-expand@12.0.3/node_modules/dotenv-expand/lib/main.js"), DOTENV_LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm, isIpv6LinkLocal = (address)=>address.toLowerCase().startsWith('fe80:'), checkPortOnHost = (port, host)=>new Promise((resolve)=>{
|
|
4468
|
+
let server = node_net.createServer();
|
|
4469
|
+
server.once('error', (error)=>{
|
|
4470
|
+
'EADDRINUSE' === error.code ? resolve('occupied') : resolve('unsupported');
|
|
4471
|
+
}), server.listen(null === host ? {
|
|
4472
|
+
port,
|
|
4473
|
+
exclusive: !0
|
|
4474
|
+
} : {
|
|
4475
|
+
port,
|
|
4476
|
+
host,
|
|
4477
|
+
exclusive: !0
|
|
4478
|
+
}, ()=>{
|
|
4479
|
+
server.close(()=>{
|
|
4480
|
+
resolve('available');
|
|
4481
|
+
});
|
|
4482
|
+
});
|
|
4483
|
+
}), getPortAvailability = async (port, hosts)=>{
|
|
4484
|
+
let hasSupportedHost = !1;
|
|
4485
|
+
for (let currentHost of hosts){
|
|
4486
|
+
let result = await checkPortOnHost(port, currentHost);
|
|
4487
|
+
if ('occupied' === result) return !1;
|
|
4488
|
+
'available' === result && (hasSupportedHost = !0);
|
|
4489
|
+
}
|
|
4490
|
+
return hasSupportedHost;
|
|
4491
|
+
}, getRandomPort = async ()=>new Promise((resolve, reject)=>{
|
|
4492
|
+
let server = node_net.createServer();
|
|
4493
|
+
server.once('error', reject), server.listen({
|
|
4494
|
+
port: 0,
|
|
4495
|
+
exclusive: !0
|
|
4496
|
+
}, ()=>{
|
|
4497
|
+
let address = server.address(), resolvedPort = 'object' == typeof address && address ? address.port : 0;
|
|
4498
|
+
server.close((error)=>{
|
|
4499
|
+
error ? reject(error) : resolvedPort > 0 ? resolve(resolvedPort) : reject(Error('Failed to resolve random available port'));
|
|
4500
|
+
});
|
|
4501
|
+
});
|
|
4502
|
+
}), getPort = async (startPort = 45678)=>{
|
|
4503
|
+
let rawStartPort = Number.isFinite(startPort) ? Math.floor(startPort) : 45678;
|
|
4504
|
+
if (0 === rawStartPort) return getRandomPort();
|
|
4505
|
+
let normalizedStartPort = Math.max(1, Math.min(65535, rawStartPort)), hosts = (()=>{
|
|
4506
|
+
let hosts = [
|
|
4507
|
+
'0.0.0.0'
|
|
4508
|
+
];
|
|
4509
|
+
try {
|
|
4510
|
+
let interfaces = node_os.networkInterfaces();
|
|
4511
|
+
for (let interfaceName of Object.keys(interfaces)){
|
|
4512
|
+
let infos = interfaces[interfaceName];
|
|
4513
|
+
if (infos) for (let info of infos){
|
|
4514
|
+
if (!info?.address) continue;
|
|
4515
|
+
let family = info.family;
|
|
4516
|
+
('IPv6' === family || 6 === family) && isIpv6LinkLocal(info.address) || hosts.push(info.address);
|
|
4517
|
+
}
|
|
4518
|
+
}
|
|
4519
|
+
} catch {}
|
|
4520
|
+
return hosts.push(null), Array.from(new Set(hosts));
|
|
4521
|
+
})();
|
|
4522
|
+
for(let port = normalizedStartPort; port <= 65535; port++)if (await getPortAvailability(port, hosts)) return port;
|
|
4523
|
+
for(let port = 1; port < normalizedStartPort; port++)if (await getPortAvailability(port, hosts)) return port;
|
|
4524
|
+
throw Error('No available port found');
|
|
4525
|
+
}, TRANSFORM_TIMING_STORE = Symbol.for('unpack:transformTimingMap'), PLUGIN_CONTEXT_STORE = Symbol.for('unpack:pluginContextStore'), globalScope = globalThis;
|
|
1778
4526
|
globalScope[TRANSFORM_TIMING_STORE] ??= new WeakMap(), globalScope[PLUGIN_CONTEXT_STORE] ??= new WeakMap();
|
|
1779
4527
|
let flattenUnpackPlugins = ()=>getCurrentUnpackConfig().plugins?.flat(1 / 0) || [];
|
|
1780
4528
|
function getNormalizedPluginsByHook(hook) {
|
|
@@ -1868,7 +4616,7 @@ function applyPluginsByHookSync(hook, runner) {
|
|
|
1868
4616
|
}
|
|
1869
4617
|
async function getEntry(root, customEntry) {
|
|
1870
4618
|
let entry;
|
|
1871
|
-
if (entry = customEntry ? node_path.resolve(root, customEntry) : (await
|
|
4619
|
+
if (entry = customEntry ? node_path.resolve(root, customEntry) : (await dist_glob('(index|main).{js,ts,jsx,tsx}', {
|
|
1872
4620
|
cwd: node_path.join(root, 'src'),
|
|
1873
4621
|
absolute: !0
|
|
1874
4622
|
}))[0], !node_fs.existsSync(entry)) throw Error('could not find entry file');
|
|
@@ -1920,7 +4668,7 @@ class JsMinifyPlugin {
|
|
|
1920
4668
|
apply(compiler) {
|
|
1921
4669
|
let meta = JSON.stringify({
|
|
1922
4670
|
name: jsMinify_PLUGIN_NAME,
|
|
1923
|
-
version: "4.7.
|
|
4671
|
+
version: "4.7.4",
|
|
1924
4672
|
options: this.minifyOptions
|
|
1925
4673
|
});
|
|
1926
4674
|
compiler.hooks.compilation.tap(jsMinify_PLUGIN_NAME, (compilation)=>{
|
|
@@ -2174,7 +4922,7 @@ async function getRspackConfig(originalUnpackConfig) {
|
|
|
2174
4922
|
}
|
|
2175
4923
|
return obj;
|
|
2176
4924
|
}(node_fs.readFileSync(envPath)));
|
|
2177
|
-
parsed.NODE_ENV && (processEnv.NODE_ENV = parsed.NODE_ENV), expand({
|
|
4925
|
+
parsed.NODE_ENV && (processEnv.NODE_ENV = parsed.NODE_ENV), (0, main_0.expand)({
|
|
2178
4926
|
parsed,
|
|
2179
4927
|
processEnv
|
|
2180
4928
|
});
|
|
@@ -2347,13 +5095,13 @@ async function getRspackConfig(originalUnpackConfig) {
|
|
|
2347
5095
|
type: 'css',
|
|
2348
5096
|
hash: unpackConfig.build?.filenameHash,
|
|
2349
5097
|
async: !0
|
|
2350
|
-
}),
|
|
5098
|
+
}), utils_set(config, [
|
|
2351
5099
|
'module',
|
|
2352
5100
|
'parser',
|
|
2353
5101
|
'css/module'
|
|
2354
5102
|
], {
|
|
2355
5103
|
namedExports: !1
|
|
2356
|
-
}),
|
|
5104
|
+
}), utils_set(config, [
|
|
2357
5105
|
'module',
|
|
2358
5106
|
'generator',
|
|
2359
5107
|
'css/module'
|
|
@@ -2654,12 +5402,12 @@ async function unpackDev(originalConfig) {
|
|
|
2654
5402
|
...middlewares
|
|
2655
5403
|
]);
|
|
2656
5404
|
let server = new RspackDevServer(devServerOptions, compiler);
|
|
2657
|
-
await server.start(), logger_logger.greet(` ${colors.brand(`${colors.bold(unpackConfig._context.callerName.toUpperCase())} v4.7.
|
|
5405
|
+
await server.start(), logger_logger.greet(` ${colors.brand(`${colors.bold(unpackConfig._context.callerName.toUpperCase())} v4.7.4`)} ${colors.dim('ready in')} ${colors.bold(Math.ceil(performance.now() - getUnpackStartTime()))} ${colors.dim('ms')}\n`), printServerUrls({
|
|
2658
5406
|
port,
|
|
2659
5407
|
host: unpackConfig.server.host,
|
|
2660
5408
|
base: unpackConfig.base
|
|
2661
5409
|
}), addRestartCleaner(()=>server.stop(), ()=>new Promise((resolve)=>compiler.close(()=>resolve())));
|
|
2662
|
-
let open = unpackConfig.server?.open, url =
|
|
5410
|
+
let open = unpackConfig.server?.open, url = utils_isString(open) ? open : `http://localhost:${port}${devPublicPath}`;
|
|
2663
5411
|
return open && openBrowser(url), {
|
|
2664
5412
|
port,
|
|
2665
5413
|
url
|
|
@@ -2668,7 +5416,7 @@ async function unpackDev(originalConfig) {
|
|
|
2668
5416
|
function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'unpack' }) {
|
|
2669
5417
|
let _context = {
|
|
2670
5418
|
callerName,
|
|
2671
|
-
version: "4.7.
|
|
5419
|
+
version: "4.7.4",
|
|
2672
5420
|
cachePath: 'node_modules/.unpack'
|
|
2673
5421
|
}, resolveConfig = (mode)=>{
|
|
2674
5422
|
let rootPath, outputPath, basePath, cachedTraceMap, fs, isValidMethodName, parseFrame, formatOriginalLocation, formatFullStack, resolveErrorLocationAndStack, root, alias, shouldTransformDeepImport, preJsAssets, jsAssets, cssAssets, bundledDepsCachePath, deepImportPkgPattern, deepImportRegex, plugin, tsconfigPath, root1, uno, generated, configOrPath, defaults, VIRTUAL_UNO_CSS_ID, rootDir, isMpa, unoConfig, configFilePath, unpackConfigPath, tokens, requestedLayers, tasks, unocssCacheDir, tokensCachePath, layersCachePath, timeCachePath, configHashCachePath, generatedCachePath, bundlerCacheDir, cachedTokensSize, cachedLayersSize, isCompiling, resolveUnocssConfig, flushTasks, getVirtualModuleContent, hash, restoreSkipCode, applyUnoTransformers, options, rootPath1, registerCode, namesCode, defaultConfig = {
|
|
@@ -2735,7 +5483,64 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
2735
5483
|
if (!sourceMapContent) return;
|
|
2736
5484
|
tracer = new TraceMap(sourceMapContent), cachedTraceMap.set(sourceMapPath, tracer);
|
|
2737
5485
|
}
|
|
2738
|
-
let originalPosition =
|
|
5486
|
+
let originalPosition = function(map, needle) {
|
|
5487
|
+
var map1, segments, memo, line, column, bias;
|
|
5488
|
+
let index, { line: line1, column: column1, bias: bias1 } = needle;
|
|
5489
|
+
if (--line1 < 0) throw Error("`line` must be greater than 0 (lines start at line 1)");
|
|
5490
|
+
if (column1 < 0) throw Error("`column` must be greater than or equal to 0 (columns start at column 0)");
|
|
5491
|
+
let decoded = (map1 = map)._decoded || (map1._decoded = function(mappings) {
|
|
5492
|
+
let { length } = mappings, reader = new StringReader(mappings), decoded = [], genColumn = 0, sourcesIndex = 0, sourceLine = 0, sourceColumn = 0, namesIndex = 0;
|
|
5493
|
+
do {
|
|
5494
|
+
let semi = reader.indexOf(";"), line = [], sorted = !0, lastCol = 0;
|
|
5495
|
+
for(genColumn = 0; reader.pos < semi;){
|
|
5496
|
+
let seg;
|
|
5497
|
+
(genColumn = decodeInteger(reader, genColumn)) < lastCol && (sorted = !1), lastCol = genColumn, hasMoreVlq(reader, semi) ? (sourcesIndex = decodeInteger(reader, sourcesIndex), sourceLine = decodeInteger(reader, sourceLine), sourceColumn = decodeInteger(reader, sourceColumn), seg = hasMoreVlq(reader, semi) ? [
|
|
5498
|
+
genColumn,
|
|
5499
|
+
sourcesIndex,
|
|
5500
|
+
sourceLine,
|
|
5501
|
+
sourceColumn,
|
|
5502
|
+
namesIndex = decodeInteger(reader, namesIndex)
|
|
5503
|
+
] : [
|
|
5504
|
+
genColumn,
|
|
5505
|
+
sourcesIndex,
|
|
5506
|
+
sourceLine,
|
|
5507
|
+
sourceColumn
|
|
5508
|
+
]) : seg = [
|
|
5509
|
+
genColumn
|
|
5510
|
+
], line.push(seg), reader.pos++;
|
|
5511
|
+
}
|
|
5512
|
+
sorted || line.sort(sortComparator), decoded.push(line), reader.pos = semi + 1;
|
|
5513
|
+
}while (reader.pos <= length);
|
|
5514
|
+
return decoded;
|
|
5515
|
+
}(map1._encoded));
|
|
5516
|
+
if (line1 >= decoded.length) return OMapping(null, null, null, null);
|
|
5517
|
+
let segments1 = decoded[line1], index1 = (segments = segments1, memo = map._decodedMemo, line = line1, column = column1, bias = bias1 || 1, index = function(haystack, needle, state, key) {
|
|
5518
|
+
let { lastKey, lastNeedle, lastIndex } = state, low = 0, high = haystack.length - 1;
|
|
5519
|
+
if (key === lastKey) {
|
|
5520
|
+
if (needle === lastNeedle) return found = -1 !== lastIndex && haystack[lastIndex][0] === needle, lastIndex;
|
|
5521
|
+
needle >= lastNeedle ? low = -1 === lastIndex ? 0 : lastIndex : high = lastIndex;
|
|
5522
|
+
}
|
|
5523
|
+
return state.lastKey = key, state.lastNeedle = needle, state.lastIndex = function(haystack, needle, low, high) {
|
|
5524
|
+
for(; low <= high;){
|
|
5525
|
+
let mid = low + (high - low >> 1), cmp = haystack[mid][0] - needle;
|
|
5526
|
+
if (0 === cmp) return found = !0, mid;
|
|
5527
|
+
cmp < 0 ? low = mid + 1 : high = mid - 1;
|
|
5528
|
+
}
|
|
5529
|
+
return found = !1, low - 1;
|
|
5530
|
+
}(haystack, needle, low, high);
|
|
5531
|
+
}(segments, column, memo, line), (found ? index = (-1 === bias ? function(haystack, needle, index) {
|
|
5532
|
+
for(let i = index + 1; i < haystack.length && haystack[i][0] === needle; index = i++);
|
|
5533
|
+
return index;
|
|
5534
|
+
} : function(haystack, needle, index) {
|
|
5535
|
+
for(let i = index - 1; i >= 0 && haystack[i][0] === needle; index = i--);
|
|
5536
|
+
return index;
|
|
5537
|
+
})(segments, column, index) : -1 === bias && index++, -1 === index || index === segments.length) ? -1 : index);
|
|
5538
|
+
if (-1 === index1) return OMapping(null, null, null, null);
|
|
5539
|
+
let segment = segments1[index1];
|
|
5540
|
+
if (1 === segment.length) return OMapping(null, null, null, null);
|
|
5541
|
+
let { names, resolvedSources } = map;
|
|
5542
|
+
return OMapping(resolvedSources[segment[1]], segment[2] + 1, segment[3], 5 === segment.length ? names[segment[4]] : null);
|
|
5543
|
+
}(tracer, {
|
|
2739
5544
|
line: lineNumber,
|
|
2740
5545
|
column: column
|
|
2741
5546
|
});
|
|
@@ -2798,7 +5603,52 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
2798
5603
|
locationSuffix: '',
|
|
2799
5604
|
stackString: ''
|
|
2800
5605
|
};
|
|
2801
|
-
let parsedFrames =
|
|
5606
|
+
let parsedFrames = item.stack.split('\n').reduce(function(stack, line) {
|
|
5607
|
+
var line1, parts, line2, parts1, line3, parts2, parseResult = function(line) {
|
|
5608
|
+
var parts = chromeRe.exec(line);
|
|
5609
|
+
if (!parts) return null;
|
|
5610
|
+
var isNative = parts[2] && 0 === parts[2].indexOf('native'), isEval = parts[2] && 0 === parts[2].indexOf('eval'), submatch = chromeEvalRe.exec(parts[2]);
|
|
5611
|
+
return isEval && null != submatch && (parts[2] = submatch[1], parts[3] = submatch[2], parts[4] = submatch[3]), {
|
|
5612
|
+
file: isNative ? null : parts[2],
|
|
5613
|
+
methodName: parts[1] || UNKNOWN_FUNCTION,
|
|
5614
|
+
arguments: isNative ? [
|
|
5615
|
+
parts[2]
|
|
5616
|
+
] : [],
|
|
5617
|
+
lineNumber: parts[3] ? +parts[3] : null,
|
|
5618
|
+
column: parts[4] ? +parts[4] : null
|
|
5619
|
+
};
|
|
5620
|
+
}(line) || (line1 = line, (parts = winjsRe.exec(line1)) ? {
|
|
5621
|
+
file: parts[2],
|
|
5622
|
+
methodName: parts[1] || UNKNOWN_FUNCTION,
|
|
5623
|
+
arguments: [],
|
|
5624
|
+
lineNumber: +parts[3],
|
|
5625
|
+
column: parts[4] ? +parts[4] : null
|
|
5626
|
+
} : null) || function(line) {
|
|
5627
|
+
var parts = geckoRe.exec(line);
|
|
5628
|
+
if (!parts) return null;
|
|
5629
|
+
var isEval = parts[3] && parts[3].indexOf(' > eval') > -1, submatch = geckoEvalRe.exec(parts[3]);
|
|
5630
|
+
return isEval && null != submatch && (parts[3] = submatch[1], parts[4] = submatch[2], parts[5] = null), {
|
|
5631
|
+
file: parts[3],
|
|
5632
|
+
methodName: parts[1] || UNKNOWN_FUNCTION,
|
|
5633
|
+
arguments: parts[2] ? parts[2].split(',') : [],
|
|
5634
|
+
lineNumber: parts[4] ? +parts[4] : null,
|
|
5635
|
+
column: parts[5] ? +parts[5] : null
|
|
5636
|
+
};
|
|
5637
|
+
}(line) || (line2 = line, (parts1 = nodeRe.exec(line2)) ? {
|
|
5638
|
+
file: parts1[2],
|
|
5639
|
+
methodName: parts1[1] || UNKNOWN_FUNCTION,
|
|
5640
|
+
arguments: [],
|
|
5641
|
+
lineNumber: +parts1[3],
|
|
5642
|
+
column: parts1[4] ? +parts1[4] : null
|
|
5643
|
+
} : null) || (line3 = line, (parts2 = javaScriptCoreRe.exec(line3)) ? {
|
|
5644
|
+
file: parts2[3],
|
|
5645
|
+
methodName: parts2[1] || UNKNOWN_FUNCTION,
|
|
5646
|
+
arguments: [],
|
|
5647
|
+
lineNumber: +parts2[4],
|
|
5648
|
+
column: parts2[5] ? +parts2[5] : null
|
|
5649
|
+
} : null);
|
|
5650
|
+
return parseResult && stack.push(parseResult), stack;
|
|
5651
|
+
}, []), userFrame = parsedFrames.find((frame)=>frame.file && null !== frame.lineNumber && null !== frame.column && SOURCE_REGEX.test(frame.file));
|
|
2802
5652
|
if (userFrame) {
|
|
2803
5653
|
let parsedUserFrame = await parseFrame(userFrame), loc = parsedUserFrame ? formatOriginalLocation(parsedUserFrame.originalPosition) : null;
|
|
2804
5654
|
if (loc) return {
|
|
@@ -2955,15 +5805,15 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
2955
5805
|
cleanedTemplate += `%${next}`, i++;
|
|
2956
5806
|
}
|
|
2957
5807
|
return [
|
|
2958
|
-
|
|
5808
|
+
external_node_util_format(cleanedTemplate, ...rest)
|
|
2959
5809
|
];
|
|
2960
5810
|
})(formattedArgs), prefix = colors.dim(`[browser ${time}]`);
|
|
2961
5811
|
switch(level){
|
|
2962
5812
|
case 'error':
|
|
2963
|
-
console.log(colors.red(`${prefix} ${
|
|
5813
|
+
console.log(colors.red(`${prefix} ${external_node_util_format(...outputArgs)}`));
|
|
2964
5814
|
break;
|
|
2965
5815
|
case 'warn':
|
|
2966
|
-
console.log(colors.yellow(`${prefix} ${
|
|
5816
|
+
console.log(colors.yellow(`${prefix} ${external_node_util_format(...outputArgs)}`));
|
|
2967
5817
|
break;
|
|
2968
5818
|
case 'debug':
|
|
2969
5819
|
console.log(prefix, ...outputArgs);
|
|
@@ -3087,15 +5937,15 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
3087
5937
|
let entry = ((packageJson)=>{
|
|
3088
5938
|
if (packageJson.module) return packageJson.module;
|
|
3089
5939
|
if (packageJson.exports) {
|
|
3090
|
-
if (
|
|
5940
|
+
if (utils_isString(packageJson.exports)) return packageJson.exports;
|
|
3091
5941
|
let defaultExport = packageJson.exports['.'];
|
|
3092
5942
|
if (defaultExport) {
|
|
3093
|
-
if (
|
|
3094
|
-
if (
|
|
3095
|
-
if (
|
|
3096
|
-
if (
|
|
5943
|
+
if (utils_isString(defaultExport)) return defaultExport;
|
|
5944
|
+
if (utils_isString(defaultExport.import)) return defaultExport.import;
|
|
5945
|
+
if (utils_isString(defaultExport.browser)) return defaultExport.browser;
|
|
5946
|
+
if (utils_isString(defaultExport.default)) return defaultExport.default;
|
|
3097
5947
|
}
|
|
3098
|
-
if (
|
|
5948
|
+
if (utils_isString(packageJson.exports.default)) return packageJson.exports.default;
|
|
3099
5949
|
}
|
|
3100
5950
|
if (packageJson.main) return packageJson.main;
|
|
3101
5951
|
})(depPackageJson);
|
|
@@ -3500,7 +6350,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
3500
6350
|
LAYER_MARK_ALL
|
|
3501
6351
|
]), tasks = [], unocssCacheDir = '', tokensCachePath = '', layersCachePath = '', timeCachePath = '', configHashCachePath = '', generatedCachePath = '', bundlerCacheDir = '', cachedTokensSize = 0, cachedLayersSize = 0, isCompiling = !0, resolveUnocssConfig = async ()=>{
|
|
3502
6352
|
let configFromOption = {};
|
|
3503
|
-
isPlainObject(configOrPath) ? configFromOption = configOrPath :
|
|
6353
|
+
isPlainObject(configOrPath) ? configFromOption = configOrPath : utils_isString(configOrPath) && (configFilePath = node_path.isAbsolute(configOrPath) ? configOrPath : node_path.resolve(rootDir, configOrPath)), configFilePath = ((root, customConfig)=>{
|
|
3504
6354
|
if (customConfig) {
|
|
3505
6355
|
let absPath = node_path.isAbsolute(customConfig) ? customConfig : node_path.resolve(root, customConfig);
|
|
3506
6356
|
if (node_fs.existsSync(absPath)) return absPath;
|
|
@@ -3532,7 +6382,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
3532
6382
|
if (original.includes('@unocss-ignore')) return null;
|
|
3533
6383
|
let transformers = (uno.config.transformers || []).filter((i)=>(i.enforce || 'default') === enforce);
|
|
3534
6384
|
if (!transformers.length) return null;
|
|
3535
|
-
let skipMap = new Map(), code = original, s = new
|
|
6385
|
+
let skipMap = new Map(), code = original, s = new MagicString(((code, map, rules, keyFlag)=>{
|
|
3536
6386
|
let next = code;
|
|
3537
6387
|
for (let item of Array.from(next.matchAll(rules)))if (null != item) {
|
|
3538
6388
|
let matched = item[0], withHashKey = `${keyFlag}${hash(matched)}`;
|
|
@@ -3544,7 +6394,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
3544
6394
|
uno,
|
|
3545
6395
|
tokens,
|
|
3546
6396
|
invalidate: ()=>{}
|
|
3547
|
-
}), s.hasChanged() && (s = new
|
|
6397
|
+
}), s.hasChanged() && (s = new MagicString(code = restoreSkipCode(s.toString(), skipMap))));
|
|
3548
6398
|
return code !== original ? code : null;
|
|
3549
6399
|
}, {
|
|
3550
6400
|
name: 'unpack:unocss',
|
|
@@ -3746,7 +6596,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
3746
6596
|
let mode = watch ? 'development' : 'production';
|
|
3747
6597
|
setNodeEnv(mode);
|
|
3748
6598
|
let config = resolveConfig(mode);
|
|
3749
|
-
console.log(colors.brand(`${callerName} v4.7.
|
|
6599
|
+
console.log(colors.brand(`${callerName} v4.7.4`), colors.cyan(`building for ${mode}...`)), await unpackBuild(config);
|
|
3750
6600
|
},
|
|
3751
6601
|
dev: async ()=>{
|
|
3752
6602
|
setUnpackStartTime(performance.now());
|
|
@@ -3761,14 +6611,1041 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
3761
6611
|
}
|
|
3762
6612
|
};
|
|
3763
6613
|
}
|
|
3764
|
-
let
|
|
6614
|
+
let EntryTypes_FILE_TYPE = 'files', EntryTypes_DIR_TYPE = 'directories', EntryTypes_FILE_DIR_TYPE = 'files_directories', defaultOptions = {
|
|
6615
|
+
root: '.',
|
|
6616
|
+
fileFilter: (_entryInfo)=>!0,
|
|
6617
|
+
directoryFilter: (_entryInfo)=>!0,
|
|
6618
|
+
type: EntryTypes_FILE_TYPE,
|
|
6619
|
+
lstat: !1,
|
|
6620
|
+
depth: 2147483648,
|
|
6621
|
+
alwaysStat: !1,
|
|
6622
|
+
highWaterMark: 4096
|
|
6623
|
+
};
|
|
6624
|
+
Object.freeze(defaultOptions);
|
|
6625
|
+
let RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR', NORMAL_FLOW_ERRORS = new Set([
|
|
6626
|
+
'ENOENT',
|
|
6627
|
+
'EPERM',
|
|
6628
|
+
'EACCES',
|
|
6629
|
+
'ELOOP',
|
|
6630
|
+
RECURSIVE_ERROR_CODE
|
|
6631
|
+
]), ALL_TYPES = [
|
|
6632
|
+
EntryTypes_DIR_TYPE,
|
|
6633
|
+
'all',
|
|
6634
|
+
EntryTypes_FILE_DIR_TYPE,
|
|
6635
|
+
EntryTypes_FILE_TYPE
|
|
6636
|
+
], DIR_TYPES = new Set([
|
|
6637
|
+
EntryTypes_DIR_TYPE,
|
|
6638
|
+
'all',
|
|
6639
|
+
EntryTypes_FILE_DIR_TYPE
|
|
6640
|
+
]), FILE_TYPES = new Set([
|
|
6641
|
+
'all',
|
|
6642
|
+
EntryTypes_FILE_DIR_TYPE,
|
|
6643
|
+
EntryTypes_FILE_TYPE
|
|
6644
|
+
]), wantBigintFsStats = 'win32' === process.platform, emptyFn = (_entryInfo)=>!0, normalizeFilter = (filter)=>{
|
|
6645
|
+
if (void 0 === filter) return emptyFn;
|
|
6646
|
+
if ('function' == typeof filter) return filter;
|
|
6647
|
+
if ('string' == typeof filter) {
|
|
6648
|
+
let fl = filter.trim();
|
|
6649
|
+
return (entry)=>entry.basename === fl;
|
|
6650
|
+
}
|
|
6651
|
+
if (Array.isArray(filter)) {
|
|
6652
|
+
let trItems = filter.map((item)=>item.trim());
|
|
6653
|
+
return (entry)=>trItems.some((f)=>entry.basename === f);
|
|
6654
|
+
}
|
|
6655
|
+
return emptyFn;
|
|
6656
|
+
};
|
|
6657
|
+
class ReaddirpStream extends Readable {
|
|
6658
|
+
parents;
|
|
6659
|
+
reading;
|
|
6660
|
+
parent;
|
|
6661
|
+
_stat;
|
|
6662
|
+
_maxDepth;
|
|
6663
|
+
_wantsDir;
|
|
6664
|
+
_wantsFile;
|
|
6665
|
+
_wantsEverything;
|
|
6666
|
+
_root;
|
|
6667
|
+
_isDirent;
|
|
6668
|
+
_statsProp;
|
|
6669
|
+
_rdOptions;
|
|
6670
|
+
_fileFilter;
|
|
6671
|
+
_directoryFilter;
|
|
6672
|
+
constructor(options = {}){
|
|
6673
|
+
super({
|
|
6674
|
+
objectMode: !0,
|
|
6675
|
+
autoDestroy: !0,
|
|
6676
|
+
highWaterMark: options.highWaterMark
|
|
6677
|
+
});
|
|
6678
|
+
let opts = {
|
|
6679
|
+
...defaultOptions,
|
|
6680
|
+
...options
|
|
6681
|
+
}, { root, type } = opts;
|
|
6682
|
+
this._fileFilter = normalizeFilter(opts.fileFilter), this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
6683
|
+
let statMethod = opts.lstat ? lstat : promises_stat;
|
|
6684
|
+
wantBigintFsStats ? this._stat = (path)=>statMethod(path, {
|
|
6685
|
+
bigint: !0
|
|
6686
|
+
}) : this._stat = statMethod, this._maxDepth = null != opts.depth && Number.isSafeInteger(opts.depth) ? opts.depth : defaultOptions.depth, this._wantsDir = !!type && DIR_TYPES.has(type), this._wantsFile = !!type && FILE_TYPES.has(type), this._wantsEverything = 'all' === type, this._root = external_node_path_resolve(root), this._isDirent = !opts.alwaysStat, this._statsProp = this._isDirent ? 'dirent' : 'stats', this._rdOptions = {
|
|
6687
|
+
encoding: 'utf8',
|
|
6688
|
+
withFileTypes: this._isDirent
|
|
6689
|
+
}, this.parents = [
|
|
6690
|
+
this._exploreDir(root, 1)
|
|
6691
|
+
], this.reading = !1, this.parent = void 0;
|
|
6692
|
+
}
|
|
6693
|
+
async _read(batch) {
|
|
6694
|
+
if (!this.reading) {
|
|
6695
|
+
this.reading = !0;
|
|
6696
|
+
try {
|
|
6697
|
+
for(; !this.destroyed && batch > 0;){
|
|
6698
|
+
let par = this.parent, fil = par && par.files;
|
|
6699
|
+
if (fil && fil.length > 0) {
|
|
6700
|
+
let { path, depth } = par, slice = fil.splice(0, batch).map((dirent)=>this._formatEntry(dirent, path));
|
|
6701
|
+
for (let entry of (await Promise.all(slice))){
|
|
6702
|
+
if (!entry) continue;
|
|
6703
|
+
if (this.destroyed) return;
|
|
6704
|
+
let entryType = await this._getEntryType(entry);
|
|
6705
|
+
'directory' === entryType && this._directoryFilter(entry) ? (depth <= this._maxDepth && this.parents.push(this._exploreDir(entry.fullPath, depth + 1)), this._wantsDir && (this.push(entry), batch--)) : ('file' === entryType || this._includeAsFile(entry)) && this._fileFilter(entry) && this._wantsFile && (this.push(entry), batch--);
|
|
6706
|
+
}
|
|
6707
|
+
} else {
|
|
6708
|
+
let parent = this.parents.pop();
|
|
6709
|
+
if (!parent) {
|
|
6710
|
+
this.push(null);
|
|
6711
|
+
break;
|
|
6712
|
+
}
|
|
6713
|
+
if (this.parent = await parent, this.destroyed) return;
|
|
6714
|
+
}
|
|
6715
|
+
}
|
|
6716
|
+
} catch (error) {
|
|
6717
|
+
this.destroy(error);
|
|
6718
|
+
} finally{
|
|
6719
|
+
this.reading = !1;
|
|
6720
|
+
}
|
|
6721
|
+
}
|
|
6722
|
+
}
|
|
6723
|
+
async _exploreDir(path, depth) {
|
|
6724
|
+
let files;
|
|
6725
|
+
try {
|
|
6726
|
+
files = await readdir(path, this._rdOptions);
|
|
6727
|
+
} catch (error) {
|
|
6728
|
+
this._onError(error);
|
|
6729
|
+
}
|
|
6730
|
+
return {
|
|
6731
|
+
files,
|
|
6732
|
+
depth,
|
|
6733
|
+
path
|
|
6734
|
+
};
|
|
6735
|
+
}
|
|
6736
|
+
async _formatEntry(dirent, path) {
|
|
6737
|
+
let entry, basename = this._isDirent ? dirent.name : dirent;
|
|
6738
|
+
try {
|
|
6739
|
+
let fullPath = external_node_path_resolve(join(path, basename));
|
|
6740
|
+
(entry = {
|
|
6741
|
+
path: external_node_path_relative(this._root, fullPath),
|
|
6742
|
+
fullPath,
|
|
6743
|
+
basename
|
|
6744
|
+
})[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
6745
|
+
} catch (err) {
|
|
6746
|
+
this._onError(err);
|
|
6747
|
+
return;
|
|
6748
|
+
}
|
|
6749
|
+
return entry;
|
|
6750
|
+
}
|
|
6751
|
+
_onError(err) {
|
|
6752
|
+
NORMAL_FLOW_ERRORS.has(err.code) && !this.destroyed ? this.emit('warn', err) : this.destroy(err);
|
|
6753
|
+
}
|
|
6754
|
+
async _getEntryType(entry) {
|
|
6755
|
+
if (!entry && this._statsProp in entry) return '';
|
|
6756
|
+
let stats = entry[this._statsProp];
|
|
6757
|
+
if (stats.isFile()) return 'file';
|
|
6758
|
+
if (stats.isDirectory()) return 'directory';
|
|
6759
|
+
if (stats && stats.isSymbolicLink()) {
|
|
6760
|
+
let full = entry.fullPath;
|
|
6761
|
+
try {
|
|
6762
|
+
let entryRealPath = await promises_realpath(full), entryRealPathStats = await lstat(entryRealPath);
|
|
6763
|
+
if (entryRealPathStats.isFile()) return 'file';
|
|
6764
|
+
if (entryRealPathStats.isDirectory()) {
|
|
6765
|
+
let len = entryRealPath.length;
|
|
6766
|
+
if (full.startsWith(entryRealPath) && full.substr(len, 1) === sep) {
|
|
6767
|
+
let recursiveError = Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
|
|
6768
|
+
return recursiveError.code = RECURSIVE_ERROR_CODE, this._onError(recursiveError);
|
|
6769
|
+
}
|
|
6770
|
+
return 'directory';
|
|
6771
|
+
}
|
|
6772
|
+
} catch (error) {
|
|
6773
|
+
return this._onError(error), '';
|
|
6774
|
+
}
|
|
6775
|
+
}
|
|
6776
|
+
}
|
|
6777
|
+
_includeAsFile(entry) {
|
|
6778
|
+
let stats = entry && entry[this._statsProp];
|
|
6779
|
+
return stats && this._wantsEverything && !stats.isDirectory();
|
|
6780
|
+
}
|
|
6781
|
+
}
|
|
6782
|
+
let EMPTY_FN = ()=>{}, pl = process.platform, isWindows = 'win32' === pl, isMacos = 'darwin' === pl, isLinux = 'linux' === pl, isFreeBSD = 'freebsd' === pl, isIBMi = 'OS400' === external_node_os_type(), EVENTS_ALL = 'all', EVENTS_READY = 'ready', EVENTS_ADD = 'add', EVENTS_CHANGE = 'change', EVENTS_ADD_DIR = 'addDir', EVENTS_UNLINK = 'unlink', EVENTS_UNLINK_DIR = 'unlinkDir', EVENTS_RAW = 'raw', EVENTS_ERROR = 'error', statMethods = {
|
|
6783
|
+
lstat: lstat,
|
|
6784
|
+
stat: promises_stat
|
|
6785
|
+
}, KEY_LISTENERS = 'listeners', KEY_ERR = 'errHandlers', KEY_RAW = 'rawEmitters', HANDLER_KEYS = [
|
|
6786
|
+
KEY_LISTENERS,
|
|
6787
|
+
KEY_ERR,
|
|
6788
|
+
KEY_RAW
|
|
6789
|
+
], binaryExtensions = new Set([
|
|
6790
|
+
'3dm',
|
|
6791
|
+
'3ds',
|
|
6792
|
+
'3g2',
|
|
6793
|
+
'3gp',
|
|
6794
|
+
'7z',
|
|
6795
|
+
'a',
|
|
6796
|
+
'aac',
|
|
6797
|
+
'adp',
|
|
6798
|
+
'afdesign',
|
|
6799
|
+
'afphoto',
|
|
6800
|
+
'afpub',
|
|
6801
|
+
'ai',
|
|
6802
|
+
'aif',
|
|
6803
|
+
'aiff',
|
|
6804
|
+
'alz',
|
|
6805
|
+
'ape',
|
|
6806
|
+
'apk',
|
|
6807
|
+
'appimage',
|
|
6808
|
+
'ar',
|
|
6809
|
+
'arj',
|
|
6810
|
+
'asf',
|
|
6811
|
+
'au',
|
|
6812
|
+
'avi',
|
|
6813
|
+
'bak',
|
|
6814
|
+
'baml',
|
|
6815
|
+
'bh',
|
|
6816
|
+
'bin',
|
|
6817
|
+
'bk',
|
|
6818
|
+
'bmp',
|
|
6819
|
+
'btif',
|
|
6820
|
+
'bz2',
|
|
6821
|
+
'bzip2',
|
|
6822
|
+
'cab',
|
|
6823
|
+
'caf',
|
|
6824
|
+
'cgm',
|
|
6825
|
+
'class',
|
|
6826
|
+
'cmx',
|
|
6827
|
+
'cpio',
|
|
6828
|
+
'cr2',
|
|
6829
|
+
'cur',
|
|
6830
|
+
'dat',
|
|
6831
|
+
'dcm',
|
|
6832
|
+
'deb',
|
|
6833
|
+
'dex',
|
|
6834
|
+
'djvu',
|
|
6835
|
+
'dll',
|
|
6836
|
+
'dmg',
|
|
6837
|
+
'dng',
|
|
6838
|
+
'doc',
|
|
6839
|
+
'docm',
|
|
6840
|
+
'docx',
|
|
6841
|
+
'dot',
|
|
6842
|
+
'dotm',
|
|
6843
|
+
'dra',
|
|
6844
|
+
'DS_Store',
|
|
6845
|
+
'dsk',
|
|
6846
|
+
'dts',
|
|
6847
|
+
'dtshd',
|
|
6848
|
+
'dvb',
|
|
6849
|
+
'dwg',
|
|
6850
|
+
'dxf',
|
|
6851
|
+
'ecelp4800',
|
|
6852
|
+
'ecelp7470',
|
|
6853
|
+
'ecelp9600',
|
|
6854
|
+
'egg',
|
|
6855
|
+
'eol',
|
|
6856
|
+
'eot',
|
|
6857
|
+
'epub',
|
|
6858
|
+
'exe',
|
|
6859
|
+
'f4v',
|
|
6860
|
+
'fbs',
|
|
6861
|
+
'fh',
|
|
6862
|
+
'fla',
|
|
6863
|
+
'flac',
|
|
6864
|
+
'flatpak',
|
|
6865
|
+
'fli',
|
|
6866
|
+
'flv',
|
|
6867
|
+
'fpx',
|
|
6868
|
+
'fst',
|
|
6869
|
+
'fvt',
|
|
6870
|
+
'g3',
|
|
6871
|
+
'gh',
|
|
6872
|
+
'gif',
|
|
6873
|
+
'graffle',
|
|
6874
|
+
'gz',
|
|
6875
|
+
'gzip',
|
|
6876
|
+
'h261',
|
|
6877
|
+
'h263',
|
|
6878
|
+
'h264',
|
|
6879
|
+
'icns',
|
|
6880
|
+
'ico',
|
|
6881
|
+
'ief',
|
|
6882
|
+
'img',
|
|
6883
|
+
'ipa',
|
|
6884
|
+
'iso',
|
|
6885
|
+
'jar',
|
|
6886
|
+
'jpeg',
|
|
6887
|
+
'jpg',
|
|
6888
|
+
'jpgv',
|
|
6889
|
+
'jpm',
|
|
6890
|
+
'jxr',
|
|
6891
|
+
'key',
|
|
6892
|
+
'ktx',
|
|
6893
|
+
'lha',
|
|
6894
|
+
'lib',
|
|
6895
|
+
'lvp',
|
|
6896
|
+
'lz',
|
|
6897
|
+
'lzh',
|
|
6898
|
+
'lzma',
|
|
6899
|
+
'lzo',
|
|
6900
|
+
'm3u',
|
|
6901
|
+
'm4a',
|
|
6902
|
+
'm4v',
|
|
6903
|
+
'mar',
|
|
6904
|
+
'mdi',
|
|
6905
|
+
'mht',
|
|
6906
|
+
'mid',
|
|
6907
|
+
'midi',
|
|
6908
|
+
'mj2',
|
|
6909
|
+
'mka',
|
|
6910
|
+
'mkv',
|
|
6911
|
+
'mmr',
|
|
6912
|
+
'mng',
|
|
6913
|
+
'mobi',
|
|
6914
|
+
'mov',
|
|
6915
|
+
'movie',
|
|
6916
|
+
'mp3',
|
|
6917
|
+
'mp4',
|
|
6918
|
+
'mp4a',
|
|
6919
|
+
'mpeg',
|
|
6920
|
+
'mpg',
|
|
6921
|
+
'mpga',
|
|
6922
|
+
'mxu',
|
|
6923
|
+
'nef',
|
|
6924
|
+
'npx',
|
|
6925
|
+
'numbers',
|
|
6926
|
+
'nupkg',
|
|
6927
|
+
'o',
|
|
6928
|
+
'odp',
|
|
6929
|
+
'ods',
|
|
6930
|
+
'odt',
|
|
6931
|
+
'oga',
|
|
6932
|
+
'ogg',
|
|
6933
|
+
'ogv',
|
|
6934
|
+
'otf',
|
|
6935
|
+
'ott',
|
|
6936
|
+
'pages',
|
|
6937
|
+
'pbm',
|
|
6938
|
+
'pcx',
|
|
6939
|
+
'pdb',
|
|
6940
|
+
'pdf',
|
|
6941
|
+
'pea',
|
|
6942
|
+
'pgm',
|
|
6943
|
+
'pic',
|
|
6944
|
+
'png',
|
|
6945
|
+
'pnm',
|
|
6946
|
+
'pot',
|
|
6947
|
+
'potm',
|
|
6948
|
+
'potx',
|
|
6949
|
+
'ppa',
|
|
6950
|
+
'ppam',
|
|
6951
|
+
'ppm',
|
|
6952
|
+
'pps',
|
|
6953
|
+
'ppsm',
|
|
6954
|
+
'ppsx',
|
|
6955
|
+
'ppt',
|
|
6956
|
+
'pptm',
|
|
6957
|
+
'pptx',
|
|
6958
|
+
'psd',
|
|
6959
|
+
'pya',
|
|
6960
|
+
'pyc',
|
|
6961
|
+
'pyo',
|
|
6962
|
+
'pyv',
|
|
6963
|
+
'qt',
|
|
6964
|
+
'rar',
|
|
6965
|
+
'ras',
|
|
6966
|
+
'raw',
|
|
6967
|
+
'resources',
|
|
6968
|
+
'rgb',
|
|
6969
|
+
'rip',
|
|
6970
|
+
'rlc',
|
|
6971
|
+
'rmf',
|
|
6972
|
+
'rmvb',
|
|
6973
|
+
'rpm',
|
|
6974
|
+
'rtf',
|
|
6975
|
+
'rz',
|
|
6976
|
+
's3m',
|
|
6977
|
+
's7z',
|
|
6978
|
+
'scpt',
|
|
6979
|
+
'sgi',
|
|
6980
|
+
'shar',
|
|
6981
|
+
'snap',
|
|
6982
|
+
'sil',
|
|
6983
|
+
'sketch',
|
|
6984
|
+
'slk',
|
|
6985
|
+
'smv',
|
|
6986
|
+
'snk',
|
|
6987
|
+
'so',
|
|
6988
|
+
'stl',
|
|
6989
|
+
'suo',
|
|
6990
|
+
'sub',
|
|
6991
|
+
'swf',
|
|
6992
|
+
'tar',
|
|
6993
|
+
'tbz',
|
|
6994
|
+
'tbz2',
|
|
6995
|
+
'tga',
|
|
6996
|
+
'tgz',
|
|
6997
|
+
'thmx',
|
|
6998
|
+
'tif',
|
|
6999
|
+
'tiff',
|
|
7000
|
+
'tlz',
|
|
7001
|
+
'ttc',
|
|
7002
|
+
'ttf',
|
|
7003
|
+
'txz',
|
|
7004
|
+
'udf',
|
|
7005
|
+
'uvh',
|
|
7006
|
+
'uvi',
|
|
7007
|
+
'uvm',
|
|
7008
|
+
'uvp',
|
|
7009
|
+
'uvs',
|
|
7010
|
+
'uvu',
|
|
7011
|
+
'viv',
|
|
7012
|
+
'vob',
|
|
7013
|
+
'war',
|
|
7014
|
+
'wav',
|
|
7015
|
+
'wax',
|
|
7016
|
+
'wbmp',
|
|
7017
|
+
'wdp',
|
|
7018
|
+
'weba',
|
|
7019
|
+
'webm',
|
|
7020
|
+
'webp',
|
|
7021
|
+
'whl',
|
|
7022
|
+
'wim',
|
|
7023
|
+
'wm',
|
|
7024
|
+
'wma',
|
|
7025
|
+
'wmv',
|
|
7026
|
+
'wmx',
|
|
7027
|
+
'woff',
|
|
7028
|
+
'woff2',
|
|
7029
|
+
'wrm',
|
|
7030
|
+
'wvx',
|
|
7031
|
+
'xbm',
|
|
7032
|
+
'xif',
|
|
7033
|
+
'xla',
|
|
7034
|
+
'xlam',
|
|
7035
|
+
'xls',
|
|
7036
|
+
'xlsb',
|
|
7037
|
+
'xlsm',
|
|
7038
|
+
'xlsx',
|
|
7039
|
+
'xlt',
|
|
7040
|
+
'xltm',
|
|
7041
|
+
'xltx',
|
|
7042
|
+
'xm',
|
|
7043
|
+
'xmind',
|
|
7044
|
+
'xpi',
|
|
7045
|
+
'xpm',
|
|
7046
|
+
'xwd',
|
|
7047
|
+
'xz',
|
|
7048
|
+
'z',
|
|
7049
|
+
'zip',
|
|
7050
|
+
'zipx'
|
|
7051
|
+
]), foreach = (val, fn)=>{
|
|
7052
|
+
val instanceof Set ? val.forEach(fn) : fn(val);
|
|
7053
|
+
}, addAndConvert = (main, prop, item)=>{
|
|
7054
|
+
let container = main[prop];
|
|
7055
|
+
container instanceof Set || (main[prop] = container = new Set([
|
|
7056
|
+
container
|
|
7057
|
+
])), container.add(item);
|
|
7058
|
+
}, delFromSet = (main, prop, item)=>{
|
|
7059
|
+
let container = main[prop];
|
|
7060
|
+
container instanceof Set ? container.delete(item) : container === item && delete main[prop];
|
|
7061
|
+
}, isEmptySet = (val)=>val instanceof Set ? 0 === val.size : !val, FsWatchInstances = new Map();
|
|
7062
|
+
function createFsWatchInstance(path, options, listener, errHandler, emitRaw) {
|
|
7063
|
+
try {
|
|
7064
|
+
return external_node_fs_watch(path, {
|
|
7065
|
+
persistent: options.persistent
|
|
7066
|
+
}, (rawEvent, evPath)=>{
|
|
7067
|
+
listener(path), emitRaw(rawEvent, evPath, {
|
|
7068
|
+
watchedPath: path
|
|
7069
|
+
}), evPath && path !== evPath && fsWatchBroadcast(external_node_path_resolve(path, evPath), KEY_LISTENERS, join(path, evPath));
|
|
7070
|
+
});
|
|
7071
|
+
} catch (error) {
|
|
7072
|
+
errHandler(error);
|
|
7073
|
+
return;
|
|
7074
|
+
}
|
|
7075
|
+
}
|
|
7076
|
+
let fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3)=>{
|
|
7077
|
+
let cont = FsWatchInstances.get(fullPath);
|
|
7078
|
+
cont && foreach(cont[listenerType], (listener)=>{
|
|
7079
|
+
listener(val1, val2, val3);
|
|
7080
|
+
});
|
|
7081
|
+
}, FsWatchFileInstances = new Map();
|
|
7082
|
+
class NodeFsHandler {
|
|
7083
|
+
fsw;
|
|
7084
|
+
_boundHandleError;
|
|
7085
|
+
constructor(fsW){
|
|
7086
|
+
this.fsw = fsW, this._boundHandleError = (error)=>fsW._handleError(error);
|
|
7087
|
+
}
|
|
7088
|
+
_watchWithNodeFs(path, listener) {
|
|
7089
|
+
let closer, opts = this.fsw.options, directory = external_node_path_dirname(path), basename = external_node_path_basename(path);
|
|
7090
|
+
this.fsw._getWatchedDir(directory).add(basename);
|
|
7091
|
+
let absolutePath = external_node_path_resolve(path), options = {
|
|
7092
|
+
persistent: opts.persistent
|
|
7093
|
+
};
|
|
7094
|
+
if (listener || (listener = EMPTY_FN), opts.usePolling) options.interval = opts.interval !== opts.binaryInterval && binaryExtensions.has(extname(basename).slice(1).toLowerCase()) ? opts.binaryInterval : opts.interval, closer = ((path, fullPath, options, handlers)=>{
|
|
7095
|
+
let { listener, rawEmitter } = handlers, cont = FsWatchFileInstances.get(fullPath), copts = cont && cont.options;
|
|
7096
|
+
return copts && (copts.persistent < options.persistent || copts.interval > options.interval) && (unwatchFile(fullPath), cont = void 0), cont ? (addAndConvert(cont, KEY_LISTENERS, listener), addAndConvert(cont, KEY_RAW, rawEmitter)) : (cont = {
|
|
7097
|
+
listeners: listener,
|
|
7098
|
+
rawEmitters: rawEmitter,
|
|
7099
|
+
options,
|
|
7100
|
+
watcher: watchFile(fullPath, options, (curr, prev)=>{
|
|
7101
|
+
foreach(cont.rawEmitters, (rawEmitter)=>{
|
|
7102
|
+
rawEmitter(EVENTS_CHANGE, fullPath, {
|
|
7103
|
+
curr,
|
|
7104
|
+
prev
|
|
7105
|
+
});
|
|
7106
|
+
});
|
|
7107
|
+
let currmtime = curr.mtimeMs;
|
|
7108
|
+
(curr.size !== prev.size || currmtime > prev.mtimeMs || 0 === currmtime) && foreach(cont.listeners, (listener)=>listener(path, curr));
|
|
7109
|
+
})
|
|
7110
|
+
}, FsWatchFileInstances.set(fullPath, cont)), ()=>{
|
|
7111
|
+
delFromSet(cont, KEY_LISTENERS, listener), delFromSet(cont, KEY_RAW, rawEmitter), isEmptySet(cont.listeners) && (FsWatchFileInstances.delete(fullPath), unwatchFile(fullPath), cont.options = cont.watcher = void 0, Object.freeze(cont));
|
|
7112
|
+
};
|
|
7113
|
+
})(path, absolutePath, options, {
|
|
7114
|
+
listener,
|
|
7115
|
+
rawEmitter: this.fsw._emitRaw
|
|
7116
|
+
});
|
|
7117
|
+
else closer = ((path, fullPath, options, handlers)=>{
|
|
7118
|
+
let watcher, { listener, errHandler, rawEmitter } = handlers, cont = FsWatchInstances.get(fullPath);
|
|
7119
|
+
if (!options.persistent) {
|
|
7120
|
+
if (!(watcher = createFsWatchInstance(path, options, listener, errHandler, rawEmitter))) return;
|
|
7121
|
+
return watcher.close.bind(watcher);
|
|
7122
|
+
}
|
|
7123
|
+
if (cont) addAndConvert(cont, KEY_LISTENERS, listener), addAndConvert(cont, KEY_ERR, errHandler), addAndConvert(cont, KEY_RAW, rawEmitter);
|
|
7124
|
+
else {
|
|
7125
|
+
if (!(watcher = createFsWatchInstance(path, options, fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), errHandler, fsWatchBroadcast.bind(null, fullPath, KEY_RAW)))) return;
|
|
7126
|
+
watcher.on(EVENTS_ERROR, async (error)=>{
|
|
7127
|
+
let broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
|
|
7128
|
+
if (cont && (cont.watcherUnusable = !0), isWindows && 'EPERM' === error.code) try {
|
|
7129
|
+
let fd = await promises_open(path, 'r');
|
|
7130
|
+
await fd.close(), broadcastErr(error);
|
|
7131
|
+
} catch (err) {}
|
|
7132
|
+
else broadcastErr(error);
|
|
7133
|
+
}), cont = {
|
|
7134
|
+
listeners: listener,
|
|
7135
|
+
errHandlers: errHandler,
|
|
7136
|
+
rawEmitters: rawEmitter,
|
|
7137
|
+
watcher
|
|
7138
|
+
}, FsWatchInstances.set(fullPath, cont);
|
|
7139
|
+
}
|
|
7140
|
+
return ()=>{
|
|
7141
|
+
if (delFromSet(cont, KEY_LISTENERS, listener), delFromSet(cont, KEY_ERR, errHandler), delFromSet(cont, KEY_RAW, rawEmitter), isEmptySet(cont.listeners)) {
|
|
7142
|
+
let cont1;
|
|
7143
|
+
cont.watcher.close(), FsWatchInstances.delete(fullPath), HANDLER_KEYS.forEach((cont1 = cont, (key)=>{
|
|
7144
|
+
let set = cont1[key];
|
|
7145
|
+
set instanceof Set ? set.clear() : delete cont1[key];
|
|
7146
|
+
})), cont.watcher = void 0, Object.freeze(cont);
|
|
7147
|
+
}
|
|
7148
|
+
};
|
|
7149
|
+
})(path, absolutePath, options, {
|
|
7150
|
+
listener,
|
|
7151
|
+
errHandler: this._boundHandleError,
|
|
7152
|
+
rawEmitter: this.fsw._emitRaw
|
|
7153
|
+
});
|
|
7154
|
+
return closer;
|
|
7155
|
+
}
|
|
7156
|
+
_handleFile(file, stats, initialAdd) {
|
|
7157
|
+
if (this.fsw.closed) return;
|
|
7158
|
+
let dirname = external_node_path_dirname(file), basename = external_node_path_basename(file), parent = this.fsw._getWatchedDir(dirname), prevStats = stats;
|
|
7159
|
+
if (parent.has(basename)) return;
|
|
7160
|
+
let listener = async (path, newStats)=>{
|
|
7161
|
+
if (this.fsw._throttle('watch', file, 5)) if (newStats && 0 !== newStats.mtimeMs) {
|
|
7162
|
+
if (parent.has(basename)) {
|
|
7163
|
+
let at = newStats.atimeMs, mt = newStats.mtimeMs;
|
|
7164
|
+
(!at || at <= mt || mt !== prevStats.mtimeMs) && this.fsw._emit(EVENTS_CHANGE, file, newStats), prevStats = newStats;
|
|
7165
|
+
}
|
|
7166
|
+
} else try {
|
|
7167
|
+
let newStats = await promises_stat(file);
|
|
7168
|
+
if (this.fsw.closed) return;
|
|
7169
|
+
let at = newStats.atimeMs, mt = newStats.mtimeMs;
|
|
7170
|
+
if ((!at || at <= mt || mt !== prevStats.mtimeMs) && this.fsw._emit(EVENTS_CHANGE, file, newStats), (isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats.ino) {
|
|
7171
|
+
this.fsw._closeFile(path), prevStats = newStats;
|
|
7172
|
+
let closer = this._watchWithNodeFs(file, listener);
|
|
7173
|
+
closer && this.fsw._addPathCloser(path, closer);
|
|
7174
|
+
} else prevStats = newStats;
|
|
7175
|
+
} catch (error) {
|
|
7176
|
+
this.fsw._remove(dirname, basename);
|
|
7177
|
+
}
|
|
7178
|
+
}, closer = this._watchWithNodeFs(file, listener);
|
|
7179
|
+
if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) {
|
|
7180
|
+
if (!this.fsw._throttle(EVENTS_ADD, file, 0)) return;
|
|
7181
|
+
this.fsw._emit(EVENTS_ADD, file, stats);
|
|
7182
|
+
}
|
|
7183
|
+
return closer;
|
|
7184
|
+
}
|
|
7185
|
+
async _handleSymlink(entry, directory, path, item) {
|
|
7186
|
+
if (this.fsw.closed) return;
|
|
7187
|
+
let full = entry.fullPath, dir = this.fsw._getWatchedDir(directory);
|
|
7188
|
+
if (!this.fsw.options.followSymlinks) {
|
|
7189
|
+
let linkPath;
|
|
7190
|
+
this.fsw._incrReadyCount();
|
|
7191
|
+
try {
|
|
7192
|
+
linkPath = await promises_realpath(path);
|
|
7193
|
+
} catch (e) {
|
|
7194
|
+
return this.fsw._emitReady(), !0;
|
|
7195
|
+
}
|
|
7196
|
+
if (this.fsw.closed) return;
|
|
7197
|
+
return dir.has(item) ? this.fsw._symlinkPaths.get(full) !== linkPath && (this.fsw._symlinkPaths.set(full, linkPath), this.fsw._emit(EVENTS_CHANGE, path, entry.stats)) : (dir.add(item), this.fsw._symlinkPaths.set(full, linkPath), this.fsw._emit(EVENTS_ADD, path, entry.stats)), this.fsw._emitReady(), !0;
|
|
7198
|
+
}
|
|
7199
|
+
if (this.fsw._symlinkPaths.has(full)) return !0;
|
|
7200
|
+
this.fsw._symlinkPaths.set(full, !0);
|
|
7201
|
+
}
|
|
7202
|
+
_handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
|
|
7203
|
+
directory = join(directory, '');
|
|
7204
|
+
let throttleKey = target ? `${directory}:${target}` : directory;
|
|
7205
|
+
if (!(throttler = this.fsw._throttle('readdir', throttleKey, 1000))) return;
|
|
7206
|
+
let previous = this.fsw._getWatchedDir(wh.path), current = new Set(), stream = this.fsw._readdirp(directory, {
|
|
7207
|
+
fileFilter: (entry)=>wh.filterPath(entry),
|
|
7208
|
+
directoryFilter: (entry)=>wh.filterDir(entry)
|
|
7209
|
+
});
|
|
7210
|
+
if (stream) return stream.on('data', async (entry)=>{
|
|
7211
|
+
if (this.fsw.closed) {
|
|
7212
|
+
stream = void 0;
|
|
7213
|
+
return;
|
|
7214
|
+
}
|
|
7215
|
+
let item = entry.path, path = join(directory, item);
|
|
7216
|
+
if (current.add(item), !(entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path, item))) {
|
|
7217
|
+
if (this.fsw.closed) {
|
|
7218
|
+
stream = void 0;
|
|
7219
|
+
return;
|
|
7220
|
+
}
|
|
7221
|
+
item !== target && (target || previous.has(item)) || (this.fsw._incrReadyCount(), path = join(dir, external_node_path_relative(dir, path)), this._addToNodeFs(path, initialAdd, wh, depth + 1));
|
|
7222
|
+
}
|
|
7223
|
+
}).on(EVENTS_ERROR, this._boundHandleError), new Promise((resolve, reject)=>{
|
|
7224
|
+
if (!stream) return reject();
|
|
7225
|
+
stream.once('end', ()=>{
|
|
7226
|
+
if (this.fsw.closed) {
|
|
7227
|
+
stream = void 0;
|
|
7228
|
+
return;
|
|
7229
|
+
}
|
|
7230
|
+
let wasThrottled = !!throttler && throttler.clear();
|
|
7231
|
+
resolve(void 0), previous.getChildren().filter((item)=>item !== directory && !current.has(item)).forEach((item)=>{
|
|
7232
|
+
this.fsw._remove(directory, item);
|
|
7233
|
+
}), stream = void 0, wasThrottled && this._handleRead(directory, !1, wh, target, dir, depth, throttler);
|
|
7234
|
+
});
|
|
7235
|
+
});
|
|
7236
|
+
}
|
|
7237
|
+
async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) {
|
|
7238
|
+
let throttler, closer, parentDir = this.fsw._getWatchedDir(external_node_path_dirname(dir)), tracked = parentDir.has(external_node_path_basename(dir));
|
|
7239
|
+
initialAdd && this.fsw.options.ignoreInitial || target || tracked || this.fsw._emit(EVENTS_ADD_DIR, dir, stats), parentDir.add(external_node_path_basename(dir)), this.fsw._getWatchedDir(dir);
|
|
7240
|
+
let oDepth = this.fsw.options.depth;
|
|
7241
|
+
if ((null == oDepth || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath)) {
|
|
7242
|
+
if (!target && (await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler), this.fsw.closed)) return;
|
|
7243
|
+
closer = this._watchWithNodeFs(dir, (dirPath, stats)=>{
|
|
7244
|
+
stats && 0 === stats.mtimeMs || this._handleRead(dirPath, !1, wh, target, dir, depth, throttler);
|
|
7245
|
+
});
|
|
7246
|
+
}
|
|
7247
|
+
return closer;
|
|
7248
|
+
}
|
|
7249
|
+
async _addToNodeFs(path, initialAdd, priorWh, depth, target) {
|
|
7250
|
+
let ready = this.fsw._emitReady;
|
|
7251
|
+
if (this.fsw._isIgnored(path) || this.fsw.closed) return ready(), !1;
|
|
7252
|
+
let wh = this.fsw._getWatchHelpers(path);
|
|
7253
|
+
priorWh && (wh.filterPath = (entry)=>priorWh.filterPath(entry), wh.filterDir = (entry)=>priorWh.filterDir(entry));
|
|
7254
|
+
try {
|
|
7255
|
+
let closer, stats = await statMethods[wh.statMethod](wh.watchPath);
|
|
7256
|
+
if (this.fsw.closed) return;
|
|
7257
|
+
if (this.fsw._isIgnored(wh.watchPath, stats)) return ready(), !1;
|
|
7258
|
+
let follow = this.fsw.options.followSymlinks;
|
|
7259
|
+
if (stats.isDirectory()) {
|
|
7260
|
+
let absPath = external_node_path_resolve(path), targetPath = follow ? await promises_realpath(path) : path;
|
|
7261
|
+
if (this.fsw.closed || (closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath), this.fsw.closed)) return;
|
|
7262
|
+
absPath !== targetPath && void 0 !== targetPath && this.fsw._symlinkPaths.set(absPath, targetPath);
|
|
7263
|
+
} else if (stats.isSymbolicLink()) {
|
|
7264
|
+
let targetPath = follow ? await promises_realpath(path) : path;
|
|
7265
|
+
if (this.fsw.closed) return;
|
|
7266
|
+
let parent = external_node_path_dirname(wh.watchPath);
|
|
7267
|
+
if (this.fsw._getWatchedDir(parent).add(wh.watchPath), this.fsw._emit(EVENTS_ADD, wh.watchPath, stats), closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath), this.fsw.closed) return;
|
|
7268
|
+
void 0 !== targetPath && this.fsw._symlinkPaths.set(external_node_path_resolve(path), targetPath);
|
|
7269
|
+
} else closer = this._handleFile(wh.watchPath, stats, initialAdd);
|
|
7270
|
+
return ready(), closer && this.fsw._addPathCloser(path, closer), !1;
|
|
7271
|
+
} catch (error) {
|
|
7272
|
+
if (this.fsw._handleError(error)) return ready(), path;
|
|
7273
|
+
}
|
|
7274
|
+
}
|
|
7275
|
+
}
|
|
7276
|
+
let BACK_SLASH_RE = /\\/g, DOUBLE_SLASH_RE = /\/\//g, DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/, REPLACER_RE = /^\.[/\\]/;
|
|
7277
|
+
function arrify(item) {
|
|
7278
|
+
return Array.isArray(item) ? item : [
|
|
7279
|
+
item
|
|
7280
|
+
];
|
|
7281
|
+
}
|
|
7282
|
+
let isMatcherObject = (matcher)=>'object' == typeof matcher && null !== matcher && !(matcher instanceof RegExp);
|
|
7283
|
+
function chokidar_matchPatterns(patterns, testString, stats) {
|
|
7284
|
+
let path = function(path) {
|
|
7285
|
+
if ('string' != typeof path) throw Error('string expected');
|
|
7286
|
+
path = (path = normalize(path)).replace(/\\/g, '/');
|
|
7287
|
+
let prepend = !1;
|
|
7288
|
+
return path.startsWith('//') && (prepend = !0), path = path.replace(DOUBLE_SLASH_RE, '/'), prepend && (path = '/' + path), path;
|
|
7289
|
+
}(testString);
|
|
7290
|
+
for(let index = 0; index < patterns.length; index++)if ((0, patterns[index])(path, stats)) return !0;
|
|
7291
|
+
return !1;
|
|
7292
|
+
}
|
|
7293
|
+
let unifyPaths = (paths_)=>{
|
|
7294
|
+
let paths = arrify(paths_).flat();
|
|
7295
|
+
if (!paths.every((p)=>'string' == typeof p)) throw TypeError(`Non-string provided as watch path: ${paths}`);
|
|
7296
|
+
return paths.map(normalizePathToUnix);
|
|
7297
|
+
}, toUnix = (string)=>{
|
|
7298
|
+
let str = string.replace(BACK_SLASH_RE, '/'), prepend = !1;
|
|
7299
|
+
return str.startsWith('//') && (prepend = !0), str = str.replace(DOUBLE_SLASH_RE, '/'), prepend && (str = '/' + str), str;
|
|
7300
|
+
}, normalizePathToUnix = (path)=>toUnix(normalize(toUnix(path))), normalizeIgnored = (cwd = '')=>(path)=>'string' == typeof path ? normalizePathToUnix(isAbsolute(path) ? path : join(cwd, path)) : path, EMPTY_SET = Object.freeze(new Set());
|
|
7301
|
+
class DirEntry {
|
|
7302
|
+
path;
|
|
7303
|
+
_removeWatcher;
|
|
7304
|
+
items;
|
|
7305
|
+
constructor(dir, removeWatcher){
|
|
7306
|
+
this.path = dir, this._removeWatcher = removeWatcher, this.items = new Set();
|
|
7307
|
+
}
|
|
7308
|
+
add(item) {
|
|
7309
|
+
let { items } = this;
|
|
7310
|
+
items && '.' !== item && '..' !== item && items.add(item);
|
|
7311
|
+
}
|
|
7312
|
+
async remove(item) {
|
|
7313
|
+
let { items } = this;
|
|
7314
|
+
if (!items || (items.delete(item), items.size > 0)) return;
|
|
7315
|
+
let dir = this.path;
|
|
7316
|
+
try {
|
|
7317
|
+
await readdir(dir);
|
|
7318
|
+
} catch (err) {
|
|
7319
|
+
this._removeWatcher && this._removeWatcher(external_node_path_dirname(dir), external_node_path_basename(dir));
|
|
7320
|
+
}
|
|
7321
|
+
}
|
|
7322
|
+
has(item) {
|
|
7323
|
+
let { items } = this;
|
|
7324
|
+
if (items) return items.has(item);
|
|
7325
|
+
}
|
|
7326
|
+
getChildren() {
|
|
7327
|
+
let { items } = this;
|
|
7328
|
+
return items ? [
|
|
7329
|
+
...items.values()
|
|
7330
|
+
] : [];
|
|
7331
|
+
}
|
|
7332
|
+
dispose() {
|
|
7333
|
+
this.items.clear(), this.path = '', this._removeWatcher = EMPTY_FN, this.items = EMPTY_SET, Object.freeze(this);
|
|
7334
|
+
}
|
|
7335
|
+
}
|
|
7336
|
+
class WatchHelper {
|
|
7337
|
+
fsw;
|
|
7338
|
+
path;
|
|
7339
|
+
watchPath;
|
|
7340
|
+
fullWatchPath;
|
|
7341
|
+
dirParts;
|
|
7342
|
+
followSymlinks;
|
|
7343
|
+
statMethod;
|
|
7344
|
+
constructor(path, follow, fsw){
|
|
7345
|
+
this.fsw = fsw;
|
|
7346
|
+
let watchPath = path;
|
|
7347
|
+
this.path = path = path.replace(REPLACER_RE, ''), this.watchPath = watchPath, this.fullWatchPath = external_node_path_resolve(watchPath), this.dirParts = [], this.dirParts.forEach((parts)=>{
|
|
7348
|
+
parts.length > 1 && parts.pop();
|
|
7349
|
+
}), this.followSymlinks = follow, this.statMethod = follow ? 'stat' : 'lstat';
|
|
7350
|
+
}
|
|
7351
|
+
entryPath(entry) {
|
|
7352
|
+
return join(this.watchPath, external_node_path_relative(this.watchPath, entry.fullPath));
|
|
7353
|
+
}
|
|
7354
|
+
filterPath(entry) {
|
|
7355
|
+
let { stats } = entry;
|
|
7356
|
+
if (stats && stats.isSymbolicLink()) return this.filterDir(entry);
|
|
7357
|
+
let resolvedPath = this.entryPath(entry);
|
|
7358
|
+
return this.fsw._isntIgnored(resolvedPath, stats) && this.fsw._hasReadPermissions(stats);
|
|
7359
|
+
}
|
|
7360
|
+
filterDir(entry) {
|
|
7361
|
+
return this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
|
|
7362
|
+
}
|
|
7363
|
+
}
|
|
7364
|
+
class FSWatcher extends EventEmitter {
|
|
7365
|
+
closed;
|
|
7366
|
+
options;
|
|
7367
|
+
_closers;
|
|
7368
|
+
_ignoredPaths;
|
|
7369
|
+
_throttled;
|
|
7370
|
+
_streams;
|
|
7371
|
+
_symlinkPaths;
|
|
7372
|
+
_watched;
|
|
7373
|
+
_pendingWrites;
|
|
7374
|
+
_pendingUnlinks;
|
|
7375
|
+
_readyCount;
|
|
7376
|
+
_emitReady;
|
|
7377
|
+
_closePromise;
|
|
7378
|
+
_userIgnored;
|
|
7379
|
+
_readyEmitted;
|
|
7380
|
+
_emitRaw;
|
|
7381
|
+
_boundRemove;
|
|
7382
|
+
_nodeFsHandler;
|
|
7383
|
+
constructor(_opts = {}){
|
|
7384
|
+
super(), this.closed = !1, this._closers = new Map(), this._ignoredPaths = new Set(), this._throttled = new Map(), this._streams = new Set(), this._symlinkPaths = new Map(), this._watched = new Map(), this._pendingWrites = new Map(), this._pendingUnlinks = new Map(), this._readyCount = 0, this._readyEmitted = !1;
|
|
7385
|
+
let awf = _opts.awaitWriteFinish, DEF_AWF = {
|
|
7386
|
+
stabilityThreshold: 2000,
|
|
7387
|
+
pollInterval: 100
|
|
7388
|
+
}, opts = {
|
|
7389
|
+
persistent: !0,
|
|
7390
|
+
ignoreInitial: !1,
|
|
7391
|
+
ignorePermissionErrors: !1,
|
|
7392
|
+
interval: 100,
|
|
7393
|
+
binaryInterval: 300,
|
|
7394
|
+
followSymlinks: !0,
|
|
7395
|
+
usePolling: !1,
|
|
7396
|
+
atomic: !0,
|
|
7397
|
+
..._opts,
|
|
7398
|
+
ignored: _opts.ignored ? arrify(_opts.ignored) : arrify([]),
|
|
7399
|
+
awaitWriteFinish: !0 === awf ? DEF_AWF : 'object' == typeof awf && {
|
|
7400
|
+
...DEF_AWF,
|
|
7401
|
+
...awf
|
|
7402
|
+
}
|
|
7403
|
+
};
|
|
7404
|
+
isIBMi && (opts.usePolling = !0), void 0 === opts.atomic && (opts.atomic = !opts.usePolling);
|
|
7405
|
+
let envPoll = process.env.CHOKIDAR_USEPOLLING;
|
|
7406
|
+
if (void 0 !== envPoll) {
|
|
7407
|
+
let envLower = envPoll.toLowerCase();
|
|
7408
|
+
'false' === envLower || '0' === envLower ? opts.usePolling = !1 : 'true' === envLower || '1' === envLower ? opts.usePolling = !0 : opts.usePolling = !!envLower;
|
|
7409
|
+
}
|
|
7410
|
+
let envInterval = process.env.CHOKIDAR_INTERVAL;
|
|
7411
|
+
envInterval && (opts.interval = Number.parseInt(envInterval, 10));
|
|
7412
|
+
let readyCalls = 0;
|
|
7413
|
+
this._emitReady = ()=>{
|
|
7414
|
+
++readyCalls >= this._readyCount && (this._emitReady = EMPTY_FN, this._readyEmitted = !0, process.nextTick(()=>this.emit(EVENTS_READY)));
|
|
7415
|
+
}, this._emitRaw = (...args)=>this.emit(EVENTS_RAW, ...args), this._boundRemove = this._remove.bind(this), this.options = opts, this._nodeFsHandler = new NodeFsHandler(this), Object.freeze(opts);
|
|
7416
|
+
}
|
|
7417
|
+
_addIgnoredPath(matcher) {
|
|
7418
|
+
if (isMatcherObject(matcher)) {
|
|
7419
|
+
for (let ignored of this._ignoredPaths)if (isMatcherObject(ignored) && ignored.path === matcher.path && ignored.recursive === matcher.recursive) return;
|
|
7420
|
+
}
|
|
7421
|
+
this._ignoredPaths.add(matcher);
|
|
7422
|
+
}
|
|
7423
|
+
_removeIgnoredPath(matcher) {
|
|
7424
|
+
if (this._ignoredPaths.delete(matcher), 'string' == typeof matcher) for (let ignored of this._ignoredPaths)isMatcherObject(ignored) && ignored.path === matcher && this._ignoredPaths.delete(ignored);
|
|
7425
|
+
}
|
|
7426
|
+
add(paths_, _origAdd, _internal) {
|
|
7427
|
+
let { cwd } = this.options;
|
|
7428
|
+
this.closed = !1, this._closePromise = void 0;
|
|
7429
|
+
let paths = unifyPaths(paths_);
|
|
7430
|
+
return cwd && (paths = paths.map((path)=>isAbsolute(path) ? path : join(cwd, path))), paths.forEach((path)=>{
|
|
7431
|
+
this._removeIgnoredPath(path);
|
|
7432
|
+
}), this._userIgnored = void 0, this._readyCount || (this._readyCount = 0), this._readyCount += paths.length, Promise.all(paths.map(async (path)=>{
|
|
7433
|
+
let res = await this._nodeFsHandler._addToNodeFs(path, !_internal, void 0, 0, _origAdd);
|
|
7434
|
+
return res && this._emitReady(), res;
|
|
7435
|
+
})).then((results)=>{
|
|
7436
|
+
this.closed || results.forEach((item)=>{
|
|
7437
|
+
item && this.add(external_node_path_dirname(item), external_node_path_basename(_origAdd || item));
|
|
7438
|
+
});
|
|
7439
|
+
}), this;
|
|
7440
|
+
}
|
|
7441
|
+
unwatch(paths_) {
|
|
7442
|
+
if (this.closed) return this;
|
|
7443
|
+
let paths = unifyPaths(paths_), { cwd } = this.options;
|
|
7444
|
+
return paths.forEach((path)=>{
|
|
7445
|
+
isAbsolute(path) || this._closers.has(path) || (cwd && (path = join(cwd, path)), path = external_node_path_resolve(path)), this._closePath(path), this._addIgnoredPath(path), this._watched.has(path) && this._addIgnoredPath({
|
|
7446
|
+
path,
|
|
7447
|
+
recursive: !0
|
|
7448
|
+
}), this._userIgnored = void 0;
|
|
7449
|
+
}), this;
|
|
7450
|
+
}
|
|
7451
|
+
close() {
|
|
7452
|
+
if (this._closePromise) return this._closePromise;
|
|
7453
|
+
this.closed = !0, this.removeAllListeners();
|
|
7454
|
+
let closers = [];
|
|
7455
|
+
return this._closers.forEach((closerList)=>closerList.forEach((closer)=>{
|
|
7456
|
+
let promise = closer();
|
|
7457
|
+
promise instanceof Promise && closers.push(promise);
|
|
7458
|
+
})), this._streams.forEach((stream)=>stream.destroy()), this._userIgnored = void 0, this._readyCount = 0, this._readyEmitted = !1, this._watched.forEach((dirent)=>dirent.dispose()), this._closers.clear(), this._watched.clear(), this._streams.clear(), this._symlinkPaths.clear(), this._throttled.clear(), this._closePromise = closers.length ? Promise.all(closers).then(()=>void 0) : Promise.resolve(), this._closePromise;
|
|
7459
|
+
}
|
|
7460
|
+
getWatched() {
|
|
7461
|
+
let watchList = {};
|
|
7462
|
+
return this._watched.forEach((entry, dir)=>{
|
|
7463
|
+
watchList[(this.options.cwd ? external_node_path_relative(this.options.cwd, dir) : dir) || '.'] = entry.getChildren().sort();
|
|
7464
|
+
}), watchList;
|
|
7465
|
+
}
|
|
7466
|
+
emitWithAll(event, args) {
|
|
7467
|
+
this.emit(event, ...args), event !== EVENTS_ERROR && this.emit(EVENTS_ALL, event, ...args);
|
|
7468
|
+
}
|
|
7469
|
+
async _emit(event, path, stats) {
|
|
7470
|
+
let pw;
|
|
7471
|
+
if (this.closed) return;
|
|
7472
|
+
let opts = this.options;
|
|
7473
|
+
isWindows && (path = normalize(path)), opts.cwd && (path = external_node_path_relative(opts.cwd, path));
|
|
7474
|
+
let args = [
|
|
7475
|
+
path
|
|
7476
|
+
];
|
|
7477
|
+
null != stats && args.push(stats);
|
|
7478
|
+
let awf = opts.awaitWriteFinish;
|
|
7479
|
+
if (awf && (pw = this._pendingWrites.get(path))) return pw.lastChange = new Date(), this;
|
|
7480
|
+
if (opts.atomic) {
|
|
7481
|
+
if (event === EVENTS_UNLINK) return this._pendingUnlinks.set(path, [
|
|
7482
|
+
event,
|
|
7483
|
+
...args
|
|
7484
|
+
]), setTimeout(()=>{
|
|
7485
|
+
this._pendingUnlinks.forEach((entry, path)=>{
|
|
7486
|
+
this.emit(...entry), this.emit(EVENTS_ALL, ...entry), this._pendingUnlinks.delete(path);
|
|
7487
|
+
});
|
|
7488
|
+
}, 'number' == typeof opts.atomic ? opts.atomic : 100), this;
|
|
7489
|
+
event === EVENTS_ADD && this._pendingUnlinks.has(path) && (event = EVENTS_CHANGE, this._pendingUnlinks.delete(path));
|
|
7490
|
+
}
|
|
7491
|
+
if (awf && (event === EVENTS_ADD || event === EVENTS_CHANGE) && this._readyEmitted) {
|
|
7492
|
+
let awfEmit = (err, stats)=>{
|
|
7493
|
+
err ? (event = EVENTS_ERROR, args[0] = err, this.emitWithAll(event, args)) : stats && (args.length > 1 ? args[1] = stats : args.push(stats), this.emitWithAll(event, args));
|
|
7494
|
+
};
|
|
7495
|
+
return this._awaitWriteFinish(path, awf.stabilityThreshold, event, awfEmit), this;
|
|
7496
|
+
}
|
|
7497
|
+
if (event === EVENTS_CHANGE && !this._throttle(EVENTS_CHANGE, path, 50)) return this;
|
|
7498
|
+
if (opts.alwaysStat && void 0 === stats && (event === EVENTS_ADD || event === EVENTS_ADD_DIR || event === EVENTS_CHANGE)) {
|
|
7499
|
+
let stats, fullPath = opts.cwd ? join(opts.cwd, path) : path;
|
|
7500
|
+
try {
|
|
7501
|
+
stats = await promises_stat(fullPath);
|
|
7502
|
+
} catch (err) {}
|
|
7503
|
+
if (!stats || this.closed) return;
|
|
7504
|
+
args.push(stats);
|
|
7505
|
+
}
|
|
7506
|
+
return this.emitWithAll(event, args), this;
|
|
7507
|
+
}
|
|
7508
|
+
_handleError(error) {
|
|
7509
|
+
let code = error && error.code;
|
|
7510
|
+
return error && 'ENOENT' !== code && 'ENOTDIR' !== code && (!this.options.ignorePermissionErrors || 'EPERM' !== code && 'EACCES' !== code) && this.emit(EVENTS_ERROR, error), error || this.closed;
|
|
7511
|
+
}
|
|
7512
|
+
_throttle(actionType, path, timeout) {
|
|
7513
|
+
let timeoutObject;
|
|
7514
|
+
this._throttled.has(actionType) || this._throttled.set(actionType, new Map());
|
|
7515
|
+
let action = this._throttled.get(actionType);
|
|
7516
|
+
if (!action) throw Error('invalid throttle');
|
|
7517
|
+
let actionPath = action.get(path);
|
|
7518
|
+
if (actionPath) return actionPath.count++, !1;
|
|
7519
|
+
let clear = ()=>{
|
|
7520
|
+
let item = action.get(path), count = item ? item.count : 0;
|
|
7521
|
+
return action.delete(path), clearTimeout(timeoutObject), item && clearTimeout(item.timeoutObject), count;
|
|
7522
|
+
}, thr = {
|
|
7523
|
+
timeoutObject: timeoutObject = setTimeout(clear, timeout),
|
|
7524
|
+
clear,
|
|
7525
|
+
count: 0
|
|
7526
|
+
};
|
|
7527
|
+
return action.set(path, thr), thr;
|
|
7528
|
+
}
|
|
7529
|
+
_incrReadyCount() {
|
|
7530
|
+
return this._readyCount++;
|
|
7531
|
+
}
|
|
7532
|
+
_awaitWriteFinish(path, threshold, event, awfEmit) {
|
|
7533
|
+
let timeoutHandler, awf = this.options.awaitWriteFinish;
|
|
7534
|
+
if ('object' != typeof awf) return;
|
|
7535
|
+
let pollInterval = awf.pollInterval, fullPath = path;
|
|
7536
|
+
this.options.cwd && !isAbsolute(path) && (fullPath = join(this.options.cwd, path));
|
|
7537
|
+
let now = new Date(), writes = this._pendingWrites;
|
|
7538
|
+
writes.has(path) || (writes.set(path, {
|
|
7539
|
+
lastChange: now,
|
|
7540
|
+
cancelWait: ()=>(writes.delete(path), clearTimeout(timeoutHandler), event)
|
|
7541
|
+
}), timeoutHandler = setTimeout(function awaitWriteFinishFn(prevStat) {
|
|
7542
|
+
external_node_fs_stat(fullPath, (err, curStat)=>{
|
|
7543
|
+
if (err || !writes.has(path)) {
|
|
7544
|
+
err && 'ENOENT' !== err.code && awfEmit(err);
|
|
7545
|
+
return;
|
|
7546
|
+
}
|
|
7547
|
+
let now = Number(new Date());
|
|
7548
|
+
prevStat && curStat.size !== prevStat.size && (writes.get(path).lastChange = now), now - writes.get(path).lastChange >= threshold ? (writes.delete(path), awfEmit(void 0, curStat)) : timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
|
|
7549
|
+
});
|
|
7550
|
+
}, pollInterval));
|
|
7551
|
+
}
|
|
7552
|
+
_isIgnored(path, stats) {
|
|
7553
|
+
if (this.options.atomic && DOT_RE.test(path)) return !0;
|
|
7554
|
+
if (!this._userIgnored) {
|
|
7555
|
+
let { cwd } = this.options, ignored = (this.options.ignored || []).map(normalizeIgnored(cwd)), list = [
|
|
7556
|
+
...[
|
|
7557
|
+
...this._ignoredPaths
|
|
7558
|
+
].map(normalizeIgnored(cwd)),
|
|
7559
|
+
...ignored
|
|
7560
|
+
];
|
|
7561
|
+
this._userIgnored = function(matchers, testString) {
|
|
7562
|
+
if (null == matchers) throw TypeError('anymatch: specify first argument');
|
|
7563
|
+
let patterns = arrify(matchers).map((matcher)=>'function' == typeof matcher ? matcher : 'string' == typeof matcher ? (string)=>matcher === string : matcher instanceof RegExp ? (string)=>matcher.test(string) : 'object' == typeof matcher && null !== matcher ? (string)=>{
|
|
7564
|
+
if (matcher.path === string) return !0;
|
|
7565
|
+
if (matcher.recursive) {
|
|
7566
|
+
let relative = external_node_path_relative(matcher.path, string);
|
|
7567
|
+
return !!relative && !relative.startsWith('..') && !isAbsolute(relative);
|
|
7568
|
+
}
|
|
7569
|
+
return !1;
|
|
7570
|
+
} : ()=>!1);
|
|
7571
|
+
return null == testString ? (testString, stats)=>chokidar_matchPatterns(patterns, testString, stats) : chokidar_matchPatterns(patterns, testString);
|
|
7572
|
+
}(list, void 0);
|
|
7573
|
+
}
|
|
7574
|
+
return this._userIgnored(path, stats);
|
|
7575
|
+
}
|
|
7576
|
+
_isntIgnored(path, stat) {
|
|
7577
|
+
return !this._isIgnored(path, stat);
|
|
7578
|
+
}
|
|
7579
|
+
_getWatchHelpers(path) {
|
|
7580
|
+
return new WatchHelper(path, this.options.followSymlinks, this);
|
|
7581
|
+
}
|
|
7582
|
+
_getWatchedDir(directory) {
|
|
7583
|
+
let dir = external_node_path_resolve(directory);
|
|
7584
|
+
return this._watched.has(dir) || this._watched.set(dir, new DirEntry(dir, this._boundRemove)), this._watched.get(dir);
|
|
7585
|
+
}
|
|
7586
|
+
_hasReadPermissions(stats) {
|
|
7587
|
+
return !!this.options.ignorePermissionErrors || !!(256 & Number(stats.mode));
|
|
7588
|
+
}
|
|
7589
|
+
_remove(directory, item, isDirectory) {
|
|
7590
|
+
let path = join(directory, item), fullPath = external_node_path_resolve(path);
|
|
7591
|
+
if (isDirectory = null != isDirectory ? isDirectory : this._watched.has(path) || this._watched.has(fullPath), !this._throttle('remove', path, 100)) return;
|
|
7592
|
+
isDirectory || 1 !== this._watched.size || this.add(directory, item, !0), this._getWatchedDir(path).getChildren().forEach((nested)=>this._remove(path, nested));
|
|
7593
|
+
let parent = this._getWatchedDir(directory), wasTracked = parent.has(item);
|
|
7594
|
+
parent.remove(item), this._symlinkPaths.has(fullPath) && this._symlinkPaths.delete(fullPath);
|
|
7595
|
+
let relPath = path;
|
|
7596
|
+
if (this.options.cwd && (relPath = external_node_path_relative(this.options.cwd, path)), this.options.awaitWriteFinish && this._pendingWrites.has(relPath) && this._pendingWrites.get(relPath).cancelWait() === EVENTS_ADD) return;
|
|
7597
|
+
this._watched.delete(path), this._watched.delete(fullPath);
|
|
7598
|
+
let eventName = isDirectory ? EVENTS_UNLINK_DIR : EVENTS_UNLINK;
|
|
7599
|
+
wasTracked && !this._isIgnored(path) && this._emit(eventName, path), this._closePath(path);
|
|
7600
|
+
}
|
|
7601
|
+
_closePath(path) {
|
|
7602
|
+
this._closeFile(path);
|
|
7603
|
+
let dir = external_node_path_dirname(path);
|
|
7604
|
+
this._getWatchedDir(dir).remove(external_node_path_basename(path));
|
|
7605
|
+
}
|
|
7606
|
+
_closeFile(path) {
|
|
7607
|
+
let closers = this._closers.get(path);
|
|
7608
|
+
closers && (closers.forEach((closer)=>closer()), this._closers.delete(path));
|
|
7609
|
+
}
|
|
7610
|
+
_addPathCloser(path, closer) {
|
|
7611
|
+
if (!closer) return;
|
|
7612
|
+
let list = this._closers.get(path);
|
|
7613
|
+
list || (list = [], this._closers.set(path, list)), list.push(closer);
|
|
7614
|
+
}
|
|
7615
|
+
_readdirp(root, opts) {
|
|
7616
|
+
if (this.closed) return;
|
|
7617
|
+
let stream = function(root, options = {}) {
|
|
7618
|
+
let type = options.entryType || options.type;
|
|
7619
|
+
if ('both' === type && (type = EntryTypes_FILE_DIR_TYPE), type && (options.type = type), root) {
|
|
7620
|
+
if ('string' != typeof root) throw TypeError('readdirp: root argument must be a string. Usage: readdirp(root, options)');
|
|
7621
|
+
else if (type && !ALL_TYPES.includes(type)) throw Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`);
|
|
7622
|
+
} else throw Error('readdirp: root argument is required. Usage: readdirp(root, options)');
|
|
7623
|
+
return options.root = root, new ReaddirpStream(options);
|
|
7624
|
+
}(root, {
|
|
7625
|
+
type: EVENTS_ALL,
|
|
7626
|
+
alwaysStat: !0,
|
|
7627
|
+
lstat: !0,
|
|
7628
|
+
...opts,
|
|
7629
|
+
depth: 0
|
|
7630
|
+
});
|
|
7631
|
+
return this._streams.add(stream), stream.once('close', ()=>{
|
|
7632
|
+
stream = void 0;
|
|
7633
|
+
}), stream.once('end', ()=>{
|
|
7634
|
+
stream && (this._streams.delete(stream), stream = void 0);
|
|
7635
|
+
}), stream;
|
|
7636
|
+
}
|
|
7637
|
+
}
|
|
7638
|
+
let chokidar_watch = function(paths, options = {}) {
|
|
7639
|
+
let watcher = new FSWatcher(options);
|
|
7640
|
+
return watcher.add(paths), watcher;
|
|
7641
|
+
}, GLOB_REGEX = /[*?{}[\]()!@+|]/;
|
|
3765
7642
|
async function createChokidar(pathOrGlobs, root = process.cwd(), options) {
|
|
3766
7643
|
let watchFiles = new Set(), globPatterns = pathOrGlobs.filter((pathOrGlob)=>!!GLOB_REGEX.test(pathOrGlob) || (watchFiles.add(pathOrGlob), !1));
|
|
3767
|
-
if (globPatterns.length) for (let file of (await
|
|
7644
|
+
if (globPatterns.length) for (let file of (await dist_glob(globPatterns, {
|
|
3768
7645
|
cwd: root,
|
|
3769
7646
|
absolute: !0
|
|
3770
7647
|
})))watchFiles.add(file);
|
|
3771
|
-
return
|
|
7648
|
+
return chokidar_watch(Array.from(watchFiles), {
|
|
3772
7649
|
ignoreInitial: !0,
|
|
3773
7650
|
ignorePermissionErrors: !0,
|
|
3774
7651
|
...options
|
|
@@ -3861,9 +7738,9 @@ async function setupUnpack(cliOptions, command) {
|
|
|
3861
7738
|
};
|
|
3862
7739
|
}
|
|
3863
7740
|
function runCLI() {
|
|
3864
|
-
let cli =
|
|
7741
|
+
let cli = ((name = "")=>new CAC(name))('unpack');
|
|
3865
7742
|
cli.option('-c, --config <file>', 'Use specified config file').option('-r, --root <dir>', 'Specify root directory').option('-d, --debug', 'Show debug logs');
|
|
3866
|
-
let devCommand = cli.command('', 'Start dev server').alias('dev'), buildCommand = cli.command('build', 'Build for production'), cleanCommand = cli.command('clean', 'Clean cache directory');
|
|
7743
|
+
let devCommand = cli.command('', 'Start dev server').alias('dev'), buildCommand = cli.command('build', 'Build for production'), cleanCommand = cli.command('clean', 'Clean cache directory'), upCommand = cli.command('up', 'Upgrade unpack packages to the latest');
|
|
3867
7744
|
buildCommand.option('-w, --watch', 'Rebuilds when modules have changed on disk').option('--analyze', 'Analyze the size of output files').action(withErrorHandling(async (options)=>{
|
|
3868
7745
|
let { unpack } = await setupUnpack(options, 'build');
|
|
3869
7746
|
await unpack.build({
|
|
@@ -3872,7 +7749,18 @@ function runCLI() {
|
|
|
3872
7749
|
})), cleanCommand.action(withErrorHandling(async (options)=>{
|
|
3873
7750
|
let { unpack } = await setupUnpack(options, 'build');
|
|
3874
7751
|
unpack.clean();
|
|
3875
|
-
}))
|
|
7752
|
+
})), upCommand.action(()=>{
|
|
7753
|
+
spawnSync('win32' === process.platform ? 'npx.cmd' : 'npx', [
|
|
7754
|
+
'--yes',
|
|
7755
|
+
'taze',
|
|
7756
|
+
'minor',
|
|
7757
|
+
'--include',
|
|
7758
|
+
'/^@unpackjs\\//',
|
|
7759
|
+
'-w'
|
|
7760
|
+
], {
|
|
7761
|
+
stdio: 'inherit'
|
|
7762
|
+
});
|
|
7763
|
+
});
|
|
3876
7764
|
let startServer = withErrorHandling(async (options)=>{
|
|
3877
7765
|
let { unpack, config } = await setupUnpack(options, 'dev'), { port, url } = await unpack.dev();
|
|
3878
7766
|
await setupCliShortcuts({
|
|
@@ -3900,8 +7788,8 @@ function runCLI() {
|
|
|
3900
7788
|
logger_logger.clear(), logger_logger.info(`${node_path.basename(file)} changed, restarting server...`), await watcher.close(), await cleanUpBeforeRestart(), startServer(options);
|
|
3901
7789
|
});
|
|
3902
7790
|
});
|
|
3903
|
-
devCommand.option('-o, --open [url]', 'Open browser on startup').option('--port <port>', 'Specify port').option('--host', 'Expose hostname').action(startServer), cli.help(), cli.version("4.7.
|
|
7791
|
+
devCommand.option('-o, --open [url]', 'Open browser on startup').option('--port <port>', 'Specify port').option('--host', 'Expose hostname').action(startServer), cli.help(), cli.version("4.7.4"), cli.parse();
|
|
3904
7792
|
}
|
|
3905
7793
|
let launch_editor = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/index.js");
|
|
3906
7794
|
var launch_editor_default_0 = __webpack_require__.n(launch_editor)(), src_CSS_MODULES_NAMED_EXPORT = !1;
|
|
3907
|
-
export { ALL_INTERFACES_IPV4, CSS_MODULES_EXPORTS_CONVENTION, CSS_MODULES_LOCAL_IDENT_NAME, CSS_MODULES_RESOURCE_QUERY_REGEX, CSS_REGEX, DEV_DEFAULT_FILENAME, JSX_REGEX, JS_REGEX, LESS_REGEX, LOCALHOST, NODE_MODULES_REGEX, PROD_DEFAULT_FILENAME, SASS_REGEX, SCRIPT_REGEX, TEMPLATE_CONTENT, addRestartCleaner, applyHtmlTagDescriptors, cleanUpBeforeRestart, clearLine, colors, convertBasicAnsiColors, createChokidar, createUnpack, debounce, defineConfig, dist_default_0 as mergeConfig, emptyDir, ensureDir, esVersionToBrowserslist,
|
|
7795
|
+
export { ALL_INTERFACES_IPV4, CSS_MODULES_EXPORTS_CONVENTION, CSS_MODULES_LOCAL_IDENT_NAME, CSS_MODULES_RESOURCE_QUERY_REGEX, CSS_REGEX, DEV_DEFAULT_FILENAME, JSX_REGEX, JS_REGEX, LESS_REGEX, LOCALHOST, NODE_MODULES_REGEX, PROD_DEFAULT_FILENAME, SASS_REGEX, SCRIPT_REGEX, TEMPLATE_CONTENT, addRestartCleaner, applyHtmlTagDescriptors, cleanUpBeforeRestart, clearLine, colors, convertBasicAnsiColors, createChokidar, createUnpack, debounce, defineConfig, dist_default_0 as mergeConfig, dist_glob as glob, emptyDir, ensureDir, esVersionToBrowserslist, findExists, getAddressUrls, getCompiledPkgPath, getCurrentUnpackConfig, getDevServerPort, getFilesContentHash, getHtmlTemplateOrContent, getIpv4Interfaces, getNodeEnv, getOrSetDefault, getPathInJs, getPort, getTime, getUnpackStartTime, getUserDepPath, getUserDepVersion, globSync, isBoolean, isDebug, isDev, isEmptyDir, isFileSync, isFunction, isNodeVersionAtLeast, isObject, isPlainObject, isRegExp, isUndefined, launch_editor_default_0 as launchEditor, loadConfig, loadConfigFromFile, logUpdate, logger_LogColor as LogColor, logger_logger as logger, normalizePublicPath, openBrowser, pLimit, pathToExportIdentifier, prettyTime, printServerUrls, removeDir, renderHtmlTagDescriptor, resolveConfigPath, rspack, runCLI, setCurrentUnpackConfig, setDevServer, setDevServerPort, setNodeEnv, setUnpackStartTime, src_CSS_MODULES_NAMED_EXPORT as CSS_MODULES_NAMED_EXPORT, trackPerformance, utils_isDevServer as isDevServer, utils_isProd as isProd, utils_isString as isString, utils_isWin as isWin, utils_set as set };
|