toiljs 0.0.140 → 0.0.142
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/CHANGELOG.md +14 -0
- package/TYPESCRIPT_LAW.md +7 -0
- package/build/cli/index.js +389 -375
- package/build/compiler/config.d.ts +2 -0
- package/build/compiler/config.js +3 -0
- package/build/compiler/index.js +1 -1
- package/build/compiler/toil-docs.generated.js +4 -4
- package/build/devserver/daemon/host.d.ts +1 -0
- package/build/devserver/daemon/index.d.ts +2 -0
- package/build/devserver/daemon/index.js +1 -0
- package/build/devserver/daemon/rpc.d.ts +3 -0
- package/build/devserver/daemon/rpc.js +37 -0
- package/build/devserver/daemon/runtime.d.ts +9 -1
- package/build/devserver/daemon/runtime.js +63 -2
- package/build/devserver/daemon/storage.d.ts +35 -0
- package/build/devserver/daemon/storage.js +200 -0
- package/build/devserver/daemon/worker.d.ts +1 -0
- package/build/devserver/daemon/worker.js +42 -0
- package/build/devserver/db/database.d.ts +2 -1
- package/build/devserver/db/database.js +4 -1
- package/build/devserver/db/limits.d.ts +8 -1
- package/build/devserver/db/limits.js +14 -0
- package/build/devserver/db/materialization.d.ts +1 -0
- package/build/devserver/db/materialization.js +13 -0
- package/build/devserver/production.js +7 -6
- package/build/devserver/runtime/host.js +2 -1
- package/build/devserver/runtime/logging.d.ts +1 -0
- package/build/devserver/runtime/logging.js +83 -0
- package/build/devserver/server.js +5 -4
- package/package.json +25 -22
- package/server/globals/toil-log.ts +21 -0
- package/server/globals.d.ts +8 -0
package/build/cli/index.js
CHANGED
|
@@ -29,62 +29,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
29
|
mod
|
|
30
30
|
));
|
|
31
31
|
|
|
32
|
-
// node_modules/sisteransi/src/index.js
|
|
33
|
-
var require_src = __commonJS({
|
|
34
|
-
"node_modules/sisteransi/src/index.js"(exports, module) {
|
|
35
|
-
"use strict";
|
|
36
|
-
var ESC2 = "\x1B";
|
|
37
|
-
var CSI2 = `${ESC2}[`;
|
|
38
|
-
var beep = "\x07";
|
|
39
|
-
var cursor3 = {
|
|
40
|
-
to(x, y2) {
|
|
41
|
-
if (!y2) return `${CSI2}${x + 1}G`;
|
|
42
|
-
return `${CSI2}${y2 + 1};${x + 1}H`;
|
|
43
|
-
},
|
|
44
|
-
move(x, y2) {
|
|
45
|
-
let ret = "";
|
|
46
|
-
if (x < 0) ret += `${CSI2}${-x}D`;
|
|
47
|
-
else if (x > 0) ret += `${CSI2}${x}C`;
|
|
48
|
-
if (y2 < 0) ret += `${CSI2}${-y2}A`;
|
|
49
|
-
else if (y2 > 0) ret += `${CSI2}${y2}B`;
|
|
50
|
-
return ret;
|
|
51
|
-
},
|
|
52
|
-
up: (count = 1) => `${CSI2}${count}A`,
|
|
53
|
-
down: (count = 1) => `${CSI2}${count}B`,
|
|
54
|
-
forward: (count = 1) => `${CSI2}${count}C`,
|
|
55
|
-
backward: (count = 1) => `${CSI2}${count}D`,
|
|
56
|
-
nextLine: (count = 1) => `${CSI2}E`.repeat(count),
|
|
57
|
-
prevLine: (count = 1) => `${CSI2}F`.repeat(count),
|
|
58
|
-
left: `${CSI2}G`,
|
|
59
|
-
hide: `${CSI2}?25l`,
|
|
60
|
-
show: `${CSI2}?25h`,
|
|
61
|
-
save: `${ESC2}7`,
|
|
62
|
-
restore: `${ESC2}8`
|
|
63
|
-
};
|
|
64
|
-
var scroll = {
|
|
65
|
-
up: (count = 1) => `${CSI2}S`.repeat(count),
|
|
66
|
-
down: (count = 1) => `${CSI2}T`.repeat(count)
|
|
67
|
-
};
|
|
68
|
-
var erase3 = {
|
|
69
|
-
screen: `${CSI2}2J`,
|
|
70
|
-
up: (count = 1) => `${CSI2}1J`.repeat(count),
|
|
71
|
-
down: (count = 1) => `${CSI2}J`.repeat(count),
|
|
72
|
-
line: `${CSI2}2K`,
|
|
73
|
-
lineEnd: `${CSI2}K`,
|
|
74
|
-
lineStart: `${CSI2}1K`,
|
|
75
|
-
lines(count) {
|
|
76
|
-
let clear = "";
|
|
77
|
-
for (let i2 = 0; i2 < count; i2++)
|
|
78
|
-
clear += this.line + (i2 < count - 1 ? cursor3.up() : "");
|
|
79
|
-
if (count)
|
|
80
|
-
clear += cursor3.left;
|
|
81
|
-
return clear;
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
module.exports = { cursor: cursor3, scroll, erase: erase3, beep };
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
|
|
88
32
|
// node_modules/picocolors/picocolors.js
|
|
89
33
|
var require_picocolors = __commonJS({
|
|
90
34
|
"node_modules/picocolors/picocolors.js"(exports, module) {
|
|
@@ -97,13 +41,13 @@ var require_picocolors = __commonJS({
|
|
|
97
41
|
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
98
42
|
};
|
|
99
43
|
var replaceClose = (string, close, replace, index) => {
|
|
100
|
-
let result = "",
|
|
44
|
+
let result = "", cursor2 = 0;
|
|
101
45
|
do {
|
|
102
|
-
result += string.substring(
|
|
103
|
-
|
|
104
|
-
index = string.indexOf(close,
|
|
46
|
+
result += string.substring(cursor2, index) + replace;
|
|
47
|
+
cursor2 = index + close.length;
|
|
48
|
+
index = string.indexOf(close, cursor2);
|
|
105
49
|
} while (~index);
|
|
106
|
-
return result + string.substring(
|
|
50
|
+
return result + string.substring(cursor2);
|
|
107
51
|
};
|
|
108
52
|
var createColors = (enabled = isColorSupported) => {
|
|
109
53
|
let f = enabled ? formatter : () => String;
|
|
@@ -1271,20 +1215,20 @@ var require_trim_comparator_whitespace = __commonJS({
|
|
|
1271
1215
|
var trimComparatorWhitespace = (range) => {
|
|
1272
1216
|
let result = "";
|
|
1273
1217
|
let copyFrom = 0;
|
|
1274
|
-
let
|
|
1218
|
+
let cursor2 = 0;
|
|
1275
1219
|
const digitRuns = { start: -1, end: -1, previousStart: -1, previousEnd: -1 };
|
|
1276
|
-
while (
|
|
1277
|
-
const matchStart =
|
|
1278
|
-
if (range[
|
|
1279
|
-
|
|
1280
|
-
} else if (!isVersionPrefix(range[
|
|
1281
|
-
|
|
1220
|
+
while (cursor2 < range.length) {
|
|
1221
|
+
const matchStart = cursor2;
|
|
1222
|
+
if (range[cursor2] === "<" || range[cursor2] === ">") {
|
|
1223
|
+
cursor2++;
|
|
1224
|
+
} else if (!isVersionPrefix(range[cursor2]) && !isVersionStart(range[cursor2])) {
|
|
1225
|
+
cursor2++;
|
|
1282
1226
|
continue;
|
|
1283
1227
|
}
|
|
1284
|
-
while (
|
|
1285
|
-
|
|
1228
|
+
while (cursor2 < range.length && isVersionPrefix(range[cursor2])) {
|
|
1229
|
+
cursor2++;
|
|
1286
1230
|
}
|
|
1287
|
-
if (!isVersionStart(range[
|
|
1231
|
+
if (!isVersionStart(range[cursor2])) {
|
|
1288
1232
|
continue;
|
|
1289
1233
|
}
|
|
1290
1234
|
const whitespacePosition = findRemovableWhitespaceIndex(range, matchStart);
|
|
@@ -1292,7 +1236,7 @@ var require_trim_comparator_whitespace = __commonJS({
|
|
|
1292
1236
|
result += range.slice(copyFrom, whitespacePosition);
|
|
1293
1237
|
copyFrom = whitespacePosition + 1;
|
|
1294
1238
|
}
|
|
1295
|
-
|
|
1239
|
+
cursor2 = findVersionEndIndex(range, cursor2, digitRuns);
|
|
1296
1240
|
}
|
|
1297
1241
|
return result + range.slice(copyFrom);
|
|
1298
1242
|
};
|
|
@@ -1325,19 +1269,19 @@ var require_range = __commonJS({
|
|
|
1325
1269
|
this.loose = !!options.loose;
|
|
1326
1270
|
this.includePrerelease = !!options.includePrerelease;
|
|
1327
1271
|
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
1328
|
-
this.set = this.raw.split("||").map((r2) => this.parseRange(r2.trim())).filter((
|
|
1272
|
+
this.set = this.raw.split("||").map((r2) => this.parseRange(r2.trim())).filter((c3) => c3.length);
|
|
1329
1273
|
if (!this.set.length) {
|
|
1330
1274
|
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
1331
1275
|
}
|
|
1332
1276
|
if (this.set.length > 1) {
|
|
1333
1277
|
const first = this.set[0];
|
|
1334
|
-
this.set = this.set.filter((
|
|
1278
|
+
this.set = this.set.filter((c3) => !isNullSet(c3[0]));
|
|
1335
1279
|
if (this.set.length === 0) {
|
|
1336
1280
|
this.set = [first];
|
|
1337
1281
|
} else if (this.set.length > 1) {
|
|
1338
|
-
for (const
|
|
1339
|
-
if (
|
|
1340
|
-
this.set = [
|
|
1282
|
+
for (const c3 of this.set) {
|
|
1283
|
+
if (c3.length === 1 && isAny(c3[0])) {
|
|
1284
|
+
this.set = [c3];
|
|
1341
1285
|
break;
|
|
1342
1286
|
}
|
|
1343
1287
|
}
|
|
@@ -1461,8 +1405,8 @@ var require_range = __commonJS({
|
|
|
1461
1405
|
} = require_re();
|
|
1462
1406
|
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
1463
1407
|
var BUILDSTRIPRE = new RegExp(src[t2.BUILD], "g");
|
|
1464
|
-
var isNullSet = (
|
|
1465
|
-
var isAny = (
|
|
1408
|
+
var isNullSet = (c3) => c3.value === "<0.0.0-0";
|
|
1409
|
+
var isAny = (c3) => c3.value === "";
|
|
1466
1410
|
var isSatisfiable = (comparators, options) => {
|
|
1467
1411
|
let result = true;
|
|
1468
1412
|
const remainingComparators = comparators.slice();
|
|
@@ -1491,7 +1435,7 @@ var require_range = __commonJS({
|
|
|
1491
1435
|
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
1492
1436
|
var invalidXRangeOrder = (M, m2, p) => isX(M) && !isX(m2) || isX(m2) && p && !isX(p);
|
|
1493
1437
|
var replaceTildes = (comp, options) => {
|
|
1494
|
-
return comp.trim().split(/\s+/).map((
|
|
1438
|
+
return comp.trim().split(/\s+/).map((c3) => replaceTilde(c3, options)).join(" ");
|
|
1495
1439
|
};
|
|
1496
1440
|
var replaceTilde = (comp, options) => {
|
|
1497
1441
|
const r2 = options.loose ? re[t2.TILDELOOSE] : re[t2.TILDE];
|
|
@@ -1516,7 +1460,7 @@ var require_range = __commonJS({
|
|
|
1516
1460
|
});
|
|
1517
1461
|
};
|
|
1518
1462
|
var replaceCarets = (comp, options) => {
|
|
1519
|
-
return comp.trim().split(/\s+/).map((
|
|
1463
|
+
return comp.trim().split(/\s+/).map((c3) => replaceCaret(c3, options)).join(" ");
|
|
1520
1464
|
};
|
|
1521
1465
|
var replaceCaret = (comp, options) => {
|
|
1522
1466
|
debug("caret", comp, options);
|
|
@@ -1564,7 +1508,7 @@ var require_range = __commonJS({
|
|
|
1564
1508
|
};
|
|
1565
1509
|
var replaceXRanges = (comp, options) => {
|
|
1566
1510
|
debug("replaceXRanges", comp, options);
|
|
1567
|
-
return comp.split(/\s+/).map((
|
|
1511
|
+
return comp.split(/\s+/).map((c3) => replaceXRange(c3, options)).join(" ");
|
|
1568
1512
|
};
|
|
1569
1513
|
var replaceXRange = (comp, options) => {
|
|
1570
1514
|
comp = comp.trim();
|
|
@@ -1820,7 +1764,7 @@ var require_to_comparators = __commonJS({
|
|
|
1820
1764
|
"node_modules/semver/ranges/to-comparators.js"(exports, module) {
|
|
1821
1765
|
"use strict";
|
|
1822
1766
|
var Range = require_range();
|
|
1823
|
-
var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((
|
|
1767
|
+
var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c3) => c3.value).join(" ").trim().split(" "));
|
|
1824
1768
|
module.exports = toComparators;
|
|
1825
1769
|
}
|
|
1826
1770
|
});
|
|
@@ -2165,13 +2109,13 @@ var require_subset = __commonJS({
|
|
|
2165
2109
|
}
|
|
2166
2110
|
const eqSet = /* @__PURE__ */ new Set();
|
|
2167
2111
|
let gt, lt;
|
|
2168
|
-
for (const
|
|
2169
|
-
if (
|
|
2170
|
-
gt = higherGT(gt,
|
|
2171
|
-
} else if (
|
|
2172
|
-
lt = lowerLT(lt,
|
|
2112
|
+
for (const c3 of sub) {
|
|
2113
|
+
if (c3.operator === ">" || c3.operator === ">=") {
|
|
2114
|
+
gt = higherGT(gt, c3, options);
|
|
2115
|
+
} else if (c3.operator === "<" || c3.operator === "<=") {
|
|
2116
|
+
lt = lowerLT(lt, c3, options);
|
|
2173
2117
|
} else {
|
|
2174
|
-
eqSet.add(
|
|
2118
|
+
eqSet.add(c3.semver);
|
|
2175
2119
|
}
|
|
2176
2120
|
}
|
|
2177
2121
|
if (eqSet.size > 1) {
|
|
@@ -2193,8 +2137,8 @@ var require_subset = __commonJS({
|
|
|
2193
2137
|
if (lt && !satisfies4(eq2, String(lt), options)) {
|
|
2194
2138
|
return null;
|
|
2195
2139
|
}
|
|
2196
|
-
for (const
|
|
2197
|
-
if (!satisfies4(eq2, String(
|
|
2140
|
+
for (const c3 of dom) {
|
|
2141
|
+
if (!satisfies4(eq2, String(c3), options)) {
|
|
2198
2142
|
return false;
|
|
2199
2143
|
}
|
|
2200
2144
|
}
|
|
@@ -2207,40 +2151,40 @@ var require_subset = __commonJS({
|
|
|
2207
2151
|
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
|
|
2208
2152
|
needDomLTPre = false;
|
|
2209
2153
|
}
|
|
2210
|
-
for (const
|
|
2211
|
-
hasDomGT = hasDomGT ||
|
|
2212
|
-
hasDomLT = hasDomLT ||
|
|
2154
|
+
for (const c3 of dom) {
|
|
2155
|
+
hasDomGT = hasDomGT || c3.operator === ">" || c3.operator === ">=";
|
|
2156
|
+
hasDomLT = hasDomLT || c3.operator === "<" || c3.operator === "<=";
|
|
2213
2157
|
if (gt) {
|
|
2214
2158
|
if (needDomGTPre) {
|
|
2215
|
-
if (
|
|
2159
|
+
if (c3.semver.prerelease && c3.semver.prerelease.length && c3.semver.major === needDomGTPre.major && c3.semver.minor === needDomGTPre.minor && c3.semver.patch === needDomGTPre.patch) {
|
|
2216
2160
|
needDomGTPre = false;
|
|
2217
2161
|
}
|
|
2218
2162
|
}
|
|
2219
|
-
if (
|
|
2220
|
-
higher = higherGT(gt,
|
|
2221
|
-
if (higher ===
|
|
2163
|
+
if (c3.operator === ">" || c3.operator === ">=") {
|
|
2164
|
+
higher = higherGT(gt, c3, options);
|
|
2165
|
+
if (higher === c3 && higher !== gt) {
|
|
2222
2166
|
return false;
|
|
2223
2167
|
}
|
|
2224
|
-
} else if (gt.operator === ">=" && !
|
|
2168
|
+
} else if (gt.operator === ">=" && !c3.test(gt.semver)) {
|
|
2225
2169
|
return false;
|
|
2226
2170
|
}
|
|
2227
2171
|
}
|
|
2228
2172
|
if (lt) {
|
|
2229
2173
|
if (needDomLTPre) {
|
|
2230
|
-
if (
|
|
2174
|
+
if (c3.semver.prerelease && c3.semver.prerelease.length && c3.semver.major === needDomLTPre.major && c3.semver.minor === needDomLTPre.minor && c3.semver.patch === needDomLTPre.patch) {
|
|
2231
2175
|
needDomLTPre = false;
|
|
2232
2176
|
}
|
|
2233
2177
|
}
|
|
2234
|
-
if (
|
|
2235
|
-
lower = lowerLT(lt,
|
|
2236
|
-
if (lower ===
|
|
2178
|
+
if (c3.operator === "<" || c3.operator === "<=") {
|
|
2179
|
+
lower = lowerLT(lt, c3, options);
|
|
2180
|
+
if (lower === c3 && lower !== lt) {
|
|
2237
2181
|
return false;
|
|
2238
2182
|
}
|
|
2239
|
-
} else if (lt.operator === "<=" && !
|
|
2183
|
+
} else if (lt.operator === "<=" && !c3.test(lt.semver)) {
|
|
2240
2184
|
return false;
|
|
2241
2185
|
}
|
|
2242
2186
|
}
|
|
2243
|
-
if (!
|
|
2187
|
+
if (!c3.operator && (lt || gt) && gtltComp !== 0) {
|
|
2244
2188
|
return false;
|
|
2245
2189
|
}
|
|
2246
2190
|
}
|
|
@@ -2380,8 +2324,8 @@ import path2 from "node:path";
|
|
|
2380
2324
|
// node_modules/@clack/core/dist/index.mjs
|
|
2381
2325
|
import { styleText } from "node:util";
|
|
2382
2326
|
import { stdout, stdin } from "node:process";
|
|
2383
|
-
import * as
|
|
2384
|
-
import
|
|
2327
|
+
import * as f$1 from "node:readline";
|
|
2328
|
+
import f__default from "node:readline";
|
|
2385
2329
|
|
|
2386
2330
|
// node_modules/fast-string-truncated-width/dist/utils.js
|
|
2387
2331
|
var getCodePointsLength = /* @__PURE__ */ (() => {
|
|
@@ -2469,7 +2413,7 @@ var getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {})
|
|
|
2469
2413
|
if (index >= length) {
|
|
2470
2414
|
break outer;
|
|
2471
2415
|
}
|
|
2472
|
-
for (let i2 = 0,
|
|
2416
|
+
for (let i2 = 0, l = PARSE_BLOCKS.length; i2 < l; i2++) {
|
|
2473
2417
|
const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i2];
|
|
2474
2418
|
BLOCK_RE.lastIndex = index;
|
|
2475
2419
|
if (BLOCK_RE.test(input)) {
|
|
@@ -2719,14 +2663,66 @@ function wrapAnsi(string, columns, options) {
|
|
|
2719
2663
|
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
|
|
2720
2664
|
}
|
|
2721
2665
|
|
|
2666
|
+
// node_modules/sisteransi/dist/index.js
|
|
2667
|
+
var ESC2 = "\x1B";
|
|
2668
|
+
var CSI2 = `${ESC2}[`;
|
|
2669
|
+
var cursor = {
|
|
2670
|
+
to(x, y) {
|
|
2671
|
+
if (!y)
|
|
2672
|
+
return `${CSI2}${x + 1}G`;
|
|
2673
|
+
return `${CSI2}${y + 1};${x + 1}H`;
|
|
2674
|
+
},
|
|
2675
|
+
move(x, y) {
|
|
2676
|
+
let ret = "";
|
|
2677
|
+
if (x < 0)
|
|
2678
|
+
ret += `${CSI2}${-x}D`;
|
|
2679
|
+
else if (x > 0)
|
|
2680
|
+
ret += `${CSI2}${x}C`;
|
|
2681
|
+
if (y < 0)
|
|
2682
|
+
ret += `${CSI2}${-y}A`;
|
|
2683
|
+
else if (y > 0)
|
|
2684
|
+
ret += `${CSI2}${y}B`;
|
|
2685
|
+
return ret;
|
|
2686
|
+
},
|
|
2687
|
+
up: (count = 1) => `${CSI2}${count}A`,
|
|
2688
|
+
down: (count = 1) => `${CSI2}${count}B`,
|
|
2689
|
+
forward: (count = 1) => `${CSI2}${count}C`,
|
|
2690
|
+
backward: (count = 1) => `${CSI2}${count}D`,
|
|
2691
|
+
nextLine: (count = 1) => `${CSI2}E`.repeat(count),
|
|
2692
|
+
prevLine: (count = 1) => `${CSI2}F`.repeat(count),
|
|
2693
|
+
left: `${CSI2}G`,
|
|
2694
|
+
hide: `${CSI2}?25l`,
|
|
2695
|
+
show: `${CSI2}?25h`,
|
|
2696
|
+
save: `${ESC2}7`,
|
|
2697
|
+
restore: `${ESC2}8`
|
|
2698
|
+
};
|
|
2699
|
+
var erase = {
|
|
2700
|
+
screen: `${CSI2}2J`,
|
|
2701
|
+
up: (count = 1) => `${CSI2}1J`.repeat(count),
|
|
2702
|
+
down: (count = 1) => `${CSI2}J`.repeat(count),
|
|
2703
|
+
line: `${CSI2}2K`,
|
|
2704
|
+
lineEnd: `${CSI2}K`,
|
|
2705
|
+
lineStart: `${CSI2}1K`,
|
|
2706
|
+
lines(count) {
|
|
2707
|
+
let clear2 = "";
|
|
2708
|
+
for (let i2 = 0; i2 < count; i2++)
|
|
2709
|
+
clear2 += this.line + (i2 < count - 1 ? cursor.up() : "");
|
|
2710
|
+
if (count)
|
|
2711
|
+
clear2 += cursor.left;
|
|
2712
|
+
return clear2;
|
|
2713
|
+
}
|
|
2714
|
+
};
|
|
2715
|
+
var clear = {
|
|
2716
|
+
screen: `${ESC2}c`
|
|
2717
|
+
};
|
|
2718
|
+
|
|
2722
2719
|
// node_modules/@clack/core/dist/index.mjs
|
|
2723
|
-
var import_sisteransi = __toESM(require_src(), 1);
|
|
2724
2720
|
import { ReadStream } from "node:tty";
|
|
2725
|
-
function findCursor(
|
|
2726
|
-
if (!
|
|
2727
|
-
return
|
|
2728
|
-
const t2 =
|
|
2729
|
-
return
|
|
2721
|
+
function findCursor(o, s, l) {
|
|
2722
|
+
if (!l.some((r2) => !r2.disabled))
|
|
2723
|
+
return o;
|
|
2724
|
+
const t2 = o + s, n3 = Math.max(l.length - 1, 0), e = t2 < 0 ? n3 : t2 > n3 ? 0 : t2;
|
|
2725
|
+
return l[e]?.disabled ? findCursor(e, s < 0 ? -1 : 1, l) : e;
|
|
2730
2726
|
}
|
|
2731
2727
|
var a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
2732
2728
|
var t = [
|
|
@@ -2815,42 +2811,42 @@ function block({
|
|
|
2815
2811
|
overwrite: o = true,
|
|
2816
2812
|
hideCursor: n3 = true
|
|
2817
2813
|
} = {}) {
|
|
2818
|
-
const s =
|
|
2814
|
+
const s = f$1.createInterface({
|
|
2819
2815
|
input: e,
|
|
2820
2816
|
output: r2,
|
|
2821
2817
|
prompt: "",
|
|
2822
2818
|
tabSize: 1
|
|
2823
2819
|
});
|
|
2824
|
-
|
|
2825
|
-
const t2 = (
|
|
2826
|
-
const
|
|
2827
|
-
if (isActionKey([
|
|
2828
|
-
n3 && r2.write(
|
|
2820
|
+
f$1.emitKeypressEvents(e, s), e instanceof ReadStream && e.isTTY && e.setRawMode(true);
|
|
2821
|
+
const t2 = (l, { name: i2, sequence: p }) => {
|
|
2822
|
+
const w = String(l);
|
|
2823
|
+
if (isActionKey([w, i2, p], "cancel")) {
|
|
2824
|
+
n3 && r2.write(cursor.show), process.exit(0);
|
|
2829
2825
|
return;
|
|
2830
2826
|
}
|
|
2831
2827
|
if (!o) return;
|
|
2832
|
-
const
|
|
2833
|
-
|
|
2834
|
-
|
|
2828
|
+
const c3 = i2 === "return" ? 0 : -1, a2 = i2 === "return" ? -1 : 0;
|
|
2829
|
+
f$1.moveCursor(r2, c3, a2, () => {
|
|
2830
|
+
f$1.clearLine(r2, 1, () => {
|
|
2835
2831
|
e.once("keypress", t2);
|
|
2836
2832
|
});
|
|
2837
2833
|
});
|
|
2838
2834
|
};
|
|
2839
|
-
return n3 && r2.write(
|
|
2840
|
-
e.off("keypress", t2), n3 && r2.write(
|
|
2835
|
+
return n3 && r2.write(cursor.hide), e.once("keypress", t2), () => {
|
|
2836
|
+
e.off("keypress", t2), n3 && r2.write(cursor.show), e instanceof ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();
|
|
2841
2837
|
};
|
|
2842
2838
|
}
|
|
2843
2839
|
var getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
|
|
2844
2840
|
var getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
|
|
2845
2841
|
function wrapTextWithPrefix(e, r2, o, n3 = o, s = o, t2) {
|
|
2846
|
-
const
|
|
2847
|
-
return wrapAnsi(r2,
|
|
2842
|
+
const l = getColumns(e ?? stdout), i2 = dist_default2(o);
|
|
2843
|
+
return wrapAnsi(r2, l - i2, {
|
|
2848
2844
|
hard: true,
|
|
2849
2845
|
trim: false
|
|
2850
2846
|
}).split(`
|
|
2851
|
-
`).map((
|
|
2852
|
-
const
|
|
2853
|
-
return
|
|
2847
|
+
`).map((c3, a2, g) => {
|
|
2848
|
+
const m2 = t2 ? t2(c3, a2) : c3;
|
|
2849
|
+
return a2 === 0 ? `${n3}${m2}` : a2 === g.length - 1 ? `${s}${m2}` : `${o}${m2}`;
|
|
2854
2850
|
}).join(`
|
|
2855
2851
|
`);
|
|
2856
2852
|
}
|
|
@@ -2861,7 +2857,7 @@ function runValidation(e, a2) {
|
|
|
2861
2857
|
}
|
|
2862
2858
|
return e(a2);
|
|
2863
2859
|
}
|
|
2864
|
-
var
|
|
2860
|
+
var C$1 = class C {
|
|
2865
2861
|
input;
|
|
2866
2862
|
output;
|
|
2867
2863
|
_abortSignal;
|
|
@@ -2943,16 +2939,16 @@ var y = class {
|
|
|
2943
2939
|
{ once: true }
|
|
2944
2940
|
);
|
|
2945
2941
|
}
|
|
2946
|
-
this.rl =
|
|
2942
|
+
this.rl = f__default.createInterface({
|
|
2947
2943
|
input: this.input,
|
|
2948
2944
|
tabSize: 2,
|
|
2949
2945
|
prompt: "",
|
|
2950
2946
|
escapeCodeTimeout: 50,
|
|
2951
2947
|
terminal: true
|
|
2952
2948
|
}), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), setRawMode(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
2953
|
-
this.output.write(
|
|
2949
|
+
this.output.write(cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(this.value);
|
|
2954
2950
|
}), this.once("cancel", () => {
|
|
2955
|
-
this.output.write(
|
|
2951
|
+
this.output.write(cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(CANCEL_SYMBOL);
|
|
2956
2952
|
});
|
|
2957
2953
|
});
|
|
2958
2954
|
}
|
|
@@ -2989,18 +2985,18 @@ var y = class {
|
|
|
2989
2985
|
`), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
2990
2986
|
}
|
|
2991
2987
|
restoreCursor() {
|
|
2992
|
-
const t2 = wrapAnsi(this._prevFrame,
|
|
2988
|
+
const t2 = wrapAnsi(this._prevFrame, getColumns(this.output), { hard: true, trim: false }).split(`
|
|
2993
2989
|
`).length - 1;
|
|
2994
|
-
this.output.write(
|
|
2990
|
+
this.output.write(cursor.move(-999, t2 * -1));
|
|
2995
2991
|
}
|
|
2996
2992
|
render() {
|
|
2997
|
-
const t2 = wrapAnsi(this._render(this) ?? "",
|
|
2993
|
+
const t2 = wrapAnsi(this._render(this) ?? "", getColumns(this.output), {
|
|
2998
2994
|
hard: true,
|
|
2999
2995
|
trim: false
|
|
3000
2996
|
});
|
|
3001
2997
|
if (t2 !== this._prevFrame) {
|
|
3002
2998
|
if (this.state === "initial")
|
|
3003
|
-
this.output.write(
|
|
2999
|
+
this.output.write(cursor.hide);
|
|
3004
3000
|
else {
|
|
3005
3001
|
const e = diffLines(this._prevFrame, t2), i2 = getRows(this.output);
|
|
3006
3002
|
if (this.restoreCursor(), e) {
|
|
@@ -3011,33 +3007,33 @@ var y = class {
|
|
|
3011
3007
|
return;
|
|
3012
3008
|
}
|
|
3013
3009
|
if (e.lines.length === 1) {
|
|
3014
|
-
this.output.write(
|
|
3010
|
+
this.output.write(cursor.move(0, n3 - r2)), this.output.write(erase.lines(1));
|
|
3015
3011
|
const o = t2.split(`
|
|
3016
3012
|
`);
|
|
3017
|
-
this.output.write(o[n3]), this._prevFrame = t2, this.output.write(
|
|
3013
|
+
this.output.write(o[n3]), this._prevFrame = t2, this.output.write(cursor.move(0, o.length - n3 - 1));
|
|
3018
3014
|
return;
|
|
3019
3015
|
} else if (e.lines.length > 1) {
|
|
3020
3016
|
if (s < r2)
|
|
3021
3017
|
n3 = s;
|
|
3022
3018
|
else {
|
|
3023
3019
|
const h2 = n3 - r2;
|
|
3024
|
-
h2 > 0 && this.output.write(
|
|
3020
|
+
h2 > 0 && this.output.write(cursor.move(0, h2));
|
|
3025
3021
|
}
|
|
3026
|
-
this.output.write(
|
|
3027
|
-
const
|
|
3022
|
+
this.output.write(erase.down());
|
|
3023
|
+
const m2 = t2.split(`
|
|
3028
3024
|
`).slice(n3);
|
|
3029
|
-
this.output.write(
|
|
3025
|
+
this.output.write(m2.join(`
|
|
3030
3026
|
`)), this._prevFrame = t2;
|
|
3031
3027
|
return;
|
|
3032
3028
|
}
|
|
3033
3029
|
}
|
|
3034
|
-
this.output.write(
|
|
3030
|
+
this.output.write(erase.down());
|
|
3035
3031
|
}
|
|
3036
3032
|
this.output.write(t2), this.state === "initial" && (this.state = "active"), this._prevFrame = t2;
|
|
3037
3033
|
}
|
|
3038
3034
|
}
|
|
3039
3035
|
};
|
|
3040
|
-
var r = class extends
|
|
3036
|
+
var r = class extends C$1 {
|
|
3041
3037
|
get cursor() {
|
|
3042
3038
|
return this.value ? 0 : 1;
|
|
3043
3039
|
}
|
|
@@ -3048,13 +3044,13 @@ var r = class extends y {
|
|
|
3048
3044
|
super(t2, false), this.value = !!t2.initialValue, this.on("userInput", () => {
|
|
3049
3045
|
this.value = this._value;
|
|
3050
3046
|
}), this.on("confirm", (i2) => {
|
|
3051
|
-
this.output.write(
|
|
3047
|
+
this.output.write(cursor.move(0, -1)), this.value = i2, this.state = "submit", this.close();
|
|
3052
3048
|
}), this.on("cursor", () => {
|
|
3053
3049
|
this.value = !this.value;
|
|
3054
3050
|
});
|
|
3055
3051
|
}
|
|
3056
3052
|
};
|
|
3057
|
-
var a = class extends
|
|
3053
|
+
var a = class extends C$1 {
|
|
3058
3054
|
options;
|
|
3059
3055
|
cursor = 0;
|
|
3060
3056
|
get _value() {
|
|
@@ -3085,8 +3081,8 @@ var a = class extends y {
|
|
|
3085
3081
|
this.options.findIndex(({ value: t2 }) => t2 === e.cursorAt),
|
|
3086
3082
|
0
|
|
3087
3083
|
);
|
|
3088
|
-
this.cursor = this.options[i2]?.disabled ? findCursor(i2, 1, this.options) : i2, this.on("key", (t2,
|
|
3089
|
-
|
|
3084
|
+
this.cursor = this.options[i2]?.disabled ? findCursor(i2, 1, this.options) : i2, this.on("key", (t2, s) => {
|
|
3085
|
+
s.name === "a" && this.toggleAll(), s.name === "i" && this.toggleInvert(), s.name === void 0 && t2 === "\u3000" && this.toggleValue();
|
|
3090
3086
|
}), this.on("cursor", (t2) => {
|
|
3091
3087
|
switch (t2) {
|
|
3092
3088
|
case "left":
|
|
@@ -3104,7 +3100,7 @@ var a = class extends y {
|
|
|
3104
3100
|
});
|
|
3105
3101
|
}
|
|
3106
3102
|
};
|
|
3107
|
-
var n$1 = class n extends
|
|
3103
|
+
var n$1 = class n extends C$1 {
|
|
3108
3104
|
options;
|
|
3109
3105
|
cursor = 0;
|
|
3110
3106
|
get _selectedValue() {
|
|
@@ -3132,7 +3128,7 @@ var n$1 = class n extends y {
|
|
|
3132
3128
|
});
|
|
3133
3129
|
}
|
|
3134
3130
|
};
|
|
3135
|
-
var n2 = class extends
|
|
3131
|
+
var n2 = class extends C$1 {
|
|
3136
3132
|
get userInputWithCursor() {
|
|
3137
3133
|
if (this.state === "submit")
|
|
3138
3134
|
return this.userInput;
|
|
@@ -3160,7 +3156,6 @@ var n2 = class extends y {
|
|
|
3160
3156
|
// node_modules/@clack/prompts/dist/index.mjs
|
|
3161
3157
|
import { styleText as styleText2, stripVTControlCharacters } from "node:util";
|
|
3162
3158
|
import process$1 from "node:process";
|
|
3163
|
-
var import_sisteransi2 = __toESM(require_src(), 1);
|
|
3164
3159
|
function isUnicodeSupported() {
|
|
3165
3160
|
if (process$1.platform !== "win32") {
|
|
3166
3161
|
return process$1.env.TERM !== "linux";
|
|
@@ -3169,7 +3164,7 @@ function isUnicodeSupported() {
|
|
|
3169
3164
|
}
|
|
3170
3165
|
var unicode = isUnicodeSupported();
|
|
3171
3166
|
var isCI = () => process.env.CI === "true";
|
|
3172
|
-
var unicodeOr = (
|
|
3167
|
+
var unicodeOr = (e, o) => unicode ? e : o;
|
|
3173
3168
|
var S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
|
|
3174
3169
|
var S_STEP_CANCEL = unicodeOr("\u25A0", "x");
|
|
3175
3170
|
var S_STEP_ERROR = unicodeOr("\u25B2", "x");
|
|
@@ -3195,8 +3190,8 @@ var S_INFO = unicodeOr("\u25CF", "\u2022");
|
|
|
3195
3190
|
var S_SUCCESS = unicodeOr("\u25C6", "*");
|
|
3196
3191
|
var S_WARN = unicodeOr("\u25B2", "!");
|
|
3197
3192
|
var S_ERROR = unicodeOr("\u25A0", "x");
|
|
3198
|
-
var symbol = (
|
|
3199
|
-
switch (
|
|
3193
|
+
var symbol = (e) => {
|
|
3194
|
+
switch (e) {
|
|
3200
3195
|
case "initial":
|
|
3201
3196
|
case "active":
|
|
3202
3197
|
return styleText2("cyan", S_STEP_ACTIVE);
|
|
@@ -3210,8 +3205,8 @@ var symbol = (o) => {
|
|
|
3210
3205
|
return styleText2("dim", S_STEP_ACTIVE);
|
|
3211
3206
|
}
|
|
3212
3207
|
};
|
|
3213
|
-
var symbolBar = (
|
|
3214
|
-
switch (
|
|
3208
|
+
var symbolBar = (e) => {
|
|
3209
|
+
switch (e) {
|
|
3215
3210
|
case "initial":
|
|
3216
3211
|
case "active":
|
|
3217
3212
|
return styleText2("cyan", S_BAR);
|
|
@@ -3223,49 +3218,50 @@ var symbolBar = (o) => {
|
|
|
3223
3218
|
return styleText2("green", S_BAR);
|
|
3224
3219
|
}
|
|
3225
3220
|
};
|
|
3226
|
-
function formatInstructionFooter(o,
|
|
3227
|
-
const
|
|
3228
|
-
|
|
3221
|
+
function formatInstructionFooter(e, o, r2) {
|
|
3222
|
+
const s = r2 ? `${styleText2("cyan", S_BAR)} ` : "", n3 = wrapTextWithPrefix(e, o.join(" \u2022 "), s).split(`
|
|
3223
|
+
`);
|
|
3224
|
+
return r2 && n3.push(styleText2("cyan", S_BAR_END)), n3;
|
|
3229
3225
|
}
|
|
3230
|
-
var
|
|
3226
|
+
var E$1 = (l, e, w, p, b, C3 = false) => {
|
|
3231
3227
|
let r2 = e, O = 0;
|
|
3232
|
-
if (
|
|
3228
|
+
if (C3)
|
|
3233
3229
|
for (let i2 = p - 1; i2 >= w; i2--) {
|
|
3234
|
-
const m2 =
|
|
3230
|
+
const m2 = l[i2];
|
|
3235
3231
|
if (m2 && (r2 -= m2.length), O++, r2 <= b) break;
|
|
3236
3232
|
}
|
|
3237
3233
|
else
|
|
3238
3234
|
for (let i2 = w; i2 < p; i2++) {
|
|
3239
|
-
const m2 =
|
|
3235
|
+
const m2 = l[i2];
|
|
3240
3236
|
if (m2 && (r2 -= m2.length), O++, r2 <= b) break;
|
|
3241
3237
|
}
|
|
3242
3238
|
return { lineCount: r2, removals: O };
|
|
3243
3239
|
};
|
|
3244
3240
|
var limitOptions = ({
|
|
3245
|
-
cursor:
|
|
3241
|
+
cursor: l,
|
|
3246
3242
|
options: e,
|
|
3247
3243
|
style: w,
|
|
3248
3244
|
output: p = process.stdout,
|
|
3249
3245
|
maxItems: b = Number.POSITIVE_INFINITY,
|
|
3250
|
-
columnPadding:
|
|
3246
|
+
columnPadding: C3 = 0,
|
|
3251
3247
|
rowPadding: r2 = 4
|
|
3252
3248
|
}) => {
|
|
3253
|
-
const i2 = getColumns(p) -
|
|
3249
|
+
const i2 = getColumns(p) - C3, m2 = getRows(p), M = styleText2("dim", "..."), v = Math.max(m2 - r2, 0), a2 = Math.max(Math.min(b, v), 5);
|
|
3254
3250
|
let f = 0;
|
|
3255
|
-
|
|
3256
|
-
Math.min(
|
|
3251
|
+
l >= a2 - 3 && (f = Math.max(
|
|
3252
|
+
Math.min(l - a2 + 3, e.length - a2),
|
|
3257
3253
|
0
|
|
3258
3254
|
));
|
|
3259
|
-
let d = a2 < e.length && f > 0,
|
|
3260
|
-
const
|
|
3255
|
+
let d = a2 < e.length && f > 0, c3 = a2 < e.length && f + a2 < e.length;
|
|
3256
|
+
const I = Math.min(
|
|
3261
3257
|
f + a2,
|
|
3262
3258
|
e.length
|
|
3263
3259
|
), s = [];
|
|
3264
3260
|
let g = 0;
|
|
3265
|
-
d && g++,
|
|
3266
|
-
const T = f + (d ? 1 : 0),
|
|
3267
|
-
for (let t2 = T; t2 <
|
|
3268
|
-
const n3 = e[t2], o = n3 ? w(n3, t2 ===
|
|
3261
|
+
d && g++, c3 && g++;
|
|
3262
|
+
const T = f + (d ? 1 : 0), W2 = I - (c3 ? 1 : 0);
|
|
3263
|
+
for (let t2 = T; t2 < W2; t2++) {
|
|
3264
|
+
const n3 = e[t2], o = n3 !== void 0 ? w(n3, t2 === l) : "", h2 = wrapAnsi(o, i2, {
|
|
3269
3265
|
hard: true,
|
|
3270
3266
|
trim: false
|
|
3271
3267
|
}).split(`
|
|
@@ -3274,9 +3270,9 @@ var limitOptions = ({
|
|
|
3274
3270
|
}
|
|
3275
3271
|
if (g > v) {
|
|
3276
3272
|
let t2 = 0, n3 = 0, o = g;
|
|
3277
|
-
const h2 =
|
|
3273
|
+
const h2 = l - T;
|
|
3278
3274
|
let u3 = v;
|
|
3279
|
-
const L = () =>
|
|
3275
|
+
const L = () => E$1(s, o, 0, h2, u3), y = () => E$1(
|
|
3280
3276
|
s,
|
|
3281
3277
|
o,
|
|
3282
3278
|
h2 + 1,
|
|
@@ -3284,14 +3280,14 @@ var limitOptions = ({
|
|
|
3284
3280
|
u3,
|
|
3285
3281
|
true
|
|
3286
3282
|
);
|
|
3287
|
-
d ? ({ lineCount: o, removals: t2 } = L(), o > u3 && (
|
|
3283
|
+
d ? ({ lineCount: o, removals: t2 } = L(), o > u3 && (c3 || (u3 -= 1), { lineCount: o, removals: n3 } = y())) : (c3 || (u3 -= 1), { lineCount: o, removals: n3 } = y(), o > u3 && (u3 -= 1, { lineCount: o, removals: t2 } = L())), t2 > 0 && (d = true, s.splice(0, t2)), n3 > 0 && (c3 = true, s.splice(s.length - n3, n3));
|
|
3288
3284
|
}
|
|
3289
3285
|
const x = [];
|
|
3290
3286
|
d && x.push(M);
|
|
3291
3287
|
for (const t2 of s)
|
|
3292
3288
|
for (const n3 of t2)
|
|
3293
3289
|
x.push(n3);
|
|
3294
|
-
return
|
|
3290
|
+
return c3 && x.push(M), x;
|
|
3295
3291
|
};
|
|
3296
3292
|
var confirm = (e) => {
|
|
3297
3293
|
const a2 = e.active ?? "Yes", o = e.inactive ?? "No";
|
|
@@ -3303,22 +3299,22 @@ var confirm = (e) => {
|
|
|
3303
3299
|
output: e.output,
|
|
3304
3300
|
initialValue: e.initialValue ?? true,
|
|
3305
3301
|
render() {
|
|
3306
|
-
const i2 = e.withGuide ?? settings.withGuide, u3 = `${symbol(this.state)} `,
|
|
3302
|
+
const i2 = e.withGuide ?? settings.withGuide, u3 = `${symbol(this.state)} `, l = i2 ? `${styleText2("gray", S_BAR)} ` : "", f = wrapTextWithPrefix(
|
|
3307
3303
|
e.output,
|
|
3308
3304
|
e.message,
|
|
3309
|
-
|
|
3305
|
+
l,
|
|
3310
3306
|
u3
|
|
3311
3307
|
), s = `${i2 ? `${styleText2("gray", S_BAR)}
|
|
3312
3308
|
` : ""}${f}
|
|
3313
|
-
`,
|
|
3309
|
+
`, c3 = this.value ? a2 : o;
|
|
3314
3310
|
switch (this.state) {
|
|
3315
3311
|
case "submit": {
|
|
3316
3312
|
const r2 = i2 ? `${styleText2("gray", S_BAR)} ` : "";
|
|
3317
|
-
return `${s}${r2}${styleText2("dim",
|
|
3313
|
+
return `${s}${r2}${styleText2("dim", c3)}`;
|
|
3318
3314
|
}
|
|
3319
3315
|
case "cancel": {
|
|
3320
3316
|
const r2 = i2 ? `${styleText2("gray", S_BAR)} ` : "";
|
|
3321
|
-
return `${s}${r2}${styleText2(["strikethrough", "dim"],
|
|
3317
|
+
return `${s}${r2}${styleText2(["strikethrough", "dim"], c3)}${i2 ? `
|
|
3322
3318
|
${styleText2("gray", S_BAR)}` : ""}`;
|
|
3323
3319
|
}
|
|
3324
3320
|
default: {
|
|
@@ -3338,22 +3334,22 @@ var MULTISELECT_INSTRUCTIONS = [
|
|
|
3338
3334
|
`${styleText2("dim", "Space:")} select`,
|
|
3339
3335
|
`${styleText2("dim", "Enter:")} confirm`
|
|
3340
3336
|
];
|
|
3341
|
-
var m = (
|
|
3337
|
+
var m = (n3, u3) => n3.split(`
|
|
3342
3338
|
`).map((d) => u3(d)).join(`
|
|
3343
3339
|
`);
|
|
3344
|
-
var multiselect = (
|
|
3340
|
+
var multiselect = (n3) => {
|
|
3345
3341
|
const u3 = (t2, a2) => {
|
|
3346
3342
|
const r2 = t2.label ?? String(t2.value);
|
|
3347
3343
|
return a2 === "disabled" ? `${styleText2("gray", S_CHECKBOX_INACTIVE)} ${m(r2, (o) => styleText2(["strikethrough", "gray"], o))}${t2.hint ? ` ${styleText2("dim", `(${t2.hint ?? "disabled"})`)}` : ""}` : a2 === "active" ? `${styleText2("cyan", S_CHECKBOX_ACTIVE)} ${r2}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : a2 === "selected" ? `${styleText2("green", S_CHECKBOX_SELECTED)} ${m(r2, (o) => styleText2("dim", o))}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : a2 === "cancelled" ? `${m(r2, (o) => styleText2(["strikethrough", "dim"], o))}` : a2 === "active-selected" ? `${styleText2("green", S_CHECKBOX_SELECTED)} ${r2}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}` : a2 === "submitted" ? `${m(r2, (o) => styleText2("dim", o))}` : `${styleText2("dim", S_CHECKBOX_INACTIVE)} ${m(r2, (o) => styleText2("dim", o))}`;
|
|
3348
|
-
}, d =
|
|
3344
|
+
}, d = n3.required ?? true, x = n3.showInstructions ?? true;
|
|
3349
3345
|
return new a({
|
|
3350
|
-
options:
|
|
3351
|
-
signal:
|
|
3352
|
-
input:
|
|
3353
|
-
output:
|
|
3354
|
-
initialValues:
|
|
3346
|
+
options: n3.options,
|
|
3347
|
+
signal: n3.signal,
|
|
3348
|
+
input: n3.input,
|
|
3349
|
+
output: n3.output,
|
|
3350
|
+
initialValues: n3.initialValues,
|
|
3355
3351
|
required: d,
|
|
3356
|
-
cursorAt:
|
|
3352
|
+
cursorAt: n3.cursorAt,
|
|
3357
3353
|
validate(t2) {
|
|
3358
3354
|
if (d && (t2 === void 0 || t2.length === 0))
|
|
3359
3355
|
return `Please select at least one option.
|
|
@@ -3369,75 +3365,75 @@ ${styleText2(
|
|
|
3369
3365
|
)}`;
|
|
3370
3366
|
},
|
|
3371
3367
|
render() {
|
|
3372
|
-
const t2 =
|
|
3373
|
-
|
|
3374
|
-
|
|
3368
|
+
const t2 = n3.withGuide ?? settings.withGuide, a2 = wrapTextWithPrefix(
|
|
3369
|
+
n3.output,
|
|
3370
|
+
n3.message,
|
|
3375
3371
|
t2 ? `${symbolBar(this.state)} ` : "",
|
|
3376
3372
|
`${symbol(this.state)} `
|
|
3377
3373
|
), r2 = `${t2 ? `${styleText2("gray", S_BAR)}
|
|
3378
3374
|
` : ""}${a2}
|
|
3379
|
-
`, o = this.value ?? [], g = (
|
|
3380
|
-
if (
|
|
3381
|
-
return u3(
|
|
3382
|
-
const s = o.includes(
|
|
3383
|
-
return
|
|
3375
|
+
`, o = this.value ?? [], g = (i2, l) => {
|
|
3376
|
+
if (i2.disabled)
|
|
3377
|
+
return u3(i2, "disabled");
|
|
3378
|
+
const s = o.includes(i2.value);
|
|
3379
|
+
return l && s ? u3(i2, "active-selected") : s ? u3(i2, "selected") : u3(i2, l ? "active" : "inactive");
|
|
3384
3380
|
};
|
|
3385
3381
|
switch (this.state) {
|
|
3386
3382
|
case "submit": {
|
|
3387
|
-
const
|
|
3388
|
-
|
|
3389
|
-
|
|
3383
|
+
const i2 = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u3(s, "submitted")).join(styleText2("dim", ", ")) || styleText2("dim", "none"), l = wrapTextWithPrefix(
|
|
3384
|
+
n3.output,
|
|
3385
|
+
i2,
|
|
3390
3386
|
t2 ? `${styleText2("gray", S_BAR)} ` : ""
|
|
3391
3387
|
);
|
|
3392
|
-
return `${r2}${
|
|
3388
|
+
return `${r2}${l}`;
|
|
3393
3389
|
}
|
|
3394
3390
|
case "cancel": {
|
|
3395
|
-
const
|
|
3396
|
-
if (
|
|
3391
|
+
const i2 = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u3(s, "cancelled")).join(styleText2("dim", ", "));
|
|
3392
|
+
if (i2.trim() === "")
|
|
3397
3393
|
return `${r2}${styleText2("gray", S_BAR)}`;
|
|
3398
|
-
const
|
|
3399
|
-
|
|
3400
|
-
|
|
3394
|
+
const l = wrapTextWithPrefix(
|
|
3395
|
+
n3.output,
|
|
3396
|
+
i2,
|
|
3401
3397
|
t2 ? `${styleText2("gray", S_BAR)} ` : ""
|
|
3402
3398
|
);
|
|
3403
|
-
return `${r2}${
|
|
3399
|
+
return `${r2}${l}${t2 ? `
|
|
3404
3400
|
${styleText2("gray", S_BAR)}` : ""}`;
|
|
3405
3401
|
}
|
|
3406
3402
|
case "error": {
|
|
3407
|
-
const
|
|
3403
|
+
const i2 = t2 ? `${styleText2("yellow", S_BAR)} ` : "", l = this.error.split(`
|
|
3408
3404
|
`).map(
|
|
3409
3405
|
($, v) => v === 0 ? `${t2 ? `${styleText2("yellow", S_BAR_END)} ` : ""}${styleText2("yellow", $)}` : ` ${$}`
|
|
3410
3406
|
).join(`
|
|
3411
3407
|
`), s = r2.split(`
|
|
3412
|
-
`).length, h2 =
|
|
3408
|
+
`).length, h2 = l.split(`
|
|
3413
3409
|
`).length + 1;
|
|
3414
|
-
return `${r2}${
|
|
3415
|
-
output:
|
|
3410
|
+
return `${r2}${i2}${limitOptions({
|
|
3411
|
+
output: n3.output,
|
|
3416
3412
|
options: this.options,
|
|
3417
3413
|
cursor: this.cursor,
|
|
3418
|
-
maxItems:
|
|
3419
|
-
columnPadding:
|
|
3414
|
+
maxItems: n3.maxItems,
|
|
3415
|
+
columnPadding: i2.length,
|
|
3420
3416
|
rowPadding: s + h2,
|
|
3421
3417
|
style: g
|
|
3422
3418
|
}).join(`
|
|
3423
|
-
${
|
|
3424
|
-
${
|
|
3419
|
+
${i2}`)}
|
|
3420
|
+
${l}
|
|
3425
3421
|
`;
|
|
3426
3422
|
}
|
|
3427
3423
|
default: {
|
|
3428
|
-
const
|
|
3429
|
-
`).length, s = x ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, t2) : t2 ? [styleText2("cyan", S_BAR_END)] : [], h2 = s.join(`
|
|
3424
|
+
const i2 = t2 ? `${styleText2("cyan", S_BAR)} ` : "", l = r2.split(`
|
|
3425
|
+
`).length, s = x ? formatInstructionFooter(n3.output, MULTISELECT_INSTRUCTIONS, t2) : t2 ? [styleText2("cyan", S_BAR_END)] : [], h2 = s.join(`
|
|
3430
3426
|
`), $ = s.length + 1;
|
|
3431
|
-
return `${r2}${
|
|
3432
|
-
output:
|
|
3427
|
+
return `${r2}${i2}${limitOptions({
|
|
3428
|
+
output: n3.output,
|
|
3433
3429
|
options: this.options,
|
|
3434
3430
|
cursor: this.cursor,
|
|
3435
|
-
maxItems:
|
|
3436
|
-
columnPadding:
|
|
3437
|
-
rowPadding:
|
|
3431
|
+
maxItems: n3.maxItems,
|
|
3432
|
+
columnPadding: i2.length,
|
|
3433
|
+
rowPadding: l + $,
|
|
3438
3434
|
style: g
|
|
3439
3435
|
}).join(`
|
|
3440
|
-
${
|
|
3436
|
+
${i2}`)}
|
|
3441
3437
|
${h2}
|
|
3442
3438
|
`;
|
|
3443
3439
|
}
|
|
@@ -3463,18 +3459,18 @@ ${styleText2("gray", S_BAR_END)} ` : "";
|
|
|
3463
3459
|
|
|
3464
3460
|
`);
|
|
3465
3461
|
};
|
|
3466
|
-
var W
|
|
3467
|
-
var
|
|
3462
|
+
var W = (o) => o;
|
|
3463
|
+
var C2 = (o, e, s) => {
|
|
3468
3464
|
const a2 = {
|
|
3469
3465
|
hard: true,
|
|
3470
3466
|
trim: false
|
|
3471
3467
|
}, i2 = wrapAnsi(o, e, a2).split(`
|
|
3472
|
-
`),
|
|
3468
|
+
`), c3 = i2.reduce((n3, t2) => Math.max(dist_default2(t2), n3), 0), u3 = i2.map(s).reduce((n3, t2) => Math.max(dist_default2(t2), n3), 0), g = e - (u3 - c3);
|
|
3473
3469
|
return wrapAnsi(o, g, a2);
|
|
3474
3470
|
};
|
|
3475
3471
|
var note = (o = "", e = "", s) => {
|
|
3476
|
-
const a2 = s?.output ?? process$1.stdout, i2 = s?.withGuide ?? settings.withGuide,
|
|
3477
|
-
`).map(
|
|
3472
|
+
const a2 = s?.output ?? process$1.stdout, i2 = s?.withGuide ?? settings.withGuide, c3 = s?.format ?? W, g = ["", ...C2(o, getColumns(a2) - 6, c3).split(`
|
|
3473
|
+
`).map(c3), ""], n3 = dist_default2(e), t2 = Math.max(
|
|
3478
3474
|
g.reduce((m2, F2) => {
|
|
3479
3475
|
const O = dist_default2(F2);
|
|
3480
3476
|
return O > m2 ? O : m2;
|
|
@@ -3495,83 +3491,102 @@ ${styleText2("gray", l$1 + S_BAR_H.repeat(t2 + 2) + S_CORNER_BOTTOM_RIGHT)}
|
|
|
3495
3491
|
`
|
|
3496
3492
|
);
|
|
3497
3493
|
};
|
|
3498
|
-
var
|
|
3494
|
+
var Y = 3e4;
|
|
3495
|
+
var Z = (c3) => styleText2("magenta", c3);
|
|
3499
3496
|
var spinner = ({
|
|
3500
|
-
indicator:
|
|
3501
|
-
onCancel:
|
|
3497
|
+
indicator: c3 = "dots",
|
|
3498
|
+
onCancel: b,
|
|
3502
3499
|
output: n3 = process.stdout,
|
|
3503
|
-
cancelMessage:
|
|
3504
|
-
errorMessage:
|
|
3505
|
-
frames:
|
|
3506
|
-
delay:
|
|
3507
|
-
signal:
|
|
3508
|
-
...
|
|
3500
|
+
cancelMessage: _,
|
|
3501
|
+
errorMessage: C3,
|
|
3502
|
+
frames: M = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
|
|
3503
|
+
delay: O = unicode ? 80 : 120,
|
|
3504
|
+
signal: g,
|
|
3505
|
+
...E
|
|
3509
3506
|
} = {}) => {
|
|
3510
|
-
const u3 = isCI();
|
|
3511
|
-
let
|
|
3512
|
-
const
|
|
3513
|
-
const
|
|
3514
|
-
|
|
3515
|
-
},
|
|
3516
|
-
process.on("uncaughtExceptionMonitor",
|
|
3517
|
-
},
|
|
3518
|
-
process.removeListener("uncaughtExceptionMonitor",
|
|
3519
|
-
},
|
|
3520
|
-
if (
|
|
3507
|
+
const u3 = isCI(), h2 = isAccessible(E.accessible);
|
|
3508
|
+
let x, I, p = false, l = false, r2 = "", v, w = performance.now();
|
|
3509
|
+
const y = getColumns(n3), F2 = E?.styleFrame ?? Z, S = (e) => {
|
|
3510
|
+
const s = e > 1 ? C3 ?? settings.messages.error : _ ?? settings.messages.cancel;
|
|
3511
|
+
l = e === 1, p && (m2(s, e), l && typeof b == "function" && b());
|
|
3512
|
+
}, $ = () => S(2), a2 = () => S(1), H = () => {
|
|
3513
|
+
process.on("uncaughtExceptionMonitor", $), process.on("unhandledRejection", $), process.on("SIGINT", a2), process.on("SIGTERM", a2), process.on("exit", S), g && g.addEventListener("abort", a2);
|
|
3514
|
+
}, B = () => {
|
|
3515
|
+
process.removeListener("uncaughtExceptionMonitor", $), process.removeListener("unhandledRejection", $), process.removeListener("SIGINT", a2), process.removeListener("SIGTERM", a2), process.removeListener("exit", S), g && g.removeEventListener("abort", a2);
|
|
3516
|
+
}, R2 = () => {
|
|
3517
|
+
if (v === void 0) return;
|
|
3521
3518
|
u3 && n3.write(`
|
|
3522
3519
|
`);
|
|
3523
|
-
const
|
|
3520
|
+
const s = wrapAnsi(v, y, {
|
|
3524
3521
|
hard: true,
|
|
3525
3522
|
trim: false
|
|
3526
3523
|
}).split(`
|
|
3527
3524
|
`);
|
|
3528
|
-
|
|
3529
|
-
},
|
|
3530
|
-
const
|
|
3531
|
-
return
|
|
3532
|
-
}, N2 =
|
|
3533
|
-
|
|
3525
|
+
s.length > 1 && n3.write(cursor.up(s.length - 1)), n3.write(cursor.to(0)), n3.write(erase.down());
|
|
3526
|
+
}, L = (e) => e.replace(/\.+$/, ""), T = (e) => {
|
|
3527
|
+
const s = (performance.now() - e) / 1e3, i2 = Math.floor(s / 60), t2 = Math.floor(s % 60);
|
|
3528
|
+
return i2 > 0 ? `[${i2}m ${t2}s]` : `[${t2}s]`;
|
|
3529
|
+
}, N2 = E.withGuide ?? settings.withGuide, P = (e = "") => {
|
|
3530
|
+
if (p = true, l = false, r2 = L(e), w = performance.now(), H(), h2) {
|
|
3531
|
+
r2 !== "" && n3.write(`${r2}
|
|
3532
|
+
`), I = setInterval(() => {
|
|
3533
|
+
n3.write(r2 === "" ? `still working
|
|
3534
|
+
` : `still working: ${r2}
|
|
3535
|
+
`);
|
|
3536
|
+
}, Y);
|
|
3537
|
+
return;
|
|
3538
|
+
}
|
|
3539
|
+
x = block({ output: n3 }), N2 && n3.write(`${styleText2("gray", S_BAR)}
|
|
3534
3540
|
`);
|
|
3535
|
-
let
|
|
3536
|
-
|
|
3537
|
-
if (u3 &&
|
|
3541
|
+
let s = 0, i2 = 0;
|
|
3542
|
+
I = setInterval(() => {
|
|
3543
|
+
if (u3 && r2 === v)
|
|
3538
3544
|
return;
|
|
3539
|
-
|
|
3540
|
-
const
|
|
3541
|
-
let
|
|
3545
|
+
R2(), v = r2;
|
|
3546
|
+
const t2 = F2(M[s]);
|
|
3547
|
+
let o;
|
|
3542
3548
|
if (u3)
|
|
3543
|
-
|
|
3544
|
-
else if (
|
|
3545
|
-
|
|
3549
|
+
o = `${t2} ${r2}...`;
|
|
3550
|
+
else if (c3 === "timer")
|
|
3551
|
+
o = `${t2} ${r2} ${T(w)}`;
|
|
3546
3552
|
else {
|
|
3547
|
-
const
|
|
3548
|
-
|
|
3553
|
+
const j = ".".repeat(Math.floor(i2)).slice(0, 3);
|
|
3554
|
+
o = `${t2} ${r2}${j}`;
|
|
3549
3555
|
}
|
|
3550
|
-
const
|
|
3556
|
+
const D = wrapAnsi(o, y, {
|
|
3551
3557
|
hard: true,
|
|
3552
3558
|
trim: false
|
|
3553
3559
|
});
|
|
3554
|
-
n3.write(
|
|
3555
|
-
},
|
|
3556
|
-
},
|
|
3557
|
-
if (
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
`)
|
|
3560
|
+
n3.write(D), s = s + 1 < M.length ? s + 1 : 0, i2 = i2 < 4 ? i2 + 0.125 : 0;
|
|
3561
|
+
}, O);
|
|
3562
|
+
}, m2 = (e = "", s = 0, i2 = false) => {
|
|
3563
|
+
if (p) {
|
|
3564
|
+
if (p = false, l = s === 1, clearInterval(I), h2 || R2(), r2 = e ?? r2, !i2)
|
|
3565
|
+
if (h2) {
|
|
3566
|
+
const t2 = s === 1 ? _ ?? settings.messages.cancel : s === 2 ? C3 ?? settings.messages.error : "Done", o = r2 || t2;
|
|
3567
|
+
c3 === "timer" ? n3.write(`${o} ${T(w)}
|
|
3568
|
+
`) : n3.write(`${o}
|
|
3569
|
+
`);
|
|
3570
|
+
} else {
|
|
3571
|
+
const t2 = s === 0 ? styleText2("green", S_STEP_SUBMIT) : s === 1 ? styleText2("red", S_STEP_CANCEL) : styleText2("red", S_STEP_ERROR);
|
|
3572
|
+
c3 === "timer" ? n3.write(`${t2} ${r2} ${T(w)}
|
|
3573
|
+
`) : n3.write(`${t2} ${r2}
|
|
3574
|
+
`);
|
|
3575
|
+
}
|
|
3576
|
+
B(), x?.();
|
|
3577
|
+
}
|
|
3563
3578
|
};
|
|
3564
3579
|
return {
|
|
3565
3580
|
start: P,
|
|
3566
|
-
stop: (e = "") =>
|
|
3581
|
+
stop: (e = "") => m2(e, 0),
|
|
3567
3582
|
message: (e = "") => {
|
|
3568
|
-
|
|
3583
|
+
r2 = L(e ?? r2);
|
|
3569
3584
|
},
|
|
3570
|
-
cancel: (e = "") =>
|
|
3571
|
-
error: (e = "") =>
|
|
3572
|
-
clear: () =>
|
|
3585
|
+
cancel: (e = "") => m2(e, 1),
|
|
3586
|
+
error: (e = "") => m2(e, 2),
|
|
3587
|
+
clear: () => m2("", 0, true),
|
|
3573
3588
|
get isCancelled() {
|
|
3574
|
-
return
|
|
3589
|
+
return l;
|
|
3575
3590
|
}
|
|
3576
3591
|
};
|
|
3577
3592
|
};
|
|
@@ -3584,7 +3599,7 @@ var SELECT_INSTRUCTIONS = [
|
|
|
3584
3599
|
`${styleText2("dim", "\u2191/\u2193")} to navigate`,
|
|
3585
3600
|
`${styleText2("dim", "Enter:")} confirm`
|
|
3586
3601
|
];
|
|
3587
|
-
var
|
|
3602
|
+
var c2 = (t2, o) => t2.includes(`
|
|
3588
3603
|
`) ? t2.split(`
|
|
3589
3604
|
`).map((d) => o(d)).join(`
|
|
3590
3605
|
`) : o(t2);
|
|
@@ -3595,15 +3610,15 @@ var select = (t2) => {
|
|
|
3595
3610
|
const s = n3.label ?? String(n3.value);
|
|
3596
3611
|
switch (m2) {
|
|
3597
3612
|
case "disabled":
|
|
3598
|
-
return `${styleText2("gray", S_RADIO_INACTIVE)} ${
|
|
3613
|
+
return `${styleText2("gray", S_RADIO_INACTIVE)} ${c2(s, (i2) => styleText2("gray", i2))}${n3.hint ? ` ${styleText2("dim", `(${n3.hint ?? "disabled"})`)}` : ""}`;
|
|
3599
3614
|
case "selected":
|
|
3600
|
-
return `${
|
|
3615
|
+
return `${c2(s, (i2) => styleText2("dim", i2))}`;
|
|
3601
3616
|
case "active":
|
|
3602
3617
|
return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${n3.hint ? ` ${styleText2("dim", `(${n3.hint})`)}` : ""}`;
|
|
3603
3618
|
case "cancelled":
|
|
3604
|
-
return `${
|
|
3619
|
+
return `${c2(s, (i2) => styleText2(["strikethrough", "dim"], i2))}`;
|
|
3605
3620
|
default:
|
|
3606
|
-
return `${styleText2("dim", S_RADIO_INACTIVE)} ${
|
|
3621
|
+
return `${styleText2("dim", S_RADIO_INACTIVE)} ${c2(s, (i2) => styleText2("dim", i2))}`;
|
|
3607
3622
|
}
|
|
3608
3623
|
}, d = t2.showInstructions ?? true;
|
|
3609
3624
|
return new n$1({
|
|
@@ -3641,7 +3656,7 @@ ${styleText2("gray", S_BAR)}` : ""}`;
|
|
|
3641
3656
|
}
|
|
3642
3657
|
default: {
|
|
3643
3658
|
const r2 = n3 ? `${styleText2("cyan", S_BAR)} ` : "", a2 = u3.split(`
|
|
3644
|
-
`).length, p = d ? formatInstructionFooter(SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], f = p.join(`
|
|
3659
|
+
`).length, p = d ? formatInstructionFooter(t2.output, SELECT_INSTRUCTIONS, n3) : n3 ? [styleText2("cyan", S_BAR_END)] : [], f = p.join(`
|
|
3645
3660
|
`), b = p.length + 1;
|
|
3646
3661
|
return `${u3}${r2}${limitOptions({
|
|
3647
3662
|
output: t2.output,
|
|
@@ -3670,7 +3685,7 @@ var text = (t2) => new n2({
|
|
|
3670
3685
|
signal: t2.signal,
|
|
3671
3686
|
input: t2.input,
|
|
3672
3687
|
render() {
|
|
3673
|
-
const r2 = t2?.withGuide ?? settings.withGuide,
|
|
3688
|
+
const r2 = t2?.withGuide ?? settings.withGuide, l = `${`${r2 ? `${styleText2("gray", S_BAR)}
|
|
3674
3689
|
` : ""}${symbol(this.state)} `}${t2.message}
|
|
3675
3690
|
`, d = t2.placeholder && t2.placeholder.length > 0 ? (
|
|
3676
3691
|
// biome-ignore lint/style/noNonNullAssertion: guarded by placeholder.length > 0
|
|
@@ -3678,30 +3693,30 @@ var text = (t2) => new n2({
|
|
|
3678
3693
|
) : styleText2(["inverse", "hidden"], "_"), o = this.userInput ? this.userInputWithCursor : d, s = this.value ?? "";
|
|
3679
3694
|
switch (this.state) {
|
|
3680
3695
|
case "validating": {
|
|
3681
|
-
const n3 = r2 ? `${styleText2("cyan", S_BAR)} ` : "", i2 = r2 ? styleText2("cyan", S_BAR_END) : "",
|
|
3682
|
-
return `${
|
|
3696
|
+
const n3 = r2 ? `${styleText2("cyan", S_BAR)} ` : "", i2 = r2 ? styleText2("cyan", S_BAR_END) : "", c3 = styleText2("dim", o), $ = styleText2("dim", "Validating...");
|
|
3697
|
+
return `${l}${n3}${c3}
|
|
3683
3698
|
${i2} ${$}
|
|
3684
3699
|
`;
|
|
3685
3700
|
}
|
|
3686
3701
|
case "error": {
|
|
3687
|
-
const n3 = this.error ? ` ${styleText2("yellow", this.error)}` : "", i2 = r2 ? `${styleText2("yellow", S_BAR)} ` : "",
|
|
3688
|
-
return `${
|
|
3702
|
+
const n3 = this.error ? ` ${styleText2("yellow", this.error)}` : "", i2 = r2 ? `${styleText2("yellow", S_BAR)} ` : "", c3 = r2 ? styleText2("yellow", S_BAR_END) : "";
|
|
3703
|
+
return `${l.trim()}
|
|
3689
3704
|
${i2}${o}
|
|
3690
|
-
${
|
|
3705
|
+
${c3}${n3}
|
|
3691
3706
|
`;
|
|
3692
3707
|
}
|
|
3693
3708
|
case "submit": {
|
|
3694
3709
|
const n3 = s ? `${r2 ? " " : ""}${styleText2("dim", s)}` : "", i2 = r2 ? styleText2("gray", S_BAR) : "";
|
|
3695
|
-
return `${
|
|
3710
|
+
return `${l}${i2}${n3}`;
|
|
3696
3711
|
}
|
|
3697
3712
|
case "cancel": {
|
|
3698
3713
|
const n3 = s ? ` ${styleText2(["strikethrough", "dim"], s)}` : "", i2 = r2 ? styleText2("gray", S_BAR) : "";
|
|
3699
|
-
return `${
|
|
3714
|
+
return `${l}${i2}${n3}${s.trim() ? `
|
|
3700
3715
|
${i2}` : ""}`;
|
|
3701
3716
|
}
|
|
3702
3717
|
default: {
|
|
3703
3718
|
const n3 = r2 ? `${styleText2("cyan", S_BAR)} ` : "", i2 = r2 ? styleText2("cyan", S_BAR_END) : "";
|
|
3704
|
-
return `${
|
|
3719
|
+
return `${l}${n3}${o}
|
|
3705
3720
|
${i2}
|
|
3706
3721
|
`;
|
|
3707
3722
|
}
|
|
@@ -3729,7 +3744,7 @@ var PREPROCESSOR_PKG = {
|
|
|
3729
3744
|
};
|
|
3730
3745
|
var TAILWIND_PKGS = ["tailwindcss", "@tailwindcss/vite"];
|
|
3731
3746
|
var PKG_VERSION = {
|
|
3732
|
-
sass: "^1.108.
|
|
3747
|
+
sass: "^1.108.2",
|
|
3733
3748
|
less: "^4.9.1",
|
|
3734
3749
|
stylus: "^0.64.0",
|
|
3735
3750
|
tailwindcss: "^4.3.5",
|
|
@@ -3774,12 +3789,12 @@ function setStyleImports(source, f) {
|
|
|
3774
3789
|
);
|
|
3775
3790
|
const block2 = styleImportLines(f).join("\n") + "\n";
|
|
3776
3791
|
const lines = stripped.split("\n");
|
|
3777
|
-
const routesIdx = lines.findIndex((
|
|
3792
|
+
const routesIdx = lines.findIndex((l) => /from\s+['"]toiljs\/routes['"]/.test(l));
|
|
3778
3793
|
let insertAt;
|
|
3779
3794
|
if (routesIdx !== -1) {
|
|
3780
3795
|
insertAt = routesIdx + 1;
|
|
3781
3796
|
} else {
|
|
3782
|
-
const lastImport = lines.reduce((acc,
|
|
3797
|
+
const lastImport = lines.reduce((acc, l, i2) => /^\s*import\s/.test(l) ? i2 : acc, -1);
|
|
3783
3798
|
insertAt = lastImport + 1;
|
|
3784
3799
|
}
|
|
3785
3800
|
const head = lines.slice(0, insertAt).join("\n");
|
|
@@ -3938,9 +3953,9 @@ function visibleWidth(s) {
|
|
|
3938
3953
|
return s.replace(ANSI_RE2, "").length;
|
|
3939
3954
|
}
|
|
3940
3955
|
function box(lines, paint = (s) => s) {
|
|
3941
|
-
const width = lines.reduce((w,
|
|
3956
|
+
const width = lines.reduce((w, l) => Math.max(w, visibleWidth(l)), 0);
|
|
3942
3957
|
const side = paint("\u2502");
|
|
3943
|
-
const body = lines.map((
|
|
3958
|
+
const body = lines.map((l) => ` ${side} ${l}${" ".repeat(width - visibleWidth(l))} ${side}`);
|
|
3944
3959
|
return [
|
|
3945
3960
|
" " + paint(`\u256D${"\u2500".repeat(width + 4)}\u256E`),
|
|
3946
3961
|
...body,
|
|
@@ -4140,7 +4155,7 @@ function describe(from, to) {
|
|
|
4140
4155
|
const { add, remove } = packageDiff(from, to);
|
|
4141
4156
|
if (add.length) lines.push(`+ ${add.join(", ")}`);
|
|
4142
4157
|
if (remove.length) lines.push(`- ${remove.join(", ")}`);
|
|
4143
|
-
return lines.map((
|
|
4158
|
+
return lines.map((l) => dim(" ") + l).join("\n");
|
|
4144
4159
|
}
|
|
4145
4160
|
async function runConfigure(opts2) {
|
|
4146
4161
|
intro(accent(" toiljs configure "));
|
|
@@ -4380,10 +4395,10 @@ function scaffold(name, template, features, aiTools, images) {
|
|
|
4380
4395
|
...TEST_DEPENDENCIES,
|
|
4381
4396
|
"@types/react": "^19.3.0",
|
|
4382
4397
|
"@types/react-dom": "^19.3.0",
|
|
4383
|
-
oxlint: "^1.
|
|
4384
|
-
"oxlint-tsgolint": "^7.0.
|
|
4385
|
-
prettier: "^3.
|
|
4386
|
-
toilscript: ">=0.1.
|
|
4398
|
+
oxlint: "^1.94.0",
|
|
4399
|
+
"oxlint-tsgolint": "^7.0.2008",
|
|
4400
|
+
prettier: "^3.10.1",
|
|
4401
|
+
toilscript: ">=0.1.68",
|
|
4387
4402
|
typescript: "^7.0.2"
|
|
4388
4403
|
};
|
|
4389
4404
|
for (const dep of requiredPackages(features).sort()) {
|
|
@@ -4425,8 +4440,8 @@ function scaffold(name, template, features, aiTools, images) {
|
|
|
4425
4440
|
".prettierrc": '"toiljs/prettier"\n',
|
|
4426
4441
|
// Generated files don't need formatting. (toilscript server decorators like @main /
|
|
4427
4442
|
// @remote-on-functions are handled by the toiljs/prettier-plugin, so server/ is not ignored.)
|
|
4428
|
-
".prettierignore": "node_modules\nbuild\n.toil\ncoverage\n.vitest\nshared/server.ts\ntoil-env.d.ts\ntoil-routes.d.ts\nserver/_emails.ts\nserver/_ssr/\nserver/toil-server-env.d.ts\n",
|
|
4429
|
-
".gitignore": "node_modules\nbuild\n.toil\ncoverage\n.vitest\nshared/server.ts\ntoil-env.d.ts\ntoil-routes.d.ts\nserver/_ssr/\nhosts/*/_tmpl/\n# Local dev env vars/secrets (never commit)\n.env\n.env.secrets\n",
|
|
4443
|
+
".prettierignore": "node_modules\nbuild\n.toil\ncoverage\n.vitest\nshared/server.ts\ntoil-env.d.ts\ntoil-routes.d.ts\nserver/_emails.ts\nserver/_ssr/\nserver/toil-server-env.d.ts\nserver/toilscript.*.generated.d.ts\n",
|
|
4444
|
+
".gitignore": "node_modules\nbuild\n.toil\ncoverage\n.vitest\nshared/server.ts\ntoil-env.d.ts\ntoil-routes.d.ts\nserver/_ssr/\nserver/toilscript.*.generated.d.ts\nhosts/*/_tmpl/\n# Local dev env vars/secrets (never commit)\n.env\n.env.secrets\n",
|
|
4430
4445
|
// Use the native TypeScript 7 language server.
|
|
4431
4446
|
".vscode/settings.json": JSON.stringify(
|
|
4432
4447
|
{
|
|
@@ -4617,7 +4632,7 @@ function clientShell(name, features) {
|
|
|
4617
4632
|
return files;
|
|
4618
4633
|
}
|
|
4619
4634
|
function layoutTsx(name, nav) {
|
|
4620
|
-
const links = nav.map((
|
|
4635
|
+
const links = nav.map((l) => ` <Toil.Link href="${l.href}">${l.label}</Toil.Link>`).join("\n");
|
|
4621
4636
|
return `import { type ReactNode } from 'react';
|
|
4622
4637
|
|
|
4623
4638
|
export default function Layout({ children }: { children?: ReactNode }) {
|
|
@@ -4905,7 +4920,7 @@ async function runCreate(opts2) {
|
|
|
4905
4920
|
steps.push(`${accent("npm run test:browser")} ${dim("run the starter browser test")}`);
|
|
4906
4921
|
steps.push("Install the Oxc plugin for VS Code or WebStorm (README.md \u2192 Editor setup)");
|
|
4907
4922
|
steps.push("WebStorm: Settings \u2192 Tools \u2192 Oxlint \u2192 Enable type aware rules");
|
|
4908
|
-
note(steps.map((
|
|
4923
|
+
note(steps.map((l) => dim(" ") + l).join("\n"), "Next steps");
|
|
4909
4924
|
outro(`Created ${accent(path4.basename(name))}, happy building! ${dim("(v" + version() + ")")}`);
|
|
4910
4925
|
}
|
|
4911
4926
|
|
|
@@ -5067,11 +5082,11 @@ function parseVersion(v) {
|
|
|
5067
5082
|
return [Number(m2[1]), Number(m2[2] ?? 0), Number(m2[3] ?? 0)];
|
|
5068
5083
|
}
|
|
5069
5084
|
function satisfiesMin(version2, range) {
|
|
5070
|
-
const [a2, b,
|
|
5071
|
-
const [x,
|
|
5085
|
+
const [a2, b, c3] = parseVersion(version2);
|
|
5086
|
+
const [x, y, z] = parseVersion(range);
|
|
5072
5087
|
if (a2 !== x) return a2 > x;
|
|
5073
|
-
if (b !==
|
|
5074
|
-
return
|
|
5088
|
+
if (b !== y) return b > y;
|
|
5089
|
+
return c3 >= z;
|
|
5075
5090
|
}
|
|
5076
5091
|
function checkNode(current, requiredRange) {
|
|
5077
5092
|
const ok = satisfiesMin(current, requiredRange);
|
|
@@ -5363,7 +5378,7 @@ function checkWasmBuilt(exists) {
|
|
|
5363
5378
|
fix: "Run your server build (toilscript) before toiljs start."
|
|
5364
5379
|
};
|
|
5365
5380
|
}
|
|
5366
|
-
var RPC_TOILSCRIPT_MIN = "0.1.
|
|
5381
|
+
var RPC_TOILSCRIPT_MIN = "0.1.68";
|
|
5367
5382
|
function checkRpcWiring(f) {
|
|
5368
5383
|
const missing = [];
|
|
5369
5384
|
if (!f.toilscriptOk) missing.push(`toilscript >=${RPC_TOILSCRIPT_MIN}`);
|
|
@@ -6494,15 +6509,15 @@ function split(lst, le = false) {
|
|
|
6494
6509
|
let Ah = new Uint32Array(len);
|
|
6495
6510
|
let Al = new Uint32Array(len);
|
|
6496
6511
|
for (let i2 = 0; i2 < len; i2++) {
|
|
6497
|
-
const { h: h2, l
|
|
6498
|
-
[Ah[i2], Al[i2]] = [h2,
|
|
6512
|
+
const { h: h2, l } = fromBig(lst[i2], le);
|
|
6513
|
+
[Ah[i2], Al[i2]] = [h2, l];
|
|
6499
6514
|
}
|
|
6500
6515
|
return [Ah, Al];
|
|
6501
6516
|
}
|
|
6502
|
-
var rotlSH = (h2,
|
|
6503
|
-
var rotlSL = (h2,
|
|
6504
|
-
var rotlBH = (h2,
|
|
6505
|
-
var rotlBL = (h2,
|
|
6517
|
+
var rotlSH = (h2, l, s) => h2 << s | l >>> 32 - s;
|
|
6518
|
+
var rotlSL = (h2, l, s) => l << s | h2 >>> 32 - s;
|
|
6519
|
+
var rotlBH = (h2, l, s) => l << s - 32 | h2 >>> 64 - s;
|
|
6520
|
+
var rotlBL = (h2, l, s) => h2 << s - 32 | l >>> 64 - s;
|
|
6506
6521
|
|
|
6507
6522
|
// node_modules/@noble/hashes/utils.js
|
|
6508
6523
|
function isBytes(a2) {
|
|
@@ -6600,9 +6615,9 @@ var _0x71n = BigInt(113);
|
|
|
6600
6615
|
var SHA3_PI = [];
|
|
6601
6616
|
var SHA3_ROTL = [];
|
|
6602
6617
|
var _SHA3_IOTA = [];
|
|
6603
|
-
for (let round = 0, R2 = _1n, x = 1,
|
|
6604
|
-
[x,
|
|
6605
|
-
SHA3_PI.push(2 * (5 *
|
|
6618
|
+
for (let round = 0, R2 = _1n, x = 1, y = 0; round < 24; round++) {
|
|
6619
|
+
[x, y] = [y, (2 * x + 3 * y) % 5];
|
|
6620
|
+
SHA3_PI.push(2 * (5 * y + x));
|
|
6606
6621
|
SHA3_ROTL.push((round + 1) * (round + 2) / 2 % 64);
|
|
6607
6622
|
let t2 = _0n;
|
|
6608
6623
|
for (let j = 0; j < 7; j++) {
|
|
@@ -6615,8 +6630,8 @@ for (let round = 0, R2 = _1n, x = 1, y2 = 0; round < 24; round++) {
|
|
|
6615
6630
|
var IOTAS = split(_SHA3_IOTA, true);
|
|
6616
6631
|
var SHA3_IOTA_H = IOTAS[0];
|
|
6617
6632
|
var SHA3_IOTA_L = IOTAS[1];
|
|
6618
|
-
var rotlH = (h2,
|
|
6619
|
-
var rotlL = (h2,
|
|
6633
|
+
var rotlH = (h2, l, s) => s > 32 ? rotlBH(h2, l, s) : rotlSH(h2, l, s);
|
|
6634
|
+
var rotlL = (h2, l, s) => s > 32 ? rotlBL(h2, l, s) : rotlSL(h2, l, s);
|
|
6620
6635
|
function keccakP(s, rounds = 24) {
|
|
6621
6636
|
anumber(rounds, "rounds");
|
|
6622
6637
|
if (rounds < 1 || rounds > 24)
|
|
@@ -6632,9 +6647,9 @@ function keccakP(s, rounds = 24) {
|
|
|
6632
6647
|
const B1 = B[idx0 + 1];
|
|
6633
6648
|
const Th = rotlH(B0, B1, 1) ^ B[idx1];
|
|
6634
6649
|
const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];
|
|
6635
|
-
for (let
|
|
6636
|
-
s[x +
|
|
6637
|
-
s[x +
|
|
6650
|
+
for (let y = 0; y < 50; y += 10) {
|
|
6651
|
+
s[x + y] ^= Th;
|
|
6652
|
+
s[x + y + 1] ^= Tl;
|
|
6638
6653
|
}
|
|
6639
6654
|
}
|
|
6640
6655
|
let curH = s[2];
|
|
@@ -6649,18 +6664,18 @@ function keccakP(s, rounds = 24) {
|
|
|
6649
6664
|
s[PI] = Th;
|
|
6650
6665
|
s[PI + 1] = Tl;
|
|
6651
6666
|
}
|
|
6652
|
-
for (let
|
|
6653
|
-
const b0 = s[
|
|
6654
|
-
s[
|
|
6655
|
-
s[
|
|
6656
|
-
s[
|
|
6657
|
-
s[
|
|
6658
|
-
s[
|
|
6659
|
-
s[
|
|
6660
|
-
s[
|
|
6661
|
-
s[
|
|
6662
|
-
s[
|
|
6663
|
-
s[
|
|
6667
|
+
for (let y = 0; y < 50; y += 10) {
|
|
6668
|
+
const b0 = s[y], b1 = s[y + 1], b2 = s[y + 2], b3 = s[y + 3];
|
|
6669
|
+
s[y] ^= ~s[y + 2] & s[y + 4];
|
|
6670
|
+
s[y + 1] ^= ~s[y + 3] & s[y + 5];
|
|
6671
|
+
s[y + 2] ^= ~s[y + 4] & s[y + 6];
|
|
6672
|
+
s[y + 3] ^= ~s[y + 5] & s[y + 7];
|
|
6673
|
+
s[y + 4] ^= ~s[y + 6] & s[y + 8];
|
|
6674
|
+
s[y + 5] ^= ~s[y + 7] & s[y + 9];
|
|
6675
|
+
s[y + 6] ^= ~s[y + 8] & b0;
|
|
6676
|
+
s[y + 7] ^= ~s[y + 9] & b1;
|
|
6677
|
+
s[y + 8] ^= ~b0 & b2;
|
|
6678
|
+
s[y + 9] ^= ~b1 & b3;
|
|
6664
6679
|
}
|
|
6665
6680
|
s[0] ^= SHA3_IOTA_H[round];
|
|
6666
6681
|
s[1] ^= SHA3_IOTA_L[round];
|
|
@@ -6912,39 +6927,39 @@ function copyBytes(bytes) {
|
|
|
6912
6927
|
return Uint8Array.from(abytes(bytes));
|
|
6913
6928
|
}
|
|
6914
6929
|
function splitCoder(label, ...lengths) {
|
|
6915
|
-
const getLength = (
|
|
6930
|
+
const getLength = (c3) => typeof c3 === "number" ? c3 : c3.bytesLen;
|
|
6916
6931
|
const bytesLen = lengths.reduce((sum, a2) => sum + getLength(a2), 0);
|
|
6917
6932
|
return {
|
|
6918
6933
|
bytesLen,
|
|
6919
6934
|
encode: (bufs) => {
|
|
6920
6935
|
const res = new Uint8Array(bytesLen);
|
|
6921
6936
|
for (let i2 = 0, pos = 0; i2 < lengths.length; i2++) {
|
|
6922
|
-
const
|
|
6923
|
-
const
|
|
6924
|
-
const b = typeof
|
|
6925
|
-
abytes(b,
|
|
6937
|
+
const c3 = lengths[i2];
|
|
6938
|
+
const l = getLength(c3);
|
|
6939
|
+
const b = typeof c3 === "number" ? bufs[i2] : c3.encode(bufs[i2]);
|
|
6940
|
+
abytes(b, l, label);
|
|
6926
6941
|
res.set(b, pos);
|
|
6927
|
-
if (typeof
|
|
6942
|
+
if (typeof c3 !== "number")
|
|
6928
6943
|
b.fill(0);
|
|
6929
|
-
pos +=
|
|
6944
|
+
pos += l;
|
|
6930
6945
|
}
|
|
6931
6946
|
return res;
|
|
6932
6947
|
},
|
|
6933
6948
|
decode: (buf) => {
|
|
6934
6949
|
abytes(buf, bytesLen, label);
|
|
6935
6950
|
const res = [];
|
|
6936
|
-
for (const
|
|
6937
|
-
const
|
|
6938
|
-
const b = buf.subarray(0,
|
|
6939
|
-
res.push(typeof
|
|
6940
|
-
buf = buf.subarray(
|
|
6951
|
+
for (const c3 of lengths) {
|
|
6952
|
+
const l = getLength(c3);
|
|
6953
|
+
const b = buf.subarray(0, l);
|
|
6954
|
+
res.push(typeof c3 === "number" ? b : c3.decode(b));
|
|
6955
|
+
buf = buf.subarray(l);
|
|
6941
6956
|
}
|
|
6942
6957
|
return res;
|
|
6943
6958
|
}
|
|
6944
6959
|
};
|
|
6945
6960
|
}
|
|
6946
|
-
function vecCoder(
|
|
6947
|
-
const coder =
|
|
6961
|
+
function vecCoder(c3, vecLen) {
|
|
6962
|
+
const coder = c3;
|
|
6948
6963
|
const bytesLen = vecLen * coder.bytesLen;
|
|
6949
6964
|
return {
|
|
6950
6965
|
bytesLen,
|
|
@@ -7035,7 +7050,7 @@ var genCrystals = (opts2) => {
|
|
|
7035
7050
|
return r2;
|
|
7036
7051
|
}
|
|
7037
7052
|
};
|
|
7038
|
-
const bitsCoder = (d,
|
|
7053
|
+
const bitsCoder = (d, c3) => {
|
|
7039
7054
|
const mask = getMask(d);
|
|
7040
7055
|
const bytesLen = d * (N2 / 8);
|
|
7041
7056
|
return {
|
|
@@ -7044,7 +7059,7 @@ var genCrystals = (opts2) => {
|
|
|
7044
7059
|
const poly = poly_;
|
|
7045
7060
|
const r2 = new Uint8Array(bytesLen);
|
|
7046
7061
|
for (let i2 = 0, buf = 0, bufLen = 0, pos = 0; i2 < poly.length; i2++) {
|
|
7047
|
-
buf |= (
|
|
7062
|
+
buf |= (c3.encode(poly[i2]) & mask) << bufLen;
|
|
7048
7063
|
bufLen += d;
|
|
7049
7064
|
for (; bufLen >= 8; bufLen -= 8, buf >>= 8)
|
|
7050
7065
|
r2[pos++] = buf & getMask(bufLen);
|
|
@@ -7057,7 +7072,7 @@ var genCrystals = (opts2) => {
|
|
|
7057
7072
|
buf |= bytes[i2] << bufLen;
|
|
7058
7073
|
bufLen += 8;
|
|
7059
7074
|
for (; bufLen >= d; bufLen -= d, buf >>= d)
|
|
7060
|
-
r2[pos++] =
|
|
7075
|
+
r2[pos++] = c3.decode(buf & mask);
|
|
7061
7076
|
}
|
|
7062
7077
|
return r2;
|
|
7063
7078
|
}
|
|
@@ -7086,9 +7101,9 @@ var createXofShake = (shake) => (seed, blockLen) => {
|
|
|
7086
7101
|
let xofs = 0;
|
|
7087
7102
|
return {
|
|
7088
7103
|
stats: () => ({ calls, xofs }),
|
|
7089
|
-
get: (x,
|
|
7104
|
+
get: (x, y) => {
|
|
7090
7105
|
_seed[seedLen + 0] = x;
|
|
7091
|
-
_seed[seedLen + 1] =
|
|
7106
|
+
_seed[seedLen + 1] = y;
|
|
7092
7107
|
h2.destroy();
|
|
7093
7108
|
h2 = shake.create({}).update(_seed);
|
|
7094
7109
|
calls++;
|
|
@@ -8124,18 +8139,24 @@ function printHelp() {
|
|
|
8124
8139
|
cmd("--target <t>", "update: latest | minor | patch | newest | greatest"),
|
|
8125
8140
|
cmd("-v, --version", "print the toiljs version"),
|
|
8126
8141
|
"",
|
|
8127
|
-
dim("
|
|
8142
|
+
dim(" Commands other than help and version check npm for a newer toiljs."),
|
|
8128
8143
|
dim(" Set TOILJS_NO_UPDATE_CHECK=1 to opt out."),
|
|
8129
8144
|
""
|
|
8130
8145
|
].join("\n") + "\n"
|
|
8131
8146
|
);
|
|
8132
8147
|
}
|
|
8133
8148
|
async function main() {
|
|
8134
|
-
const
|
|
8149
|
+
const args = process.argv.slice(2);
|
|
8150
|
+
const [command, ...rest] = args[0] === "--" ? args.slice(1) : args;
|
|
8135
8151
|
if (command === "--version" || command === "-v") {
|
|
8136
8152
|
process.stdout.write(version() + "\n");
|
|
8137
8153
|
return;
|
|
8138
8154
|
}
|
|
8155
|
+
if (command === void 0 || command === "help" || command === "--help" || command === "-h") {
|
|
8156
|
+
banner();
|
|
8157
|
+
printHelp();
|
|
8158
|
+
return;
|
|
8159
|
+
}
|
|
8139
8160
|
const flags = parseArgs(rest);
|
|
8140
8161
|
await notifyIfOutdated(flags.root);
|
|
8141
8162
|
switch (command) {
|
|
@@ -8230,13 +8251,6 @@ async function main() {
|
|
|
8230
8251
|
runDb(action, fileArg, { root: flags.root });
|
|
8231
8252
|
break;
|
|
8232
8253
|
}
|
|
8233
|
-
case "help":
|
|
8234
|
-
case "--help":
|
|
8235
|
-
case "-h":
|
|
8236
|
-
case void 0:
|
|
8237
|
-
banner();
|
|
8238
|
-
printHelp();
|
|
8239
|
-
break;
|
|
8240
8254
|
default:
|
|
8241
8255
|
banner();
|
|
8242
8256
|
process.stdout.write(dim(` unknown command: ${command}`) + "\n\n");
|