@kaynooo/cli-db 0.11.0 → 0.12.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.
Files changed (2) hide show
  1. package/dist/cli.js +91 -270
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env bun
1
+ #!/usr/bin/env -S bun --config=/dev/null
2
2
  // @bun
3
3
 
4
4
  // src/cli.ts
@@ -9,7 +9,23 @@ import { parseArgs } from "util";
9
9
 
10
10
  // ../kit/src/format.ts
11
11
  import process7 from "process";
12
-
12
+ // ../../node_modules/.bun/@kaynooo+utils@3.0.0+4c7ddab9986847c5/node_modules/@kaynooo/utils/dist/chunk-rxztfxgv.js
13
+ var N = new Map;
14
+ var Nt = /\s+\S*$/;
15
+ var Y = /\s/;
16
+ function ko(t, e, r = "...") {
17
+ let { suffix: n = "...", includeSuffix: s = false, wordBoundary: o = false } = typeof r === "string" ? { suffix: r } : r;
18
+ if (t.length <= e)
19
+ return t;
20
+ let l = Math.max(0, e), c = t.substring(0, Math.max(0, s ? l - n.length : l));
21
+ if (o && !Y.test(t[c.length] ?? " "))
22
+ c = c.replace(Nt, "") || c;
23
+ if (o)
24
+ c = c.trimEnd();
25
+ return s ? (c + n).slice(0, l) : c + n;
26
+ }
27
+ var be = new Map(["\u20AC", "", "\u201A", "\u0192", "\u201E", "\u2026", "\u2020", "\u2021", "\u02C6", "\u2030", "\u0160", "\u2039", "\u0152", "", "\u017D", "", "", "\u2018", "\u2019", "\u201C", "\u201D", "\u2022", "\u2013", "\u2014", "\u02DC", "\u2122", "\u0161", "\u203A", "\u0153", "", "\u017E", "\u0178"].map((t, e) => [t, 128 + e]).filter(([t]) => t));
28
+ var z = new Map;
13
29
  // ../kit/src/mode.ts
14
30
  import process2 from "process";
15
31
  var MODES = new Set(["terminal", "ci", "agent", "pipe"]);
