varlock 0.9.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-FWJAZMC7.js → chunk-2ABRAKHE.js} +4 -4
- package/dist/{chunk-FWJAZMC7.js.map → chunk-2ABRAKHE.js.map} +1 -1
- package/dist/chunk-2EEXFFKL.js +149 -0
- package/dist/chunk-2EEXFFKL.js.map +1 -0
- package/dist/chunk-6DXWXIQV.js +1092 -0
- package/dist/chunk-6DXWXIQV.js.map +1 -0
- package/dist/{chunk-7P3SVUZ5.js → chunk-6JKWTWLB.js} +6 -6
- package/dist/{chunk-7P3SVUZ5.js.map → chunk-6JKWTWLB.js.map} +1 -1
- package/dist/chunk-7WB7HK5Z.js +21 -0
- package/dist/chunk-7WB7HK5Z.js.map +1 -0
- package/dist/chunk-AMNNQL7K.js +26 -0
- package/dist/chunk-AMNNQL7K.js.map +1 -0
- package/dist/{chunk-UG4RTI6V.js → chunk-CKWXLVMV.js} +5 -4
- package/dist/chunk-CKWXLVMV.js.map +1 -0
- package/dist/{chunk-253NGIPN.js → chunk-FTVXXJMG.js} +3 -3
- package/dist/{chunk-253NGIPN.js.map → chunk-FTVXXJMG.js.map} +1 -1
- package/dist/{chunk-QHIRGHGG.js → chunk-GBCB7Y3B.js} +3 -3
- package/dist/{chunk-QHIRGHGG.js.map → chunk-GBCB7Y3B.js.map} +1 -1
- package/dist/chunk-HDKXXS2X.js +1959 -0
- package/dist/chunk-HDKXXS2X.js.map +1 -0
- package/dist/chunk-JEZQ2DFL.js +198 -0
- package/dist/chunk-JEZQ2DFL.js.map +1 -0
- package/dist/{chunk-GH73MG2H.js → chunk-LOIJO4MO.js} +4 -4
- package/dist/{chunk-GH73MG2H.js.map → chunk-LOIJO4MO.js.map} +1 -1
- package/dist/{chunk-ZRHT6QHO.js → chunk-NJONB6CB.js} +5 -5
- package/dist/{chunk-ZRHT6QHO.js.map → chunk-NJONB6CB.js.map} +1 -1
- package/dist/{chunk-4VC5S7NB.js → chunk-QJ6NMN5H.js} +5 -5
- package/dist/{chunk-4VC5S7NB.js.map → chunk-QJ6NMN5H.js.map} +1 -1
- package/dist/{chunk-NWKETKFP.js → chunk-QNTIIXD5.js} +5 -5
- package/dist/{chunk-NWKETKFP.js.map → chunk-QNTIIXD5.js.map} +1 -1
- package/dist/{chunk-W3GUFLIV.js → chunk-U7RQPX5K.js} +349 -1130
- package/dist/chunk-U7RQPX5K.js.map +1 -0
- package/dist/{chunk-FSLTOPCT.js → chunk-UKFHSMKY.js} +4 -4
- package/dist/{chunk-FSLTOPCT.js.map → chunk-UKFHSMKY.js.map} +1 -1
- package/dist/chunk-V2MTE4J6.js +426 -0
- package/dist/chunk-V2MTE4J6.js.map +1 -0
- package/dist/{chunk-LOGMWG5X.js → chunk-VODQDF4Q.js} +5 -5
- package/dist/{chunk-LOGMWG5X.js.map → chunk-VODQDF4Q.js.map} +1 -1
- package/dist/{chunk-BFRONY2O.js → chunk-XADO6HQG.js} +6 -6
- package/dist/{chunk-BFRONY2O.js.map → chunk-XADO6HQG.js.map} +1 -1
- package/dist/{chunk-US7YQTJZ.js → chunk-XTOUG72X.js} +5 -5
- package/dist/{chunk-US7YQTJZ.js.map → chunk-XTOUG72X.js.map} +1 -1
- package/dist/cli/cli-executable.js +47 -31
- package/dist/cli/cli-executable.js.map +1 -1
- package/dist/config-item-2FQ6I6PO.js +7 -0
- package/dist/{config-item-IK3DUE5F.js.map → config-item-2FQ6I6PO.js.map} +1 -1
- package/dist/dist-WGIHRGBZ.js +4 -0
- package/dist/dist-WGIHRGBZ.js.map +1 -0
- package/dist/encrypt.command-K2SBJVQ5.js +14 -0
- package/dist/encrypt.command-K2SBJVQ5.js.map +1 -0
- package/dist/{env-graph-DaF8Aebq.d.ts → env-graph-CXTsI2Eg.d.ts} +3 -0
- package/dist/explain.command-E6MR72IY.js +15 -0
- package/dist/{explain.command-5DG3ACIH.js.map → explain.command-E6MR72IY.js.map} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/dist/init.command-TGDNXHJ7.js +13 -0
- package/dist/{init.command-EWCFF2D5.js.map → init.command-TGDNXHJ7.js.map} +1 -1
- package/dist/install-plugin.command-Z2S5DIFS.js +13 -0
- package/dist/{install-plugin.command-6ESRFNKI.js.map → install-plugin.command-Z2S5DIFS.js.map} +1 -1
- package/dist/load.command-K2IH3646.js +15 -0
- package/dist/{load.command-QNDTE2VK.js.map → load.command-K2IH3646.js.map} +1 -1
- package/dist/lock.command-GL4CLXED.js +7 -0
- package/dist/lock.command-GL4CLXED.js.map +1 -0
- package/dist/plugin-lib.d.ts +2 -2
- package/dist/printenv.command-34LGQT6W.js +15 -0
- package/dist/{printenv.command-SBCXAVQT.js.map → printenv.command-34LGQT6W.js.map} +1 -1
- package/dist/reveal.command-WOHYRSYO.js +15 -0
- package/dist/reveal.command-WOHYRSYO.js.map +1 -0
- package/dist/run.command-PPC2X2N7.js +16 -0
- package/dist/{run.command-64JM27VM.js.map → run.command-PPC2X2N7.js.map} +1 -1
- package/dist/runtime/env.d.ts +1 -1
- package/dist/scan.command-4DJBQEML.js +16 -0
- package/dist/{scan.command-YFM7VO2I.js.map → scan.command-4DJBQEML.js.map} +1 -1
- package/dist/telemetry.command-LIOCXWQK.js +13 -0
- package/dist/{telemetry.command-4AEVBTVE.js.map → telemetry.command-LIOCXWQK.js.map} +1 -1
- package/dist/typegen.command-COL35ALE.js +15 -0
- package/dist/{typegen.command-27OCEPZM.js.map → typegen.command-COL35ALE.js.map} +1 -1
- package/native-bins/darwin/VarlockEnclave.app/Contents/CodeResources +0 -0
- package/native-bins/darwin/VarlockEnclave.app/Contents/Info.plist +28 -0
- package/native-bins/darwin/VarlockEnclave.app/Contents/MacOS/varlock-local-encrypt +0 -0
- package/native-bins/darwin/VarlockEnclave.app/Contents/Resources/AppIcon.icns +0 -0
- package/native-bins/darwin/VarlockEnclave.app/Contents/Resources/varlock-menu-locked.pdf +0 -0
- package/native-bins/darwin/VarlockEnclave.app/Contents/Resources/varlock-menu-unlocked.pdf +0 -0
- package/native-bins/darwin/VarlockEnclave.app/Contents/_CodeSignature/CodeResources +150 -0
- package/native-bins/linux-arm64/varlock-local-encrypt +0 -0
- package/native-bins/linux-x64/varlock-local-encrypt +0 -0
- package/native-bins/win32-x64/varlock-local-encrypt.exe +0 -0
- package/package.json +9 -2
- package/dist/chunk-MIMMYDBC.js +0 -83
- package/dist/chunk-MIMMYDBC.js.map +0 -1
- package/dist/chunk-UG4RTI6V.js.map +0 -1
- package/dist/chunk-W3GUFLIV.js.map +0 -1
- package/dist/config-item-IK3DUE5F.js +0 -5
- package/dist/explain.command-5DG3ACIH.js +0 -12
- package/dist/init.command-EWCFF2D5.js +0 -11
- package/dist/install-plugin.command-6ESRFNKI.js +0 -11
- package/dist/load.command-QNDTE2VK.js +0 -12
- package/dist/printenv.command-SBCXAVQT.js +0 -12
- package/dist/run.command-64JM27VM.js +0 -13
- package/dist/scan.command-YFM7VO2I.js +0 -13
- package/dist/telemetry.command-4AEVBTVE.js +0 -11
- package/dist/typegen.command-27OCEPZM.js +0 -12
|
@@ -1,88 +1,89 @@
|
|
|
1
|
+
import { getUserVarlockDir } from './chunk-7WB7HK5Z.js';
|
|
2
|
+
import { q, Q, nt, it, rt } from './chunk-HDKXXS2X.js';
|
|
1
3
|
import { my_dash_default, SchemaError, createDebug, ResolutionError, CoercionError, ValidationError, activatePlugin, deactivatePlugin, VarlockError, EmptyRequiredValueError, ParseError, pluginProxy } from './chunk-2PFIYNFA.js';
|
|
2
4
|
import { __commonJS, __name, __toESM } from './chunk-6PEHRAEP.js';
|
|
3
5
|
import { exec, spawn } from 'child_process';
|
|
4
|
-
import { promisify
|
|
6
|
+
import { promisify } from 'util';
|
|
5
7
|
import fs3, { access } from 'fs/promises';
|
|
6
8
|
import os from 'os';
|
|
7
|
-
import path3
|
|
9
|
+
import path3 from 'path';
|
|
8
10
|
import crypto2 from 'crypto';
|
|
9
|
-
import fs, { accessSync
|
|
11
|
+
import fs, { accessSync } from 'fs';
|
|
10
12
|
import { createRequire } from 'module';
|
|
11
13
|
import { pathToFileURL } from 'url';
|
|
12
14
|
import https from 'https';
|
|
13
|
-
import P2, { stdin, stdout } from 'process';
|
|
14
|
-
import P from 'readline';
|
|
15
15
|
import { WriteStream } from 'tty';
|
|
16
|
+
import process2 from 'process';
|
|
16
17
|
import { AsyncLocalStorage } from 'async_hooks';
|
|
17
18
|
|
|
18
19
|
// ../../node_modules/.bun/ansis@4.2.0/node_modules/ansis/index.cjs
|
|
19
20
|
var require_ansis = __commonJS({
|
|
20
21
|
"../../node_modules/.bun/ansis@4.2.0/node_modules/ansis/index.cjs"(exports$1, module) {
|
|
21
22
|
var e;
|
|
22
|
-
var
|
|
23
|
+
var t;
|
|
23
24
|
var r;
|
|
24
25
|
var { defineProperty: l, setPrototypeOf: n, create: o, keys: s } = Object;
|
|
25
26
|
var i = "";
|
|
26
|
-
var { round:
|
|
27
|
-
var
|
|
28
|
-
let
|
|
27
|
+
var { round: c, max: a2 } = Math;
|
|
28
|
+
var p = /* @__PURE__ */ __name((e2) => {
|
|
29
|
+
let t2 = /([a-f\d]{3,6})/i.exec(e2)?.[1], r2 = t2?.length, l2 = parseInt(6 ^ r2 ? 3 ^ r2 ? "0" : t2[0] + t2[0] + t2[1] + t2[1] + t2[2] + t2[2] : t2, 16);
|
|
29
30
|
return [l2 >> 16 & 255, l2 >> 8 & 255, 255 & l2];
|
|
30
31
|
}, "p");
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
let
|
|
34
|
-
return 8 > e2 ? 30 + e2 : 16 > e2 ? e2 - 8 + 90 : (232 > e2 ? (o2 = (e2 -= 16) % 36,
|
|
32
|
+
var u = /* @__PURE__ */ __name((e2, t2, r2) => e2 ^ t2 || t2 ^ r2 ? 16 + 36 * c(e2 / 51) + 6 * c(t2 / 51) + c(r2 / 51) : 8 > e2 ? 16 : e2 > 248 ? 231 : c(24 * (e2 - 8) / 247) + 232, "u");
|
|
33
|
+
var d = /* @__PURE__ */ __name((e2) => {
|
|
34
|
+
let t2, r2, l2, n2, o2;
|
|
35
|
+
return 8 > e2 ? 30 + e2 : 16 > e2 ? e2 - 8 + 90 : (232 > e2 ? (o2 = (e2 -= 16) % 36, t2 = (e2 / 36 | 0) / 5, r2 = (o2 / 6 | 0) / 5, l2 = o2 % 6 / 5) : t2 = r2 = l2 = (10 * (e2 - 232) + 8) / 255, n2 = 2 * a2(t2, r2, l2), n2 ? 30 + (c(l2) << 2 | c(r2) << 1 | c(t2)) + (2 ^ n2 ? 0 : 60) : 30);
|
|
35
36
|
}, "d");
|
|
36
37
|
var f = (() => {
|
|
37
|
-
let r2 = /* @__PURE__ */ __name((e2) => o2.some(((
|
|
38
|
+
let r2 = /* @__PURE__ */ __name((e2) => o2.some(((t2) => e2.test(t2))), "r"), l2 = globalThis, n2 = l2.process ?? {}, o2 = n2.argv ?? [], i2 = n2.env ?? {}, c2 = -1;
|
|
38
39
|
try {
|
|
39
40
|
e = "," + s(i2).join(",");
|
|
40
41
|
} catch (e2) {
|
|
41
|
-
i2 = {},
|
|
42
|
+
i2 = {}, c2 = 0;
|
|
42
43
|
}
|
|
43
|
-
let a3 = "FORCE_COLOR",
|
|
44
|
-
return
|
|
44
|
+
let a3 = "FORCE_COLOR", p2 = { false: 0, 0: 0, 1: 1, 2: 2, 3: 3 }[i2[a3]] ?? -1, u2 = a3 in i2 && p2 || r2(/^--color=?(true|always)?$/);
|
|
45
|
+
return u2 && (c2 = p2), ~c2 || (c2 = ((r3, l3, n3) => (t = r3.TERM, { "24bit": 3, truecolor: 3, ansi256: 2, ansi: 1 }[r3.COLORTERM] || (r3.CI ? /,GITHUB/.test(e) ? 3 : 1 : l3 && "dumb" !== t ? n3 ? 3 : /-256/.test(t) ? 2 : 1 : 0)))(i2, !!i2.PM2_HOME || i2.NEXT_RUNTIME?.includes("edge") || !!n2.stdout?.isTTY, "win32" === n2.platform)), !p2 || i2.NO_COLOR || r2(/^--(no-color|color=(false|never))$/) ? 0 : l2.window?.chrome || u2 && !c2 ? 3 : c2;
|
|
45
46
|
})();
|
|
46
47
|
var g = { open: i, close: i };
|
|
47
48
|
var h = 39;
|
|
48
49
|
var b = 49;
|
|
49
|
-
var
|
|
50
|
-
var m = /* @__PURE__ */ __name(({ p: e2 }, { open:
|
|
50
|
+
var O = {};
|
|
51
|
+
var m = /* @__PURE__ */ __name(({ p: e2 }, { open: t2, close: l2 }) => {
|
|
51
52
|
let o2 = /* @__PURE__ */ __name((e3, ...r2) => {
|
|
52
53
|
if (!e3) {
|
|
53
|
-
if (
|
|
54
|
+
if (t2 && t2 === l2) return t2;
|
|
54
55
|
if ((e3 ?? i) === i) return i;
|
|
55
56
|
}
|
|
56
|
-
let n2, s3 = e3.raw ? String.raw({ raw: e3 }, ...r2) : i + e3,
|
|
57
|
-
if (s3.includes("\x1B")) for (;
|
|
58
|
-
let { open: e4, close:
|
|
59
|
-
if (r3) for (; ~(n2 = s3.indexOf(
|
|
57
|
+
let n2, s3 = e3.raw ? String.raw({ raw: e3 }, ...r2) : i + e3, c3 = o2.p, a3 = c3.o, p2 = c3.c;
|
|
58
|
+
if (s3.includes("\x1B")) for (; c3; c3 = c3.p) {
|
|
59
|
+
let { open: e4, close: t3 } = c3, r3 = t3.length, l3 = i, o3 = 0;
|
|
60
|
+
if (r3) for (; ~(n2 = s3.indexOf(t3, o3)); o3 = n2 + r3) l3 += s3.slice(o3, n2) + e4;
|
|
60
61
|
s3 = l3 + s3.slice(o3);
|
|
61
62
|
}
|
|
62
|
-
return a3 + (s3.includes("\n") ? s3.replace(/(\r?\n)/g,
|
|
63
|
-
}, "o"), s2 =
|
|
64
|
-
return e2 && (s2 = e2.o +
|
|
63
|
+
return a3 + (s3.includes("\n") ? s3.replace(/(\r?\n)/g, p2 + "$1" + a3) : s3) + p2;
|
|
64
|
+
}, "o"), s2 = t2, c2 = l2;
|
|
65
|
+
return e2 && (s2 = e2.o + t2, c2 = l2 + e2.c), n(o2, r), o2.p = { open: t2, close: l2, o: s2, c: c2, p: e2 }, o2.open = s2, o2.close = c2, o2;
|
|
65
66
|
}, "m");
|
|
66
|
-
var
|
|
67
|
-
let s2 = { Ansis: e2, level:
|
|
68
|
-
for (let
|
|
69
|
-
let r2 = e3[
|
|
70
|
-
"s" === l2 ? (
|
|
71
|
-
}
|
|
72
|
-
return r = o({},
|
|
73
|
-
} },
|
|
74
|
-
|
|
75
|
-
let n2 = r2 ? (...e4) => m(this,
|
|
67
|
+
var w = new (/* @__PURE__ */ __name(function e2(t2 = f) {
|
|
68
|
+
let s2 = { Ansis: e2, level: t2, isSupported: /* @__PURE__ */ __name(() => a3, "isSupported"), strip: /* @__PURE__ */ __name((e3) => e3.replace(/[][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, i), "strip"), extend(e3) {
|
|
69
|
+
for (let t3 in e3) {
|
|
70
|
+
let r2 = e3[t3], l2 = (typeof r2)[0];
|
|
71
|
+
"s" === l2 ? (c2(t3, T(...p(r2))), c2(_2(t3), v(...p(r2)))) : c2(t3, r2, "f" === l2);
|
|
72
|
+
}
|
|
73
|
+
return r = o({}, O), n(s2, r), s2;
|
|
74
|
+
} }, c2 = /* @__PURE__ */ __name((e3, t3, r2) => {
|
|
75
|
+
O[e3] = { get() {
|
|
76
|
+
let n2 = r2 ? (...e4) => m(this, t3(...e4)) : m(this, t3);
|
|
76
77
|
return l(this, e3, { value: n2 }), n2;
|
|
77
78
|
} };
|
|
78
|
-
}, "c"), a3 =
|
|
79
|
-
2 ===
|
|
80
|
-
let
|
|
81
|
-
return "black,red,green,yellow,blue,magenta,cyan,white,gray".split(",").map(((e3,
|
|
82
|
-
|
|
79
|
+
}, "c"), a3 = t2 > 0, w2 = /* @__PURE__ */ __name((e3, t3) => a3 ? { open: `\x1B[${e3}m`, close: `\x1B[${t3}m` } : g, "w"), y = /* @__PURE__ */ __name((e3) => (t3) => e3(...p(t3)), "y"), R = /* @__PURE__ */ __name((e3, t3) => (r2, l2, n2) => w2(`${e3}8;2;${r2};${l2};${n2}`, t3), "R"), $ = /* @__PURE__ */ __name((e3, t3) => (r2, l2, n2) => w2(((e4, t4, r3) => d(u(e4, t4, r3)))(r2, l2, n2) + e3, t3), "$"), x = /* @__PURE__ */ __name((e3) => (t3, r2, l2) => e3(u(t3, r2, l2)), "x"), T = R(3, h), v = R(4, b), C = /* @__PURE__ */ __name((e3) => w2("38;5;" + e3, h), "C"), E = /* @__PURE__ */ __name((e3) => w2("48;5;" + e3, b), "E");
|
|
80
|
+
2 === t2 ? (T = x(C), v = x(E)) : 1 === t2 && (T = $(0, h), v = $(10, b), C = /* @__PURE__ */ __name((e3) => w2(d(e3), h), "C"), E = /* @__PURE__ */ __name((e3) => w2(d(e3) + 10, b), "E"));
|
|
81
|
+
let M, I = { fg: C, bg: E, rgb: T, bgRgb: v, hex: y(T), bgHex: y(v), visible: g, reset: w2(0, 0), bold: w2(1, 22), dim: w2(2, 22), italic: w2(3, 23), underline: w2(4, 24), inverse: w2(7, 27), hidden: w2(8, 28), strikethrough: w2(9, 29) }, _2 = /* @__PURE__ */ __name((e3) => "bg" + e3[0].toUpperCase() + e3.slice(1), "_"), k = "Bright";
|
|
82
|
+
return "black,red,green,yellow,blue,magenta,cyan,white,gray".split(",").map(((e3, t3) => {
|
|
83
|
+
M = _2(e3), 8 > t3 ? (I[e3 + k] = w2(90 + t3, h), I[M + k] = w2(100 + t3, b)) : t3 = 60, I[e3] = w2(30 + t3, h), I[M] = w2(40 + t3, b);
|
|
83
84
|
})), s2.extend(I);
|
|
84
85
|
}, "e"))();
|
|
85
|
-
module.exports =
|
|
86
|
+
module.exports = w, w.default = w;
|
|
86
87
|
}
|
|
87
88
|
});
|
|
88
89
|
|
|
@@ -136,12 +137,12 @@ var require_re = __commonJS({
|
|
|
136
137
|
} = require_constants();
|
|
137
138
|
var debug2 = require_debug();
|
|
138
139
|
exports$1 = module.exports = {};
|
|
139
|
-
var
|
|
140
|
+
var re = exports$1.re = [];
|
|
140
141
|
var safeRe = exports$1.safeRe = [];
|
|
141
142
|
var src = exports$1.src = [];
|
|
142
143
|
var safeSrc = exports$1.safeSrc = [];
|
|
143
|
-
var
|
|
144
|
-
var
|
|
144
|
+
var t = exports$1.t = {};
|
|
145
|
+
var R = 0;
|
|
145
146
|
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
146
147
|
var safeRegexReplacements = [
|
|
147
148
|
["\\s", 1],
|
|
@@ -156,57 +157,57 @@ var require_re = __commonJS({
|
|
|
156
157
|
}, "makeSafeRegex");
|
|
157
158
|
var createToken = /* @__PURE__ */ __name((name, value, isGlobal) => {
|
|
158
159
|
const safe = makeSafeRegex(value);
|
|
159
|
-
const index =
|
|
160
|
+
const index = R++;
|
|
160
161
|
debug2(name, index, value);
|
|
161
|
-
|
|
162
|
+
t[name] = index;
|
|
162
163
|
src[index] = value;
|
|
163
164
|
safeSrc[index] = safe;
|
|
164
|
-
|
|
165
|
+
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
165
166
|
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
166
167
|
}, "createToken");
|
|
167
168
|
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
168
169
|
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
169
170
|
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
170
|
-
createToken("MAINVERSION", `(${src[
|
|
171
|
-
createToken("MAINVERSIONLOOSE", `(${src[
|
|
172
|
-
createToken("PRERELEASEIDENTIFIER", `(?:${src[
|
|
173
|
-
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[
|
|
174
|
-
createToken("PRERELEASE", `(?:-(${src[
|
|
175
|
-
createToken("PRERELEASELOOSE", `(?:-?(${src[
|
|
171
|
+
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
172
|
+
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
173
|
+
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
|
|
174
|
+
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
175
|
+
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
176
|
+
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
176
177
|
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
177
|
-
createToken("BUILD", `(?:\\+(${src[
|
|
178
|
-
createToken("FULLPLAIN", `v?${src[
|
|
179
|
-
createToken("FULL", `^${src[
|
|
180
|
-
createToken("LOOSEPLAIN", `[v=\\s]*${src[
|
|
181
|
-
createToken("LOOSE", `^${src[
|
|
178
|
+
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
179
|
+
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
180
|
+
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
181
|
+
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
182
|
+
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
182
183
|
createToken("GTLT", "((?:<|>)?=?)");
|
|
183
|
-
createToken("XRANGEIDENTIFIERLOOSE", `${src[
|
|
184
|
-
createToken("XRANGEIDENTIFIER", `${src[
|
|
185
|
-
createToken("XRANGEPLAIN", `[v=\\s]*(${src[
|
|
186
|
-
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[
|
|
187
|
-
createToken("XRANGE", `^${src[
|
|
188
|
-
createToken("XRANGELOOSE", `^${src[
|
|
184
|
+
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
185
|
+
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
186
|
+
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
187
|
+
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
188
|
+
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
189
|
+
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
189
190
|
createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
190
|
-
createToken("COERCE", `${src[
|
|
191
|
-
createToken("COERCEFULL", src[
|
|
192
|
-
createToken("COERCERTL", src[
|
|
193
|
-
createToken("COERCERTLFULL", src[
|
|
191
|
+
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
192
|
+
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
193
|
+
createToken("COERCERTL", src[t.COERCE], true);
|
|
194
|
+
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
194
195
|
createToken("LONETILDE", "(?:~>?)");
|
|
195
|
-
createToken("TILDETRIM", `(\\s*)${src[
|
|
196
|
+
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
196
197
|
exports$1.tildeTrimReplace = "$1~";
|
|
197
|
-
createToken("TILDE", `^${src[
|
|
198
|
-
createToken("TILDELOOSE", `^${src[
|
|
198
|
+
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
199
|
+
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
199
200
|
createToken("LONECARET", "(?:\\^)");
|
|
200
|
-
createToken("CARETTRIM", `(\\s*)${src[
|
|
201
|
+
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
201
202
|
exports$1.caretTrimReplace = "$1^";
|
|
202
|
-
createToken("CARET", `^${src[
|
|
203
|
-
createToken("CARETLOOSE", `^${src[
|
|
204
|
-
createToken("COMPARATORLOOSE", `^${src[
|
|
205
|
-
createToken("COMPARATOR", `^${src[
|
|
206
|
-
createToken("COMPARATORTRIM", `(\\s*)${src[
|
|
203
|
+
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
204
|
+
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
205
|
+
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
206
|
+
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
207
|
+
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
207
208
|
exports$1.comparatorTrimReplace = "$1$2$3";
|
|
208
|
-
createToken("HYPHENRANGE", `^\\s*(${src[
|
|
209
|
-
createToken("HYPHENRANGELOOSE", `^\\s*(${src[
|
|
209
|
+
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
210
|
+
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
210
211
|
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
211
212
|
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
212
213
|
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
@@ -260,7 +261,7 @@ var require_semver = __commonJS({
|
|
|
260
261
|
"../../node_modules/.bun/semver@7.7.4/node_modules/semver/classes/semver.js"(exports$1, module) {
|
|
261
262
|
var debug2 = require_debug();
|
|
262
263
|
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
263
|
-
var { safeRe:
|
|
264
|
+
var { safeRe: re, t } = require_re();
|
|
264
265
|
var parseOptions = require_parse_options();
|
|
265
266
|
var { compareIdentifiers } = require_identifiers();
|
|
266
267
|
var SemVer = class _SemVer {
|
|
@@ -287,7 +288,7 @@ var require_semver = __commonJS({
|
|
|
287
288
|
this.options = options;
|
|
288
289
|
this.loose = !!options.loose;
|
|
289
290
|
this.includePrerelease = !!options.includePrerelease;
|
|
290
|
-
const m = version.trim().match(options.loose ?
|
|
291
|
+
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
291
292
|
if (!m) {
|
|
292
293
|
throw new TypeError(`Invalid Version: ${version}`);
|
|
293
294
|
}
|
|
@@ -426,7 +427,7 @@ var require_semver = __commonJS({
|
|
|
426
427
|
throw new Error("invalid increment argument: identifier is empty");
|
|
427
428
|
}
|
|
428
429
|
if (identifier) {
|
|
429
|
-
const match = `-${identifier}`.match(this.options.loose ?
|
|
430
|
+
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
430
431
|
if (!match || match[1] !== identifier) {
|
|
431
432
|
throw new Error(`invalid identifier: ${identifier}`);
|
|
432
433
|
}
|
|
@@ -852,7 +853,7 @@ var require_coerce = __commonJS({
|
|
|
852
853
|
"../../node_modules/.bun/semver@7.7.4/node_modules/semver/functions/coerce.js"(exports$1, module) {
|
|
853
854
|
var SemVer = require_semver();
|
|
854
855
|
var parse = require_parse();
|
|
855
|
-
var { safeRe:
|
|
856
|
+
var { safeRe: re, t } = require_re();
|
|
856
857
|
var coerce = /* @__PURE__ */ __name((version, options) => {
|
|
857
858
|
if (version instanceof SemVer) {
|
|
858
859
|
return version;
|
|
@@ -866,9 +867,9 @@ var require_coerce = __commonJS({
|
|
|
866
867
|
options = options || {};
|
|
867
868
|
let match = null;
|
|
868
869
|
if (!options.rtl) {
|
|
869
|
-
match = version.match(options.includePrerelease ?
|
|
870
|
+
match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
870
871
|
} else {
|
|
871
|
-
const coerceRtlRegex = options.includePrerelease ?
|
|
872
|
+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
872
873
|
let next;
|
|
873
874
|
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
874
875
|
if (!match || next.index + next[0].length !== match.index + match[0].length) {
|
|
@@ -959,19 +960,19 @@ var require_range = __commonJS({
|
|
|
959
960
|
this.loose = !!options.loose;
|
|
960
961
|
this.includePrerelease = !!options.includePrerelease;
|
|
961
962
|
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
962
|
-
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((
|
|
963
|
+
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
963
964
|
if (!this.set.length) {
|
|
964
965
|
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
965
966
|
}
|
|
966
967
|
if (this.set.length > 1) {
|
|
967
968
|
const first = this.set[0];
|
|
968
|
-
this.set = this.set.filter((
|
|
969
|
+
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
969
970
|
if (this.set.length === 0) {
|
|
970
971
|
this.set = [first];
|
|
971
972
|
} else if (this.set.length > 1) {
|
|
972
|
-
for (const
|
|
973
|
-
if (
|
|
974
|
-
this.set = [
|
|
973
|
+
for (const c of this.set) {
|
|
974
|
+
if (c.length === 1 && isAny(c[0])) {
|
|
975
|
+
this.set = [c];
|
|
975
976
|
break;
|
|
976
977
|
}
|
|
977
978
|
}
|
|
@@ -1011,20 +1012,20 @@ var require_range = __commonJS({
|
|
|
1011
1012
|
return cached;
|
|
1012
1013
|
}
|
|
1013
1014
|
const loose = this.options.loose;
|
|
1014
|
-
const hr = loose ?
|
|
1015
|
+
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
1015
1016
|
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
1016
1017
|
debug2("hyphen replace", range);
|
|
1017
|
-
range = range.replace(
|
|
1018
|
+
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
1018
1019
|
debug2("comparator trim", range);
|
|
1019
|
-
range = range.replace(
|
|
1020
|
+
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
1020
1021
|
debug2("tilde trim", range);
|
|
1021
|
-
range = range.replace(
|
|
1022
|
+
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
1022
1023
|
debug2("caret trim", range);
|
|
1023
1024
|
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
1024
1025
|
if (loose) {
|
|
1025
1026
|
rangeList = rangeList.filter((comp) => {
|
|
1026
1027
|
debug2("loose invalid filter", comp, this.options);
|
|
1027
|
-
return !!comp.match(
|
|
1028
|
+
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
1028
1029
|
});
|
|
1029
1030
|
}
|
|
1030
1031
|
debug2("range list", rangeList);
|
|
@@ -1085,15 +1086,15 @@ var require_range = __commonJS({
|
|
|
1085
1086
|
var debug2 = require_debug();
|
|
1086
1087
|
var SemVer = require_semver();
|
|
1087
1088
|
var {
|
|
1088
|
-
safeRe:
|
|
1089
|
-
t
|
|
1089
|
+
safeRe: re,
|
|
1090
|
+
t,
|
|
1090
1091
|
comparatorTrimReplace,
|
|
1091
1092
|
tildeTrimReplace,
|
|
1092
1093
|
caretTrimReplace
|
|
1093
1094
|
} = require_re();
|
|
1094
1095
|
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
1095
|
-
var isNullSet = /* @__PURE__ */ __name((
|
|
1096
|
-
var isAny = /* @__PURE__ */ __name((
|
|
1096
|
+
var isNullSet = /* @__PURE__ */ __name((c) => c.value === "<0.0.0-0", "isNullSet");
|
|
1097
|
+
var isAny = /* @__PURE__ */ __name((c) => c.value === "", "isAny");
|
|
1097
1098
|
var isSatisfiable = /* @__PURE__ */ __name((comparators, options) => {
|
|
1098
1099
|
let result = true;
|
|
1099
1100
|
const remainingComparators = comparators.slice();
|
|
@@ -1107,7 +1108,7 @@ var require_range = __commonJS({
|
|
|
1107
1108
|
return result;
|
|
1108
1109
|
}, "isSatisfiable");
|
|
1109
1110
|
var parseComparator = /* @__PURE__ */ __name((comp, options) => {
|
|
1110
|
-
comp = comp.replace(
|
|
1111
|
+
comp = comp.replace(re[t.BUILD], "");
|
|
1111
1112
|
debug2("comp", comp, options);
|
|
1112
1113
|
comp = replaceCarets(comp, options);
|
|
1113
1114
|
debug2("caret", comp);
|
|
@@ -1121,70 +1122,70 @@ var require_range = __commonJS({
|
|
|
1121
1122
|
}, "parseComparator");
|
|
1122
1123
|
var isX = /* @__PURE__ */ __name((id) => !id || id.toLowerCase() === "x" || id === "*", "isX");
|
|
1123
1124
|
var replaceTildes = /* @__PURE__ */ __name((comp, options) => {
|
|
1124
|
-
return comp.trim().split(/\s+/).map((
|
|
1125
|
+
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
1125
1126
|
}, "replaceTildes");
|
|
1126
1127
|
var replaceTilde = /* @__PURE__ */ __name((comp, options) => {
|
|
1127
|
-
const r = options.loose ?
|
|
1128
|
-
return comp.replace(r, (
|
|
1129
|
-
debug2("tilde", comp,
|
|
1128
|
+
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
1129
|
+
return comp.replace(r, (_2, M, m, p, pr) => {
|
|
1130
|
+
debug2("tilde", comp, _2, M, m, p, pr);
|
|
1130
1131
|
let ret;
|
|
1131
|
-
if (isX(
|
|
1132
|
+
if (isX(M)) {
|
|
1132
1133
|
ret = "";
|
|
1133
1134
|
} else if (isX(m)) {
|
|
1134
|
-
ret = `>=${
|
|
1135
|
-
} else if (isX(
|
|
1136
|
-
ret = `>=${
|
|
1135
|
+
ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
1136
|
+
} else if (isX(p)) {
|
|
1137
|
+
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
1137
1138
|
} else if (pr) {
|
|
1138
1139
|
debug2("replaceTilde pr", pr);
|
|
1139
|
-
ret = `>=${
|
|
1140
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1140
1141
|
} else {
|
|
1141
|
-
ret = `>=${
|
|
1142
|
+
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
1142
1143
|
}
|
|
1143
1144
|
debug2("tilde return", ret);
|
|
1144
1145
|
return ret;
|
|
1145
1146
|
});
|
|
1146
1147
|
}, "replaceTilde");
|
|
1147
1148
|
var replaceCarets = /* @__PURE__ */ __name((comp, options) => {
|
|
1148
|
-
return comp.trim().split(/\s+/).map((
|
|
1149
|
+
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
1149
1150
|
}, "replaceCarets");
|
|
1150
1151
|
var replaceCaret = /* @__PURE__ */ __name((comp, options) => {
|
|
1151
1152
|
debug2("caret", comp, options);
|
|
1152
|
-
const r = options.loose ?
|
|
1153
|
-
const
|
|
1154
|
-
return comp.replace(r, (
|
|
1155
|
-
debug2("caret", comp,
|
|
1153
|
+
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
1154
|
+
const z = options.includePrerelease ? "-0" : "";
|
|
1155
|
+
return comp.replace(r, (_2, M, m, p, pr) => {
|
|
1156
|
+
debug2("caret", comp, _2, M, m, p, pr);
|
|
1156
1157
|
let ret;
|
|
1157
|
-
if (isX(
|
|
1158
|
+
if (isX(M)) {
|
|
1158
1159
|
ret = "";
|
|
1159
1160
|
} else if (isX(m)) {
|
|
1160
|
-
ret = `>=${
|
|
1161
|
-
} else if (isX(
|
|
1162
|
-
if (
|
|
1163
|
-
ret = `>=${
|
|
1161
|
+
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
1162
|
+
} else if (isX(p)) {
|
|
1163
|
+
if (M === "0") {
|
|
1164
|
+
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
1164
1165
|
} else {
|
|
1165
|
-
ret = `>=${
|
|
1166
|
+
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
1166
1167
|
}
|
|
1167
1168
|
} else if (pr) {
|
|
1168
1169
|
debug2("replaceCaret pr", pr);
|
|
1169
|
-
if (
|
|
1170
|
+
if (M === "0") {
|
|
1170
1171
|
if (m === "0") {
|
|
1171
|
-
ret = `>=${
|
|
1172
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
1172
1173
|
} else {
|
|
1173
|
-
ret = `>=${
|
|
1174
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1174
1175
|
}
|
|
1175
1176
|
} else {
|
|
1176
|
-
ret = `>=${
|
|
1177
|
+
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
1177
1178
|
}
|
|
1178
1179
|
} else {
|
|
1179
1180
|
debug2("no pr");
|
|
1180
|
-
if (
|
|
1181
|
+
if (M === "0") {
|
|
1181
1182
|
if (m === "0") {
|
|
1182
|
-
ret = `>=${
|
|
1183
|
+
ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
|
1183
1184
|
} else {
|
|
1184
|
-
ret = `>=${
|
|
1185
|
+
ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
|
|
1185
1186
|
}
|
|
1186
1187
|
} else {
|
|
1187
|
-
ret = `>=${
|
|
1188
|
+
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
1188
1189
|
}
|
|
1189
1190
|
}
|
|
1190
1191
|
debug2("caret return", ret);
|
|
@@ -1193,16 +1194,16 @@ var require_range = __commonJS({
|
|
|
1193
1194
|
}, "replaceCaret");
|
|
1194
1195
|
var replaceXRanges = /* @__PURE__ */ __name((comp, options) => {
|
|
1195
1196
|
debug2("replaceXRanges", comp, options);
|
|
1196
|
-
return comp.split(/\s+/).map((
|
|
1197
|
+
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
1197
1198
|
}, "replaceXRanges");
|
|
1198
1199
|
var replaceXRange = /* @__PURE__ */ __name((comp, options) => {
|
|
1199
1200
|
comp = comp.trim();
|
|
1200
|
-
const r = options.loose ?
|
|
1201
|
-
return comp.replace(r, (ret, gtlt,
|
|
1202
|
-
debug2("xRange", comp, ret, gtlt,
|
|
1203
|
-
const xM = isX(
|
|
1201
|
+
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
1202
|
+
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
1203
|
+
debug2("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
1204
|
+
const xM = isX(M);
|
|
1204
1205
|
const xm = xM || isX(m);
|
|
1205
|
-
const xp = xm || isX(
|
|
1206
|
+
const xp = xm || isX(p);
|
|
1206
1207
|
const anyX = xp;
|
|
1207
1208
|
if (gtlt === "=" && anyX) {
|
|
1208
1209
|
gtlt = "";
|
|
@@ -1218,21 +1219,21 @@ var require_range = __commonJS({
|
|
|
1218
1219
|
if (xm) {
|
|
1219
1220
|
m = 0;
|
|
1220
1221
|
}
|
|
1221
|
-
|
|
1222
|
+
p = 0;
|
|
1222
1223
|
if (gtlt === ">") {
|
|
1223
1224
|
gtlt = ">=";
|
|
1224
1225
|
if (xm) {
|
|
1225
|
-
|
|
1226
|
+
M = +M + 1;
|
|
1226
1227
|
m = 0;
|
|
1227
|
-
|
|
1228
|
+
p = 0;
|
|
1228
1229
|
} else {
|
|
1229
1230
|
m = +m + 1;
|
|
1230
|
-
|
|
1231
|
+
p = 0;
|
|
1231
1232
|
}
|
|
1232
1233
|
} else if (gtlt === "<=") {
|
|
1233
1234
|
gtlt = "<";
|
|
1234
1235
|
if (xm) {
|
|
1235
|
-
|
|
1236
|
+
M = +M + 1;
|
|
1236
1237
|
} else {
|
|
1237
1238
|
m = +m + 1;
|
|
1238
1239
|
}
|
|
@@ -1240,11 +1241,11 @@ var require_range = __commonJS({
|
|
|
1240
1241
|
if (gtlt === "<") {
|
|
1241
1242
|
pr = "-0";
|
|
1242
1243
|
}
|
|
1243
|
-
ret = `${gtlt +
|
|
1244
|
+
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
1244
1245
|
} else if (xm) {
|
|
1245
|
-
ret = `>=${
|
|
1246
|
+
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
1246
1247
|
} else if (xp) {
|
|
1247
|
-
ret = `>=${
|
|
1248
|
+
ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
1248
1249
|
}
|
|
1249
1250
|
debug2("xRange return", ret);
|
|
1250
1251
|
return ret;
|
|
@@ -1252,11 +1253,11 @@ var require_range = __commonJS({
|
|
|
1252
1253
|
}, "replaceXRange");
|
|
1253
1254
|
var replaceStars = /* @__PURE__ */ __name((comp, options) => {
|
|
1254
1255
|
debug2("replaceStars", comp, options);
|
|
1255
|
-
return comp.trim().replace(
|
|
1256
|
+
return comp.trim().replace(re[t.STAR], "");
|
|
1256
1257
|
}, "replaceStars");
|
|
1257
1258
|
var replaceGTE0 = /* @__PURE__ */ __name((comp, options) => {
|
|
1258
1259
|
debug2("replaceGTE0", comp, options);
|
|
1259
|
-
return comp.trim().replace(
|
|
1260
|
+
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
1260
1261
|
}, "replaceGTE0");
|
|
1261
1262
|
var hyphenReplace = /* @__PURE__ */ __name((incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
1262
1263
|
if (isX(fM)) {
|
|
@@ -1344,7 +1345,7 @@ var require_comparator = __commonJS({
|
|
|
1344
1345
|
debug2("comp", this);
|
|
1345
1346
|
}
|
|
1346
1347
|
parse(comp) {
|
|
1347
|
-
const r = this.options.loose ?
|
|
1348
|
+
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
1348
1349
|
const m = comp.match(r);
|
|
1349
1350
|
if (!m) {
|
|
1350
1351
|
throw new TypeError(`Invalid comparator: ${comp}`);
|
|
@@ -1418,7 +1419,7 @@ var require_comparator = __commonJS({
|
|
|
1418
1419
|
};
|
|
1419
1420
|
module.exports = Comparator;
|
|
1420
1421
|
var parseOptions = require_parse_options();
|
|
1421
|
-
var { safeRe:
|
|
1422
|
+
var { safeRe: re, t } = require_re();
|
|
1422
1423
|
var cmp = require_cmp();
|
|
1423
1424
|
var debug2 = require_debug();
|
|
1424
1425
|
var SemVer = require_semver();
|
|
@@ -1446,7 +1447,7 @@ var require_satisfies = __commonJS({
|
|
|
1446
1447
|
var require_to_comparators = __commonJS({
|
|
1447
1448
|
"../../node_modules/.bun/semver@7.7.4/node_modules/semver/ranges/to-comparators.js"(exports$1, module) {
|
|
1448
1449
|
var Range = require_range();
|
|
1449
|
-
var toComparators = /* @__PURE__ */ __name((range, options) => new Range(range, options).set.map((comp) => comp.map((
|
|
1450
|
+
var toComparators = /* @__PURE__ */ __name((range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" ")), "toComparators");
|
|
1450
1451
|
module.exports = toComparators;
|
|
1451
1452
|
}
|
|
1452
1453
|
});
|
|
@@ -1781,13 +1782,13 @@ var require_subset = __commonJS({
|
|
|
1781
1782
|
}
|
|
1782
1783
|
const eqSet = /* @__PURE__ */ new Set();
|
|
1783
1784
|
let gt, lt;
|
|
1784
|
-
for (const
|
|
1785
|
-
if (
|
|
1786
|
-
gt = higherGT(gt,
|
|
1787
|
-
} else if (
|
|
1788
|
-
lt = lowerLT(lt,
|
|
1785
|
+
for (const c of sub) {
|
|
1786
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
1787
|
+
gt = higherGT(gt, c, options);
|
|
1788
|
+
} else if (c.operator === "<" || c.operator === "<=") {
|
|
1789
|
+
lt = lowerLT(lt, c, options);
|
|
1789
1790
|
} else {
|
|
1790
|
-
eqSet.add(
|
|
1791
|
+
eqSet.add(c.semver);
|
|
1791
1792
|
}
|
|
1792
1793
|
}
|
|
1793
1794
|
if (eqSet.size > 1) {
|
|
@@ -1809,8 +1810,8 @@ var require_subset = __commonJS({
|
|
|
1809
1810
|
if (lt && !satisfies(eq, String(lt), options)) {
|
|
1810
1811
|
return null;
|
|
1811
1812
|
}
|
|
1812
|
-
for (const
|
|
1813
|
-
if (!satisfies(eq, String(
|
|
1813
|
+
for (const c of dom) {
|
|
1814
|
+
if (!satisfies(eq, String(c), options)) {
|
|
1814
1815
|
return false;
|
|
1815
1816
|
}
|
|
1816
1817
|
}
|
|
@@ -1823,40 +1824,40 @@ var require_subset = __commonJS({
|
|
|
1823
1824
|
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
|
|
1824
1825
|
needDomLTPre = false;
|
|
1825
1826
|
}
|
|
1826
|
-
for (const
|
|
1827
|
-
hasDomGT = hasDomGT ||
|
|
1828
|
-
hasDomLT = hasDomLT ||
|
|
1827
|
+
for (const c of dom) {
|
|
1828
|
+
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
1829
|
+
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
1829
1830
|
if (gt) {
|
|
1830
1831
|
if (needDomGTPre) {
|
|
1831
|
-
if (
|
|
1832
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
|
|
1832
1833
|
needDomGTPre = false;
|
|
1833
1834
|
}
|
|
1834
1835
|
}
|
|
1835
|
-
if (
|
|
1836
|
-
higher = higherGT(gt,
|
|
1837
|
-
if (higher ===
|
|
1836
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
1837
|
+
higher = higherGT(gt, c, options);
|
|
1838
|
+
if (higher === c && higher !== gt) {
|
|
1838
1839
|
return false;
|
|
1839
1840
|
}
|
|
1840
|
-
} else if (gt.operator === ">=" && !satisfies(gt.semver, String(
|
|
1841
|
+
} else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) {
|
|
1841
1842
|
return false;
|
|
1842
1843
|
}
|
|
1843
1844
|
}
|
|
1844
1845
|
if (lt) {
|
|
1845
1846
|
if (needDomLTPre) {
|
|
1846
|
-
if (
|
|
1847
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
|
|
1847
1848
|
needDomLTPre = false;
|
|
1848
1849
|
}
|
|
1849
1850
|
}
|
|
1850
|
-
if (
|
|
1851
|
-
lower = lowerLT(lt,
|
|
1852
|
-
if (lower ===
|
|
1851
|
+
if (c.operator === "<" || c.operator === "<=") {
|
|
1852
|
+
lower = lowerLT(lt, c, options);
|
|
1853
|
+
if (lower === c && lower !== lt) {
|
|
1853
1854
|
return false;
|
|
1854
1855
|
}
|
|
1855
|
-
} else if (lt.operator === "<=" && !satisfies(lt.semver, String(
|
|
1856
|
+
} else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) {
|
|
1856
1857
|
return false;
|
|
1857
1858
|
}
|
|
1858
1859
|
}
|
|
1859
|
-
if (!
|
|
1860
|
+
if (!c.operator && (lt || gt) && gtltComp !== 0) {
|
|
1860
1861
|
return false;
|
|
1861
1862
|
}
|
|
1862
1863
|
}
|
|
@@ -1983,61 +1984,6 @@ var require_semver2 = __commonJS({
|
|
|
1983
1984
|
}
|
|
1984
1985
|
});
|
|
1985
1986
|
|
|
1986
|
-
// ../../node_modules/.bun/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
|
|
1987
|
-
var require_src = __commonJS({
|
|
1988
|
-
"../../node_modules/.bun/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports$1, module) {
|
|
1989
|
-
var ESC2 = "\x1B";
|
|
1990
|
-
var CSI2 = `${ESC2}[`;
|
|
1991
|
-
var beep = "\x07";
|
|
1992
|
-
var cursor = {
|
|
1993
|
-
to(x, y2) {
|
|
1994
|
-
if (!y2) return `${CSI2}${x + 1}G`;
|
|
1995
|
-
return `${CSI2}${y2 + 1};${x + 1}H`;
|
|
1996
|
-
},
|
|
1997
|
-
move(x, y2) {
|
|
1998
|
-
let ret = "";
|
|
1999
|
-
if (x < 0) ret += `${CSI2}${-x}D`;
|
|
2000
|
-
else if (x > 0) ret += `${CSI2}${x}C`;
|
|
2001
|
-
if (y2 < 0) ret += `${CSI2}${-y2}A`;
|
|
2002
|
-
else if (y2 > 0) ret += `${CSI2}${y2}B`;
|
|
2003
|
-
return ret;
|
|
2004
|
-
},
|
|
2005
|
-
up: /* @__PURE__ */ __name((count = 1) => `${CSI2}${count}A`, "up"),
|
|
2006
|
-
down: /* @__PURE__ */ __name((count = 1) => `${CSI2}${count}B`, "down"),
|
|
2007
|
-
forward: /* @__PURE__ */ __name((count = 1) => `${CSI2}${count}C`, "forward"),
|
|
2008
|
-
backward: /* @__PURE__ */ __name((count = 1) => `${CSI2}${count}D`, "backward"),
|
|
2009
|
-
nextLine: /* @__PURE__ */ __name((count = 1) => `${CSI2}E`.repeat(count), "nextLine"),
|
|
2010
|
-
prevLine: /* @__PURE__ */ __name((count = 1) => `${CSI2}F`.repeat(count), "prevLine"),
|
|
2011
|
-
left: `${CSI2}G`,
|
|
2012
|
-
hide: `${CSI2}?25l`,
|
|
2013
|
-
show: `${CSI2}?25h`,
|
|
2014
|
-
save: `${ESC2}7`,
|
|
2015
|
-
restore: `${ESC2}8`
|
|
2016
|
-
};
|
|
2017
|
-
var scroll = {
|
|
2018
|
-
up: /* @__PURE__ */ __name((count = 1) => `${CSI2}S`.repeat(count), "up"),
|
|
2019
|
-
down: /* @__PURE__ */ __name((count = 1) => `${CSI2}T`.repeat(count), "down")
|
|
2020
|
-
};
|
|
2021
|
-
var erase = {
|
|
2022
|
-
screen: `${CSI2}2J`,
|
|
2023
|
-
up: /* @__PURE__ */ __name((count = 1) => `${CSI2}1J`.repeat(count), "up"),
|
|
2024
|
-
down: /* @__PURE__ */ __name((count = 1) => `${CSI2}J`.repeat(count), "down"),
|
|
2025
|
-
line: `${CSI2}2K`,
|
|
2026
|
-
lineEnd: `${CSI2}K`,
|
|
2027
|
-
lineStart: `${CSI2}1K`,
|
|
2028
|
-
lines(count) {
|
|
2029
|
-
let clear = "";
|
|
2030
|
-
for (let i = 0; i < count; i++)
|
|
2031
|
-
clear += this.line + (i < count - 1 ? cursor.up() : "");
|
|
2032
|
-
if (count)
|
|
2033
|
-
clear += cursor.left;
|
|
2034
|
-
return clear;
|
|
2035
|
-
}
|
|
2036
|
-
};
|
|
2037
|
-
module.exports = { cursor, scroll, erase, beep };
|
|
2038
|
-
}
|
|
2039
|
-
});
|
|
2040
|
-
|
|
2041
1987
|
// ../env-spec-parser/dist/chunk-JOUVRUWD.mjs
|
|
2042
1988
|
var __defProp = Object.defineProperty;
|
|
2043
1989
|
var __name2 = /* @__PURE__ */ __name((target, value) => __defProp(target, "name", { value, configurable: true }), "__name");
|
|
@@ -2284,7 +2230,7 @@ var ParsedEnvSpecDecoratorComment = class {
|
|
|
2284
2230
|
toString() {
|
|
2285
2231
|
let s = "#";
|
|
2286
2232
|
s += this.data.leadingSpace || "";
|
|
2287
|
-
s += this.data.decorators.map((
|
|
2233
|
+
s += this.data.decorators.map((d) => d.toString()).join(" ");
|
|
2288
2234
|
if (this.data.postComment) s += ` ${this.data.postComment.toString()}`;
|
|
2289
2235
|
return s;
|
|
2290
2236
|
}
|
|
@@ -2766,9 +2712,9 @@ var peg$SyntaxError = class extends SyntaxError {
|
|
|
2766
2712
|
let str = "Error: " + this.message;
|
|
2767
2713
|
if (this.location) {
|
|
2768
2714
|
let src = null;
|
|
2769
|
-
const
|
|
2770
|
-
if (
|
|
2771
|
-
src =
|
|
2715
|
+
const st = sources.find((s2) => s2.source === this.location.source);
|
|
2716
|
+
if (st) {
|
|
2717
|
+
src = st.text.split(/\r\n|\n|\r/g);
|
|
2772
2718
|
}
|
|
2773
2719
|
const s = this.location.start;
|
|
2774
2720
|
const offset_s = this.location.source && typeof this.location.source.offset === "function" ? this.location.source.offset(s) : s;
|
|
@@ -2840,14 +2786,14 @@ var peg$SyntaxError = class extends SyntaxError {
|
|
|
2840
2786
|
const descriptions = expected2.map(describeExpectation);
|
|
2841
2787
|
descriptions.sort();
|
|
2842
2788
|
if (descriptions.length > 0) {
|
|
2843
|
-
let
|
|
2789
|
+
let j = 1;
|
|
2844
2790
|
for (let i = 1; i < descriptions.length; i++) {
|
|
2845
2791
|
if (descriptions[i - 1] !== descriptions[i]) {
|
|
2846
|
-
descriptions[
|
|
2847
|
-
|
|
2792
|
+
descriptions[j] = descriptions[i];
|
|
2793
|
+
j++;
|
|
2848
2794
|
}
|
|
2849
2795
|
}
|
|
2850
|
-
descriptions.length =
|
|
2796
|
+
descriptions.length = j;
|
|
2851
2797
|
}
|
|
2852
2798
|
switch (descriptions.length) {
|
|
2853
2799
|
case 1:
|
|
@@ -3208,30 +3154,30 @@ function peg$parse(input, options) {
|
|
|
3208
3154
|
__name2(peg$otherExpectation, "peg$otherExpectation");
|
|
3209
3155
|
function peg$computePosDetails(pos) {
|
|
3210
3156
|
let details = peg$posDetailsCache[pos];
|
|
3211
|
-
let
|
|
3157
|
+
let p;
|
|
3212
3158
|
if (details) {
|
|
3213
3159
|
return details;
|
|
3214
3160
|
} else {
|
|
3215
3161
|
if (pos >= peg$posDetailsCache.length) {
|
|
3216
|
-
|
|
3162
|
+
p = peg$posDetailsCache.length - 1;
|
|
3217
3163
|
} else {
|
|
3218
|
-
|
|
3219
|
-
while (!peg$posDetailsCache[--
|
|
3164
|
+
p = pos;
|
|
3165
|
+
while (!peg$posDetailsCache[--p]) {
|
|
3220
3166
|
}
|
|
3221
3167
|
}
|
|
3222
|
-
details = peg$posDetailsCache[
|
|
3168
|
+
details = peg$posDetailsCache[p];
|
|
3223
3169
|
details = {
|
|
3224
3170
|
line: details.line,
|
|
3225
3171
|
column: details.column
|
|
3226
3172
|
};
|
|
3227
|
-
while (
|
|
3228
|
-
if (input.charCodeAt(
|
|
3173
|
+
while (p < pos) {
|
|
3174
|
+
if (input.charCodeAt(p) === 10) {
|
|
3229
3175
|
details.line++;
|
|
3230
3176
|
details.column = 1;
|
|
3231
3177
|
} else {
|
|
3232
3178
|
details.column++;
|
|
3233
3179
|
}
|
|
3234
|
-
|
|
3180
|
+
p++;
|
|
3235
3181
|
}
|
|
3236
3182
|
peg$posDetailsCache[pos] = details;
|
|
3237
3183
|
return details;
|
|
@@ -7571,9 +7517,9 @@ var VALID_ENVIRONMENTS = /* @__PURE__ */ new Set(
|
|
|
7571
7517
|
["development", "preview", "staging", "production", "test"]
|
|
7572
7518
|
);
|
|
7573
7519
|
function runDetect(platform, env) {
|
|
7574
|
-
const
|
|
7575
|
-
if (typeof
|
|
7576
|
-
return
|
|
7520
|
+
const d = platform.detect;
|
|
7521
|
+
if (typeof d === "string") return !!env[d];
|
|
7522
|
+
return d(env);
|
|
7577
7523
|
}
|
|
7578
7524
|
__name(runDetect, "runDetect");
|
|
7579
7525
|
function runExtractor(platform, key, env) {
|
|
@@ -8278,18 +8224,18 @@ var EnvGraph = class {
|
|
|
8278
8224
|
/** plugins installed globally in the graph */
|
|
8279
8225
|
plugins = [];
|
|
8280
8226
|
};
|
|
8281
|
-
async function pathExists(
|
|
8227
|
+
async function pathExists(p) {
|
|
8282
8228
|
try {
|
|
8283
|
-
await access(
|
|
8229
|
+
await access(p);
|
|
8284
8230
|
return true;
|
|
8285
8231
|
} catch {
|
|
8286
8232
|
return false;
|
|
8287
8233
|
}
|
|
8288
8234
|
}
|
|
8289
8235
|
__name(pathExists, "pathExists");
|
|
8290
|
-
function pathExistsSync(
|
|
8236
|
+
function pathExistsSync(p) {
|
|
8291
8237
|
try {
|
|
8292
|
-
accessSync(
|
|
8238
|
+
accessSync(p);
|
|
8293
8239
|
return true;
|
|
8294
8240
|
} catch {
|
|
8295
8241
|
return false;
|
|
@@ -8304,809 +8250,10 @@ var { Ansis, fg, bg, rgb, bgRgb, hex, bgHex, reset, inverse, hidden, visible, bo
|
|
|
8304
8250
|
|
|
8305
8251
|
// src/env-graph/lib/plugins.ts
|
|
8306
8252
|
var import_semver = __toESM(require_semver2(), 1);
|
|
8307
|
-
|
|
8308
|
-
// ../../node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/utils.js
|
|
8309
|
-
var isAmbiguous = /* @__PURE__ */ __name((x) => {
|
|
8310
|
-
return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
|
|
8311
|
-
}, "isAmbiguous");
|
|
8312
|
-
var isFullWidth = /* @__PURE__ */ __name((x) => {
|
|
8313
|
-
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
8314
|
-
}, "isFullWidth");
|
|
8315
|
-
var isWide = /* @__PURE__ */ __name((x) => {
|
|
8316
|
-
return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9800 && x <= 9811 || x === 9855 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 19968 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101632 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129672 || x >= 129680 && x <= 129725 || x >= 129727 && x <= 129733 || x >= 129742 && x <= 129755 || x >= 129760 && x <= 129768 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
8317
|
-
}, "isWide");
|
|
8318
|
-
|
|
8319
|
-
// ../../node_modules/.bun/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js
|
|
8320
|
-
var ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
|
|
8321
|
-
var CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
8322
|
-
var TAB_RE = /\t{1,1000}/y;
|
|
8323
|
-
var EMOJI_RE = new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*", "yu");
|
|
8324
|
-
var LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
8325
|
-
var MODIFIER_RE = new RegExp("\\p{M}+", "gu");
|
|
8326
|
-
var NO_TRUNCATION = { limit: Infinity, ellipsis: "" };
|
|
8327
|
-
var getStringTruncatedWidth = /* @__PURE__ */ __name((input, truncationOptions = {}, widthOptions = {}) => {
|
|
8328
|
-
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
8329
|
-
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
8330
|
-
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
|
|
8331
|
-
const ANSI_WIDTH = widthOptions.ansiWidth ?? 0;
|
|
8332
|
-
const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
|
|
8333
|
-
const TAB_WIDTH = widthOptions.tabWidth ?? 8;
|
|
8334
|
-
const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
|
|
8335
|
-
const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
|
|
8336
|
-
const FULL_WIDTH_WIDTH = widthOptions.fullWidthWidth ?? 2;
|
|
8337
|
-
const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
|
|
8338
|
-
const WIDE_WIDTH = widthOptions.wideWidth ?? 2;
|
|
8339
|
-
let indexPrev = 0;
|
|
8340
|
-
let index = 0;
|
|
8341
|
-
let length = input.length;
|
|
8342
|
-
let lengthExtra = 0;
|
|
8343
|
-
let truncationEnabled = false;
|
|
8344
|
-
let truncationIndex = length;
|
|
8345
|
-
let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);
|
|
8346
|
-
let unmatchedStart = 0;
|
|
8347
|
-
let unmatchedEnd = 0;
|
|
8348
|
-
let width = 0;
|
|
8349
|
-
let widthExtra = 0;
|
|
8350
|
-
outer: while (true) {
|
|
8351
|
-
if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
|
|
8352
|
-
const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);
|
|
8353
|
-
lengthExtra = 0;
|
|
8354
|
-
for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
|
|
8355
|
-
const codePoint = char.codePointAt(0) || 0;
|
|
8356
|
-
if (isFullWidth(codePoint)) {
|
|
8357
|
-
widthExtra = FULL_WIDTH_WIDTH;
|
|
8358
|
-
} else if (isWide(codePoint)) {
|
|
8359
|
-
widthExtra = WIDE_WIDTH;
|
|
8360
|
-
} else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) {
|
|
8361
|
-
widthExtra = AMBIGUOUS_WIDTH;
|
|
8362
|
-
} else {
|
|
8363
|
-
widthExtra = REGULAR_WIDTH;
|
|
8364
|
-
}
|
|
8365
|
-
if (width + widthExtra > truncationLimit) {
|
|
8366
|
-
truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
|
|
8367
|
-
}
|
|
8368
|
-
if (width + widthExtra > LIMIT) {
|
|
8369
|
-
truncationEnabled = true;
|
|
8370
|
-
break outer;
|
|
8371
|
-
}
|
|
8372
|
-
lengthExtra += char.length;
|
|
8373
|
-
width += widthExtra;
|
|
8374
|
-
}
|
|
8375
|
-
unmatchedStart = unmatchedEnd = 0;
|
|
8376
|
-
}
|
|
8377
|
-
if (index >= length)
|
|
8378
|
-
break;
|
|
8379
|
-
LATIN_RE.lastIndex = index;
|
|
8380
|
-
if (LATIN_RE.test(input)) {
|
|
8381
|
-
lengthExtra = LATIN_RE.lastIndex - index;
|
|
8382
|
-
widthExtra = lengthExtra * REGULAR_WIDTH;
|
|
8383
|
-
if (width + widthExtra > truncationLimit) {
|
|
8384
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
|
|
8385
|
-
}
|
|
8386
|
-
if (width + widthExtra > LIMIT) {
|
|
8387
|
-
truncationEnabled = true;
|
|
8388
|
-
break;
|
|
8389
|
-
}
|
|
8390
|
-
width += widthExtra;
|
|
8391
|
-
unmatchedStart = indexPrev;
|
|
8392
|
-
unmatchedEnd = index;
|
|
8393
|
-
index = indexPrev = LATIN_RE.lastIndex;
|
|
8394
|
-
continue;
|
|
8395
|
-
}
|
|
8396
|
-
ANSI_RE.lastIndex = index;
|
|
8397
|
-
if (ANSI_RE.test(input)) {
|
|
8398
|
-
if (width + ANSI_WIDTH > truncationLimit) {
|
|
8399
|
-
truncationIndex = Math.min(truncationIndex, index);
|
|
8400
|
-
}
|
|
8401
|
-
if (width + ANSI_WIDTH > LIMIT) {
|
|
8402
|
-
truncationEnabled = true;
|
|
8403
|
-
break;
|
|
8404
|
-
}
|
|
8405
|
-
width += ANSI_WIDTH;
|
|
8406
|
-
unmatchedStart = indexPrev;
|
|
8407
|
-
unmatchedEnd = index;
|
|
8408
|
-
index = indexPrev = ANSI_RE.lastIndex;
|
|
8409
|
-
continue;
|
|
8410
|
-
}
|
|
8411
|
-
CONTROL_RE.lastIndex = index;
|
|
8412
|
-
if (CONTROL_RE.test(input)) {
|
|
8413
|
-
lengthExtra = CONTROL_RE.lastIndex - index;
|
|
8414
|
-
widthExtra = lengthExtra * CONTROL_WIDTH;
|
|
8415
|
-
if (width + widthExtra > truncationLimit) {
|
|
8416
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
|
|
8417
|
-
}
|
|
8418
|
-
if (width + widthExtra > LIMIT) {
|
|
8419
|
-
truncationEnabled = true;
|
|
8420
|
-
break;
|
|
8421
|
-
}
|
|
8422
|
-
width += widthExtra;
|
|
8423
|
-
unmatchedStart = indexPrev;
|
|
8424
|
-
unmatchedEnd = index;
|
|
8425
|
-
index = indexPrev = CONTROL_RE.lastIndex;
|
|
8426
|
-
continue;
|
|
8427
|
-
}
|
|
8428
|
-
TAB_RE.lastIndex = index;
|
|
8429
|
-
if (TAB_RE.test(input)) {
|
|
8430
|
-
lengthExtra = TAB_RE.lastIndex - index;
|
|
8431
|
-
widthExtra = lengthExtra * TAB_WIDTH;
|
|
8432
|
-
if (width + widthExtra > truncationLimit) {
|
|
8433
|
-
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
|
|
8434
|
-
}
|
|
8435
|
-
if (width + widthExtra > LIMIT) {
|
|
8436
|
-
truncationEnabled = true;
|
|
8437
|
-
break;
|
|
8438
|
-
}
|
|
8439
|
-
width += widthExtra;
|
|
8440
|
-
unmatchedStart = indexPrev;
|
|
8441
|
-
unmatchedEnd = index;
|
|
8442
|
-
index = indexPrev = TAB_RE.lastIndex;
|
|
8443
|
-
continue;
|
|
8444
|
-
}
|
|
8445
|
-
EMOJI_RE.lastIndex = index;
|
|
8446
|
-
if (EMOJI_RE.test(input)) {
|
|
8447
|
-
if (width + EMOJI_WIDTH > truncationLimit) {
|
|
8448
|
-
truncationIndex = Math.min(truncationIndex, index);
|
|
8449
|
-
}
|
|
8450
|
-
if (width + EMOJI_WIDTH > LIMIT) {
|
|
8451
|
-
truncationEnabled = true;
|
|
8452
|
-
break;
|
|
8453
|
-
}
|
|
8454
|
-
width += EMOJI_WIDTH;
|
|
8455
|
-
unmatchedStart = indexPrev;
|
|
8456
|
-
unmatchedEnd = index;
|
|
8457
|
-
index = indexPrev = EMOJI_RE.lastIndex;
|
|
8458
|
-
continue;
|
|
8459
|
-
}
|
|
8460
|
-
index += 1;
|
|
8461
|
-
}
|
|
8462
|
-
return {
|
|
8463
|
-
width: truncationEnabled ? truncationLimit : width,
|
|
8464
|
-
index: truncationEnabled ? truncationIndex : length,
|
|
8465
|
-
truncated: truncationEnabled,
|
|
8466
|
-
ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
|
|
8467
|
-
};
|
|
8468
|
-
}, "getStringTruncatedWidth");
|
|
8469
|
-
var dist_default = getStringTruncatedWidth;
|
|
8470
|
-
|
|
8471
|
-
// ../../node_modules/.bun/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js
|
|
8472
|
-
var NO_TRUNCATION2 = {
|
|
8473
|
-
limit: Infinity,
|
|
8474
|
-
ellipsis: "",
|
|
8475
|
-
ellipsisWidth: 0
|
|
8476
|
-
};
|
|
8477
|
-
var fastStringWidth = /* @__PURE__ */ __name((input, options = {}) => {
|
|
8478
|
-
return dist_default(input, NO_TRUNCATION2, options).width;
|
|
8479
|
-
}, "fastStringWidth");
|
|
8480
|
-
var dist_default2 = fastStringWidth;
|
|
8481
|
-
|
|
8482
|
-
// ../../node_modules/.bun/fast-wrap-ansi@0.1.6/node_modules/fast-wrap-ansi/lib/main.js
|
|
8483
|
-
var ESC = "\x1B";
|
|
8484
|
-
var CSI = "\x9B";
|
|
8485
|
-
var END_CODE = 39;
|
|
8486
|
-
var ANSI_ESCAPE_BELL = "\x07";
|
|
8487
|
-
var ANSI_CSI = "[";
|
|
8488
|
-
var ANSI_OSC = "]";
|
|
8489
|
-
var ANSI_SGR_TERMINATOR = "m";
|
|
8490
|
-
var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
8491
|
-
var GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, "y");
|
|
8492
|
-
var getClosingCode = /* @__PURE__ */ __name((openingCode) => {
|
|
8493
|
-
if (openingCode >= 30 && openingCode <= 37)
|
|
8494
|
-
return 39;
|
|
8495
|
-
if (openingCode >= 90 && openingCode <= 97)
|
|
8496
|
-
return 39;
|
|
8497
|
-
if (openingCode >= 40 && openingCode <= 47)
|
|
8498
|
-
return 49;
|
|
8499
|
-
if (openingCode >= 100 && openingCode <= 107)
|
|
8500
|
-
return 49;
|
|
8501
|
-
if (openingCode === 1 || openingCode === 2)
|
|
8502
|
-
return 22;
|
|
8503
|
-
if (openingCode === 3)
|
|
8504
|
-
return 23;
|
|
8505
|
-
if (openingCode === 4)
|
|
8506
|
-
return 24;
|
|
8507
|
-
if (openingCode === 7)
|
|
8508
|
-
return 27;
|
|
8509
|
-
if (openingCode === 8)
|
|
8510
|
-
return 28;
|
|
8511
|
-
if (openingCode === 9)
|
|
8512
|
-
return 29;
|
|
8513
|
-
if (openingCode === 0)
|
|
8514
|
-
return 0;
|
|
8515
|
-
return void 0;
|
|
8516
|
-
}, "getClosingCode");
|
|
8517
|
-
var wrapAnsiCode = /* @__PURE__ */ __name((code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`, "wrapAnsiCode");
|
|
8518
|
-
var wrapAnsiHyperlink = /* @__PURE__ */ __name((url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`, "wrapAnsiHyperlink");
|
|
8519
|
-
var wrapWord = /* @__PURE__ */ __name((rows, word, columns) => {
|
|
8520
|
-
const characters = word[Symbol.iterator]();
|
|
8521
|
-
let isInsideEscape = false;
|
|
8522
|
-
let isInsideLinkEscape = false;
|
|
8523
|
-
let lastRow = rows.at(-1);
|
|
8524
|
-
let visible2 = lastRow === void 0 ? 0 : dist_default2(lastRow);
|
|
8525
|
-
let currentCharacter = characters.next();
|
|
8526
|
-
let nextCharacter = characters.next();
|
|
8527
|
-
let rawCharacterIndex = 0;
|
|
8528
|
-
while (!currentCharacter.done) {
|
|
8529
|
-
const character = currentCharacter.value;
|
|
8530
|
-
const characterLength = dist_default2(character);
|
|
8531
|
-
if (visible2 + characterLength <= columns) {
|
|
8532
|
-
rows[rows.length - 1] += character;
|
|
8533
|
-
} else {
|
|
8534
|
-
rows.push(character);
|
|
8535
|
-
visible2 = 0;
|
|
8536
|
-
}
|
|
8537
|
-
if (character === ESC || character === CSI) {
|
|
8538
|
-
isInsideEscape = true;
|
|
8539
|
-
isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);
|
|
8540
|
-
}
|
|
8541
|
-
if (isInsideEscape) {
|
|
8542
|
-
if (isInsideLinkEscape) {
|
|
8543
|
-
if (character === ANSI_ESCAPE_BELL) {
|
|
8544
|
-
isInsideEscape = false;
|
|
8545
|
-
isInsideLinkEscape = false;
|
|
8546
|
-
}
|
|
8547
|
-
} else if (character === ANSI_SGR_TERMINATOR) {
|
|
8548
|
-
isInsideEscape = false;
|
|
8549
|
-
}
|
|
8550
|
-
} else {
|
|
8551
|
-
visible2 += characterLength;
|
|
8552
|
-
if (visible2 === columns && !nextCharacter.done) {
|
|
8553
|
-
rows.push("");
|
|
8554
|
-
visible2 = 0;
|
|
8555
|
-
}
|
|
8556
|
-
}
|
|
8557
|
-
currentCharacter = nextCharacter;
|
|
8558
|
-
nextCharacter = characters.next();
|
|
8559
|
-
rawCharacterIndex += character.length;
|
|
8560
|
-
}
|
|
8561
|
-
lastRow = rows.at(-1);
|
|
8562
|
-
if (!visible2 && lastRow !== void 0 && lastRow.length && rows.length > 1) {
|
|
8563
|
-
rows[rows.length - 2] += rows.pop();
|
|
8564
|
-
}
|
|
8565
|
-
}, "wrapWord");
|
|
8566
|
-
var stringVisibleTrimSpacesRight = /* @__PURE__ */ __name((string) => {
|
|
8567
|
-
const words = string.split(" ");
|
|
8568
|
-
let last = words.length;
|
|
8569
|
-
while (last) {
|
|
8570
|
-
if (dist_default2(words[last - 1])) {
|
|
8571
|
-
break;
|
|
8572
|
-
}
|
|
8573
|
-
last--;
|
|
8574
|
-
}
|
|
8575
|
-
if (last === words.length) {
|
|
8576
|
-
return string;
|
|
8577
|
-
}
|
|
8578
|
-
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
8579
|
-
}, "stringVisibleTrimSpacesRight");
|
|
8580
|
-
var exec2 = /* @__PURE__ */ __name((string, columns, options = {}) => {
|
|
8581
|
-
if (options.trim !== false && string.trim() === "") {
|
|
8582
|
-
return "";
|
|
8583
|
-
}
|
|
8584
|
-
let returnValue = "";
|
|
8585
|
-
let escapeCode;
|
|
8586
|
-
let escapeUrl;
|
|
8587
|
-
const words = string.split(" ");
|
|
8588
|
-
let rows = [""];
|
|
8589
|
-
let rowLength = 0;
|
|
8590
|
-
for (let index = 0; index < words.length; index++) {
|
|
8591
|
-
const word = words[index];
|
|
8592
|
-
if (options.trim !== false) {
|
|
8593
|
-
const row = rows.at(-1) ?? "";
|
|
8594
|
-
const trimmed = row.trimStart();
|
|
8595
|
-
if (row.length !== trimmed.length) {
|
|
8596
|
-
rows[rows.length - 1] = trimmed;
|
|
8597
|
-
rowLength = dist_default2(trimmed);
|
|
8598
|
-
}
|
|
8599
|
-
}
|
|
8600
|
-
if (index !== 0) {
|
|
8601
|
-
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
8602
|
-
rows.push("");
|
|
8603
|
-
rowLength = 0;
|
|
8604
|
-
}
|
|
8605
|
-
if (rowLength || options.trim === false) {
|
|
8606
|
-
rows[rows.length - 1] += " ";
|
|
8607
|
-
rowLength++;
|
|
8608
|
-
}
|
|
8609
|
-
}
|
|
8610
|
-
const wordLength = dist_default2(word);
|
|
8611
|
-
if (options.hard && wordLength > columns) {
|
|
8612
|
-
const remainingColumns = columns - rowLength;
|
|
8613
|
-
const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
|
|
8614
|
-
const breaksStartingNextLine = Math.floor((wordLength - 1) / columns);
|
|
8615
|
-
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
8616
|
-
rows.push("");
|
|
8617
|
-
}
|
|
8618
|
-
wrapWord(rows, word, columns);
|
|
8619
|
-
rowLength = dist_default2(rows.at(-1) ?? "");
|
|
8620
|
-
continue;
|
|
8621
|
-
}
|
|
8622
|
-
if (rowLength + wordLength > columns && rowLength && wordLength) {
|
|
8623
|
-
if (options.wordWrap === false && rowLength < columns) {
|
|
8624
|
-
wrapWord(rows, word, columns);
|
|
8625
|
-
rowLength = dist_default2(rows.at(-1) ?? "");
|
|
8626
|
-
continue;
|
|
8627
|
-
}
|
|
8628
|
-
rows.push("");
|
|
8629
|
-
rowLength = 0;
|
|
8630
|
-
}
|
|
8631
|
-
if (rowLength + wordLength > columns && options.wordWrap === false) {
|
|
8632
|
-
wrapWord(rows, word, columns);
|
|
8633
|
-
rowLength = dist_default2(rows.at(-1) ?? "");
|
|
8634
|
-
continue;
|
|
8635
|
-
}
|
|
8636
|
-
rows[rows.length - 1] += word;
|
|
8637
|
-
rowLength += wordLength;
|
|
8638
|
-
}
|
|
8639
|
-
if (options.trim !== false) {
|
|
8640
|
-
rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
|
|
8641
|
-
}
|
|
8642
|
-
const preString = rows.join("\n");
|
|
8643
|
-
let inSurrogate = false;
|
|
8644
|
-
for (let i = 0; i < preString.length; i++) {
|
|
8645
|
-
const character = preString[i];
|
|
8646
|
-
returnValue += character;
|
|
8647
|
-
if (!inSurrogate) {
|
|
8648
|
-
inSurrogate = character >= "\uD800" && character <= "\uDBFF";
|
|
8649
|
-
} else {
|
|
8650
|
-
continue;
|
|
8651
|
-
}
|
|
8652
|
-
if (character === ESC || character === CSI) {
|
|
8653
|
-
GROUP_REGEX.lastIndex = i + 1;
|
|
8654
|
-
const groupsResult = GROUP_REGEX.exec(preString);
|
|
8655
|
-
const groups = groupsResult?.groups;
|
|
8656
|
-
if (groups?.code !== void 0) {
|
|
8657
|
-
const code = Number.parseFloat(groups.code);
|
|
8658
|
-
escapeCode = code === END_CODE ? void 0 : code;
|
|
8659
|
-
} else if (groups?.uri !== void 0) {
|
|
8660
|
-
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
8661
|
-
}
|
|
8662
|
-
}
|
|
8663
|
-
if (preString[i + 1] === "\n") {
|
|
8664
|
-
if (escapeUrl) {
|
|
8665
|
-
returnValue += wrapAnsiHyperlink("");
|
|
8666
|
-
}
|
|
8667
|
-
const closingCode = escapeCode ? getClosingCode(escapeCode) : void 0;
|
|
8668
|
-
if (escapeCode && closingCode) {
|
|
8669
|
-
returnValue += wrapAnsiCode(closingCode);
|
|
8670
|
-
}
|
|
8671
|
-
} else if (character === "\n") {
|
|
8672
|
-
if (escapeCode && getClosingCode(escapeCode)) {
|
|
8673
|
-
returnValue += wrapAnsiCode(escapeCode);
|
|
8674
|
-
}
|
|
8675
|
-
if (escapeUrl) {
|
|
8676
|
-
returnValue += wrapAnsiHyperlink(escapeUrl);
|
|
8677
|
-
}
|
|
8678
|
-
}
|
|
8679
|
-
}
|
|
8680
|
-
return returnValue;
|
|
8681
|
-
}, "exec");
|
|
8682
|
-
var CRLF_OR_LF = /\r?\n/;
|
|
8683
|
-
function wrapAnsi(string, columns, options) {
|
|
8684
|
-
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec2(line, columns, options)).join("\n");
|
|
8685
|
-
}
|
|
8686
|
-
__name(wrapAnsi, "wrapAnsi");
|
|
8687
|
-
|
|
8688
|
-
// ../../node_modules/.bun/@clack+core@1.2.0/node_modules/@clack/core/dist/index.mjs
|
|
8689
|
-
var import_sisteransi = __toESM(require_src(), 1);
|
|
8690
|
-
function d(r, t2, e) {
|
|
8691
|
-
if (!e.some((o) => !o.disabled)) return r;
|
|
8692
|
-
const s = r + t2, i = Math.max(e.length - 1, 0), n = s < 0 ? i : s > i ? 0 : s;
|
|
8693
|
-
return e[n].disabled ? d(n, t2 < 0 ? -1 : 1, e) : n;
|
|
8694
|
-
}
|
|
8695
|
-
__name(d, "d");
|
|
8696
|
-
var E = ["up", "down", "left", "right", "space", "enter", "cancel"];
|
|
8697
|
-
var u = { actions: new Set(E), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]), withGuide: true};
|
|
8698
|
-
function V(r, t2) {
|
|
8699
|
-
if (typeof r == "string") return u.aliases.get(r) === t2;
|
|
8700
|
-
for (const e of r) if (e !== void 0 && V(e, t2)) return true;
|
|
8701
|
-
return false;
|
|
8702
|
-
}
|
|
8703
|
-
__name(V, "V");
|
|
8704
|
-
function j(r, t2) {
|
|
8705
|
-
if (r === t2) return;
|
|
8706
|
-
const e = r.split(`
|
|
8707
|
-
`), s = t2.split(`
|
|
8708
|
-
`), i = Math.max(e.length, s.length), n = [];
|
|
8709
|
-
for (let o = 0; o < i; o++) e[o] !== s[o] && n.push(o);
|
|
8710
|
-
return { lines: n, numLinesBefore: e.length, numLinesAfter: s.length, numLines: i };
|
|
8711
|
-
}
|
|
8712
|
-
__name(j, "j");
|
|
8713
|
-
globalThis.process.platform.startsWith("win");
|
|
8714
|
-
var C = /* @__PURE__ */ Symbol("clack:cancel");
|
|
8715
|
-
function q(r) {
|
|
8716
|
-
return r === C;
|
|
8717
|
-
}
|
|
8718
|
-
__name(q, "q");
|
|
8719
|
-
function w(r, t2) {
|
|
8720
|
-
const e = r;
|
|
8721
|
-
e.isTTY && e.setRawMode(t2);
|
|
8722
|
-
}
|
|
8723
|
-
__name(w, "w");
|
|
8724
|
-
var O = /* @__PURE__ */ __name((r) => "columns" in r && typeof r.columns == "number" ? r.columns : 80, "O");
|
|
8725
|
-
var A = /* @__PURE__ */ __name((r) => "rows" in r && typeof r.rows == "number" ? r.rows : 20, "A");
|
|
8726
|
-
function R(r, t2, e, s = e) {
|
|
8727
|
-
const i = O(r ?? stdout);
|
|
8728
|
-
return wrapAnsi(t2, i - e.length, { hard: true, trim: false }).split(`
|
|
8729
|
-
`).map((n, o) => `${o === 0 ? s : e}${n}`).join(`
|
|
8730
|
-
`);
|
|
8731
|
-
}
|
|
8732
|
-
__name(R, "R");
|
|
8733
|
-
var p = class {
|
|
8734
|
-
static {
|
|
8735
|
-
__name(this, "p");
|
|
8736
|
-
}
|
|
8737
|
-
input;
|
|
8738
|
-
output;
|
|
8739
|
-
_abortSignal;
|
|
8740
|
-
rl;
|
|
8741
|
-
opts;
|
|
8742
|
-
_render;
|
|
8743
|
-
_track = false;
|
|
8744
|
-
_prevFrame = "";
|
|
8745
|
-
_subscribers = /* @__PURE__ */ new Map();
|
|
8746
|
-
_cursor = 0;
|
|
8747
|
-
state = "initial";
|
|
8748
|
-
error = "";
|
|
8749
|
-
value;
|
|
8750
|
-
userInput = "";
|
|
8751
|
-
constructor(t2, e = true) {
|
|
8752
|
-
const { input: s = stdin, output: i = stdout, render: n, signal: o, ...a2 } = t2;
|
|
8753
|
-
this.opts = a2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = n.bind(this), this._track = e, this._abortSignal = o, this.input = s, this.output = i;
|
|
8754
|
-
}
|
|
8755
|
-
unsubscribe() {
|
|
8756
|
-
this._subscribers.clear();
|
|
8757
|
-
}
|
|
8758
|
-
setSubscriber(t2, e) {
|
|
8759
|
-
const s = this._subscribers.get(t2) ?? [];
|
|
8760
|
-
s.push(e), this._subscribers.set(t2, s);
|
|
8761
|
-
}
|
|
8762
|
-
on(t2, e) {
|
|
8763
|
-
this.setSubscriber(t2, { cb: e });
|
|
8764
|
-
}
|
|
8765
|
-
once(t2, e) {
|
|
8766
|
-
this.setSubscriber(t2, { cb: e, once: true });
|
|
8767
|
-
}
|
|
8768
|
-
emit(t2, ...e) {
|
|
8769
|
-
const s = this._subscribers.get(t2) ?? [], i = [];
|
|
8770
|
-
for (const n of s) n.cb(...e), n.once && i.push(() => s.splice(s.indexOf(n), 1));
|
|
8771
|
-
for (const n of i) n();
|
|
8772
|
-
}
|
|
8773
|
-
prompt() {
|
|
8774
|
-
return new Promise((t2) => {
|
|
8775
|
-
if (this._abortSignal) {
|
|
8776
|
-
if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t2(C);
|
|
8777
|
-
this._abortSignal.addEventListener("abort", () => {
|
|
8778
|
-
this.state = "cancel", this.close();
|
|
8779
|
-
}, { once: true });
|
|
8780
|
-
}
|
|
8781
|
-
this.rl = P.createInterface({ input: this.input, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), w(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
|
|
8782
|
-
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t2(this.value);
|
|
8783
|
-
}), this.once("cancel", () => {
|
|
8784
|
-
this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), w(this.input, false), t2(C);
|
|
8785
|
-
});
|
|
8786
|
-
});
|
|
8787
|
-
}
|
|
8788
|
-
_isActionKey(t2, e) {
|
|
8789
|
-
return t2 === " ";
|
|
8790
|
-
}
|
|
8791
|
-
_setValue(t2) {
|
|
8792
|
-
this.value = t2, this.emit("value", this.value);
|
|
8793
|
-
}
|
|
8794
|
-
_setUserInput(t2, e) {
|
|
8795
|
-
this.userInput = t2 ?? "", this.emit("userInput", this.userInput), e && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
|
|
8796
|
-
}
|
|
8797
|
-
_clearUserInput() {
|
|
8798
|
-
this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
|
|
8799
|
-
}
|
|
8800
|
-
onKeypress(t2, e) {
|
|
8801
|
-
if (this._track && e.name !== "return" && (e.name && this._isActionKey(t2, e) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && u.aliases.has(e.name) && this.emit("cursor", u.aliases.get(e.name)), u.actions.has(e.name) && this.emit("cursor", e.name)), t2 && (t2.toLowerCase() === "y" || t2.toLowerCase() === "n") && this.emit("confirm", t2.toLowerCase() === "y"), this.emit("key", t2?.toLowerCase(), e), e?.name === "return") {
|
|
8802
|
-
if (this.opts.validate) {
|
|
8803
|
-
const s = this.opts.validate(this.value);
|
|
8804
|
-
s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
|
|
8805
|
-
}
|
|
8806
|
-
this.state !== "error" && (this.state = "submit");
|
|
8807
|
-
}
|
|
8808
|
-
V([t2, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
|
|
8809
|
-
}
|
|
8810
|
-
close() {
|
|
8811
|
-
this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
|
|
8812
|
-
`), w(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
|
|
8813
|
-
}
|
|
8814
|
-
restoreCursor() {
|
|
8815
|
-
const t2 = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
|
|
8816
|
-
`).length - 1;
|
|
8817
|
-
this.output.write(import_sisteransi.cursor.move(-999, t2 * -1));
|
|
8818
|
-
}
|
|
8819
|
-
render() {
|
|
8820
|
-
const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, { hard: true, trim: false });
|
|
8821
|
-
if (t2 !== this._prevFrame) {
|
|
8822
|
-
if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
|
|
8823
|
-
else {
|
|
8824
|
-
const e = j(this._prevFrame, t2), s = A(this.output);
|
|
8825
|
-
if (this.restoreCursor(), e) {
|
|
8826
|
-
const i = Math.max(0, e.numLinesAfter - s), n = Math.max(0, e.numLinesBefore - s);
|
|
8827
|
-
let o = e.lines.find((a2) => a2 >= i);
|
|
8828
|
-
if (o === void 0) {
|
|
8829
|
-
this._prevFrame = t2;
|
|
8830
|
-
return;
|
|
8831
|
-
}
|
|
8832
|
-
if (e.lines.length === 1) {
|
|
8833
|
-
this.output.write(import_sisteransi.cursor.move(0, o - n)), this.output.write(import_sisteransi.erase.lines(1));
|
|
8834
|
-
const a2 = t2.split(`
|
|
8835
|
-
`);
|
|
8836
|
-
this.output.write(a2[o]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, a2.length - o - 1));
|
|
8837
|
-
return;
|
|
8838
|
-
} else if (e.lines.length > 1) {
|
|
8839
|
-
if (i < n) o = i;
|
|
8840
|
-
else {
|
|
8841
|
-
const h = o - n;
|
|
8842
|
-
h > 0 && this.output.write(import_sisteransi.cursor.move(0, h));
|
|
8843
|
-
}
|
|
8844
|
-
this.output.write(import_sisteransi.erase.down());
|
|
8845
|
-
const a2 = t2.split(`
|
|
8846
|
-
`).slice(o);
|
|
8847
|
-
this.output.write(a2.join(`
|
|
8848
|
-
`)), this._prevFrame = t2;
|
|
8849
|
-
return;
|
|
8850
|
-
}
|
|
8851
|
-
}
|
|
8852
|
-
this.output.write(import_sisteransi.erase.down());
|
|
8853
|
-
}
|
|
8854
|
-
this.output.write(t2), this.state === "initial" && (this.state = "active"), this._prevFrame = t2;
|
|
8855
|
-
}
|
|
8856
|
-
}
|
|
8857
|
-
};
|
|
8858
|
-
var Q = class extends p {
|
|
8859
|
-
static {
|
|
8860
|
-
__name(this, "Q");
|
|
8861
|
-
}
|
|
8862
|
-
get cursor() {
|
|
8863
|
-
return this.value ? 0 : 1;
|
|
8864
|
-
}
|
|
8865
|
-
get _value() {
|
|
8866
|
-
return this.cursor === 0;
|
|
8867
|
-
}
|
|
8868
|
-
constructor(t2) {
|
|
8869
|
-
super(t2, false), this.value = !!t2.initialValue, this.on("userInput", () => {
|
|
8870
|
-
this.value = this._value;
|
|
8871
|
-
}), this.on("confirm", (e) => {
|
|
8872
|
-
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = e, this.state = "submit", this.close();
|
|
8873
|
-
}), this.on("cursor", () => {
|
|
8874
|
-
this.value = !this.value;
|
|
8875
|
-
});
|
|
8876
|
-
}
|
|
8877
|
-
};
|
|
8878
|
-
var it = class extends p {
|
|
8879
|
-
static {
|
|
8880
|
-
__name(this, "it");
|
|
8881
|
-
}
|
|
8882
|
-
options;
|
|
8883
|
-
cursor = 0;
|
|
8884
|
-
get _value() {
|
|
8885
|
-
return this.options[this.cursor].value;
|
|
8886
|
-
}
|
|
8887
|
-
get _enabledOptions() {
|
|
8888
|
-
return this.options.filter((t2) => t2.disabled !== true);
|
|
8889
|
-
}
|
|
8890
|
-
toggleAll() {
|
|
8891
|
-
const t2 = this._enabledOptions, e = this.value !== void 0 && this.value.length === t2.length;
|
|
8892
|
-
this.value = e ? [] : t2.map((s) => s.value);
|
|
8893
|
-
}
|
|
8894
|
-
toggleInvert() {
|
|
8895
|
-
const t2 = this.value;
|
|
8896
|
-
if (!t2) return;
|
|
8897
|
-
const e = this._enabledOptions.filter((s) => !t2.includes(s.value));
|
|
8898
|
-
this.value = e.map((s) => s.value);
|
|
8899
|
-
}
|
|
8900
|
-
toggleValue() {
|
|
8901
|
-
this.value === void 0 && (this.value = []);
|
|
8902
|
-
const t2 = this.value.includes(this._value);
|
|
8903
|
-
this.value = t2 ? this.value.filter((e) => e !== this._value) : [...this.value, this._value];
|
|
8904
|
-
}
|
|
8905
|
-
constructor(t2) {
|
|
8906
|
-
super(t2, false), this.options = t2.options, this.value = [...t2.initialValues ?? []];
|
|
8907
|
-
const e = Math.max(this.options.findIndex(({ value: s }) => s === t2.cursorAt), 0);
|
|
8908
|
-
this.cursor = this.options[e].disabled ? d(e, 1, this.options) : e, this.on("key", (s) => {
|
|
8909
|
-
s === "a" && this.toggleAll(), s === "i" && this.toggleInvert();
|
|
8910
|
-
}), this.on("cursor", (s) => {
|
|
8911
|
-
switch (s) {
|
|
8912
|
-
case "left":
|
|
8913
|
-
case "up":
|
|
8914
|
-
this.cursor = d(this.cursor, -1, this.options);
|
|
8915
|
-
break;
|
|
8916
|
-
case "down":
|
|
8917
|
-
case "right":
|
|
8918
|
-
this.cursor = d(this.cursor, 1, this.options);
|
|
8919
|
-
break;
|
|
8920
|
-
case "space":
|
|
8921
|
-
this.toggleValue();
|
|
8922
|
-
break;
|
|
8923
|
-
}
|
|
8924
|
-
});
|
|
8925
|
-
}
|
|
8926
|
-
};
|
|
8927
|
-
var nt = class extends p {
|
|
8928
|
-
static {
|
|
8929
|
-
__name(this, "nt");
|
|
8930
|
-
}
|
|
8931
|
-
options;
|
|
8932
|
-
cursor = 0;
|
|
8933
|
-
get _selectedValue() {
|
|
8934
|
-
return this.options[this.cursor];
|
|
8935
|
-
}
|
|
8936
|
-
changeValue() {
|
|
8937
|
-
this.value = this._selectedValue.value;
|
|
8938
|
-
}
|
|
8939
|
-
constructor(t2) {
|
|
8940
|
-
super(t2, false), this.options = t2.options;
|
|
8941
|
-
const e = this.options.findIndex(({ value: i }) => i === t2.initialValue), s = e === -1 ? 0 : e;
|
|
8942
|
-
this.cursor = this.options[s].disabled ? d(s, 1, this.options) : s, this.changeValue(), this.on("cursor", (i) => {
|
|
8943
|
-
switch (i) {
|
|
8944
|
-
case "left":
|
|
8945
|
-
case "up":
|
|
8946
|
-
this.cursor = d(this.cursor, -1, this.options);
|
|
8947
|
-
break;
|
|
8948
|
-
case "down":
|
|
8949
|
-
case "right":
|
|
8950
|
-
this.cursor = d(this.cursor, 1, this.options);
|
|
8951
|
-
break;
|
|
8952
|
-
}
|
|
8953
|
-
this.changeValue();
|
|
8954
|
-
});
|
|
8955
|
-
}
|
|
8956
|
-
};
|
|
8957
|
-
__toESM(require_src(), 1);
|
|
8958
|
-
function Ze() {
|
|
8959
|
-
return P2.platform !== "win32" ? P2.env.TERM !== "linux" : !!P2.env.CI || !!P2.env.WT_SESSION || !!P2.env.TERMINUS_SUBLIME || P2.env.ConEmuTask === "{cmd::Cmder}" || P2.env.TERM_PROGRAM === "Terminus-Sublime" || P2.env.TERM_PROGRAM === "vscode" || P2.env.TERM === "xterm-256color" || P2.env.TERM === "alacritty" || P2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
8960
|
-
}
|
|
8961
|
-
__name(Ze, "Ze");
|
|
8962
|
-
var ee = Ze();
|
|
8963
|
-
var w2 = /* @__PURE__ */ __name((e, i) => ee ? e : i, "w");
|
|
8964
|
-
var _e = w2("\u25C6", "*");
|
|
8965
|
-
var oe = w2("\u25A0", "x");
|
|
8966
|
-
var ue = w2("\u25B2", "x");
|
|
8967
|
-
var F = w2("\u25C7", "o");
|
|
8968
|
-
w2("\u250C", "T");
|
|
8969
|
-
var d2 = w2("\u2502", "|");
|
|
8970
|
-
var E2 = w2("\u2514", "\u2014");
|
|
8971
|
-
w2("\u2510", "T");
|
|
8972
|
-
w2("\u2518", "\u2014");
|
|
8973
|
-
var z2 = w2("\u25CF", ">");
|
|
8974
|
-
var H2 = w2("\u25CB", " ");
|
|
8975
|
-
w2("\u25FB", "[\u2022]");
|
|
8976
|
-
w2("\u25FC", "[+]");
|
|
8977
|
-
w2("\u25FB", "[ ]");
|
|
8978
|
-
w2("\u25AA", "\u2022");
|
|
8979
|
-
w2("\u2500", "-");
|
|
8980
|
-
w2("\u256E", "+");
|
|
8981
|
-
w2("\u251C", "+");
|
|
8982
|
-
w2("\u256F", "+");
|
|
8983
|
-
w2("\u2570", "+");
|
|
8984
|
-
w2("\u256D", "+");
|
|
8985
|
-
w2("\u25CF", "\u2022");
|
|
8986
|
-
w2("\u25C6", "*");
|
|
8987
|
-
w2("\u25B2", "!");
|
|
8988
|
-
w2("\u25A0", "x");
|
|
8989
|
-
var V2 = /* @__PURE__ */ __name((e) => {
|
|
8990
|
-
switch (e) {
|
|
8991
|
-
case "initial":
|
|
8992
|
-
case "active":
|
|
8993
|
-
return styleText("cyan", _e);
|
|
8994
|
-
case "cancel":
|
|
8995
|
-
return styleText("red", oe);
|
|
8996
|
-
case "error":
|
|
8997
|
-
return styleText("yellow", ue);
|
|
8998
|
-
case "submit":
|
|
8999
|
-
return styleText("green", F);
|
|
9000
|
-
}
|
|
9001
|
-
}, "V");
|
|
9002
|
-
var ye = /* @__PURE__ */ __name((e) => {
|
|
9003
|
-
switch (e) {
|
|
9004
|
-
case "initial":
|
|
9005
|
-
case "active":
|
|
9006
|
-
return styleText("cyan", d2);
|
|
9007
|
-
case "cancel":
|
|
9008
|
-
return styleText("red", d2);
|
|
9009
|
-
case "error":
|
|
9010
|
-
return styleText("yellow", d2);
|
|
9011
|
-
case "submit":
|
|
9012
|
-
return styleText("green", d2);
|
|
9013
|
-
}
|
|
9014
|
-
}, "ye");
|
|
9015
|
-
var et2 = /* @__PURE__ */ __name((e, i, s, r, u2) => {
|
|
9016
|
-
let n = i, o = 0;
|
|
9017
|
-
for (let c2 = s; c2 < r; c2++) {
|
|
9018
|
-
const a2 = e[c2];
|
|
9019
|
-
if (n = n - a2.length, o++, n <= u2) break;
|
|
9020
|
-
}
|
|
9021
|
-
return { lineCount: n, removals: o };
|
|
9022
|
-
}, "et");
|
|
9023
|
-
var Y2 = /* @__PURE__ */ __name(({ cursor: e, options: i, style: s, output: r = process.stdout, maxItems: u2 = Number.POSITIVE_INFINITY, columnPadding: n = 0, rowPadding: o = 4 }) => {
|
|
9024
|
-
const c2 = O(r) - n, a2 = A(r), l = styleText("dim", "..."), $2 = Math.max(a2 - o, 0), y2 = Math.max(Math.min(u2, $2), 5);
|
|
9025
|
-
let p2 = 0;
|
|
9026
|
-
e >= y2 - 3 && (p2 = Math.max(Math.min(e - y2 + 3, i.length - y2), 0));
|
|
9027
|
-
let m = y2 < i.length && p2 > 0, g = y2 < i.length && p2 + y2 < i.length;
|
|
9028
|
-
const S2 = Math.min(p2 + y2, i.length), h = [];
|
|
9029
|
-
let f = 0;
|
|
9030
|
-
m && f++, g && f++;
|
|
9031
|
-
const v = p2 + (m ? 1 : 0), T = S2 - (g ? 1 : 0);
|
|
9032
|
-
for (let b = v; b < T; b++) {
|
|
9033
|
-
const x = wrapAnsi(s(i[b], b === e), c2, { hard: true, trim: false }).split(`
|
|
9034
|
-
`);
|
|
9035
|
-
h.push(x), f += x.length;
|
|
9036
|
-
}
|
|
9037
|
-
if (f > $2) {
|
|
9038
|
-
let b = 0, x = 0, G2 = f;
|
|
9039
|
-
const M2 = e - v, R2 = /* @__PURE__ */ __name((j2, D2) => et2(h, G2, j2, D2, $2), "R");
|
|
9040
|
-
m ? ({ lineCount: G2, removals: b } = R2(0, M2), G2 > $2 && ({ lineCount: G2, removals: x } = R2(M2 + 1, h.length))) : ({ lineCount: G2, removals: x } = R2(M2 + 1, h.length), G2 > $2 && ({ lineCount: G2, removals: b } = R2(0, M2))), b > 0 && (m = true, h.splice(0, b)), x > 0 && (g = true, h.splice(h.length - x, x));
|
|
9041
|
-
}
|
|
9042
|
-
const C2 = [];
|
|
9043
|
-
m && C2.push(l);
|
|
9044
|
-
for (const b of h) for (const x of b) C2.push(x);
|
|
9045
|
-
return g && C2.push(l), C2;
|
|
9046
|
-
}, "Y");
|
|
9047
|
-
({ light: w2("\u2500", "-"), heavy: w2("\u2501", "="), block: w2("\u2588", "#") });
|
|
9048
|
-
var re = /* @__PURE__ */ __name((e, i) => e.includes(`
|
|
9049
|
-
`) ? e.split(`
|
|
9050
|
-
`).map((s) => i(s)).join(`
|
|
9051
|
-
`) : i(e), "re");
|
|
9052
|
-
var _t = /* @__PURE__ */ __name((e) => {
|
|
9053
|
-
const i = /* @__PURE__ */ __name((s, r) => {
|
|
9054
|
-
const u2 = s.label ?? String(s.value);
|
|
9055
|
-
switch (r) {
|
|
9056
|
-
case "disabled":
|
|
9057
|
-
return `${styleText("gray", H2)} ${re(u2, (n) => styleText("gray", n))}${s.hint ? ` ${styleText("dim", `(${s.hint ?? "disabled"})`)}` : ""}`;
|
|
9058
|
-
case "selected":
|
|
9059
|
-
return `${re(u2, (n) => styleText("dim", n))}`;
|
|
9060
|
-
case "active":
|
|
9061
|
-
return `${styleText("green", z2)} ${u2}${s.hint ? ` ${styleText("dim", `(${s.hint})`)}` : ""}`;
|
|
9062
|
-
case "cancelled":
|
|
9063
|
-
return `${re(u2, (n) => styleText(["strikethrough", "dim"], n))}`;
|
|
9064
|
-
default:
|
|
9065
|
-
return `${styleText("dim", H2)} ${re(u2, (n) => styleText("dim", n))}`;
|
|
9066
|
-
}
|
|
9067
|
-
}, "i");
|
|
9068
|
-
return new nt({ options: e.options, signal: e.signal, input: e.input, output: e.output, initialValue: e.initialValue, render() {
|
|
9069
|
-
const s = e.withGuide ?? u.withGuide, r = `${V2(this.state)} `, u2 = `${ye(this.state)} `, n = R(e.output, e.message, u2, r), o = `${s ? `${styleText("gray", d2)}
|
|
9070
|
-
` : ""}${n}
|
|
9071
|
-
`;
|
|
9072
|
-
switch (this.state) {
|
|
9073
|
-
case "submit": {
|
|
9074
|
-
const c2 = s ? `${styleText("gray", d2)} ` : "", a2 = R(e.output, i(this.options[this.cursor], "selected"), c2);
|
|
9075
|
-
return `${o}${a2}`;
|
|
9076
|
-
}
|
|
9077
|
-
case "cancel": {
|
|
9078
|
-
const c2 = s ? `${styleText("gray", d2)} ` : "", a2 = R(e.output, i(this.options[this.cursor], "cancelled"), c2);
|
|
9079
|
-
return `${o}${a2}${s ? `
|
|
9080
|
-
${styleText("gray", d2)}` : ""}`;
|
|
9081
|
-
}
|
|
9082
|
-
default: {
|
|
9083
|
-
const c2 = s ? `${styleText("cyan", d2)} ` : "", a2 = s ? styleText("cyan", E2) : "", l = o.split(`
|
|
9084
|
-
`).length, $2 = s ? 2 : 1;
|
|
9085
|
-
return `${o}${c2}${Y2({ output: e.output, cursor: this.cursor, options: this.options, maxItems: e.maxItems, columnPadding: c2.length, rowPadding: l + $2, style: /* @__PURE__ */ __name((y2, p2) => i(y2, y2.disabled ? "disabled" : p2 ? "active" : "inactive"), "style") }).join(`
|
|
9086
|
-
${c2}`)}
|
|
9087
|
-
${a2}
|
|
9088
|
-
`;
|
|
9089
|
-
}
|
|
9090
|
-
}
|
|
9091
|
-
} }).prompt();
|
|
9092
|
-
}, "_t");
|
|
9093
|
-
`${styleText("gray", d2)} `;
|
|
9094
|
-
function getUserVarlockDir() {
|
|
9095
|
-
const home = os.homedir();
|
|
9096
|
-
if (process.env.XDG_CONFIG_HOME) {
|
|
9097
|
-
return join(process.env.XDG_CONFIG_HOME, "varlock");
|
|
9098
|
-
}
|
|
9099
|
-
const legacyDir = join(home, ".varlock");
|
|
9100
|
-
if (existsSync(legacyDir)) {
|
|
9101
|
-
return legacyDir;
|
|
9102
|
-
}
|
|
9103
|
-
return join(home, ".config", "varlock");
|
|
9104
|
-
}
|
|
9105
|
-
__name(getUserVarlockDir, "getUserVarlockDir");
|
|
9106
8253
|
function isUnicodeSupported() {
|
|
9107
|
-
const { env } =
|
|
8254
|
+
const { env } = process2;
|
|
9108
8255
|
const { TERM, TERM_PROGRAM } = env;
|
|
9109
|
-
if (
|
|
8256
|
+
if (process2.platform !== "win32") {
|
|
9110
8257
|
return TERM !== "linux";
|
|
9111
8258
|
}
|
|
9112
8259
|
return Boolean(env.WT_SESSION) || Boolean(env.TERMINUS_SUBLIME) || env.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
@@ -9115,7 +8262,7 @@ __name(isUnicodeSupported, "isUnicodeSupported");
|
|
|
9115
8262
|
|
|
9116
8263
|
// src/cli/helpers/prompts.ts
|
|
9117
8264
|
var unicode = isUnicodeSupported();
|
|
9118
|
-
var unicodeOr = /* @__PURE__ */ __name((
|
|
8265
|
+
var unicodeOr = /* @__PURE__ */ __name((c, fallback) => unicode ? c : fallback, "unicodeOr");
|
|
9119
8266
|
var S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
|
|
9120
8267
|
var S_STEP_CANCEL = unicodeOr("\u25A0", "x");
|
|
9121
8268
|
var S_STEP_ERROR = unicodeOr("\u25B2", "x");
|
|
@@ -9128,7 +8275,7 @@ var S_RADIO_INACTIVE = unicodeOr("\u25CB", " ");
|
|
|
9128
8275
|
var S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]");
|
|
9129
8276
|
var S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]");
|
|
9130
8277
|
var S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]");
|
|
9131
|
-
unicodeOr("\u25AA", "\u2022");
|
|
8278
|
+
var S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022");
|
|
9132
8279
|
unicodeOr("\u2500", "-");
|
|
9133
8280
|
unicodeOr("\u256E", "+");
|
|
9134
8281
|
unicodeOr("\u251C", "+");
|
|
@@ -9342,10 +8489,68 @@ ${ansis_default.cyan(S_BAR_END)}
|
|
|
9342
8489
|
}
|
|
9343
8490
|
}).prompt();
|
|
9344
8491
|
}, "multiselect");
|
|
8492
|
+
function getPasswordPromptChain() {
|
|
8493
|
+
const globalKey = "__varlockPasswordPromptChain__";
|
|
8494
|
+
const globalState = globalThis;
|
|
8495
|
+
globalState[globalKey] ??= Promise.resolve();
|
|
8496
|
+
return {
|
|
8497
|
+
get: /* @__PURE__ */ __name(() => globalState[globalKey], "get"),
|
|
8498
|
+
set: /* @__PURE__ */ __name((nextChain) => {
|
|
8499
|
+
globalState[globalKey] = nextChain;
|
|
8500
|
+
}, "set")
|
|
8501
|
+
};
|
|
8502
|
+
}
|
|
8503
|
+
__name(getPasswordPromptChain, "getPasswordPromptChain");
|
|
8504
|
+
function enqueuePasswordPrompt(task) {
|
|
8505
|
+
const promptChain = getPasswordPromptChain();
|
|
8506
|
+
const run = promptChain.get().then(task, task);
|
|
8507
|
+
promptChain.set(run.then(() => void 0, () => void 0));
|
|
8508
|
+
return run;
|
|
8509
|
+
}
|
|
8510
|
+
__name(enqueuePasswordPrompt, "enqueuePasswordPrompt");
|
|
8511
|
+
var password = /* @__PURE__ */ __name(async (opts) => {
|
|
8512
|
+
return enqueuePasswordPrompt(async () => {
|
|
8513
|
+
const mask = opts.mask ?? S_PASSWORD_MASK;
|
|
8514
|
+
if (process.platform === "win32") {
|
|
8515
|
+
const { password: clackPassword, isCancel } = await import('./dist-WGIHRGBZ.js');
|
|
8516
|
+
const result = await clackPassword({ message: opts.message, mask });
|
|
8517
|
+
return isCancel(result) ? /* @__PURE__ */ Symbol("cancel") : result;
|
|
8518
|
+
}
|
|
8519
|
+
return new rt({
|
|
8520
|
+
mask,
|
|
8521
|
+
input: opts.input,
|
|
8522
|
+
output: opts.output,
|
|
8523
|
+
render() {
|
|
8524
|
+
const hintLine = opts.hint ? `${ansis_default.gray(S_BAR)} ${ansis_default.dim(opts.hint)}
|
|
8525
|
+
` : "";
|
|
8526
|
+
const title = `${ansis_default.gray(S_BAR)}
|
|
8527
|
+
${symbol(this.state)} ${opts.message}
|
|
8528
|
+
${hintLine}`;
|
|
8529
|
+
const value = this.value ? String(this.value) : "";
|
|
8530
|
+
const masked = value ? mask.repeat(value.length) : "";
|
|
8531
|
+
switch (this.state) {
|
|
8532
|
+
case "submit":
|
|
8533
|
+
return `${title}${ansis_default.gray(S_BAR)} ${ansis_default.dim(masked)}`;
|
|
8534
|
+
case "cancel":
|
|
8535
|
+
return `${title}${ansis_default.gray(S_BAR)} ${ansis_default.strikethrough(ansis_default.dim(masked))}
|
|
8536
|
+
${ansis_default.gray(S_BAR)}`;
|
|
8537
|
+
case "error":
|
|
8538
|
+
return `${title}${ansis_default.yellow(S_BAR)} ${masked}
|
|
8539
|
+
${ansis_default.yellow(S_BAR_END)} ${ansis_default.yellow(this.error)}`;
|
|
8540
|
+
default:
|
|
8541
|
+
return `${title}${ansis_default.cyan(S_BAR)} ${masked}
|
|
8542
|
+
${ansis_default.cyan(S_BAR_END)}
|
|
8543
|
+
`;
|
|
8544
|
+
}
|
|
8545
|
+
}
|
|
8546
|
+
}).prompt();
|
|
8547
|
+
});
|
|
8548
|
+
}, "password");
|
|
9345
8549
|
var prompts = {
|
|
9346
8550
|
confirm,
|
|
9347
8551
|
select,
|
|
9348
|
-
multiselect
|
|
8552
|
+
multiselect,
|
|
8553
|
+
password
|
|
9349
8554
|
};
|
|
9350
8555
|
var prompts_default = prompts;
|
|
9351
8556
|
var debug = createDebug("varlock:workspace-utils");
|
|
@@ -9825,7 +9030,7 @@ async function isPluginCached(url) {
|
|
|
9825
9030
|
}
|
|
9826
9031
|
__name(isPluginCached, "isPluginCached");
|
|
9827
9032
|
async function downloadPlugin(url) {
|
|
9828
|
-
const
|
|
9033
|
+
const exec3 = promisify(exec);
|
|
9829
9034
|
const cacheDir = path3.join(getUserVarlockDir(), "plugins-cache");
|
|
9830
9035
|
const indexPath = path3.join(cacheDir, "index.json");
|
|
9831
9036
|
await fs3.mkdir(cacheDir, { recursive: true });
|
|
@@ -9856,7 +9061,7 @@ async function downloadPlugin(url) {
|
|
|
9856
9061
|
});
|
|
9857
9062
|
const tmpExtractDir = path3.join(cacheDir, `tmp-extract-${crypto2.randomBytes(8).toString("hex")}`);
|
|
9858
9063
|
await fs3.mkdir(tmpExtractDir);
|
|
9859
|
-
await
|
|
9064
|
+
await exec3(`tar -xzf ${tmpTgz} -C ${tmpExtractDir}`);
|
|
9860
9065
|
let pkgJsonPath = path3.join(tmpExtractDir, "package", "package.json");
|
|
9861
9066
|
let pluginRoot = path3.join(tmpExtractDir, "package");
|
|
9862
9067
|
if (!await fs3.stat(pkgJsonPath).then(() => true, () => false)) {
|
|
@@ -10330,7 +9535,7 @@ var EnvGraphDataSource2 = class {
|
|
|
10330
9535
|
}
|
|
10331
9536
|
if (this.graph.virtualImports) {
|
|
10332
9537
|
if (importPath.endsWith("/")) {
|
|
10333
|
-
const dirExists = Object.keys(this.graph.virtualImports).some((
|
|
9538
|
+
const dirExists = Object.keys(this.graph.virtualImports).some((p) => p.startsWith(fullImportPath));
|
|
10334
9539
|
if (!dirExists && allowMissing) continue;
|
|
10335
9540
|
if (!dirExists) {
|
|
10336
9541
|
this._loadingError = new Error(`Virtual directory import ${fullImportPath} not found`);
|
|
@@ -10445,11 +9650,11 @@ var EnvGraphDataSource2 = class {
|
|
|
10445
9650
|
get schemaErrors() {
|
|
10446
9651
|
return my_dash_default.compact([
|
|
10447
9652
|
...this._schemaErrors,
|
|
10448
|
-
...this.rootDecorators.flatMap((
|
|
9653
|
+
...this.rootDecorators.flatMap((d) => d.schemaErrors)
|
|
10449
9654
|
]);
|
|
10450
9655
|
}
|
|
10451
9656
|
get resolutionErrors() {
|
|
10452
|
-
return my_dash_default.compact([...this.rootDecorators.flatMap((
|
|
9657
|
+
return my_dash_default.compact([...this.rootDecorators.flatMap((d) => d._executionError)]);
|
|
10453
9658
|
}
|
|
10454
9659
|
get isValid() {
|
|
10455
9660
|
return !this.loadingError && !this.schemaErrors.some((e) => !e.isWarning) && !this.resolutionErrors.length;
|
|
@@ -10457,7 +9662,7 @@ var EnvGraphDataSource2 = class {
|
|
|
10457
9662
|
configItemDefs = {};
|
|
10458
9663
|
decorators = [];
|
|
10459
9664
|
getRootDecorators(decName) {
|
|
10460
|
-
return this.decorators.filter((
|
|
9665
|
+
return this.decorators.filter((d) => d.name === decName);
|
|
10461
9666
|
}
|
|
10462
9667
|
getRootDecoratorSimpleValue(decName) {
|
|
10463
9668
|
const decorators = this.getRootDecorators(decName);
|
|
@@ -10467,10 +9672,10 @@ var EnvGraphDataSource2 = class {
|
|
|
10467
9672
|
}
|
|
10468
9673
|
rootDecorators = [];
|
|
10469
9674
|
getRootDec(decName) {
|
|
10470
|
-
return this.rootDecorators.find((
|
|
9675
|
+
return this.rootDecorators.find((d) => d.name === decName && !d.isFunctionCall);
|
|
10471
9676
|
}
|
|
10472
9677
|
getRootDecFns(decName) {
|
|
10473
|
-
return this.rootDecorators.filter((
|
|
9678
|
+
return this.rootDecorators.filter((d) => d.name === decName && d.isFunctionCall);
|
|
10474
9679
|
}
|
|
10475
9680
|
};
|
|
10476
9681
|
var ImportAliasSource = class extends EnvGraphDataSource2 {
|
|
@@ -10584,7 +9789,7 @@ var DotEnvFileDataSource = class extends FileBasedDataSource {
|
|
|
10584
9789
|
if (this.loadingError) return;
|
|
10585
9790
|
if (!this.parsedFile) throw new Error("Failed to parse .env file");
|
|
10586
9791
|
if (!this.graph) throw new Error("expected graph to be set");
|
|
10587
|
-
this.rootDecorators = this.parsedFile.decoratorsArray.map((
|
|
9792
|
+
this.rootDecorators = this.parsedFile.decoratorsArray.map((d) => new RootDecoratorInstance2(this, d));
|
|
10588
9793
|
this._validateDecoratorPlacement(this.parsedFile);
|
|
10589
9794
|
for (const item of this.parsedFile.configItems) {
|
|
10590
9795
|
this.configItemDefs[item.key] = {
|
|
@@ -11080,7 +10285,7 @@ var builtInRootDecorators = [
|
|
|
11080
10285
|
dataSource._loadingError = err instanceof SchemaError ? err : new SchemaError(err);
|
|
11081
10286
|
return;
|
|
11082
10287
|
}
|
|
11083
|
-
const { ConfigItem: ConfigItem2 } = await import('./config-item-
|
|
10288
|
+
const { ConfigItem: ConfigItem2 } = await import('./config-item-2FQ6I6PO.js');
|
|
11084
10289
|
for (const [key, entry] of Object.entries(entries)) {
|
|
11085
10290
|
const existsInSchema = key in graph.configSchema;
|
|
11086
10291
|
if (!existsInSchema && !createMissing) {
|
|
@@ -11915,8 +11120,8 @@ var NumberDataType = createEnvGraphDataType(
|
|
|
11915
11120
|
if (settings?.isInt === true || settings?.precision === 0) {
|
|
11916
11121
|
numVal = Math.round(numVal);
|
|
11917
11122
|
} else if (settings?.precision) {
|
|
11918
|
-
const
|
|
11919
|
-
numVal = Math.round(numVal *
|
|
11123
|
+
const p = 10 ** settings.precision;
|
|
11124
|
+
numVal = Math.round(numVal * p) / p;
|
|
11920
11125
|
}
|
|
11921
11126
|
return numVal;
|
|
11922
11127
|
},
|
|
@@ -12251,7 +11456,7 @@ var ConfigItem = class {
|
|
|
12251
11456
|
* This is useful for explaining where a value comes from regardless of overrides.
|
|
12252
11457
|
*/
|
|
12253
11458
|
get activeValueDef() {
|
|
12254
|
-
const hasInternalResolver = this._internalDefs.some((
|
|
11459
|
+
const hasInternalResolver = this._internalDefs.some((d) => d.itemDef.resolver);
|
|
12255
11460
|
for (const def of this.defs) {
|
|
12256
11461
|
if (def.itemDef.resolver) {
|
|
12257
11462
|
if (hasInternalResolver && def.itemDef.resolver instanceof StaticValueResolver && !def.itemDef.resolver.staticValue) {
|
|
@@ -12265,7 +11470,7 @@ var ConfigItem = class {
|
|
|
12265
11470
|
if (this.isOverridden) {
|
|
12266
11471
|
return new StaticValueResolver(this.envGraph.overrideValues[this.key]);
|
|
12267
11472
|
}
|
|
12268
|
-
const hasInternalResolver = this._internalDefs.some((
|
|
11473
|
+
const hasInternalResolver = this._internalDefs.some((d) => d.itemDef.resolver);
|
|
12269
11474
|
for (const def of this.defs) {
|
|
12270
11475
|
if (def.itemDef.resolver) {
|
|
12271
11476
|
if (hasInternalResolver && def.itemDef.resolver instanceof StaticValueResolver && !def.itemDef.resolver.staticValue) {
|
|
@@ -12300,7 +11505,7 @@ var ConfigItem = class {
|
|
|
12300
11505
|
return this.valueResolver?.schemaErrors || [];
|
|
12301
11506
|
}
|
|
12302
11507
|
get decoratorSchemaErrors() {
|
|
12303
|
-
return my_dash_default.values(this.allDecorators).flatMap((
|
|
11508
|
+
return my_dash_default.values(this.allDecorators).flatMap((d) => d.schemaErrors);
|
|
12304
11509
|
}
|
|
12305
11510
|
isProcessed = false;
|
|
12306
11511
|
async process() {
|
|
@@ -12319,10 +11524,10 @@ var ConfigItem = class {
|
|
|
12319
11524
|
}
|
|
12320
11525
|
for (const def of this.defs) {
|
|
12321
11526
|
def.itemDef.decorators = def.itemDef.parsedDecorators?.map(
|
|
12322
|
-
(
|
|
11527
|
+
(d) => new ItemDecoratorInstance(this, def.source, d)
|
|
12323
11528
|
);
|
|
12324
11529
|
const decKeysInThisDef = /* @__PURE__ */ new Set();
|
|
12325
|
-
const allDecsInThisDef = def.itemDef.decorators?.map((
|
|
11530
|
+
const allDecsInThisDef = def.itemDef.decorators?.map((d) => d.name);
|
|
12326
11531
|
for (const dec of def.itemDef.decorators || []) {
|
|
12327
11532
|
await dec.process();
|
|
12328
11533
|
this.allDecorators?.push(dec);
|
|
@@ -12377,7 +11582,7 @@ var ConfigItem = class {
|
|
|
12377
11582
|
),
|
|
12378
11583
|
...my_dash_default.values(this.effectiveDecoratorFns).flatMap(
|
|
12379
11584
|
(decArr) => decArr.flatMap(
|
|
12380
|
-
(
|
|
11585
|
+
(d) => d.decValueResolver?.deps || []
|
|
12381
11586
|
)
|
|
12382
11587
|
)
|
|
12383
11588
|
]);
|
|
@@ -12406,46 +11611,46 @@ var ConfigItem = class {
|
|
|
12406
11611
|
async processRequired() {
|
|
12407
11612
|
try {
|
|
12408
11613
|
for (const def of this.defs) {
|
|
12409
|
-
const requiredDecs = def.itemDef.decorators?.filter((
|
|
11614
|
+
const requiredDecs = def.itemDef.decorators?.filter((d) => d.name === "required" || d.name === "optional") || [];
|
|
12410
11615
|
const requiredDec = requiredDecs[0];
|
|
12411
|
-
if (requiredDec)
|
|
12412
|
-
|
|
12413
|
-
|
|
12414
|
-
|
|
12415
|
-
|
|
12416
|
-
|
|
12417
|
-
|
|
12418
|
-
|
|
12419
|
-
|
|
12420
|
-
|
|
12421
|
-
|
|
12422
|
-
|
|
12423
|
-
}
|
|
12424
|
-
if (requiredDecoratorVal !== void 0) {
|
|
12425
|
-
this._isRequired = usingOptional ? !requiredDecoratorVal : requiredDecoratorVal;
|
|
12426
|
-
return;
|
|
12427
|
-
}
|
|
11616
|
+
if (!requiredDec) continue;
|
|
11617
|
+
const usingOptional = requiredDec.name === "optional";
|
|
11618
|
+
if (requiredDec.decValueResolver?.fnName !== "\0static") {
|
|
11619
|
+
this._isRequiredDynamic = true;
|
|
11620
|
+
}
|
|
11621
|
+
const requiredDecoratorVal = await requiredDec.resolve();
|
|
11622
|
+
if (requiredDec.schemaErrors.length) {
|
|
11623
|
+
this._isRequired = false;
|
|
11624
|
+
return;
|
|
11625
|
+
}
|
|
11626
|
+
if (![true, false, void 0].includes(requiredDecoratorVal)) {
|
|
11627
|
+
throw new SchemaError("@required/@optional must resolve to a boolean or undefined");
|
|
12428
11628
|
}
|
|
11629
|
+
if (requiredDecoratorVal !== void 0) {
|
|
11630
|
+
this._isRequired = usingOptional ? !requiredDecoratorVal : requiredDecoratorVal;
|
|
11631
|
+
return;
|
|
11632
|
+
}
|
|
11633
|
+
}
|
|
11634
|
+
for (const def of this.defs) {
|
|
12429
11635
|
const defaultRequiredDec = def.source?.getRootDec("defaultRequired");
|
|
12430
|
-
if (defaultRequiredDec)
|
|
12431
|
-
|
|
12432
|
-
|
|
12433
|
-
|
|
12434
|
-
|
|
12435
|
-
|
|
12436
|
-
|
|
12437
|
-
|
|
12438
|
-
|
|
12439
|
-
} else {
|
|
12440
|
-
this._isRequired = true;
|
|
12441
|
-
}
|
|
11636
|
+
if (!defaultRequiredDec) continue;
|
|
11637
|
+
const defaultRequiredVal = await defaultRequiredDec.resolve();
|
|
11638
|
+
if (my_dash_default.isBoolean(defaultRequiredVal)) {
|
|
11639
|
+
this._isRequired = defaultRequiredVal;
|
|
11640
|
+
return;
|
|
11641
|
+
} else if (defaultRequiredVal === "infer") {
|
|
11642
|
+
if (def.itemDef.resolver) {
|
|
11643
|
+
if (def.itemDef.resolver instanceof StaticValueResolver) {
|
|
11644
|
+
this._isRequired = def.itemDef.resolver.staticValue !== void 0 && def.itemDef.resolver.staticValue !== "";
|
|
12442
11645
|
} else {
|
|
12443
|
-
this._isRequired =
|
|
11646
|
+
this._isRequired = true;
|
|
12444
11647
|
}
|
|
12445
|
-
return;
|
|
12446
11648
|
} else {
|
|
12447
|
-
|
|
11649
|
+
this._isRequired = false;
|
|
12448
11650
|
}
|
|
11651
|
+
return;
|
|
11652
|
+
} else {
|
|
11653
|
+
throw new SchemaError('@defaultRequired must resolve to a boolean or "infer"');
|
|
12449
11654
|
}
|
|
12450
11655
|
}
|
|
12451
11656
|
} catch (err) {
|
|
@@ -12459,31 +11664,32 @@ var ConfigItem = class {
|
|
|
12459
11664
|
return this._isRequiredDynamic;
|
|
12460
11665
|
}
|
|
12461
11666
|
_isSensitive = true;
|
|
11667
|
+
_sensitiveExplicitlySet = false;
|
|
12462
11668
|
get isSensitive() {
|
|
12463
11669
|
return this._isSensitive;
|
|
12464
11670
|
}
|
|
12465
11671
|
async processSensitive() {
|
|
12466
11672
|
const sensitiveFromDataType = this.dataType?.isSensitive;
|
|
12467
11673
|
for (const def of this.defs) {
|
|
12468
|
-
const sensitiveDecs = def.itemDef.decorators?.filter((
|
|
11674
|
+
const sensitiveDecs = def.itemDef.decorators?.filter((d) => d.name === "sensitive" || d.name === "public") || [];
|
|
12469
11675
|
const sensitiveDec = sensitiveDecs[0];
|
|
12470
|
-
if (sensitiveDec)
|
|
12471
|
-
|
|
12472
|
-
|
|
12473
|
-
|
|
12474
|
-
|
|
12475
|
-
|
|
12476
|
-
|
|
12477
|
-
|
|
12478
|
-
|
|
12479
|
-
|
|
12480
|
-
|
|
12481
|
-
return;
|
|
12482
|
-
}
|
|
11676
|
+
if (!sensitiveDec) continue;
|
|
11677
|
+
const usingPublic = sensitiveDec.name === "public";
|
|
11678
|
+
const sensitiveDecValue = await sensitiveDec.resolve();
|
|
11679
|
+
if (sensitiveDec.schemaErrors.length) return;
|
|
11680
|
+
if (![true, false, void 0].includes(sensitiveDecValue)) {
|
|
11681
|
+
throw new SchemaError("@sensitive/@public must resolve to a boolean or undefined");
|
|
11682
|
+
}
|
|
11683
|
+
if (sensitiveDecValue !== void 0) {
|
|
11684
|
+
this._isSensitive = usingPublic ? !sensitiveDecValue : sensitiveDecValue;
|
|
11685
|
+
this._sensitiveExplicitlySet = true;
|
|
11686
|
+
return;
|
|
12483
11687
|
}
|
|
12484
|
-
|
|
12485
|
-
|
|
12486
|
-
|
|
11688
|
+
}
|
|
11689
|
+
if (sensitiveFromDataType === void 0) {
|
|
11690
|
+
for (const def of this.defs) {
|
|
11691
|
+
const defaultSensitiveDec = def.source?.getRootDec("defaultSensitive");
|
|
11692
|
+
if (!defaultSensitiveDec) continue;
|
|
12487
11693
|
if (!defaultSensitiveDec.decValueResolver) throw new Error("expected defaultSensitive to have a value resolver");
|
|
12488
11694
|
if (defaultSensitiveDec.decValueResolver.fnName === "inferFromPrefix") {
|
|
12489
11695
|
const prefix = defaultSensitiveDec.decValueResolver.arrArgs[0].staticValue;
|
|
@@ -12551,6 +11757,19 @@ var ConfigItem = class {
|
|
|
12551
11757
|
await this.resolveDecorators();
|
|
12552
11758
|
await this.processRequired();
|
|
12553
11759
|
await this.processSensitive();
|
|
11760
|
+
if (this.valueResolver?.def?.impliesSensitive && !this._sensitiveExplicitlySet) {
|
|
11761
|
+
const wasSensitive = this._isSensitive;
|
|
11762
|
+
this._isSensitive = true;
|
|
11763
|
+
if (!wasSensitive) {
|
|
11764
|
+
const hasSchemaSource = this.defs.some((d) => d.source && d.source.type !== "overrides");
|
|
11765
|
+
if (hasSchemaSource) {
|
|
11766
|
+
this._schemaErrors.push(new SchemaError(
|
|
11767
|
+
"implicitly treated as @sensitive \u2014 add @sensitive to schema",
|
|
11768
|
+
{ isWarning: true }
|
|
11769
|
+
));
|
|
11770
|
+
}
|
|
11771
|
+
}
|
|
11772
|
+
}
|
|
12554
11773
|
if (!this.valueResolver) {
|
|
12555
11774
|
this.isResolved = true;
|
|
12556
11775
|
this.resolvedRawValue = void 0;
|
|
@@ -12642,7 +11861,7 @@ var ConfigItem = class {
|
|
|
12642
11861
|
let isRequiredDynamic = false;
|
|
12643
11862
|
try {
|
|
12644
11863
|
for (const def of defs) {
|
|
12645
|
-
const requiredDecs = def.itemDef.decorators?.filter((
|
|
11864
|
+
const requiredDecs = def.itemDef.decorators?.filter((d) => d.name === "required" || d.name === "optional") || [];
|
|
12646
11865
|
const requiredDec = requiredDecs[0];
|
|
12647
11866
|
if (requiredDec) {
|
|
12648
11867
|
const usingOptional = requiredDec.name === "optional";
|
|
@@ -12688,7 +11907,7 @@ var ConfigItem = class {
|
|
|
12688
11907
|
try {
|
|
12689
11908
|
let foundSensitive = false;
|
|
12690
11909
|
for (const def of defs) {
|
|
12691
|
-
const sensitiveDecs = def.itemDef.decorators?.filter((
|
|
11910
|
+
const sensitiveDecs = def.itemDef.decorators?.filter((d) => d.name === "sensitive" || d.name === "public") || [];
|
|
12692
11911
|
const sensitiveDec = sensitiveDecs[0];
|
|
12693
11912
|
if (sensitiveDec) {
|
|
12694
11913
|
const usingPublic = sensitiveDec.name === "public";
|
|
@@ -12730,7 +11949,7 @@ var ConfigItem = class {
|
|
|
12730
11949
|
}
|
|
12731
11950
|
let icon;
|
|
12732
11951
|
for (const def of defs) {
|
|
12733
|
-
const iconDec = def.itemDef.decorators?.find((
|
|
11952
|
+
const iconDec = def.itemDef.decorators?.find((d) => d.name === "icon");
|
|
12734
11953
|
if (iconDec) {
|
|
12735
11954
|
try {
|
|
12736
11955
|
icon = await iconDec.resolve();
|
|
@@ -12748,7 +11967,7 @@ var ConfigItem = class {
|
|
|
12748
11967
|
}
|
|
12749
11968
|
}
|
|
12750
11969
|
for (const def of defs) {
|
|
12751
|
-
const docsUrlDec = def.itemDef.decorators?.find((
|
|
11970
|
+
const docsUrlDec = def.itemDef.decorators?.find((d) => d.name === "docsUrl");
|
|
12752
11971
|
if (docsUrlDec) {
|
|
12753
11972
|
try {
|
|
12754
11973
|
const val = await docsUrlDec.resolve();
|
|
@@ -12756,7 +11975,7 @@ var ConfigItem = class {
|
|
|
12756
11975
|
} catch {
|
|
12757
11976
|
}
|
|
12758
11977
|
}
|
|
12759
|
-
const docsFnDecs = def.itemDef.decorators?.filter((
|
|
11978
|
+
const docsFnDecs = def.itemDef.decorators?.filter((d) => d.name === "docs" && d.isFunctionCall) || [];
|
|
12760
11979
|
for (const docsDec of docsFnDecs) {
|
|
12761
11980
|
try {
|
|
12762
11981
|
const decVal = await docsDec.resolve();
|
|
@@ -12784,6 +12003,6 @@ var ConfigItem = class {
|
|
|
12784
12003
|
}
|
|
12785
12004
|
};
|
|
12786
12005
|
|
|
12787
|
-
export { ConfigItem, DirectoryDataSource, DotEnvFileDataSource, EnvGraph, FileBasedDataSource, MultiplePathsContainerDataSource, ParsedEnvSpecStaticValue, StaticValueResolver,
|
|
12788
|
-
//# sourceMappingURL=chunk-
|
|
12789
|
-
//# sourceMappingURL=chunk-
|
|
12006
|
+
export { ConfigItem, DirectoryDataSource, DotEnvFileDataSource, EnvGraph, FileBasedDataSource, MultiplePathsContainerDataSource, ParsedEnvSpecFunctionCall, ParsedEnvSpecStaticValue, StaticValueResolver, ansis_default, createResolver, detectWorkspaceInfo, downloadPluginToCache, envSpecUpdater, multiselect, parseEnvSpecDotEnvFile, password, pathExists, prompts_default, require_semver2 as require_semver, runWithWorkspaceInfo, select, spawnAsync, tryCatch };
|
|
12007
|
+
//# sourceMappingURL=chunk-U7RQPX5K.js.map
|
|
12008
|
+
//# sourceMappingURL=chunk-U7RQPX5K.js.map
|