@stryke/capnp 0.12.96 → 0.12.98
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 +405 -304
- 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 +368 -268
- 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-Cx88xgqJ.mjs → compile-D_BOc0dD.mjs} +109 -15
- package/dist/compile-D_BOc0dD.mjs.map +1 -0
- package/dist/{compile-SmxAaHxW.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-BoYAadSB.mjs → helpers-2TldkyGG.mjs} +136 -137
- package/dist/helpers-2TldkyGG.mjs.map +1 -0
- package/dist/{helpers-gxlsFdP8.cjs → helpers-Dn4nWOb7.cjs} +164 -165
- 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 +5 -5
- 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-Cx88xgqJ.mjs.map +0 -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/dist-BlvFBzSi.mjs.map +0 -1
- package/dist/helpers-BoYAadSB.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.190.1_zod@4.4.
|
|
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.190.1_zod@4.4.
|
|
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.190.1_zod@4.4.
|
|
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.190.1_zod@4.4.
|
|
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.190.1_zod@4.4.
|
|
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.190.1_zod@4.4.
|
|
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
|
|
2324
2325
|
var formatTimestamp = (fullDateTime = false, date = /* @__PURE__ */ new Date()) => {
|
|
2325
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.190.1_zod@4.4.
|
|
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.190.1_zod@4.4.
|
|
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",
|
|
@@ -2921,19 +2921,19 @@ var writeInfo = (message, config) => getLogFn(LogLevel.INFO, config)(message);
|
|
|
2921
2921
|
var writeSuccess = (message, config) => getLogFn(LogLevel.SUCCESS, config)(message);
|
|
2922
2922
|
var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
|
|
2923
2923
|
var MAX_DEPTH$1 = 6;
|
|
2924
|
-
var formatLogMessage = (message, options = {}, depth
|
|
2925
|
-
if (depth
|
|
2924
|
+
var formatLogMessage = (message, options = {}, depth = 0) => {
|
|
2925
|
+
if (depth > MAX_DEPTH$1) return "<max depth>";
|
|
2926
2926
|
const prefix = options.prefix ?? "-";
|
|
2927
2927
|
const skip = options.skip ?? [];
|
|
2928
2928
|
return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
|
|
2929
2929
|
${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, {
|
|
2930
2930
|
prefix: `${prefix}-`,
|
|
2931
2931
|
skip
|
|
2932
|
-
}, depth
|
|
2932
|
+
}, depth + 1)}`).join("\n")}` : typeof message === "object" ? `
|
|
2933
2933
|
${Object.keys(message).filter((key) => !skip.includes(key)).map((key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(message[key], {
|
|
2934
2934
|
prefix: `${prefix}-`,
|
|
2935
2935
|
skip
|
|
2936
|
-
}, depth
|
|
2936
|
+
}, depth + 1) : message[key]}`).join("\n")}` : message;
|
|
2937
2937
|
};
|
|
2938
2938
|
var _isFunction = (value) => {
|
|
2939
2939
|
try {
|
|
@@ -2945,7 +2945,7 @@ var _isFunction = (value) => {
|
|
|
2945
2945
|
var brandIcon = (config = {}, _chalk = getChalk()) => _chalk.hex(getColor("brand", config))("🗲");
|
|
2946
2946
|
|
|
2947
2947
|
//#endregion
|
|
2948
|
-
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.190.1_zod@4.4.
|
|
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
|
|
2949
2949
|
var exitWithError = (config) => {
|
|
2950
2950
|
writeFatal("Exiting script with an error status...", config);
|
|
2951
2951
|
process.exit(1);
|
|
@@ -2980,7 +2980,7 @@ Stacktrace: ${error.stack}`, config);
|
|
|
2980
2980
|
};
|
|
2981
2981
|
|
|
2982
2982
|
//#endregion
|
|
2983
|
-
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.190.1_zod@4.4.
|
|
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
|
|
2984
2984
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
2985
2985
|
var depth = 0;
|
|
2986
2986
|
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
@@ -2991,7 +2991,7 @@ function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
|
2991
2991
|
}
|
|
2992
2992
|
|
|
2993
2993
|
//#endregion
|
|
2994
|
-
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.190.1_zod@4.4.
|
|
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
|
|
2995
2995
|
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
2996
2996
|
function normalizeWindowsPath(input = "") {
|
|
2997
2997
|
if (!input) return input;
|
|
@@ -3000,33 +3000,33 @@ function normalizeWindowsPath(input = "") {
|
|
|
3000
3000
|
var _UNC_REGEX = /^[/\\]{2}/;
|
|
3001
3001
|
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
3002
3002
|
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
3003
|
-
var correctPaths = function(path
|
|
3004
|
-
if (!path
|
|
3005
|
-
path
|
|
3006
|
-
const isUNCPath = path
|
|
3007
|
-
const isPathAbsolute = isAbsolute(path
|
|
3008
|
-
const trailingSeparator = path
|
|
3009
|
-
path
|
|
3010
|
-
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) {
|
|
3011
3011
|
if (isPathAbsolute) return "/";
|
|
3012
3012
|
return trailingSeparator ? "./" : ".";
|
|
3013
3013
|
}
|
|
3014
|
-
if (trailingSeparator) path
|
|
3015
|
-
if (_DRIVE_LETTER_RE.test(path
|
|
3014
|
+
if (trailingSeparator) path += "/";
|
|
3015
|
+
if (_DRIVE_LETTER_RE.test(path)) path += "/";
|
|
3016
3016
|
if (isUNCPath) {
|
|
3017
|
-
if (!isPathAbsolute) return `//./${path
|
|
3018
|
-
return `//${path
|
|
3017
|
+
if (!isPathAbsolute) return `//./${path}`;
|
|
3018
|
+
return `//${path}`;
|
|
3019
3019
|
}
|
|
3020
|
-
return isPathAbsolute && !isAbsolute(path
|
|
3020
|
+
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
|
3021
3021
|
};
|
|
3022
|
-
function normalizeString(path
|
|
3022
|
+
function normalizeString(path, allowAboveRoot) {
|
|
3023
3023
|
let res = "";
|
|
3024
3024
|
let lastSegmentLength = 0;
|
|
3025
3025
|
let lastSlash = -1;
|
|
3026
3026
|
let dots = 0;
|
|
3027
3027
|
let char = null;
|
|
3028
|
-
for (let index = 0; index <= path
|
|
3029
|
-
if (index < path
|
|
3028
|
+
for (let index = 0; index <= path.length; ++index) {
|
|
3029
|
+
if (index < path.length) char = path[index];
|
|
3030
3030
|
else if (char === "/") break;
|
|
3031
3031
|
else char = "/";
|
|
3032
3032
|
if (char === "/") {
|
|
@@ -3057,8 +3057,8 @@ function normalizeString(path$1, allowAboveRoot) {
|
|
|
3057
3057
|
lastSegmentLength = 2;
|
|
3058
3058
|
}
|
|
3059
3059
|
} else {
|
|
3060
|
-
if (res.length > 0) res += `/${path
|
|
3061
|
-
else res = path
|
|
3060
|
+
if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
|
|
3061
|
+
else res = path.slice(lastSlash + 1, index);
|
|
3062
3062
|
lastSegmentLength = index - lastSlash - 1;
|
|
3063
3063
|
}
|
|
3064
3064
|
lastSlash = index;
|
|
@@ -3073,7 +3073,7 @@ var isAbsolute = function(p) {
|
|
|
3073
3073
|
};
|
|
3074
3074
|
|
|
3075
3075
|
//#endregion
|
|
3076
|
-
//#region ../../node_modules/.pnpm/@storm-software+config-tools@1.190.1_zod@4.4.
|
|
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
|
|
3077
3077
|
var rootFiles = [
|
|
3078
3078
|
"storm-workspace.json",
|
|
3079
3079
|
"storm-workspace.yaml",
|
|
@@ -3127,7 +3127,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3127
3127
|
/**
|
|
3128
3128
|
* CommanderError class
|
|
3129
3129
|
*/
|
|
3130
|
-
var CommanderError
|
|
3130
|
+
var CommanderError = class extends Error {
|
|
3131
3131
|
/**
|
|
3132
3132
|
* Constructs the CommanderError class
|
|
3133
3133
|
* @param {number} exitCode suggested exit code which could be used with process.exit
|
|
@@ -3146,7 +3146,7 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3146
3146
|
/**
|
|
3147
3147
|
* InvalidArgumentError class
|
|
3148
3148
|
*/
|
|
3149
|
-
var InvalidArgumentError
|
|
3149
|
+
var InvalidArgumentError = class extends CommanderError {
|
|
3150
3150
|
/**
|
|
3151
3151
|
* Constructs the InvalidArgumentError class
|
|
3152
3152
|
* @param {string} [message] explanation of why argument is invalid
|
|
@@ -3157,15 +3157,15 @@ var require_error = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3157
3157
|
this.name = this.constructor.name;
|
|
3158
3158
|
}
|
|
3159
3159
|
};
|
|
3160
|
-
exports.CommanderError = CommanderError
|
|
3161
|
-
exports.InvalidArgumentError = InvalidArgumentError
|
|
3160
|
+
exports.CommanderError = CommanderError;
|
|
3161
|
+
exports.InvalidArgumentError = InvalidArgumentError;
|
|
3162
3162
|
}));
|
|
3163
3163
|
|
|
3164
3164
|
//#endregion
|
|
3165
3165
|
//#region ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/argument.js
|
|
3166
3166
|
var require_argument = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3167
|
-
const { InvalidArgumentError
|
|
3168
|
-
var Argument
|
|
3167
|
+
const { InvalidArgumentError } = require_error();
|
|
3168
|
+
var Argument = class {
|
|
3169
3169
|
/**
|
|
3170
3170
|
* Initialize a new command argument with the given name and description.
|
|
3171
3171
|
* The default is that the argument is required, and you can explicitly
|
|
@@ -3247,7 +3247,7 @@ var require_argument = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3247
3247
|
choices(values) {
|
|
3248
3248
|
this.argChoices = values.slice();
|
|
3249
3249
|
this.parseArg = (arg, previous) => {
|
|
3250
|
-
if (!this.argChoices.includes(arg)) throw new InvalidArgumentError
|
|
3250
|
+
if (!this.argChoices.includes(arg)) throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
|
|
3251
3251
|
if (this.variadic) return this._collectValue(arg, previous);
|
|
3252
3252
|
return arg;
|
|
3253
3253
|
};
|
|
@@ -3279,18 +3279,18 @@ var require_argument = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3279
3279
|
* @return {string}
|
|
3280
3280
|
* @private
|
|
3281
3281
|
*/
|
|
3282
|
-
function humanReadableArgName
|
|
3282
|
+
function humanReadableArgName(arg) {
|
|
3283
3283
|
const nameOutput = arg.name() + (arg.variadic === true ? "..." : "");
|
|
3284
3284
|
return arg.required ? "<" + nameOutput + ">" : "[" + nameOutput + "]";
|
|
3285
3285
|
}
|
|
3286
|
-
exports.Argument = Argument
|
|
3287
|
-
exports.humanReadableArgName = humanReadableArgName
|
|
3286
|
+
exports.Argument = Argument;
|
|
3287
|
+
exports.humanReadableArgName = humanReadableArgName;
|
|
3288
3288
|
}));
|
|
3289
3289
|
|
|
3290
3290
|
//#endregion
|
|
3291
3291
|
//#region ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/help.js
|
|
3292
3292
|
var require_help = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3293
|
-
const { humanReadableArgName
|
|
3293
|
+
const { humanReadableArgName } = require_argument();
|
|
3294
3294
|
/**
|
|
3295
3295
|
* TypeScript import types for JSDoc, used by Visual Studio Code IntelliSense and `npm run typescript-checkJS`
|
|
3296
3296
|
* https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#import-types
|
|
@@ -3298,7 +3298,7 @@ var require_help = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3298
3298
|
* @typedef { import("./command.js").Command } Command
|
|
3299
3299
|
* @typedef { import("./option.js").Option } Option
|
|
3300
3300
|
*/
|
|
3301
|
-
var Help
|
|
3301
|
+
var Help = class {
|
|
3302
3302
|
constructor() {
|
|
3303
3303
|
this.helpWidth = void 0;
|
|
3304
3304
|
this.minWidthToWrap = 40;
|
|
@@ -3324,7 +3324,7 @@ var require_help = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3324
3324
|
* @returns {Command[]}
|
|
3325
3325
|
*/
|
|
3326
3326
|
visibleCommands(cmd) {
|
|
3327
|
-
const visibleCommands = cmd.commands.filter((cmd
|
|
3327
|
+
const visibleCommands = cmd.commands.filter((cmd) => !cmd._hidden);
|
|
3328
3328
|
const helpCommand = cmd._getHelpCommand();
|
|
3329
3329
|
if (helpCommand && !helpCommand._hidden) visibleCommands.push(helpCommand);
|
|
3330
3330
|
if (this.sortSubcommands) visibleCommands.sort((a, b) => {
|
|
@@ -3400,7 +3400,7 @@ var require_help = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3400
3400
|
* @returns {string}
|
|
3401
3401
|
*/
|
|
3402
3402
|
subcommandTerm(cmd) {
|
|
3403
|
-
const args = cmd.registeredArguments.map((arg) => humanReadableArgName
|
|
3403
|
+
const args = cmd.registeredArguments.map((arg) => humanReadableArgName(arg)).join(" ");
|
|
3404
3404
|
return cmd._name + (cmd._aliases[0] ? "|" + cmd._aliases[0] : "") + (cmd.options.length ? " [options]" : "") + (args ? " " + args : "");
|
|
3405
3405
|
}
|
|
3406
3406
|
/**
|
|
@@ -3623,7 +3623,7 @@ var require_help = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3623
3623
|
* @returns {number}
|
|
3624
3624
|
*/
|
|
3625
3625
|
displayWidth(str) {
|
|
3626
|
-
return stripColor
|
|
3626
|
+
return stripColor(str).length;
|
|
3627
3627
|
}
|
|
3628
3628
|
/**
|
|
3629
3629
|
* Style the title for displaying in the help. Called with 'Usage:', 'Options:', etc.
|
|
@@ -3771,18 +3771,18 @@ var require_help = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3771
3771
|
* @returns {string}
|
|
3772
3772
|
* @package
|
|
3773
3773
|
*/
|
|
3774
|
-
function stripColor
|
|
3774
|
+
function stripColor(str) {
|
|
3775
3775
|
return str.replace(/\x1b\[\d*(;\d*)*m/g, "");
|
|
3776
3776
|
}
|
|
3777
|
-
exports.Help = Help
|
|
3778
|
-
exports.stripColor = stripColor
|
|
3777
|
+
exports.Help = Help;
|
|
3778
|
+
exports.stripColor = stripColor;
|
|
3779
3779
|
}));
|
|
3780
3780
|
|
|
3781
3781
|
//#endregion
|
|
3782
3782
|
//#region ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/lib/option.js
|
|
3783
3783
|
var require_option = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3784
|
-
const { InvalidArgumentError
|
|
3785
|
-
var Option
|
|
3784
|
+
const { InvalidArgumentError } = require_error();
|
|
3785
|
+
var Option = class {
|
|
3786
3786
|
/**
|
|
3787
3787
|
* Initialize a new `Option` with the given `flags` and `description`.
|
|
3788
3788
|
*
|
|
@@ -3933,7 +3933,7 @@ var require_option = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3933
3933
|
choices(values) {
|
|
3934
3934
|
this.argChoices = values.slice();
|
|
3935
3935
|
this.parseArg = (arg, previous) => {
|
|
3936
|
-
if (!this.argChoices.includes(arg)) throw new InvalidArgumentError
|
|
3936
|
+
if (!this.argChoices.includes(arg)) throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
|
|
3937
3937
|
if (this.variadic) return this._collectValue(arg, previous);
|
|
3938
3938
|
return arg;
|
|
3939
3939
|
};
|
|
@@ -3997,7 +3997,7 @@ var require_option = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3997
3997
|
* use cases, but is tricky for others where we want separate behaviours despite
|
|
3998
3998
|
* the single shared option value.
|
|
3999
3999
|
*/
|
|
4000
|
-
var DualOptions
|
|
4000
|
+
var DualOptions = class {
|
|
4001
4001
|
/**
|
|
4002
4002
|
* @param {Option[]} options
|
|
4003
4003
|
*/
|
|
@@ -4036,8 +4036,8 @@ var require_option = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4036
4036
|
* @private
|
|
4037
4037
|
*/
|
|
4038
4038
|
function camelcase(str) {
|
|
4039
|
-
return str.split("-").reduce((str
|
|
4040
|
-
return str
|
|
4039
|
+
return str.split("-").reduce((str, word) => {
|
|
4040
|
+
return str + word[0].toUpperCase() + word.slice(1);
|
|
4041
4041
|
});
|
|
4042
4042
|
}
|
|
4043
4043
|
/**
|
|
@@ -4078,8 +4078,8 @@ var require_option = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4078
4078
|
longFlag
|
|
4079
4079
|
};
|
|
4080
4080
|
}
|
|
4081
|
-
exports.Option = Option
|
|
4082
|
-
exports.DualOptions = DualOptions
|
|
4081
|
+
exports.Option = Option;
|
|
4082
|
+
exports.DualOptions = DualOptions;
|
|
4083
4083
|
}));
|
|
4084
4084
|
|
|
4085
4085
|
//#endregion
|
|
@@ -4107,7 +4107,7 @@ var require_suggestSimilar = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4107
4107
|
* @param {string[]} candidates
|
|
4108
4108
|
* @returns {string}
|
|
4109
4109
|
*/
|
|
4110
|
-
function suggestSimilar
|
|
4110
|
+
function suggestSimilar(word, candidates) {
|
|
4111
4111
|
if (!candidates || candidates.length === 0) return "";
|
|
4112
4112
|
candidates = Array.from(new Set(candidates));
|
|
4113
4113
|
const searchingOptions = word.startsWith("--");
|
|
@@ -4135,7 +4135,7 @@ var require_suggestSimilar = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4135
4135
|
if (similar.length === 1) return `\n(Did you mean ${similar[0]}?)`;
|
|
4136
4136
|
return "";
|
|
4137
4137
|
}
|
|
4138
|
-
exports.suggestSimilar = suggestSimilar
|
|
4138
|
+
exports.suggestSimilar = suggestSimilar;
|
|
4139
4139
|
}));
|
|
4140
4140
|
|
|
4141
4141
|
//#endregion
|
|
@@ -4146,12 +4146,12 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4146
4146
|
const path = require("node:path");
|
|
4147
4147
|
const fs = require("node:fs");
|
|
4148
4148
|
const process$1 = require("node:process");
|
|
4149
|
-
const { Argument
|
|
4150
|
-
const { CommanderError
|
|
4151
|
-
const { Help
|
|
4152
|
-
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();
|
|
4153
4153
|
const { suggestSimilar } = require_suggestSimilar();
|
|
4154
|
-
var Command
|
|
4154
|
+
var Command = class Command extends EventEmitter {
|
|
4155
4155
|
/**
|
|
4156
4156
|
* Initialize a new `Command`.
|
|
4157
4157
|
*
|
|
@@ -4309,7 +4309,7 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4309
4309
|
* @return {Command} new command
|
|
4310
4310
|
*/
|
|
4311
4311
|
createCommand(name) {
|
|
4312
|
-
return new Command
|
|
4312
|
+
return new Command(name);
|
|
4313
4313
|
}
|
|
4314
4314
|
/**
|
|
4315
4315
|
* You can customise the help with a subclass of Help by overriding createHelp,
|
|
@@ -4318,7 +4318,7 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4318
4318
|
* @return {Help}
|
|
4319
4319
|
*/
|
|
4320
4320
|
createHelp() {
|
|
4321
|
-
return Object.assign(new Help
|
|
4321
|
+
return Object.assign(new Help(), this.configureHelp());
|
|
4322
4322
|
}
|
|
4323
4323
|
/**
|
|
4324
4324
|
* You can customise the help by overriding Help properties using configureHelp(),
|
|
@@ -4414,7 +4414,7 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4414
4414
|
* @return {Argument} new argument
|
|
4415
4415
|
*/
|
|
4416
4416
|
createArgument(name, description) {
|
|
4417
|
-
return new Argument
|
|
4417
|
+
return new Argument(name, description);
|
|
4418
4418
|
}
|
|
4419
4419
|
/**
|
|
4420
4420
|
* Define argument syntax for command.
|
|
@@ -4571,7 +4571,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
4571
4571
|
* @private
|
|
4572
4572
|
*/
|
|
4573
4573
|
_exit(exitCode, code, message) {
|
|
4574
|
-
if (this._exitCallback) this._exitCallback(new CommanderError
|
|
4574
|
+
if (this._exitCallback) this._exitCallback(new CommanderError(exitCode, code, message));
|
|
4575
4575
|
process$1.exit(exitCode);
|
|
4576
4576
|
}
|
|
4577
4577
|
/**
|
|
@@ -4611,7 +4611,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
4611
4611
|
* @return {Option} new option
|
|
4612
4612
|
*/
|
|
4613
4613
|
createOption(flags, description) {
|
|
4614
|
-
return new Option
|
|
4614
|
+
return new Option(flags, description);
|
|
4615
4615
|
}
|
|
4616
4616
|
/**
|
|
4617
4617
|
* Wrap parseArgs to catch 'commander.invalidArgument'.
|
|
@@ -4712,7 +4712,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
4712
4712
|
* @private
|
|
4713
4713
|
*/
|
|
4714
4714
|
_optionEx(config, flags, description, fn, defaultValue) {
|
|
4715
|
-
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()");
|
|
4716
4716
|
const option = this.createOption(flags, description);
|
|
4717
4717
|
option.makeOptionMandatory(!!config.mandatory);
|
|
4718
4718
|
if (typeof fn === "function") option.default(defaultValue).argParser(fn);
|
|
@@ -5118,14 +5118,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5118
5118
|
proc.on("close", (code) => {
|
|
5119
5119
|
code = code ?? 1;
|
|
5120
5120
|
if (!exitCallback) process$1.exit(code);
|
|
5121
|
-
else exitCallback(new CommanderError
|
|
5121
|
+
else exitCallback(new CommanderError(code, "commander.executeSubCommandAsync", "(close)"));
|
|
5122
5122
|
});
|
|
5123
5123
|
proc.on("error", (err) => {
|
|
5124
5124
|
if (err.code === "ENOENT") this._checkForMissingExecutable(executableFile, executableDir, subcommand._name);
|
|
5125
5125
|
else if (err.code === "EACCES") throw new Error(`'${executableFile}' not executable`);
|
|
5126
5126
|
if (!exitCallback) process$1.exit(1);
|
|
5127
5127
|
else {
|
|
5128
|
-
const wrappedError = new CommanderError
|
|
5128
|
+
const wrappedError = new CommanderError(1, "commander.executeSubCommandAsync", "(error)");
|
|
5129
5129
|
wrappedError.nestedError = err;
|
|
5130
5130
|
exitCallback(wrappedError);
|
|
5131
5131
|
}
|
|
@@ -5600,16 +5600,16 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5600
5600
|
* @private
|
|
5601
5601
|
*/
|
|
5602
5602
|
_conflictingOption(option, conflictingOption) {
|
|
5603
|
-
const findBestOptionFromValue = (option
|
|
5604
|
-
const optionKey = option
|
|
5603
|
+
const findBestOptionFromValue = (option) => {
|
|
5604
|
+
const optionKey = option.attributeName();
|
|
5605
5605
|
const optionValue = this.getOptionValue(optionKey);
|
|
5606
5606
|
const negativeOption = this.options.find((target) => target.negate && optionKey === target.attributeName());
|
|
5607
5607
|
const positiveOption = this.options.find((target) => !target.negate && optionKey === target.attributeName());
|
|
5608
5608
|
if (negativeOption && (negativeOption.presetArg === void 0 && optionValue === false || negativeOption.presetArg !== void 0 && optionValue === negativeOption.presetArg)) return negativeOption;
|
|
5609
|
-
return positiveOption || option
|
|
5609
|
+
return positiveOption || option;
|
|
5610
5610
|
};
|
|
5611
|
-
const getErrorMessage = (option
|
|
5612
|
-
const bestOption = findBestOptionFromValue(option
|
|
5611
|
+
const getErrorMessage = (option) => {
|
|
5612
|
+
const bestOption = findBestOptionFromValue(option);
|
|
5613
5613
|
const optionKey = bestOption.attributeName();
|
|
5614
5614
|
if (this.getOptionValueSource(optionKey) === "env") return `environment variable '${bestOption.envVar}'`;
|
|
5615
5615
|
return `option '${bestOption.flags}'`;
|
|
@@ -5872,9 +5872,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5872
5872
|
* @param {string} [path]
|
|
5873
5873
|
* @return {(string|null|Command)}
|
|
5874
5874
|
*/
|
|
5875
|
-
executableDir(path
|
|
5876
|
-
if (path
|
|
5877
|
-
this._executableDir = path
|
|
5875
|
+
executableDir(path) {
|
|
5876
|
+
if (path === void 0) return this._executableDir;
|
|
5877
|
+
this._executableDir = path;
|
|
5878
5878
|
return this;
|
|
5879
5879
|
}
|
|
5880
5880
|
/**
|
|
@@ -6113,32 +6113,32 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
6113
6113
|
if (process$1.env.NO_COLOR || process$1.env.FORCE_COLOR === "0" || process$1.env.FORCE_COLOR === "false") return false;
|
|
6114
6114
|
if (process$1.env.FORCE_COLOR || process$1.env.CLICOLOR_FORCE !== void 0) return true;
|
|
6115
6115
|
}
|
|
6116
|
-
exports.Command = Command
|
|
6116
|
+
exports.Command = Command;
|
|
6117
6117
|
exports.useColor = useColor;
|
|
6118
6118
|
}));
|
|
6119
6119
|
|
|
6120
6120
|
//#endregion
|
|
6121
6121
|
//#region ../../node_modules/.pnpm/commander@14.0.3/node_modules/commander/index.js
|
|
6122
6122
|
var require_commander = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
6123
|
-
const { Argument
|
|
6124
|
-
const { Command
|
|
6125
|
-
const { CommanderError
|
|
6126
|
-
const { Help
|
|
6127
|
-
const { Option
|
|
6128
|
-
exports.program = new Command
|
|
6129
|
-
exports.createCommand = (name) => new Command
|
|
6130
|
-
exports.createOption = (flags, description) => new Option
|
|
6131
|
-
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);
|
|
6132
6132
|
/**
|
|
6133
6133
|
* Expose classes
|
|
6134
6134
|
*/
|
|
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
|
|
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;
|
|
6142
6142
|
}));
|
|
6143
6143
|
|
|
6144
6144
|
//#endregion
|
|
@@ -6169,7 +6169,6 @@ const MAX_INT32 = 2147483647;
|
|
|
6169
6169
|
const MAX_UINT32 = 4294967295;
|
|
6170
6170
|
const MIN_SINGLE_SEGMENT_GROWTH = 4096;
|
|
6171
6171
|
const NATIVE_LITTLE_ENDIAN = tmpWord.getUint8(0) === 2;
|
|
6172
|
-
const PACK_SPAN_THRESHOLD = 2;
|
|
6173
6172
|
const POINTER_DOUBLE_FAR_MASK = 4;
|
|
6174
6173
|
const POINTER_TYPE_MASK = 3;
|
|
6175
6174
|
const MAX_DEPTH = MAX_INT32;
|
|
@@ -6392,6 +6391,7 @@ var Orphan = class {
|
|
|
6392
6391
|
case PointerType.OTHER:
|
|
6393
6392
|
setInterfacePointer(this._capnp.capId, res.pointer);
|
|
6394
6393
|
break;
|
|
6394
|
+
/* istanbul ignore next */
|
|
6395
6395
|
default: throw new Error(PTR_INVALID_POINTER_TYPE);
|
|
6396
6396
|
}
|
|
6397
6397
|
this._capnp = void 0;
|
|
@@ -6432,22 +6432,28 @@ function getListByteLength(elementSize, length, compositeSize) {
|
|
|
6432
6432
|
case ListElementSize.BYTE_8:
|
|
6433
6433
|
case ListElementSize.POINTER:
|
|
6434
6434
|
case ListElementSize.VOID: return padToWord$1(getListElementByteLength(elementSize) * length);
|
|
6435
|
+
/* istanbul ignore next */
|
|
6435
6436
|
case ListElementSize.COMPOSITE:
|
|
6436
6437
|
if (compositeSize === void 0) throw new Error(format(PTR_INVALID_LIST_SIZE, NaN));
|
|
6437
6438
|
return length * padToWord$1(getByteLength(compositeSize));
|
|
6439
|
+
/* istanbul ignore next */
|
|
6438
6440
|
default: throw new Error(PTR_INVALID_LIST_SIZE);
|
|
6439
6441
|
}
|
|
6440
6442
|
}
|
|
6441
6443
|
function getListElementByteLength(elementSize) {
|
|
6442
6444
|
switch (elementSize) {
|
|
6445
|
+
/* istanbul ignore next */
|
|
6443
6446
|
case ListElementSize.BIT: return NaN;
|
|
6444
6447
|
case ListElementSize.BYTE: return 1;
|
|
6445
6448
|
case ListElementSize.BYTE_2: return 2;
|
|
6446
6449
|
case ListElementSize.BYTE_4: return 4;
|
|
6447
6450
|
case ListElementSize.BYTE_8:
|
|
6448
6451
|
case ListElementSize.POINTER: return 8;
|
|
6452
|
+
/* istanbul ignore next */
|
|
6449
6453
|
case ListElementSize.COMPOSITE: return NaN;
|
|
6454
|
+
/* istanbul ignore next */
|
|
6450
6455
|
case ListElementSize.VOID: return 0;
|
|
6456
|
+
/* istanbul ignore next */
|
|
6451
6457
|
default: throw new Error(format(PTR_INVALID_LIST_SIZE, elementSize));
|
|
6452
6458
|
}
|
|
6453
6459
|
}
|
|
@@ -6468,6 +6474,7 @@ function copyFrom(src, p) {
|
|
|
6468
6474
|
case PointerType.OTHER:
|
|
6469
6475
|
copyFromInterface(src, p);
|
|
6470
6476
|
break;
|
|
6477
|
+
/* istanbul ignore next */
|
|
6471
6478
|
default: throw new Error(format(PTR_INVALID_POINTER_TYPE, getTargetPointerType(p)));
|
|
6472
6479
|
}
|
|
6473
6480
|
}
|
|
@@ -6913,8 +6920,8 @@ var List = class List extends Pointer {
|
|
|
6913
6920
|
entries() {
|
|
6914
6921
|
return this.toArray().entries();
|
|
6915
6922
|
}
|
|
6916
|
-
flat(depth
|
|
6917
|
-
return this.toArray().flat(depth
|
|
6923
|
+
flat(depth) {
|
|
6924
|
+
return this.toArray().flat(depth);
|
|
6918
6925
|
}
|
|
6919
6926
|
with(index, value) {
|
|
6920
6927
|
return this.toArray().with(index, value);
|
|
@@ -7376,8 +7383,8 @@ function getStruct(index, StructClass, s, defaultValue) {
|
|
|
7376
7383
|
else initStruct(StructClass._capnp.size, t);
|
|
7377
7384
|
else {
|
|
7378
7385
|
validate(PointerType.STRUCT, t);
|
|
7379
|
-
const ts
|
|
7380
|
-
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);
|
|
7381
7388
|
}
|
|
7382
7389
|
return t;
|
|
7383
7390
|
}
|
|
@@ -8081,10 +8088,38 @@ var Node_Annotation = class extends Struct {
|
|
|
8081
8088
|
};
|
|
8082
8089
|
const Node_Which = {
|
|
8083
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
|
+
*/
|
|
8084
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
|
+
*/
|
|
8085
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
|
+
*/
|
|
8086
8113
|
INTERFACE: 3,
|
|
8114
|
+
/**
|
|
8115
|
+
* List of nodes nested within this node, along with the names under which they were declared.
|
|
8116
|
+
*
|
|
8117
|
+
*/
|
|
8087
8118
|
CONST: 4,
|
|
8119
|
+
/**
|
|
8120
|
+
* Annotations applied to this node.
|
|
8121
|
+
*
|
|
8122
|
+
*/
|
|
8088
8123
|
ANNOTATION: 5
|
|
8089
8124
|
};
|
|
8090
8125
|
var Node = class Node extends Struct {
|
|
@@ -8402,6 +8437,13 @@ var Field_Group = class extends Struct {
|
|
|
8402
8437
|
};
|
|
8403
8438
|
const Field_Ordinal_Which = {
|
|
8404
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
|
+
*/
|
|
8405
8447
|
EXPLICIT: 1
|
|
8406
8448
|
};
|
|
8407
8449
|
var Field_Ordinal = class extends Struct {
|
|
@@ -8445,6 +8487,15 @@ var Field_Ordinal = class extends Struct {
|
|
|
8445
8487
|
};
|
|
8446
8488
|
const Field_Which = {
|
|
8447
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
|
+
*/
|
|
8448
8499
|
GROUP: 1
|
|
8449
8500
|
};
|
|
8450
8501
|
var Field = class Field extends Struct {
|
|
@@ -8908,9 +8959,25 @@ var Type_Interface = class extends Struct {
|
|
|
8908
8959
|
}
|
|
8909
8960
|
};
|
|
8910
8961
|
const Type_AnyPointer_Unconstrained_Which = {
|
|
8962
|
+
/**
|
|
8963
|
+
* truly AnyPointer
|
|
8964
|
+
*
|
|
8965
|
+
*/
|
|
8911
8966
|
ANY_KIND: 0,
|
|
8967
|
+
/**
|
|
8968
|
+
* AnyStruct
|
|
8969
|
+
*
|
|
8970
|
+
*/
|
|
8912
8971
|
STRUCT: 1,
|
|
8972
|
+
/**
|
|
8973
|
+
* AnyList
|
|
8974
|
+
*
|
|
8975
|
+
*/
|
|
8913
8976
|
LIST: 2,
|
|
8977
|
+
/**
|
|
8978
|
+
* Capability
|
|
8979
|
+
*
|
|
8980
|
+
*/
|
|
8914
8981
|
CAPABILITY: 3
|
|
8915
8982
|
};
|
|
8916
8983
|
var Type_AnyPointer_Unconstrained = class extends Struct {
|
|
@@ -9002,8 +9069,25 @@ var Type_AnyPointer_ImplicitMethodParameter = class extends Struct {
|
|
|
9002
9069
|
}
|
|
9003
9070
|
};
|
|
9004
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
|
+
*/
|
|
9005
9080
|
UNCONSTRAINED: 0,
|
|
9081
|
+
/**
|
|
9082
|
+
* This is actually a reference to a type parameter defined within this scope.
|
|
9083
|
+
*
|
|
9084
|
+
*/
|
|
9006
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
|
+
*/
|
|
9007
9091
|
IMPLICIT_METHOD_PARAMETER: 2
|
|
9008
9092
|
};
|
|
9009
9093
|
var Type_AnyPointer = class extends Struct {
|
|
@@ -9289,7 +9373,15 @@ var Type = class extends Struct {
|
|
|
9289
9373
|
}
|
|
9290
9374
|
};
|
|
9291
9375
|
const Brand_Scope_Which = {
|
|
9376
|
+
/**
|
|
9377
|
+
* ID of the scope to which these params apply.
|
|
9378
|
+
*
|
|
9379
|
+
*/
|
|
9292
9380
|
BIND: 0,
|
|
9381
|
+
/**
|
|
9382
|
+
* List of parameter bindings.
|
|
9383
|
+
*
|
|
9384
|
+
*/
|
|
9293
9385
|
INHERIT: 1
|
|
9294
9386
|
};
|
|
9295
9387
|
var Brand_Scope = class Brand_Scope extends Struct {
|
|
@@ -9458,6 +9550,11 @@ const Value_Which = {
|
|
|
9458
9550
|
LIST: 14,
|
|
9459
9551
|
ENUM: 15,
|
|
9460
9552
|
STRUCT: 16,
|
|
9553
|
+
/**
|
|
9554
|
+
* The only interface value that can be represented statically is "null", whose methods always
|
|
9555
|
+
* throw exceptions.
|
|
9556
|
+
*
|
|
9557
|
+
*/
|
|
9461
9558
|
INTERFACE: 17,
|
|
9462
9559
|
ANY_POINTER: 18
|
|
9463
9560
|
};
|
|
@@ -9799,6 +9896,10 @@ var Annotation = class extends Struct {
|
|
|
9799
9896
|
}
|
|
9800
9897
|
};
|
|
9801
9898
|
const ElementSize = {
|
|
9899
|
+
/**
|
|
9900
|
+
* aka "void", but that's a keyword.
|
|
9901
|
+
*
|
|
9902
|
+
*/
|
|
9802
9903
|
EMPTY: 0,
|
|
9803
9904
|
BIT: 1,
|
|
9804
9905
|
BYTE: 2,
|
|
@@ -10117,7 +10218,7 @@ var SingleSegmentArena = class {
|
|
|
10117
10218
|
};
|
|
10118
10219
|
function allocate$1(minSize, segments, s) {
|
|
10119
10220
|
const srcBuffer = segments.length > 0 ? segments[0].buffer : s.buffer;
|
|
10120
|
-
minSize = minSize <
|
|
10221
|
+
minSize = minSize < 4096 ? MIN_SINGLE_SEGMENT_GROWTH : padToWord$1(minSize);
|
|
10121
10222
|
s.buffer = new ArrayBuffer(srcBuffer.byteLength + minSize);
|
|
10122
10223
|
new Float64Array(s.buffer).set(new Float64Array(srcBuffer));
|
|
10123
10224
|
return new ArenaAllocationResult(0, s.buffer);
|
|
@@ -10228,7 +10329,7 @@ function pack(unpacked, byteOffset = 0, byteLength) {
|
|
|
10228
10329
|
} else rangeWordCount++;
|
|
10229
10330
|
break;
|
|
10230
10331
|
case 255:
|
|
10231
|
-
if (getZeroByteCount(a, b, c, d, e, f, g, h) >=
|
|
10332
|
+
if (getZeroByteCount(a, b, c, d, e, f, g, h) >= 2 || rangeWordCount >= 255) {
|
|
10232
10333
|
dst[spanWordCountOffset] = rangeWordCount;
|
|
10233
10334
|
rangeWordCount = 0;
|
|
10234
10335
|
skipWriteWord = false;
|
|
@@ -10320,7 +10421,7 @@ var Segment = class {
|
|
|
10320
10421
|
allocate(byteLength) {
|
|
10321
10422
|
let segment = this;
|
|
10322
10423
|
byteLength = padToWord$1(byteLength);
|
|
10323
|
-
if (byteLength >
|
|
10424
|
+
if (byteLength > 4294967295 - 8) throw new Error(format(SEG_SIZE_OVERFLOW, byteLength));
|
|
10324
10425
|
if (!segment.hasCapacity(byteLength)) segment = segment.message.allocateSegment(byteLength);
|
|
10325
10426
|
const byteOffset = segment.byteLength;
|
|
10326
10427
|
segment.byteLength += byteLength;
|
|
@@ -10820,8 +10921,8 @@ Segment #${i}
|
|
|
10820
10921
|
function getRoot(RootStruct, m) {
|
|
10821
10922
|
const root = new RootStruct(m.getSegment(0), 0);
|
|
10822
10923
|
validate(PointerType.STRUCT, root);
|
|
10823
|
-
const ts
|
|
10824
|
-
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);
|
|
10825
10926
|
return root;
|
|
10826
10927
|
}
|
|
10827
10928
|
function getSegment(id, m) {
|
|
@@ -11030,7 +11131,7 @@ var hasRequiredHex2dec;
|
|
|
11030
11131
|
function requireHex2dec() {
|
|
11031
11132
|
if (hasRequiredHex2dec) return hex2dec;
|
|
11032
11133
|
hasRequiredHex2dec = 1;
|
|
11033
|
-
function add
|
|
11134
|
+
function add(x, y, base) {
|
|
11034
11135
|
var z = [];
|
|
11035
11136
|
var n = Math.max(x.length, y.length);
|
|
11036
11137
|
var carry = 0;
|
|
@@ -11051,10 +11152,10 @@ function requireHex2dec() {
|
|
|
11051
11152
|
var result = [];
|
|
11052
11153
|
var power = x;
|
|
11053
11154
|
while (true) {
|
|
11054
|
-
if (num & 1) result = add
|
|
11155
|
+
if (num & 1) result = add(result, power, base);
|
|
11055
11156
|
num = num >> 1;
|
|
11056
11157
|
if (num === 0) break;
|
|
11057
|
-
power = add
|
|
11158
|
+
power = add(power, power, base);
|
|
11058
11159
|
}
|
|
11059
11160
|
return result;
|
|
11060
11161
|
}
|
|
@@ -11074,7 +11175,7 @@ function requireHex2dec() {
|
|
|
11074
11175
|
var outArray = [];
|
|
11075
11176
|
var power = [1];
|
|
11076
11177
|
for (var i = 0; i < digits.length; i++) {
|
|
11077
|
-
if (digits[i]) outArray = add
|
|
11178
|
+
if (digits[i]) outArray = add(outArray, multiplyByNumber(digits[i], power, toBase), toBase);
|
|
11078
11179
|
power = multiplyByNumber(fromBase, power, toBase);
|
|
11079
11180
|
}
|
|
11080
11181
|
var out = "";
|
|
@@ -11469,16 +11570,16 @@ function generateStructFieldMethods(ctx, members, node, field, fieldIndex) {
|
|
|
11469
11570
|
const maybeDefaultArg = hadExplicitDefault ? `, ${fullClassName}._capnp.default${capitalizedName}` : "";
|
|
11470
11571
|
const union = discriminantValue !== Field.NO_DISCRIMINANT;
|
|
11471
11572
|
const offset = field._isSlot ? field.slot.offset : 0;
|
|
11472
|
-
let adopt
|
|
11473
|
-
let disown
|
|
11573
|
+
let adopt = false;
|
|
11574
|
+
let disown = false;
|
|
11474
11575
|
let has = false;
|
|
11475
11576
|
let init;
|
|
11476
11577
|
let get;
|
|
11477
11578
|
let set;
|
|
11478
11579
|
switch (whichType) {
|
|
11479
11580
|
case Type.ANY_POINTER:
|
|
11480
|
-
adopt
|
|
11481
|
-
disown
|
|
11581
|
+
adopt = true;
|
|
11582
|
+
disown = true;
|
|
11482
11583
|
has = true;
|
|
11483
11584
|
get = `$.utils.getPointer(${offset}, this${maybeDefaultArg})`;
|
|
11484
11585
|
set = `$.utils.copyFrom(value, ${get})`;
|
|
@@ -11503,8 +11604,8 @@ function generateStructFieldMethods(ctx, members, node, field, fieldIndex) {
|
|
|
11503
11604
|
break;
|
|
11504
11605
|
}
|
|
11505
11606
|
case Type.DATA:
|
|
11506
|
-
adopt
|
|
11507
|
-
disown
|
|
11607
|
+
adopt = true;
|
|
11608
|
+
disown = true;
|
|
11508
11609
|
has = true;
|
|
11509
11610
|
get = `$.utils.getData(${offset}, this${maybeDefaultArg})`;
|
|
11510
11611
|
set = `$.utils.copyFrom(value, $.utils.getPointer(${offset}, this))`;
|
|
@@ -11519,8 +11620,8 @@ function generateStructFieldMethods(ctx, members, node, field, fieldIndex) {
|
|
|
11519
11620
|
let listClass = ConcreteListType[elementType];
|
|
11520
11621
|
if (elementType === Type.LIST || elementType === Type.STRUCT) listClass = `${fullClassName}._${capitalizedName}`;
|
|
11521
11622
|
else if (listClass === void 0) throw new Error(format(GEN_UNSUPPORTED_LIST_ELEMENT_TYPE, elementType));
|
|
11522
|
-
adopt
|
|
11523
|
-
disown
|
|
11623
|
+
adopt = true;
|
|
11624
|
+
disown = true;
|
|
11524
11625
|
has = true;
|
|
11525
11626
|
get = `$.utils.getList(${offset}, ${listClass}, this${maybeDefaultArg})`;
|
|
11526
11627
|
set = `$.utils.copyFrom(value, $.utils.getPointer(${offset}, this))`;
|
|
@@ -11532,8 +11633,8 @@ function generateStructFieldMethods(ctx, members, node, field, fieldIndex) {
|
|
|
11532
11633
|
break;
|
|
11533
11634
|
}
|
|
11534
11635
|
case Type.STRUCT:
|
|
11535
|
-
adopt
|
|
11536
|
-
disown
|
|
11636
|
+
adopt = true;
|
|
11637
|
+
disown = true;
|
|
11537
11638
|
has = true;
|
|
11538
11639
|
get = `$.utils.getStruct(${offset}, ${jsType}, this${maybeDefaultArg})`;
|
|
11539
11640
|
set = `$.utils.copyFrom(value, $.utils.getPointer(${offset}, this))`;
|
|
@@ -11550,13 +11651,13 @@ function generateStructFieldMethods(ctx, members, node, field, fieldIndex) {
|
|
|
11550
11651
|
init = get;
|
|
11551
11652
|
break;
|
|
11552
11653
|
}
|
|
11553
|
-
if (adopt
|
|
11654
|
+
if (adopt) members.push(`
|
|
11554
11655
|
_adopt${capitalizedName}(value: $.Orphan<${jsType}>): void {
|
|
11555
11656
|
${union ? `$.utils.setUint16(${discriminantOffset * 2}, ${discriminantValue}, this);` : ""}
|
|
11556
11657
|
$.utils.adopt(value, $.utils.getPointer(${offset}, this));
|
|
11557
11658
|
}
|
|
11558
11659
|
`);
|
|
11559
|
-
if (disown
|
|
11660
|
+
if (disown) members.push(`
|
|
11560
11661
|
_disown${capitalizedName}(): $.Orphan<${jsType}> {
|
|
11561
11662
|
return $.utils.disown(this.${name === "constructor" ? `$${name}` : name});
|
|
11562
11663
|
}
|
|
@@ -11858,9 +11959,9 @@ function tsCompile(files, dts, js, tsconfig) {
|
|
|
11858
11959
|
if (files.has(filename)) return files.get(filename);
|
|
11859
11960
|
return _readFile(filename);
|
|
11860
11961
|
};
|
|
11861
|
-
const program
|
|
11862
|
-
const emitResult = program
|
|
11863
|
-
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];
|
|
11864
11965
|
if (allDiagnostics.length > 0) {
|
|
11865
11966
|
for (const diagnostic of allDiagnostics) {
|
|
11866
11967
|
const message = typescript.default.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
|
|
@@ -11895,35 +11996,35 @@ function toArray(array) {
|
|
|
11895
11996
|
* @returns The resolved options
|
|
11896
11997
|
*/
|
|
11897
11998
|
async function resolveOptions(options) {
|
|
11898
|
-
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");
|
|
11899
12000
|
const schemas = [];
|
|
11900
|
-
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,
|
|
11901
|
-
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");
|
|
11902
12003
|
let resolvedTsconfig;
|
|
11903
12004
|
if (options.tsconfig) resolvedTsconfig = options.tsconfig;
|
|
11904
12005
|
else {
|
|
11905
12006
|
let resolvedTsconfigPath = tsconfigPath;
|
|
11906
|
-
if (!(0,
|
|
12007
|
+
if (!(0, _stryke_fs_exists.existsSync)(resolvedTsconfigPath)) {
|
|
11907
12008
|
const found = [
|
|
11908
|
-
(0,
|
|
11909
|
-
(0,
|
|
11910
|
-
(0,
|
|
11911
|
-
(0,
|
|
11912
|
-
(0,
|
|
11913
|
-
(0,
|
|
11914
|
-
(0,
|
|
11915
|
-
(0,
|
|
11916
|
-
(0,
|
|
11917
|
-
(0,
|
|
11918
|
-
].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));
|
|
11919
12020
|
if (found) resolvedTsconfigPath = found;
|
|
11920
12021
|
}
|
|
11921
|
-
if (!resolvedTsconfigPath || !(0,
|
|
12022
|
+
if (!resolvedTsconfigPath || !(0, _stryke_fs_exists.existsSync)(resolvedTsconfigPath)) {
|
|
11922
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.";
|
|
11923
12024
|
writeFatal(errorMessage, { logLevel: "all" });
|
|
11924
12025
|
throw new Error(errorMessage);
|
|
11925
12026
|
}
|
|
11926
|
-
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));
|
|
11927
12028
|
if (!resolvedTsconfig) {
|
|
11928
12029
|
const errorMessage = `✖ The specified TypeScript configuration file "${tsconfigPath}" is invalid. Please provide a valid configuration.`;
|
|
11929
12030
|
writeFatal(errorMessage, { logLevel: "all" });
|
|
@@ -11938,21 +12039,21 @@ async function resolveOptions(options) {
|
|
|
11938
12039
|
for (const schema of schemas) {
|
|
11939
12040
|
let formattedSchema = schema;
|
|
11940
12041
|
if (!schema.endsWith(".capnp") && !schema.includes("*")) formattedSchema = `${schema.replace(/\/$/g, "")}/*.capnp`;
|
|
11941
|
-
resolvedSchemas.push(...await (0,
|
|
12042
|
+
resolvedSchemas.push(...await (0, _stryke_fs_list_files.listFiles)(formattedSchema));
|
|
11942
12043
|
}
|
|
11943
12044
|
if (resolvedSchemas.length === 0 || !resolvedSchemas[0]) {
|
|
11944
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" });
|
|
11945
12046
|
return null;
|
|
11946
12047
|
}
|
|
11947
|
-
const output = options.output ? options.output.replace("{projectRoot}", options.projectRoot).replace("{workspaceRoot}", options.workspaceRoot) : (0,
|
|
11948
|
-
if (!(0,
|
|
11949
|
-
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)) {
|
|
11950
12051
|
const errorMessage = `✖ The specified output path "${output}" is a file. Please provide a valid directory path.`;
|
|
11951
12052
|
writeFatal(errorMessage, { logLevel: "all" });
|
|
11952
12053
|
throw new Error(errorMessage);
|
|
11953
12054
|
}
|
|
11954
12055
|
writeInfo(`Output directory "${output}" does not exist. It will be created automatically.`, { logLevel: "all" });
|
|
11955
|
-
await (0,
|
|
12056
|
+
await (0, _stryke_fs.createDirectory)(output);
|
|
11956
12057
|
}
|
|
11957
12058
|
resolvedTsconfig.options.outDir = output;
|
|
11958
12059
|
return {
|
|
@@ -11978,9 +12079,9 @@ async function resolveOptions(options) {
|
|
|
11978
12079
|
* @returns A promise that resolves to the compilation result.
|
|
11979
12080
|
*/
|
|
11980
12081
|
async function capnpc(options) {
|
|
11981
|
-
const { output, tsconfig, schemas = [], tty
|
|
12082
|
+
const { output, tsconfig, schemas = [], tty } = options;
|
|
11982
12083
|
let dataBuf = node_buffer.Buffer.alloc(0);
|
|
11983
|
-
if (tty
|
|
12084
|
+
if (tty) {
|
|
11984
12085
|
const chunks = [];
|
|
11985
12086
|
process.stdin.on("data", (chunk) => {
|
|
11986
12087
|
chunks.push(chunk);
|
|
@@ -11998,9 +12099,9 @@ async function capnpc(options) {
|
|
|
11998
12099
|
}
|
|
11999
12100
|
if (dataBuf.byteLength === 0) {
|
|
12000
12101
|
const opts = [];
|
|
12001
|
-
if (output && (0,
|
|
12102
|
+
if (output && (0, _stryke_fs_exists.existsSync)(output)) opts.push(`-o-:${output}`);
|
|
12002
12103
|
else {
|
|
12003
|
-
if (output && !(0,
|
|
12104
|
+
if (output && !(0, _stryke_fs_exists.existsSync)(output)) writeWarning(`Output directory "${output}" does not exist, will write to schema path...`);
|
|
12004
12105
|
opts.push("-o-");
|
|
12005
12106
|
}
|
|
12006
12107
|
dataBuf = await new Promise((resolve) => {
|
|
@@ -12023,7 +12124,7 @@ async function capnpc(options) {
|
|
|
12023
12124
|
//#region bin/capnpc.ts
|
|
12024
12125
|
const compileAction = (workspaceRoot) => async (options) => {
|
|
12025
12126
|
let projectRoot = options.projectRoot;
|
|
12026
|
-
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();
|
|
12027
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()}`);
|
|
12028
12129
|
const resolvedOptions = await resolveOptions({
|
|
12029
12130
|
workspaceRoot,
|
|
@@ -12046,13 +12147,13 @@ const compileAction = (workspaceRoot) => async (options) => {
|
|
|
12046
12147
|
writeInfo(`Writing ${result.files.size} generated files to disk...`, { logLevel: "all" });
|
|
12047
12148
|
for (const [fileName, content] of result.files) {
|
|
12048
12149
|
let filePath = fileName;
|
|
12049
|
-
if (!(0,
|
|
12150
|
+
if (!(0, _stryke_fs_exists.existsSync)((0, _stryke_path_file_path_fns.findFilePath)(filePath))) {
|
|
12050
12151
|
const fullPath = `/${filePath}`;
|
|
12051
|
-
if ((0,
|
|
12152
|
+
if ((0, _stryke_fs_exists.existsSync)((0, _stryke_path_file_path_fns.findFilePath)(fullPath))) filePath = fullPath;
|
|
12052
12153
|
}
|
|
12053
12154
|
if (options.output) {
|
|
12054
|
-
filePath = (0,
|
|
12055
|
-
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...`);
|
|
12056
12157
|
}
|
|
12057
12158
|
await (0, node_fs_promises.writeFile)(filePath, content.replace(/^\s+/gm, (match) => " ".repeat(match.length / 2)));
|
|
12058
12159
|
}
|
|
@@ -12068,10 +12169,10 @@ function createProgram() {
|
|
|
12068
12169
|
const workspaceRoot = findWorkspaceRootSafe(process.cwd());
|
|
12069
12170
|
process.env.STORM_WORKSPACE_ROOT ??= workspaceRoot;
|
|
12070
12171
|
process.env.NX_WORKSPACE_ROOT_PATH ??= workspaceRoot;
|
|
12071
|
-
const program
|
|
12072
|
-
program
|
|
12073
|
-
program
|
|
12074
|
-
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;
|
|
12075
12176
|
}
|
|
12076
12177
|
(async () => {
|
|
12077
12178
|
try {
|