@arcote.tech/arc-cli 0.1.1 → 0.1.3
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 +35 -1455
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/utils/build.ts +27 -2
package/dist/index.js
CHANGED
|
@@ -168020,7 +168020,7 @@ var require_brace_expansion = __commonJS((exports, module) => {
|
|
|
168020
168020
|
}
|
|
168021
168021
|
});
|
|
168022
168022
|
|
|
168023
|
-
// ../../node_modules/
|
|
168023
|
+
// ../../node_modules/picomatch/lib/constants.js
|
|
168024
168024
|
var require_constants = __commonJS((exports, module) => {
|
|
168025
168025
|
var path4 = __require("path");
|
|
168026
168026
|
var WIN_SLASH = "\\\\/";
|
|
@@ -168160,7 +168160,7 @@ var require_constants = __commonJS((exports, module) => {
|
|
|
168160
168160
|
};
|
|
168161
168161
|
});
|
|
168162
168162
|
|
|
168163
|
-
// ../../node_modules/
|
|
168163
|
+
// ../../node_modules/picomatch/lib/utils.js
|
|
168164
168164
|
var require_utils = __commonJS((exports) => {
|
|
168165
168165
|
var path4 = __require("path");
|
|
168166
168166
|
var win322 = process.platform === "win32";
|
|
@@ -168220,7 +168220,7 @@ var require_utils = __commonJS((exports) => {
|
|
|
168220
168220
|
};
|
|
168221
168221
|
});
|
|
168222
168222
|
|
|
168223
|
-
// ../../node_modules/
|
|
168223
|
+
// ../../node_modules/picomatch/lib/scan.js
|
|
168224
168224
|
var require_scan = __commonJS((exports, module) => {
|
|
168225
168225
|
var utils = require_utils();
|
|
168226
168226
|
var {
|
|
@@ -168535,7 +168535,7 @@ var require_scan = __commonJS((exports, module) => {
|
|
|
168535
168535
|
module.exports = scan;
|
|
168536
168536
|
});
|
|
168537
168537
|
|
|
168538
|
-
// ../../node_modules/
|
|
168538
|
+
// ../../node_modules/picomatch/lib/parse.js
|
|
168539
168539
|
var require_parse = __commonJS((exports, module) => {
|
|
168540
168540
|
var constants = require_constants();
|
|
168541
168541
|
var utils = require_utils();
|
|
@@ -169313,7 +169313,7 @@ var require_parse = __commonJS((exports, module) => {
|
|
|
169313
169313
|
module.exports = parse;
|
|
169314
169314
|
});
|
|
169315
169315
|
|
|
169316
|
-
// ../../node_modules/
|
|
169316
|
+
// ../../node_modules/picomatch/lib/picomatch.js
|
|
169317
169317
|
var require_picomatch = __commonJS((exports, module) => {
|
|
169318
169318
|
var path4 = __require("path");
|
|
169319
169319
|
var scan = require_scan();
|
|
@@ -169685,1440 +169685,6 @@ var require_readdirp = __commonJS((exports, module) => {
|
|
|
169685
169685
|
module.exports = readdirp;
|
|
169686
169686
|
});
|
|
169687
169687
|
|
|
169688
|
-
// ../../node_modules/anymatch/node_modules/picomatch/lib/constants.js
|
|
169689
|
-
var require_constants2 = __commonJS((exports, module) => {
|
|
169690
|
-
var path4 = __require("path");
|
|
169691
|
-
var WIN_SLASH = "\\\\/";
|
|
169692
|
-
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
169693
|
-
var DOT_LITERAL = "\\.";
|
|
169694
|
-
var PLUS_LITERAL = "\\+";
|
|
169695
|
-
var QMARK_LITERAL = "\\?";
|
|
169696
|
-
var SLASH_LITERAL = "\\/";
|
|
169697
|
-
var ONE_CHAR = "(?=.)";
|
|
169698
|
-
var QMARK = "[^/]";
|
|
169699
|
-
var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
|
|
169700
|
-
var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
|
|
169701
|
-
var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
|
|
169702
|
-
var NO_DOT = `(?!${DOT_LITERAL})`;
|
|
169703
|
-
var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
|
|
169704
|
-
var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
|
|
169705
|
-
var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
|
|
169706
|
-
var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
|
|
169707
|
-
var STAR = `${QMARK}*?`;
|
|
169708
|
-
var POSIX_CHARS = {
|
|
169709
|
-
DOT_LITERAL,
|
|
169710
|
-
PLUS_LITERAL,
|
|
169711
|
-
QMARK_LITERAL,
|
|
169712
|
-
SLASH_LITERAL,
|
|
169713
|
-
ONE_CHAR,
|
|
169714
|
-
QMARK,
|
|
169715
|
-
END_ANCHOR,
|
|
169716
|
-
DOTS_SLASH,
|
|
169717
|
-
NO_DOT,
|
|
169718
|
-
NO_DOTS,
|
|
169719
|
-
NO_DOT_SLASH,
|
|
169720
|
-
NO_DOTS_SLASH,
|
|
169721
|
-
QMARK_NO_DOT,
|
|
169722
|
-
STAR,
|
|
169723
|
-
START_ANCHOR
|
|
169724
|
-
};
|
|
169725
|
-
var WINDOWS_CHARS = {
|
|
169726
|
-
...POSIX_CHARS,
|
|
169727
|
-
SLASH_LITERAL: `[${WIN_SLASH}]`,
|
|
169728
|
-
QMARK: WIN_NO_SLASH,
|
|
169729
|
-
STAR: `${WIN_NO_SLASH}*?`,
|
|
169730
|
-
DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
|
|
169731
|
-
NO_DOT: `(?!${DOT_LITERAL})`,
|
|
169732
|
-
NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
169733
|
-
NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
|
|
169734
|
-
NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
169735
|
-
QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
|
|
169736
|
-
START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
|
|
169737
|
-
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`
|
|
169738
|
-
};
|
|
169739
|
-
var POSIX_REGEX_SOURCE = {
|
|
169740
|
-
alnum: "a-zA-Z0-9",
|
|
169741
|
-
alpha: "a-zA-Z",
|
|
169742
|
-
ascii: "\\x00-\\x7F",
|
|
169743
|
-
blank: " \\t",
|
|
169744
|
-
cntrl: "\\x00-\\x1F\\x7F",
|
|
169745
|
-
digit: "0-9",
|
|
169746
|
-
graph: "\\x21-\\x7E",
|
|
169747
|
-
lower: "a-z",
|
|
169748
|
-
print: "\\x20-\\x7E ",
|
|
169749
|
-
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
|
|
169750
|
-
space: " \\t\\r\\n\\v\\f",
|
|
169751
|
-
upper: "A-Z",
|
|
169752
|
-
word: "A-Za-z0-9_",
|
|
169753
|
-
xdigit: "A-Fa-f0-9"
|
|
169754
|
-
};
|
|
169755
|
-
module.exports = {
|
|
169756
|
-
MAX_LENGTH: 1024 * 64,
|
|
169757
|
-
POSIX_REGEX_SOURCE,
|
|
169758
|
-
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
169759
|
-
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
169760
|
-
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
|
169761
|
-
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
|
169762
|
-
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
|
169763
|
-
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
169764
|
-
REPLACEMENTS: {
|
|
169765
|
-
"***": "*",
|
|
169766
|
-
"**/**": "**",
|
|
169767
|
-
"**/**/**": "**"
|
|
169768
|
-
},
|
|
169769
|
-
CHAR_0: 48,
|
|
169770
|
-
CHAR_9: 57,
|
|
169771
|
-
CHAR_UPPERCASE_A: 65,
|
|
169772
|
-
CHAR_LOWERCASE_A: 97,
|
|
169773
|
-
CHAR_UPPERCASE_Z: 90,
|
|
169774
|
-
CHAR_LOWERCASE_Z: 122,
|
|
169775
|
-
CHAR_LEFT_PARENTHESES: 40,
|
|
169776
|
-
CHAR_RIGHT_PARENTHESES: 41,
|
|
169777
|
-
CHAR_ASTERISK: 42,
|
|
169778
|
-
CHAR_AMPERSAND: 38,
|
|
169779
|
-
CHAR_AT: 64,
|
|
169780
|
-
CHAR_BACKWARD_SLASH: 92,
|
|
169781
|
-
CHAR_CARRIAGE_RETURN: 13,
|
|
169782
|
-
CHAR_CIRCUMFLEX_ACCENT: 94,
|
|
169783
|
-
CHAR_COLON: 58,
|
|
169784
|
-
CHAR_COMMA: 44,
|
|
169785
|
-
CHAR_DOT: 46,
|
|
169786
|
-
CHAR_DOUBLE_QUOTE: 34,
|
|
169787
|
-
CHAR_EQUAL: 61,
|
|
169788
|
-
CHAR_EXCLAMATION_MARK: 33,
|
|
169789
|
-
CHAR_FORM_FEED: 12,
|
|
169790
|
-
CHAR_FORWARD_SLASH: 47,
|
|
169791
|
-
CHAR_GRAVE_ACCENT: 96,
|
|
169792
|
-
CHAR_HASH: 35,
|
|
169793
|
-
CHAR_HYPHEN_MINUS: 45,
|
|
169794
|
-
CHAR_LEFT_ANGLE_BRACKET: 60,
|
|
169795
|
-
CHAR_LEFT_CURLY_BRACE: 123,
|
|
169796
|
-
CHAR_LEFT_SQUARE_BRACKET: 91,
|
|
169797
|
-
CHAR_LINE_FEED: 10,
|
|
169798
|
-
CHAR_NO_BREAK_SPACE: 160,
|
|
169799
|
-
CHAR_PERCENT: 37,
|
|
169800
|
-
CHAR_PLUS: 43,
|
|
169801
|
-
CHAR_QUESTION_MARK: 63,
|
|
169802
|
-
CHAR_RIGHT_ANGLE_BRACKET: 62,
|
|
169803
|
-
CHAR_RIGHT_CURLY_BRACE: 125,
|
|
169804
|
-
CHAR_RIGHT_SQUARE_BRACKET: 93,
|
|
169805
|
-
CHAR_SEMICOLON: 59,
|
|
169806
|
-
CHAR_SINGLE_QUOTE: 39,
|
|
169807
|
-
CHAR_SPACE: 32,
|
|
169808
|
-
CHAR_TAB: 9,
|
|
169809
|
-
CHAR_UNDERSCORE: 95,
|
|
169810
|
-
CHAR_VERTICAL_LINE: 124,
|
|
169811
|
-
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
169812
|
-
SEP: path4.sep,
|
|
169813
|
-
extglobChars(chars) {
|
|
169814
|
-
return {
|
|
169815
|
-
"!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
|
|
169816
|
-
"?": { type: "qmark", open: "(?:", close: ")?" },
|
|
169817
|
-
"+": { type: "plus", open: "(?:", close: ")+" },
|
|
169818
|
-
"*": { type: "star", open: "(?:", close: ")*" },
|
|
169819
|
-
"@": { type: "at", open: "(?:", close: ")" }
|
|
169820
|
-
};
|
|
169821
|
-
},
|
|
169822
|
-
globChars(win322) {
|
|
169823
|
-
return win322 === true ? WINDOWS_CHARS : POSIX_CHARS;
|
|
169824
|
-
}
|
|
169825
|
-
};
|
|
169826
|
-
});
|
|
169827
|
-
|
|
169828
|
-
// ../../node_modules/anymatch/node_modules/picomatch/lib/utils.js
|
|
169829
|
-
var require_utils2 = __commonJS((exports) => {
|
|
169830
|
-
var path4 = __require("path");
|
|
169831
|
-
var win322 = process.platform === "win32";
|
|
169832
|
-
var {
|
|
169833
|
-
REGEX_BACKSLASH,
|
|
169834
|
-
REGEX_REMOVE_BACKSLASH,
|
|
169835
|
-
REGEX_SPECIAL_CHARS,
|
|
169836
|
-
REGEX_SPECIAL_CHARS_GLOBAL
|
|
169837
|
-
} = require_constants2();
|
|
169838
|
-
exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
169839
|
-
exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
|
|
169840
|
-
exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
|
|
169841
|
-
exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
|
|
169842
|
-
exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
|
|
169843
|
-
exports.removeBackslashes = (str) => {
|
|
169844
|
-
return str.replace(REGEX_REMOVE_BACKSLASH, (match2) => {
|
|
169845
|
-
return match2 === "\\" ? "" : match2;
|
|
169846
|
-
});
|
|
169847
|
-
};
|
|
169848
|
-
exports.supportsLookbehinds = () => {
|
|
169849
|
-
const segs = process.version.slice(1).split(".").map(Number);
|
|
169850
|
-
if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) {
|
|
169851
|
-
return true;
|
|
169852
|
-
}
|
|
169853
|
-
return false;
|
|
169854
|
-
};
|
|
169855
|
-
exports.isWindows = (options) => {
|
|
169856
|
-
if (options && typeof options.windows === "boolean") {
|
|
169857
|
-
return options.windows;
|
|
169858
|
-
}
|
|
169859
|
-
return win322 === true || path4.sep === "\\";
|
|
169860
|
-
};
|
|
169861
|
-
exports.escapeLast = (input, char, lastIdx) => {
|
|
169862
|
-
const idx = input.lastIndexOf(char, lastIdx);
|
|
169863
|
-
if (idx === -1)
|
|
169864
|
-
return input;
|
|
169865
|
-
if (input[idx - 1] === "\\")
|
|
169866
|
-
return exports.escapeLast(input, char, idx - 1);
|
|
169867
|
-
return `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
|
169868
|
-
};
|
|
169869
|
-
exports.removePrefix = (input, state = {}) => {
|
|
169870
|
-
let output = input;
|
|
169871
|
-
if (output.startsWith("./")) {
|
|
169872
|
-
output = output.slice(2);
|
|
169873
|
-
state.prefix = "./";
|
|
169874
|
-
}
|
|
169875
|
-
return output;
|
|
169876
|
-
};
|
|
169877
|
-
exports.wrapOutput = (input, state = {}, options = {}) => {
|
|
169878
|
-
const prepend = options.contains ? "" : "^";
|
|
169879
|
-
const append = options.contains ? "" : "$";
|
|
169880
|
-
let output = `${prepend}(?:${input})${append}`;
|
|
169881
|
-
if (state.negated === true) {
|
|
169882
|
-
output = `(?:^(?!${output}).*$)`;
|
|
169883
|
-
}
|
|
169884
|
-
return output;
|
|
169885
|
-
};
|
|
169886
|
-
});
|
|
169887
|
-
|
|
169888
|
-
// ../../node_modules/anymatch/node_modules/picomatch/lib/scan.js
|
|
169889
|
-
var require_scan2 = __commonJS((exports, module) => {
|
|
169890
|
-
var utils = require_utils2();
|
|
169891
|
-
var {
|
|
169892
|
-
CHAR_ASTERISK,
|
|
169893
|
-
CHAR_AT,
|
|
169894
|
-
CHAR_BACKWARD_SLASH,
|
|
169895
|
-
CHAR_COMMA,
|
|
169896
|
-
CHAR_DOT,
|
|
169897
|
-
CHAR_EXCLAMATION_MARK,
|
|
169898
|
-
CHAR_FORWARD_SLASH,
|
|
169899
|
-
CHAR_LEFT_CURLY_BRACE,
|
|
169900
|
-
CHAR_LEFT_PARENTHESES,
|
|
169901
|
-
CHAR_LEFT_SQUARE_BRACKET,
|
|
169902
|
-
CHAR_PLUS,
|
|
169903
|
-
CHAR_QUESTION_MARK,
|
|
169904
|
-
CHAR_RIGHT_CURLY_BRACE,
|
|
169905
|
-
CHAR_RIGHT_PARENTHESES,
|
|
169906
|
-
CHAR_RIGHT_SQUARE_BRACKET
|
|
169907
|
-
} = require_constants2();
|
|
169908
|
-
var isPathSeparator = (code) => {
|
|
169909
|
-
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
|
169910
|
-
};
|
|
169911
|
-
var depth = (token) => {
|
|
169912
|
-
if (token.isPrefix !== true) {
|
|
169913
|
-
token.depth = token.isGlobstar ? Infinity : 1;
|
|
169914
|
-
}
|
|
169915
|
-
};
|
|
169916
|
-
var scan = (input, options) => {
|
|
169917
|
-
const opts = options || {};
|
|
169918
|
-
const length = input.length - 1;
|
|
169919
|
-
const scanToEnd = opts.parts === true || opts.scanToEnd === true;
|
|
169920
|
-
const slashes = [];
|
|
169921
|
-
const tokens = [];
|
|
169922
|
-
const parts = [];
|
|
169923
|
-
let str = input;
|
|
169924
|
-
let index = -1;
|
|
169925
|
-
let start = 0;
|
|
169926
|
-
let lastIndex = 0;
|
|
169927
|
-
let isBrace = false;
|
|
169928
|
-
let isBracket = false;
|
|
169929
|
-
let isGlob = false;
|
|
169930
|
-
let isExtglob = false;
|
|
169931
|
-
let isGlobstar = false;
|
|
169932
|
-
let braceEscaped = false;
|
|
169933
|
-
let backslashes = false;
|
|
169934
|
-
let negated = false;
|
|
169935
|
-
let negatedExtglob = false;
|
|
169936
|
-
let finished = false;
|
|
169937
|
-
let braces = 0;
|
|
169938
|
-
let prev;
|
|
169939
|
-
let code;
|
|
169940
|
-
let token = { value: "", depth: 0, isGlob: false };
|
|
169941
|
-
const eos = () => index >= length;
|
|
169942
|
-
const peek = () => str.charCodeAt(index + 1);
|
|
169943
|
-
const advance = () => {
|
|
169944
|
-
prev = code;
|
|
169945
|
-
return str.charCodeAt(++index);
|
|
169946
|
-
};
|
|
169947
|
-
while (index < length) {
|
|
169948
|
-
code = advance();
|
|
169949
|
-
let next;
|
|
169950
|
-
if (code === CHAR_BACKWARD_SLASH) {
|
|
169951
|
-
backslashes = token.backslashes = true;
|
|
169952
|
-
code = advance();
|
|
169953
|
-
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
169954
|
-
braceEscaped = true;
|
|
169955
|
-
}
|
|
169956
|
-
continue;
|
|
169957
|
-
}
|
|
169958
|
-
if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
|
|
169959
|
-
braces++;
|
|
169960
|
-
while (eos() !== true && (code = advance())) {
|
|
169961
|
-
if (code === CHAR_BACKWARD_SLASH) {
|
|
169962
|
-
backslashes = token.backslashes = true;
|
|
169963
|
-
advance();
|
|
169964
|
-
continue;
|
|
169965
|
-
}
|
|
169966
|
-
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
169967
|
-
braces++;
|
|
169968
|
-
continue;
|
|
169969
|
-
}
|
|
169970
|
-
if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
|
|
169971
|
-
isBrace = token.isBrace = true;
|
|
169972
|
-
isGlob = token.isGlob = true;
|
|
169973
|
-
finished = true;
|
|
169974
|
-
if (scanToEnd === true) {
|
|
169975
|
-
continue;
|
|
169976
|
-
}
|
|
169977
|
-
break;
|
|
169978
|
-
}
|
|
169979
|
-
if (braceEscaped !== true && code === CHAR_COMMA) {
|
|
169980
|
-
isBrace = token.isBrace = true;
|
|
169981
|
-
isGlob = token.isGlob = true;
|
|
169982
|
-
finished = true;
|
|
169983
|
-
if (scanToEnd === true) {
|
|
169984
|
-
continue;
|
|
169985
|
-
}
|
|
169986
|
-
break;
|
|
169987
|
-
}
|
|
169988
|
-
if (code === CHAR_RIGHT_CURLY_BRACE) {
|
|
169989
|
-
braces--;
|
|
169990
|
-
if (braces === 0) {
|
|
169991
|
-
braceEscaped = false;
|
|
169992
|
-
isBrace = token.isBrace = true;
|
|
169993
|
-
finished = true;
|
|
169994
|
-
break;
|
|
169995
|
-
}
|
|
169996
|
-
}
|
|
169997
|
-
}
|
|
169998
|
-
if (scanToEnd === true) {
|
|
169999
|
-
continue;
|
|
170000
|
-
}
|
|
170001
|
-
break;
|
|
170002
|
-
}
|
|
170003
|
-
if (code === CHAR_FORWARD_SLASH) {
|
|
170004
|
-
slashes.push(index);
|
|
170005
|
-
tokens.push(token);
|
|
170006
|
-
token = { value: "", depth: 0, isGlob: false };
|
|
170007
|
-
if (finished === true)
|
|
170008
|
-
continue;
|
|
170009
|
-
if (prev === CHAR_DOT && index === start + 1) {
|
|
170010
|
-
start += 2;
|
|
170011
|
-
continue;
|
|
170012
|
-
}
|
|
170013
|
-
lastIndex = index + 1;
|
|
170014
|
-
continue;
|
|
170015
|
-
}
|
|
170016
|
-
if (opts.noext !== true) {
|
|
170017
|
-
const isExtglobChar = code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK;
|
|
170018
|
-
if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
|
|
170019
|
-
isGlob = token.isGlob = true;
|
|
170020
|
-
isExtglob = token.isExtglob = true;
|
|
170021
|
-
finished = true;
|
|
170022
|
-
if (code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
170023
|
-
negatedExtglob = true;
|
|
170024
|
-
}
|
|
170025
|
-
if (scanToEnd === true) {
|
|
170026
|
-
while (eos() !== true && (code = advance())) {
|
|
170027
|
-
if (code === CHAR_BACKWARD_SLASH) {
|
|
170028
|
-
backslashes = token.backslashes = true;
|
|
170029
|
-
code = advance();
|
|
170030
|
-
continue;
|
|
170031
|
-
}
|
|
170032
|
-
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
170033
|
-
isGlob = token.isGlob = true;
|
|
170034
|
-
finished = true;
|
|
170035
|
-
break;
|
|
170036
|
-
}
|
|
170037
|
-
}
|
|
170038
|
-
continue;
|
|
170039
|
-
}
|
|
170040
|
-
break;
|
|
170041
|
-
}
|
|
170042
|
-
}
|
|
170043
|
-
if (code === CHAR_ASTERISK) {
|
|
170044
|
-
if (prev === CHAR_ASTERISK)
|
|
170045
|
-
isGlobstar = token.isGlobstar = true;
|
|
170046
|
-
isGlob = token.isGlob = true;
|
|
170047
|
-
finished = true;
|
|
170048
|
-
if (scanToEnd === true) {
|
|
170049
|
-
continue;
|
|
170050
|
-
}
|
|
170051
|
-
break;
|
|
170052
|
-
}
|
|
170053
|
-
if (code === CHAR_QUESTION_MARK) {
|
|
170054
|
-
isGlob = token.isGlob = true;
|
|
170055
|
-
finished = true;
|
|
170056
|
-
if (scanToEnd === true) {
|
|
170057
|
-
continue;
|
|
170058
|
-
}
|
|
170059
|
-
break;
|
|
170060
|
-
}
|
|
170061
|
-
if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
|
170062
|
-
while (eos() !== true && (next = advance())) {
|
|
170063
|
-
if (next === CHAR_BACKWARD_SLASH) {
|
|
170064
|
-
backslashes = token.backslashes = true;
|
|
170065
|
-
advance();
|
|
170066
|
-
continue;
|
|
170067
|
-
}
|
|
170068
|
-
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
170069
|
-
isBracket = token.isBracket = true;
|
|
170070
|
-
isGlob = token.isGlob = true;
|
|
170071
|
-
finished = true;
|
|
170072
|
-
break;
|
|
170073
|
-
}
|
|
170074
|
-
}
|
|
170075
|
-
if (scanToEnd === true) {
|
|
170076
|
-
continue;
|
|
170077
|
-
}
|
|
170078
|
-
break;
|
|
170079
|
-
}
|
|
170080
|
-
if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
170081
|
-
negated = token.negated = true;
|
|
170082
|
-
start++;
|
|
170083
|
-
continue;
|
|
170084
|
-
}
|
|
170085
|
-
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
|
|
170086
|
-
isGlob = token.isGlob = true;
|
|
170087
|
-
if (scanToEnd === true) {
|
|
170088
|
-
while (eos() !== true && (code = advance())) {
|
|
170089
|
-
if (code === CHAR_LEFT_PARENTHESES) {
|
|
170090
|
-
backslashes = token.backslashes = true;
|
|
170091
|
-
code = advance();
|
|
170092
|
-
continue;
|
|
170093
|
-
}
|
|
170094
|
-
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
170095
|
-
finished = true;
|
|
170096
|
-
break;
|
|
170097
|
-
}
|
|
170098
|
-
}
|
|
170099
|
-
continue;
|
|
170100
|
-
}
|
|
170101
|
-
break;
|
|
170102
|
-
}
|
|
170103
|
-
if (isGlob === true) {
|
|
170104
|
-
finished = true;
|
|
170105
|
-
if (scanToEnd === true) {
|
|
170106
|
-
continue;
|
|
170107
|
-
}
|
|
170108
|
-
break;
|
|
170109
|
-
}
|
|
170110
|
-
}
|
|
170111
|
-
if (opts.noext === true) {
|
|
170112
|
-
isExtglob = false;
|
|
170113
|
-
isGlob = false;
|
|
170114
|
-
}
|
|
170115
|
-
let base = str;
|
|
170116
|
-
let prefix = "";
|
|
170117
|
-
let glob2 = "";
|
|
170118
|
-
if (start > 0) {
|
|
170119
|
-
prefix = str.slice(0, start);
|
|
170120
|
-
str = str.slice(start);
|
|
170121
|
-
lastIndex -= start;
|
|
170122
|
-
}
|
|
170123
|
-
if (base && isGlob === true && lastIndex > 0) {
|
|
170124
|
-
base = str.slice(0, lastIndex);
|
|
170125
|
-
glob2 = str.slice(lastIndex);
|
|
170126
|
-
} else if (isGlob === true) {
|
|
170127
|
-
base = "";
|
|
170128
|
-
glob2 = str;
|
|
170129
|
-
} else {
|
|
170130
|
-
base = str;
|
|
170131
|
-
}
|
|
170132
|
-
if (base && base !== "" && base !== "/" && base !== str) {
|
|
170133
|
-
if (isPathSeparator(base.charCodeAt(base.length - 1))) {
|
|
170134
|
-
base = base.slice(0, -1);
|
|
170135
|
-
}
|
|
170136
|
-
}
|
|
170137
|
-
if (opts.unescape === true) {
|
|
170138
|
-
if (glob2)
|
|
170139
|
-
glob2 = utils.removeBackslashes(glob2);
|
|
170140
|
-
if (base && backslashes === true) {
|
|
170141
|
-
base = utils.removeBackslashes(base);
|
|
170142
|
-
}
|
|
170143
|
-
}
|
|
170144
|
-
const state = {
|
|
170145
|
-
prefix,
|
|
170146
|
-
input,
|
|
170147
|
-
start,
|
|
170148
|
-
base,
|
|
170149
|
-
glob: glob2,
|
|
170150
|
-
isBrace,
|
|
170151
|
-
isBracket,
|
|
170152
|
-
isGlob,
|
|
170153
|
-
isExtglob,
|
|
170154
|
-
isGlobstar,
|
|
170155
|
-
negated,
|
|
170156
|
-
negatedExtglob
|
|
170157
|
-
};
|
|
170158
|
-
if (opts.tokens === true) {
|
|
170159
|
-
state.maxDepth = 0;
|
|
170160
|
-
if (!isPathSeparator(code)) {
|
|
170161
|
-
tokens.push(token);
|
|
170162
|
-
}
|
|
170163
|
-
state.tokens = tokens;
|
|
170164
|
-
}
|
|
170165
|
-
if (opts.parts === true || opts.tokens === true) {
|
|
170166
|
-
let prevIndex;
|
|
170167
|
-
for (let idx = 0;idx < slashes.length; idx++) {
|
|
170168
|
-
const n = prevIndex ? prevIndex + 1 : start;
|
|
170169
|
-
const i = slashes[idx];
|
|
170170
|
-
const value = input.slice(n, i);
|
|
170171
|
-
if (opts.tokens) {
|
|
170172
|
-
if (idx === 0 && start !== 0) {
|
|
170173
|
-
tokens[idx].isPrefix = true;
|
|
170174
|
-
tokens[idx].value = prefix;
|
|
170175
|
-
} else {
|
|
170176
|
-
tokens[idx].value = value;
|
|
170177
|
-
}
|
|
170178
|
-
depth(tokens[idx]);
|
|
170179
|
-
state.maxDepth += tokens[idx].depth;
|
|
170180
|
-
}
|
|
170181
|
-
if (idx !== 0 || value !== "") {
|
|
170182
|
-
parts.push(value);
|
|
170183
|
-
}
|
|
170184
|
-
prevIndex = i;
|
|
170185
|
-
}
|
|
170186
|
-
if (prevIndex && prevIndex + 1 < input.length) {
|
|
170187
|
-
const value = input.slice(prevIndex + 1);
|
|
170188
|
-
parts.push(value);
|
|
170189
|
-
if (opts.tokens) {
|
|
170190
|
-
tokens[tokens.length - 1].value = value;
|
|
170191
|
-
depth(tokens[tokens.length - 1]);
|
|
170192
|
-
state.maxDepth += tokens[tokens.length - 1].depth;
|
|
170193
|
-
}
|
|
170194
|
-
}
|
|
170195
|
-
state.slashes = slashes;
|
|
170196
|
-
state.parts = parts;
|
|
170197
|
-
}
|
|
170198
|
-
return state;
|
|
170199
|
-
};
|
|
170200
|
-
module.exports = scan;
|
|
170201
|
-
});
|
|
170202
|
-
|
|
170203
|
-
// ../../node_modules/anymatch/node_modules/picomatch/lib/parse.js
|
|
170204
|
-
var require_parse2 = __commonJS((exports, module) => {
|
|
170205
|
-
var constants = require_constants2();
|
|
170206
|
-
var utils = require_utils2();
|
|
170207
|
-
var {
|
|
170208
|
-
MAX_LENGTH,
|
|
170209
|
-
POSIX_REGEX_SOURCE,
|
|
170210
|
-
REGEX_NON_SPECIAL_CHARS,
|
|
170211
|
-
REGEX_SPECIAL_CHARS_BACKREF,
|
|
170212
|
-
REPLACEMENTS
|
|
170213
|
-
} = constants;
|
|
170214
|
-
var expandRange = (args, options) => {
|
|
170215
|
-
if (typeof options.expandRange === "function") {
|
|
170216
|
-
return options.expandRange(...args, options);
|
|
170217
|
-
}
|
|
170218
|
-
args.sort();
|
|
170219
|
-
const value = `[${args.join("-")}]`;
|
|
170220
|
-
try {
|
|
170221
|
-
new RegExp(value);
|
|
170222
|
-
} catch (ex) {
|
|
170223
|
-
return args.map((v) => utils.escapeRegex(v)).join("..");
|
|
170224
|
-
}
|
|
170225
|
-
return value;
|
|
170226
|
-
};
|
|
170227
|
-
var syntaxError = (type, char) => {
|
|
170228
|
-
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
170229
|
-
};
|
|
170230
|
-
var parse = (input, options) => {
|
|
170231
|
-
if (typeof input !== "string") {
|
|
170232
|
-
throw new TypeError("Expected a string");
|
|
170233
|
-
}
|
|
170234
|
-
input = REPLACEMENTS[input] || input;
|
|
170235
|
-
const opts = { ...options };
|
|
170236
|
-
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
170237
|
-
let len = input.length;
|
|
170238
|
-
if (len > max) {
|
|
170239
|
-
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
170240
|
-
}
|
|
170241
|
-
const bos = { type: "bos", value: "", output: opts.prepend || "" };
|
|
170242
|
-
const tokens = [bos];
|
|
170243
|
-
const capture = opts.capture ? "" : "?:";
|
|
170244
|
-
const win322 = utils.isWindows(options);
|
|
170245
|
-
const PLATFORM_CHARS = constants.globChars(win322);
|
|
170246
|
-
const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
|
|
170247
|
-
const {
|
|
170248
|
-
DOT_LITERAL,
|
|
170249
|
-
PLUS_LITERAL,
|
|
170250
|
-
SLASH_LITERAL,
|
|
170251
|
-
ONE_CHAR,
|
|
170252
|
-
DOTS_SLASH,
|
|
170253
|
-
NO_DOT,
|
|
170254
|
-
NO_DOT_SLASH,
|
|
170255
|
-
NO_DOTS_SLASH,
|
|
170256
|
-
QMARK,
|
|
170257
|
-
QMARK_NO_DOT,
|
|
170258
|
-
STAR,
|
|
170259
|
-
START_ANCHOR
|
|
170260
|
-
} = PLATFORM_CHARS;
|
|
170261
|
-
const globstar = (opts2) => {
|
|
170262
|
-
return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
170263
|
-
};
|
|
170264
|
-
const nodot = opts.dot ? "" : NO_DOT;
|
|
170265
|
-
const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
|
|
170266
|
-
let star3 = opts.bash === true ? globstar(opts) : STAR;
|
|
170267
|
-
if (opts.capture) {
|
|
170268
|
-
star3 = `(${star3})`;
|
|
170269
|
-
}
|
|
170270
|
-
if (typeof opts.noext === "boolean") {
|
|
170271
|
-
opts.noextglob = opts.noext;
|
|
170272
|
-
}
|
|
170273
|
-
const state = {
|
|
170274
|
-
input,
|
|
170275
|
-
index: -1,
|
|
170276
|
-
start: 0,
|
|
170277
|
-
dot: opts.dot === true,
|
|
170278
|
-
consumed: "",
|
|
170279
|
-
output: "",
|
|
170280
|
-
prefix: "",
|
|
170281
|
-
backtrack: false,
|
|
170282
|
-
negated: false,
|
|
170283
|
-
brackets: 0,
|
|
170284
|
-
braces: 0,
|
|
170285
|
-
parens: 0,
|
|
170286
|
-
quotes: 0,
|
|
170287
|
-
globstar: false,
|
|
170288
|
-
tokens
|
|
170289
|
-
};
|
|
170290
|
-
input = utils.removePrefix(input, state);
|
|
170291
|
-
len = input.length;
|
|
170292
|
-
const extglobs = [];
|
|
170293
|
-
const braces = [];
|
|
170294
|
-
const stack = [];
|
|
170295
|
-
let prev = bos;
|
|
170296
|
-
let value;
|
|
170297
|
-
const eos = () => state.index === len - 1;
|
|
170298
|
-
const peek = state.peek = (n = 1) => input[state.index + n];
|
|
170299
|
-
const advance = state.advance = () => input[++state.index] || "";
|
|
170300
|
-
const remaining = () => input.slice(state.index + 1);
|
|
170301
|
-
const consume = (value2 = "", num = 0) => {
|
|
170302
|
-
state.consumed += value2;
|
|
170303
|
-
state.index += num;
|
|
170304
|
-
};
|
|
170305
|
-
const append = (token) => {
|
|
170306
|
-
state.output += token.output != null ? token.output : token.value;
|
|
170307
|
-
consume(token.value);
|
|
170308
|
-
};
|
|
170309
|
-
const negate = () => {
|
|
170310
|
-
let count = 1;
|
|
170311
|
-
while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
|
|
170312
|
-
advance();
|
|
170313
|
-
state.start++;
|
|
170314
|
-
count++;
|
|
170315
|
-
}
|
|
170316
|
-
if (count % 2 === 0) {
|
|
170317
|
-
return false;
|
|
170318
|
-
}
|
|
170319
|
-
state.negated = true;
|
|
170320
|
-
state.start++;
|
|
170321
|
-
return true;
|
|
170322
|
-
};
|
|
170323
|
-
const increment = (type) => {
|
|
170324
|
-
state[type]++;
|
|
170325
|
-
stack.push(type);
|
|
170326
|
-
};
|
|
170327
|
-
const decrement = (type) => {
|
|
170328
|
-
state[type]--;
|
|
170329
|
-
stack.pop();
|
|
170330
|
-
};
|
|
170331
|
-
const push = (tok) => {
|
|
170332
|
-
if (prev.type === "globstar") {
|
|
170333
|
-
const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
|
|
170334
|
-
const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
|
|
170335
|
-
if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
|
|
170336
|
-
state.output = state.output.slice(0, -prev.output.length);
|
|
170337
|
-
prev.type = "star";
|
|
170338
|
-
prev.value = "*";
|
|
170339
|
-
prev.output = star3;
|
|
170340
|
-
state.output += prev.output;
|
|
170341
|
-
}
|
|
170342
|
-
}
|
|
170343
|
-
if (extglobs.length && tok.type !== "paren") {
|
|
170344
|
-
extglobs[extglobs.length - 1].inner += tok.value;
|
|
170345
|
-
}
|
|
170346
|
-
if (tok.value || tok.output)
|
|
170347
|
-
append(tok);
|
|
170348
|
-
if (prev && prev.type === "text" && tok.type === "text") {
|
|
170349
|
-
prev.value += tok.value;
|
|
170350
|
-
prev.output = (prev.output || "") + tok.value;
|
|
170351
|
-
return;
|
|
170352
|
-
}
|
|
170353
|
-
tok.prev = prev;
|
|
170354
|
-
tokens.push(tok);
|
|
170355
|
-
prev = tok;
|
|
170356
|
-
};
|
|
170357
|
-
const extglobOpen = (type, value2) => {
|
|
170358
|
-
const token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
|
|
170359
|
-
token.prev = prev;
|
|
170360
|
-
token.parens = state.parens;
|
|
170361
|
-
token.output = state.output;
|
|
170362
|
-
const output = (opts.capture ? "(" : "") + token.open;
|
|
170363
|
-
increment("parens");
|
|
170364
|
-
push({ type, value: value2, output: state.output ? "" : ONE_CHAR });
|
|
170365
|
-
push({ type: "paren", extglob: true, value: advance(), output });
|
|
170366
|
-
extglobs.push(token);
|
|
170367
|
-
};
|
|
170368
|
-
const extglobClose = (token) => {
|
|
170369
|
-
let output = token.close + (opts.capture ? ")" : "");
|
|
170370
|
-
let rest;
|
|
170371
|
-
if (token.type === "negate") {
|
|
170372
|
-
let extglobStar = star3;
|
|
170373
|
-
if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
|
|
170374
|
-
extglobStar = globstar(opts);
|
|
170375
|
-
}
|
|
170376
|
-
if (extglobStar !== star3 || eos() || /^\)+$/.test(remaining())) {
|
|
170377
|
-
output = token.close = `)$))${extglobStar}`;
|
|
170378
|
-
}
|
|
170379
|
-
if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
170380
|
-
const expression = parse(rest, { ...options, fastpaths: false }).output;
|
|
170381
|
-
output = token.close = `)${expression})${extglobStar})`;
|
|
170382
|
-
}
|
|
170383
|
-
if (token.prev.type === "bos") {
|
|
170384
|
-
state.negatedExtglob = true;
|
|
170385
|
-
}
|
|
170386
|
-
}
|
|
170387
|
-
push({ type: "paren", extglob: true, value, output });
|
|
170388
|
-
decrement("parens");
|
|
170389
|
-
};
|
|
170390
|
-
if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
170391
|
-
let backslashes = false;
|
|
170392
|
-
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
|
|
170393
|
-
if (first === "\\") {
|
|
170394
|
-
backslashes = true;
|
|
170395
|
-
return m;
|
|
170396
|
-
}
|
|
170397
|
-
if (first === "?") {
|
|
170398
|
-
if (esc) {
|
|
170399
|
-
return esc + first + (rest ? QMARK.repeat(rest.length) : "");
|
|
170400
|
-
}
|
|
170401
|
-
if (index === 0) {
|
|
170402
|
-
return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
|
|
170403
|
-
}
|
|
170404
|
-
return QMARK.repeat(chars.length);
|
|
170405
|
-
}
|
|
170406
|
-
if (first === ".") {
|
|
170407
|
-
return DOT_LITERAL.repeat(chars.length);
|
|
170408
|
-
}
|
|
170409
|
-
if (first === "*") {
|
|
170410
|
-
if (esc) {
|
|
170411
|
-
return esc + first + (rest ? star3 : "");
|
|
170412
|
-
}
|
|
170413
|
-
return star3;
|
|
170414
|
-
}
|
|
170415
|
-
return esc ? m : `\\${m}`;
|
|
170416
|
-
});
|
|
170417
|
-
if (backslashes === true) {
|
|
170418
|
-
if (opts.unescape === true) {
|
|
170419
|
-
output = output.replace(/\\/g, "");
|
|
170420
|
-
} else {
|
|
170421
|
-
output = output.replace(/\\+/g, (m) => {
|
|
170422
|
-
return m.length % 2 === 0 ? "\\\\" : m ? "\\" : "";
|
|
170423
|
-
});
|
|
170424
|
-
}
|
|
170425
|
-
}
|
|
170426
|
-
if (output === input && opts.contains === true) {
|
|
170427
|
-
state.output = input;
|
|
170428
|
-
return state;
|
|
170429
|
-
}
|
|
170430
|
-
state.output = utils.wrapOutput(output, state, options);
|
|
170431
|
-
return state;
|
|
170432
|
-
}
|
|
170433
|
-
while (!eos()) {
|
|
170434
|
-
value = advance();
|
|
170435
|
-
if (value === "\x00") {
|
|
170436
|
-
continue;
|
|
170437
|
-
}
|
|
170438
|
-
if (value === "\\") {
|
|
170439
|
-
const next = peek();
|
|
170440
|
-
if (next === "/" && opts.bash !== true) {
|
|
170441
|
-
continue;
|
|
170442
|
-
}
|
|
170443
|
-
if (next === "." || next === ";") {
|
|
170444
|
-
continue;
|
|
170445
|
-
}
|
|
170446
|
-
if (!next) {
|
|
170447
|
-
value += "\\";
|
|
170448
|
-
push({ type: "text", value });
|
|
170449
|
-
continue;
|
|
170450
|
-
}
|
|
170451
|
-
const match2 = /^\\+/.exec(remaining());
|
|
170452
|
-
let slashes = 0;
|
|
170453
|
-
if (match2 && match2[0].length > 2) {
|
|
170454
|
-
slashes = match2[0].length;
|
|
170455
|
-
state.index += slashes;
|
|
170456
|
-
if (slashes % 2 !== 0) {
|
|
170457
|
-
value += "\\";
|
|
170458
|
-
}
|
|
170459
|
-
}
|
|
170460
|
-
if (opts.unescape === true) {
|
|
170461
|
-
value = advance();
|
|
170462
|
-
} else {
|
|
170463
|
-
value += advance();
|
|
170464
|
-
}
|
|
170465
|
-
if (state.brackets === 0) {
|
|
170466
|
-
push({ type: "text", value });
|
|
170467
|
-
continue;
|
|
170468
|
-
}
|
|
170469
|
-
}
|
|
170470
|
-
if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
|
|
170471
|
-
if (opts.posix !== false && value === ":") {
|
|
170472
|
-
const inner = prev.value.slice(1);
|
|
170473
|
-
if (inner.includes("[")) {
|
|
170474
|
-
prev.posix = true;
|
|
170475
|
-
if (inner.includes(":")) {
|
|
170476
|
-
const idx = prev.value.lastIndexOf("[");
|
|
170477
|
-
const pre = prev.value.slice(0, idx);
|
|
170478
|
-
const rest2 = prev.value.slice(idx + 2);
|
|
170479
|
-
const posix2 = POSIX_REGEX_SOURCE[rest2];
|
|
170480
|
-
if (posix2) {
|
|
170481
|
-
prev.value = pre + posix2;
|
|
170482
|
-
state.backtrack = true;
|
|
170483
|
-
advance();
|
|
170484
|
-
if (!bos.output && tokens.indexOf(prev) === 1) {
|
|
170485
|
-
bos.output = ONE_CHAR;
|
|
170486
|
-
}
|
|
170487
|
-
continue;
|
|
170488
|
-
}
|
|
170489
|
-
}
|
|
170490
|
-
}
|
|
170491
|
-
}
|
|
170492
|
-
if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
|
|
170493
|
-
value = `\\${value}`;
|
|
170494
|
-
}
|
|
170495
|
-
if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
|
|
170496
|
-
value = `\\${value}`;
|
|
170497
|
-
}
|
|
170498
|
-
if (opts.posix === true && value === "!" && prev.value === "[") {
|
|
170499
|
-
value = "^";
|
|
170500
|
-
}
|
|
170501
|
-
prev.value += value;
|
|
170502
|
-
append({ value });
|
|
170503
|
-
continue;
|
|
170504
|
-
}
|
|
170505
|
-
if (state.quotes === 1 && value !== '"') {
|
|
170506
|
-
value = utils.escapeRegex(value);
|
|
170507
|
-
prev.value += value;
|
|
170508
|
-
append({ value });
|
|
170509
|
-
continue;
|
|
170510
|
-
}
|
|
170511
|
-
if (value === '"') {
|
|
170512
|
-
state.quotes = state.quotes === 1 ? 0 : 1;
|
|
170513
|
-
if (opts.keepQuotes === true) {
|
|
170514
|
-
push({ type: "text", value });
|
|
170515
|
-
}
|
|
170516
|
-
continue;
|
|
170517
|
-
}
|
|
170518
|
-
if (value === "(") {
|
|
170519
|
-
increment("parens");
|
|
170520
|
-
push({ type: "paren", value });
|
|
170521
|
-
continue;
|
|
170522
|
-
}
|
|
170523
|
-
if (value === ")") {
|
|
170524
|
-
if (state.parens === 0 && opts.strictBrackets === true) {
|
|
170525
|
-
throw new SyntaxError(syntaxError("opening", "("));
|
|
170526
|
-
}
|
|
170527
|
-
const extglob = extglobs[extglobs.length - 1];
|
|
170528
|
-
if (extglob && state.parens === extglob.parens + 1) {
|
|
170529
|
-
extglobClose(extglobs.pop());
|
|
170530
|
-
continue;
|
|
170531
|
-
}
|
|
170532
|
-
push({ type: "paren", value, output: state.parens ? ")" : "\\)" });
|
|
170533
|
-
decrement("parens");
|
|
170534
|
-
continue;
|
|
170535
|
-
}
|
|
170536
|
-
if (value === "[") {
|
|
170537
|
-
if (opts.nobracket === true || !remaining().includes("]")) {
|
|
170538
|
-
if (opts.nobracket !== true && opts.strictBrackets === true) {
|
|
170539
|
-
throw new SyntaxError(syntaxError("closing", "]"));
|
|
170540
|
-
}
|
|
170541
|
-
value = `\\${value}`;
|
|
170542
|
-
} else {
|
|
170543
|
-
increment("brackets");
|
|
170544
|
-
}
|
|
170545
|
-
push({ type: "bracket", value });
|
|
170546
|
-
continue;
|
|
170547
|
-
}
|
|
170548
|
-
if (value === "]") {
|
|
170549
|
-
if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
|
|
170550
|
-
push({ type: "text", value, output: `\\${value}` });
|
|
170551
|
-
continue;
|
|
170552
|
-
}
|
|
170553
|
-
if (state.brackets === 0) {
|
|
170554
|
-
if (opts.strictBrackets === true) {
|
|
170555
|
-
throw new SyntaxError(syntaxError("opening", "["));
|
|
170556
|
-
}
|
|
170557
|
-
push({ type: "text", value, output: `\\${value}` });
|
|
170558
|
-
continue;
|
|
170559
|
-
}
|
|
170560
|
-
decrement("brackets");
|
|
170561
|
-
const prevValue = prev.value.slice(1);
|
|
170562
|
-
if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
|
|
170563
|
-
value = `/${value}`;
|
|
170564
|
-
}
|
|
170565
|
-
prev.value += value;
|
|
170566
|
-
append({ value });
|
|
170567
|
-
if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
|
|
170568
|
-
continue;
|
|
170569
|
-
}
|
|
170570
|
-
const escaped = utils.escapeRegex(prev.value);
|
|
170571
|
-
state.output = state.output.slice(0, -prev.value.length);
|
|
170572
|
-
if (opts.literalBrackets === true) {
|
|
170573
|
-
state.output += escaped;
|
|
170574
|
-
prev.value = escaped;
|
|
170575
|
-
continue;
|
|
170576
|
-
}
|
|
170577
|
-
prev.value = `(${capture}${escaped}|${prev.value})`;
|
|
170578
|
-
state.output += prev.value;
|
|
170579
|
-
continue;
|
|
170580
|
-
}
|
|
170581
|
-
if (value === "{" && opts.nobrace !== true) {
|
|
170582
|
-
increment("braces");
|
|
170583
|
-
const open = {
|
|
170584
|
-
type: "brace",
|
|
170585
|
-
value,
|
|
170586
|
-
output: "(",
|
|
170587
|
-
outputIndex: state.output.length,
|
|
170588
|
-
tokensIndex: state.tokens.length
|
|
170589
|
-
};
|
|
170590
|
-
braces.push(open);
|
|
170591
|
-
push(open);
|
|
170592
|
-
continue;
|
|
170593
|
-
}
|
|
170594
|
-
if (value === "}") {
|
|
170595
|
-
const brace = braces[braces.length - 1];
|
|
170596
|
-
if (opts.nobrace === true || !brace) {
|
|
170597
|
-
push({ type: "text", value, output: value });
|
|
170598
|
-
continue;
|
|
170599
|
-
}
|
|
170600
|
-
let output = ")";
|
|
170601
|
-
if (brace.dots === true) {
|
|
170602
|
-
const arr = tokens.slice();
|
|
170603
|
-
const range = [];
|
|
170604
|
-
for (let i = arr.length - 1;i >= 0; i--) {
|
|
170605
|
-
tokens.pop();
|
|
170606
|
-
if (arr[i].type === "brace") {
|
|
170607
|
-
break;
|
|
170608
|
-
}
|
|
170609
|
-
if (arr[i].type !== "dots") {
|
|
170610
|
-
range.unshift(arr[i].value);
|
|
170611
|
-
}
|
|
170612
|
-
}
|
|
170613
|
-
output = expandRange(range, opts);
|
|
170614
|
-
state.backtrack = true;
|
|
170615
|
-
}
|
|
170616
|
-
if (brace.comma !== true && brace.dots !== true) {
|
|
170617
|
-
const out = state.output.slice(0, brace.outputIndex);
|
|
170618
|
-
const toks = state.tokens.slice(brace.tokensIndex);
|
|
170619
|
-
brace.value = brace.output = "\\{";
|
|
170620
|
-
value = output = "\\}";
|
|
170621
|
-
state.output = out;
|
|
170622
|
-
for (const t of toks) {
|
|
170623
|
-
state.output += t.output || t.value;
|
|
170624
|
-
}
|
|
170625
|
-
}
|
|
170626
|
-
push({ type: "brace", value, output });
|
|
170627
|
-
decrement("braces");
|
|
170628
|
-
braces.pop();
|
|
170629
|
-
continue;
|
|
170630
|
-
}
|
|
170631
|
-
if (value === "|") {
|
|
170632
|
-
if (extglobs.length > 0) {
|
|
170633
|
-
extglobs[extglobs.length - 1].conditions++;
|
|
170634
|
-
}
|
|
170635
|
-
push({ type: "text", value });
|
|
170636
|
-
continue;
|
|
170637
|
-
}
|
|
170638
|
-
if (value === ",") {
|
|
170639
|
-
let output = value;
|
|
170640
|
-
const brace = braces[braces.length - 1];
|
|
170641
|
-
if (brace && stack[stack.length - 1] === "braces") {
|
|
170642
|
-
brace.comma = true;
|
|
170643
|
-
output = "|";
|
|
170644
|
-
}
|
|
170645
|
-
push({ type: "comma", value, output });
|
|
170646
|
-
continue;
|
|
170647
|
-
}
|
|
170648
|
-
if (value === "/") {
|
|
170649
|
-
if (prev.type === "dot" && state.index === state.start + 1) {
|
|
170650
|
-
state.start = state.index + 1;
|
|
170651
|
-
state.consumed = "";
|
|
170652
|
-
state.output = "";
|
|
170653
|
-
tokens.pop();
|
|
170654
|
-
prev = bos;
|
|
170655
|
-
continue;
|
|
170656
|
-
}
|
|
170657
|
-
push({ type: "slash", value, output: SLASH_LITERAL });
|
|
170658
|
-
continue;
|
|
170659
|
-
}
|
|
170660
|
-
if (value === ".") {
|
|
170661
|
-
if (state.braces > 0 && prev.type === "dot") {
|
|
170662
|
-
if (prev.value === ".")
|
|
170663
|
-
prev.output = DOT_LITERAL;
|
|
170664
|
-
const brace = braces[braces.length - 1];
|
|
170665
|
-
prev.type = "dots";
|
|
170666
|
-
prev.output += value;
|
|
170667
|
-
prev.value += value;
|
|
170668
|
-
brace.dots = true;
|
|
170669
|
-
continue;
|
|
170670
|
-
}
|
|
170671
|
-
if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
|
|
170672
|
-
push({ type: "text", value, output: DOT_LITERAL });
|
|
170673
|
-
continue;
|
|
170674
|
-
}
|
|
170675
|
-
push({ type: "dot", value, output: DOT_LITERAL });
|
|
170676
|
-
continue;
|
|
170677
|
-
}
|
|
170678
|
-
if (value === "?") {
|
|
170679
|
-
const isGroup = prev && prev.value === "(";
|
|
170680
|
-
if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
170681
|
-
extglobOpen("qmark", value);
|
|
170682
|
-
continue;
|
|
170683
|
-
}
|
|
170684
|
-
if (prev && prev.type === "paren") {
|
|
170685
|
-
const next = peek();
|
|
170686
|
-
let output = value;
|
|
170687
|
-
if (next === "<" && !utils.supportsLookbehinds()) {
|
|
170688
|
-
throw new Error("Node.js v10 or higher is required for regex lookbehinds");
|
|
170689
|
-
}
|
|
170690
|
-
if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
|
|
170691
|
-
output = `\\${value}`;
|
|
170692
|
-
}
|
|
170693
|
-
push({ type: "text", value, output });
|
|
170694
|
-
continue;
|
|
170695
|
-
}
|
|
170696
|
-
if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
|
|
170697
|
-
push({ type: "qmark", value, output: QMARK_NO_DOT });
|
|
170698
|
-
continue;
|
|
170699
|
-
}
|
|
170700
|
-
push({ type: "qmark", value, output: QMARK });
|
|
170701
|
-
continue;
|
|
170702
|
-
}
|
|
170703
|
-
if (value === "!") {
|
|
170704
|
-
if (opts.noextglob !== true && peek() === "(") {
|
|
170705
|
-
if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
|
|
170706
|
-
extglobOpen("negate", value);
|
|
170707
|
-
continue;
|
|
170708
|
-
}
|
|
170709
|
-
}
|
|
170710
|
-
if (opts.nonegate !== true && state.index === 0) {
|
|
170711
|
-
negate();
|
|
170712
|
-
continue;
|
|
170713
|
-
}
|
|
170714
|
-
}
|
|
170715
|
-
if (value === "+") {
|
|
170716
|
-
if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
170717
|
-
extglobOpen("plus", value);
|
|
170718
|
-
continue;
|
|
170719
|
-
}
|
|
170720
|
-
if (prev && prev.value === "(" || opts.regex === false) {
|
|
170721
|
-
push({ type: "plus", value, output: PLUS_LITERAL });
|
|
170722
|
-
continue;
|
|
170723
|
-
}
|
|
170724
|
-
if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
|
|
170725
|
-
push({ type: "plus", value });
|
|
170726
|
-
continue;
|
|
170727
|
-
}
|
|
170728
|
-
push({ type: "plus", value: PLUS_LITERAL });
|
|
170729
|
-
continue;
|
|
170730
|
-
}
|
|
170731
|
-
if (value === "@") {
|
|
170732
|
-
if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
170733
|
-
push({ type: "at", extglob: true, value, output: "" });
|
|
170734
|
-
continue;
|
|
170735
|
-
}
|
|
170736
|
-
push({ type: "text", value });
|
|
170737
|
-
continue;
|
|
170738
|
-
}
|
|
170739
|
-
if (value !== "*") {
|
|
170740
|
-
if (value === "$" || value === "^") {
|
|
170741
|
-
value = `\\${value}`;
|
|
170742
|
-
}
|
|
170743
|
-
const match2 = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
170744
|
-
if (match2) {
|
|
170745
|
-
value += match2[0];
|
|
170746
|
-
state.index += match2[0].length;
|
|
170747
|
-
}
|
|
170748
|
-
push({ type: "text", value });
|
|
170749
|
-
continue;
|
|
170750
|
-
}
|
|
170751
|
-
if (prev && (prev.type === "globstar" || prev.star === true)) {
|
|
170752
|
-
prev.type = "star";
|
|
170753
|
-
prev.star = true;
|
|
170754
|
-
prev.value += value;
|
|
170755
|
-
prev.output = star3;
|
|
170756
|
-
state.backtrack = true;
|
|
170757
|
-
state.globstar = true;
|
|
170758
|
-
consume(value);
|
|
170759
|
-
continue;
|
|
170760
|
-
}
|
|
170761
|
-
let rest = remaining();
|
|
170762
|
-
if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
|
|
170763
|
-
extglobOpen("star", value);
|
|
170764
|
-
continue;
|
|
170765
|
-
}
|
|
170766
|
-
if (prev.type === "star") {
|
|
170767
|
-
if (opts.noglobstar === true) {
|
|
170768
|
-
consume(value);
|
|
170769
|
-
continue;
|
|
170770
|
-
}
|
|
170771
|
-
const prior = prev.prev;
|
|
170772
|
-
const before = prior.prev;
|
|
170773
|
-
const isStart = prior.type === "slash" || prior.type === "bos";
|
|
170774
|
-
const afterStar = before && (before.type === "star" || before.type === "globstar");
|
|
170775
|
-
if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
|
|
170776
|
-
push({ type: "star", value, output: "" });
|
|
170777
|
-
continue;
|
|
170778
|
-
}
|
|
170779
|
-
const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
|
|
170780
|
-
const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
|
|
170781
|
-
if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
|
|
170782
|
-
push({ type: "star", value, output: "" });
|
|
170783
|
-
continue;
|
|
170784
|
-
}
|
|
170785
|
-
while (rest.slice(0, 3) === "/**") {
|
|
170786
|
-
const after = input[state.index + 4];
|
|
170787
|
-
if (after && after !== "/") {
|
|
170788
|
-
break;
|
|
170789
|
-
}
|
|
170790
|
-
rest = rest.slice(3);
|
|
170791
|
-
consume("/**", 3);
|
|
170792
|
-
}
|
|
170793
|
-
if (prior.type === "bos" && eos()) {
|
|
170794
|
-
prev.type = "globstar";
|
|
170795
|
-
prev.value += value;
|
|
170796
|
-
prev.output = globstar(opts);
|
|
170797
|
-
state.output = prev.output;
|
|
170798
|
-
state.globstar = true;
|
|
170799
|
-
consume(value);
|
|
170800
|
-
continue;
|
|
170801
|
-
}
|
|
170802
|
-
if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
|
|
170803
|
-
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
170804
|
-
prior.output = `(?:${prior.output}`;
|
|
170805
|
-
prev.type = "globstar";
|
|
170806
|
-
prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
|
|
170807
|
-
prev.value += value;
|
|
170808
|
-
state.globstar = true;
|
|
170809
|
-
state.output += prior.output + prev.output;
|
|
170810
|
-
consume(value);
|
|
170811
|
-
continue;
|
|
170812
|
-
}
|
|
170813
|
-
if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
|
|
170814
|
-
const end = rest[1] !== undefined ? "|$" : "";
|
|
170815
|
-
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
170816
|
-
prior.output = `(?:${prior.output}`;
|
|
170817
|
-
prev.type = "globstar";
|
|
170818
|
-
prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
|
|
170819
|
-
prev.value += value;
|
|
170820
|
-
state.output += prior.output + prev.output;
|
|
170821
|
-
state.globstar = true;
|
|
170822
|
-
consume(value + advance());
|
|
170823
|
-
push({ type: "slash", value: "/", output: "" });
|
|
170824
|
-
continue;
|
|
170825
|
-
}
|
|
170826
|
-
if (prior.type === "bos" && rest[0] === "/") {
|
|
170827
|
-
prev.type = "globstar";
|
|
170828
|
-
prev.value += value;
|
|
170829
|
-
prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
|
|
170830
|
-
state.output = prev.output;
|
|
170831
|
-
state.globstar = true;
|
|
170832
|
-
consume(value + advance());
|
|
170833
|
-
push({ type: "slash", value: "/", output: "" });
|
|
170834
|
-
continue;
|
|
170835
|
-
}
|
|
170836
|
-
state.output = state.output.slice(0, -prev.output.length);
|
|
170837
|
-
prev.type = "globstar";
|
|
170838
|
-
prev.output = globstar(opts);
|
|
170839
|
-
prev.value += value;
|
|
170840
|
-
state.output += prev.output;
|
|
170841
|
-
state.globstar = true;
|
|
170842
|
-
consume(value);
|
|
170843
|
-
continue;
|
|
170844
|
-
}
|
|
170845
|
-
const token = { type: "star", value, output: star3 };
|
|
170846
|
-
if (opts.bash === true) {
|
|
170847
|
-
token.output = ".*?";
|
|
170848
|
-
if (prev.type === "bos" || prev.type === "slash") {
|
|
170849
|
-
token.output = nodot + token.output;
|
|
170850
|
-
}
|
|
170851
|
-
push(token);
|
|
170852
|
-
continue;
|
|
170853
|
-
}
|
|
170854
|
-
if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
|
|
170855
|
-
token.output = value;
|
|
170856
|
-
push(token);
|
|
170857
|
-
continue;
|
|
170858
|
-
}
|
|
170859
|
-
if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
|
|
170860
|
-
if (prev.type === "dot") {
|
|
170861
|
-
state.output += NO_DOT_SLASH;
|
|
170862
|
-
prev.output += NO_DOT_SLASH;
|
|
170863
|
-
} else if (opts.dot === true) {
|
|
170864
|
-
state.output += NO_DOTS_SLASH;
|
|
170865
|
-
prev.output += NO_DOTS_SLASH;
|
|
170866
|
-
} else {
|
|
170867
|
-
state.output += nodot;
|
|
170868
|
-
prev.output += nodot;
|
|
170869
|
-
}
|
|
170870
|
-
if (peek() !== "*") {
|
|
170871
|
-
state.output += ONE_CHAR;
|
|
170872
|
-
prev.output += ONE_CHAR;
|
|
170873
|
-
}
|
|
170874
|
-
}
|
|
170875
|
-
push(token);
|
|
170876
|
-
}
|
|
170877
|
-
while (state.brackets > 0) {
|
|
170878
|
-
if (opts.strictBrackets === true)
|
|
170879
|
-
throw new SyntaxError(syntaxError("closing", "]"));
|
|
170880
|
-
state.output = utils.escapeLast(state.output, "[");
|
|
170881
|
-
decrement("brackets");
|
|
170882
|
-
}
|
|
170883
|
-
while (state.parens > 0) {
|
|
170884
|
-
if (opts.strictBrackets === true)
|
|
170885
|
-
throw new SyntaxError(syntaxError("closing", ")"));
|
|
170886
|
-
state.output = utils.escapeLast(state.output, "(");
|
|
170887
|
-
decrement("parens");
|
|
170888
|
-
}
|
|
170889
|
-
while (state.braces > 0) {
|
|
170890
|
-
if (opts.strictBrackets === true)
|
|
170891
|
-
throw new SyntaxError(syntaxError("closing", "}"));
|
|
170892
|
-
state.output = utils.escapeLast(state.output, "{");
|
|
170893
|
-
decrement("braces");
|
|
170894
|
-
}
|
|
170895
|
-
if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
|
|
170896
|
-
push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` });
|
|
170897
|
-
}
|
|
170898
|
-
if (state.backtrack === true) {
|
|
170899
|
-
state.output = "";
|
|
170900
|
-
for (const token of state.tokens) {
|
|
170901
|
-
state.output += token.output != null ? token.output : token.value;
|
|
170902
|
-
if (token.suffix) {
|
|
170903
|
-
state.output += token.suffix;
|
|
170904
|
-
}
|
|
170905
|
-
}
|
|
170906
|
-
}
|
|
170907
|
-
return state;
|
|
170908
|
-
};
|
|
170909
|
-
parse.fastpaths = (input, options) => {
|
|
170910
|
-
const opts = { ...options };
|
|
170911
|
-
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
170912
|
-
const len = input.length;
|
|
170913
|
-
if (len > max) {
|
|
170914
|
-
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
170915
|
-
}
|
|
170916
|
-
input = REPLACEMENTS[input] || input;
|
|
170917
|
-
const win322 = utils.isWindows(options);
|
|
170918
|
-
const {
|
|
170919
|
-
DOT_LITERAL,
|
|
170920
|
-
SLASH_LITERAL,
|
|
170921
|
-
ONE_CHAR,
|
|
170922
|
-
DOTS_SLASH,
|
|
170923
|
-
NO_DOT,
|
|
170924
|
-
NO_DOTS,
|
|
170925
|
-
NO_DOTS_SLASH,
|
|
170926
|
-
STAR,
|
|
170927
|
-
START_ANCHOR
|
|
170928
|
-
} = constants.globChars(win322);
|
|
170929
|
-
const nodot = opts.dot ? NO_DOTS : NO_DOT;
|
|
170930
|
-
const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
|
170931
|
-
const capture = opts.capture ? "" : "?:";
|
|
170932
|
-
const state = { negated: false, prefix: "" };
|
|
170933
|
-
let star3 = opts.bash === true ? ".*?" : STAR;
|
|
170934
|
-
if (opts.capture) {
|
|
170935
|
-
star3 = `(${star3})`;
|
|
170936
|
-
}
|
|
170937
|
-
const globstar = (opts2) => {
|
|
170938
|
-
if (opts2.noglobstar === true)
|
|
170939
|
-
return star3;
|
|
170940
|
-
return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
170941
|
-
};
|
|
170942
|
-
const create = (str) => {
|
|
170943
|
-
switch (str) {
|
|
170944
|
-
case "*":
|
|
170945
|
-
return `${nodot}${ONE_CHAR}${star3}`;
|
|
170946
|
-
case ".*":
|
|
170947
|
-
return `${DOT_LITERAL}${ONE_CHAR}${star3}`;
|
|
170948
|
-
case "*.*":
|
|
170949
|
-
return `${nodot}${star3}${DOT_LITERAL}${ONE_CHAR}${star3}`;
|
|
170950
|
-
case "*/*":
|
|
170951
|
-
return `${nodot}${star3}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star3}`;
|
|
170952
|
-
case "**":
|
|
170953
|
-
return nodot + globstar(opts);
|
|
170954
|
-
case "**/*":
|
|
170955
|
-
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star3}`;
|
|
170956
|
-
case "**/*.*":
|
|
170957
|
-
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star3}${DOT_LITERAL}${ONE_CHAR}${star3}`;
|
|
170958
|
-
case "**/.*":
|
|
170959
|
-
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star3}`;
|
|
170960
|
-
default: {
|
|
170961
|
-
const match2 = /^(.*?)\.(\w+)$/.exec(str);
|
|
170962
|
-
if (!match2)
|
|
170963
|
-
return;
|
|
170964
|
-
const source2 = create(match2[1]);
|
|
170965
|
-
if (!source2)
|
|
170966
|
-
return;
|
|
170967
|
-
return source2 + DOT_LITERAL + match2[2];
|
|
170968
|
-
}
|
|
170969
|
-
}
|
|
170970
|
-
};
|
|
170971
|
-
const output = utils.removePrefix(input, state);
|
|
170972
|
-
let source = create(output);
|
|
170973
|
-
if (source && opts.strictSlashes !== true) {
|
|
170974
|
-
source += `${SLASH_LITERAL}?`;
|
|
170975
|
-
}
|
|
170976
|
-
return source;
|
|
170977
|
-
};
|
|
170978
|
-
module.exports = parse;
|
|
170979
|
-
});
|
|
170980
|
-
|
|
170981
|
-
// ../../node_modules/anymatch/node_modules/picomatch/lib/picomatch.js
|
|
170982
|
-
var require_picomatch2 = __commonJS((exports, module) => {
|
|
170983
|
-
var path4 = __require("path");
|
|
170984
|
-
var scan = require_scan2();
|
|
170985
|
-
var parse = require_parse2();
|
|
170986
|
-
var utils = require_utils2();
|
|
170987
|
-
var constants = require_constants2();
|
|
170988
|
-
var isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
|
|
170989
|
-
var picomatch = (glob2, options, returnState = false) => {
|
|
170990
|
-
if (Array.isArray(glob2)) {
|
|
170991
|
-
const fns = glob2.map((input) => picomatch(input, options, returnState));
|
|
170992
|
-
const arrayMatcher = (str) => {
|
|
170993
|
-
for (const isMatch of fns) {
|
|
170994
|
-
const state2 = isMatch(str);
|
|
170995
|
-
if (state2)
|
|
170996
|
-
return state2;
|
|
170997
|
-
}
|
|
170998
|
-
return false;
|
|
170999
|
-
};
|
|
171000
|
-
return arrayMatcher;
|
|
171001
|
-
}
|
|
171002
|
-
const isState = isObject(glob2) && glob2.tokens && glob2.input;
|
|
171003
|
-
if (glob2 === "" || typeof glob2 !== "string" && !isState) {
|
|
171004
|
-
throw new TypeError("Expected pattern to be a non-empty string");
|
|
171005
|
-
}
|
|
171006
|
-
const opts = options || {};
|
|
171007
|
-
const posix2 = utils.isWindows(options);
|
|
171008
|
-
const regex = isState ? picomatch.compileRe(glob2, options) : picomatch.makeRe(glob2, options, false, true);
|
|
171009
|
-
const state = regex.state;
|
|
171010
|
-
delete regex.state;
|
|
171011
|
-
let isIgnored = () => false;
|
|
171012
|
-
if (opts.ignore) {
|
|
171013
|
-
const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
|
171014
|
-
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
171015
|
-
}
|
|
171016
|
-
const matcher = (input, returnObject = false) => {
|
|
171017
|
-
const { isMatch, match: match2, output } = picomatch.test(input, regex, options, { glob: glob2, posix: posix2 });
|
|
171018
|
-
const result = { glob: glob2, state, regex, posix: posix2, input, output, match: match2, isMatch };
|
|
171019
|
-
if (typeof opts.onResult === "function") {
|
|
171020
|
-
opts.onResult(result);
|
|
171021
|
-
}
|
|
171022
|
-
if (isMatch === false) {
|
|
171023
|
-
result.isMatch = false;
|
|
171024
|
-
return returnObject ? result : false;
|
|
171025
|
-
}
|
|
171026
|
-
if (isIgnored(input)) {
|
|
171027
|
-
if (typeof opts.onIgnore === "function") {
|
|
171028
|
-
opts.onIgnore(result);
|
|
171029
|
-
}
|
|
171030
|
-
result.isMatch = false;
|
|
171031
|
-
return returnObject ? result : false;
|
|
171032
|
-
}
|
|
171033
|
-
if (typeof opts.onMatch === "function") {
|
|
171034
|
-
opts.onMatch(result);
|
|
171035
|
-
}
|
|
171036
|
-
return returnObject ? result : true;
|
|
171037
|
-
};
|
|
171038
|
-
if (returnState) {
|
|
171039
|
-
matcher.state = state;
|
|
171040
|
-
}
|
|
171041
|
-
return matcher;
|
|
171042
|
-
};
|
|
171043
|
-
picomatch.test = (input, regex, options, { glob: glob2, posix: posix2 } = {}) => {
|
|
171044
|
-
if (typeof input !== "string") {
|
|
171045
|
-
throw new TypeError("Expected input to be a string");
|
|
171046
|
-
}
|
|
171047
|
-
if (input === "") {
|
|
171048
|
-
return { isMatch: false, output: "" };
|
|
171049
|
-
}
|
|
171050
|
-
const opts = options || {};
|
|
171051
|
-
const format = opts.format || (posix2 ? utils.toPosixSlashes : null);
|
|
171052
|
-
let match2 = input === glob2;
|
|
171053
|
-
let output = match2 && format ? format(input) : input;
|
|
171054
|
-
if (match2 === false) {
|
|
171055
|
-
output = format ? format(input) : input;
|
|
171056
|
-
match2 = output === glob2;
|
|
171057
|
-
}
|
|
171058
|
-
if (match2 === false || opts.capture === true) {
|
|
171059
|
-
if (opts.matchBase === true || opts.basename === true) {
|
|
171060
|
-
match2 = picomatch.matchBase(input, regex, options, posix2);
|
|
171061
|
-
} else {
|
|
171062
|
-
match2 = regex.exec(output);
|
|
171063
|
-
}
|
|
171064
|
-
}
|
|
171065
|
-
return { isMatch: Boolean(match2), match: match2, output };
|
|
171066
|
-
};
|
|
171067
|
-
picomatch.matchBase = (input, glob2, options, posix2 = utils.isWindows(options)) => {
|
|
171068
|
-
const regex = glob2 instanceof RegExp ? glob2 : picomatch.makeRe(glob2, options);
|
|
171069
|
-
return regex.test(path4.basename(input));
|
|
171070
|
-
};
|
|
171071
|
-
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
171072
|
-
picomatch.parse = (pattern, options) => {
|
|
171073
|
-
if (Array.isArray(pattern))
|
|
171074
|
-
return pattern.map((p) => picomatch.parse(p, options));
|
|
171075
|
-
return parse(pattern, { ...options, fastpaths: false });
|
|
171076
|
-
};
|
|
171077
|
-
picomatch.scan = (input, options) => scan(input, options);
|
|
171078
|
-
picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
|
|
171079
|
-
if (returnOutput === true) {
|
|
171080
|
-
return state.output;
|
|
171081
|
-
}
|
|
171082
|
-
const opts = options || {};
|
|
171083
|
-
const prepend = opts.contains ? "" : "^";
|
|
171084
|
-
const append = opts.contains ? "" : "$";
|
|
171085
|
-
let source = `${prepend}(?:${state.output})${append}`;
|
|
171086
|
-
if (state && state.negated === true) {
|
|
171087
|
-
source = `^(?!${source}).*$`;
|
|
171088
|
-
}
|
|
171089
|
-
const regex = picomatch.toRegex(source, options);
|
|
171090
|
-
if (returnState === true) {
|
|
171091
|
-
regex.state = state;
|
|
171092
|
-
}
|
|
171093
|
-
return regex;
|
|
171094
|
-
};
|
|
171095
|
-
picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
|
|
171096
|
-
if (!input || typeof input !== "string") {
|
|
171097
|
-
throw new TypeError("Expected a non-empty string");
|
|
171098
|
-
}
|
|
171099
|
-
let parsed = { negated: false, fastpaths: true };
|
|
171100
|
-
if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
|
|
171101
|
-
parsed.output = parse.fastpaths(input, options);
|
|
171102
|
-
}
|
|
171103
|
-
if (!parsed.output) {
|
|
171104
|
-
parsed = parse(input, options);
|
|
171105
|
-
}
|
|
171106
|
-
return picomatch.compileRe(parsed, options, returnOutput, returnState);
|
|
171107
|
-
};
|
|
171108
|
-
picomatch.toRegex = (source, options) => {
|
|
171109
|
-
try {
|
|
171110
|
-
const opts = options || {};
|
|
171111
|
-
return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
|
|
171112
|
-
} catch (err) {
|
|
171113
|
-
if (options && options.debug === true)
|
|
171114
|
-
throw err;
|
|
171115
|
-
return /$^/;
|
|
171116
|
-
}
|
|
171117
|
-
};
|
|
171118
|
-
picomatch.constants = constants;
|
|
171119
|
-
module.exports = picomatch;
|
|
171120
|
-
});
|
|
171121
|
-
|
|
171122
169688
|
// ../../node_modules/normalize-path/index.js
|
|
171123
169689
|
var require_normalize_path = __commonJS((exports, module) => {
|
|
171124
169690
|
/*!
|
|
@@ -171155,7 +169721,7 @@ var require_normalize_path = __commonJS((exports, module) => {
|
|
|
171155
169721
|
// ../../node_modules/anymatch/index.js
|
|
171156
169722
|
var require_anymatch = __commonJS((exports, module) => {
|
|
171157
169723
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
171158
|
-
var picomatch =
|
|
169724
|
+
var picomatch = require_picomatch();
|
|
171159
169725
|
var normalizePath = require_normalize_path();
|
|
171160
169726
|
var BANG = "!";
|
|
171161
169727
|
var DEFAULT_OPTIONS = { returnIndex: false };
|
|
@@ -171400,7 +169966,7 @@ var require_glob_parent = __commonJS((exports, module) => {
|
|
|
171400
169966
|
});
|
|
171401
169967
|
|
|
171402
169968
|
// ../../node_modules/braces/lib/utils.js
|
|
171403
|
-
var
|
|
169969
|
+
var require_utils2 = __commonJS((exports) => {
|
|
171404
169970
|
exports.isInteger = (num) => {
|
|
171405
169971
|
if (typeof num === "number") {
|
|
171406
169972
|
return Number.isInteger(num);
|
|
@@ -171488,7 +170054,7 @@ var require_utils3 = __commonJS((exports) => {
|
|
|
171488
170054
|
|
|
171489
170055
|
// ../../node_modules/braces/lib/stringify.js
|
|
171490
170056
|
var require_stringify = __commonJS((exports, module) => {
|
|
171491
|
-
var utils =
|
|
170057
|
+
var utils = require_utils2();
|
|
171492
170058
|
module.exports = (ast, options = {}) => {
|
|
171493
170059
|
const stringify = (node, parent = {}) => {
|
|
171494
170060
|
const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
|
|
@@ -171960,7 +170526,7 @@ var require_fill_range = __commonJS((exports, module) => {
|
|
|
171960
170526
|
// ../../node_modules/braces/lib/compile.js
|
|
171961
170527
|
var require_compile = __commonJS((exports, module) => {
|
|
171962
170528
|
var fill = require_fill_range();
|
|
171963
|
-
var utils =
|
|
170529
|
+
var utils = require_utils2();
|
|
171964
170530
|
var compile = (ast, options = {}) => {
|
|
171965
170531
|
const walk = (node, parent = {}) => {
|
|
171966
170532
|
const invalidBlock = utils.isInvalidBrace(parent);
|
|
@@ -172010,7 +170576,7 @@ var require_compile = __commonJS((exports, module) => {
|
|
|
172010
170576
|
var require_expand = __commonJS((exports, module) => {
|
|
172011
170577
|
var fill = require_fill_range();
|
|
172012
170578
|
var stringify = require_stringify();
|
|
172013
|
-
var utils =
|
|
170579
|
+
var utils = require_utils2();
|
|
172014
170580
|
var append = (queue = "", stash = "", enclose = false) => {
|
|
172015
170581
|
const result = [];
|
|
172016
170582
|
queue = [].concat(queue);
|
|
@@ -172101,7 +170667,7 @@ var require_expand = __commonJS((exports, module) => {
|
|
|
172101
170667
|
});
|
|
172102
170668
|
|
|
172103
170669
|
// ../../node_modules/braces/lib/constants.js
|
|
172104
|
-
var
|
|
170670
|
+
var require_constants2 = __commonJS((exports, module) => {
|
|
172105
170671
|
module.exports = {
|
|
172106
170672
|
MAX_LENGTH: 1e4,
|
|
172107
170673
|
CHAR_0: "0",
|
|
@@ -172153,7 +170719,7 @@ var require_constants3 = __commonJS((exports, module) => {
|
|
|
172153
170719
|
});
|
|
172154
170720
|
|
|
172155
170721
|
// ../../node_modules/braces/lib/parse.js
|
|
172156
|
-
var
|
|
170722
|
+
var require_parse2 = __commonJS((exports, module) => {
|
|
172157
170723
|
var stringify = require_stringify();
|
|
172158
170724
|
var {
|
|
172159
170725
|
MAX_LENGTH,
|
|
@@ -172171,7 +170737,7 @@ var require_parse3 = __commonJS((exports, module) => {
|
|
|
172171
170737
|
CHAR_SINGLE_QUOTE,
|
|
172172
170738
|
CHAR_NO_BREAK_SPACE,
|
|
172173
170739
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE
|
|
172174
|
-
} =
|
|
170740
|
+
} = require_constants2();
|
|
172175
170741
|
var parse = (input, options = {}) => {
|
|
172176
170742
|
if (typeof input !== "string") {
|
|
172177
170743
|
throw new TypeError("Expected a string");
|
|
@@ -172384,7 +170950,7 @@ var require_braces = __commonJS((exports, module) => {
|
|
|
172384
170950
|
var stringify = require_stringify();
|
|
172385
170951
|
var compile = require_compile();
|
|
172386
170952
|
var expand2 = require_expand();
|
|
172387
|
-
var parse =
|
|
170953
|
+
var parse = require_parse2();
|
|
172388
170954
|
var braces = (input, options = {}) => {
|
|
172389
170955
|
let output = [];
|
|
172390
170956
|
if (Array.isArray(input)) {
|
|
@@ -172715,7 +171281,7 @@ var require_is_binary_path = __commonJS((exports, module) => {
|
|
|
172715
171281
|
});
|
|
172716
171282
|
|
|
172717
171283
|
// ../../node_modules/chokidar/lib/constants.js
|
|
172718
|
-
var
|
|
171284
|
+
var require_constants3 = __commonJS((exports) => {
|
|
172719
171285
|
var { sep: sep2 } = __require("path");
|
|
172720
171286
|
var { platform } = process;
|
|
172721
171287
|
var os = __require("os");
|
|
@@ -172797,7 +171363,7 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
172797
171363
|
STR_END,
|
|
172798
171364
|
BRACE_START,
|
|
172799
171365
|
STAR
|
|
172800
|
-
} =
|
|
171366
|
+
} = require_constants3();
|
|
172801
171367
|
var THROTTLE_MODE_WATCH = "watch";
|
|
172802
171368
|
var open = promisify(fs2.open);
|
|
172803
171369
|
var stat = promisify(fs2.stat);
|
|
@@ -173349,7 +171915,7 @@ var require_fsevents_handler = __commonJS((exports, module) => {
|
|
|
173349
171915
|
FUNCTION_TYPE,
|
|
173350
171916
|
EMPTY_FN,
|
|
173351
171917
|
IDENTITY_FN
|
|
173352
|
-
} =
|
|
171918
|
+
} = require_constants3();
|
|
173353
171919
|
var Depth = (value) => isNaN(value) ? {} : { depth: value };
|
|
173354
171920
|
var stat = promisify(fs2.stat);
|
|
173355
171921
|
var lstat2 = promisify(fs2.lstat);
|
|
@@ -173721,7 +172287,7 @@ var require_chokidar = __commonJS((exports) => {
|
|
|
173721
172287
|
isWindows,
|
|
173722
172288
|
isMacos,
|
|
173723
172289
|
isIBMi
|
|
173724
|
-
} =
|
|
172290
|
+
} = require_constants3();
|
|
173725
172291
|
var stat = promisify(fs2.stat);
|
|
173726
172292
|
var readdir2 = promisify(fs2.readdir);
|
|
173727
172293
|
var arrify = (value = []) => Array.isArray(value) ? value : [value];
|
|
@@ -174469,6 +173035,7 @@ import { dirname as dirname2 } from "path";
|
|
|
174469
173035
|
// src/utils/build.ts
|
|
174470
173036
|
var ts = __toESM(require_typescript(), 1);
|
|
174471
173037
|
import { spawn } from "child_process";
|
|
173038
|
+
import { readFileSync as readFileSync2 } from "fs";
|
|
174472
173039
|
import { dirname, join as join2 } from "path";
|
|
174473
173040
|
|
|
174474
173041
|
// src/utils/config.ts
|
|
@@ -179837,6 +178404,16 @@ function normalizeClientName(client) {
|
|
|
179837
178404
|
}
|
|
179838
178405
|
|
|
179839
178406
|
// src/utils/build.ts
|
|
178407
|
+
function getPeerDependencies(configDir) {
|
|
178408
|
+
try {
|
|
178409
|
+
const packageJsonPath = join2(configDir, "package.json");
|
|
178410
|
+
const packageJson = JSON.parse(readFileSync2(packageJsonPath, "utf-8"));
|
|
178411
|
+
return Object.keys(packageJson.peerDependencies || {});
|
|
178412
|
+
} catch (error) {
|
|
178413
|
+
console.warn("Could not read package.json or peerDependencies:", error);
|
|
178414
|
+
return [];
|
|
178415
|
+
}
|
|
178416
|
+
}
|
|
179840
178417
|
async function buildClient(configPath, config, client, watch = false) {
|
|
179841
178418
|
const configDir = dirname(configPath);
|
|
179842
178419
|
const { file, outDir } = config;
|
|
@@ -179849,9 +178426,12 @@ async function buildClient(configPath, config, client, watch = false) {
|
|
|
179849
178426
|
defineValues[`ONLY_${normalizedC}`] = c === client ? "true" : "false";
|
|
179850
178427
|
}
|
|
179851
178428
|
const defineArgs = Object.entries(defineValues).map(([key, value]) => `--define="${key}=${value}"`).join(" ");
|
|
178429
|
+
const peerDeps = getPeerDependencies(configDir);
|
|
178430
|
+
const externalArgs = peerDeps.length > 0 ? peerDeps.map((dep) => `--external=${dep}`).join(" ") + " " : "";
|
|
178431
|
+
const buildTarget = client === "browser" ? "browser" : "bun";
|
|
179852
178432
|
const filePath = join2(configDir, file);
|
|
179853
|
-
const
|
|
179854
|
-
const command = `bun build ${filePath} --
|
|
178433
|
+
const outDirPath = join2(configDir, outDir, client.toLowerCase());
|
|
178434
|
+
const command = `bun build ${filePath} --target=${buildTarget} --outdir=${outDirPath} ${defineArgs} ${externalArgs}${watch ? " --watch" : ""}`;
|
|
179855
178435
|
console.log(`Building ${client} client...`);
|
|
179856
178436
|
console.log(command);
|
|
179857
178437
|
return new Promise((resolve, reject) => {
|
|
@@ -180029,7 +178609,7 @@ async function dev() {
|
|
|
180029
178609
|
|
|
180030
178610
|
// src/index.ts
|
|
180031
178611
|
var program2 = new Command;
|
|
180032
|
-
program2.name("arc").description("CLI tool for Arc framework").version("0.0.
|
|
178612
|
+
program2.name("arc").description("CLI tool for Arc framework").version("0.0.2");
|
|
180033
178613
|
program2.command("dev").description("Run development mode for Arc framework").action(dev);
|
|
180034
178614
|
program2.command("build").description("Build all clients and declarations").action(build);
|
|
180035
178615
|
program2.parse(process.argv);
|