claudekit-cli 3.31.0-dev.1 → 3.31.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1529 -40
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -15653,8 +15653,1455 @@ var require_extract_zip = __commonJS((exports, module) => {
|
|
|
15653
15653
|
};
|
|
15654
15654
|
});
|
|
15655
15655
|
|
|
15656
|
-
// node_modules/
|
|
15656
|
+
// node_modules/picomatch/lib/constants.js
|
|
15657
15657
|
var require_constants = __commonJS((exports, module) => {
|
|
15658
|
+
var WIN_SLASH = "\\\\/";
|
|
15659
|
+
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
15660
|
+
var DOT_LITERAL = "\\.";
|
|
15661
|
+
var PLUS_LITERAL = "\\+";
|
|
15662
|
+
var QMARK_LITERAL = "\\?";
|
|
15663
|
+
var SLASH_LITERAL = "\\/";
|
|
15664
|
+
var ONE_CHAR = "(?=.)";
|
|
15665
|
+
var QMARK = "[^/]";
|
|
15666
|
+
var END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
|
|
15667
|
+
var START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
|
|
15668
|
+
var DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
|
|
15669
|
+
var NO_DOT = `(?!${DOT_LITERAL})`;
|
|
15670
|
+
var NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
|
|
15671
|
+
var NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
|
|
15672
|
+
var NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
|
|
15673
|
+
var QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
|
|
15674
|
+
var STAR = `${QMARK}*?`;
|
|
15675
|
+
var SEP = "/";
|
|
15676
|
+
var POSIX_CHARS = {
|
|
15677
|
+
DOT_LITERAL,
|
|
15678
|
+
PLUS_LITERAL,
|
|
15679
|
+
QMARK_LITERAL,
|
|
15680
|
+
SLASH_LITERAL,
|
|
15681
|
+
ONE_CHAR,
|
|
15682
|
+
QMARK,
|
|
15683
|
+
END_ANCHOR,
|
|
15684
|
+
DOTS_SLASH,
|
|
15685
|
+
NO_DOT,
|
|
15686
|
+
NO_DOTS,
|
|
15687
|
+
NO_DOT_SLASH,
|
|
15688
|
+
NO_DOTS_SLASH,
|
|
15689
|
+
QMARK_NO_DOT,
|
|
15690
|
+
STAR,
|
|
15691
|
+
START_ANCHOR,
|
|
15692
|
+
SEP
|
|
15693
|
+
};
|
|
15694
|
+
var WINDOWS_CHARS = {
|
|
15695
|
+
...POSIX_CHARS,
|
|
15696
|
+
SLASH_LITERAL: `[${WIN_SLASH}]`,
|
|
15697
|
+
QMARK: WIN_NO_SLASH,
|
|
15698
|
+
STAR: `${WIN_NO_SLASH}*?`,
|
|
15699
|
+
DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
|
|
15700
|
+
NO_DOT: `(?!${DOT_LITERAL})`,
|
|
15701
|
+
NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
15702
|
+
NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
|
|
15703
|
+
NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
15704
|
+
QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
|
|
15705
|
+
START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
|
|
15706
|
+
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,
|
|
15707
|
+
SEP: "\\"
|
|
15708
|
+
};
|
|
15709
|
+
var POSIX_REGEX_SOURCE = {
|
|
15710
|
+
alnum: "a-zA-Z0-9",
|
|
15711
|
+
alpha: "a-zA-Z",
|
|
15712
|
+
ascii: "\\x00-\\x7F",
|
|
15713
|
+
blank: " \\t",
|
|
15714
|
+
cntrl: "\\x00-\\x1F\\x7F",
|
|
15715
|
+
digit: "0-9",
|
|
15716
|
+
graph: "\\x21-\\x7E",
|
|
15717
|
+
lower: "a-z",
|
|
15718
|
+
print: "\\x20-\\x7E ",
|
|
15719
|
+
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
|
|
15720
|
+
space: " \\t\\r\\n\\v\\f",
|
|
15721
|
+
upper: "A-Z",
|
|
15722
|
+
word: "A-Za-z0-9_",
|
|
15723
|
+
xdigit: "A-Fa-f0-9"
|
|
15724
|
+
};
|
|
15725
|
+
module.exports = {
|
|
15726
|
+
MAX_LENGTH: 1024 * 64,
|
|
15727
|
+
POSIX_REGEX_SOURCE,
|
|
15728
|
+
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
15729
|
+
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
15730
|
+
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
|
15731
|
+
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
|
15732
|
+
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
|
15733
|
+
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
15734
|
+
REPLACEMENTS: {
|
|
15735
|
+
__proto__: null,
|
|
15736
|
+
"***": "*",
|
|
15737
|
+
"**/**": "**",
|
|
15738
|
+
"**/**/**": "**"
|
|
15739
|
+
},
|
|
15740
|
+
CHAR_0: 48,
|
|
15741
|
+
CHAR_9: 57,
|
|
15742
|
+
CHAR_UPPERCASE_A: 65,
|
|
15743
|
+
CHAR_LOWERCASE_A: 97,
|
|
15744
|
+
CHAR_UPPERCASE_Z: 90,
|
|
15745
|
+
CHAR_LOWERCASE_Z: 122,
|
|
15746
|
+
CHAR_LEFT_PARENTHESES: 40,
|
|
15747
|
+
CHAR_RIGHT_PARENTHESES: 41,
|
|
15748
|
+
CHAR_ASTERISK: 42,
|
|
15749
|
+
CHAR_AMPERSAND: 38,
|
|
15750
|
+
CHAR_AT: 64,
|
|
15751
|
+
CHAR_BACKWARD_SLASH: 92,
|
|
15752
|
+
CHAR_CARRIAGE_RETURN: 13,
|
|
15753
|
+
CHAR_CIRCUMFLEX_ACCENT: 94,
|
|
15754
|
+
CHAR_COLON: 58,
|
|
15755
|
+
CHAR_COMMA: 44,
|
|
15756
|
+
CHAR_DOT: 46,
|
|
15757
|
+
CHAR_DOUBLE_QUOTE: 34,
|
|
15758
|
+
CHAR_EQUAL: 61,
|
|
15759
|
+
CHAR_EXCLAMATION_MARK: 33,
|
|
15760
|
+
CHAR_FORM_FEED: 12,
|
|
15761
|
+
CHAR_FORWARD_SLASH: 47,
|
|
15762
|
+
CHAR_GRAVE_ACCENT: 96,
|
|
15763
|
+
CHAR_HASH: 35,
|
|
15764
|
+
CHAR_HYPHEN_MINUS: 45,
|
|
15765
|
+
CHAR_LEFT_ANGLE_BRACKET: 60,
|
|
15766
|
+
CHAR_LEFT_CURLY_BRACE: 123,
|
|
15767
|
+
CHAR_LEFT_SQUARE_BRACKET: 91,
|
|
15768
|
+
CHAR_LINE_FEED: 10,
|
|
15769
|
+
CHAR_NO_BREAK_SPACE: 160,
|
|
15770
|
+
CHAR_PERCENT: 37,
|
|
15771
|
+
CHAR_PLUS: 43,
|
|
15772
|
+
CHAR_QUESTION_MARK: 63,
|
|
15773
|
+
CHAR_RIGHT_ANGLE_BRACKET: 62,
|
|
15774
|
+
CHAR_RIGHT_CURLY_BRACE: 125,
|
|
15775
|
+
CHAR_RIGHT_SQUARE_BRACKET: 93,
|
|
15776
|
+
CHAR_SEMICOLON: 59,
|
|
15777
|
+
CHAR_SINGLE_QUOTE: 39,
|
|
15778
|
+
CHAR_SPACE: 32,
|
|
15779
|
+
CHAR_TAB: 9,
|
|
15780
|
+
CHAR_UNDERSCORE: 95,
|
|
15781
|
+
CHAR_VERTICAL_LINE: 124,
|
|
15782
|
+
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
15783
|
+
extglobChars(chars) {
|
|
15784
|
+
return {
|
|
15785
|
+
"!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
|
|
15786
|
+
"?": { type: "qmark", open: "(?:", close: ")?" },
|
|
15787
|
+
"+": { type: "plus", open: "(?:", close: ")+" },
|
|
15788
|
+
"*": { type: "star", open: "(?:", close: ")*" },
|
|
15789
|
+
"@": { type: "at", open: "(?:", close: ")" }
|
|
15790
|
+
};
|
|
15791
|
+
},
|
|
15792
|
+
globChars(win322) {
|
|
15793
|
+
return win322 === true ? WINDOWS_CHARS : POSIX_CHARS;
|
|
15794
|
+
}
|
|
15795
|
+
};
|
|
15796
|
+
});
|
|
15797
|
+
|
|
15798
|
+
// node_modules/picomatch/lib/utils.js
|
|
15799
|
+
var require_utils3 = __commonJS((exports) => {
|
|
15800
|
+
var {
|
|
15801
|
+
REGEX_BACKSLASH,
|
|
15802
|
+
REGEX_REMOVE_BACKSLASH,
|
|
15803
|
+
REGEX_SPECIAL_CHARS,
|
|
15804
|
+
REGEX_SPECIAL_CHARS_GLOBAL
|
|
15805
|
+
} = require_constants();
|
|
15806
|
+
exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
15807
|
+
exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
|
|
15808
|
+
exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
|
|
15809
|
+
exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
|
|
15810
|
+
exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
|
|
15811
|
+
exports.isWindows = () => {
|
|
15812
|
+
if (typeof navigator !== "undefined" && navigator.platform) {
|
|
15813
|
+
const platform10 = navigator.platform.toLowerCase();
|
|
15814
|
+
return platform10 === "win32" || platform10 === "windows";
|
|
15815
|
+
}
|
|
15816
|
+
if (typeof process !== "undefined" && process.platform) {
|
|
15817
|
+
return process.platform === "win32";
|
|
15818
|
+
}
|
|
15819
|
+
return false;
|
|
15820
|
+
};
|
|
15821
|
+
exports.removeBackslashes = (str) => {
|
|
15822
|
+
return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
|
|
15823
|
+
return match === "\\" ? "" : match;
|
|
15824
|
+
});
|
|
15825
|
+
};
|
|
15826
|
+
exports.escapeLast = (input, char, lastIdx) => {
|
|
15827
|
+
const idx = input.lastIndexOf(char, lastIdx);
|
|
15828
|
+
if (idx === -1)
|
|
15829
|
+
return input;
|
|
15830
|
+
if (input[idx - 1] === "\\")
|
|
15831
|
+
return exports.escapeLast(input, char, idx - 1);
|
|
15832
|
+
return `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
|
15833
|
+
};
|
|
15834
|
+
exports.removePrefix = (input, state = {}) => {
|
|
15835
|
+
let output2 = input;
|
|
15836
|
+
if (output2.startsWith("./")) {
|
|
15837
|
+
output2 = output2.slice(2);
|
|
15838
|
+
state.prefix = "./";
|
|
15839
|
+
}
|
|
15840
|
+
return output2;
|
|
15841
|
+
};
|
|
15842
|
+
exports.wrapOutput = (input, state = {}, options = {}) => {
|
|
15843
|
+
const prepend = options.contains ? "" : "^";
|
|
15844
|
+
const append = options.contains ? "" : "$";
|
|
15845
|
+
let output2 = `${prepend}(?:${input})${append}`;
|
|
15846
|
+
if (state.negated === true) {
|
|
15847
|
+
output2 = `(?:^(?!${output2}).*$)`;
|
|
15848
|
+
}
|
|
15849
|
+
return output2;
|
|
15850
|
+
};
|
|
15851
|
+
exports.basename = (path10, { windows } = {}) => {
|
|
15852
|
+
const segs = path10.split(windows ? /[\\/]/ : "/");
|
|
15853
|
+
const last = segs[segs.length - 1];
|
|
15854
|
+
if (last === "") {
|
|
15855
|
+
return segs[segs.length - 2];
|
|
15856
|
+
}
|
|
15857
|
+
return last;
|
|
15858
|
+
};
|
|
15859
|
+
});
|
|
15860
|
+
|
|
15861
|
+
// node_modules/picomatch/lib/scan.js
|
|
15862
|
+
var require_scan = __commonJS((exports, module) => {
|
|
15863
|
+
var utils = require_utils3();
|
|
15864
|
+
var {
|
|
15865
|
+
CHAR_ASTERISK,
|
|
15866
|
+
CHAR_AT,
|
|
15867
|
+
CHAR_BACKWARD_SLASH,
|
|
15868
|
+
CHAR_COMMA,
|
|
15869
|
+
CHAR_DOT,
|
|
15870
|
+
CHAR_EXCLAMATION_MARK,
|
|
15871
|
+
CHAR_FORWARD_SLASH,
|
|
15872
|
+
CHAR_LEFT_CURLY_BRACE,
|
|
15873
|
+
CHAR_LEFT_PARENTHESES,
|
|
15874
|
+
CHAR_LEFT_SQUARE_BRACKET,
|
|
15875
|
+
CHAR_PLUS,
|
|
15876
|
+
CHAR_QUESTION_MARK,
|
|
15877
|
+
CHAR_RIGHT_CURLY_BRACE,
|
|
15878
|
+
CHAR_RIGHT_PARENTHESES,
|
|
15879
|
+
CHAR_RIGHT_SQUARE_BRACKET
|
|
15880
|
+
} = require_constants();
|
|
15881
|
+
var isPathSeparator = (code2) => {
|
|
15882
|
+
return code2 === CHAR_FORWARD_SLASH || code2 === CHAR_BACKWARD_SLASH;
|
|
15883
|
+
};
|
|
15884
|
+
var depth = (token) => {
|
|
15885
|
+
if (token.isPrefix !== true) {
|
|
15886
|
+
token.depth = token.isGlobstar ? Infinity : 1;
|
|
15887
|
+
}
|
|
15888
|
+
};
|
|
15889
|
+
var scan = (input, options) => {
|
|
15890
|
+
const opts = options || {};
|
|
15891
|
+
const length = input.length - 1;
|
|
15892
|
+
const scanToEnd = opts.parts === true || opts.scanToEnd === true;
|
|
15893
|
+
const slashes = [];
|
|
15894
|
+
const tokens = [];
|
|
15895
|
+
const parts = [];
|
|
15896
|
+
let str = input;
|
|
15897
|
+
let index = -1;
|
|
15898
|
+
let start = 0;
|
|
15899
|
+
let lastIndex = 0;
|
|
15900
|
+
let isBrace = false;
|
|
15901
|
+
let isBracket = false;
|
|
15902
|
+
let isGlob = false;
|
|
15903
|
+
let isExtglob = false;
|
|
15904
|
+
let isGlobstar = false;
|
|
15905
|
+
let braceEscaped = false;
|
|
15906
|
+
let backslashes = false;
|
|
15907
|
+
let negated = false;
|
|
15908
|
+
let negatedExtglob = false;
|
|
15909
|
+
let finished = false;
|
|
15910
|
+
let braces = 0;
|
|
15911
|
+
let prev;
|
|
15912
|
+
let code2;
|
|
15913
|
+
let token = { value: "", depth: 0, isGlob: false };
|
|
15914
|
+
const eos = () => index >= length;
|
|
15915
|
+
const peek = () => str.charCodeAt(index + 1);
|
|
15916
|
+
const advance = () => {
|
|
15917
|
+
prev = code2;
|
|
15918
|
+
return str.charCodeAt(++index);
|
|
15919
|
+
};
|
|
15920
|
+
while (index < length) {
|
|
15921
|
+
code2 = advance();
|
|
15922
|
+
let next;
|
|
15923
|
+
if (code2 === CHAR_BACKWARD_SLASH) {
|
|
15924
|
+
backslashes = token.backslashes = true;
|
|
15925
|
+
code2 = advance();
|
|
15926
|
+
if (code2 === CHAR_LEFT_CURLY_BRACE) {
|
|
15927
|
+
braceEscaped = true;
|
|
15928
|
+
}
|
|
15929
|
+
continue;
|
|
15930
|
+
}
|
|
15931
|
+
if (braceEscaped === true || code2 === CHAR_LEFT_CURLY_BRACE) {
|
|
15932
|
+
braces++;
|
|
15933
|
+
while (eos() !== true && (code2 = advance())) {
|
|
15934
|
+
if (code2 === CHAR_BACKWARD_SLASH) {
|
|
15935
|
+
backslashes = token.backslashes = true;
|
|
15936
|
+
advance();
|
|
15937
|
+
continue;
|
|
15938
|
+
}
|
|
15939
|
+
if (code2 === CHAR_LEFT_CURLY_BRACE) {
|
|
15940
|
+
braces++;
|
|
15941
|
+
continue;
|
|
15942
|
+
}
|
|
15943
|
+
if (braceEscaped !== true && code2 === CHAR_DOT && (code2 = advance()) === CHAR_DOT) {
|
|
15944
|
+
isBrace = token.isBrace = true;
|
|
15945
|
+
isGlob = token.isGlob = true;
|
|
15946
|
+
finished = true;
|
|
15947
|
+
if (scanToEnd === true) {
|
|
15948
|
+
continue;
|
|
15949
|
+
}
|
|
15950
|
+
break;
|
|
15951
|
+
}
|
|
15952
|
+
if (braceEscaped !== true && code2 === CHAR_COMMA) {
|
|
15953
|
+
isBrace = token.isBrace = true;
|
|
15954
|
+
isGlob = token.isGlob = true;
|
|
15955
|
+
finished = true;
|
|
15956
|
+
if (scanToEnd === true) {
|
|
15957
|
+
continue;
|
|
15958
|
+
}
|
|
15959
|
+
break;
|
|
15960
|
+
}
|
|
15961
|
+
if (code2 === CHAR_RIGHT_CURLY_BRACE) {
|
|
15962
|
+
braces--;
|
|
15963
|
+
if (braces === 0) {
|
|
15964
|
+
braceEscaped = false;
|
|
15965
|
+
isBrace = token.isBrace = true;
|
|
15966
|
+
finished = true;
|
|
15967
|
+
break;
|
|
15968
|
+
}
|
|
15969
|
+
}
|
|
15970
|
+
}
|
|
15971
|
+
if (scanToEnd === true) {
|
|
15972
|
+
continue;
|
|
15973
|
+
}
|
|
15974
|
+
break;
|
|
15975
|
+
}
|
|
15976
|
+
if (code2 === CHAR_FORWARD_SLASH) {
|
|
15977
|
+
slashes.push(index);
|
|
15978
|
+
tokens.push(token);
|
|
15979
|
+
token = { value: "", depth: 0, isGlob: false };
|
|
15980
|
+
if (finished === true)
|
|
15981
|
+
continue;
|
|
15982
|
+
if (prev === CHAR_DOT && index === start + 1) {
|
|
15983
|
+
start += 2;
|
|
15984
|
+
continue;
|
|
15985
|
+
}
|
|
15986
|
+
lastIndex = index + 1;
|
|
15987
|
+
continue;
|
|
15988
|
+
}
|
|
15989
|
+
if (opts.noext !== true) {
|
|
15990
|
+
const isExtglobChar = code2 === CHAR_PLUS || code2 === CHAR_AT || code2 === CHAR_ASTERISK || code2 === CHAR_QUESTION_MARK || code2 === CHAR_EXCLAMATION_MARK;
|
|
15991
|
+
if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
|
|
15992
|
+
isGlob = token.isGlob = true;
|
|
15993
|
+
isExtglob = token.isExtglob = true;
|
|
15994
|
+
finished = true;
|
|
15995
|
+
if (code2 === CHAR_EXCLAMATION_MARK && index === start) {
|
|
15996
|
+
negatedExtglob = true;
|
|
15997
|
+
}
|
|
15998
|
+
if (scanToEnd === true) {
|
|
15999
|
+
while (eos() !== true && (code2 = advance())) {
|
|
16000
|
+
if (code2 === CHAR_BACKWARD_SLASH) {
|
|
16001
|
+
backslashes = token.backslashes = true;
|
|
16002
|
+
code2 = advance();
|
|
16003
|
+
continue;
|
|
16004
|
+
}
|
|
16005
|
+
if (code2 === CHAR_RIGHT_PARENTHESES) {
|
|
16006
|
+
isGlob = token.isGlob = true;
|
|
16007
|
+
finished = true;
|
|
16008
|
+
break;
|
|
16009
|
+
}
|
|
16010
|
+
}
|
|
16011
|
+
continue;
|
|
16012
|
+
}
|
|
16013
|
+
break;
|
|
16014
|
+
}
|
|
16015
|
+
}
|
|
16016
|
+
if (code2 === CHAR_ASTERISK) {
|
|
16017
|
+
if (prev === CHAR_ASTERISK)
|
|
16018
|
+
isGlobstar = token.isGlobstar = true;
|
|
16019
|
+
isGlob = token.isGlob = true;
|
|
16020
|
+
finished = true;
|
|
16021
|
+
if (scanToEnd === true) {
|
|
16022
|
+
continue;
|
|
16023
|
+
}
|
|
16024
|
+
break;
|
|
16025
|
+
}
|
|
16026
|
+
if (code2 === CHAR_QUESTION_MARK) {
|
|
16027
|
+
isGlob = token.isGlob = true;
|
|
16028
|
+
finished = true;
|
|
16029
|
+
if (scanToEnd === true) {
|
|
16030
|
+
continue;
|
|
16031
|
+
}
|
|
16032
|
+
break;
|
|
16033
|
+
}
|
|
16034
|
+
if (code2 === CHAR_LEFT_SQUARE_BRACKET) {
|
|
16035
|
+
while (eos() !== true && (next = advance())) {
|
|
16036
|
+
if (next === CHAR_BACKWARD_SLASH) {
|
|
16037
|
+
backslashes = token.backslashes = true;
|
|
16038
|
+
advance();
|
|
16039
|
+
continue;
|
|
16040
|
+
}
|
|
16041
|
+
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
16042
|
+
isBracket = token.isBracket = true;
|
|
16043
|
+
isGlob = token.isGlob = true;
|
|
16044
|
+
finished = true;
|
|
16045
|
+
break;
|
|
16046
|
+
}
|
|
16047
|
+
}
|
|
16048
|
+
if (scanToEnd === true) {
|
|
16049
|
+
continue;
|
|
16050
|
+
}
|
|
16051
|
+
break;
|
|
16052
|
+
}
|
|
16053
|
+
if (opts.nonegate !== true && code2 === CHAR_EXCLAMATION_MARK && index === start) {
|
|
16054
|
+
negated = token.negated = true;
|
|
16055
|
+
start++;
|
|
16056
|
+
continue;
|
|
16057
|
+
}
|
|
16058
|
+
if (opts.noparen !== true && code2 === CHAR_LEFT_PARENTHESES) {
|
|
16059
|
+
isGlob = token.isGlob = true;
|
|
16060
|
+
if (scanToEnd === true) {
|
|
16061
|
+
while (eos() !== true && (code2 = advance())) {
|
|
16062
|
+
if (code2 === CHAR_LEFT_PARENTHESES) {
|
|
16063
|
+
backslashes = token.backslashes = true;
|
|
16064
|
+
code2 = advance();
|
|
16065
|
+
continue;
|
|
16066
|
+
}
|
|
16067
|
+
if (code2 === CHAR_RIGHT_PARENTHESES) {
|
|
16068
|
+
finished = true;
|
|
16069
|
+
break;
|
|
16070
|
+
}
|
|
16071
|
+
}
|
|
16072
|
+
continue;
|
|
16073
|
+
}
|
|
16074
|
+
break;
|
|
16075
|
+
}
|
|
16076
|
+
if (isGlob === true) {
|
|
16077
|
+
finished = true;
|
|
16078
|
+
if (scanToEnd === true) {
|
|
16079
|
+
continue;
|
|
16080
|
+
}
|
|
16081
|
+
break;
|
|
16082
|
+
}
|
|
16083
|
+
}
|
|
16084
|
+
if (opts.noext === true) {
|
|
16085
|
+
isExtglob = false;
|
|
16086
|
+
isGlob = false;
|
|
16087
|
+
}
|
|
16088
|
+
let base = str;
|
|
16089
|
+
let prefix = "";
|
|
16090
|
+
let glob = "";
|
|
16091
|
+
if (start > 0) {
|
|
16092
|
+
prefix = str.slice(0, start);
|
|
16093
|
+
str = str.slice(start);
|
|
16094
|
+
lastIndex -= start;
|
|
16095
|
+
}
|
|
16096
|
+
if (base && isGlob === true && lastIndex > 0) {
|
|
16097
|
+
base = str.slice(0, lastIndex);
|
|
16098
|
+
glob = str.slice(lastIndex);
|
|
16099
|
+
} else if (isGlob === true) {
|
|
16100
|
+
base = "";
|
|
16101
|
+
glob = str;
|
|
16102
|
+
} else {
|
|
16103
|
+
base = str;
|
|
16104
|
+
}
|
|
16105
|
+
if (base && base !== "" && base !== "/" && base !== str) {
|
|
16106
|
+
if (isPathSeparator(base.charCodeAt(base.length - 1))) {
|
|
16107
|
+
base = base.slice(0, -1);
|
|
16108
|
+
}
|
|
16109
|
+
}
|
|
16110
|
+
if (opts.unescape === true) {
|
|
16111
|
+
if (glob)
|
|
16112
|
+
glob = utils.removeBackslashes(glob);
|
|
16113
|
+
if (base && backslashes === true) {
|
|
16114
|
+
base = utils.removeBackslashes(base);
|
|
16115
|
+
}
|
|
16116
|
+
}
|
|
16117
|
+
const state = {
|
|
16118
|
+
prefix,
|
|
16119
|
+
input,
|
|
16120
|
+
start,
|
|
16121
|
+
base,
|
|
16122
|
+
glob,
|
|
16123
|
+
isBrace,
|
|
16124
|
+
isBracket,
|
|
16125
|
+
isGlob,
|
|
16126
|
+
isExtglob,
|
|
16127
|
+
isGlobstar,
|
|
16128
|
+
negated,
|
|
16129
|
+
negatedExtglob
|
|
16130
|
+
};
|
|
16131
|
+
if (opts.tokens === true) {
|
|
16132
|
+
state.maxDepth = 0;
|
|
16133
|
+
if (!isPathSeparator(code2)) {
|
|
16134
|
+
tokens.push(token);
|
|
16135
|
+
}
|
|
16136
|
+
state.tokens = tokens;
|
|
16137
|
+
}
|
|
16138
|
+
if (opts.parts === true || opts.tokens === true) {
|
|
16139
|
+
let prevIndex;
|
|
16140
|
+
for (let idx = 0;idx < slashes.length; idx++) {
|
|
16141
|
+
const n = prevIndex ? prevIndex + 1 : start;
|
|
16142
|
+
const i = slashes[idx];
|
|
16143
|
+
const value = input.slice(n, i);
|
|
16144
|
+
if (opts.tokens) {
|
|
16145
|
+
if (idx === 0 && start !== 0) {
|
|
16146
|
+
tokens[idx].isPrefix = true;
|
|
16147
|
+
tokens[idx].value = prefix;
|
|
16148
|
+
} else {
|
|
16149
|
+
tokens[idx].value = value;
|
|
16150
|
+
}
|
|
16151
|
+
depth(tokens[idx]);
|
|
16152
|
+
state.maxDepth += tokens[idx].depth;
|
|
16153
|
+
}
|
|
16154
|
+
if (idx !== 0 || value !== "") {
|
|
16155
|
+
parts.push(value);
|
|
16156
|
+
}
|
|
16157
|
+
prevIndex = i;
|
|
16158
|
+
}
|
|
16159
|
+
if (prevIndex && prevIndex + 1 < input.length) {
|
|
16160
|
+
const value = input.slice(prevIndex + 1);
|
|
16161
|
+
parts.push(value);
|
|
16162
|
+
if (opts.tokens) {
|
|
16163
|
+
tokens[tokens.length - 1].value = value;
|
|
16164
|
+
depth(tokens[tokens.length - 1]);
|
|
16165
|
+
state.maxDepth += tokens[tokens.length - 1].depth;
|
|
16166
|
+
}
|
|
16167
|
+
}
|
|
16168
|
+
state.slashes = slashes;
|
|
16169
|
+
state.parts = parts;
|
|
16170
|
+
}
|
|
16171
|
+
return state;
|
|
16172
|
+
};
|
|
16173
|
+
module.exports = scan;
|
|
16174
|
+
});
|
|
16175
|
+
|
|
16176
|
+
// node_modules/picomatch/lib/parse.js
|
|
16177
|
+
var require_parse = __commonJS((exports, module) => {
|
|
16178
|
+
var constants5 = require_constants();
|
|
16179
|
+
var utils = require_utils3();
|
|
16180
|
+
var {
|
|
16181
|
+
MAX_LENGTH,
|
|
16182
|
+
POSIX_REGEX_SOURCE,
|
|
16183
|
+
REGEX_NON_SPECIAL_CHARS,
|
|
16184
|
+
REGEX_SPECIAL_CHARS_BACKREF,
|
|
16185
|
+
REPLACEMENTS
|
|
16186
|
+
} = constants5;
|
|
16187
|
+
var expandRange = (args, options) => {
|
|
16188
|
+
if (typeof options.expandRange === "function") {
|
|
16189
|
+
return options.expandRange(...args, options);
|
|
16190
|
+
}
|
|
16191
|
+
args.sort();
|
|
16192
|
+
const value = `[${args.join("-")}]`;
|
|
16193
|
+
try {
|
|
16194
|
+
new RegExp(value);
|
|
16195
|
+
} catch (ex) {
|
|
16196
|
+
return args.map((v2) => utils.escapeRegex(v2)).join("..");
|
|
16197
|
+
}
|
|
16198
|
+
return value;
|
|
16199
|
+
};
|
|
16200
|
+
var syntaxError = (type, char) => {
|
|
16201
|
+
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
16202
|
+
};
|
|
16203
|
+
var parse5 = (input, options) => {
|
|
16204
|
+
if (typeof input !== "string") {
|
|
16205
|
+
throw new TypeError("Expected a string");
|
|
16206
|
+
}
|
|
16207
|
+
input = REPLACEMENTS[input] || input;
|
|
16208
|
+
const opts = { ...options };
|
|
16209
|
+
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
16210
|
+
let len = input.length;
|
|
16211
|
+
if (len > max) {
|
|
16212
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
16213
|
+
}
|
|
16214
|
+
const bos = { type: "bos", value: "", output: opts.prepend || "" };
|
|
16215
|
+
const tokens = [bos];
|
|
16216
|
+
const capture = opts.capture ? "" : "?:";
|
|
16217
|
+
const PLATFORM_CHARS = constants5.globChars(opts.windows);
|
|
16218
|
+
const EXTGLOB_CHARS = constants5.extglobChars(PLATFORM_CHARS);
|
|
16219
|
+
const {
|
|
16220
|
+
DOT_LITERAL,
|
|
16221
|
+
PLUS_LITERAL,
|
|
16222
|
+
SLASH_LITERAL,
|
|
16223
|
+
ONE_CHAR,
|
|
16224
|
+
DOTS_SLASH,
|
|
16225
|
+
NO_DOT,
|
|
16226
|
+
NO_DOT_SLASH,
|
|
16227
|
+
NO_DOTS_SLASH,
|
|
16228
|
+
QMARK,
|
|
16229
|
+
QMARK_NO_DOT,
|
|
16230
|
+
STAR,
|
|
16231
|
+
START_ANCHOR
|
|
16232
|
+
} = PLATFORM_CHARS;
|
|
16233
|
+
const globstar = (opts2) => {
|
|
16234
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
16235
|
+
};
|
|
16236
|
+
const nodot = opts.dot ? "" : NO_DOT;
|
|
16237
|
+
const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
|
|
16238
|
+
let star = opts.bash === true ? globstar(opts) : STAR;
|
|
16239
|
+
if (opts.capture) {
|
|
16240
|
+
star = `(${star})`;
|
|
16241
|
+
}
|
|
16242
|
+
if (typeof opts.noext === "boolean") {
|
|
16243
|
+
opts.noextglob = opts.noext;
|
|
16244
|
+
}
|
|
16245
|
+
const state = {
|
|
16246
|
+
input,
|
|
16247
|
+
index: -1,
|
|
16248
|
+
start: 0,
|
|
16249
|
+
dot: opts.dot === true,
|
|
16250
|
+
consumed: "",
|
|
16251
|
+
output: "",
|
|
16252
|
+
prefix: "",
|
|
16253
|
+
backtrack: false,
|
|
16254
|
+
negated: false,
|
|
16255
|
+
brackets: 0,
|
|
16256
|
+
braces: 0,
|
|
16257
|
+
parens: 0,
|
|
16258
|
+
quotes: 0,
|
|
16259
|
+
globstar: false,
|
|
16260
|
+
tokens
|
|
16261
|
+
};
|
|
16262
|
+
input = utils.removePrefix(input, state);
|
|
16263
|
+
len = input.length;
|
|
16264
|
+
const extglobs = [];
|
|
16265
|
+
const braces = [];
|
|
16266
|
+
const stack = [];
|
|
16267
|
+
let prev = bos;
|
|
16268
|
+
let value;
|
|
16269
|
+
const eos = () => state.index === len - 1;
|
|
16270
|
+
const peek = state.peek = (n = 1) => input[state.index + n];
|
|
16271
|
+
const advance = state.advance = () => input[++state.index] || "";
|
|
16272
|
+
const remaining = () => input.slice(state.index + 1);
|
|
16273
|
+
const consume = (value2 = "", num = 0) => {
|
|
16274
|
+
state.consumed += value2;
|
|
16275
|
+
state.index += num;
|
|
16276
|
+
};
|
|
16277
|
+
const append = (token) => {
|
|
16278
|
+
state.output += token.output != null ? token.output : token.value;
|
|
16279
|
+
consume(token.value);
|
|
16280
|
+
};
|
|
16281
|
+
const negate = () => {
|
|
16282
|
+
let count = 1;
|
|
16283
|
+
while (peek() === "!" && (peek(2) !== "(" || peek(3) === "?")) {
|
|
16284
|
+
advance();
|
|
16285
|
+
state.start++;
|
|
16286
|
+
count++;
|
|
16287
|
+
}
|
|
16288
|
+
if (count % 2 === 0) {
|
|
16289
|
+
return false;
|
|
16290
|
+
}
|
|
16291
|
+
state.negated = true;
|
|
16292
|
+
state.start++;
|
|
16293
|
+
return true;
|
|
16294
|
+
};
|
|
16295
|
+
const increment = (type) => {
|
|
16296
|
+
state[type]++;
|
|
16297
|
+
stack.push(type);
|
|
16298
|
+
};
|
|
16299
|
+
const decrement = (type) => {
|
|
16300
|
+
state[type]--;
|
|
16301
|
+
stack.pop();
|
|
16302
|
+
};
|
|
16303
|
+
const push2 = (tok) => {
|
|
16304
|
+
if (prev.type === "globstar") {
|
|
16305
|
+
const isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace");
|
|
16306
|
+
const isExtglob = tok.extglob === true || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
|
|
16307
|
+
if (tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob) {
|
|
16308
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
16309
|
+
prev.type = "star";
|
|
16310
|
+
prev.value = "*";
|
|
16311
|
+
prev.output = star;
|
|
16312
|
+
state.output += prev.output;
|
|
16313
|
+
}
|
|
16314
|
+
}
|
|
16315
|
+
if (extglobs.length && tok.type !== "paren") {
|
|
16316
|
+
extglobs[extglobs.length - 1].inner += tok.value;
|
|
16317
|
+
}
|
|
16318
|
+
if (tok.value || tok.output)
|
|
16319
|
+
append(tok);
|
|
16320
|
+
if (prev && prev.type === "text" && tok.type === "text") {
|
|
16321
|
+
prev.output = (prev.output || prev.value) + tok.value;
|
|
16322
|
+
prev.value += tok.value;
|
|
16323
|
+
return;
|
|
16324
|
+
}
|
|
16325
|
+
tok.prev = prev;
|
|
16326
|
+
tokens.push(tok);
|
|
16327
|
+
prev = tok;
|
|
16328
|
+
};
|
|
16329
|
+
const extglobOpen = (type, value2) => {
|
|
16330
|
+
const token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
|
|
16331
|
+
token.prev = prev;
|
|
16332
|
+
token.parens = state.parens;
|
|
16333
|
+
token.output = state.output;
|
|
16334
|
+
const output2 = (opts.capture ? "(" : "") + token.open;
|
|
16335
|
+
increment("parens");
|
|
16336
|
+
push2({ type, value: value2, output: state.output ? "" : ONE_CHAR });
|
|
16337
|
+
push2({ type: "paren", extglob: true, value: advance(), output: output2 });
|
|
16338
|
+
extglobs.push(token);
|
|
16339
|
+
};
|
|
16340
|
+
const extglobClose = (token) => {
|
|
16341
|
+
let output2 = token.close + (opts.capture ? ")" : "");
|
|
16342
|
+
let rest;
|
|
16343
|
+
if (token.type === "negate") {
|
|
16344
|
+
let extglobStar = star;
|
|
16345
|
+
if (token.inner && token.inner.length > 1 && token.inner.includes("/")) {
|
|
16346
|
+
extglobStar = globstar(opts);
|
|
16347
|
+
}
|
|
16348
|
+
if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
|
|
16349
|
+
output2 = token.close = `)$))${extglobStar}`;
|
|
16350
|
+
}
|
|
16351
|
+
if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
|
16352
|
+
const expression = parse5(rest, { ...options, fastpaths: false }).output;
|
|
16353
|
+
output2 = token.close = `)${expression})${extglobStar})`;
|
|
16354
|
+
}
|
|
16355
|
+
if (token.prev.type === "bos") {
|
|
16356
|
+
state.negatedExtglob = true;
|
|
16357
|
+
}
|
|
16358
|
+
}
|
|
16359
|
+
push2({ type: "paren", extglob: true, value, output: output2 });
|
|
16360
|
+
decrement("parens");
|
|
16361
|
+
};
|
|
16362
|
+
if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
16363
|
+
let backslashes = false;
|
|
16364
|
+
let output2 = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m2, esc, chars, first, rest, index) => {
|
|
16365
|
+
if (first === "\\") {
|
|
16366
|
+
backslashes = true;
|
|
16367
|
+
return m2;
|
|
16368
|
+
}
|
|
16369
|
+
if (first === "?") {
|
|
16370
|
+
if (esc) {
|
|
16371
|
+
return esc + first + (rest ? QMARK.repeat(rest.length) : "");
|
|
16372
|
+
}
|
|
16373
|
+
if (index === 0) {
|
|
16374
|
+
return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "");
|
|
16375
|
+
}
|
|
16376
|
+
return QMARK.repeat(chars.length);
|
|
16377
|
+
}
|
|
16378
|
+
if (first === ".") {
|
|
16379
|
+
return DOT_LITERAL.repeat(chars.length);
|
|
16380
|
+
}
|
|
16381
|
+
if (first === "*") {
|
|
16382
|
+
if (esc) {
|
|
16383
|
+
return esc + first + (rest ? star : "");
|
|
16384
|
+
}
|
|
16385
|
+
return star;
|
|
16386
|
+
}
|
|
16387
|
+
return esc ? m2 : `\\${m2}`;
|
|
16388
|
+
});
|
|
16389
|
+
if (backslashes === true) {
|
|
16390
|
+
if (opts.unescape === true) {
|
|
16391
|
+
output2 = output2.replace(/\\/g, "");
|
|
16392
|
+
} else {
|
|
16393
|
+
output2 = output2.replace(/\\+/g, (m2) => {
|
|
16394
|
+
return m2.length % 2 === 0 ? "\\\\" : m2 ? "\\" : "";
|
|
16395
|
+
});
|
|
16396
|
+
}
|
|
16397
|
+
}
|
|
16398
|
+
if (output2 === input && opts.contains === true) {
|
|
16399
|
+
state.output = input;
|
|
16400
|
+
return state;
|
|
16401
|
+
}
|
|
16402
|
+
state.output = utils.wrapOutput(output2, state, options);
|
|
16403
|
+
return state;
|
|
16404
|
+
}
|
|
16405
|
+
while (!eos()) {
|
|
16406
|
+
value = advance();
|
|
16407
|
+
if (value === "\x00") {
|
|
16408
|
+
continue;
|
|
16409
|
+
}
|
|
16410
|
+
if (value === "\\") {
|
|
16411
|
+
const next = peek();
|
|
16412
|
+
if (next === "/" && opts.bash !== true) {
|
|
16413
|
+
continue;
|
|
16414
|
+
}
|
|
16415
|
+
if (next === "." || next === ";") {
|
|
16416
|
+
continue;
|
|
16417
|
+
}
|
|
16418
|
+
if (!next) {
|
|
16419
|
+
value += "\\";
|
|
16420
|
+
push2({ type: "text", value });
|
|
16421
|
+
continue;
|
|
16422
|
+
}
|
|
16423
|
+
const match = /^\\+/.exec(remaining());
|
|
16424
|
+
let slashes = 0;
|
|
16425
|
+
if (match && match[0].length > 2) {
|
|
16426
|
+
slashes = match[0].length;
|
|
16427
|
+
state.index += slashes;
|
|
16428
|
+
if (slashes % 2 !== 0) {
|
|
16429
|
+
value += "\\";
|
|
16430
|
+
}
|
|
16431
|
+
}
|
|
16432
|
+
if (opts.unescape === true) {
|
|
16433
|
+
value = advance();
|
|
16434
|
+
} else {
|
|
16435
|
+
value += advance();
|
|
16436
|
+
}
|
|
16437
|
+
if (state.brackets === 0) {
|
|
16438
|
+
push2({ type: "text", value });
|
|
16439
|
+
continue;
|
|
16440
|
+
}
|
|
16441
|
+
}
|
|
16442
|
+
if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
|
|
16443
|
+
if (opts.posix !== false && value === ":") {
|
|
16444
|
+
const inner = prev.value.slice(1);
|
|
16445
|
+
if (inner.includes("[")) {
|
|
16446
|
+
prev.posix = true;
|
|
16447
|
+
if (inner.includes(":")) {
|
|
16448
|
+
const idx = prev.value.lastIndexOf("[");
|
|
16449
|
+
const pre = prev.value.slice(0, idx);
|
|
16450
|
+
const rest2 = prev.value.slice(idx + 2);
|
|
16451
|
+
const posix = POSIX_REGEX_SOURCE[rest2];
|
|
16452
|
+
if (posix) {
|
|
16453
|
+
prev.value = pre + posix;
|
|
16454
|
+
state.backtrack = true;
|
|
16455
|
+
advance();
|
|
16456
|
+
if (!bos.output && tokens.indexOf(prev) === 1) {
|
|
16457
|
+
bos.output = ONE_CHAR;
|
|
16458
|
+
}
|
|
16459
|
+
continue;
|
|
16460
|
+
}
|
|
16461
|
+
}
|
|
16462
|
+
}
|
|
16463
|
+
}
|
|
16464
|
+
if (value === "[" && peek() !== ":" || value === "-" && peek() === "]") {
|
|
16465
|
+
value = `\\${value}`;
|
|
16466
|
+
}
|
|
16467
|
+
if (value === "]" && (prev.value === "[" || prev.value === "[^")) {
|
|
16468
|
+
value = `\\${value}`;
|
|
16469
|
+
}
|
|
16470
|
+
if (opts.posix === true && value === "!" && prev.value === "[") {
|
|
16471
|
+
value = "^";
|
|
16472
|
+
}
|
|
16473
|
+
prev.value += value;
|
|
16474
|
+
append({ value });
|
|
16475
|
+
continue;
|
|
16476
|
+
}
|
|
16477
|
+
if (state.quotes === 1 && value !== '"') {
|
|
16478
|
+
value = utils.escapeRegex(value);
|
|
16479
|
+
prev.value += value;
|
|
16480
|
+
append({ value });
|
|
16481
|
+
continue;
|
|
16482
|
+
}
|
|
16483
|
+
if (value === '"') {
|
|
16484
|
+
state.quotes = state.quotes === 1 ? 0 : 1;
|
|
16485
|
+
if (opts.keepQuotes === true) {
|
|
16486
|
+
push2({ type: "text", value });
|
|
16487
|
+
}
|
|
16488
|
+
continue;
|
|
16489
|
+
}
|
|
16490
|
+
if (value === "(") {
|
|
16491
|
+
increment("parens");
|
|
16492
|
+
push2({ type: "paren", value });
|
|
16493
|
+
continue;
|
|
16494
|
+
}
|
|
16495
|
+
if (value === ")") {
|
|
16496
|
+
if (state.parens === 0 && opts.strictBrackets === true) {
|
|
16497
|
+
throw new SyntaxError(syntaxError("opening", "("));
|
|
16498
|
+
}
|
|
16499
|
+
const extglob = extglobs[extglobs.length - 1];
|
|
16500
|
+
if (extglob && state.parens === extglob.parens + 1) {
|
|
16501
|
+
extglobClose(extglobs.pop());
|
|
16502
|
+
continue;
|
|
16503
|
+
}
|
|
16504
|
+
push2({ type: "paren", value, output: state.parens ? ")" : "\\)" });
|
|
16505
|
+
decrement("parens");
|
|
16506
|
+
continue;
|
|
16507
|
+
}
|
|
16508
|
+
if (value === "[") {
|
|
16509
|
+
if (opts.nobracket === true || !remaining().includes("]")) {
|
|
16510
|
+
if (opts.nobracket !== true && opts.strictBrackets === true) {
|
|
16511
|
+
throw new SyntaxError(syntaxError("closing", "]"));
|
|
16512
|
+
}
|
|
16513
|
+
value = `\\${value}`;
|
|
16514
|
+
} else {
|
|
16515
|
+
increment("brackets");
|
|
16516
|
+
}
|
|
16517
|
+
push2({ type: "bracket", value });
|
|
16518
|
+
continue;
|
|
16519
|
+
}
|
|
16520
|
+
if (value === "]") {
|
|
16521
|
+
if (opts.nobracket === true || prev && prev.type === "bracket" && prev.value.length === 1) {
|
|
16522
|
+
push2({ type: "text", value, output: `\\${value}` });
|
|
16523
|
+
continue;
|
|
16524
|
+
}
|
|
16525
|
+
if (state.brackets === 0) {
|
|
16526
|
+
if (opts.strictBrackets === true) {
|
|
16527
|
+
throw new SyntaxError(syntaxError("opening", "["));
|
|
16528
|
+
}
|
|
16529
|
+
push2({ type: "text", value, output: `\\${value}` });
|
|
16530
|
+
continue;
|
|
16531
|
+
}
|
|
16532
|
+
decrement("brackets");
|
|
16533
|
+
const prevValue = prev.value.slice(1);
|
|
16534
|
+
if (prev.posix !== true && prevValue[0] === "^" && !prevValue.includes("/")) {
|
|
16535
|
+
value = `/${value}`;
|
|
16536
|
+
}
|
|
16537
|
+
prev.value += value;
|
|
16538
|
+
append({ value });
|
|
16539
|
+
if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) {
|
|
16540
|
+
continue;
|
|
16541
|
+
}
|
|
16542
|
+
const escaped = utils.escapeRegex(prev.value);
|
|
16543
|
+
state.output = state.output.slice(0, -prev.value.length);
|
|
16544
|
+
if (opts.literalBrackets === true) {
|
|
16545
|
+
state.output += escaped;
|
|
16546
|
+
prev.value = escaped;
|
|
16547
|
+
continue;
|
|
16548
|
+
}
|
|
16549
|
+
prev.value = `(${capture}${escaped}|${prev.value})`;
|
|
16550
|
+
state.output += prev.value;
|
|
16551
|
+
continue;
|
|
16552
|
+
}
|
|
16553
|
+
if (value === "{" && opts.nobrace !== true) {
|
|
16554
|
+
increment("braces");
|
|
16555
|
+
const open = {
|
|
16556
|
+
type: "brace",
|
|
16557
|
+
value,
|
|
16558
|
+
output: "(",
|
|
16559
|
+
outputIndex: state.output.length,
|
|
16560
|
+
tokensIndex: state.tokens.length
|
|
16561
|
+
};
|
|
16562
|
+
braces.push(open);
|
|
16563
|
+
push2(open);
|
|
16564
|
+
continue;
|
|
16565
|
+
}
|
|
16566
|
+
if (value === "}") {
|
|
16567
|
+
const brace = braces[braces.length - 1];
|
|
16568
|
+
if (opts.nobrace === true || !brace) {
|
|
16569
|
+
push2({ type: "text", value, output: value });
|
|
16570
|
+
continue;
|
|
16571
|
+
}
|
|
16572
|
+
let output2 = ")";
|
|
16573
|
+
if (brace.dots === true) {
|
|
16574
|
+
const arr = tokens.slice();
|
|
16575
|
+
const range = [];
|
|
16576
|
+
for (let i = arr.length - 1;i >= 0; i--) {
|
|
16577
|
+
tokens.pop();
|
|
16578
|
+
if (arr[i].type === "brace") {
|
|
16579
|
+
break;
|
|
16580
|
+
}
|
|
16581
|
+
if (arr[i].type !== "dots") {
|
|
16582
|
+
range.unshift(arr[i].value);
|
|
16583
|
+
}
|
|
16584
|
+
}
|
|
16585
|
+
output2 = expandRange(range, opts);
|
|
16586
|
+
state.backtrack = true;
|
|
16587
|
+
}
|
|
16588
|
+
if (brace.comma !== true && brace.dots !== true) {
|
|
16589
|
+
const out = state.output.slice(0, brace.outputIndex);
|
|
16590
|
+
const toks = state.tokens.slice(brace.tokensIndex);
|
|
16591
|
+
brace.value = brace.output = "\\{";
|
|
16592
|
+
value = output2 = "\\}";
|
|
16593
|
+
state.output = out;
|
|
16594
|
+
for (const t of toks) {
|
|
16595
|
+
state.output += t.output || t.value;
|
|
16596
|
+
}
|
|
16597
|
+
}
|
|
16598
|
+
push2({ type: "brace", value, output: output2 });
|
|
16599
|
+
decrement("braces");
|
|
16600
|
+
braces.pop();
|
|
16601
|
+
continue;
|
|
16602
|
+
}
|
|
16603
|
+
if (value === "|") {
|
|
16604
|
+
if (extglobs.length > 0) {
|
|
16605
|
+
extglobs[extglobs.length - 1].conditions++;
|
|
16606
|
+
}
|
|
16607
|
+
push2({ type: "text", value });
|
|
16608
|
+
continue;
|
|
16609
|
+
}
|
|
16610
|
+
if (value === ",") {
|
|
16611
|
+
let output2 = value;
|
|
16612
|
+
const brace = braces[braces.length - 1];
|
|
16613
|
+
if (brace && stack[stack.length - 1] === "braces") {
|
|
16614
|
+
brace.comma = true;
|
|
16615
|
+
output2 = "|";
|
|
16616
|
+
}
|
|
16617
|
+
push2({ type: "comma", value, output: output2 });
|
|
16618
|
+
continue;
|
|
16619
|
+
}
|
|
16620
|
+
if (value === "/") {
|
|
16621
|
+
if (prev.type === "dot" && state.index === state.start + 1) {
|
|
16622
|
+
state.start = state.index + 1;
|
|
16623
|
+
state.consumed = "";
|
|
16624
|
+
state.output = "";
|
|
16625
|
+
tokens.pop();
|
|
16626
|
+
prev = bos;
|
|
16627
|
+
continue;
|
|
16628
|
+
}
|
|
16629
|
+
push2({ type: "slash", value, output: SLASH_LITERAL });
|
|
16630
|
+
continue;
|
|
16631
|
+
}
|
|
16632
|
+
if (value === ".") {
|
|
16633
|
+
if (state.braces > 0 && prev.type === "dot") {
|
|
16634
|
+
if (prev.value === ".")
|
|
16635
|
+
prev.output = DOT_LITERAL;
|
|
16636
|
+
const brace = braces[braces.length - 1];
|
|
16637
|
+
prev.type = "dots";
|
|
16638
|
+
prev.output += value;
|
|
16639
|
+
prev.value += value;
|
|
16640
|
+
brace.dots = true;
|
|
16641
|
+
continue;
|
|
16642
|
+
}
|
|
16643
|
+
if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
|
|
16644
|
+
push2({ type: "text", value, output: DOT_LITERAL });
|
|
16645
|
+
continue;
|
|
16646
|
+
}
|
|
16647
|
+
push2({ type: "dot", value, output: DOT_LITERAL });
|
|
16648
|
+
continue;
|
|
16649
|
+
}
|
|
16650
|
+
if (value === "?") {
|
|
16651
|
+
const isGroup = prev && prev.value === "(";
|
|
16652
|
+
if (!isGroup && opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
16653
|
+
extglobOpen("qmark", value);
|
|
16654
|
+
continue;
|
|
16655
|
+
}
|
|
16656
|
+
if (prev && prev.type === "paren") {
|
|
16657
|
+
const next = peek();
|
|
16658
|
+
let output2 = value;
|
|
16659
|
+
if (prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) {
|
|
16660
|
+
output2 = `\\${value}`;
|
|
16661
|
+
}
|
|
16662
|
+
push2({ type: "text", value, output: output2 });
|
|
16663
|
+
continue;
|
|
16664
|
+
}
|
|
16665
|
+
if (opts.dot !== true && (prev.type === "slash" || prev.type === "bos")) {
|
|
16666
|
+
push2({ type: "qmark", value, output: QMARK_NO_DOT });
|
|
16667
|
+
continue;
|
|
16668
|
+
}
|
|
16669
|
+
push2({ type: "qmark", value, output: QMARK });
|
|
16670
|
+
continue;
|
|
16671
|
+
}
|
|
16672
|
+
if (value === "!") {
|
|
16673
|
+
if (opts.noextglob !== true && peek() === "(") {
|
|
16674
|
+
if (peek(2) !== "?" || !/[!=<:]/.test(peek(3))) {
|
|
16675
|
+
extglobOpen("negate", value);
|
|
16676
|
+
continue;
|
|
16677
|
+
}
|
|
16678
|
+
}
|
|
16679
|
+
if (opts.nonegate !== true && state.index === 0) {
|
|
16680
|
+
negate();
|
|
16681
|
+
continue;
|
|
16682
|
+
}
|
|
16683
|
+
}
|
|
16684
|
+
if (value === "+") {
|
|
16685
|
+
if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
16686
|
+
extglobOpen("plus", value);
|
|
16687
|
+
continue;
|
|
16688
|
+
}
|
|
16689
|
+
if (prev && prev.value === "(" || opts.regex === false) {
|
|
16690
|
+
push2({ type: "plus", value, output: PLUS_LITERAL });
|
|
16691
|
+
continue;
|
|
16692
|
+
}
|
|
16693
|
+
if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
|
|
16694
|
+
push2({ type: "plus", value });
|
|
16695
|
+
continue;
|
|
16696
|
+
}
|
|
16697
|
+
push2({ type: "plus", value: PLUS_LITERAL });
|
|
16698
|
+
continue;
|
|
16699
|
+
}
|
|
16700
|
+
if (value === "@") {
|
|
16701
|
+
if (opts.noextglob !== true && peek() === "(" && peek(2) !== "?") {
|
|
16702
|
+
push2({ type: "at", extglob: true, value, output: "" });
|
|
16703
|
+
continue;
|
|
16704
|
+
}
|
|
16705
|
+
push2({ type: "text", value });
|
|
16706
|
+
continue;
|
|
16707
|
+
}
|
|
16708
|
+
if (value !== "*") {
|
|
16709
|
+
if (value === "$" || value === "^") {
|
|
16710
|
+
value = `\\${value}`;
|
|
16711
|
+
}
|
|
16712
|
+
const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
16713
|
+
if (match) {
|
|
16714
|
+
value += match[0];
|
|
16715
|
+
state.index += match[0].length;
|
|
16716
|
+
}
|
|
16717
|
+
push2({ type: "text", value });
|
|
16718
|
+
continue;
|
|
16719
|
+
}
|
|
16720
|
+
if (prev && (prev.type === "globstar" || prev.star === true)) {
|
|
16721
|
+
prev.type = "star";
|
|
16722
|
+
prev.star = true;
|
|
16723
|
+
prev.value += value;
|
|
16724
|
+
prev.output = star;
|
|
16725
|
+
state.backtrack = true;
|
|
16726
|
+
state.globstar = true;
|
|
16727
|
+
consume(value);
|
|
16728
|
+
continue;
|
|
16729
|
+
}
|
|
16730
|
+
let rest = remaining();
|
|
16731
|
+
if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
|
|
16732
|
+
extglobOpen("star", value);
|
|
16733
|
+
continue;
|
|
16734
|
+
}
|
|
16735
|
+
if (prev.type === "star") {
|
|
16736
|
+
if (opts.noglobstar === true) {
|
|
16737
|
+
consume(value);
|
|
16738
|
+
continue;
|
|
16739
|
+
}
|
|
16740
|
+
const prior = prev.prev;
|
|
16741
|
+
const before = prior.prev;
|
|
16742
|
+
const isStart = prior.type === "slash" || prior.type === "bos";
|
|
16743
|
+
const afterStar = before && (before.type === "star" || before.type === "globstar");
|
|
16744
|
+
if (opts.bash === true && (!isStart || rest[0] && rest[0] !== "/")) {
|
|
16745
|
+
push2({ type: "star", value, output: "" });
|
|
16746
|
+
continue;
|
|
16747
|
+
}
|
|
16748
|
+
const isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace");
|
|
16749
|
+
const isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
|
|
16750
|
+
if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
|
|
16751
|
+
push2({ type: "star", value, output: "" });
|
|
16752
|
+
continue;
|
|
16753
|
+
}
|
|
16754
|
+
while (rest.slice(0, 3) === "/**") {
|
|
16755
|
+
const after = input[state.index + 4];
|
|
16756
|
+
if (after && after !== "/") {
|
|
16757
|
+
break;
|
|
16758
|
+
}
|
|
16759
|
+
rest = rest.slice(3);
|
|
16760
|
+
consume("/**", 3);
|
|
16761
|
+
}
|
|
16762
|
+
if (prior.type === "bos" && eos()) {
|
|
16763
|
+
prev.type = "globstar";
|
|
16764
|
+
prev.value += value;
|
|
16765
|
+
prev.output = globstar(opts);
|
|
16766
|
+
state.output = prev.output;
|
|
16767
|
+
state.globstar = true;
|
|
16768
|
+
consume(value);
|
|
16769
|
+
continue;
|
|
16770
|
+
}
|
|
16771
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
|
|
16772
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
16773
|
+
prior.output = `(?:${prior.output}`;
|
|
16774
|
+
prev.type = "globstar";
|
|
16775
|
+
prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)");
|
|
16776
|
+
prev.value += value;
|
|
16777
|
+
state.globstar = true;
|
|
16778
|
+
state.output += prior.output + prev.output;
|
|
16779
|
+
consume(value);
|
|
16780
|
+
continue;
|
|
16781
|
+
}
|
|
16782
|
+
if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
|
|
16783
|
+
const end = rest[1] !== undefined ? "|$" : "";
|
|
16784
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
16785
|
+
prior.output = `(?:${prior.output}`;
|
|
16786
|
+
prev.type = "globstar";
|
|
16787
|
+
prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
|
|
16788
|
+
prev.value += value;
|
|
16789
|
+
state.output += prior.output + prev.output;
|
|
16790
|
+
state.globstar = true;
|
|
16791
|
+
consume(value + advance());
|
|
16792
|
+
push2({ type: "slash", value: "/", output: "" });
|
|
16793
|
+
continue;
|
|
16794
|
+
}
|
|
16795
|
+
if (prior.type === "bos" && rest[0] === "/") {
|
|
16796
|
+
prev.type = "globstar";
|
|
16797
|
+
prev.value += value;
|
|
16798
|
+
prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
|
|
16799
|
+
state.output = prev.output;
|
|
16800
|
+
state.globstar = true;
|
|
16801
|
+
consume(value + advance());
|
|
16802
|
+
push2({ type: "slash", value: "/", output: "" });
|
|
16803
|
+
continue;
|
|
16804
|
+
}
|
|
16805
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
16806
|
+
prev.type = "globstar";
|
|
16807
|
+
prev.output = globstar(opts);
|
|
16808
|
+
prev.value += value;
|
|
16809
|
+
state.output += prev.output;
|
|
16810
|
+
state.globstar = true;
|
|
16811
|
+
consume(value);
|
|
16812
|
+
continue;
|
|
16813
|
+
}
|
|
16814
|
+
const token = { type: "star", value, output: star };
|
|
16815
|
+
if (opts.bash === true) {
|
|
16816
|
+
token.output = ".*?";
|
|
16817
|
+
if (prev.type === "bos" || prev.type === "slash") {
|
|
16818
|
+
token.output = nodot + token.output;
|
|
16819
|
+
}
|
|
16820
|
+
push2(token);
|
|
16821
|
+
continue;
|
|
16822
|
+
}
|
|
16823
|
+
if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === true) {
|
|
16824
|
+
token.output = value;
|
|
16825
|
+
push2(token);
|
|
16826
|
+
continue;
|
|
16827
|
+
}
|
|
16828
|
+
if (state.index === state.start || prev.type === "slash" || prev.type === "dot") {
|
|
16829
|
+
if (prev.type === "dot") {
|
|
16830
|
+
state.output += NO_DOT_SLASH;
|
|
16831
|
+
prev.output += NO_DOT_SLASH;
|
|
16832
|
+
} else if (opts.dot === true) {
|
|
16833
|
+
state.output += NO_DOTS_SLASH;
|
|
16834
|
+
prev.output += NO_DOTS_SLASH;
|
|
16835
|
+
} else {
|
|
16836
|
+
state.output += nodot;
|
|
16837
|
+
prev.output += nodot;
|
|
16838
|
+
}
|
|
16839
|
+
if (peek() !== "*") {
|
|
16840
|
+
state.output += ONE_CHAR;
|
|
16841
|
+
prev.output += ONE_CHAR;
|
|
16842
|
+
}
|
|
16843
|
+
}
|
|
16844
|
+
push2(token);
|
|
16845
|
+
}
|
|
16846
|
+
while (state.brackets > 0) {
|
|
16847
|
+
if (opts.strictBrackets === true)
|
|
16848
|
+
throw new SyntaxError(syntaxError("closing", "]"));
|
|
16849
|
+
state.output = utils.escapeLast(state.output, "[");
|
|
16850
|
+
decrement("brackets");
|
|
16851
|
+
}
|
|
16852
|
+
while (state.parens > 0) {
|
|
16853
|
+
if (opts.strictBrackets === true)
|
|
16854
|
+
throw new SyntaxError(syntaxError("closing", ")"));
|
|
16855
|
+
state.output = utils.escapeLast(state.output, "(");
|
|
16856
|
+
decrement("parens");
|
|
16857
|
+
}
|
|
16858
|
+
while (state.braces > 0) {
|
|
16859
|
+
if (opts.strictBrackets === true)
|
|
16860
|
+
throw new SyntaxError(syntaxError("closing", "}"));
|
|
16861
|
+
state.output = utils.escapeLast(state.output, "{");
|
|
16862
|
+
decrement("braces");
|
|
16863
|
+
}
|
|
16864
|
+
if (opts.strictSlashes !== true && (prev.type === "star" || prev.type === "bracket")) {
|
|
16865
|
+
push2({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` });
|
|
16866
|
+
}
|
|
16867
|
+
if (state.backtrack === true) {
|
|
16868
|
+
state.output = "";
|
|
16869
|
+
for (const token of state.tokens) {
|
|
16870
|
+
state.output += token.output != null ? token.output : token.value;
|
|
16871
|
+
if (token.suffix) {
|
|
16872
|
+
state.output += token.suffix;
|
|
16873
|
+
}
|
|
16874
|
+
}
|
|
16875
|
+
}
|
|
16876
|
+
return state;
|
|
16877
|
+
};
|
|
16878
|
+
parse5.fastpaths = (input, options) => {
|
|
16879
|
+
const opts = { ...options };
|
|
16880
|
+
const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
16881
|
+
const len = input.length;
|
|
16882
|
+
if (len > max) {
|
|
16883
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
16884
|
+
}
|
|
16885
|
+
input = REPLACEMENTS[input] || input;
|
|
16886
|
+
const {
|
|
16887
|
+
DOT_LITERAL,
|
|
16888
|
+
SLASH_LITERAL,
|
|
16889
|
+
ONE_CHAR,
|
|
16890
|
+
DOTS_SLASH,
|
|
16891
|
+
NO_DOT,
|
|
16892
|
+
NO_DOTS,
|
|
16893
|
+
NO_DOTS_SLASH,
|
|
16894
|
+
STAR,
|
|
16895
|
+
START_ANCHOR
|
|
16896
|
+
} = constants5.globChars(opts.windows);
|
|
16897
|
+
const nodot = opts.dot ? NO_DOTS : NO_DOT;
|
|
16898
|
+
const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
|
16899
|
+
const capture = opts.capture ? "" : "?:";
|
|
16900
|
+
const state = { negated: false, prefix: "" };
|
|
16901
|
+
let star = opts.bash === true ? ".*?" : STAR;
|
|
16902
|
+
if (opts.capture) {
|
|
16903
|
+
star = `(${star})`;
|
|
16904
|
+
}
|
|
16905
|
+
const globstar = (opts2) => {
|
|
16906
|
+
if (opts2.noglobstar === true)
|
|
16907
|
+
return star;
|
|
16908
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
16909
|
+
};
|
|
16910
|
+
const create3 = (str) => {
|
|
16911
|
+
switch (str) {
|
|
16912
|
+
case "*":
|
|
16913
|
+
return `${nodot}${ONE_CHAR}${star}`;
|
|
16914
|
+
case ".*":
|
|
16915
|
+
return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
16916
|
+
case "*.*":
|
|
16917
|
+
return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
16918
|
+
case "*/*":
|
|
16919
|
+
return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
|
16920
|
+
case "**":
|
|
16921
|
+
return nodot + globstar(opts);
|
|
16922
|
+
case "**/*":
|
|
16923
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
|
16924
|
+
case "**/*.*":
|
|
16925
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
16926
|
+
case "**/.*":
|
|
16927
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
16928
|
+
default: {
|
|
16929
|
+
const match = /^(.*?)\.(\w+)$/.exec(str);
|
|
16930
|
+
if (!match)
|
|
16931
|
+
return;
|
|
16932
|
+
const source2 = create3(match[1]);
|
|
16933
|
+
if (!source2)
|
|
16934
|
+
return;
|
|
16935
|
+
return source2 + DOT_LITERAL + match[2];
|
|
16936
|
+
}
|
|
16937
|
+
}
|
|
16938
|
+
};
|
|
16939
|
+
const output2 = utils.removePrefix(input, state);
|
|
16940
|
+
let source = create3(output2);
|
|
16941
|
+
if (source && opts.strictSlashes !== true) {
|
|
16942
|
+
source += `${SLASH_LITERAL}?`;
|
|
16943
|
+
}
|
|
16944
|
+
return source;
|
|
16945
|
+
};
|
|
16946
|
+
module.exports = parse5;
|
|
16947
|
+
});
|
|
16948
|
+
|
|
16949
|
+
// node_modules/picomatch/lib/picomatch.js
|
|
16950
|
+
var require_picomatch = __commonJS((exports, module) => {
|
|
16951
|
+
var scan = require_scan();
|
|
16952
|
+
var parse5 = require_parse();
|
|
16953
|
+
var utils = require_utils3();
|
|
16954
|
+
var constants5 = require_constants();
|
|
16955
|
+
var isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
|
|
16956
|
+
var picomatch = (glob, options, returnState = false) => {
|
|
16957
|
+
if (Array.isArray(glob)) {
|
|
16958
|
+
const fns = glob.map((input) => picomatch(input, options, returnState));
|
|
16959
|
+
const arrayMatcher = (str) => {
|
|
16960
|
+
for (const isMatch of fns) {
|
|
16961
|
+
const state2 = isMatch(str);
|
|
16962
|
+
if (state2)
|
|
16963
|
+
return state2;
|
|
16964
|
+
}
|
|
16965
|
+
return false;
|
|
16966
|
+
};
|
|
16967
|
+
return arrayMatcher;
|
|
16968
|
+
}
|
|
16969
|
+
const isState = isObject(glob) && glob.tokens && glob.input;
|
|
16970
|
+
if (glob === "" || typeof glob !== "string" && !isState) {
|
|
16971
|
+
throw new TypeError("Expected pattern to be a non-empty string");
|
|
16972
|
+
}
|
|
16973
|
+
const opts = options || {};
|
|
16974
|
+
const posix = opts.windows;
|
|
16975
|
+
const regex2 = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
|
|
16976
|
+
const state = regex2.state;
|
|
16977
|
+
delete regex2.state;
|
|
16978
|
+
let isIgnored = () => false;
|
|
16979
|
+
if (opts.ignore) {
|
|
16980
|
+
const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
|
16981
|
+
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
16982
|
+
}
|
|
16983
|
+
const matcher = (input, returnObject = false) => {
|
|
16984
|
+
const { isMatch, match, output: output2 } = picomatch.test(input, regex2, options, { glob, posix });
|
|
16985
|
+
const result = { glob, state, regex: regex2, posix, input, output: output2, match, isMatch };
|
|
16986
|
+
if (typeof opts.onResult === "function") {
|
|
16987
|
+
opts.onResult(result);
|
|
16988
|
+
}
|
|
16989
|
+
if (isMatch === false) {
|
|
16990
|
+
result.isMatch = false;
|
|
16991
|
+
return returnObject ? result : false;
|
|
16992
|
+
}
|
|
16993
|
+
if (isIgnored(input)) {
|
|
16994
|
+
if (typeof opts.onIgnore === "function") {
|
|
16995
|
+
opts.onIgnore(result);
|
|
16996
|
+
}
|
|
16997
|
+
result.isMatch = false;
|
|
16998
|
+
return returnObject ? result : false;
|
|
16999
|
+
}
|
|
17000
|
+
if (typeof opts.onMatch === "function") {
|
|
17001
|
+
opts.onMatch(result);
|
|
17002
|
+
}
|
|
17003
|
+
return returnObject ? result : true;
|
|
17004
|
+
};
|
|
17005
|
+
if (returnState) {
|
|
17006
|
+
matcher.state = state;
|
|
17007
|
+
}
|
|
17008
|
+
return matcher;
|
|
17009
|
+
};
|
|
17010
|
+
picomatch.test = (input, regex2, options, { glob, posix } = {}) => {
|
|
17011
|
+
if (typeof input !== "string") {
|
|
17012
|
+
throw new TypeError("Expected input to be a string");
|
|
17013
|
+
}
|
|
17014
|
+
if (input === "") {
|
|
17015
|
+
return { isMatch: false, output: "" };
|
|
17016
|
+
}
|
|
17017
|
+
const opts = options || {};
|
|
17018
|
+
const format = opts.format || (posix ? utils.toPosixSlashes : null);
|
|
17019
|
+
let match = input === glob;
|
|
17020
|
+
let output2 = match && format ? format(input) : input;
|
|
17021
|
+
if (match === false) {
|
|
17022
|
+
output2 = format ? format(input) : input;
|
|
17023
|
+
match = output2 === glob;
|
|
17024
|
+
}
|
|
17025
|
+
if (match === false || opts.capture === true) {
|
|
17026
|
+
if (opts.matchBase === true || opts.basename === true) {
|
|
17027
|
+
match = picomatch.matchBase(input, regex2, options, posix);
|
|
17028
|
+
} else {
|
|
17029
|
+
match = regex2.exec(output2);
|
|
17030
|
+
}
|
|
17031
|
+
}
|
|
17032
|
+
return { isMatch: Boolean(match), match, output: output2 };
|
|
17033
|
+
};
|
|
17034
|
+
picomatch.matchBase = (input, glob, options) => {
|
|
17035
|
+
const regex2 = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
|
17036
|
+
return regex2.test(utils.basename(input));
|
|
17037
|
+
};
|
|
17038
|
+
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
17039
|
+
picomatch.parse = (pattern, options) => {
|
|
17040
|
+
if (Array.isArray(pattern))
|
|
17041
|
+
return pattern.map((p) => picomatch.parse(p, options));
|
|
17042
|
+
return parse5(pattern, { ...options, fastpaths: false });
|
|
17043
|
+
};
|
|
17044
|
+
picomatch.scan = (input, options) => scan(input, options);
|
|
17045
|
+
picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
|
|
17046
|
+
if (returnOutput === true) {
|
|
17047
|
+
return state.output;
|
|
17048
|
+
}
|
|
17049
|
+
const opts = options || {};
|
|
17050
|
+
const prepend = opts.contains ? "" : "^";
|
|
17051
|
+
const append = opts.contains ? "" : "$";
|
|
17052
|
+
let source = `${prepend}(?:${state.output})${append}`;
|
|
17053
|
+
if (state && state.negated === true) {
|
|
17054
|
+
source = `^(?!${source}).*$`;
|
|
17055
|
+
}
|
|
17056
|
+
const regex2 = picomatch.toRegex(source, options);
|
|
17057
|
+
if (returnState === true) {
|
|
17058
|
+
regex2.state = state;
|
|
17059
|
+
}
|
|
17060
|
+
return regex2;
|
|
17061
|
+
};
|
|
17062
|
+
picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => {
|
|
17063
|
+
if (!input || typeof input !== "string") {
|
|
17064
|
+
throw new TypeError("Expected a non-empty string");
|
|
17065
|
+
}
|
|
17066
|
+
let parsed = { negated: false, fastpaths: true };
|
|
17067
|
+
if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
|
|
17068
|
+
parsed.output = parse5.fastpaths(input, options);
|
|
17069
|
+
}
|
|
17070
|
+
if (!parsed.output) {
|
|
17071
|
+
parsed = parse5(input, options);
|
|
17072
|
+
}
|
|
17073
|
+
return picomatch.compileRe(parsed, options, returnOutput, returnState);
|
|
17074
|
+
};
|
|
17075
|
+
picomatch.toRegex = (source, options) => {
|
|
17076
|
+
try {
|
|
17077
|
+
const opts = options || {};
|
|
17078
|
+
return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
|
|
17079
|
+
} catch (err) {
|
|
17080
|
+
if (options && options.debug === true)
|
|
17081
|
+
throw err;
|
|
17082
|
+
return /$^/;
|
|
17083
|
+
}
|
|
17084
|
+
};
|
|
17085
|
+
picomatch.constants = constants5;
|
|
17086
|
+
module.exports = picomatch;
|
|
17087
|
+
});
|
|
17088
|
+
|
|
17089
|
+
// node_modules/picomatch/index.js
|
|
17090
|
+
var require_picomatch2 = __commonJS((exports, module) => {
|
|
17091
|
+
var pico = require_picomatch();
|
|
17092
|
+
var utils = require_utils3();
|
|
17093
|
+
function picomatch(glob, options, returnState = false) {
|
|
17094
|
+
if (options && (options.windows === null || options.windows === undefined)) {
|
|
17095
|
+
options = { ...options, windows: utils.isWindows() };
|
|
17096
|
+
}
|
|
17097
|
+
return pico(glob, options, returnState);
|
|
17098
|
+
}
|
|
17099
|
+
Object.assign(picomatch, pico);
|
|
17100
|
+
module.exports = picomatch;
|
|
17101
|
+
});
|
|
17102
|
+
|
|
17103
|
+
// node_modules/semver/internal/constants.js
|
|
17104
|
+
var require_constants2 = __commonJS((exports, module) => {
|
|
15658
17105
|
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
15659
17106
|
var MAX_LENGTH = 256;
|
|
15660
17107
|
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
@@ -15693,7 +17140,7 @@ var require_re = __commonJS((exports, module) => {
|
|
|
15693
17140
|
MAX_SAFE_COMPONENT_LENGTH,
|
|
15694
17141
|
MAX_SAFE_BUILD_LENGTH,
|
|
15695
17142
|
MAX_LENGTH
|
|
15696
|
-
} =
|
|
17143
|
+
} = require_constants2();
|
|
15697
17144
|
var debug = require_debug();
|
|
15698
17145
|
exports = module.exports = {};
|
|
15699
17146
|
var re2 = exports.re = [];
|
|
@@ -15813,7 +17260,7 @@ var require_identifiers = __commonJS((exports, module) => {
|
|
|
15813
17260
|
// node_modules/semver/classes/semver.js
|
|
15814
17261
|
var require_semver = __commonJS((exports, module) => {
|
|
15815
17262
|
var debug = require_debug();
|
|
15816
|
-
var { MAX_LENGTH, MAX_SAFE_INTEGER } =
|
|
17263
|
+
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants2();
|
|
15817
17264
|
var { safeRe: re2, t } = require_re();
|
|
15818
17265
|
var parseOptions = require_parse_options();
|
|
15819
17266
|
var { compareIdentifiers } = require_identifiers();
|
|
@@ -16080,7 +17527,7 @@ var require_semver = __commonJS((exports, module) => {
|
|
|
16080
17527
|
});
|
|
16081
17528
|
|
|
16082
17529
|
// node_modules/semver/functions/parse.js
|
|
16083
|
-
var
|
|
17530
|
+
var require_parse2 = __commonJS((exports, module) => {
|
|
16084
17531
|
var SemVer = require_semver();
|
|
16085
17532
|
var parse5 = (version, options, throwErrors = false) => {
|
|
16086
17533
|
if (version instanceof SemVer) {
|
|
@@ -16100,7 +17547,7 @@ var require_parse = __commonJS((exports, module) => {
|
|
|
16100
17547
|
|
|
16101
17548
|
// node_modules/semver/functions/valid.js
|
|
16102
17549
|
var require_valid = __commonJS((exports, module) => {
|
|
16103
|
-
var parse5 =
|
|
17550
|
+
var parse5 = require_parse2();
|
|
16104
17551
|
var valid = (version, options) => {
|
|
16105
17552
|
const v2 = parse5(version, options);
|
|
16106
17553
|
return v2 ? v2.version : null;
|
|
@@ -16110,7 +17557,7 @@ var require_valid = __commonJS((exports, module) => {
|
|
|
16110
17557
|
|
|
16111
17558
|
// node_modules/semver/functions/clean.js
|
|
16112
17559
|
var require_clean = __commonJS((exports, module) => {
|
|
16113
|
-
var parse5 =
|
|
17560
|
+
var parse5 = require_parse2();
|
|
16114
17561
|
var clean = (version, options) => {
|
|
16115
17562
|
const s = parse5(version.trim().replace(/^[=v]+/, ""), options);
|
|
16116
17563
|
return s ? s.version : null;
|
|
@@ -16138,7 +17585,7 @@ var require_inc = __commonJS((exports, module) => {
|
|
|
16138
17585
|
|
|
16139
17586
|
// node_modules/semver/functions/diff.js
|
|
16140
17587
|
var require_diff = __commonJS((exports, module) => {
|
|
16141
|
-
var parse5 =
|
|
17588
|
+
var parse5 = require_parse2();
|
|
16142
17589
|
var diff = (version1, version2) => {
|
|
16143
17590
|
const v1 = parse5(version1, null, true);
|
|
16144
17591
|
const v2 = parse5(version2, null, true);
|
|
@@ -16200,7 +17647,7 @@ var require_patch = __commonJS((exports, module) => {
|
|
|
16200
17647
|
|
|
16201
17648
|
// node_modules/semver/functions/prerelease.js
|
|
16202
17649
|
var require_prerelease = __commonJS((exports, module) => {
|
|
16203
|
-
var parse5 =
|
|
17650
|
+
var parse5 = require_parse2();
|
|
16204
17651
|
var prerelease = (version, options) => {
|
|
16205
17652
|
const parsed = parse5(version, options);
|
|
16206
17653
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
@@ -16346,7 +17793,7 @@ var require_cmp = __commonJS((exports, module) => {
|
|
|
16346
17793
|
// node_modules/semver/functions/coerce.js
|
|
16347
17794
|
var require_coerce = __commonJS((exports, module) => {
|
|
16348
17795
|
var SemVer = require_semver();
|
|
16349
|
-
var parse5 =
|
|
17796
|
+
var parse5 = require_parse2();
|
|
16350
17797
|
var { safeRe: re2, t } = require_re();
|
|
16351
17798
|
var coerce2 = (version, options) => {
|
|
16352
17799
|
if (version instanceof SemVer) {
|
|
@@ -16576,7 +18023,7 @@ var require_range = __commonJS((exports, module) => {
|
|
|
16576
18023
|
tildeTrimReplace,
|
|
16577
18024
|
caretTrimReplace
|
|
16578
18025
|
} = require_re();
|
|
16579
|
-
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } =
|
|
18026
|
+
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants2();
|
|
16580
18027
|
var isNullSet = (c2) => c2.value === "<0.0.0-0";
|
|
16581
18028
|
var isAny = (c2) => c2.value === "";
|
|
16582
18029
|
var isSatisfiable = (comparators, options) => {
|
|
@@ -17347,10 +18794,10 @@ var require_subset = __commonJS((exports, module) => {
|
|
|
17347
18794
|
// node_modules/semver/index.js
|
|
17348
18795
|
var require_semver2 = __commonJS((exports, module) => {
|
|
17349
18796
|
var internalRe = require_re();
|
|
17350
|
-
var constants5 =
|
|
18797
|
+
var constants5 = require_constants2();
|
|
17351
18798
|
var SemVer = require_semver();
|
|
17352
18799
|
var identifiers = require_identifiers();
|
|
17353
|
-
var parse5 =
|
|
18800
|
+
var parse5 = require_parse2();
|
|
17354
18801
|
var valid = require_valid();
|
|
17355
18802
|
var clean = require_clean();
|
|
17356
18803
|
var inc = require_inc();
|
|
@@ -35230,7 +36677,7 @@ import { join as join54 } from "node:path";
|
|
|
35230
36677
|
|
|
35231
36678
|
// src/domains/installation/deletion-handler.ts
|
|
35232
36679
|
import { existsSync as existsSync17, lstatSync as lstatSync2, readdirSync, rmSync as rmSync2, rmdirSync, unlinkSync as unlinkSync3 } from "node:fs";
|
|
35233
|
-
import { dirname as dirname6, join as join40, resolve as resolve6 } from "node:path";
|
|
36680
|
+
import { dirname as dirname6, join as join40, relative as relative5, resolve as resolve6 } from "node:path";
|
|
35234
36681
|
|
|
35235
36682
|
// src/services/file-operations/manifest/manifest-reader.ts
|
|
35236
36683
|
import { join as join39 } from "node:path";
|
|
@@ -35382,6 +36829,7 @@ async function getUninstallManifest(claudeDir, kit) {
|
|
|
35382
36829
|
// src/domains/installation/deletion-handler.ts
|
|
35383
36830
|
init_logger();
|
|
35384
36831
|
var import_fs_extra7 = __toESM(require_lib(), 1);
|
|
36832
|
+
var import_picomatch = __toESM(require_picomatch2(), 1);
|
|
35385
36833
|
function findFileInMetadata(metadata, path10) {
|
|
35386
36834
|
if (!metadata)
|
|
35387
36835
|
return null;
|
|
@@ -35407,6 +36855,44 @@ function shouldDeletePath(path10, metadata) {
|
|
|
35407
36855
|
return true;
|
|
35408
36856
|
return tracked.ownership !== "user";
|
|
35409
36857
|
}
|
|
36858
|
+
function isGlobPattern(pattern) {
|
|
36859
|
+
return pattern.includes("*") || pattern.includes("?") || pattern.includes("{");
|
|
36860
|
+
}
|
|
36861
|
+
function collectFilesRecursively(dir, baseDir) {
|
|
36862
|
+
const results = [];
|
|
36863
|
+
if (!existsSync17(dir))
|
|
36864
|
+
return results;
|
|
36865
|
+
try {
|
|
36866
|
+
const entries = readdirSync(dir, { withFileTypes: true });
|
|
36867
|
+
for (const entry of entries) {
|
|
36868
|
+
const fullPath = join40(dir, entry.name);
|
|
36869
|
+
const relativePath = relative5(baseDir, fullPath);
|
|
36870
|
+
if (entry.isDirectory()) {
|
|
36871
|
+
results.push(...collectFilesRecursively(fullPath, baseDir));
|
|
36872
|
+
} else {
|
|
36873
|
+
results.push(relativePath);
|
|
36874
|
+
}
|
|
36875
|
+
}
|
|
36876
|
+
} catch {}
|
|
36877
|
+
return results;
|
|
36878
|
+
}
|
|
36879
|
+
function expandGlobPatterns(patterns, claudeDir) {
|
|
36880
|
+
const expanded = [];
|
|
36881
|
+
const allFiles = collectFilesRecursively(claudeDir, claudeDir);
|
|
36882
|
+
for (const pattern of patterns) {
|
|
36883
|
+
if (isGlobPattern(pattern)) {
|
|
36884
|
+
const matcher = import_picomatch.default(pattern);
|
|
36885
|
+
const matches = allFiles.filter((file) => matcher(file));
|
|
36886
|
+
expanded.push(...matches);
|
|
36887
|
+
if (matches.length > 0) {
|
|
36888
|
+
logger.debug(`Pattern "${pattern}" matched ${matches.length} files`);
|
|
36889
|
+
}
|
|
36890
|
+
} else {
|
|
36891
|
+
expanded.push(pattern);
|
|
36892
|
+
}
|
|
36893
|
+
}
|
|
36894
|
+
return [...new Set(expanded)];
|
|
36895
|
+
}
|
|
35410
36896
|
var MAX_CLEANUP_ITERATIONS = 50;
|
|
35411
36897
|
function cleanupEmptyDirectories(filePath, claudeDir) {
|
|
35412
36898
|
const normalizedClaudeDir = resolve6(claudeDir);
|
|
@@ -35494,10 +36980,11 @@ async function updateMetadataAfterDeletion(claudeDir, deletedPaths) {
|
|
|
35494
36980
|
}
|
|
35495
36981
|
}
|
|
35496
36982
|
async function handleDeletions(sourceMetadata, claudeDir) {
|
|
35497
|
-
const
|
|
35498
|
-
if (
|
|
36983
|
+
const deletionPatterns = sourceMetadata.deletions || [];
|
|
36984
|
+
if (deletionPatterns.length === 0) {
|
|
35499
36985
|
return { deletedPaths: [], preservedPaths: [], errors: [] };
|
|
35500
36986
|
}
|
|
36987
|
+
const deletions = expandGlobPatterns(deletionPatterns, claudeDir);
|
|
35501
36988
|
const userMetadata = await readManifest(claudeDir);
|
|
35502
36989
|
const result = { deletedPaths: [], preservedPaths: [], errors: [] };
|
|
35503
36990
|
for (const path10 of deletions) {
|
|
@@ -35541,7 +37028,7 @@ init_logger();
|
|
|
35541
37028
|
init_types2();
|
|
35542
37029
|
var import_fs_extra11 = __toESM(require_lib(), 1);
|
|
35543
37030
|
var import_ignore3 = __toESM(require_ignore(), 1);
|
|
35544
|
-
import { dirname as dirname9, join as join44, relative as
|
|
37031
|
+
import { dirname as dirname9, join as join44, relative as relative7 } from "node:path";
|
|
35545
37032
|
|
|
35546
37033
|
// src/domains/installation/selective-merger.ts
|
|
35547
37034
|
import { stat as stat6 } from "node:fs/promises";
|
|
@@ -35719,7 +37206,7 @@ class SelectiveMerger {
|
|
|
35719
37206
|
init_logger();
|
|
35720
37207
|
var import_fs_extra8 = __toESM(require_lib(), 1);
|
|
35721
37208
|
var import_ignore2 = __toESM(require_ignore(), 1);
|
|
35722
|
-
import { relative as
|
|
37209
|
+
import { relative as relative6 } from "node:path";
|
|
35723
37210
|
import { join as join41 } from "node:path";
|
|
35724
37211
|
|
|
35725
37212
|
// node_modules/@isaacs/balanced-match/dist/esm/index.js
|
|
@@ -37177,7 +38664,7 @@ class FileScanner {
|
|
|
37177
38664
|
const entries = await import_fs_extra8.readdir(dir, { encoding: "utf8" });
|
|
37178
38665
|
for (const entry of entries) {
|
|
37179
38666
|
const fullPath = join41(dir, entry);
|
|
37180
|
-
const relativePath =
|
|
38667
|
+
const relativePath = relative6(baseDir, fullPath);
|
|
37181
38668
|
const normalizedRelativePath = relativePath.replace(/\\/g, "/");
|
|
37182
38669
|
const stats = await import_fs_extra8.lstat(fullPath);
|
|
37183
38670
|
if (stats.isSymbolicLink()) {
|
|
@@ -38045,7 +39532,7 @@ class CopyExecutor {
|
|
|
38045
39532
|
const conflicts = [];
|
|
38046
39533
|
const files = await this.fileScanner.getFiles(sourceDir, sourceDir);
|
|
38047
39534
|
for (const file of files) {
|
|
38048
|
-
const relativePath =
|
|
39535
|
+
const relativePath = relative7(sourceDir, file);
|
|
38049
39536
|
const normalizedRelativePath = relativePath.replace(/\\/g, "/");
|
|
38050
39537
|
const destPath = join44(destDir, relativePath);
|
|
38051
39538
|
if (await import_fs_extra11.pathExists(destPath)) {
|
|
@@ -38067,7 +39554,7 @@ class CopyExecutor {
|
|
|
38067
39554
|
let copiedCount = 0;
|
|
38068
39555
|
let skippedCount = 0;
|
|
38069
39556
|
for (const file of files) {
|
|
38070
|
-
const relativePath =
|
|
39557
|
+
const relativePath = relative7(sourceDir, file);
|
|
38071
39558
|
const normalizedRelativePath = relativePath.replace(/\\/g, "/");
|
|
38072
39559
|
const destPath = join44(destDir, relativePath);
|
|
38073
39560
|
if (this.fileScanner.shouldNeverCopy(normalizedRelativePath)) {
|
|
@@ -38239,7 +39726,7 @@ class FileMerger {
|
|
|
38239
39726
|
|
|
38240
39727
|
// src/domains/migration/legacy-migration.ts
|
|
38241
39728
|
import { readdir as readdir9, stat as stat7 } from "node:fs/promises";
|
|
38242
|
-
import { join as join48, relative as
|
|
39729
|
+
import { join as join48, relative as relative8 } from "node:path";
|
|
38243
39730
|
// src/services/file-operations/manifest/manifest-tracker.ts
|
|
38244
39731
|
import { join as join47 } from "node:path";
|
|
38245
39732
|
|
|
@@ -38613,7 +40100,7 @@ class LegacyMigration {
|
|
|
38613
40100
|
};
|
|
38614
40101
|
const filesInManifest = [];
|
|
38615
40102
|
for (const file of files) {
|
|
38616
|
-
const relativePath =
|
|
40103
|
+
const relativePath = relative8(claudeDir, file).replace(/\\/g, "/");
|
|
38617
40104
|
const manifestEntry = ReleaseManifestLoader.findFile(manifest, relativePath);
|
|
38618
40105
|
if (!manifestEntry) {
|
|
38619
40106
|
preview.userCreated.push(relativePath);
|
|
@@ -38806,7 +40293,7 @@ function buildConflictSummary(fileConflicts, hookConflicts, mcpConflicts) {
|
|
|
38806
40293
|
}
|
|
38807
40294
|
|
|
38808
40295
|
// src/services/file-operations/file-scanner.ts
|
|
38809
|
-
import { join as join49, relative as
|
|
40296
|
+
import { join as join49, relative as relative9, resolve as resolve7 } from "node:path";
|
|
38810
40297
|
init_logger();
|
|
38811
40298
|
var import_fs_extra15 = __toESM(require_lib(), 1);
|
|
38812
40299
|
|
|
@@ -38847,7 +40334,7 @@ class FileScanner2 {
|
|
|
38847
40334
|
const subFiles = await FileScanner2.getFiles(fullPath, basePath);
|
|
38848
40335
|
files.push(...subFiles);
|
|
38849
40336
|
} else if (stats.isFile()) {
|
|
38850
|
-
const relativePath =
|
|
40337
|
+
const relativePath = relative9(basePath, fullPath);
|
|
38851
40338
|
files.push(FileScanner2.toPosixPath(relativePath));
|
|
38852
40339
|
}
|
|
38853
40340
|
}
|
|
@@ -39475,7 +40962,7 @@ init_logger();
|
|
|
39475
40962
|
init_logger();
|
|
39476
40963
|
import { createHash as createHash2 } from "node:crypto";
|
|
39477
40964
|
import { readFile as readFile21, readdir as readdir15, writeFile as writeFile17 } from "node:fs/promises";
|
|
39478
|
-
import { join as join55, relative as
|
|
40965
|
+
import { join as join55, relative as relative10 } from "node:path";
|
|
39479
40966
|
init_types2();
|
|
39480
40967
|
var import_fs_extra20 = __toESM(require_lib(), 1);
|
|
39481
40968
|
|
|
@@ -39581,7 +41068,7 @@ class SkillsManifestManager {
|
|
|
39581
41068
|
const files = await SkillsManifestManager.getAllFiles(dirPath);
|
|
39582
41069
|
files.sort();
|
|
39583
41070
|
for (const file of files) {
|
|
39584
|
-
const relativePath =
|
|
41071
|
+
const relativePath = relative10(dirPath, file);
|
|
39585
41072
|
const content = await readFile21(file);
|
|
39586
41073
|
hash.update(relativePath);
|
|
39587
41074
|
hash.update(content);
|
|
@@ -40316,13 +41803,13 @@ init_logger();
|
|
|
40316
41803
|
|
|
40317
41804
|
// src/domains/skills/customization/comparison-engine.ts
|
|
40318
41805
|
var import_fs_extra25 = __toESM(require_lib(), 1);
|
|
40319
|
-
import { relative as
|
|
41806
|
+
import { relative as relative12 } from "node:path";
|
|
40320
41807
|
|
|
40321
41808
|
// src/domains/skills/customization/hash-calculator.ts
|
|
40322
41809
|
import { createHash as createHash3 } from "node:crypto";
|
|
40323
41810
|
import { createReadStream as createReadStream2 } from "node:fs";
|
|
40324
41811
|
import { readFile as readFile22, readdir as readdir19 } from "node:fs/promises";
|
|
40325
|
-
import { join as join59, relative as
|
|
41812
|
+
import { join as join59, relative as relative11 } from "node:path";
|
|
40326
41813
|
async function getAllFiles(dirPath) {
|
|
40327
41814
|
const files = [];
|
|
40328
41815
|
const entries = await readdir19(dirPath, { withFileTypes: true });
|
|
@@ -40359,7 +41846,7 @@ async function hashDirectory(dirPath) {
|
|
|
40359
41846
|
const files = await getAllFiles(dirPath);
|
|
40360
41847
|
files.sort();
|
|
40361
41848
|
for (const file of files) {
|
|
40362
|
-
const relativePath =
|
|
41849
|
+
const relativePath = relative11(dirPath, file);
|
|
40363
41850
|
const content = await readFile22(file);
|
|
40364
41851
|
hash.update(relativePath);
|
|
40365
41852
|
hash.update(content);
|
|
@@ -40393,8 +41880,8 @@ async function compareDirectories(dir1, dir2) {
|
|
|
40393
41880
|
if (files1.length !== files2.length) {
|
|
40394
41881
|
return true;
|
|
40395
41882
|
}
|
|
40396
|
-
const relFiles1 = files1.map((f3) =>
|
|
40397
|
-
const relFiles2 = files2.map((f3) =>
|
|
41883
|
+
const relFiles1 = files1.map((f3) => relative12(dir1, f3)).sort();
|
|
41884
|
+
const relFiles2 = files2.map((f3) => relative12(dir2, f3)).sort();
|
|
40398
41885
|
if (JSON.stringify(relFiles1) !== JSON.stringify(relFiles2)) {
|
|
40399
41886
|
return true;
|
|
40400
41887
|
}
|
|
@@ -40412,12 +41899,12 @@ async function detectFileChanges(currentSkillPath, baselineSkillPath) {
|
|
|
40412
41899
|
const currentFiles = await getAllFiles(currentSkillPath);
|
|
40413
41900
|
const baselineFiles = await import_fs_extra25.pathExists(baselineSkillPath) ? await getAllFiles(baselineSkillPath) : [];
|
|
40414
41901
|
const currentFileMap = new Map(await Promise.all(currentFiles.map(async (f3) => {
|
|
40415
|
-
const relPath =
|
|
41902
|
+
const relPath = relative12(currentSkillPath, f3);
|
|
40416
41903
|
const hash = await hashFile(f3);
|
|
40417
41904
|
return [relPath, hash];
|
|
40418
41905
|
})));
|
|
40419
41906
|
const baselineFileMap = new Map(await Promise.all(baselineFiles.map(async (f3) => {
|
|
40420
|
-
const relPath =
|
|
41907
|
+
const relPath = relative12(baselineSkillPath, f3);
|
|
40421
41908
|
const hash = await hashFile(f3);
|
|
40422
41909
|
return [relPath, hash];
|
|
40423
41910
|
})));
|
|
@@ -42188,7 +43675,7 @@ init_logger();
|
|
|
42188
43675
|
init_types2();
|
|
42189
43676
|
var import_fs_extra33 = __toESM(require_lib(), 1);
|
|
42190
43677
|
import { rename as rename4, rm as rm7 } from "node:fs/promises";
|
|
42191
|
-
import { join as join70, relative as
|
|
43678
|
+
import { join as join70, relative as relative13 } from "node:path";
|
|
42192
43679
|
async function collectDirsToRename(extractDir, folders) {
|
|
42193
43680
|
const dirsToRename = [];
|
|
42194
43681
|
if (folders.docs !== DEFAULT_FOLDERS.docs) {
|
|
@@ -42242,11 +43729,11 @@ async function renameFolders(dirsToRename, extractDir, options) {
|
|
|
42242
43729
|
let foldersRenamed = 0;
|
|
42243
43730
|
for (const { from, to } of dirsToRename) {
|
|
42244
43731
|
if (options.dryRun) {
|
|
42245
|
-
logger.info(`[dry-run] Would rename: ${
|
|
43732
|
+
logger.info(`[dry-run] Would rename: ${relative13(extractDir, from)} -> ${relative13(extractDir, to)}`);
|
|
42246
43733
|
} else {
|
|
42247
43734
|
try {
|
|
42248
43735
|
await moveAcrossDevices(from, to);
|
|
42249
|
-
logger.debug(`Renamed: ${
|
|
43736
|
+
logger.debug(`Renamed: ${relative13(extractDir, from)} -> ${relative13(extractDir, to)}`);
|
|
42250
43737
|
foldersRenamed++;
|
|
42251
43738
|
} catch (error) {
|
|
42252
43739
|
logger.warning(`Failed to rename ${from}: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
@@ -42260,7 +43747,7 @@ async function renameFolders(dirsToRename, extractDir, options) {
|
|
|
42260
43747
|
init_logger();
|
|
42261
43748
|
init_types2();
|
|
42262
43749
|
import { readFile as readFile26, readdir as readdir23, writeFile as writeFile22 } from "node:fs/promises";
|
|
42263
|
-
import { join as join71, relative as
|
|
43750
|
+
import { join as join71, relative as relative14 } from "node:path";
|
|
42264
43751
|
var TRANSFORMABLE_FILE_PATTERNS = [
|
|
42265
43752
|
".md",
|
|
42266
43753
|
".txt",
|
|
@@ -42340,10 +43827,10 @@ async function transformFileContents(dir, compiledReplacements, options) {
|
|
|
42340
43827
|
}
|
|
42341
43828
|
if (changeCount > 0) {
|
|
42342
43829
|
if (options.dryRun) {
|
|
42343
|
-
logger.debug(`[dry-run] Would update ${
|
|
43830
|
+
logger.debug(`[dry-run] Would update ${relative14(dir, fullPath)}: ${changeCount} replacement(s)`);
|
|
42344
43831
|
} else {
|
|
42345
43832
|
await writeFile22(fullPath, newContent, "utf-8");
|
|
42346
|
-
logger.debug(`Updated ${
|
|
43833
|
+
logger.debug(`Updated ${relative14(dir, fullPath)}: ${changeCount} replacement(s)`);
|
|
42347
43834
|
}
|
|
42348
43835
|
filesChanged++;
|
|
42349
43836
|
replacementsCount += changeCount;
|
|
@@ -43730,7 +45217,7 @@ var import_fs_extra37 = __toESM(require_lib(), 1);
|
|
|
43730
45217
|
// package.json
|
|
43731
45218
|
var package_default = {
|
|
43732
45219
|
name: "claudekit-cli",
|
|
43733
|
-
version: "3.31.0-dev.
|
|
45220
|
+
version: "3.31.0-dev.2",
|
|
43734
45221
|
description: "CLI tool for bootstrapping and updating ClaudeKit projects",
|
|
43735
45222
|
type: "module",
|
|
43736
45223
|
repository: {
|
|
@@ -43796,6 +45283,7 @@ var package_default = {
|
|
|
43796
45283
|
ora: "^8.0.0",
|
|
43797
45284
|
"p-limit": "^7.2.0",
|
|
43798
45285
|
picocolors: "^1.1.1",
|
|
45286
|
+
picomatch: "^4.0.3",
|
|
43799
45287
|
"proper-lockfile": "^4.1.2",
|
|
43800
45288
|
semver: "^7.7.3",
|
|
43801
45289
|
tar: "^7.4.3",
|
|
@@ -43811,6 +45299,7 @@ var package_default = {
|
|
|
43811
45299
|
"@types/diff": "^8.0.0",
|
|
43812
45300
|
"@types/fs-extra": "^11.0.4",
|
|
43813
45301
|
"@types/node": "^22.10.1",
|
|
45302
|
+
"@types/picomatch": "^4.0.2",
|
|
43814
45303
|
"@types/proper-lockfile": "^4.1.4",
|
|
43815
45304
|
"@types/semver": "^7.7.1",
|
|
43816
45305
|
"@types/tar": "^6.1.13",
|