@@ -31,266 +47,60 @@ function outputMode(stream = process2.stdout, env = process2.env) {
31
47
  // ../kit/src/style.ts
32
48
  import process6 from "process";
33
49
 
34
- // ../../node_modules/.bun/@kaynooo+utils@2.31.2+d0769e28dc4dad16/node_modules/@kaynooo/utils/dist/chunk-mtetydvc.js
35
- function x(s) {
36
- let r = s.startsWith("#") ? s.slice(1).toLowerCase() : s.toLowerCase();
37
- if (!/^[a-f0-9]+$/.test(r))
50
+ // ../../node_modules/.bun/@kaynooo+utils@3.0.0+4c7ddab9986847c5/node_modules/@kaynooo/utils/dist/chunk-x450vn3m.js
51
+ var G2 = /^[a-f0-9]+$/i;
52
+ function b(r) {
53
+ let e = r.startsWith("#") ? r.slice(1) : r;
54
+ if (!G2.test(e))
38
55
  return [0, 0, 0];
39
- let t = r.length, n = (c) => Number.parseInt(c, 16);
40
- if (t === 3 || t === 4) {
41
- let c = n(r[0] + r[0]), u = n(r[1] + r[1]), h = n(r[2] + r[2]), g = t === 4 ? n(r[3] + r[3]) : undefined;
42
- return g !== undefined ? [c, u, h, g] : [c, u, h];
43
- }
44
- if (t !== 6 && t !== 8)
45
- throw Error(`Invalid hex color length: ${t}`);
46
- let a = n(r.slice(0, 2)), b = n(r.slice(2, 4)), o = n(r.slice(4, 6)), y = t === 8 ? n(r.slice(6, 8)) : undefined;
47
- if ([a, b, o].some(Number.isNaN) || y !== undefined && Number.isNaN(y))
48
- throw Error(`Invalid hex color value: ${s}`);
49
- return y !== undefined ? [a, b, o, y] : [a, b, o];
50
- }
51
- function A(s) {
52
- let [r, t, n, a] = s;
53
- if (a)
54
- return `#${(r << 24 | t << 16 | n << 8 | Math.round((a ?? 1) * 255)).toString(16).padStart(8, "0").toUpperCase()}`;
55
- return `#${(r << 16 | t << 8 | n).toString(16).padStart(6, "0").toUpperCase()}`;
56
- }
57
- function R(s, r, t) {
58
- s = (s % 360 + 360) % 360, t /= 100;
59
- let n = r * Math.min(t, 1 - t) / 100, a = (b) => {
60
- let o = (b + s / 30) % 12, y = t - n * Math.max(Math.min(o - 3, 9 - o, 1), -1);
61
- return Math.round(255 * y);
62
- };
63
- return [a(0), a(8), a(4)];
64
- }
65
- function k(s) {
66
- let [r, t, n] = s;
67
- r /= 255, t /= 255, n /= 255;
68
- let a = Math.max(r, t, n), b = Math.min(r, t, n), o = 0, y = 0, c = (a + b) / 2;
69
- if (a !== b) {
70
- let u = a - b;
71
- if (y = c > 0 && c < 1 ? u / (1 - Math.abs(2 * c - 1)) : 0, a === r)
72
- o = (t - n) / u + (t < n ? 6 : 0);
73
- else if (a === t)
74
- o = (n - r) / u + 2;
75
- else
76
- o = (r - t) / u + 4;
77
- o /= 6;
78
- }
79
- return [Math.round(o * 360), Math.round(y * 100), Math.round(c * 100)];
80
- }
81
- function H(s, r, t) {
82
- s = (s % 360 + 360) % 360, r /= 100, t /= 100;
83
- let n = (a) => {
84
- let b = (a + s / 60) % 6, o = t - t * r * Math.max(Math.min(b, 4 - b, 1), 0);
85
- return Math.round(255 * o);
86
- };
87
- return [n(5), n(3), n(1)];
88
- }
89
- function f(s) {
90
- let [r, t, n] = s;
91
- r /= 255, t /= 255, n /= 255;
92
- let a = Math.max(r, t, n), b = Math.min(r, t, n), o = a - b, y = 0, c = a === 0 ? 0 : o / a, u = a;
93
- if (o !== 0) {
94
- if (a === r)
95
- y = (t - n) / o + (t < n ? 6 : 0);
96
- else if (a === t)
97
- y = (n - r) / o + 2;
98
- else
99
- y = (r - t) / o + 4;
100
- y /= 6;
101
- }
102
- return [Math.round(y * 360), Math.round(c * 100), Math.round(u * 100)];
103
- }
104
- function O(s) {
105
- let r = s[0] / 255, t = s[1] / 255, n = s[2] / 255, a = 1 - Math.max(r, t, n);
106
- if (a === 1)
107
- return [0, 0, 0, 100];
108
- let b = (1 - r - a) / (1 - a), o = (1 - t - a) / (1 - a), y = (1 - n - a) / (1 - a);
109
- return [Math.round(b * 100), Math.round(o * 100), Math.round(y * 100), Math.round(a * 100)];
110
- }
111
- function v(s, r, t, n) {
112
- return s /= 100, r /= 100, t /= 100, n /= 100, [Math.round(255 * (1 - s) * (1 - n)), Math.round(255 * (1 - r) * (1 - n)), Math.round(255 * (1 - t) * (1 - n))];
113
- }
114
- var m = (s) => s <= 0.04045 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;
115
- var p = (s) => s <= 0.0031308 ? 12.92 * s : 1.055 * s ** 0.4166666666666667 - 0.055;
116
- var i = (s, r) => Math.round(s * 10 ** r) / 10 ** r;
117
- function T(s) {
118
- let r = m(s[0] / 255), t = m(s[1] / 255), n = m(s[2] / 255), a = Math.cbrt(0.4122214708 * r + 0.5363325363 * t + 0.0514459929 * n), b = Math.cbrt(0.2119034982 * r + 0.6806995451 * t + 0.1073969566 * n), o = Math.cbrt(0.0883024619 * r + 0.2817188376 * t + 0.6299787005 * n);
119
- return [i(0.2104542553 * a + 0.793617785 * b - 0.0040720468 * o, 4), i(1.9779984951 * a - 2.428592205 * b + 0.4505937099 * o, 4), i(0.0259040371 * a + 0.7827717662 * b - 0.808675766 * o, 4)];
120
- }
121
- function M(s, r, t) {
122
- let n = (s + 0.3963377774 * r + 0.2158037573 * t) ** 3, a = (s - 0.1055613458 * r - 0.0638541728 * t) ** 3, b = (s - 0.0894841775 * r - 1.291485548 * t) ** 3, o = p(4.0767416621 * n - 3.3077115913 * a + 0.2309699292 * b), y = p(-1.2684380046 * n + 2.6097574011 * a - 0.3413193965 * b), c = p(-0.0041960863 * n - 0.7034186147 * a + 1.707614701 * b), u = (h) => Math.min(255, Math.max(0, Math.round(h * 255)));
123
- return [u(o), u(y), u(c)];
124
- }
125
- function d(s) {
126
- let [r, t, n] = T(s), a = Math.sqrt(t * t + n * n), b = (Math.atan2(n, t) * 180 / Math.PI + 360) % 360;
127
- return [i(r, 4), i(a, 4), i(b, 2)];
128
- }
129
- function C(s, r, t) {
130
- let n = t * Math.PI / 180;
131
- return M(s, r * Math.cos(n), r * Math.sin(n));
132
- }
133
- function l(s) {
134
- let r = s / 255;
135
- return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
136
- }
137
-
138
- class e {
139
- r;
140
- g;
141
- b;
142
- a;
143
- constructor(s, r, t, n = 1) {
144
- this.r = s, this.g = r, this.b = t, this.a = n;
145
- }
146
- static from(s, r) {
147
- if (s === "hex") {
148
- let [t, n, a, b] = x(r);
149
- return new e(t, n, a, b);
150
- }
151
- if (s === "rgb") {
152
- if (Array.isArray(r)) {
153
- let [o, y, c, u] = r;
154
- return new e(o, y, c, u);
155
- }
156
- let { r: t, g: n, b: a, a: b } = r;
157
- return new e(t, n, a, b);
158
- }
159
- if (s === "hsl") {
160
- let t, n, a, b;
161
- if (Array.isArray(r))
162
- [t, n, a, b] = r;
163
- else
164
- ({ h: t, s: n, l: a, a: b } = r);
165
- let [o, y, c] = R(t, n, a);
166
- return new e(o, y, c, b);
167
- }
168
- if (s === "hsv") {
169
- let t, n, a, b;
170
- if (Array.isArray(r))
171
- [t, n, a, b] = r;
172
- else
173
- ({ h: t, s: n, v: a, a: b } = r);
174
- let [o, y, c] = H(t, n, a);
175
- return new e(o, y, c, b);
176
- }
177
- if (s === "cmyk") {
178
- let t, n, a, b, o;
179
- if (Array.isArray(r))
180
- [t, n, a, b, o] = r;
181
- else
182
- ({ c: t, m: n, y: a, k: b, a: o } = r);
183
- let [y, c, u] = v(t, n, a, b);
184
- return new e(y, c, u, o);
185
- }
186
- if (s === "oklch") {
187
- let t, n, a, b;
188
- if (Array.isArray(r))
189
- [t, n, a, b] = r;
190
- else
191
- ({ l: t, c: n, h: a, a: b } = r);
192
- let [o, y, c] = C(t, n, a);
193
- return new e(o, y, c, b);
194
- }
195
- if (s === "oklab") {
196
- let t, n, a, b;
197
- if (Array.isArray(r))
198
- [t, n, a, b] = r;
199
- else
200
- ({ l: t, a: n, b: a, alpha: b } = r);
201
- let [o, y, c] = M(t, n, a);
202
- return new e(o, y, c, b);
203
- }
204
- throw Error("Invalid input");
205
- }
206
- to(s) {
207
- switch (s) {
208
- case "rgb":
209
- return [this.r, this.g, this.b];
210
- case "rgba":
211
- return [this.r, this.g, this.b, this.a];
212
- case "hex":
213
- return A([this.r, this.g, this.b]);
214
- case "hexa":
215
- return A([this.r, this.g, this.b, this.a]);
216
- case "hsl":
217
- return k([this.r, this.g, this.b]);
218
- case "hsla":
219
- return [...k([this.r, this.g, this.b]), this.a];
220
- case "hsv":
221
- return f([this.r, this.g, this.b]);
222
- case "hsva":
223
- return [...f([this.r, this.g, this.b]), this.a];
224
- case "cmyk":
225
- return O([this.r, this.g, this.b]);
226
- case "cmyka":
227
- return [...O([this.r, this.g, this.b]), this.a];
228
- case "oklch":
229
- return d([this.r, this.g, this.b]);
230
- case "oklcha":
231
- return [...d([this.r, this.g, this.b]), this.a];
232
- case "oklab":
233
- return T([this.r, this.g, this.b]);
234
- case "oklaba":
235
- return [...T([this.r, this.g, this.b]), this.a];
236
- default:
237
- return [this.r, this.g, this.b];
238
- }
239
- }
240
- getLuminance() {
241
- let s = l(this.r), r = l(this.g), t = l(this.b);
242
- return 0.2126 * s + 0.7152 * r + 0.0722 * t;
243
- }
244
- contrastRatio(s) {
245
- let r = this.getLuminance(), t = s.getLuminance(), [n, a] = r >= t ? [r, t] : [t, r];
246
- return (n + 0.05) / (a + 0.05);
247
- }
248
- bestContrastForeground() {
249
- let s = new e(255, 255, 255, 1), r = new e(0, 0, 0, 1), t = this.contrastRatio(s), n = this.contrastRatio(r);
250
- return t >= n ? s : r;
251
- }
252
- }
253
-
254
- // ../../node_modules/.bun/@kaynooo+utils@2.31.2+d0769e28dc4dad16/node_modules/@kaynooo/utils/dist/chunk-y1msbssb.js
255
- var r = 39;
256
- var o = 49;
257
- var f2 = "\x1B[";
258
- var C2 = { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29], black: [30, r], red: [31, r], green: [32, r], yellow: [33, r], blue: [34, r], magenta: [35, r], cyan: [36, r], white: [37, r], gray: [90, r], grey: [90, r], blackBright: [90, r], redBright: [91, r], greenBright: [92, r], yellowBright: [93, r], blueBright: [94, r], magentaBright: [95, r], cyanBright: [96, r], whiteBright: [97, r], bgBlack: [40, o], bgRed: [41, o], bgGreen: [42, o], bgYellow: [43, o], bgBlue: [44, o], bgMagenta: [45, o], bgCyan: [46, o], bgWhite: [47, o], bgBlackBright: [100, o], bgRedBright: [101, o], bgGreenBright: [102, o], bgYellowBright: [103, o], bgBlueBright: [104, o], bgMagentaBright: [105, o], bgCyanBright: [106, o], bgWhiteBright: [107, o], rgb: (i, n, a, l = "fg") => [`${l === "fg" ? 38 : 48};2;${i};${n};${a}`, l === "fg" ? r : o], hex: (i, n = "fg") => {
259
- let [a, l, s] = e.from("hex", i).to("rgb");
260
- return [`${n === "fg" ? 38 : 48};2;${a};${l};${s}`, n === "fg" ? r : o];
261
- }, ansi256: (i, n = "fg") => [`${n === "fg" ? 38 : 48};5;${i}`, n === "fg" ? r : o] };
262
- var b = new Set(["", "1", "2", "3", "true"]);
263
- function h(i, n = globalThis.process?.env ?? {}) {
264
- if (n.FORCE_COLOR !== undefined)
265
- return b.has(n.FORCE_COLOR);
266
- if (n.NO_COLOR !== undefined || n.NODE_DISABLE_COLORS !== undefined || n.TERM === "dumb")
56
+ if (e.length === 3 || e.length === 4)
57
+ return [Number.parseInt(e[0] + e[0], 16), Number.parseInt(e[1] + e[1], 16), Number.parseInt(e[2] + e[2], 16)];
58
+ if (e.length !== 6 && e.length !== 8)
59
+ throw Error(`Invalid hex color length: ${e.length}`);
60
+ return [Number.parseInt(e.slice(0, 2), 16), Number.parseInt(e.slice(2, 4), 16), Number.parseInt(e.slice(4, 6), 16)];
61
+ }
62
+ var B2 = { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29], black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], gray: [90, 39], grey: [90, 39], blackBright: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39], bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49], rgb: (r, e, l, n = "fg") => [`${n === "fg" ? 38 : 48};2;${r};${e};${l}`, n === "fg" ? 39 : 49], hex: (r, e = "fg") => {
63
+ let [l, n, c] = b(r);
64
+ return [`${e === "fg" ? 38 : 48};2;${l};${n};${c}`, e === "fg" ? 39 : 49];
65
+ }, ansi256: (r, e = "fg") => [`${e === "fg" ? 38 : 48};5;${r}`, e === "fg" ? 39 : 49] };
66
+ var h = new Set(["", "1", "2", "3", "true"]);
67
+ function C(r, e = globalThis.process?.env ?? {}) {
68
+ if (e.FORCE_COLOR !== undefined)
69
+ return h.has(e.FORCE_COLOR);
70
+ if (e.NO_COLOR !== undefined || e.NODE_DISABLE_COLORS !== undefined || e.TERM === "dumb")
267
71
  return false;
268
- return i?.isTTY === true;
269
- }
270
- function d2(i, n, a) {
271
- if (!h(a.stream ?? globalThis.process?.stdout, a.env))
272
- return n;
273
- let l = "", s = "";
274
- for (let g = 0, y = i.length;g < y; g++) {
275
- let [c, p] = i[g];
276
- l += `${f2}${c}m`, s = `${f2}${p}m${s}`;
277
- }
278
- return l + n + s;
279
- }
280
- function u(i, n = []) {
281
- return new Proxy((l) => d2(n, l, i), { get(l, s) {
282
- let g = C2[s];
283
- if (Array.isArray(g))
284
- return u(i, [...n, g]);
285
- if (typeof g === "function")
286
- return (...y) => u(i, [...n, g(...y)]);
287
- throw Error(`Unknown style: ${String(s)}`);
72
+ return r?.isTTY === true;
73
+ }
74
+ function f2(r, e = []) {
75
+ let l = "", n = "";
76
+ for (let t = 0, i = e.length;t < i; t++)
77
+ l += `\x1B[${e[t][0]}m`, n = `\x1B[${e[t][1]}m${n}`;
78
+ let c = (t) => C(r.stream ?? globalThis.process?.stdout, r.env) ? l + t + n : t, g = new Map;
79
+ return new Proxy(c, { get(t, i) {
80
+ let a = B2[i];
81
+ if (Array.isArray(a)) {
82
+ let s = g.get(i);
83
+ if (s === undefined)
84
+ s = f2(r, [...e, a]), g.set(i, s);
85
+ return s;
86
+ }
87
+ if (typeof a === "function")
88
+ return (...s) => {
89
+ let y = `${i}:${s.join(",")}`, u = g.get(y);
90
+ if (u === undefined) {
91
+ if (g.size >= 64)
92
+ g.clear();
93
+ u = f2(r, [...e, a(...s)]), g.set(y, u);
94
+ }
95
+ return u;
96
+ };
97
+ throw Error(`Unknown style: ${String(i)}`);
288
98
  } });
289
99
  }
290
- function le(i = {}) {
291
- return u(i);
100
+ function Fe2(r = {}) {
101
+ return f2(r);
292
102
  }
293
- var t = le();
103
+ var o2 = Fe2();
294
104
 
295
105
  // ../kit/src/theme.ts
296
106
  import { existsSync as existsSync3, readFileSync, statSync } from "fs";
@@ -334,19 +144,21 @@ function userConfigReadPath(bin, legacy = [], where = {}) {
334
144
  }
335
145
 
336
146
  // ../kit/src/theme.ts
147
+ var ENDS = new Map;
337
148
  var DEFAULT = {
338
- colors: { accent: "cyan", id: "yellow", path: "blue", label: "dim", value: "bold", ok: "green", warn: "yellow", problem: "red", note: "dim", passed: "green", failed: "red", running: "cyan", queued: "yellow", skipped: "dim" },
339
- glyphs: { ok: "\u2713", warn: "\u25B2", problem: "\u2717", note: "\u203A", passed: "\u2713", failed: "\u2717", running: "\u25CF", queued: "\u25CB", skipped: "-", bar: "\u2501" },
149
+ colors: { accent: "cyan", id: "yellow", path: "blue", label: "dim", value: "bold", ok: "green", warn: "yellow", problem: "red", note: "dim", plan: "magenta", passed: "green", failed: "red", running: "cyan", queued: "yellow", skipped: "dim" },
150
+ glyphs: { ok: "\u2713", warn: "\u25B2", problem: "\u2717", note: "\u203A", plan: "\u25C7", passed: "\u2713", failed: "\u2717", running: "\u25CF", queued: "\u25CB", skipped: "-", bar: "\u2501", rule: "\u2500", corner: "\u256D", open: "\u2022", leaf: "\xB7", guide: "\u2502" },
340
151
  accents: ["cyan", "magenta", "green", "blue", "yellow", "redBright"],
341
- bins: {}
152
+ bins: {},
153
+ gradient: ["#c084fc", "#67e8f9"]
342
154
  };
343
- var BRIGHT = { accent: "cyanBright", id: "yellowBright", path: "blueBright", label: "white", value: "bold whiteBright", ok: "greenBright", warn: "yellowBright", problem: "redBright", note: "white", passed: "greenBright", failed: "redBright", running: "cyanBright", queued: "yellowBright", skipped: "white" };
344
- var MONO = { accent: "bold", id: "bold", path: "underline", label: "dim", value: "bold", ok: "bold", warn: "bold", problem: "bold", note: "dim", passed: "bold", failed: "bold", running: "bold", queued: "dim", skipped: "dim" };
345
- var ASCII = { ok: "+", warn: "!", problem: "x", note: ">", passed: "+", failed: "x", running: "*", queued: "o", skipped: "-", bar: "#" };
155
+ var BRIGHT = { accent: "cyanBright", id: "yellowBright", path: "blueBright", label: "white", value: "bold whiteBright", ok: "greenBright", warn: "yellowBright", problem: "redBright", note: "white", plan: "magentaBright", passed: "greenBright", failed: "redBright", running: "cyanBright", queued: "yellowBright", skipped: "white" };
156
+ var MONO = { accent: "bold", id: "bold", path: "underline", label: "dim", value: "bold", ok: "bold", warn: "bold", problem: "bold", note: "dim", plan: "dim", passed: "bold", failed: "bold", running: "bold", queued: "dim", skipped: "dim" };
157
+ var ASCII = { ok: "+", warn: "!", problem: "x", note: ">", plan: "?", passed: "+", failed: "x", running: "*", queued: "o", skipped: "-", bar: "#", rule: "-", corner: "+", open: "*", leaf: "-", guide: "|" };
346
158
  var PRESETS = {
347
159
  default: {},
348
- "high-contrast": { colors: BRIGHT, accents: ["cyanBright", "magentaBright", "greenBright", "blueBright", "yellowBright", "redBright"] },
349
- mono: { colors: MONO, accents: ["bold"] },
160
+ "high-contrast": { colors: BRIGHT, accents: ["cyanBright", "magentaBright", "greenBright", "blueBright", "yellowBright", "redBright"], gradient: ["#d8b4fe", "#a5f3fc"] },
161
+ mono: { colors: MONO, accents: ["bold"], gradient: undefined },
350
162
  ascii: { glyphs: ASCII }
351
163
  };
352
164
  var STYLES = new Set(["bold", "dim", "italic", "underline", "inverse", "strikethrough", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white", "gray", "grey", "blackBright", "redBright", "greenBright", "yellowBright", "blueBright", "magentaBright", "cyanBright", "whiteBright"]);
@@ -417,6 +229,8 @@ function applyPreset(theme, name, warn, where) {
417
229
  Object.assign(theme.glyphs, preset.glyphs);
418
230
  if (preset.accents !== undefined)
419
231
  theme.accents = [...preset.accents];
232
+ if (Object.hasOwn(preset, "gradient"))
233
+ theme.gradient = preset.gradient;
420
234
  return name;
421
235
  }
422
236
  function applyFile(theme, file, where, warn) {
@@ -444,6 +258,12 @@ function applyFile(theme, file, where, warn) {
444
258
  theme.accents = [...file.accents];
445
259
  else if (file.accents !== undefined)
446
260
  warn(`${where}: accents must be a non-empty list of colours`);
261
+ if (file.gradient === null)
262
+ theme.gradient = undefined;
263
+ else if (Array.isArray(file.gradient) && file.gradient.length === 2 && file.gradient.every((end) => typeof end === "string" && HEX.test(end)))
264
+ theme.gradient = [file.gradient[0], file.gradient[1]];
265
+ else if (file.gradient !== undefined)
266
+ warn(`${where}: gradient must be two \`#rrggbb\` colours, or null for none`);
447
267
  if (isRecord(file.bins)) {
448
268
  for (const [bin, value] of Object.entries(file.bins)) {
449
269
  if (isColorSpec(value))
@@ -467,7 +287,7 @@ function isPath(chosen) {
467
287
  return chosen.includes("/") || chosen.endsWith(".json");
468
288
  }
469
289
  function loadTheme({ env = process5.env, from = process5.cwd(), home = homedir2(), warn = warnOnce } = {}) {
470
- const theme = { colors: { ...DEFAULT.colors }, glyphs: { ...DEFAULT.glyphs }, accents: [...DEFAULT.accents], bins: Object.create(null) };
290
+ const theme = { colors: { ...DEFAULT.colors }, glyphs: { ...DEFAULT.glyphs }, accents: [...DEFAULT.accents], bins: Object.create(null), gradient: DEFAULT.gradient };
471
291
  const sources = [];
472
292
  const chosen = env.KIT_THEME ?? "";
473
293
  const wanted = chosen === "" ? [userConfigPath("theme", { home, xdg: env.XDG_CONFIG_HOME }), findUp(join3(".kaynooo", "theme.json"), from, endsWalk(home))] : [];
@@ -505,12 +325,12 @@ function activeTheme() {
505
325
  }
506
326
 
507
327
  // ../kit/src/style.ts
508
- var MARK_WORDS = { ok: "ok:", warn: "warning:", problem: "error:", note: "note:" };
328
+ var MARK_WORDS = { ok: "ok:", warn: "warning:", problem: "error:", note: "note:", plan: "would:" };
509
329
  function takesControlCodes(stream, env = process6.env) {
510
330
  return stream.isTTY === true && env.NO_COLOR === undefined && env.NODE_DISABLE_COLORS === undefined && env.TERM !== "dumb" && outputMode(stream, env) === "terminal";
511
331
  }
512
332
  function paint(stream, env = process6.env) {
513
- return le({ stream: { isTTY: takesControlCodes(stream, env) }, env });
333
+ return Fe2({ stream: { isTTY: takesControlCodes(stream, env) }, env });
514
334
  }
515
335
  function marked(mark, text, stream, detail, env = process6.env) {
516
336
  const colors = paint(stream, env);
@@ -539,7 +359,7 @@ function upTo(text, separator) {
539
359
  return end === -1 ? text : text.slice(0, end);
540
360
  }
541
361
  function truncate(text, width) {
542
- return text.length <= width ? text : `${text.slice(0, Math.max(0, width - 1))}\u2026`;
362
+ return ko(text, width, { suffix: "\u2026", includeSuffix: true });
543
363
  }
544
364
  var LINE_BREAKS = /\s*\n\s*/g;
545
365
  var ESCAPE = String.fromCharCode(27);
@@ -693,7 +513,6 @@ var DASHES = /^-+/;
693
513
  function jsonOption(holds) {
694
514
  return { type: "boolean", description: holds === undefined ? "print JSON" : `print JSON: ${holds}` };
695
515
  }
696
-
697
516
  class Exit extends Error {
698
517
  code;
699
518
  hint;
@@ -1354,6 +1173,8 @@ function jsonLines(text) {
1354
1173
  return trimmed.startsWith("[") ? JSON.parse(trimmed) : trimmed.split(`
1355
1174
  `).map((line) => JSON.parse(line));
1356
1175
  }
1176
+ // ../kit/src/folders.ts
1177
+ var SKIPPED_FOLDERS = new Set(["node_modules", "vendor", "dist", "build", "target", "coverage", "venv", "__pycache__"]);
1357
1178
  // ../kit/src/secrets.ts
1358
1179
  var SECRET_PART = /token|secret|passw|credential|private|dsn|apikey|accesskey|key$/i;
1359
1180
  var SECRET_WORDS = new Set(["key", "pass", "pwd", "auth", "salt", "cookie", "session", "jwt", "ssn", "iban", "card", "cvv", "otp"]);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kaynooo/cli-db",
3
3
  "type": "module",
4
- "version": "0.11.0",
4
+ "version": "0.12.0",
5
5
  "description": "db: run read-only SQL against Postgres, MySQL and MariaDB from the terminal without ever showing the connection credentials.",
6
6
  "author": "Kaynooo <contact@kaynooo.fr>",
7
7
  "license": "MIT",
@@ -28,6 +28,6 @@
28
28
  "db": "$npm_execpath src/cli.ts"
29
29
  },
30
30
  "devDependencies": {
31
- "@kaynooo/cli-kit": "0.22.0"
31
+ "@kaynooo/cli-kit": "0.35.0"
32
32
  }
33
33
  }