ocx 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +801 -97
- package/dist/index.js.map +9 -6
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -8709,98 +8709,810 @@ async function fetchFileContent(baseUrl, componentName, filePath) {
|
|
|
8709
8709
|
return response.text();
|
|
8710
8710
|
}
|
|
8711
8711
|
|
|
8712
|
-
// ../../node_modules/.bun/
|
|
8713
|
-
|
|
8714
|
-
|
|
8715
|
-
|
|
8716
|
-
|
|
8717
|
-
|
|
8718
|
-
|
|
8719
|
-
|
|
8720
|
-
|
|
8721
|
-
|
|
8722
|
-
|
|
8723
|
-
|
|
8724
|
-
|
|
8712
|
+
// ../../node_modules/.bun/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/scanner.js
|
|
8713
|
+
function createScanner(text, ignoreTrivia = false) {
|
|
8714
|
+
const len = text.length;
|
|
8715
|
+
let pos = 0, value = "", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0;
|
|
8716
|
+
function scanHexDigits(count, exact) {
|
|
8717
|
+
let digits = 0;
|
|
8718
|
+
let value2 = 0;
|
|
8719
|
+
while (digits < count || !exact) {
|
|
8720
|
+
let ch = text.charCodeAt(pos);
|
|
8721
|
+
if (ch >= 48 && ch <= 57) {
|
|
8722
|
+
value2 = value2 * 16 + ch - 48;
|
|
8723
|
+
} else if (ch >= 65 && ch <= 70) {
|
|
8724
|
+
value2 = value2 * 16 + ch - 65 + 10;
|
|
8725
|
+
} else if (ch >= 97 && ch <= 102) {
|
|
8726
|
+
value2 = value2 * 16 + ch - 97 + 10;
|
|
8727
|
+
} else {
|
|
8728
|
+
break;
|
|
8729
|
+
}
|
|
8730
|
+
pos++;
|
|
8731
|
+
digits++;
|
|
8732
|
+
}
|
|
8733
|
+
if (digits < count) {
|
|
8734
|
+
value2 = -1;
|
|
8735
|
+
}
|
|
8736
|
+
return value2;
|
|
8737
|
+
}
|
|
8738
|
+
function setPosition(newPosition) {
|
|
8739
|
+
pos = newPosition;
|
|
8740
|
+
value = "";
|
|
8741
|
+
tokenOffset = 0;
|
|
8742
|
+
token = 16;
|
|
8743
|
+
scanError = 0;
|
|
8744
|
+
}
|
|
8745
|
+
function scanNumber() {
|
|
8746
|
+
let start = pos;
|
|
8747
|
+
if (text.charCodeAt(pos) === 48) {
|
|
8748
|
+
pos++;
|
|
8749
|
+
} else {
|
|
8750
|
+
pos++;
|
|
8751
|
+
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
8752
|
+
pos++;
|
|
8753
|
+
}
|
|
8754
|
+
}
|
|
8755
|
+
if (pos < text.length && text.charCodeAt(pos) === 46) {
|
|
8756
|
+
pos++;
|
|
8757
|
+
if (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
8758
|
+
pos++;
|
|
8759
|
+
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
8760
|
+
pos++;
|
|
8761
|
+
}
|
|
8762
|
+
} else {
|
|
8763
|
+
scanError = 3;
|
|
8764
|
+
return text.substring(start, pos);
|
|
8765
|
+
}
|
|
8766
|
+
}
|
|
8767
|
+
let end = pos;
|
|
8768
|
+
if (pos < text.length && (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101)) {
|
|
8769
|
+
pos++;
|
|
8770
|
+
if (pos < text.length && text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) {
|
|
8771
|
+
pos++;
|
|
8772
|
+
}
|
|
8773
|
+
if (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
8774
|
+
pos++;
|
|
8775
|
+
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
8776
|
+
pos++;
|
|
8777
|
+
}
|
|
8778
|
+
end = pos;
|
|
8779
|
+
} else {
|
|
8780
|
+
scanError = 3;
|
|
8781
|
+
}
|
|
8782
|
+
}
|
|
8783
|
+
return text.substring(start, end);
|
|
8784
|
+
}
|
|
8785
|
+
function scanString() {
|
|
8786
|
+
let result = "", start = pos;
|
|
8787
|
+
while (true) {
|
|
8788
|
+
if (pos >= len) {
|
|
8789
|
+
result += text.substring(start, pos);
|
|
8790
|
+
scanError = 2;
|
|
8791
|
+
break;
|
|
8792
|
+
}
|
|
8793
|
+
const ch = text.charCodeAt(pos);
|
|
8794
|
+
if (ch === 34) {
|
|
8795
|
+
result += text.substring(start, pos);
|
|
8796
|
+
pos++;
|
|
8797
|
+
break;
|
|
8798
|
+
}
|
|
8799
|
+
if (ch === 92) {
|
|
8800
|
+
result += text.substring(start, pos);
|
|
8801
|
+
pos++;
|
|
8802
|
+
if (pos >= len) {
|
|
8803
|
+
scanError = 2;
|
|
8804
|
+
break;
|
|
8805
|
+
}
|
|
8806
|
+
const ch2 = text.charCodeAt(pos++);
|
|
8807
|
+
switch (ch2) {
|
|
8808
|
+
case 34:
|
|
8809
|
+
result += '"';
|
|
8810
|
+
break;
|
|
8811
|
+
case 92:
|
|
8812
|
+
result += "\\";
|
|
8813
|
+
break;
|
|
8814
|
+
case 47:
|
|
8815
|
+
result += "/";
|
|
8816
|
+
break;
|
|
8817
|
+
case 98:
|
|
8818
|
+
result += "\b";
|
|
8819
|
+
break;
|
|
8820
|
+
case 102:
|
|
8821
|
+
result += "\f";
|
|
8822
|
+
break;
|
|
8823
|
+
case 110:
|
|
8824
|
+
result += `
|
|
8825
|
+
`;
|
|
8826
|
+
break;
|
|
8827
|
+
case 114:
|
|
8828
|
+
result += "\r";
|
|
8829
|
+
break;
|
|
8830
|
+
case 116:
|
|
8831
|
+
result += "\t";
|
|
8832
|
+
break;
|
|
8833
|
+
case 117:
|
|
8834
|
+
const ch3 = scanHexDigits(4, true);
|
|
8835
|
+
if (ch3 >= 0) {
|
|
8836
|
+
result += String.fromCharCode(ch3);
|
|
8837
|
+
} else {
|
|
8838
|
+
scanError = 4;
|
|
8839
|
+
}
|
|
8840
|
+
break;
|
|
8841
|
+
default:
|
|
8842
|
+
scanError = 5;
|
|
8843
|
+
}
|
|
8844
|
+
start = pos;
|
|
8845
|
+
continue;
|
|
8846
|
+
}
|
|
8847
|
+
if (ch >= 0 && ch <= 31) {
|
|
8848
|
+
if (isLineBreak(ch)) {
|
|
8849
|
+
result += text.substring(start, pos);
|
|
8850
|
+
scanError = 2;
|
|
8851
|
+
break;
|
|
8852
|
+
} else {
|
|
8853
|
+
scanError = 6;
|
|
8854
|
+
}
|
|
8855
|
+
}
|
|
8856
|
+
pos++;
|
|
8857
|
+
}
|
|
8858
|
+
return result;
|
|
8859
|
+
}
|
|
8860
|
+
function scanNext() {
|
|
8861
|
+
value = "";
|
|
8862
|
+
scanError = 0;
|
|
8863
|
+
tokenOffset = pos;
|
|
8864
|
+
lineStartOffset = lineNumber;
|
|
8865
|
+
prevTokenLineStartOffset = tokenLineStartOffset;
|
|
8866
|
+
if (pos >= len) {
|
|
8867
|
+
tokenOffset = len;
|
|
8868
|
+
return token = 17;
|
|
8869
|
+
}
|
|
8870
|
+
let code = text.charCodeAt(pos);
|
|
8871
|
+
if (isWhiteSpace(code)) {
|
|
8872
|
+
do {
|
|
8873
|
+
pos++;
|
|
8874
|
+
value += String.fromCharCode(code);
|
|
8875
|
+
code = text.charCodeAt(pos);
|
|
8876
|
+
} while (isWhiteSpace(code));
|
|
8877
|
+
return token = 15;
|
|
8878
|
+
}
|
|
8879
|
+
if (isLineBreak(code)) {
|
|
8880
|
+
pos++;
|
|
8881
|
+
value += String.fromCharCode(code);
|
|
8882
|
+
if (code === 13 && text.charCodeAt(pos) === 10) {
|
|
8883
|
+
pos++;
|
|
8884
|
+
value += `
|
|
8885
|
+
`;
|
|
8886
|
+
}
|
|
8887
|
+
lineNumber++;
|
|
8888
|
+
tokenLineStartOffset = pos;
|
|
8889
|
+
return token = 14;
|
|
8890
|
+
}
|
|
8891
|
+
switch (code) {
|
|
8892
|
+
case 123:
|
|
8893
|
+
pos++;
|
|
8894
|
+
return token = 1;
|
|
8895
|
+
case 125:
|
|
8896
|
+
pos++;
|
|
8897
|
+
return token = 2;
|
|
8898
|
+
case 91:
|
|
8899
|
+
pos++;
|
|
8900
|
+
return token = 3;
|
|
8901
|
+
case 93:
|
|
8902
|
+
pos++;
|
|
8903
|
+
return token = 4;
|
|
8904
|
+
case 58:
|
|
8905
|
+
pos++;
|
|
8906
|
+
return token = 6;
|
|
8907
|
+
case 44:
|
|
8908
|
+
pos++;
|
|
8909
|
+
return token = 5;
|
|
8910
|
+
case 34:
|
|
8911
|
+
pos++;
|
|
8912
|
+
value = scanString();
|
|
8913
|
+
return token = 10;
|
|
8914
|
+
case 47:
|
|
8915
|
+
const start = pos - 1;
|
|
8916
|
+
if (text.charCodeAt(pos + 1) === 47) {
|
|
8917
|
+
pos += 2;
|
|
8918
|
+
while (pos < len) {
|
|
8919
|
+
if (isLineBreak(text.charCodeAt(pos))) {
|
|
8920
|
+
break;
|
|
8921
|
+
}
|
|
8922
|
+
pos++;
|
|
8923
|
+
}
|
|
8924
|
+
value = text.substring(start, pos);
|
|
8925
|
+
return token = 12;
|
|
8926
|
+
}
|
|
8927
|
+
if (text.charCodeAt(pos + 1) === 42) {
|
|
8928
|
+
pos += 2;
|
|
8929
|
+
const safeLength = len - 1;
|
|
8930
|
+
let commentClosed = false;
|
|
8931
|
+
while (pos < safeLength) {
|
|
8932
|
+
const ch = text.charCodeAt(pos);
|
|
8933
|
+
if (ch === 42 && text.charCodeAt(pos + 1) === 47) {
|
|
8934
|
+
pos += 2;
|
|
8935
|
+
commentClosed = true;
|
|
8936
|
+
break;
|
|
8937
|
+
}
|
|
8938
|
+
pos++;
|
|
8939
|
+
if (isLineBreak(ch)) {
|
|
8940
|
+
if (ch === 13 && text.charCodeAt(pos) === 10) {
|
|
8941
|
+
pos++;
|
|
8942
|
+
}
|
|
8943
|
+
lineNumber++;
|
|
8944
|
+
tokenLineStartOffset = pos;
|
|
8945
|
+
}
|
|
8946
|
+
}
|
|
8947
|
+
if (!commentClosed) {
|
|
8948
|
+
pos++;
|
|
8949
|
+
scanError = 1;
|
|
8950
|
+
}
|
|
8951
|
+
value = text.substring(start, pos);
|
|
8952
|
+
return token = 13;
|
|
8953
|
+
}
|
|
8954
|
+
value += String.fromCharCode(code);
|
|
8955
|
+
pos++;
|
|
8956
|
+
return token = 16;
|
|
8957
|
+
case 45:
|
|
8958
|
+
value += String.fromCharCode(code);
|
|
8959
|
+
pos++;
|
|
8960
|
+
if (pos === len || !isDigit(text.charCodeAt(pos))) {
|
|
8961
|
+
return token = 16;
|
|
8962
|
+
}
|
|
8963
|
+
case 48:
|
|
8964
|
+
case 49:
|
|
8965
|
+
case 50:
|
|
8966
|
+
case 51:
|
|
8967
|
+
case 52:
|
|
8968
|
+
case 53:
|
|
8969
|
+
case 54:
|
|
8970
|
+
case 55:
|
|
8971
|
+
case 56:
|
|
8972
|
+
case 57:
|
|
8973
|
+
value += scanNumber();
|
|
8974
|
+
return token = 11;
|
|
8975
|
+
default:
|
|
8976
|
+
while (pos < len && isUnknownContentCharacter(code)) {
|
|
8977
|
+
pos++;
|
|
8978
|
+
code = text.charCodeAt(pos);
|
|
8979
|
+
}
|
|
8980
|
+
if (tokenOffset !== pos) {
|
|
8981
|
+
value = text.substring(tokenOffset, pos);
|
|
8982
|
+
switch (value) {
|
|
8983
|
+
case "true":
|
|
8984
|
+
return token = 8;
|
|
8985
|
+
case "false":
|
|
8986
|
+
return token = 9;
|
|
8987
|
+
case "null":
|
|
8988
|
+
return token = 7;
|
|
8989
|
+
}
|
|
8990
|
+
return token = 16;
|
|
8991
|
+
}
|
|
8992
|
+
value += String.fromCharCode(code);
|
|
8993
|
+
pos++;
|
|
8994
|
+
return token = 16;
|
|
8995
|
+
}
|
|
8996
|
+
}
|
|
8997
|
+
function isUnknownContentCharacter(code) {
|
|
8998
|
+
if (isWhiteSpace(code) || isLineBreak(code)) {
|
|
8999
|
+
return false;
|
|
9000
|
+
}
|
|
9001
|
+
switch (code) {
|
|
9002
|
+
case 125:
|
|
9003
|
+
case 93:
|
|
9004
|
+
case 123:
|
|
9005
|
+
case 91:
|
|
9006
|
+
case 34:
|
|
9007
|
+
case 58:
|
|
9008
|
+
case 44:
|
|
9009
|
+
case 47:
|
|
9010
|
+
return false;
|
|
9011
|
+
}
|
|
9012
|
+
return true;
|
|
9013
|
+
}
|
|
9014
|
+
function scanNextNonTrivia() {
|
|
9015
|
+
let result;
|
|
9016
|
+
do {
|
|
9017
|
+
result = scanNext();
|
|
9018
|
+
} while (result >= 12 && result <= 15);
|
|
9019
|
+
return result;
|
|
9020
|
+
}
|
|
9021
|
+
return {
|
|
9022
|
+
setPosition,
|
|
9023
|
+
getPosition: () => pos,
|
|
9024
|
+
scan: ignoreTrivia ? scanNextNonTrivia : scanNext,
|
|
9025
|
+
getToken: () => token,
|
|
9026
|
+
getTokenValue: () => value,
|
|
9027
|
+
getTokenOffset: () => tokenOffset,
|
|
9028
|
+
getTokenLength: () => pos - tokenOffset,
|
|
9029
|
+
getTokenStartLine: () => lineStartOffset,
|
|
9030
|
+
getTokenStartCharacter: () => tokenOffset - prevTokenLineStartOffset,
|
|
9031
|
+
getTokenError: () => scanError
|
|
9032
|
+
};
|
|
9033
|
+
}
|
|
9034
|
+
function isWhiteSpace(ch) {
|
|
9035
|
+
return ch === 32 || ch === 9;
|
|
9036
|
+
}
|
|
9037
|
+
function isLineBreak(ch) {
|
|
9038
|
+
return ch === 10 || ch === 13;
|
|
9039
|
+
}
|
|
9040
|
+
function isDigit(ch) {
|
|
9041
|
+
return ch >= 48 && ch <= 57;
|
|
9042
|
+
}
|
|
9043
|
+
var CharacterCodes;
|
|
9044
|
+
(function(CharacterCodes2) {
|
|
9045
|
+
CharacterCodes2[CharacterCodes2["lineFeed"] = 10] = "lineFeed";
|
|
9046
|
+
CharacterCodes2[CharacterCodes2["carriageReturn"] = 13] = "carriageReturn";
|
|
9047
|
+
CharacterCodes2[CharacterCodes2["space"] = 32] = "space";
|
|
9048
|
+
CharacterCodes2[CharacterCodes2["_0"] = 48] = "_0";
|
|
9049
|
+
CharacterCodes2[CharacterCodes2["_1"] = 49] = "_1";
|
|
9050
|
+
CharacterCodes2[CharacterCodes2["_2"] = 50] = "_2";
|
|
9051
|
+
CharacterCodes2[CharacterCodes2["_3"] = 51] = "_3";
|
|
9052
|
+
CharacterCodes2[CharacterCodes2["_4"] = 52] = "_4";
|
|
9053
|
+
CharacterCodes2[CharacterCodes2["_5"] = 53] = "_5";
|
|
9054
|
+
CharacterCodes2[CharacterCodes2["_6"] = 54] = "_6";
|
|
9055
|
+
CharacterCodes2[CharacterCodes2["_7"] = 55] = "_7";
|
|
9056
|
+
CharacterCodes2[CharacterCodes2["_8"] = 56] = "_8";
|
|
9057
|
+
CharacterCodes2[CharacterCodes2["_9"] = 57] = "_9";
|
|
9058
|
+
CharacterCodes2[CharacterCodes2["a"] = 97] = "a";
|
|
9059
|
+
CharacterCodes2[CharacterCodes2["b"] = 98] = "b";
|
|
9060
|
+
CharacterCodes2[CharacterCodes2["c"] = 99] = "c";
|
|
9061
|
+
CharacterCodes2[CharacterCodes2["d"] = 100] = "d";
|
|
9062
|
+
CharacterCodes2[CharacterCodes2["e"] = 101] = "e";
|
|
9063
|
+
CharacterCodes2[CharacterCodes2["f"] = 102] = "f";
|
|
9064
|
+
CharacterCodes2[CharacterCodes2["g"] = 103] = "g";
|
|
9065
|
+
CharacterCodes2[CharacterCodes2["h"] = 104] = "h";
|
|
9066
|
+
CharacterCodes2[CharacterCodes2["i"] = 105] = "i";
|
|
9067
|
+
CharacterCodes2[CharacterCodes2["j"] = 106] = "j";
|
|
9068
|
+
CharacterCodes2[CharacterCodes2["k"] = 107] = "k";
|
|
9069
|
+
CharacterCodes2[CharacterCodes2["l"] = 108] = "l";
|
|
9070
|
+
CharacterCodes2[CharacterCodes2["m"] = 109] = "m";
|
|
9071
|
+
CharacterCodes2[CharacterCodes2["n"] = 110] = "n";
|
|
9072
|
+
CharacterCodes2[CharacterCodes2["o"] = 111] = "o";
|
|
9073
|
+
CharacterCodes2[CharacterCodes2["p"] = 112] = "p";
|
|
9074
|
+
CharacterCodes2[CharacterCodes2["q"] = 113] = "q";
|
|
9075
|
+
CharacterCodes2[CharacterCodes2["r"] = 114] = "r";
|
|
9076
|
+
CharacterCodes2[CharacterCodes2["s"] = 115] = "s";
|
|
9077
|
+
CharacterCodes2[CharacterCodes2["t"] = 116] = "t";
|
|
9078
|
+
CharacterCodes2[CharacterCodes2["u"] = 117] = "u";
|
|
9079
|
+
CharacterCodes2[CharacterCodes2["v"] = 118] = "v";
|
|
9080
|
+
CharacterCodes2[CharacterCodes2["w"] = 119] = "w";
|
|
9081
|
+
CharacterCodes2[CharacterCodes2["x"] = 120] = "x";
|
|
9082
|
+
CharacterCodes2[CharacterCodes2["y"] = 121] = "y";
|
|
9083
|
+
CharacterCodes2[CharacterCodes2["z"] = 122] = "z";
|
|
9084
|
+
CharacterCodes2[CharacterCodes2["A"] = 65] = "A";
|
|
9085
|
+
CharacterCodes2[CharacterCodes2["B"] = 66] = "B";
|
|
9086
|
+
CharacterCodes2[CharacterCodes2["C"] = 67] = "C";
|
|
9087
|
+
CharacterCodes2[CharacterCodes2["D"] = 68] = "D";
|
|
9088
|
+
CharacterCodes2[CharacterCodes2["E"] = 69] = "E";
|
|
9089
|
+
CharacterCodes2[CharacterCodes2["F"] = 70] = "F";
|
|
9090
|
+
CharacterCodes2[CharacterCodes2["G"] = 71] = "G";
|
|
9091
|
+
CharacterCodes2[CharacterCodes2["H"] = 72] = "H";
|
|
9092
|
+
CharacterCodes2[CharacterCodes2["I"] = 73] = "I";
|
|
9093
|
+
CharacterCodes2[CharacterCodes2["J"] = 74] = "J";
|
|
9094
|
+
CharacterCodes2[CharacterCodes2["K"] = 75] = "K";
|
|
9095
|
+
CharacterCodes2[CharacterCodes2["L"] = 76] = "L";
|
|
9096
|
+
CharacterCodes2[CharacterCodes2["M"] = 77] = "M";
|
|
9097
|
+
CharacterCodes2[CharacterCodes2["N"] = 78] = "N";
|
|
9098
|
+
CharacterCodes2[CharacterCodes2["O"] = 79] = "O";
|
|
9099
|
+
CharacterCodes2[CharacterCodes2["P"] = 80] = "P";
|
|
9100
|
+
CharacterCodes2[CharacterCodes2["Q"] = 81] = "Q";
|
|
9101
|
+
CharacterCodes2[CharacterCodes2["R"] = 82] = "R";
|
|
9102
|
+
CharacterCodes2[CharacterCodes2["S"] = 83] = "S";
|
|
9103
|
+
CharacterCodes2[CharacterCodes2["T"] = 84] = "T";
|
|
9104
|
+
CharacterCodes2[CharacterCodes2["U"] = 85] = "U";
|
|
9105
|
+
CharacterCodes2[CharacterCodes2["V"] = 86] = "V";
|
|
9106
|
+
CharacterCodes2[CharacterCodes2["W"] = 87] = "W";
|
|
9107
|
+
CharacterCodes2[CharacterCodes2["X"] = 88] = "X";
|
|
9108
|
+
CharacterCodes2[CharacterCodes2["Y"] = 89] = "Y";
|
|
9109
|
+
CharacterCodes2[CharacterCodes2["Z"] = 90] = "Z";
|
|
9110
|
+
CharacterCodes2[CharacterCodes2["asterisk"] = 42] = "asterisk";
|
|
9111
|
+
CharacterCodes2[CharacterCodes2["backslash"] = 92] = "backslash";
|
|
9112
|
+
CharacterCodes2[CharacterCodes2["closeBrace"] = 125] = "closeBrace";
|
|
9113
|
+
CharacterCodes2[CharacterCodes2["closeBracket"] = 93] = "closeBracket";
|
|
9114
|
+
CharacterCodes2[CharacterCodes2["colon"] = 58] = "colon";
|
|
9115
|
+
CharacterCodes2[CharacterCodes2["comma"] = 44] = "comma";
|
|
9116
|
+
CharacterCodes2[CharacterCodes2["dot"] = 46] = "dot";
|
|
9117
|
+
CharacterCodes2[CharacterCodes2["doubleQuote"] = 34] = "doubleQuote";
|
|
9118
|
+
CharacterCodes2[CharacterCodes2["minus"] = 45] = "minus";
|
|
9119
|
+
CharacterCodes2[CharacterCodes2["openBrace"] = 123] = "openBrace";
|
|
9120
|
+
CharacterCodes2[CharacterCodes2["openBracket"] = 91] = "openBracket";
|
|
9121
|
+
CharacterCodes2[CharacterCodes2["plus"] = 43] = "plus";
|
|
9122
|
+
CharacterCodes2[CharacterCodes2["slash"] = 47] = "slash";
|
|
9123
|
+
CharacterCodes2[CharacterCodes2["formFeed"] = 12] = "formFeed";
|
|
9124
|
+
CharacterCodes2[CharacterCodes2["tab"] = 9] = "tab";
|
|
9125
|
+
})(CharacterCodes || (CharacterCodes = {}));
|
|
9126
|
+
|
|
9127
|
+
// ../../node_modules/.bun/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/string-intern.js
|
|
9128
|
+
var cachedSpaces = new Array(20).fill(0).map((_, index) => {
|
|
9129
|
+
return " ".repeat(index);
|
|
9130
|
+
});
|
|
9131
|
+
var maxCachedValues = 200;
|
|
9132
|
+
var cachedBreakLinesWithSpaces = {
|
|
9133
|
+
" ": {
|
|
9134
|
+
"\n": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
9135
|
+
return `
|
|
9136
|
+
` + " ".repeat(index);
|
|
9137
|
+
}),
|
|
9138
|
+
"\r": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
9139
|
+
return "\r" + " ".repeat(index);
|
|
9140
|
+
}),
|
|
9141
|
+
"\r\n": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
9142
|
+
return `\r
|
|
9143
|
+
` + " ".repeat(index);
|
|
9144
|
+
})
|
|
9145
|
+
},
|
|
9146
|
+
"\t": {
|
|
9147
|
+
"\n": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
9148
|
+
return `
|
|
9149
|
+
` + "\t".repeat(index);
|
|
9150
|
+
}),
|
|
9151
|
+
"\r": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
9152
|
+
return "\r" + "\t".repeat(index);
|
|
9153
|
+
}),
|
|
9154
|
+
"\r\n": new Array(maxCachedValues).fill(0).map((_, index) => {
|
|
9155
|
+
return `\r
|
|
9156
|
+
` + "\t".repeat(index);
|
|
9157
|
+
})
|
|
9158
|
+
}
|
|
8725
9159
|
};
|
|
8726
|
-
|
|
8727
|
-
|
|
8728
|
-
|
|
8729
|
-
|
|
8730
|
-
|
|
8731
|
-
|
|
8732
|
-
|
|
8733
|
-
|
|
8734
|
-
|
|
8735
|
-
let
|
|
8736
|
-
let
|
|
8737
|
-
|
|
8738
|
-
|
|
8739
|
-
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8746
|
-
|
|
8747
|
-
|
|
9160
|
+
|
|
9161
|
+
// ../../node_modules/.bun/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/parser.js
|
|
9162
|
+
var ParseOptions;
|
|
9163
|
+
(function(ParseOptions2) {
|
|
9164
|
+
ParseOptions2.DEFAULT = {
|
|
9165
|
+
allowTrailingComma: false
|
|
9166
|
+
};
|
|
9167
|
+
})(ParseOptions || (ParseOptions = {}));
|
|
9168
|
+
function parse(text, errors2 = [], options = ParseOptions.DEFAULT) {
|
|
9169
|
+
let currentProperty = null;
|
|
9170
|
+
let currentParent = [];
|
|
9171
|
+
const previousParents = [];
|
|
9172
|
+
function onValue(value) {
|
|
9173
|
+
if (Array.isArray(currentParent)) {
|
|
9174
|
+
currentParent.push(value);
|
|
9175
|
+
} else if (currentProperty !== null) {
|
|
9176
|
+
currentParent[currentProperty] = value;
|
|
9177
|
+
}
|
|
9178
|
+
}
|
|
9179
|
+
const visitor = {
|
|
9180
|
+
onObjectBegin: () => {
|
|
9181
|
+
const object = {};
|
|
9182
|
+
onValue(object);
|
|
9183
|
+
previousParents.push(currentParent);
|
|
9184
|
+
currentParent = object;
|
|
9185
|
+
currentProperty = null;
|
|
9186
|
+
},
|
|
9187
|
+
onObjectProperty: (name) => {
|
|
9188
|
+
currentProperty = name;
|
|
9189
|
+
},
|
|
9190
|
+
onObjectEnd: () => {
|
|
9191
|
+
currentParent = previousParents.pop();
|
|
9192
|
+
},
|
|
9193
|
+
onArrayBegin: () => {
|
|
9194
|
+
const array = [];
|
|
9195
|
+
onValue(array);
|
|
9196
|
+
previousParents.push(currentParent);
|
|
9197
|
+
currentParent = array;
|
|
9198
|
+
currentProperty = null;
|
|
9199
|
+
},
|
|
9200
|
+
onArrayEnd: () => {
|
|
9201
|
+
currentParent = previousParents.pop();
|
|
9202
|
+
},
|
|
9203
|
+
onLiteralValue: onValue,
|
|
9204
|
+
onError: (error, offset, length) => {
|
|
9205
|
+
errors2.push({ error, offset, length });
|
|
8748
9206
|
}
|
|
8749
|
-
|
|
8750
|
-
|
|
8751
|
-
|
|
8752
|
-
|
|
8753
|
-
|
|
8754
|
-
|
|
8755
|
-
|
|
8756
|
-
|
|
8757
|
-
|
|
8758
|
-
|
|
8759
|
-
|
|
8760
|
-
|
|
8761
|
-
|
|
8762
|
-
|
|
8763
|
-
|
|
8764
|
-
|
|
8765
|
-
|
|
8766
|
-
|
|
8767
|
-
|
|
8768
|
-
|
|
8769
|
-
|
|
8770
|
-
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
|
|
8779
|
-
|
|
8780
|
-
|
|
8781
|
-
|
|
8782
|
-
|
|
8783
|
-
|
|
8784
|
-
|
|
8785
|
-
|
|
8786
|
-
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
9207
|
+
};
|
|
9208
|
+
visit(text, visitor, options);
|
|
9209
|
+
return currentParent[0];
|
|
9210
|
+
}
|
|
9211
|
+
function visit(text, visitor, options = ParseOptions.DEFAULT) {
|
|
9212
|
+
const _scanner = createScanner(text, false);
|
|
9213
|
+
const _jsonPath = [];
|
|
9214
|
+
let suppressedCallbacks = 0;
|
|
9215
|
+
function toNoArgVisit(visitFunction) {
|
|
9216
|
+
return visitFunction ? () => suppressedCallbacks === 0 && visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
|
|
9217
|
+
}
|
|
9218
|
+
function toOneArgVisit(visitFunction) {
|
|
9219
|
+
return visitFunction ? (arg) => suppressedCallbacks === 0 && visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;
|
|
9220
|
+
}
|
|
9221
|
+
function toOneArgVisitWithPath(visitFunction) {
|
|
9222
|
+
return visitFunction ? (arg) => suppressedCallbacks === 0 && visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;
|
|
9223
|
+
}
|
|
9224
|
+
function toBeginVisit(visitFunction) {
|
|
9225
|
+
return visitFunction ? () => {
|
|
9226
|
+
if (suppressedCallbacks > 0) {
|
|
9227
|
+
suppressedCallbacks++;
|
|
9228
|
+
} else {
|
|
9229
|
+
let cbReturn = visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice());
|
|
9230
|
+
if (cbReturn === false) {
|
|
9231
|
+
suppressedCallbacks = 1;
|
|
9232
|
+
}
|
|
9233
|
+
}
|
|
9234
|
+
} : () => true;
|
|
9235
|
+
}
|
|
9236
|
+
function toEndVisit(visitFunction) {
|
|
9237
|
+
return visitFunction ? () => {
|
|
9238
|
+
if (suppressedCallbacks > 0) {
|
|
9239
|
+
suppressedCallbacks--;
|
|
9240
|
+
}
|
|
9241
|
+
if (suppressedCallbacks === 0) {
|
|
9242
|
+
visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter());
|
|
9243
|
+
}
|
|
9244
|
+
} : () => true;
|
|
9245
|
+
}
|
|
9246
|
+
const onObjectBegin = toBeginVisit(visitor.onObjectBegin), onObjectProperty = toOneArgVisitWithPath(visitor.onObjectProperty), onObjectEnd = toEndVisit(visitor.onObjectEnd), onArrayBegin = toBeginVisit(visitor.onArrayBegin), onArrayEnd = toEndVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisitWithPath(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError = toOneArgVisit(visitor.onError);
|
|
9247
|
+
const disallowComments = options && options.disallowComments;
|
|
9248
|
+
const allowTrailingComma = options && options.allowTrailingComma;
|
|
9249
|
+
function scanNext() {
|
|
9250
|
+
while (true) {
|
|
9251
|
+
const token = _scanner.scan();
|
|
9252
|
+
switch (_scanner.getTokenError()) {
|
|
9253
|
+
case 4:
|
|
9254
|
+
handleError(14);
|
|
9255
|
+
break;
|
|
9256
|
+
case 5:
|
|
9257
|
+
handleError(15);
|
|
9258
|
+
break;
|
|
9259
|
+
case 3:
|
|
9260
|
+
handleError(13);
|
|
9261
|
+
break;
|
|
9262
|
+
case 1:
|
|
9263
|
+
if (!disallowComments) {
|
|
9264
|
+
handleError(11);
|
|
9265
|
+
}
|
|
9266
|
+
break;
|
|
9267
|
+
case 2:
|
|
9268
|
+
handleError(12);
|
|
9269
|
+
break;
|
|
9270
|
+
case 6:
|
|
9271
|
+
handleError(16);
|
|
9272
|
+
break;
|
|
9273
|
+
}
|
|
9274
|
+
switch (token) {
|
|
9275
|
+
case 12:
|
|
9276
|
+
case 13:
|
|
9277
|
+
if (disallowComments) {
|
|
9278
|
+
handleError(10);
|
|
9279
|
+
} else {
|
|
9280
|
+
onComment();
|
|
9281
|
+
}
|
|
9282
|
+
break;
|
|
9283
|
+
case 16:
|
|
9284
|
+
handleError(1);
|
|
9285
|
+
break;
|
|
9286
|
+
case 15:
|
|
9287
|
+
case 14:
|
|
9288
|
+
break;
|
|
9289
|
+
default:
|
|
9290
|
+
return token;
|
|
9291
|
+
}
|
|
9292
|
+
}
|
|
9293
|
+
}
|
|
9294
|
+
function handleError(error, skipUntilAfter = [], skipUntil = []) {
|
|
9295
|
+
onError(error);
|
|
9296
|
+
if (skipUntilAfter.length + skipUntil.length > 0) {
|
|
9297
|
+
let token = _scanner.getToken();
|
|
9298
|
+
while (token !== 17) {
|
|
9299
|
+
if (skipUntilAfter.indexOf(token) !== -1) {
|
|
9300
|
+
scanNext();
|
|
9301
|
+
break;
|
|
9302
|
+
} else if (skipUntil.indexOf(token) !== -1) {
|
|
9303
|
+
break;
|
|
9304
|
+
}
|
|
9305
|
+
token = scanNext();
|
|
9306
|
+
}
|
|
9307
|
+
}
|
|
9308
|
+
}
|
|
9309
|
+
function parseString(isValue) {
|
|
9310
|
+
const value = _scanner.getTokenValue();
|
|
9311
|
+
if (isValue) {
|
|
9312
|
+
onLiteralValue(value);
|
|
9313
|
+
} else {
|
|
9314
|
+
onObjectProperty(value);
|
|
9315
|
+
_jsonPath.push(value);
|
|
9316
|
+
}
|
|
9317
|
+
scanNext();
|
|
9318
|
+
return true;
|
|
9319
|
+
}
|
|
9320
|
+
function parseLiteral() {
|
|
9321
|
+
switch (_scanner.getToken()) {
|
|
9322
|
+
case 11:
|
|
9323
|
+
const tokenValue = _scanner.getTokenValue();
|
|
9324
|
+
let value = Number(tokenValue);
|
|
9325
|
+
if (isNaN(value)) {
|
|
9326
|
+
handleError(2);
|
|
9327
|
+
value = 0;
|
|
9328
|
+
}
|
|
9329
|
+
onLiteralValue(value);
|
|
9330
|
+
break;
|
|
9331
|
+
case 7:
|
|
9332
|
+
onLiteralValue(null);
|
|
9333
|
+
break;
|
|
9334
|
+
case 8:
|
|
9335
|
+
onLiteralValue(true);
|
|
9336
|
+
break;
|
|
9337
|
+
case 9:
|
|
9338
|
+
onLiteralValue(false);
|
|
9339
|
+
break;
|
|
9340
|
+
default:
|
|
9341
|
+
return false;
|
|
9342
|
+
}
|
|
9343
|
+
scanNext();
|
|
9344
|
+
return true;
|
|
9345
|
+
}
|
|
9346
|
+
function parseProperty() {
|
|
9347
|
+
if (_scanner.getToken() !== 10) {
|
|
9348
|
+
handleError(3, [], [2, 5]);
|
|
9349
|
+
return false;
|
|
9350
|
+
}
|
|
9351
|
+
parseString(false);
|
|
9352
|
+
if (_scanner.getToken() === 6) {
|
|
9353
|
+
onSeparator(":");
|
|
9354
|
+
scanNext();
|
|
9355
|
+
if (!parseValue()) {
|
|
9356
|
+
handleError(4, [], [2, 5]);
|
|
9357
|
+
}
|
|
9358
|
+
} else {
|
|
9359
|
+
handleError(5, [], [2, 5]);
|
|
9360
|
+
}
|
|
9361
|
+
_jsonPath.pop();
|
|
9362
|
+
return true;
|
|
9363
|
+
}
|
|
9364
|
+
function parseObject() {
|
|
9365
|
+
onObjectBegin();
|
|
9366
|
+
scanNext();
|
|
9367
|
+
let needsComma = false;
|
|
9368
|
+
while (_scanner.getToken() !== 2 && _scanner.getToken() !== 17) {
|
|
9369
|
+
if (_scanner.getToken() === 5) {
|
|
9370
|
+
if (!needsComma) {
|
|
9371
|
+
handleError(4, [], []);
|
|
9372
|
+
}
|
|
9373
|
+
onSeparator(",");
|
|
9374
|
+
scanNext();
|
|
9375
|
+
if (_scanner.getToken() === 2 && allowTrailingComma) {
|
|
9376
|
+
break;
|
|
9377
|
+
}
|
|
9378
|
+
} else if (needsComma) {
|
|
9379
|
+
handleError(6, [], []);
|
|
9380
|
+
}
|
|
9381
|
+
if (!parseProperty()) {
|
|
9382
|
+
handleError(4, [], [2, 5]);
|
|
9383
|
+
}
|
|
9384
|
+
needsComma = true;
|
|
9385
|
+
}
|
|
9386
|
+
onObjectEnd();
|
|
9387
|
+
if (_scanner.getToken() !== 2) {
|
|
9388
|
+
handleError(7, [2], []);
|
|
9389
|
+
} else {
|
|
9390
|
+
scanNext();
|
|
9391
|
+
}
|
|
9392
|
+
return true;
|
|
9393
|
+
}
|
|
9394
|
+
function parseArray() {
|
|
9395
|
+
onArrayBegin();
|
|
9396
|
+
scanNext();
|
|
9397
|
+
let isFirstElement = true;
|
|
9398
|
+
let needsComma = false;
|
|
9399
|
+
while (_scanner.getToken() !== 4 && _scanner.getToken() !== 17) {
|
|
9400
|
+
if (_scanner.getToken() === 5) {
|
|
9401
|
+
if (!needsComma) {
|
|
9402
|
+
handleError(4, [], []);
|
|
9403
|
+
}
|
|
9404
|
+
onSeparator(",");
|
|
9405
|
+
scanNext();
|
|
9406
|
+
if (_scanner.getToken() === 4 && allowTrailingComma) {
|
|
9407
|
+
break;
|
|
8791
9408
|
}
|
|
8792
|
-
} else if (
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
|
|
8796
|
-
|
|
9409
|
+
} else if (needsComma) {
|
|
9410
|
+
handleError(6, [], []);
|
|
9411
|
+
}
|
|
9412
|
+
if (isFirstElement) {
|
|
9413
|
+
_jsonPath.push(0);
|
|
9414
|
+
isFirstElement = false;
|
|
9415
|
+
} else {
|
|
9416
|
+
_jsonPath[_jsonPath.length - 1]++;
|
|
9417
|
+
}
|
|
9418
|
+
if (!parseValue()) {
|
|
9419
|
+
handleError(4, [], [4, 5]);
|
|
8797
9420
|
}
|
|
9421
|
+
needsComma = true;
|
|
9422
|
+
}
|
|
9423
|
+
onArrayEnd();
|
|
9424
|
+
if (!isFirstElement) {
|
|
9425
|
+
_jsonPath.pop();
|
|
8798
9426
|
}
|
|
9427
|
+
if (_scanner.getToken() !== 4) {
|
|
9428
|
+
handleError(8, [4], []);
|
|
9429
|
+
} else {
|
|
9430
|
+
scanNext();
|
|
9431
|
+
}
|
|
9432
|
+
return true;
|
|
8799
9433
|
}
|
|
8800
|
-
|
|
8801
|
-
|
|
9434
|
+
function parseValue() {
|
|
9435
|
+
switch (_scanner.getToken()) {
|
|
9436
|
+
case 3:
|
|
9437
|
+
return parseArray();
|
|
9438
|
+
case 1:
|
|
9439
|
+
return parseObject();
|
|
9440
|
+
case 10:
|
|
9441
|
+
return parseString(true);
|
|
9442
|
+
default:
|
|
9443
|
+
return parseLiteral();
|
|
9444
|
+
}
|
|
9445
|
+
}
|
|
9446
|
+
scanNext();
|
|
9447
|
+
if (_scanner.getToken() === 17) {
|
|
9448
|
+
if (options.allowEmptyContent) {
|
|
9449
|
+
return true;
|
|
9450
|
+
}
|
|
9451
|
+
handleError(4, [], []);
|
|
9452
|
+
return false;
|
|
9453
|
+
}
|
|
9454
|
+
if (!parseValue()) {
|
|
9455
|
+
handleError(4, [], []);
|
|
9456
|
+
return false;
|
|
9457
|
+
}
|
|
9458
|
+
if (_scanner.getToken() !== 17) {
|
|
9459
|
+
handleError(9, [], []);
|
|
9460
|
+
}
|
|
9461
|
+
return true;
|
|
8802
9462
|
}
|
|
8803
9463
|
|
|
9464
|
+
// ../../node_modules/.bun/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/main.js
|
|
9465
|
+
var ScanError;
|
|
9466
|
+
(function(ScanError2) {
|
|
9467
|
+
ScanError2[ScanError2["None"] = 0] = "None";
|
|
9468
|
+
ScanError2[ScanError2["UnexpectedEndOfComment"] = 1] = "UnexpectedEndOfComment";
|
|
9469
|
+
ScanError2[ScanError2["UnexpectedEndOfString"] = 2] = "UnexpectedEndOfString";
|
|
9470
|
+
ScanError2[ScanError2["UnexpectedEndOfNumber"] = 3] = "UnexpectedEndOfNumber";
|
|
9471
|
+
ScanError2[ScanError2["InvalidUnicode"] = 4] = "InvalidUnicode";
|
|
9472
|
+
ScanError2[ScanError2["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter";
|
|
9473
|
+
ScanError2[ScanError2["InvalidCharacter"] = 6] = "InvalidCharacter";
|
|
9474
|
+
})(ScanError || (ScanError = {}));
|
|
9475
|
+
var SyntaxKind;
|
|
9476
|
+
(function(SyntaxKind2) {
|
|
9477
|
+
SyntaxKind2[SyntaxKind2["OpenBraceToken"] = 1] = "OpenBraceToken";
|
|
9478
|
+
SyntaxKind2[SyntaxKind2["CloseBraceToken"] = 2] = "CloseBraceToken";
|
|
9479
|
+
SyntaxKind2[SyntaxKind2["OpenBracketToken"] = 3] = "OpenBracketToken";
|
|
9480
|
+
SyntaxKind2[SyntaxKind2["CloseBracketToken"] = 4] = "CloseBracketToken";
|
|
9481
|
+
SyntaxKind2[SyntaxKind2["CommaToken"] = 5] = "CommaToken";
|
|
9482
|
+
SyntaxKind2[SyntaxKind2["ColonToken"] = 6] = "ColonToken";
|
|
9483
|
+
SyntaxKind2[SyntaxKind2["NullKeyword"] = 7] = "NullKeyword";
|
|
9484
|
+
SyntaxKind2[SyntaxKind2["TrueKeyword"] = 8] = "TrueKeyword";
|
|
9485
|
+
SyntaxKind2[SyntaxKind2["FalseKeyword"] = 9] = "FalseKeyword";
|
|
9486
|
+
SyntaxKind2[SyntaxKind2["StringLiteral"] = 10] = "StringLiteral";
|
|
9487
|
+
SyntaxKind2[SyntaxKind2["NumericLiteral"] = 11] = "NumericLiteral";
|
|
9488
|
+
SyntaxKind2[SyntaxKind2["LineCommentTrivia"] = 12] = "LineCommentTrivia";
|
|
9489
|
+
SyntaxKind2[SyntaxKind2["BlockCommentTrivia"] = 13] = "BlockCommentTrivia";
|
|
9490
|
+
SyntaxKind2[SyntaxKind2["LineBreakTrivia"] = 14] = "LineBreakTrivia";
|
|
9491
|
+
SyntaxKind2[SyntaxKind2["Trivia"] = 15] = "Trivia";
|
|
9492
|
+
SyntaxKind2[SyntaxKind2["Unknown"] = 16] = "Unknown";
|
|
9493
|
+
SyntaxKind2[SyntaxKind2["EOF"] = 17] = "EOF";
|
|
9494
|
+
})(SyntaxKind || (SyntaxKind = {}));
|
|
9495
|
+
var parse2 = parse;
|
|
9496
|
+
var ParseErrorCode;
|
|
9497
|
+
(function(ParseErrorCode2) {
|
|
9498
|
+
ParseErrorCode2[ParseErrorCode2["InvalidSymbol"] = 1] = "InvalidSymbol";
|
|
9499
|
+
ParseErrorCode2[ParseErrorCode2["InvalidNumberFormat"] = 2] = "InvalidNumberFormat";
|
|
9500
|
+
ParseErrorCode2[ParseErrorCode2["PropertyNameExpected"] = 3] = "PropertyNameExpected";
|
|
9501
|
+
ParseErrorCode2[ParseErrorCode2["ValueExpected"] = 4] = "ValueExpected";
|
|
9502
|
+
ParseErrorCode2[ParseErrorCode2["ColonExpected"] = 5] = "ColonExpected";
|
|
9503
|
+
ParseErrorCode2[ParseErrorCode2["CommaExpected"] = 6] = "CommaExpected";
|
|
9504
|
+
ParseErrorCode2[ParseErrorCode2["CloseBraceExpected"] = 7] = "CloseBraceExpected";
|
|
9505
|
+
ParseErrorCode2[ParseErrorCode2["CloseBracketExpected"] = 8] = "CloseBracketExpected";
|
|
9506
|
+
ParseErrorCode2[ParseErrorCode2["EndOfFileExpected"] = 9] = "EndOfFileExpected";
|
|
9507
|
+
ParseErrorCode2[ParseErrorCode2["InvalidCommentToken"] = 10] = "InvalidCommentToken";
|
|
9508
|
+
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfComment"] = 11] = "UnexpectedEndOfComment";
|
|
9509
|
+
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfString"] = 12] = "UnexpectedEndOfString";
|
|
9510
|
+
ParseErrorCode2[ParseErrorCode2["UnexpectedEndOfNumber"] = 13] = "UnexpectedEndOfNumber";
|
|
9511
|
+
ParseErrorCode2[ParseErrorCode2["InvalidUnicode"] = 14] = "InvalidUnicode";
|
|
9512
|
+
ParseErrorCode2[ParseErrorCode2["InvalidEscapeCharacter"] = 15] = "InvalidEscapeCharacter";
|
|
9513
|
+
ParseErrorCode2[ParseErrorCode2["InvalidCharacter"] = 16] = "InvalidCharacter";
|
|
9514
|
+
})(ParseErrorCode || (ParseErrorCode = {}));
|
|
9515
|
+
|
|
8804
9516
|
// src/registry/opencode-config.ts
|
|
8805
9517
|
async function readOpencodeConfig(cwd) {
|
|
8806
9518
|
const jsonPath = `${cwd}/opencode.json`;
|
|
@@ -8809,9 +9521,8 @@ async function readOpencodeConfig(cwd) {
|
|
|
8809
9521
|
const file = Bun.file(configPath);
|
|
8810
9522
|
if (await file.exists()) {
|
|
8811
9523
|
const content = await file.text();
|
|
8812
|
-
const stripped = configPath.endsWith(".jsonc") ? stripJsonComments(content) : content;
|
|
8813
9524
|
return {
|
|
8814
|
-
config:
|
|
9525
|
+
config: parse2(content, [], { allowTrailingComma: true }),
|
|
8815
9526
|
path: configPath
|
|
8816
9527
|
};
|
|
8817
9528
|
}
|
|
@@ -8976,13 +9687,6 @@ var opencodeConfigPatchSchema = exports_external.object({
|
|
|
8976
9687
|
});
|
|
8977
9688
|
var CONFIG_FILE = "ocx.jsonc";
|
|
8978
9689
|
var LOCK_FILE = "ocx.lock";
|
|
8979
|
-
function stripJsonComments2(content) {
|
|
8980
|
-
return content.replace(/("(?:[^"\\]|\\.)*")|(\/\*[\s\S]*?\*\/)|(\/\/.*)$/gm, (_match, string, _block, _line) => {
|
|
8981
|
-
if (string)
|
|
8982
|
-
return string;
|
|
8983
|
-
return "";
|
|
8984
|
-
});
|
|
8985
|
-
}
|
|
8986
9690
|
async function readOcxConfig(cwd) {
|
|
8987
9691
|
const configPath = `${cwd}/${CONFIG_FILE}`;
|
|
8988
9692
|
const file = Bun.file(configPath);
|
|
@@ -8991,7 +9695,7 @@ async function readOcxConfig(cwd) {
|
|
|
8991
9695
|
}
|
|
8992
9696
|
const content = await file.text();
|
|
8993
9697
|
try {
|
|
8994
|
-
const json =
|
|
9698
|
+
const json = parse2(content, [], { allowTrailingComma: true });
|
|
8995
9699
|
return ocxConfigSchema.parse(json);
|
|
8996
9700
|
} catch (error) {
|
|
8997
9701
|
console.error(`Error parsing ${configPath}:`, error);
|
|
@@ -9010,7 +9714,7 @@ async function readOcxLock(cwd) {
|
|
|
9010
9714
|
return null;
|
|
9011
9715
|
}
|
|
9012
9716
|
const content = await file.text();
|
|
9013
|
-
const json =
|
|
9717
|
+
const json = parse2(content, [], { allowTrailingComma: true });
|
|
9014
9718
|
return ocxLockSchema.parse(json);
|
|
9015
9719
|
}
|
|
9016
9720
|
|
|
@@ -11927,7 +12631,7 @@ function registerSearchCommand(program2) {
|
|
|
11927
12631
|
}
|
|
11928
12632
|
|
|
11929
12633
|
// src/index.ts
|
|
11930
|
-
var version = "1.0.
|
|
12634
|
+
var version = "1.0.4";
|
|
11931
12635
|
async function main2() {
|
|
11932
12636
|
const program2 = new Command().name("ocx").description("OpenCode Extensions - Install agents, skills, plugins, and commands").version(version);
|
|
11933
12637
|
registerInitCommand(program2);
|
|
@@ -11942,4 +12646,4 @@ main2().catch((err) => {
|
|
|
11942
12646
|
handleError(err);
|
|
11943
12647
|
});
|
|
11944
12648
|
|
|
11945
|
-
//# debugId=
|
|
12649
|
+
//# debugId=C39FF1FC1164FA0C64756E2164756E21
|