@stryke/capnp 0.12.95 → 0.12.97
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/bin/capnpc.cjs +418 -316
- package/bin/capnpc.d.cts +909 -4
- package/bin/capnpc.d.cts.map +1 -1
- package/bin/capnpc.d.mts +909 -4
- package/bin/capnpc.d.mts.map +1 -1
- package/bin/capnpc.mjs +381 -280
- package/bin/capnpc.mjs.map +1 -1
- package/dist/capnp-es.BHkXHvyK-B3-d8RNu.d.mts +2991 -0
- package/dist/capnp-es.BHkXHvyK-B3-d8RNu.d.mts.map +1 -0
- package/dist/capnp-es.BHkXHvyK-CQWXOqvU.d.cts +2991 -0
- package/dist/capnp-es.BHkXHvyK-CQWXOqvU.d.cts.map +1 -0
- package/dist/{capnp-es.GpvEvMIK-C4q8I6qy.mjs → capnp-es.GpvEvMIK-CH8kq1KS.mjs} +13 -6
- package/dist/{capnp-es.GpvEvMIK-C4q8I6qy.mjs.map → capnp-es.GpvEvMIK-CH8kq1KS.mjs.map} +1 -1
- package/dist/{capnp-es.GpvEvMIK-BcYm5JyH.cjs → capnp-es.GpvEvMIK-CZ5ZimCD.cjs} +12 -5
- package/dist/{compile-ySRLGi2G.mjs → compile-D_BOc0dD.mjs} +109 -15
- package/dist/compile-D_BOc0dD.mjs.map +1 -0
- package/dist/{compile-DgmKft8T.cjs → compile-Yq1zhccM.cjs} +113 -19
- package/dist/compile.cjs +2 -2
- package/dist/compile.d.cts +38 -3
- package/dist/compile.d.cts.map +1 -0
- package/dist/compile.d.mts +38 -3
- package/dist/compile.d.mts.map +1 -0
- package/dist/compile.mjs +1 -2
- package/dist/{dist-BlvFBzSi.mjs → dist-DQ7xmzRT.mjs} +385 -16
- package/dist/dist-DQ7xmzRT.mjs.map +1 -0
- package/dist/{dist-YywzZL3Q.cjs → dist-VMGxvENY.cjs} +381 -12
- package/dist/{helpers-B1zJTrkG.mjs → helpers-2TldkyGG.mjs} +149 -149
- package/dist/helpers-2TldkyGG.mjs.map +1 -0
- package/dist/{helpers-B7aznH9v.cjs → helpers-Dn4nWOb7.cjs} +177 -177
- package/dist/helpers.cjs +2 -1
- package/dist/helpers.d.cts +1 -2
- package/dist/helpers.d.cts.map +1 -1
- package/dist/helpers.d.mts +1 -2
- package/dist/helpers.d.mts.map +1 -1
- package/dist/helpers.mjs +1 -1
- package/dist/index-63Za7yNc.d.cts +736 -0
- package/dist/index-63Za7yNc.d.cts.map +1 -0
- package/dist/index-LYXu6eWz.d.mts +736 -0
- package/dist/index-LYXu6eWz.d.mts.map +1 -0
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +5 -4
- package/dist/index.d.mts +5 -4
- package/dist/index.mjs +4 -5
- package/dist/rpc-helpers.cjs +4 -3
- package/dist/rpc-helpers.d.cts +3 -4
- package/dist/rpc-helpers.d.cts.map +1 -1
- package/dist/rpc-helpers.d.mts +3 -4
- package/dist/rpc-helpers.d.mts.map +1 -1
- package/dist/rpc-helpers.mjs +2 -2
- package/dist/types-BjCOVfgj.d.cts +1506 -0
- package/dist/types-BjCOVfgj.d.cts.map +1 -0
- package/dist/types-CVzMn-TI.d.mts +1506 -0
- package/dist/types-CVzMn-TI.d.mts.map +1 -0
- package/dist/types.cjs +8 -2
- package/dist/types.d.cts +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.mjs +7 -2
- package/dist/types.mjs.map +1 -0
- package/package.json +8 -8
- package/schemas/cpp.cjs +1 -0
- package/schemas/cpp.d.cts.map +1 -1
- package/schemas/cpp.d.mts.map +1 -1
- package/schemas/index-BB47pUzp.d.cts +742 -0
- package/schemas/index-BB47pUzp.d.cts.map +1 -0
- package/schemas/index-DprjZUdT.d.mts +742 -0
- package/schemas/index-DprjZUdT.d.mts.map +1 -0
- package/schemas/persistent.cjs +2 -1
- package/schemas/persistent.d.cts +48 -21
- package/schemas/persistent.d.cts.map +1 -1
- package/schemas/persistent.d.mts +48 -21
- package/schemas/persistent.d.mts.map +1 -1
- package/schemas/persistent.mjs +1 -1
- package/schemas/persistent.mjs.map +1 -1
- package/schemas/rpc-twoparty.cjs +20 -1
- package/schemas/rpc-twoparty.d.cts +17 -17
- package/schemas/rpc-twoparty.d.cts.map +1 -1
- package/schemas/rpc-twoparty.d.mts +17 -17
- package/schemas/rpc-twoparty.d.mts.map +1 -1
- package/schemas/rpc-twoparty.mjs +19 -1
- package/schemas/rpc-twoparty.mjs.map +1 -1
- package/schemas/rpc.cjs +371 -1
- package/schemas/rpc.d.cts +141 -141
- package/schemas/rpc.d.cts.map +1 -1
- package/schemas/rpc.d.mts +141 -141
- package/schemas/rpc.d.mts.map +1 -1
- package/schemas/rpc.mjs +370 -1
- package/schemas/rpc.mjs.map +1 -1
- package/schemas/schema.cjs +96 -1
- package/schemas/schema.d.cts +286 -228
- package/schemas/schema.d.cts.map +1 -1
- package/schemas/schema.d.mts +286 -228
- package/schemas/schema.d.mts.map +1 -1
- package/schemas/schema.mjs +95 -1
- package/schemas/schema.mjs.map +1 -1
- package/schemas/{src-2eLj6yCr.cjs → src-B6FhDNiV.cjs} +19 -12
- package/schemas/{src-s2pCu2mc.mjs → src-B97sIXSw.mjs} +19 -13
- package/schemas/src-B97sIXSw.mjs.map +1 -0
- package/schemas/ts.cjs +1 -0
- package/schemas/ts.d.cts.map +1 -1
- package/schemas/ts.d.mts.map +1 -1
- package/dist/compile-DccxA7WZ.d.cts +0 -40
- package/dist/compile-DccxA7WZ.d.cts.map +0 -1
- package/dist/compile-UkKIpqrK.d.mts +0 -40
- package/dist/compile-UkKIpqrK.d.mts.map +0 -1
- package/dist/compile-ySRLGi2G.mjs.map +0 -1
- package/dist/dist-BlvFBzSi.mjs.map +0 -1
- package/dist/helpers-B1zJTrkG.mjs.map +0 -1
- package/dist/types-Cuj2daUE.mjs +0 -8
- package/dist/types-Cuj2daUE.mjs.map +0 -1
- package/dist/types-D03SjfBL.d.mts +0 -55
- package/dist/types-D03SjfBL.d.mts.map +0 -1
- package/dist/types-D52qMMoK.d.cts +0 -55
- package/dist/types-D52qMMoK.d.cts.map +0 -1
- package/dist/types-DHrjS-69.cjs +0 -13
- package/schemas/index-BAJMwFip.d.mts +0 -96
- package/schemas/index-BAJMwFip.d.mts.map +0 -1
- package/schemas/index-b7dam4EA.d.cts +0 -96
- package/schemas/index-b7dam4EA.d.cts.map +0 -1
- package/schemas/src-s2pCu2mc.mjs.map +0 -1
package/bin/capnpc.cjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
3
|
+
//#region \0rolldown/runtime.js
|
|
3
4
|
var __create = Object.create;
|
|
4
5
|
var __defProp = Object.defineProperty;
|
|
5
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
10
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
10
11
|
var __copyProps = (to, from, except, desc) => {
|
|
11
12
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
13
|
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
@@ -31,19 +32,19 @@ let node_child_process = require("node:child_process");
|
|
|
31
32
|
let node_fs = require("node:fs");
|
|
32
33
|
let node_path = require("node:path");
|
|
33
34
|
let node_fs_promises = require("node:fs/promises");
|
|
34
|
-
let
|
|
35
|
-
let
|
|
36
|
-
let
|
|
35
|
+
let _stryke_fs_exists = require("@stryke/fs/exists");
|
|
36
|
+
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
37
|
+
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
37
38
|
let typescript = require("typescript");
|
|
38
|
-
typescript = __toESM(typescript);
|
|
39
|
+
typescript = __toESM(typescript, 1);
|
|
39
40
|
require("defu");
|
|
40
41
|
let node_buffer = require("node:buffer");
|
|
41
|
-
let
|
|
42
|
-
let
|
|
43
|
-
let
|
|
44
|
-
let
|
|
42
|
+
let _stryke_fs = require("@stryke/fs");
|
|
43
|
+
let _stryke_fs_json = require("@stryke/fs/json");
|
|
44
|
+
let _stryke_fs_list_files = require("@stryke/fs/list-files");
|
|
45
|
+
let _stryke_path_append = require("@stryke/path/append");
|
|
45
46
|
|
|
46
|
-
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
47
|
+
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.190.1_zod@4.4.3/node_modules/@storm-software/config-tools/dist/chunk-5DQF4GNF.js
|
|
47
48
|
var DEFAULT_COLOR_CONFIG = {
|
|
48
49
|
light: {
|
|
49
50
|
background: "#fafafa",
|
|
@@ -861,7 +862,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
861
862
|
const cssKeywords = require_color_name();
|
|
862
863
|
const reverseKeywords = {};
|
|
863
864
|
for (const key of Object.keys(cssKeywords)) reverseKeywords[cssKeywords[key]] = key;
|
|
864
|
-
const convert
|
|
865
|
+
const convert = {
|
|
865
866
|
rgb: {
|
|
866
867
|
channels: 3,
|
|
867
868
|
labels: "rgb"
|
|
@@ -931,18 +932,18 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
931
932
|
labels: ["gray"]
|
|
932
933
|
}
|
|
933
934
|
};
|
|
934
|
-
module.exports = convert
|
|
935
|
-
for (const model of Object.keys(convert
|
|
936
|
-
if (!("channels" in convert
|
|
937
|
-
if (!("labels" in convert
|
|
938
|
-
if (convert
|
|
939
|
-
const { channels, labels } = convert
|
|
940
|
-
delete convert
|
|
941
|
-
delete convert
|
|
942
|
-
Object.defineProperty(convert
|
|
943
|
-
Object.defineProperty(convert
|
|
944
|
-
}
|
|
945
|
-
convert
|
|
935
|
+
module.exports = convert;
|
|
936
|
+
for (const model of Object.keys(convert)) {
|
|
937
|
+
if (!("channels" in convert[model])) throw new Error("missing channels property: " + model);
|
|
938
|
+
if (!("labels" in convert[model])) throw new Error("missing channel labels property: " + model);
|
|
939
|
+
if (convert[model].labels.length !== convert[model].channels) throw new Error("channel and label counts mismatch: " + model);
|
|
940
|
+
const { channels, labels } = convert[model];
|
|
941
|
+
delete convert[model].channels;
|
|
942
|
+
delete convert[model].labels;
|
|
943
|
+
Object.defineProperty(convert[model], "channels", { value: channels });
|
|
944
|
+
Object.defineProperty(convert[model], "labels", { value: labels });
|
|
945
|
+
}
|
|
946
|
+
convert.rgb.hsl = function(rgb) {
|
|
946
947
|
const r = rgb[0] / 255;
|
|
947
948
|
const g = rgb[1] / 255;
|
|
948
949
|
const b = rgb[2] / 255;
|
|
@@ -967,7 +968,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
967
968
|
l * 100
|
|
968
969
|
];
|
|
969
970
|
};
|
|
970
|
-
convert
|
|
971
|
+
convert.rgb.hsv = function(rgb) {
|
|
971
972
|
let rdif;
|
|
972
973
|
let gdif;
|
|
973
974
|
let bdif;
|
|
@@ -1001,11 +1002,11 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1001
1002
|
v * 100
|
|
1002
1003
|
];
|
|
1003
1004
|
};
|
|
1004
|
-
convert
|
|
1005
|
+
convert.rgb.hwb = function(rgb) {
|
|
1005
1006
|
const r = rgb[0];
|
|
1006
1007
|
const g = rgb[1];
|
|
1007
1008
|
let b = rgb[2];
|
|
1008
|
-
const h = convert
|
|
1009
|
+
const h = convert.rgb.hsl(rgb)[0];
|
|
1009
1010
|
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
1010
1011
|
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
1011
1012
|
return [
|
|
@@ -1014,7 +1015,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1014
1015
|
b * 100
|
|
1015
1016
|
];
|
|
1016
1017
|
};
|
|
1017
|
-
convert
|
|
1018
|
+
convert.rgb.cmyk = function(rgb) {
|
|
1018
1019
|
const r = rgb[0] / 255;
|
|
1019
1020
|
const g = rgb[1] / 255;
|
|
1020
1021
|
const b = rgb[2] / 255;
|
|
@@ -1032,7 +1033,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1032
1033
|
function comparativeDistance(x, y) {
|
|
1033
1034
|
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
1034
1035
|
}
|
|
1035
|
-
convert
|
|
1036
|
+
convert.rgb.keyword = function(rgb) {
|
|
1036
1037
|
const reversed = reverseKeywords[rgb];
|
|
1037
1038
|
if (reversed) return reversed;
|
|
1038
1039
|
let currentClosestDistance = Infinity;
|
|
@@ -1047,10 +1048,10 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1047
1048
|
}
|
|
1048
1049
|
return currentClosestKeyword;
|
|
1049
1050
|
};
|
|
1050
|
-
convert
|
|
1051
|
+
convert.keyword.rgb = function(keyword) {
|
|
1051
1052
|
return cssKeywords[keyword];
|
|
1052
1053
|
};
|
|
1053
|
-
convert
|
|
1054
|
+
convert.rgb.xyz = function(rgb) {
|
|
1054
1055
|
let r = rgb[0] / 255;
|
|
1055
1056
|
let g = rgb[1] / 255;
|
|
1056
1057
|
let b = rgb[2] / 255;
|
|
@@ -1066,8 +1067,8 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1066
1067
|
z * 100
|
|
1067
1068
|
];
|
|
1068
1069
|
};
|
|
1069
|
-
convert
|
|
1070
|
-
const xyz = convert
|
|
1070
|
+
convert.rgb.lab = function(rgb) {
|
|
1071
|
+
const xyz = convert.rgb.xyz(rgb);
|
|
1071
1072
|
let x = xyz[0];
|
|
1072
1073
|
let y = xyz[1];
|
|
1073
1074
|
let z = xyz[2];
|
|
@@ -1083,7 +1084,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1083
1084
|
200 * (y - z)
|
|
1084
1085
|
];
|
|
1085
1086
|
};
|
|
1086
|
-
convert
|
|
1087
|
+
convert.hsl.rgb = function(hsl) {
|
|
1087
1088
|
const h = hsl[0] / 360;
|
|
1088
1089
|
const s = hsl[1] / 100;
|
|
1089
1090
|
const l = hsl[2] / 100;
|
|
@@ -1118,7 +1119,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1118
1119
|
}
|
|
1119
1120
|
return rgb;
|
|
1120
1121
|
};
|
|
1121
|
-
convert
|
|
1122
|
+
convert.hsl.hsv = function(hsl) {
|
|
1122
1123
|
const h = hsl[0];
|
|
1123
1124
|
let s = hsl[1] / 100;
|
|
1124
1125
|
let l = hsl[2] / 100;
|
|
@@ -1134,7 +1135,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1134
1135
|
v * 100
|
|
1135
1136
|
];
|
|
1136
1137
|
};
|
|
1137
|
-
convert
|
|
1138
|
+
convert.hsv.rgb = function(hsv) {
|
|
1138
1139
|
const h = hsv[0] / 60;
|
|
1139
1140
|
const s = hsv[1] / 100;
|
|
1140
1141
|
let v = hsv[2] / 100;
|
|
@@ -1177,7 +1178,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1177
1178
|
];
|
|
1178
1179
|
}
|
|
1179
1180
|
};
|
|
1180
|
-
convert
|
|
1181
|
+
convert.hsv.hsl = function(hsv) {
|
|
1181
1182
|
const h = hsv[0];
|
|
1182
1183
|
const s = hsv[1] / 100;
|
|
1183
1184
|
const v = hsv[2] / 100;
|
|
@@ -1196,7 +1197,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1196
1197
|
l * 100
|
|
1197
1198
|
];
|
|
1198
1199
|
};
|
|
1199
|
-
convert
|
|
1200
|
+
convert.hwb.rgb = function(hwb) {
|
|
1200
1201
|
const h = hwb[0] / 360;
|
|
1201
1202
|
let wh = hwb[1] / 100;
|
|
1202
1203
|
let bl = hwb[2] / 100;
|
|
@@ -1254,7 +1255,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1254
1255
|
b * 255
|
|
1255
1256
|
];
|
|
1256
1257
|
};
|
|
1257
|
-
convert
|
|
1258
|
+
convert.cmyk.rgb = function(cmyk) {
|
|
1258
1259
|
const c = cmyk[0] / 100;
|
|
1259
1260
|
const m = cmyk[1] / 100;
|
|
1260
1261
|
const y = cmyk[2] / 100;
|
|
@@ -1268,7 +1269,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1268
1269
|
b * 255
|
|
1269
1270
|
];
|
|
1270
1271
|
};
|
|
1271
|
-
convert
|
|
1272
|
+
convert.xyz.rgb = function(xyz) {
|
|
1272
1273
|
const x = xyz[0] / 100;
|
|
1273
1274
|
const y = xyz[1] / 100;
|
|
1274
1275
|
const z = xyz[2] / 100;
|
|
@@ -1290,7 +1291,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1290
1291
|
b * 255
|
|
1291
1292
|
];
|
|
1292
1293
|
};
|
|
1293
|
-
convert
|
|
1294
|
+
convert.xyz.lab = function(xyz) {
|
|
1294
1295
|
let x = xyz[0];
|
|
1295
1296
|
let y = xyz[1];
|
|
1296
1297
|
let z = xyz[2];
|
|
@@ -1306,7 +1307,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1306
1307
|
200 * (y - z)
|
|
1307
1308
|
];
|
|
1308
1309
|
};
|
|
1309
|
-
convert
|
|
1310
|
+
convert.lab.xyz = function(lab) {
|
|
1310
1311
|
const l = lab[0];
|
|
1311
1312
|
const a = lab[1];
|
|
1312
1313
|
const b = lab[2];
|
|
@@ -1331,7 +1332,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1331
1332
|
z
|
|
1332
1333
|
];
|
|
1333
1334
|
};
|
|
1334
|
-
convert
|
|
1335
|
+
convert.lab.lch = function(lab) {
|
|
1335
1336
|
const l = lab[0];
|
|
1336
1337
|
const a = lab[1];
|
|
1337
1338
|
const b = lab[2];
|
|
@@ -1344,7 +1345,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1344
1345
|
h
|
|
1345
1346
|
];
|
|
1346
1347
|
};
|
|
1347
|
-
convert
|
|
1348
|
+
convert.lch.lab = function(lch) {
|
|
1348
1349
|
const l = lch[0];
|
|
1349
1350
|
const c = lch[1];
|
|
1350
1351
|
const hr = lch[2] / 360 * 2 * Math.PI;
|
|
@@ -1354,19 +1355,19 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1354
1355
|
c * Math.sin(hr)
|
|
1355
1356
|
];
|
|
1356
1357
|
};
|
|
1357
|
-
convert
|
|
1358
|
+
convert.rgb.ansi16 = function(args, saturation = null) {
|
|
1358
1359
|
const [r, g, b] = args;
|
|
1359
|
-
let value = saturation === null ? convert
|
|
1360
|
+
let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
|
1360
1361
|
value = Math.round(value / 50);
|
|
1361
1362
|
if (value === 0) return 30;
|
|
1362
1363
|
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
1363
1364
|
if (value === 2) ansi += 60;
|
|
1364
1365
|
return ansi;
|
|
1365
1366
|
};
|
|
1366
|
-
convert
|
|
1367
|
-
return convert
|
|
1367
|
+
convert.hsv.ansi16 = function(args) {
|
|
1368
|
+
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
1368
1369
|
};
|
|
1369
|
-
convert
|
|
1370
|
+
convert.rgb.ansi256 = function(args) {
|
|
1370
1371
|
const r = args[0];
|
|
1371
1372
|
const g = args[1];
|
|
1372
1373
|
const b = args[2];
|
|
@@ -1377,7 +1378,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1377
1378
|
}
|
|
1378
1379
|
return 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
1379
1380
|
};
|
|
1380
|
-
convert
|
|
1381
|
+
convert.ansi16.rgb = function(args) {
|
|
1381
1382
|
let color = args % 10;
|
|
1382
1383
|
if (color === 0 || color === 7) {
|
|
1383
1384
|
if (args > 50) color += 3.5;
|
|
@@ -1395,7 +1396,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1395
1396
|
(color >> 2 & 1) * mult * 255
|
|
1396
1397
|
];
|
|
1397
1398
|
};
|
|
1398
|
-
convert
|
|
1399
|
+
convert.ansi256.rgb = function(args) {
|
|
1399
1400
|
if (args >= 232) {
|
|
1400
1401
|
const c = (args - 232) * 10 + 8;
|
|
1401
1402
|
return [
|
|
@@ -1412,11 +1413,11 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1412
1413
|
rem % 6 / 5 * 255
|
|
1413
1414
|
];
|
|
1414
1415
|
};
|
|
1415
|
-
convert
|
|
1416
|
+
convert.rgb.hex = function(args) {
|
|
1416
1417
|
const string = (((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255)).toString(16).toUpperCase();
|
|
1417
1418
|
return "000000".substring(string.length) + string;
|
|
1418
1419
|
};
|
|
1419
|
-
convert
|
|
1420
|
+
convert.hex.rgb = function(args) {
|
|
1420
1421
|
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
1421
1422
|
if (!match) return [
|
|
1422
1423
|
0,
|
|
@@ -1434,7 +1435,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1434
1435
|
integer & 255
|
|
1435
1436
|
];
|
|
1436
1437
|
};
|
|
1437
|
-
convert
|
|
1438
|
+
convert.rgb.hcg = function(rgb) {
|
|
1438
1439
|
const r = rgb[0] / 255;
|
|
1439
1440
|
const g = rgb[1] / 255;
|
|
1440
1441
|
const b = rgb[2] / 255;
|
|
@@ -1457,7 +1458,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1457
1458
|
grayscale * 100
|
|
1458
1459
|
];
|
|
1459
1460
|
};
|
|
1460
|
-
convert
|
|
1461
|
+
convert.hsl.hcg = function(hsl) {
|
|
1461
1462
|
const s = hsl[1] / 100;
|
|
1462
1463
|
const l = hsl[2] / 100;
|
|
1463
1464
|
const c = l < .5 ? 2 * s * l : 2 * s * (1 - l);
|
|
@@ -1469,7 +1470,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1469
1470
|
f * 100
|
|
1470
1471
|
];
|
|
1471
1472
|
};
|
|
1472
|
-
convert
|
|
1473
|
+
convert.hsv.hcg = function(hsv) {
|
|
1473
1474
|
const s = hsv[1] / 100;
|
|
1474
1475
|
const v = hsv[2] / 100;
|
|
1475
1476
|
const c = s * v;
|
|
@@ -1481,7 +1482,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1481
1482
|
f * 100
|
|
1482
1483
|
];
|
|
1483
1484
|
};
|
|
1484
|
-
convert
|
|
1485
|
+
convert.hcg.rgb = function(hcg) {
|
|
1485
1486
|
const h = hcg[0] / 360;
|
|
1486
1487
|
const c = hcg[1] / 100;
|
|
1487
1488
|
const g = hcg[2] / 100;
|
|
@@ -1537,7 +1538,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1537
1538
|
(c * pure[2] + mg) * 255
|
|
1538
1539
|
];
|
|
1539
1540
|
};
|
|
1540
|
-
convert
|
|
1541
|
+
convert.hcg.hsv = function(hcg) {
|
|
1541
1542
|
const c = hcg[1] / 100;
|
|
1542
1543
|
const v = c + hcg[2] / 100 * (1 - c);
|
|
1543
1544
|
let f = 0;
|
|
@@ -1548,7 +1549,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1548
1549
|
v * 100
|
|
1549
1550
|
];
|
|
1550
1551
|
};
|
|
1551
|
-
convert
|
|
1552
|
+
convert.hcg.hsl = function(hcg) {
|
|
1552
1553
|
const c = hcg[1] / 100;
|
|
1553
1554
|
const l = hcg[2] / 100 * (1 - c) + .5 * c;
|
|
1554
1555
|
let s = 0;
|
|
@@ -1560,7 +1561,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1560
1561
|
l * 100
|
|
1561
1562
|
];
|
|
1562
1563
|
};
|
|
1563
|
-
convert
|
|
1564
|
+
convert.hcg.hwb = function(hcg) {
|
|
1564
1565
|
const c = hcg[1] / 100;
|
|
1565
1566
|
const v = c + hcg[2] / 100 * (1 - c);
|
|
1566
1567
|
return [
|
|
@@ -1569,7 +1570,7 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1569
1570
|
(1 - v) * 100
|
|
1570
1571
|
];
|
|
1571
1572
|
};
|
|
1572
|
-
convert
|
|
1573
|
+
convert.hwb.hcg = function(hwb) {
|
|
1573
1574
|
const w = hwb[1] / 100;
|
|
1574
1575
|
const v = 1 - hwb[2] / 100;
|
|
1575
1576
|
const c = v - w;
|
|
@@ -1581,43 +1582,43 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1581
1582
|
g * 100
|
|
1582
1583
|
];
|
|
1583
1584
|
};
|
|
1584
|
-
convert
|
|
1585
|
+
convert.apple.rgb = function(apple) {
|
|
1585
1586
|
return [
|
|
1586
1587
|
apple[0] / 65535 * 255,
|
|
1587
1588
|
apple[1] / 65535 * 255,
|
|
1588
1589
|
apple[2] / 65535 * 255
|
|
1589
1590
|
];
|
|
1590
1591
|
};
|
|
1591
|
-
convert
|
|
1592
|
+
convert.rgb.apple = function(rgb) {
|
|
1592
1593
|
return [
|
|
1593
1594
|
rgb[0] / 255 * 65535,
|
|
1594
1595
|
rgb[1] / 255 * 65535,
|
|
1595
1596
|
rgb[2] / 255 * 65535
|
|
1596
1597
|
];
|
|
1597
1598
|
};
|
|
1598
|
-
convert
|
|
1599
|
+
convert.gray.rgb = function(args) {
|
|
1599
1600
|
return [
|
|
1600
1601
|
args[0] / 100 * 255,
|
|
1601
1602
|
args[0] / 100 * 255,
|
|
1602
1603
|
args[0] / 100 * 255
|
|
1603
1604
|
];
|
|
1604
1605
|
};
|
|
1605
|
-
convert
|
|
1606
|
+
convert.gray.hsl = function(args) {
|
|
1606
1607
|
return [
|
|
1607
1608
|
0,
|
|
1608
1609
|
0,
|
|
1609
1610
|
args[0]
|
|
1610
1611
|
];
|
|
1611
1612
|
};
|
|
1612
|
-
convert
|
|
1613
|
-
convert
|
|
1613
|
+
convert.gray.hsv = convert.gray.hsl;
|
|
1614
|
+
convert.gray.hwb = function(gray) {
|
|
1614
1615
|
return [
|
|
1615
1616
|
0,
|
|
1616
1617
|
100,
|
|
1617
1618
|
gray[0]
|
|
1618
1619
|
];
|
|
1619
1620
|
};
|
|
1620
|
-
convert
|
|
1621
|
+
convert.gray.cmyk = function(gray) {
|
|
1621
1622
|
return [
|
|
1622
1623
|
0,
|
|
1623
1624
|
0,
|
|
@@ -1625,19 +1626,19 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1625
1626
|
gray[0]
|
|
1626
1627
|
];
|
|
1627
1628
|
};
|
|
1628
|
-
convert
|
|
1629
|
+
convert.gray.lab = function(gray) {
|
|
1629
1630
|
return [
|
|
1630
1631
|
gray[0],
|
|
1631
1632
|
0,
|
|
1632
1633
|
0
|
|
1633
1634
|
];
|
|
1634
1635
|
};
|
|
1635
|
-
convert
|
|
1636
|
+
convert.gray.hex = function(gray) {
|
|
1636
1637
|
const val = Math.round(gray[0] / 100 * 255) & 255;
|
|
1637
1638
|
const string = ((val << 16) + (val << 8) + val).toString(16).toUpperCase();
|
|
1638
1639
|
return "000000".substring(string.length) + string;
|
|
1639
1640
|
};
|
|
1640
|
-
convert
|
|
1641
|
+
convert.rgb.gray = function(rgb) {
|
|
1641
1642
|
return [(rgb[0] + rgb[1] + rgb[2]) / 3 / 255 * 100];
|
|
1642
1643
|
};
|
|
1643
1644
|
}));
|
|
@@ -1645,11 +1646,11 @@ var require_conversions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1645
1646
|
//#endregion
|
|
1646
1647
|
//#region ../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js
|
|
1647
1648
|
var require_route = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1648
|
-
const conversions
|
|
1649
|
+
const conversions = require_conversions();
|
|
1649
1650
|
function buildGraph() {
|
|
1650
1651
|
const graph = {};
|
|
1651
|
-
const models
|
|
1652
|
-
for (let len = models
|
|
1652
|
+
const models = Object.keys(conversions);
|
|
1653
|
+
for (let len = models.length, i = 0; i < len; i++) graph[models[i]] = {
|
|
1653
1654
|
distance: -1,
|
|
1654
1655
|
parent: null
|
|
1655
1656
|
};
|
|
@@ -1661,7 +1662,7 @@ var require_route = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1661
1662
|
graph[fromModel].distance = 0;
|
|
1662
1663
|
while (queue.length) {
|
|
1663
1664
|
const current = queue.pop();
|
|
1664
|
-
const adjacents = Object.keys(conversions
|
|
1665
|
+
const adjacents = Object.keys(conversions[current]);
|
|
1665
1666
|
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
1666
1667
|
const adjacent = adjacents[i];
|
|
1667
1668
|
const node = graph[adjacent];
|
|
@@ -1680,23 +1681,23 @@ var require_route = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1680
1681
|
};
|
|
1681
1682
|
}
|
|
1682
1683
|
function wrapConversion(toModel, graph) {
|
|
1683
|
-
const path
|
|
1684
|
-
let fn = conversions
|
|
1684
|
+
const path = [graph[toModel].parent, toModel];
|
|
1685
|
+
let fn = conversions[graph[toModel].parent][toModel];
|
|
1685
1686
|
let cur = graph[toModel].parent;
|
|
1686
1687
|
while (graph[cur].parent) {
|
|
1687
|
-
path
|
|
1688
|
-
fn = link(conversions
|
|
1688
|
+
path.unshift(graph[cur].parent);
|
|
1689
|
+
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
1689
1690
|
cur = graph[cur].parent;
|
|
1690
1691
|
}
|
|
1691
|
-
fn.conversion = path
|
|
1692
|
+
fn.conversion = path;
|
|
1692
1693
|
return fn;
|
|
1693
1694
|
}
|
|
1694
1695
|
module.exports = function(fromModel) {
|
|
1695
1696
|
const graph = deriveBFS(fromModel);
|
|
1696
1697
|
const conversion = {};
|
|
1697
|
-
const models
|
|
1698
|
-
for (let len = models
|
|
1699
|
-
const toModel = models
|
|
1698
|
+
const models = Object.keys(graph);
|
|
1699
|
+
for (let len = models.length, i = 0; i < len; i++) {
|
|
1700
|
+
const toModel = models[i];
|
|
1700
1701
|
if (graph[toModel].parent === null) continue;
|
|
1701
1702
|
conversion[toModel] = wrapConversion(toModel, graph);
|
|
1702
1703
|
}
|
|
@@ -1787,17 +1788,17 @@ var require_ansi_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1787
1788
|
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
1788
1789
|
if (colorConvert === void 0) colorConvert = require_color_convert();
|
|
1789
1790
|
const offset = isBackground ? 10 : 0;
|
|
1790
|
-
const styles
|
|
1791
|
+
const styles = {};
|
|
1791
1792
|
for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
|
|
1792
1793
|
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
1793
|
-
if (sourceSpace === targetSpace) styles
|
|
1794
|
-
else if (typeof suite === "object") styles
|
|
1794
|
+
if (sourceSpace === targetSpace) styles[name] = wrap(identity, offset);
|
|
1795
|
+
else if (typeof suite === "object") styles[name] = wrap(suite[targetSpace], offset);
|
|
1795
1796
|
}
|
|
1796
|
-
return styles
|
|
1797
|
+
return styles;
|
|
1797
1798
|
};
|
|
1798
1799
|
function assembleStyles() {
|
|
1799
1800
|
const codes = /* @__PURE__ */ new Map();
|
|
1800
|
-
const styles
|
|
1801
|
+
const styles = {
|
|
1801
1802
|
modifier: {
|
|
1802
1803
|
reset: [0, 0],
|
|
1803
1804
|
bold: [1, 22],
|
|
@@ -1845,37 +1846,37 @@ var require_ansi_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1845
1846
|
bgWhiteBright: [107, 49]
|
|
1846
1847
|
}
|
|
1847
1848
|
};
|
|
1848
|
-
styles
|
|
1849
|
-
styles
|
|
1850
|
-
styles
|
|
1851
|
-
styles
|
|
1852
|
-
for (const [groupName, group] of Object.entries(styles
|
|
1849
|
+
styles.color.gray = styles.color.blackBright;
|
|
1850
|
+
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
|
1851
|
+
styles.color.grey = styles.color.blackBright;
|
|
1852
|
+
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
|
1853
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
1853
1854
|
for (const [styleName, style] of Object.entries(group)) {
|
|
1854
|
-
styles
|
|
1855
|
+
styles[styleName] = {
|
|
1855
1856
|
open: `\u001B[${style[0]}m`,
|
|
1856
1857
|
close: `\u001B[${style[1]}m`
|
|
1857
1858
|
};
|
|
1858
|
-
group[styleName] = styles
|
|
1859
|
+
group[styleName] = styles[styleName];
|
|
1859
1860
|
codes.set(style[0], style[1]);
|
|
1860
1861
|
}
|
|
1861
|
-
Object.defineProperty(styles
|
|
1862
|
+
Object.defineProperty(styles, groupName, {
|
|
1862
1863
|
value: group,
|
|
1863
1864
|
enumerable: false
|
|
1864
1865
|
});
|
|
1865
1866
|
}
|
|
1866
|
-
Object.defineProperty(styles
|
|
1867
|
+
Object.defineProperty(styles, "codes", {
|
|
1867
1868
|
value: codes,
|
|
1868
1869
|
enumerable: false
|
|
1869
1870
|
});
|
|
1870
|
-
styles
|
|
1871
|
-
styles
|
|
1872
|
-
setLazyProperty(styles
|
|
1873
|
-
setLazyProperty(styles
|
|
1874
|
-
setLazyProperty(styles
|
|
1875
|
-
setLazyProperty(styles
|
|
1876
|
-
setLazyProperty(styles
|
|
1877
|
-
setLazyProperty(styles
|
|
1878
|
-
return styles
|
|
1871
|
+
styles.color.close = "\x1B[39m";
|
|
1872
|
+
styles.bgColor.close = "\x1B[49m";
|
|
1873
|
+
setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
|
|
1874
|
+
setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
|
|
1875
|
+
setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
|
|
1876
|
+
setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
|
|
1877
|
+
setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
|
|
1878
|
+
setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
|
|
1879
|
+
return styles;
|
|
1879
1880
|
}
|
|
1880
1881
|
Object.defineProperty(module, "exports", {
|
|
1881
1882
|
enumerable: true,
|
|
@@ -1966,7 +1967,7 @@ var require_supports_color = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
1966
1967
|
//#endregion
|
|
1967
1968
|
//#region ../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js
|
|
1968
1969
|
var require_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1969
|
-
const stringReplaceAll
|
|
1970
|
+
const stringReplaceAll = (string, substring, replacer) => {
|
|
1970
1971
|
let index = string.indexOf(substring);
|
|
1971
1972
|
if (index === -1) return string;
|
|
1972
1973
|
const substringLength = substring.length;
|
|
@@ -1980,7 +1981,7 @@ var require_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1980
1981
|
returnValue += string.substr(endIndex);
|
|
1981
1982
|
return returnValue;
|
|
1982
1983
|
};
|
|
1983
|
-
const stringEncaseCRLFWithFirstIndex
|
|
1984
|
+
const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
|
|
1984
1985
|
let endIndex = 0;
|
|
1985
1986
|
let returnValue = "";
|
|
1986
1987
|
do {
|
|
@@ -1993,8 +1994,8 @@ var require_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1993
1994
|
return returnValue;
|
|
1994
1995
|
};
|
|
1995
1996
|
module.exports = {
|
|
1996
|
-
stringReplaceAll
|
|
1997
|
-
stringEncaseCRLFWithFirstIndex
|
|
1997
|
+
stringReplaceAll,
|
|
1998
|
+
stringEncaseCRLFWithFirstIndex
|
|
1998
1999
|
};
|
|
1999
2000
|
}));
|
|
2000
2001
|
|
|
@@ -2049,19 +2050,19 @@ var require_templates = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2049
2050
|
}
|
|
2050
2051
|
return results;
|
|
2051
2052
|
}
|
|
2052
|
-
function buildStyle(chalk
|
|
2053
|
+
function buildStyle(chalk, styles) {
|
|
2053
2054
|
const enabled = {};
|
|
2054
|
-
for (const layer of styles
|
|
2055
|
-
let current = chalk
|
|
2056
|
-
for (const [styleName, styles
|
|
2057
|
-
if (!Array.isArray(styles
|
|
2055
|
+
for (const layer of styles) for (const style of layer.styles) enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
2056
|
+
let current = chalk;
|
|
2057
|
+
for (const [styleName, styles] of Object.entries(enabled)) {
|
|
2058
|
+
if (!Array.isArray(styles)) continue;
|
|
2058
2059
|
if (!(styleName in current)) throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
2059
|
-
current = styles
|
|
2060
|
+
current = styles.length > 0 ? current[styleName](...styles) : current[styleName];
|
|
2060
2061
|
}
|
|
2061
2062
|
return current;
|
|
2062
2063
|
}
|
|
2063
|
-
module.exports = (chalk
|
|
2064
|
-
const styles
|
|
2064
|
+
module.exports = (chalk, temporary) => {
|
|
2065
|
+
const styles = [];
|
|
2065
2066
|
const chunks = [];
|
|
2066
2067
|
let chunk = [];
|
|
2067
2068
|
temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
|
|
@@ -2069,21 +2070,21 @@ var require_templates = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2069
2070
|
else if (style) {
|
|
2070
2071
|
const string = chunk.join("");
|
|
2071
2072
|
chunk = [];
|
|
2072
|
-
chunks.push(styles
|
|
2073
|
-
styles
|
|
2073
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));
|
|
2074
|
+
styles.push({
|
|
2074
2075
|
inverse,
|
|
2075
2076
|
styles: parseStyle(style)
|
|
2076
2077
|
});
|
|
2077
2078
|
} else if (close) {
|
|
2078
|
-
if (styles
|
|
2079
|
-
chunks.push(buildStyle(chalk
|
|
2079
|
+
if (styles.length === 0) throw new Error("Found extraneous } in Chalk template literal");
|
|
2080
|
+
chunks.push(buildStyle(chalk, styles)(chunk.join("")));
|
|
2080
2081
|
chunk = [];
|
|
2081
|
-
styles
|
|
2082
|
+
styles.pop();
|
|
2082
2083
|
} else chunk.push(character);
|
|
2083
2084
|
});
|
|
2084
2085
|
chunks.push(chunk.join(""));
|
|
2085
|
-
if (styles
|
|
2086
|
-
const errMessage = `Chalk template literal is missing ${styles
|
|
2086
|
+
if (styles.length > 0) {
|
|
2087
|
+
const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
|
|
2087
2088
|
throw new Error(errMessage);
|
|
2088
2089
|
}
|
|
2089
2090
|
return chunks.join("");
|
|
@@ -2115,16 +2116,16 @@ var require_source = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2115
2116
|
}
|
|
2116
2117
|
};
|
|
2117
2118
|
const chalkFactory = (options) => {
|
|
2118
|
-
const chalk
|
|
2119
|
-
applyOptions(chalk
|
|
2120
|
-
chalk
|
|
2121
|
-
Object.setPrototypeOf(chalk
|
|
2122
|
-
Object.setPrototypeOf(chalk
|
|
2123
|
-
chalk
|
|
2119
|
+
const chalk = {};
|
|
2120
|
+
applyOptions(chalk, options);
|
|
2121
|
+
chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_);
|
|
2122
|
+
Object.setPrototypeOf(chalk, Chalk.prototype);
|
|
2123
|
+
Object.setPrototypeOf(chalk.template, chalk);
|
|
2124
|
+
chalk.template.constructor = () => {
|
|
2124
2125
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
2125
2126
|
};
|
|
2126
|
-
chalk
|
|
2127
|
-
return chalk
|
|
2127
|
+
chalk.template.Instance = ChalkClass;
|
|
2128
|
+
return chalk.template;
|
|
2128
2129
|
};
|
|
2129
2130
|
function Chalk(options) {
|
|
2130
2131
|
return chalkFactory(options);
|
|
@@ -2221,25 +2222,25 @@ var require_source = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2221
2222
|
return openAll + string + closeAll;
|
|
2222
2223
|
};
|
|
2223
2224
|
let template;
|
|
2224
|
-
const chalkTag = (chalk
|
|
2225
|
+
const chalkTag = (chalk, ...strings) => {
|
|
2225
2226
|
const [firstString] = strings;
|
|
2226
2227
|
if (!isArray(firstString) || !isArray(firstString.raw)) return strings.join(" ");
|
|
2227
2228
|
const arguments_ = strings.slice(1);
|
|
2228
2229
|
const parts = [firstString.raw[0]];
|
|
2229
2230
|
for (let i = 1; i < firstString.length; i++) parts.push(String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"), String(firstString.raw[i]));
|
|
2230
2231
|
if (template === void 0) template = require_templates();
|
|
2231
|
-
return template(chalk
|
|
2232
|
+
return template(chalk, parts.join(""));
|
|
2232
2233
|
};
|
|
2233
2234
|
Object.defineProperties(Chalk.prototype, styles);
|
|
2234
|
-
const chalk
|
|
2235
|
-
chalk
|
|
2236
|
-
chalk
|
|
2237
|
-
chalk
|
|
2238
|
-
module.exports = chalk
|
|
2235
|
+
const chalk = Chalk();
|
|
2236
|
+
chalk.supportsColor = stdoutColor;
|
|
2237
|
+
chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
2238
|
+
chalk.stderr.supportsColor = stderrColor;
|
|
2239
|
+
module.exports = chalk;
|
|
2239
2240
|
}));
|
|
2240
2241
|
|
|
2241
2242
|
//#endregion
|
|
2242
|
-
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
2243
|
+
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.190.1_zod@4.4.3/node_modules/@storm-software/config-tools/dist/chunk-HVVJHTFS.js
|
|
2243
2244
|
var import_source = /* @__PURE__ */ __toESM(require_source(), 1);
|
|
2244
2245
|
var chalkDefault = {
|
|
2245
2246
|
hex: (_) => (message) => message,
|
|
@@ -2271,14 +2272,14 @@ var getChalk = () => {
|
|
|
2271
2272
|
};
|
|
2272
2273
|
|
|
2273
2274
|
//#endregion
|
|
2274
|
-
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
2275
|
+
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.190.1_zod@4.4.3/node_modules/@storm-software/config-tools/dist/chunk-G2MK47WL.js
|
|
2275
2276
|
function isUnicodeSupported() {
|
|
2276
2277
|
if (process.platform !== "win32") return process.env.TERM !== "linux";
|
|
2277
2278
|
return Boolean(process.env.WT_SESSION) || Boolean(process.env.TERMINUS_SUBLIME) || process.env.ConEmuTask === "{cmd::Cmder}" || process.env.TERM_PROGRAM === "Terminus-Sublime" || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty" || process.env.TERM === "rxvt-unicode" || process.env.TERM === "rxvt-unicode-256color" || process.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
2278
2279
|
}
|
|
2279
2280
|
|
|
2280
2281
|
//#endregion
|
|
2281
|
-
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
2282
|
+
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.190.1_zod@4.4.3/node_modules/@storm-software/config-tools/dist/chunk-RALMUN5C.js
|
|
2282
2283
|
var LogLevel = {
|
|
2283
2284
|
SILENT: 0,
|
|
2284
2285
|
FATAL: 10,
|
|
@@ -2305,7 +2306,7 @@ var LogLevelLabel = {
|
|
|
2305
2306
|
};
|
|
2306
2307
|
|
|
2307
2308
|
//#endregion
|
|
2308
|
-
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
2309
|
+
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.190.1_zod@4.4.3/node_modules/@storm-software/config-tools/dist/chunk-ZFNAUMQS.js
|
|
2309
2310
|
var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
|
|
2310
2311
|
var CONSOLE_ICONS = {
|
|
2311
2312
|
[LogLevelLabel.ERROR]: useIcon("✘", "×"),
|
|
@@ -2320,13 +2321,13 @@ var CONSOLE_ICONS = {
|
|
|
2320
2321
|
};
|
|
2321
2322
|
|
|
2322
2323
|
//#endregion
|
|
2323
|
-
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
2324
|
-
var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
|
|
2325
|
-
return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
|
|
2324
|
+
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.190.1_zod@4.4.3/node_modules/@storm-software/config-tools/dist/chunk-JZAYHDV3.js
|
|
2325
|
+
var formatTimestamp = (fullDateTime = false, date = /* @__PURE__ */ new Date()) => {
|
|
2326
|
+
return fullDateTime ? `${date.toLocaleDateString()} ${date.toLocaleTimeString()}` : `${date.toLocaleTimeString()}`;
|
|
2326
2327
|
};
|
|
2327
2328
|
|
|
2328
2329
|
//#endregion
|
|
2329
|
-
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
2330
|
+
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.190.1_zod@4.4.3/node_modules/@storm-software/config-tools/dist/chunk-SXPH7ILL.js
|
|
2330
2331
|
var getLogLevel = (label) => {
|
|
2331
2332
|
switch (label) {
|
|
2332
2333
|
case "all": return LogLevel.ALL;
|
|
@@ -2343,13 +2344,12 @@ var getLogLevel = (label) => {
|
|
|
2343
2344
|
};
|
|
2344
2345
|
|
|
2345
2346
|
//#endregion
|
|
2346
|
-
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
2347
|
+
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.190.1_zod@4.4.3/node_modules/@storm-software/config-tools/dist/chunk-TOMKPXJE.js
|
|
2347
2348
|
var daysInYear = 365.2425;
|
|
2348
2349
|
-(Math.pow(10, 8) * 24 * 60 * 60 * 1e3);
|
|
2349
2350
|
var secondsInDay = 3600 * 24;
|
|
2350
2351
|
secondsInDay * 7;
|
|
2351
2352
|
secondsInDay * daysInYear / 12 * 3;
|
|
2352
|
-
var constructFromSymbol = Symbol.for("constructDateFrom");
|
|
2353
2353
|
var formatDistanceLocale = {
|
|
2354
2354
|
lessThanXSeconds: {
|
|
2355
2355
|
one: "less than a second",
|
|
@@ -2863,53 +2863,54 @@ var enUS = {
|
|
|
2863
2863
|
firstWeekContainsDate: 1
|
|
2864
2864
|
}
|
|
2865
2865
|
};
|
|
2866
|
-
var getLogFn = (logLevel = LogLevel.INFO, config = {},
|
|
2866
|
+
var getLogFn = (logLevel = LogLevel.INFO, config = {}, options = {}) => {
|
|
2867
|
+
const { chalk: _chalk = getChalk(), fullDateTime = false, hideDateTime = false } = options;
|
|
2867
2868
|
const colors = !config.colors?.dark && !config.colors?.["base"] && !config.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config.colors?.dark && typeof config.colors.dark === "string" ? config.colors : config.colors?.["base"]?.dark && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : config.colors?.["base"] ? config.colors?.["base"] : DEFAULT_COLOR_CONFIG;
|
|
2868
2869
|
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
2869
2870
|
if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) return (_) => {};
|
|
2870
2871
|
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) return (message) => {
|
|
2871
2872
|
console.error(`
|
|
2872
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal)(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2873
|
+
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal)(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2873
2874
|
`);
|
|
2874
2875
|
};
|
|
2875
2876
|
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) return (message) => {
|
|
2876
2877
|
console.error(`
|
|
2877
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger)(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2878
|
+
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger)(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2878
2879
|
`);
|
|
2879
2880
|
};
|
|
2880
2881
|
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) return (message) => {
|
|
2881
2882
|
console.warn(`
|
|
2882
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning)(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2883
|
+
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning)(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2883
2884
|
`);
|
|
2884
2885
|
};
|
|
2885
2886
|
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) return (message) => {
|
|
2886
2887
|
console.info(`
|
|
2887
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? DEFAULT_COLOR_CONFIG.dark.success)(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2888
|
+
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.success ?? DEFAULT_COLOR_CONFIG.dark.success)(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2888
2889
|
`);
|
|
2889
2890
|
};
|
|
2890
2891
|
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) return (message) => {
|
|
2891
2892
|
console.info(`
|
|
2892
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2893
|
+
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2893
2894
|
`);
|
|
2894
2895
|
};
|
|
2895
2896
|
if (typeof logLevel === "number" && LogLevel.PERFORMANCE >= logLevel) return (message) => {
|
|
2896
2897
|
console.debug(`
|
|
2897
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.performance ?? DEFAULT_COLOR_CONFIG.dark.performance)(`[${CONSOLE_ICONS[LogLevelLabel.PERFORMANCE]} Performance] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2898
|
+
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.performance ?? DEFAULT_COLOR_CONFIG.dark.performance)(`[${CONSOLE_ICONS[LogLevelLabel.PERFORMANCE]} Performance] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2898
2899
|
`);
|
|
2899
2900
|
};
|
|
2900
2901
|
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) return (message) => {
|
|
2901
2902
|
console.debug(`
|
|
2902
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.debug ?? DEFAULT_COLOR_CONFIG.dark.debug)(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2903
|
+
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.debug ?? DEFAULT_COLOR_CONFIG.dark.debug)(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2903
2904
|
`);
|
|
2904
2905
|
};
|
|
2905
2906
|
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) return (message) => {
|
|
2906
2907
|
console.debug(`
|
|
2907
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex("#bbbbbb")(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2908
|
+
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex("#bbbbbb")(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2908
2909
|
`);
|
|
2909
2910
|
};
|
|
2910
2911
|
return (message) => {
|
|
2911
2912
|
console.log(`
|
|
2912
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand)(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2913
|
+
${hideDateTime ? "" : `${_chalk.gray(formatTimestamp(fullDateTime))} `}${_chalk.hex(colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand)(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
2913
2914
|
`);
|
|
2914
2915
|
};
|
|
2915
2916
|
};
|
|
@@ -2920,19 +2921,19 @@ var writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
|
|
|
2920
2921
|
var writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
|
|
2921
2922
|
var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
|
|
2922
2923
|
var MAX_DEPTH$1 = 6;
|
|
2923
|
-
var formatLogMessage = (message, options = {}, depth
|
|
2924
|
-
if (depth
|
|
2924
|
+
var formatLogMessage = (message, options = {}, depth = 0) => {
|
|
2925
|
+
if (depth > MAX_DEPTH$1) return "<max depth>";
|
|
2925
2926
|
const prefix = options.prefix ?? "-";
|
|
2926
2927
|
const skip = options.skip ?? [];
|
|
2927
2928
|
return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
|
|
2928
2929
|
${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, {
|
|
2929
2930
|
prefix: `${prefix}-`,
|
|
2930
2931
|
skip
|
|
2931
|
-
}, depth
|
|
2932
|
+
}, depth + 1)}`).join("\n")}` : typeof message === "object" ? `
|
|
2932
2933
|
${Object.keys(message).filter((key) => !skip.includes(key)).map((key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(message[key], {
|
|
2933
2934
|
prefix: `${prefix}-`,
|
|
2934
2935
|
skip
|
|
2935
|
-
}, depth
|
|
2936
|
+
}, depth + 1) : message[key]}`).join("\n")}` : message;
|
|
2936
2937
|
};
|
|
2937
2938
|
var _isFunction = (value) => {
|
|
2938
2939
|
try {
|
|
@@ -2944,7 +2945,7 @@ var _isFunction = (value) => {
|
|
|
2944
2945
|
var brandIcon = (config = {}, _chalk = getChalk()) => _chalk.hex(getColor("brand", config))("🗲");
|
|
2945
2946
|
|
|
2946
2947
|
//#endregion
|
|
2947
|
-
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
2948
|
+
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.190.1_zod@4.4.3/node_modules/@storm-software/config-tools/dist/chunk-PN7H7GUE.js
|
|
2948
2949
|
var exitWithError = (config) => {
|
|
2949
2950
|
writeFatal("Exiting script with an error status...", config);
|
|
2950
2951
|
process.exit(1);
|
|
@@ -2979,7 +2980,7 @@ Stacktrace: ${error.stack}`, config);
|
|
|
2979
2980
|
};
|
|
2980
2981
|
|
|
2981
2982
|
//#endregion
|
|
2982
|
-
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
2983
|
+
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.190.1_zod@4.4.3/node_modules/@storm-software/config-tools/dist/chunk-RUKM6FCF.js
|
|
2983
2984
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
2984
2985
|
var depth = 0;
|
|
2985
2986
|
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
@@ -2990,7 +2991,7 @@ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
|
2990
2991
|
}
|
|
2991
2992
|
|
|
2992
2993
|
//#endregion
|
|
2993
|
-
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
2994
|
+
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.190.1_zod@4.4.3/node_modules/@storm-software/config-tools/dist/chunk-V3GMJ4TX.js
|
|
2994
2995
|
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
2995
2996
|
function normalizeWindowsPath(input = "") {
|
|
2996
2997
|
if (!input) return input;
|
|
@@ -2999,33 +3000,33 @@ function normalizeWindowsPath(input = "") {
|
|
|
2999
3000
|
var _UNC_REGEX = /^[/\\]{2}/;
|
|
3000
3001
|
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
3001
3002
|
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
3002
|
-
var correctPaths = function(path
|
|
3003
|
-
if (!path
|
|
3004
|
-
path
|
|
3005
|
-
const isUNCPath = path
|
|
3006
|
-
const isPathAbsolute = isAbsolute(path
|
|
3007
|
-
const trailingSeparator = path
|
|
3008
|
-
path
|
|
3009
|
-
if (path
|
|
3003
|
+
var correctPaths = function(path) {
|
|
3004
|
+
if (!path || path.length === 0) return ".";
|
|
3005
|
+
path = normalizeWindowsPath(path);
|
|
3006
|
+
const isUNCPath = path?.match(_UNC_REGEX);
|
|
3007
|
+
const isPathAbsolute = isAbsolute(path);
|
|
3008
|
+
const trailingSeparator = path[path.length - 1] === "/";
|
|
3009
|
+
path = normalizeString(path, !isPathAbsolute);
|
|
3010
|
+
if (path.length === 0) {
|
|
3010
3011
|
if (isPathAbsolute) return "/";
|
|
3011
3012
|
return trailingSeparator ? "./" : ".";
|
|
3012
3013
|
}
|
|
3013
|
-
if (trailingSeparator) path
|
|
3014
|
-
if (_DRIVE_LETTER_RE.test(path
|
|
3014
|
+
if (trailingSeparator) path += "/";
|
|
3015
|
+
if (_DRIVE_LETTER_RE.test(path)) path += "/";
|
|
3015
3016
|
if (isUNCPath) {
|
|
3016
|
-
if (!isPathAbsolute) return `//./${path
|
|
3017
|
-
return `//${path
|
|
3017
|
+
if (!isPathAbsolute) return `//./${path}`;
|
|
3018
|
+
return `//${path}`;
|
|
3018
3019
|
}
|
|
3019
|
-
return isPathAbsolute && !isAbsolute(path
|
|
3020
|
+
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
3020
3021
|
};
|
|
3021
|
-
function normalizeString(path
|
|
3022
|
+
function normalizeString(path, allowAboveRoot) {
|
|
3022
3023
|
let res = "";
|
|
3023
3024
|
let lastSegmentLength = 0;
|
|
3024
3025
|
let lastSlash = -1;
|
|
3025
3026
|
let dots = 0;
|
|
3026
3027
|
let char = null;
|
|
3027
|
-
for (let index = 0; index <= path
|
|
3028
|
-
if (index < path
|
|
3028
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
3029
|
+
if (index < path.length) char = path[index];
|
|
3029
3030
|
else if (char === "/") break;
|
|
3030
3031
|
else char = "/";
|
|
3031
3032
|
if (char === "/") {
|
|
@@ -3056,8 +3057,8 @@ function normalizeString(path$1, allowAboveRoot) {
|
|
|
3056
3057
|
lastSegmentLength = 2;
|
|
3057
3058
|
}
|
|
3058
3059
|
} else {
|
|
3059
|
-
if (res.length > 0) res += `/${path
|
|
3060
|
-
else res = path
|
|
3060
|
+
if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
|
|
3061
|
+
else res = path.slice(lastSlash + 1, index);
|
|
3061
3062
|
lastSegmentLength = index - lastSlash - 1;
|
|
3062
3063
|
}
|
|
3063
3064
|
lastSlash = index;
|
|
@@ -3072,7 +3073,7 @@ var isAbsolute = function(p) {
|
|
|
3072
3073
|
};
|
|
3073
3074
|
|
|
3074
3075
|
//#endregion
|
|
3075
|
-
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.
|
|
3076
|
+
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.190.1_zod@4.4.3/node_modules/@storm-software/config-tools/dist/chunk-LF3SAK2O.js
|
|
3076
3077
|
var rootFiles = [
|
|
3077
3078
|
"storm-workspace.json",
|
|
3078
3079
|
"storm-workspace.yaml",
|
|
@@ -3126,7 +3127,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3126
3127
|
/**
|
|
3127
3128
|
* CommanderError class
|
|
3128
3129
|
*/
|
|
3129
|
-
var CommanderError
|
|
3130
|
+
var CommanderError = class extends Error {
|
|
3130
3131
|
/**
|
|
3131
3132
|
* Constructs the CommanderError class
|
|
3132
3133
|
* @param {number} exitCode suggested exit code which could be used with process.exit
|
|
@@ -3145,7 +3146,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3145
3146
|
/**
|
|
3146
3147
|
* InvalidArgumentError class
|
|
3147
3148
|
*/
|
|
3148
|
-
var InvalidArgumentError
|
|
3149
|
+
var InvalidArgumentError = class extends CommanderError {
|
|
3149
3150
|
/**
|
|
3150
3151
|
* Constructs the InvalidArgumentError class
|
|
3151
3152
|
* @param {string} [message] explanation of why argument is invalid
|
|
@@ -3156,15 +3157,15 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3156
3157
|
this.name = this.constructor.name;
|
|
3157
3158
|
}
|
|
3158
3159
|
};
|
|
3159
|
-
exports.CommanderError = CommanderError
|
|
3160
|
-
exports.InvalidArgumentError = InvalidArgumentError
|
|
3160
|
+
exports.CommanderError = CommanderError;
|
|
3161
|
+
exports.InvalidArgumentError = InvalidArgumentError;
|
|
3161
3162
|
}));
|
|
3162
3163
|
|
|
3163
3164
|
//#endregion
|
|
3164
3165
|
//#region ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/argument.js
|
|
3165
3166
|
var require_argument = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3166
|
-
const { InvalidArgumentError
|
|
3167
|
-
var Argument
|
|
3167
|
+
const { InvalidArgumentError } = require_error();
|
|
3168
|
+
var Argument = class {
|
|
3168
3169
|
/**
|
|
3169
3170
|
* Initialize a new command argument with the given name and description.
|
|
3170
3171
|
* The default is that the argument is required, and you can explicitly
|
|
@@ -3246,7 +3247,7 @@ var require_argument = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3246
3247
|
choices(values) {
|
|
3247
3248
|
this.argChoices = values.slice();
|
|
3248
3249
|
this.parseArg = (arg, previous) => {
|
|
3249
|
-
if (!this.argChoices.includes(arg)) throw new InvalidArgumentError
|
|
3250
|
+
if (!this.argChoices.includes(arg)) throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
|
|
3250
3251
|
if (this.variadic) return this._collectValue(arg, previous);
|
|
3251
3252
|
return arg;
|
|
3252
3253
|
};
|
|
@@ -3278,18 +3279,18 @@ var require_argument = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3278
3279
|
* @return {string}
|
|
3279
3280
|
* @private
|
|
3280
3281
|
*/
|
|
3281
|
-
function humanReadableArgName
|
|
3282
|
+
function humanReadableArgName(arg) {
|
|
3282
3283
|
const nameOutput = arg.name() + (arg.variadic === true ? "..." : "");
|
|
3283
3284
|
return arg.required ? "<" + nameOutput + ">" : "[" + nameOutput + "]";
|
|
3284
3285
|
}
|
|
3285
|
-
exports.Argument = Argument
|
|
3286
|
-
exports.humanReadableArgName = humanReadableArgName
|
|
3286
|
+
exports.Argument = Argument;
|
|
3287
|
+
exports.humanReadableArgName = humanReadableArgName;
|
|
3287
3288
|
}));
|
|
3288
3289
|
|
|
3289
3290
|
//#endregion
|
|
3290
3291
|
//#region ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/help.js
|
|
3291
3292
|
var require_help = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3292
|
-
const { humanReadableArgName
|
|
3293
|
+
const { humanReadableArgName } = require_argument();
|
|
3293
3294
|
/**
|
|
3294
3295
|
* TypeScript import types for JSDoc, used by Visual Studio Code IntelliSense and `npm run typescript-checkJS`
|
|
3295
3296
|
* https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#import-types
|
|
@@ -3297,7 +3298,7 @@ var require_help = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3297
3298
|
* @typedef { import("./command.js").Command } Command
|
|
3298
3299
|
* @typedef { import("./option.js").Option } Option
|
|
3299
3300
|
*/
|
|
3300
|
-
var Help
|
|
3301
|
+
var Help = class {
|
|
3301
3302
|
constructor() {
|
|
3302
3303
|
this.helpWidth = void 0;
|
|
3303
3304
|
this.minWidthToWrap = 40;
|
|
@@ -3323,7 +3324,7 @@ var require_help = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3323
3324
|
* @returns {Command[]}
|
|
3324
3325
|
*/
|
|
3325
3326
|
visibleCommands(cmd) {
|
|
3326
|
-
const visibleCommands = cmd.commands.filter((cmd
|
|
3327
|
+
const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);
|
|
3327
3328
|
const helpCommand = cmd._getHelpCommand();
|
|
3328
3329
|
if (helpCommand && !helpCommand._hidden) visibleCommands.push(helpCommand);
|
|
3329
3330
|
if (this.sortSubcommands) visibleCommands.sort((a, b) => {
|
|
@@ -3399,7 +3400,7 @@ var require_help = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3399
3400
|
* @returns {string}
|
|
3400
3401
|
*/
|
|
3401
3402
|
subcommandTerm(cmd) {
|
|
3402
|
-
const args = cmd.registeredArguments.map((arg) => humanReadableArgName
|
|
3403
|
+
const args = cmd.registeredArguments.map((arg) => humanReadableArgName(arg)).join(" ");
|
|
3403
3404
|
return cmd._name + (cmd._aliases[0] ? "|" + cmd._aliases[0] : "") + (cmd.options.length ? " [options]" : "") + (args ? " " + args : "");
|
|
3404
3405
|
}
|
|
3405
3406
|
/**
|
|
@@ -3622,7 +3623,7 @@ var require_help = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3622
3623
|
* @returns {number}
|
|
3623
3624
|
*/
|
|
3624
3625
|
displayWidth(str) {
|
|
3625
|
-
return stripColor
|
|
3626
|
+
return stripColor(str).length;
|
|
3626
3627
|
}
|
|
3627
3628
|
/**
|
|
3628
3629
|
* Style the title for displaying in the help. Called with 'Usage:', 'Options:', etc.
|
|
@@ -3770,18 +3771,18 @@ var require_help = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3770
3771
|
* @returns {string}
|
|
3771
3772
|
* @package
|
|
3772
3773
|
*/
|
|
3773
|
-
function stripColor
|
|
3774
|
+
function stripColor(str) {
|
|
3774
3775
|
return str.replace(/\x1b\[\d*(;\d*)*m/g, "");
|
|
3775
3776
|
}
|
|
3776
|
-
exports.Help = Help
|
|
3777
|
-
exports.stripColor = stripColor
|
|
3777
|
+
exports.Help = Help;
|
|
3778
|
+
exports.stripColor = stripColor;
|
|
3778
3779
|
}));
|
|
3779
3780
|
|
|
3780
3781
|
//#endregion
|
|
3781
3782
|
//#region ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/option.js
|
|
3782
3783
|
var require_option = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3783
|
-
const { InvalidArgumentError
|
|
3784
|
-
var Option
|
|
3784
|
+
const { InvalidArgumentError } = require_error();
|
|
3785
|
+
var Option = class {
|
|
3785
3786
|
/**
|
|
3786
3787
|
* Initialize a new `Option` with the given `flags` and `description`.
|
|
3787
3788
|
*
|
|
@@ -3932,7 +3933,7 @@ var require_option = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3932
3933
|
choices(values) {
|
|
3933
3934
|
this.argChoices = values.slice();
|
|
3934
3935
|
this.parseArg = (arg, previous) => {
|
|
3935
|
-
if (!this.argChoices.includes(arg)) throw new InvalidArgumentError
|
|
3936
|
+
if (!this.argChoices.includes(arg)) throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
|
|
3936
3937
|
if (this.variadic) return this._collectValue(arg, previous);
|
|
3937
3938
|
return arg;
|
|
3938
3939
|
};
|
|
@@ -3996,7 +3997,7 @@ var require_option = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3996
3997
|
* use cases, but is tricky for others where we want separate behaviours despite
|
|
3997
3998
|
* the single shared option value.
|
|
3998
3999
|
*/
|
|
3999
|
-
var DualOptions
|
|
4000
|
+
var DualOptions = class {
|
|
4000
4001
|
/**
|
|
4001
4002
|
* @param {Option[]} options
|
|
4002
4003
|
*/
|
|
@@ -4035,8 +4036,8 @@ var require_option = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4035
4036
|
* @private
|
|
4036
4037
|
*/
|
|
4037
4038
|
function camelcase(str) {
|
|
4038
|
-
return str.split("-").reduce((str
|
|
4039
|
-
return str
|
|
4039
|
+
return str.split("-").reduce((str, word) => {
|
|
4040
|
+
return str + word[0].toUpperCase() + word.slice(1);
|
|
4040
4041
|
});
|
|
4041
4042
|
}
|
|
4042
4043
|
/**
|
|
@@ -4077,8 +4078,8 @@ var require_option = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4077
4078
|
longFlag
|
|
4078
4079
|
};
|
|
4079
4080
|
}
|
|
4080
|
-
exports.Option = Option
|
|
4081
|
-
exports.DualOptions = DualOptions
|
|
4081
|
+
exports.Option = Option;
|
|
4082
|
+
exports.DualOptions = DualOptions;
|
|
4082
4083
|
}));
|
|
4083
4084
|
|
|
4084
4085
|
//#endregion
|
|
@@ -4106,7 +4107,7 @@ var require_suggestSimilar = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4106
4107
|
* @param {string[]} candidates
|
|
4107
4108
|
* @returns {string}
|
|
4108
4109
|
*/
|
|
4109
|
-
function suggestSimilar
|
|
4110
|
+
function suggestSimilar(word, candidates) {
|
|
4110
4111
|
if (!candidates || candidates.length === 0) return "";
|
|
4111
4112
|
candidates = Array.from(new Set(candidates));
|
|
4112
4113
|
const searchingOptions = word.startsWith("--");
|
|
@@ -4134,7 +4135,7 @@ var require_suggestSimilar = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4134
4135
|
if (similar.length === 1) return `\n(Did you mean ${similar[0]}?)`;
|
|
4135
4136
|
return "";
|
|
4136
4137
|
}
|
|
4137
|
-
exports.suggestSimilar = suggestSimilar
|
|
4138
|
+
exports.suggestSimilar = suggestSimilar;
|
|
4138
4139
|
}));
|
|
4139
4140
|
|
|
4140
4141
|
//#endregion
|
|
@@ -4145,12 +4146,12 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4145
4146
|
const path = require("node:path");
|
|
4146
4147
|
const fs = require("node:fs");
|
|
4147
4148
|
const process$1 = require("node:process");
|
|
4148
|
-
const { Argument
|
|
4149
|
-
const { CommanderError
|
|
4150
|
-
const { Help
|
|
4151
|
-
const { Option
|
|
4149
|
+
const { Argument, humanReadableArgName } = require_argument();
|
|
4150
|
+
const { CommanderError } = require_error();
|
|
4151
|
+
const { Help, stripColor } = require_help();
|
|
4152
|
+
const { Option, DualOptions } = require_option();
|
|
4152
4153
|
const { suggestSimilar } = require_suggestSimilar();
|
|
4153
|
-
var Command
|
|
4154
|
+
var Command = class Command extends EventEmitter {
|
|
4154
4155
|
/**
|
|
4155
4156
|
* Initialize a new `Command`.
|
|
4156
4157
|
*
|
|
@@ -4308,7 +4309,7 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4308
4309
|
* @return {Command} new command
|
|
4309
4310
|
*/
|
|
4310
4311
|
createCommand(name) {
|
|
4311
|
-
return new Command
|
|
4312
|
+
return new Command(name);
|
|
4312
4313
|
}
|
|
4313
4314
|
/**
|
|
4314
4315
|
* You can customise the help with a subclass of Help by overriding createHelp,
|
|
@@ -4317,7 +4318,7 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4317
4318
|
* @return {Help}
|
|
4318
4319
|
*/
|
|
4319
4320
|
createHelp() {
|
|
4320
|
-
return Object.assign(new Help
|
|
4321
|
+
return Object.assign(new Help(), this.configureHelp());
|
|
4321
4322
|
}
|
|
4322
4323
|
/**
|
|
4323
4324
|
* You can customise the help by overriding Help properties using configureHelp(),
|
|
@@ -4413,7 +4414,7 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4413
4414
|
* @return {Argument} new argument
|
|
4414
4415
|
*/
|
|
4415
4416
|
createArgument(name, description) {
|
|
4416
|
-
return new Argument
|
|
4417
|
+
return new Argument(name, description);
|
|
4417
4418
|
}
|
|
4418
4419
|
/**
|
|
4419
4420
|
* Define argument syntax for command.
|
|
@@ -4570,7 +4571,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
4570
4571
|
* @private
|
|
4571
4572
|
*/
|
|
4572
4573
|
_exit(exitCode, code, message) {
|
|
4573
|
-
if (this._exitCallback) this._exitCallback(new CommanderError
|
|
4574
|
+
if (this._exitCallback) this._exitCallback(new CommanderError(exitCode, code, message));
|
|
4574
4575
|
process$1.exit(exitCode);
|
|
4575
4576
|
}
|
|
4576
4577
|
/**
|
|
@@ -4610,7 +4611,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
4610
4611
|
* @return {Option} new option
|
|
4611
4612
|
*/
|
|
4612
4613
|
createOption(flags, description) {
|
|
4613
|
-
return new Option
|
|
4614
|
+
return new Option(flags, description);
|
|
4614
4615
|
}
|
|
4615
4616
|
/**
|
|
4616
4617
|
* Wrap parseArgs to catch 'commander.invalidArgument'.
|
|
@@ -4711,7 +4712,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
4711
4712
|
* @private
|
|
4712
4713
|
*/
|
|
4713
4714
|
_optionEx(config, flags, description, fn, defaultValue) {
|
|
4714
|
-
if (typeof flags === "object" && flags instanceof Option
|
|
4715
|
+
if (typeof flags === "object" && flags instanceof Option) throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");
|
|
4715
4716
|
const option = this.createOption(flags, description);
|
|
4716
4717
|
option.makeOptionMandatory(!!config.mandatory);
|
|
4717
4718
|
if (typeof fn === "function") option.default(defaultValue).argParser(fn);
|
|
@@ -5117,14 +5118,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5117
5118
|
proc.on("close", (code) => {
|
|
5118
5119
|
code = code ?? 1;
|
|
5119
5120
|
if (!exitCallback) process$1.exit(code);
|
|
5120
|
-
else exitCallback(new CommanderError
|
|
5121
|
+
else exitCallback(new CommanderError(code, "commander.executeSubCommandAsync", "(close)"));
|
|
5121
5122
|
});
|
|
5122
5123
|
proc.on("error", (err) => {
|
|
5123
5124
|
if (err.code === "ENOENT") this._checkForMissingExecutable(executableFile, executableDir, subcommand._name);
|
|
5124
5125
|
else if (err.code === "EACCES") throw new Error(`'${executableFile}' not executable`);
|
|
5125
5126
|
if (!exitCallback) process$1.exit(1);
|
|
5126
5127
|
else {
|
|
5127
|
-
const wrappedError = new CommanderError
|
|
5128
|
+
const wrappedError = new CommanderError(1, "commander.executeSubCommandAsync", "(error)");
|
|
5128
5129
|
wrappedError.nestedError = err;
|
|
5129
5130
|
exitCallback(wrappedError);
|
|
5130
5131
|
}
|
|
@@ -5599,16 +5600,16 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5599
5600
|
* @private
|
|
5600
5601
|
*/
|
|
5601
5602
|
_conflictingOption(option, conflictingOption) {
|
|
5602
|
-
const findBestOptionFromValue = (option
|
|
5603
|
-
const optionKey = option
|
|
5603
|
+
const findBestOptionFromValue = (option) => {
|
|
5604
|
+
const optionKey = option.attributeName();
|
|
5604
5605
|
const optionValue = this.getOptionValue(optionKey);
|
|
5605
5606
|
const negativeOption = this.options.find((target) => target.negate && optionKey === target.attributeName());
|
|
5606
5607
|
const positiveOption = this.options.find((target) => !target.negate && optionKey === target.attributeName());
|
|
5607
5608
|
if (negativeOption && (negativeOption.presetArg === void 0 && optionValue === false || negativeOption.presetArg !== void 0 && optionValue === negativeOption.presetArg)) return negativeOption;
|
|
5608
|
-
return positiveOption || option
|
|
5609
|
+
return positiveOption || option;
|
|
5609
5610
|
};
|
|
5610
|
-
const getErrorMessage = (option
|
|
5611
|
-
const bestOption = findBestOptionFromValue(option
|
|
5611
|
+
const getErrorMessage = (option) => {
|
|
5612
|
+
const bestOption = findBestOptionFromValue(option);
|
|
5612
5613
|
const optionKey = bestOption.attributeName();
|
|
5613
5614
|
if (this.getOptionValueSource(optionKey) === "env") return `environment variable '${bestOption.envVar}'`;
|
|
5614
5615
|
return `option '${bestOption.flags}'`;
|
|
@@ -5871,9 +5872,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5871
5872
|
* @param {string} [path]
|
|
5872
5873
|
* @return {(string|null|Command)}
|
|
5873
5874
|
*/
|
|
5874
|
-
executableDir(path
|
|
5875
|
-
if (path
|
|
5876
|
-
this._executableDir = path
|
|
5875
|
+
executableDir(path) {
|
|
5876
|
+
if (path === void 0) return this._executableDir;
|
|
5877
|
+
this._executableDir = path;
|
|
5877
5878
|
return this;
|
|
5878
5879
|
}
|
|
5879
5880
|
/**
|
|
@@ -6112,32 +6113,32 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
6112
6113
|
if (process$1.env.NO_COLOR || process$1.env.FORCE_COLOR === "0" || process$1.env.FORCE_COLOR === "false") return false;
|
|
6113
6114
|
if (process$1.env.FORCE_COLOR || process$1.env.CLICOLOR_FORCE !== void 0) return true;
|
|
6114
6115
|
}
|
|
6115
|
-
exports.Command = Command
|
|
6116
|
+
exports.Command = Command;
|
|
6116
6117
|
exports.useColor = useColor;
|
|
6117
6118
|
}));
|
|
6118
6119
|
|
|
6119
6120
|
//#endregion
|
|
6120
6121
|
//#region ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/index.js
|
|
6121
6122
|
var require_commander = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
6122
|
-
const { Argument
|
|
6123
|
-
const { Command
|
|
6124
|
-
const { CommanderError
|
|
6125
|
-
const { Help
|
|
6126
|
-
const { Option
|
|
6127
|
-
exports.program = new Command
|
|
6128
|
-
exports.createCommand = (name) => new Command
|
|
6129
|
-
exports.createOption = (flags, description) => new Option
|
|
6130
|
-
exports.createArgument = (name, description) => new Argument
|
|
6123
|
+
const { Argument } = require_argument();
|
|
6124
|
+
const { Command } = require_command();
|
|
6125
|
+
const { CommanderError, InvalidArgumentError } = require_error();
|
|
6126
|
+
const { Help } = require_help();
|
|
6127
|
+
const { Option } = require_option();
|
|
6128
|
+
exports.program = new Command();
|
|
6129
|
+
exports.createCommand = (name) => new Command(name);
|
|
6130
|
+
exports.createOption = (flags, description) => new Option(flags, description);
|
|
6131
|
+
exports.createArgument = (name, description) => new Argument(name, description);
|
|
6131
6132
|
/**
|
|
6132
6133
|
* Expose classes
|
|
6133
6134
|
*/
|
|
6134
|
-
exports.Command = Command
|
|
6135
|
-
exports.Option = Option
|
|
6136
|
-
exports.Argument = Argument
|
|
6137
|
-
exports.Help = Help
|
|
6138
|
-
exports.CommanderError = CommanderError
|
|
6139
|
-
exports.InvalidArgumentError = InvalidArgumentError
|
|
6140
|
-
exports.InvalidOptionArgumentError = InvalidArgumentError
|
|
6135
|
+
exports.Command = Command;
|
|
6136
|
+
exports.Option = Option;
|
|
6137
|
+
exports.Argument = Argument;
|
|
6138
|
+
exports.Help = Help;
|
|
6139
|
+
exports.CommanderError = CommanderError;
|
|
6140
|
+
exports.InvalidArgumentError = InvalidArgumentError;
|
|
6141
|
+
exports.InvalidOptionArgumentError = InvalidArgumentError;
|
|
6141
6142
|
}));
|
|
6142
6143
|
|
|
6143
6144
|
//#endregion
|
|
@@ -6168,7 +6169,6 @@ const MAX_INT32 = 2147483647;
|
|
|
6168
6169
|
const MAX_UINT32 = 4294967295;
|
|
6169
6170
|
const MIN_SINGLE_SEGMENT_GROWTH = 4096;
|
|
6170
6171
|
const NATIVE_LITTLE_ENDIAN = tmpWord.getUint8(0) === 2;
|
|
6171
|
-
const PACK_SPAN_THRESHOLD = 2;
|
|
6172
6172
|
const POINTER_DOUBLE_FAR_MASK = 4;
|
|
6173
6173
|
const POINTER_TYPE_MASK = 3;
|
|
6174
6174
|
const MAX_DEPTH = MAX_INT32;
|
|
@@ -6391,6 +6391,7 @@ var Orphan = class {
|
|
|
6391
6391
|
case PointerType.OTHER:
|
|
6392
6392
|
setInterfacePointer(this._capnp.capId, res.pointer);
|
|
6393
6393
|
break;
|
|
6394
|
+
/* istanbul ignore next */
|
|
6394
6395
|
default: throw new Error(PTR_INVALID_POINTER_TYPE);
|
|
6395
6396
|
}
|
|
6396
6397
|
this._capnp = void 0;
|
|
@@ -6431,22 +6432,28 @@ function getListByteLength(elementSize, length, compositeSize) {
|
|
|
6431
6432
|
case ListElementSize.BYTE_8:
|
|
6432
6433
|
case ListElementSize.POINTER:
|
|
6433
6434
|
case ListElementSize.VOID: return padToWord$1(getListElementByteLength(elementSize) * length);
|
|
6435
|
+
/* istanbul ignore next */
|
|
6434
6436
|
case ListElementSize.COMPOSITE:
|
|
6435
6437
|
if (compositeSize === void 0) throw new Error(format(PTR_INVALID_LIST_SIZE, NaN));
|
|
6436
6438
|
return length * padToWord$1(getByteLength(compositeSize));
|
|
6439
|
+
/* istanbul ignore next */
|
|
6437
6440
|
default: throw new Error(PTR_INVALID_LIST_SIZE);
|
|
6438
6441
|
}
|
|
6439
6442
|
}
|
|
6440
6443
|
function getListElementByteLength(elementSize) {
|
|
6441
6444
|
switch (elementSize) {
|
|
6445
|
+
/* istanbul ignore next */
|
|
6442
6446
|
case ListElementSize.BIT: return NaN;
|
|
6443
6447
|
case ListElementSize.BYTE: return 1;
|
|
6444
6448
|
case ListElementSize.BYTE_2: return 2;
|
|
6445
6449
|
case ListElementSize.BYTE_4: return 4;
|
|
6446
6450
|
case ListElementSize.BYTE_8:
|
|
6447
6451
|
case ListElementSize.POINTER: return 8;
|
|
6452
|
+
/* istanbul ignore next */
|
|
6448
6453
|
case ListElementSize.COMPOSITE: return NaN;
|
|
6454
|
+
/* istanbul ignore next */
|
|
6449
6455
|
case ListElementSize.VOID: return 0;
|
|
6456
|
+
/* istanbul ignore next */
|
|
6450
6457
|
default: throw new Error(format(PTR_INVALID_LIST_SIZE, elementSize));
|
|
6451
6458
|
}
|
|
6452
6459
|
}
|
|
@@ -6467,6 +6474,7 @@ function copyFrom(src, p) {
|
|
|
6467
6474
|
case PointerType.OTHER:
|
|
6468
6475
|
copyFromInterface(src, p);
|
|
6469
6476
|
break;
|
|
6477
|
+
/* istanbul ignore next */
|
|
6470
6478
|
default: throw new Error(format(PTR_INVALID_POINTER_TYPE, getTargetPointerType(p)));
|
|
6471
6479
|
}
|
|
6472
6480
|
}
|
|
@@ -6912,8 +6920,8 @@ var List = class List extends Pointer {
|
|
|
6912
6920
|
entries() {
|
|
6913
6921
|
return this.toArray().entries();
|
|
6914
6922
|
}
|
|
6915
|
-
flat(depth
|
|
6916
|
-
return this.toArray().flat(depth
|
|
6923
|
+
flat(depth) {
|
|
6924
|
+
return this.toArray().flat(depth);
|
|
6917
6925
|
}
|
|
6918
6926
|
with(index, value) {
|
|
6919
6927
|
return this.toArray().with(index, value);
|
|
@@ -7375,8 +7383,8 @@ function getStruct(index, StructClass, s, defaultValue) {
|
|
|
7375
7383
|
else initStruct(StructClass._capnp.size, t);
|
|
7376
7384
|
else {
|
|
7377
7385
|
validate(PointerType.STRUCT, t);
|
|
7378
|
-
const ts
|
|
7379
|
-
if (ts
|
|
7386
|
+
const ts = getTargetStructSize(t);
|
|
7387
|
+
if (ts.dataByteLength < StructClass._capnp.size.dataByteLength || ts.pointerLength < StructClass._capnp.size.pointerLength) resize(StructClass._capnp.size, t);
|
|
7380
7388
|
}
|
|
7381
7389
|
return t;
|
|
7382
7390
|
}
|
|
@@ -8080,10 +8088,38 @@ var Node_Annotation = class extends Struct {
|
|
|
8080
8088
|
};
|
|
8081
8089
|
const Node_Which = {
|
|
8082
8090
|
FILE: 0,
|
|
8091
|
+
/**
|
|
8092
|
+
* Name to present to humans to identify this Node. You should not attempt to parse this. Its
|
|
8093
|
+
* format could change. It is not guaranteed to be unique.
|
|
8094
|
+
*
|
|
8095
|
+
* (On Zooko's triangle, this is the node's nickname.)
|
|
8096
|
+
*
|
|
8097
|
+
*/
|
|
8083
8098
|
STRUCT: 1,
|
|
8099
|
+
/**
|
|
8100
|
+
* If you want a shorter version of `displayName` (just naming this node, without its surrounding
|
|
8101
|
+
* scope), chop off this many characters from the beginning of `displayName`.
|
|
8102
|
+
*
|
|
8103
|
+
*/
|
|
8084
8104
|
ENUM: 2,
|
|
8105
|
+
/**
|
|
8106
|
+
* ID of the lexical parent node. Typically, the scope node will have a NestedNode pointing back
|
|
8107
|
+
* at this node, but robust code should avoid relying on this (and, in fact, group nodes are not
|
|
8108
|
+
* listed in the outer struct's nestedNodes, since they are listed in the fields). `scopeId` is
|
|
8109
|
+
* zero if the node has no parent, which is normally only the case with files, but should be
|
|
8110
|
+
* allowed for any kind of node (in order to make runtime type generation easier).
|
|
8111
|
+
*
|
|
8112
|
+
*/
|
|
8085
8113
|
INTERFACE: 3,
|
|
8114
|
+
/**
|
|
8115
|
+
* List of nodes nested within this node, along with the names under which they were declared.
|
|
8116
|
+
*
|
|
8117
|
+
*/
|
|
8086
8118
|
CONST: 4,
|
|
8119
|
+
/**
|
|
8120
|
+
* Annotations applied to this node.
|
|
8121
|
+
*
|
|
8122
|
+
*/
|
|
8087
8123
|
ANNOTATION: 5
|
|
8088
8124
|
};
|
|
8089
8125
|
var Node = class Node extends Struct {
|
|
@@ -8401,6 +8437,13 @@ var Field_Group = class extends Struct {
|
|
|
8401
8437
|
};
|
|
8402
8438
|
const Field_Ordinal_Which = {
|
|
8403
8439
|
IMPLICIT: 0,
|
|
8440
|
+
/**
|
|
8441
|
+
* The original ordinal number given to the field. You probably should NOT use this; if you need
|
|
8442
|
+
* a numeric identifier for a field, use its position within the field array for its scope.
|
|
8443
|
+
* The ordinal is given here mainly just so that the original schema text can be reproduced given
|
|
8444
|
+
* the compiled version -- i.e. so that `capnp compile -ocapnp` can do its job.
|
|
8445
|
+
*
|
|
8446
|
+
*/
|
|
8404
8447
|
EXPLICIT: 1
|
|
8405
8448
|
};
|
|
8406
8449
|
var Field_Ordinal = class extends Struct {
|
|
@@ -8444,6 +8487,15 @@ var Field_Ordinal = class extends Struct {
|
|
|
8444
8487
|
};
|
|
8445
8488
|
const Field_Which = {
|
|
8446
8489
|
SLOT: 0,
|
|
8490
|
+
/**
|
|
8491
|
+
* Indicates where this member appeared in the code, relative to other members.
|
|
8492
|
+
* Code ordering may have semantic relevance -- programmers tend to place related fields
|
|
8493
|
+
* together. So, using code ordering makes sense in human-readable formats where ordering is
|
|
8494
|
+
* otherwise irrelevant, like JSON. The values of codeOrder are tightly-packed, so the maximum
|
|
8495
|
+
* value is count(members) - 1. Fields that are members of a union are only ordered relative to
|
|
8496
|
+
* the other members of that union, so the maximum value there is count(union.members).
|
|
8497
|
+
*
|
|
8498
|
+
*/
|
|
8447
8499
|
GROUP: 1
|
|
8448
8500
|
};
|
|
8449
8501
|
var Field = class Field extends Struct {
|
|
@@ -8907,9 +8959,25 @@ var Type_Interface = class extends Struct {
|
|
|
8907
8959
|
}
|
|
8908
8960
|
};
|
|
8909
8961
|
const Type_AnyPointer_Unconstrained_Which = {
|
|
8962
|
+
/**
|
|
8963
|
+
* truly AnyPointer
|
|
8964
|
+
*
|
|
8965
|
+
*/
|
|
8910
8966
|
ANY_KIND: 0,
|
|
8967
|
+
/**
|
|
8968
|
+
* AnyStruct
|
|
8969
|
+
*
|
|
8970
|
+
*/
|
|
8911
8971
|
STRUCT: 1,
|
|
8972
|
+
/**
|
|
8973
|
+
* AnyList
|
|
8974
|
+
*
|
|
8975
|
+
*/
|
|
8912
8976
|
LIST: 2,
|
|
8977
|
+
/**
|
|
8978
|
+
* Capability
|
|
8979
|
+
*
|
|
8980
|
+
*/
|
|
8913
8981
|
CAPABILITY: 3
|
|
8914
8982
|
};
|
|
8915
8983
|
var Type_AnyPointer_Unconstrained = class extends Struct {
|
|
@@ -9001,8 +9069,25 @@ var Type_AnyPointer_ImplicitMethodParameter = class extends Struct {
|
|
|
9001
9069
|
}
|
|
9002
9070
|
};
|
|
9003
9071
|
const Type_AnyPointer_Which = {
|
|
9072
|
+
/**
|
|
9073
|
+
* A regular AnyPointer.
|
|
9074
|
+
*
|
|
9075
|
+
* The name "unconstrained" means as opposed to constraining it to match a type parameter.
|
|
9076
|
+
* In retrospect this name is probably a poor choice given that it may still be constrained
|
|
9077
|
+
* to be a struct, list, or capability.
|
|
9078
|
+
*
|
|
9079
|
+
*/
|
|
9004
9080
|
UNCONSTRAINED: 0,
|
|
9081
|
+
/**
|
|
9082
|
+
* This is actually a reference to a type parameter defined within this scope.
|
|
9083
|
+
*
|
|
9084
|
+
*/
|
|
9005
9085
|
PARAMETER: 1,
|
|
9086
|
+
/**
|
|
9087
|
+
* This is actually a reference to an implicit (generic) parameter of a method. The only
|
|
9088
|
+
* legal context for this type to appear is inside Method.paramBrand or Method.resultBrand.
|
|
9089
|
+
*
|
|
9090
|
+
*/
|
|
9006
9091
|
IMPLICIT_METHOD_PARAMETER: 2
|
|
9007
9092
|
};
|
|
9008
9093
|
var Type_AnyPointer = class extends Struct {
|
|
@@ -9288,7 +9373,15 @@ var Type = class extends Struct {
|
|
|
9288
9373
|
}
|
|
9289
9374
|
};
|
|
9290
9375
|
const Brand_Scope_Which = {
|
|
9376
|
+
/**
|
|
9377
|
+
* ID of the scope to which these params apply.
|
|
9378
|
+
*
|
|
9379
|
+
*/
|
|
9291
9380
|
BIND: 0,
|
|
9381
|
+
/**
|
|
9382
|
+
* List of parameter bindings.
|
|
9383
|
+
*
|
|
9384
|
+
*/
|
|
9292
9385
|
INHERIT: 1
|
|
9293
9386
|
};
|
|
9294
9387
|
var Brand_Scope = class Brand_Scope extends Struct {
|
|
@@ -9457,6 +9550,11 @@ const Value_Which = {
|
|
|
9457
9550
|
LIST: 14,
|
|
9458
9551
|
ENUM: 15,
|
|
9459
9552
|
STRUCT: 16,
|
|
9553
|
+
/**
|
|
9554
|
+
* The only interface value that can be represented statically is "null", whose methods always
|
|
9555
|
+
* throw exceptions.
|
|
9556
|
+
*
|
|
9557
|
+
*/
|
|
9460
9558
|
INTERFACE: 17,
|
|
9461
9559
|
ANY_POINTER: 18
|
|
9462
9560
|
};
|
|
@@ -9798,6 +9896,10 @@ var Annotation = class extends Struct {
|
|
|
9798
9896
|
}
|
|
9799
9897
|
};
|
|
9800
9898
|
const ElementSize = {
|
|
9899
|
+
/**
|
|
9900
|
+
* aka "void", but that's a keyword.
|
|
9901
|
+
*
|
|
9902
|
+
*/
|
|
9801
9903
|
EMPTY: 0,
|
|
9802
9904
|
BIT: 1,
|
|
9803
9905
|
BYTE: 2,
|
|
@@ -10116,7 +10218,7 @@ var SingleSegmentArena = class {
|
|
|
10116
10218
|
};
|
|
10117
10219
|
function allocate$1(minSize, segments, s) {
|
|
10118
10220
|
const srcBuffer = segments.length > 0 ? segments[0].buffer : s.buffer;
|
|
10119
|
-
minSize = minSize <
|
|
10221
|
+
minSize = minSize < 4096 ? MIN_SINGLE_SEGMENT_GROWTH : padToWord$1(minSize);
|
|
10120
10222
|
s.buffer = new ArrayBuffer(srcBuffer.byteLength + minSize);
|
|
10121
10223
|
new Float64Array(s.buffer).set(new Float64Array(srcBuffer));
|
|
10122
10224
|
return new ArenaAllocationResult(0, s.buffer);
|
|
@@ -10227,7 +10329,7 @@ function pack(unpacked, byteOffset = 0, byteLength) {
|
|
|
10227
10329
|
} else rangeWordCount++;
|
|
10228
10330
|
break;
|
|
10229
10331
|
case 255:
|
|
10230
|
-
if (getZeroByteCount(a, b, c, d, e, f, g, h) >=
|
|
10332
|
+
if (getZeroByteCount(a, b, c, d, e, f, g, h) >= 2 || rangeWordCount >= 255) {
|
|
10231
10333
|
dst[spanWordCountOffset] = rangeWordCount;
|
|
10232
10334
|
rangeWordCount = 0;
|
|
10233
10335
|
skipWriteWord = false;
|
|
@@ -10319,7 +10421,7 @@ var Segment = class {
|
|
|
10319
10421
|
allocate(byteLength) {
|
|
10320
10422
|
let segment = this;
|
|
10321
10423
|
byteLength = padToWord$1(byteLength);
|
|
10322
|
-
if (byteLength >
|
|
10424
|
+
if (byteLength > 4294967295 - 8) throw new Error(format(SEG_SIZE_OVERFLOW, byteLength));
|
|
10323
10425
|
if (!segment.hasCapacity(byteLength)) segment = segment.message.allocateSegment(byteLength);
|
|
10324
10426
|
const byteOffset = segment.byteLength;
|
|
10325
10427
|
segment.byteLength += byteLength;
|
|
@@ -10819,8 +10921,8 @@ Segment #${i}
|
|
|
10819
10921
|
function getRoot(RootStruct, m) {
|
|
10820
10922
|
const root = new RootStruct(m.getSegment(0), 0);
|
|
10821
10923
|
validate(PointerType.STRUCT, root);
|
|
10822
|
-
const ts
|
|
10823
|
-
if (ts
|
|
10924
|
+
const ts = getTargetStructSize(root);
|
|
10925
|
+
if (ts.dataByteLength < RootStruct._capnp.size.dataByteLength || ts.pointerLength < RootStruct._capnp.size.pointerLength) resize(RootStruct._capnp.size, root);
|
|
10824
10926
|
return root;
|
|
10825
10927
|
}
|
|
10826
10928
|
function getSegment(id, m) {
|
|
@@ -11029,7 +11131,7 @@ var hasRequiredHex2dec;
|
|
|
11029
11131
|
function requireHex2dec() {
|
|
11030
11132
|
if (hasRequiredHex2dec) return hex2dec;
|
|
11031
11133
|
hasRequiredHex2dec = 1;
|
|
11032
|
-
function add
|
|
11134
|
+
function add(x, y, base) {
|
|
11033
11135
|
var z = [];
|
|
11034
11136
|
var n = Math.max(x.length, y.length);
|
|
11035
11137
|
var carry = 0;
|
|
@@ -11050,10 +11152,10 @@ function requireHex2dec() {
|
|
|
11050
11152
|
var result = [];
|
|
11051
11153
|
var power = x;
|
|
11052
11154
|
while (true) {
|
|
11053
|
-
if (num & 1) result = add
|
|
11155
|
+
if (num & 1) result = add(result, power, base);
|
|
11054
11156
|
num = num >> 1;
|
|
11055
11157
|
if (num === 0) break;
|
|
11056
|
-
power = add
|
|
11158
|
+
power = add(power, power, base);
|
|
11057
11159
|
}
|
|
11058
11160
|
return result;
|
|
11059
11161
|
}
|
|
@@ -11073,7 +11175,7 @@ function requireHex2dec() {
|
|
|
11073
11175
|
var outArray = [];
|
|
11074
11176
|
var power = [1];
|
|
11075
11177
|
for (var i = 0; i < digits.length; i++) {
|
|
11076
|
-
if (digits[i]) outArray = add
|
|
11178
|
+
if (digits[i]) outArray = add(outArray, multiplyByNumber(digits[i], power, toBase), toBase);
|
|
11077
11179
|
power = multiplyByNumber(fromBase, power, toBase);
|
|
11078
11180
|
}
|
|
11079
11181
|
var out = "";
|
|
@@ -11468,16 +11570,16 @@ function generateStructFieldMethods(ctx, members, node, field, fieldIndex) {
|
|
|
11468
11570
|
const maybeDefaultArg = hadExplicitDefault ? `, ${fullClassName}._capnp.default${capitalizedName}` : "";
|
|
11469
11571
|
const union = discriminantValue !== Field.NO_DISCRIMINANT;
|
|
11470
11572
|
const offset = field._isSlot ? field.slot.offset : 0;
|
|
11471
|
-
let adopt
|
|
11472
|
-
let disown
|
|
11573
|
+
let adopt = false;
|
|
11574
|
+
let disown = false;
|
|
11473
11575
|
let has = false;
|
|
11474
11576
|
let init;
|
|
11475
11577
|
let get;
|
|
11476
11578
|
let set;
|
|
11477
11579
|
switch (whichType) {
|
|
11478
11580
|
case Type.ANY_POINTER:
|
|
11479
|
-
adopt
|
|
11480
|
-
disown
|
|
11581
|
+
adopt = true;
|
|
11582
|
+
disown = true;
|
|
11481
11583
|
has = true;
|
|
11482
11584
|
get = `$.utils.getPointer(${offset}, this${maybeDefaultArg})`;
|
|
11483
11585
|
set = `$.utils.copyFrom(value, ${get})`;
|
|
@@ -11502,8 +11604,8 @@ function generateStructFieldMethods(ctx, members, node, field, fieldIndex) {
|
|
|
11502
11604
|
break;
|
|
11503
11605
|
}
|
|
11504
11606
|
case Type.DATA:
|
|
11505
|
-
adopt
|
|
11506
|
-
disown
|
|
11607
|
+
adopt = true;
|
|
11608
|
+
disown = true;
|
|
11507
11609
|
has = true;
|
|
11508
11610
|
get = `$.utils.getData(${offset}, this${maybeDefaultArg})`;
|
|
11509
11611
|
set = `$.utils.copyFrom(value, $.utils.getPointer(${offset}, this))`;
|
|
@@ -11518,8 +11620,8 @@ function generateStructFieldMethods(ctx, members, node, field, fieldIndex) {
|
|
|
11518
11620
|
let listClass = ConcreteListType[elementType];
|
|
11519
11621
|
if (elementType === Type.LIST || elementType === Type.STRUCT) listClass = `${fullClassName}._${capitalizedName}`;
|
|
11520
11622
|
else if (listClass === void 0) throw new Error(format(GEN_UNSUPPORTED_LIST_ELEMENT_TYPE, elementType));
|
|
11521
|
-
adopt
|
|
11522
|
-
disown
|
|
11623
|
+
adopt = true;
|
|
11624
|
+
disown = true;
|
|
11523
11625
|
has = true;
|
|
11524
11626
|
get = `$.utils.getList(${offset}, ${listClass}, this${maybeDefaultArg})`;
|
|
11525
11627
|
set = `$.utils.copyFrom(value, $.utils.getPointer(${offset}, this))`;
|
|
@@ -11531,8 +11633,8 @@ function generateStructFieldMethods(ctx, members, node, field, fieldIndex) {
|
|
|
11531
11633
|
break;
|
|
11532
11634
|
}
|
|
11533
11635
|
case Type.STRUCT:
|
|
11534
|
-
adopt
|
|
11535
|
-
disown
|
|
11636
|
+
adopt = true;
|
|
11637
|
+
disown = true;
|
|
11536
11638
|
has = true;
|
|
11537
11639
|
get = `$.utils.getStruct(${offset}, ${jsType}, this${maybeDefaultArg})`;
|
|
11538
11640
|
set = `$.utils.copyFrom(value, $.utils.getPointer(${offset}, this))`;
|
|
@@ -11549,13 +11651,13 @@ function generateStructFieldMethods(ctx, members, node, field, fieldIndex) {
|
|
|
11549
11651
|
init = get;
|
|
11550
11652
|
break;
|
|
11551
11653
|
}
|
|
11552
|
-
if (adopt
|
|
11654
|
+
if (adopt) members.push(`
|
|
11553
11655
|
_adopt${capitalizedName}(value: $.Orphan<${jsType}>): void {
|
|
11554
11656
|
${union ? `$.utils.setUint16(${discriminantOffset * 2}, ${discriminantValue}, this);` : ""}
|
|
11555
11657
|
$.utils.adopt(value, $.utils.getPointer(${offset}, this));
|
|
11556
11658
|
}
|
|
11557
11659
|
`);
|
|
11558
|
-
if (disown
|
|
11660
|
+
if (disown) members.push(`
|
|
11559
11661
|
_disown${capitalizedName}(): $.Orphan<${jsType}> {
|
|
11560
11662
|
return $.utils.disown(this.${name === "constructor" ? `$${name}` : name});
|
|
11561
11663
|
}
|
|
@@ -11857,9 +11959,9 @@ function tsCompile(files, dts, js, tsconfig) {
|
|
|
11857
11959
|
if (files.has(filename)) return files.get(filename);
|
|
11858
11960
|
return _readFile(filename);
|
|
11859
11961
|
};
|
|
11860
|
-
const program
|
|
11861
|
-
const emitResult = program
|
|
11862
|
-
const allDiagnostics = [...typescript.default.getPreEmitDiagnostics(program
|
|
11962
|
+
const program = typescript.default.createProgram([...files.keys()], compileOptions, compilerHost);
|
|
11963
|
+
const emitResult = program.emit();
|
|
11964
|
+
const allDiagnostics = [...typescript.default.getPreEmitDiagnostics(program), ...emitResult.diagnostics];
|
|
11863
11965
|
if (allDiagnostics.length > 0) {
|
|
11864
11966
|
for (const diagnostic of allDiagnostics) {
|
|
11865
11967
|
const message = typescript.default.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
|
|
@@ -11894,35 +11996,35 @@ function toArray(array) {
|
|
|
11894
11996
|
* @returns The resolved options
|
|
11895
11997
|
*/
|
|
11896
11998
|
async function resolveOptions(options) {
|
|
11897
|
-
const tsconfigPath = options.tsconfigPath ? options.tsconfigPath.replace("{projectRoot}", options.projectRoot).replace("{workspaceRoot}", options.workspaceRoot) : (0,
|
|
11999
|
+
const tsconfigPath = options.tsconfigPath ? options.tsconfigPath.replace("{projectRoot}", options.projectRoot).replace("{workspaceRoot}", options.workspaceRoot) : (0, _stryke_path_join_paths.joinPaths)(options.projectRoot, "tsconfig.json");
|
|
11898
12000
|
const schemas = [];
|
|
11899
|
-
if (options.schemas) schemas.push(...toArray(options.schemas).filter(Boolean).map((schema) => schema.replace("{projectRoot}", options.projectRoot).replace("{workspaceRoot}", options.workspaceRoot)).map((schema) => schema.includes("*") || schema.endsWith(".capnp") || (0,
|
|
11900
|
-
else schemas.push((0,
|
|
12001
|
+
if (options.schemas) schemas.push(...toArray(options.schemas).filter(Boolean).map((schema) => schema.replace("{projectRoot}", options.projectRoot).replace("{workspaceRoot}", options.workspaceRoot)).map((schema) => schema.includes("*") || schema.endsWith(".capnp") || (0, _stryke_fs_exists.existsSync)(schema) && (0, _stryke_fs_list_files.listSync)((0, _stryke_path_join_paths.joinPaths)(schema, "**/*.capnp")).length > 0 ? schema : (0, _stryke_fs_exists.existsSync)((0, _stryke_path_join_paths.joinPaths)(options.projectRoot, schema)) && (0, _stryke_fs_list_files.listSync)((0, _stryke_path_join_paths.joinPaths)(options.projectRoot, schema, "**/*.capnp")).length > 0 ? (0, _stryke_path_join_paths.joinPaths)(options.projectRoot, schema, "**/*.capnp") : (0, _stryke_fs_exists.existsSync)((0, _stryke_path_join_paths.joinPaths)(options.workspaceRoot, schema)) && (0, _stryke_fs_list_files.listSync)((0, _stryke_path_join_paths.joinPaths)(options.workspaceRoot, schema, "**/*.capnp")).length > 0 ? (0, _stryke_path_join_paths.joinPaths)(options.workspaceRoot, schema, "**/*.capnp") : schema));
|
|
12002
|
+
else schemas.push((0, _stryke_fs_exists.existsSync)((0, _stryke_path_join_paths.joinPaths)(options.projectRoot, "schemas/**/*.capnp")) && (0, _stryke_fs_list_files.listSync)((0, _stryke_path_join_paths.joinPaths)(options.projectRoot, "schemas/**/*.capnp")).length > 0 ? (0, _stryke_path_join_paths.joinPaths)(options.projectRoot, "schemas/**/*.capnp") : (0, _stryke_fs_exists.existsSync)((0, _stryke_path_join_paths.joinPaths)(options.workspaceRoot, "schemas/**/*.capnp")) && (0, _stryke_fs_list_files.listSync)((0, _stryke_path_join_paths.joinPaths)(options.workspaceRoot, "schemas/**/*.capnp")).length > 0 ? (0, _stryke_path_join_paths.joinPaths)(options.workspaceRoot, "schemas/**/*.capnp") : "schemas/**/*.capnp");
|
|
11901
12003
|
let resolvedTsconfig;
|
|
11902
12004
|
if (options.tsconfig) resolvedTsconfig = options.tsconfig;
|
|
11903
12005
|
else {
|
|
11904
12006
|
let resolvedTsconfigPath = tsconfigPath;
|
|
11905
|
-
if (!(0,
|
|
12007
|
+
if (!(0, _stryke_fs_exists.existsSync)(resolvedTsconfigPath)) {
|
|
11906
12008
|
const found = [
|
|
11907
|
-
(0,
|
|
11908
|
-
(0,
|
|
11909
|
-
(0,
|
|
11910
|
-
(0,
|
|
11911
|
-
(0,
|
|
11912
|
-
(0,
|
|
11913
|
-
(0,
|
|
11914
|
-
(0,
|
|
11915
|
-
(0,
|
|
11916
|
-
(0,
|
|
11917
|
-
].find((path
|
|
12009
|
+
(0, _stryke_path_join_paths.joinPaths)(options.projectRoot, "tsconfig.json"),
|
|
12010
|
+
(0, _stryke_path_join_paths.joinPaths)(options.projectRoot, "tsconfig.lib.json"),
|
|
12011
|
+
(0, _stryke_path_join_paths.joinPaths)(options.projectRoot, "tsconfig.app.json"),
|
|
12012
|
+
(0, _stryke_path_join_paths.joinPaths)(options.projectRoot, "tsconfig.capnp.json"),
|
|
12013
|
+
(0, _stryke_path_join_paths.joinPaths)(options.projectRoot, "tsconfig.schema.json"),
|
|
12014
|
+
(0, _stryke_path_join_paths.joinPaths)(options.workspaceRoot, "tsconfig.json"),
|
|
12015
|
+
(0, _stryke_path_join_paths.joinPaths)(options.workspaceRoot, "tsconfig.lib.json"),
|
|
12016
|
+
(0, _stryke_path_join_paths.joinPaths)(options.workspaceRoot, "tsconfig.app.json"),
|
|
12017
|
+
(0, _stryke_path_join_paths.joinPaths)(options.workspaceRoot, "tsconfig.capnp.json"),
|
|
12018
|
+
(0, _stryke_path_join_paths.joinPaths)(options.workspaceRoot, "tsconfig.schema.json")
|
|
12019
|
+
].find((path) => (0, _stryke_fs_exists.existsSync)(path));
|
|
11918
12020
|
if (found) resolvedTsconfigPath = found;
|
|
11919
12021
|
}
|
|
11920
|
-
if (!resolvedTsconfigPath || !(0,
|
|
12022
|
+
if (!resolvedTsconfigPath || !(0, _stryke_fs_exists.existsSync)(resolvedTsconfigPath)) {
|
|
11921
12023
|
const errorMessage = tsconfigPath ? `✖ The specified TypeScript configuration file "${tsconfigPath}" does not exist. Please provide a valid path.` : "✖ The specified TypeScript configuration file does not exist. Please provide a valid path.";
|
|
11922
12024
|
writeFatal(errorMessage, { logLevel: "all" });
|
|
11923
12025
|
throw new Error(errorMessage);
|
|
11924
12026
|
}
|
|
11925
|
-
resolvedTsconfig = (0, typescript.parseJsonConfigFileContent)(await (0,
|
|
12027
|
+
resolvedTsconfig = (0, typescript.parseJsonConfigFileContent)(await (0, _stryke_fs_json.readJsonFile)(tsconfigPath), typescript.sys, (0, _stryke_path_file_path_fns.findFilePath)(tsconfigPath));
|
|
11926
12028
|
if (!resolvedTsconfig) {
|
|
11927
12029
|
const errorMessage = `✖ The specified TypeScript configuration file "${tsconfigPath}" is invalid. Please provide a valid configuration.`;
|
|
11928
12030
|
writeFatal(errorMessage, { logLevel: "all" });
|
|
@@ -11937,21 +12039,21 @@ async function resolveOptions(options) {
|
|
|
11937
12039
|
for (const schema of schemas) {
|
|
11938
12040
|
let formattedSchema = schema;
|
|
11939
12041
|
if (!schema.endsWith(".capnp") && !schema.includes("*")) formattedSchema = `${schema.replace(/\/$/g, "")}/*.capnp`;
|
|
11940
|
-
resolvedSchemas.push(...await (0,
|
|
12042
|
+
resolvedSchemas.push(...await (0, _stryke_fs_list_files.listFiles)(formattedSchema));
|
|
11941
12043
|
}
|
|
11942
12044
|
if (resolvedSchemas.length === 0 || !resolvedSchemas[0]) {
|
|
11943
12045
|
writeWarning(`✖ No Cap'n Proto schema files found in the specified source paths: ${schemas.join(", ")}. As a result, the Cap'n Proto compiler will not be able to generate any output files. Please ensure that the paths are correct and contain .capnp files.`, { logLevel: "all" });
|
|
11944
12046
|
return null;
|
|
11945
12047
|
}
|
|
11946
|
-
const output = options.output ? options.output.replace("{projectRoot}", options.projectRoot).replace("{workspaceRoot}", options.workspaceRoot) : (0,
|
|
11947
|
-
if (!(0,
|
|
11948
|
-
if ((0,
|
|
12048
|
+
const output = options.output ? options.output.replace("{projectRoot}", options.projectRoot).replace("{workspaceRoot}", options.workspaceRoot) : (0, _stryke_path_append.appendPath)((0, _stryke_path_file_path_fns.relativePath)(tsconfigPath ? (0, _stryke_path_file_path_fns.findFilePath)(tsconfigPath) : options.projectRoot, (0, _stryke_path_append.appendPath)(resolvedSchemas[0].endsWith(".capnp") ? (0, _stryke_path_file_path_fns.findFilePath)(resolvedSchemas[0]) : resolvedSchemas[0], options.workspaceRoot)), options.projectRoot);
|
|
12049
|
+
if (!(0, _stryke_fs_exists.existsSync)(output)) {
|
|
12050
|
+
if ((0, _stryke_fs.isFile)(output)) {
|
|
11949
12051
|
const errorMessage = `✖ The specified output path "${output}" is a file. Please provide a valid directory path.`;
|
|
11950
12052
|
writeFatal(errorMessage, { logLevel: "all" });
|
|
11951
12053
|
throw new Error(errorMessage);
|
|
11952
12054
|
}
|
|
11953
12055
|
writeInfo(`Output directory "${output}" does not exist. It will be created automatically.`, { logLevel: "all" });
|
|
11954
|
-
await (0,
|
|
12056
|
+
await (0, _stryke_fs.createDirectory)(output);
|
|
11955
12057
|
}
|
|
11956
12058
|
resolvedTsconfig.options.outDir = output;
|
|
11957
12059
|
return {
|
|
@@ -11977,9 +12079,9 @@ async function resolveOptions(options) {
|
|
|
11977
12079
|
* @returns A promise that resolves to the compilation result.
|
|
11978
12080
|
*/
|
|
11979
12081
|
async function capnpc(options) {
|
|
11980
|
-
const { output, tsconfig, schemas = [], tty
|
|
12082
|
+
const { output, tsconfig, schemas = [], tty } = options;
|
|
11981
12083
|
let dataBuf = node_buffer.Buffer.alloc(0);
|
|
11982
|
-
if (tty
|
|
12084
|
+
if (tty) {
|
|
11983
12085
|
const chunks = [];
|
|
11984
12086
|
process.stdin.on("data", (chunk) => {
|
|
11985
12087
|
chunks.push(chunk);
|
|
@@ -11997,9 +12099,9 @@ async function capnpc(options) {
|
|
|
11997
12099
|
}
|
|
11998
12100
|
if (dataBuf.byteLength === 0) {
|
|
11999
12101
|
const opts = [];
|
|
12000
|
-
if (output && (0,
|
|
12102
|
+
if (output && (0, _stryke_fs_exists.existsSync)(output)) opts.push(`-o-:${output}`);
|
|
12001
12103
|
else {
|
|
12002
|
-
if (output && !(0,
|
|
12104
|
+
if (output && !(0, _stryke_fs_exists.existsSync)(output)) writeWarning(`Output directory "${output}" does not exist, will write to schema path...`);
|
|
12003
12105
|
opts.push("-o-");
|
|
12004
12106
|
}
|
|
12005
12107
|
dataBuf = await new Promise((resolve) => {
|
|
@@ -12022,7 +12124,7 @@ async function capnpc(options) {
|
|
|
12022
12124
|
//#region bin/capnpc.ts
|
|
12023
12125
|
const compileAction = (workspaceRoot) => async (options) => {
|
|
12024
12126
|
let projectRoot = options.projectRoot;
|
|
12025
|
-
if (!projectRoot && workspaceRoot !== process.cwd() && ((0,
|
|
12127
|
+
if (!projectRoot && workspaceRoot !== process.cwd() && ((0, _stryke_fs_exists.existsSync)((0, _stryke_path_join_paths.joinPaths)(process.cwd(), "package.json")) || (0, _stryke_fs_exists.existsSync)((0, _stryke_path_join_paths.joinPaths)(process.cwd(), "project.json")))) projectRoot = process.cwd();
|
|
12026
12128
|
if (!projectRoot) throw new Error(`✖ The project root directory must be specified using the -p or --project-root option. \n\nCurrent directories: \nWorkspace Root: ${workspaceRoot} \nCurrent Working Directory: ${process.cwd()}`);
|
|
12027
12129
|
const resolvedOptions = await resolveOptions({
|
|
12028
12130
|
workspaceRoot,
|
|
@@ -12045,13 +12147,13 @@ const compileAction = (workspaceRoot) => async (options) => {
|
|
|
12045
12147
|
writeInfo(`Writing ${result.files.size} generated files to disk...`, { logLevel: "all" });
|
|
12046
12148
|
for (const [fileName, content] of result.files) {
|
|
12047
12149
|
let filePath = fileName;
|
|
12048
|
-
if (!(0,
|
|
12150
|
+
if (!(0, _stryke_fs_exists.existsSync)((0, _stryke_path_file_path_fns.findFilePath)(filePath))) {
|
|
12049
12151
|
const fullPath = `/${filePath}`;
|
|
12050
|
-
if ((0,
|
|
12152
|
+
if ((0, _stryke_fs_exists.existsSync)((0, _stryke_path_file_path_fns.findFilePath)(fullPath))) filePath = fullPath;
|
|
12051
12153
|
}
|
|
12052
12154
|
if (options.output) {
|
|
12053
|
-
filePath = (0,
|
|
12054
|
-
if (!(0,
|
|
12155
|
+
filePath = (0, _stryke_path_join_paths.joinPaths)(options.output, fileName);
|
|
12156
|
+
if (!(0, _stryke_fs_exists.existsSync)((0, _stryke_path_file_path_fns.findFilePath)(options.output))) writeWarning(`Output directory "${(0, _stryke_path_file_path_fns.findFilePath)(options.output)}" does not exist, it will be created...`);
|
|
12055
12157
|
}
|
|
12056
12158
|
await (0, node_fs_promises.writeFile)(filePath, content.replace(/^\s+/gm, (match) => " ".repeat(match.length / 2)));
|
|
12057
12159
|
}
|
|
@@ -12067,10 +12169,10 @@ function createProgram() {
|
|
|
12067
12169
|
const workspaceRoot = findWorkspaceRootSafe(process.cwd());
|
|
12068
12170
|
process.env.STORM_WORKSPACE_ROOT ??= workspaceRoot;
|
|
12069
12171
|
process.env.NX_WORKSPACE_ROOT_PATH ??= workspaceRoot;
|
|
12070
|
-
const program
|
|
12071
|
-
program
|
|
12072
|
-
program
|
|
12073
|
-
return program
|
|
12172
|
+
const program = new Command();
|
|
12173
|
+
program.name("storm-capnpc").description("Run the Storm Cap'n Proto compiler").version("1.0.0", "-v --version", "display CLI version");
|
|
12174
|
+
program.command("compile", { isDefault: true }).option("-p --project-root <path>", "The path to the project root directory").option("-s --schema <path>", "The directory (or a glob to the directory) containing the Cap'n Proto schema files to compile (default: current working directory)").option("-o --output <path>", "The directory to output the generated files to").option("--tsconfig <path>", "The path to the TypeScript configuration file to use for compilation").option("--skip-generating-id", "Skip generating a new 64-bit unique ID for use in a Cap'n Proto schema").option("--no-standard-imports", "Skip adding default import paths; use only those specified by -I").option("--no-ts", "An indicator to disable generation of TypeScript files").option("--js", "An indicator to generate JavaScript files").option("--dts", "An indicator to generate TypeScript declaration files").option("--no-dts", "An indicator to disable generation of TypeScript declaration files").option("-w --workspace-root <path>", "The path to the workspace root directory", workspaceRoot).option("--tty", "An indicator to enable TTY mode for the compiler").action(compileAction(workspaceRoot));
|
|
12175
|
+
return program;
|
|
12074
12176
|
}
|
|
12075
12177
|
(async () => {
|
|
12076
12178
|
try {
|