@kaynooo/cli-check 0.16.0 → 0.17.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/cli.js +17 -7
- package/dist/errs-cli.js +17 -7
- package/dist/fix-cli.js +17 -7
- package/dist/j-cli.js +45 -16
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -329,19 +329,21 @@ function userConfigPath(bin, where = {}) {
|
|
|
329
329
|
}
|
|
330
330
|
|
|
331
331
|
// ../kit/src/theme.ts
|
|
332
|
+
var ENDS = new Map;
|
|
332
333
|
var DEFAULT = {
|
|
333
334
|
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" },
|
|
334
|
-
glyphs: { ok: "\u2713", warn: "\u25B2", problem: "\u2717", note: "\u203A", passed: "\u2713", failed: "\u2717", running: "\u25CF", queued: "\u25CB", skipped: "-", bar: "\u2501" },
|
|
335
|
+
glyphs: { ok: "\u2713", warn: "\u25B2", problem: "\u2717", note: "\u203A", passed: "\u2713", failed: "\u2717", running: "\u25CF", queued: "\u25CB", skipped: "-", bar: "\u2501", rule: "\u2500", corner: "\u256D" },
|
|
335
336
|
accents: ["cyan", "magenta", "green", "blue", "yellow", "redBright"],
|
|
336
|
-
bins: {}
|
|
337
|
+
bins: {},
|
|
338
|
+
gradient: ["#c084fc", "#67e8f9"]
|
|
337
339
|
};
|
|
338
340
|
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" };
|
|
339
341
|
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" };
|
|
340
|
-
var ASCII = { ok: "+", warn: "!", problem: "x", note: ">", passed: "+", failed: "x", running: "*", queued: "o", skipped: "-", bar: "#" };
|
|
342
|
+
var ASCII = { ok: "+", warn: "!", problem: "x", note: ">", passed: "+", failed: "x", running: "*", queued: "o", skipped: "-", bar: "#", rule: "-", corner: "+" };
|
|
341
343
|
var PRESETS = {
|
|
342
344
|
default: {},
|
|
343
|
-
"high-contrast": { colors: BRIGHT, accents: ["cyanBright", "magentaBright", "greenBright", "blueBright", "yellowBright", "redBright"] },
|
|
344
|
-
mono: { colors: MONO, accents: ["bold"] },
|
|
345
|
+
"high-contrast": { colors: BRIGHT, accents: ["cyanBright", "magentaBright", "greenBright", "blueBright", "yellowBright", "redBright"], gradient: ["#d8b4fe", "#a5f3fc"] },
|
|
346
|
+
mono: { colors: MONO, accents: ["bold"], gradient: undefined },
|
|
345
347
|
ascii: { glyphs: ASCII }
|
|
346
348
|
};
|
|
347
349
|
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"]);
|
|
@@ -412,6 +414,8 @@ function applyPreset(theme, name, warn, where) {
|
|
|
412
414
|
Object.assign(theme.glyphs, preset.glyphs);
|
|
413
415
|
if (preset.accents !== undefined)
|
|
414
416
|
theme.accents = [...preset.accents];
|
|
417
|
+
if (Object.hasOwn(preset, "gradient"))
|
|
418
|
+
theme.gradient = preset.gradient;
|
|
415
419
|
return name;
|
|
416
420
|
}
|
|
417
421
|
function applyFile(theme, file, where, warn) {
|
|
@@ -439,6 +443,12 @@ function applyFile(theme, file, where, warn) {
|
|
|
439
443
|
theme.accents = [...file.accents];
|
|
440
444
|
else if (file.accents !== undefined)
|
|
441
445
|
warn(`${where}: accents must be a non-empty list of colours`);
|
|
446
|
+
if (file.gradient === null)
|
|
447
|
+
theme.gradient = undefined;
|
|
448
|
+
else if (Array.isArray(file.gradient) && file.gradient.length === 2 && file.gradient.every((end) => typeof end === "string" && HEX.test(end)))
|
|
449
|
+
theme.gradient = [file.gradient[0], file.gradient[1]];
|
|
450
|
+
else if (file.gradient !== undefined)
|
|
451
|
+
warn(`${where}: gradient must be two \`#rrggbb\` colours, or null for none`);
|
|
442
452
|
if (isRecord(file.bins)) {
|
|
443
453
|
for (const [bin, value] of Object.entries(file.bins)) {
|
|
444
454
|
if (isColorSpec(value))
|
|
@@ -462,7 +472,7 @@ function isPath(chosen) {
|
|
|
462
472
|
return chosen.includes("/") || chosen.endsWith(".json");
|
|
463
473
|
}
|
|
464
474
|
function loadTheme({ env = process5.env, from = process5.cwd(), home = homedir2(), warn = warnOnce } = {}) {
|
|
465
|
-
const theme = { colors: { ...DEFAULT.colors }, glyphs: { ...DEFAULT.glyphs }, accents: [...DEFAULT.accents], bins: Object.create(null) };
|
|
475
|
+
const theme = { colors: { ...DEFAULT.colors }, glyphs: { ...DEFAULT.glyphs }, accents: [...DEFAULT.accents], bins: Object.create(null), gradient: DEFAULT.gradient };
|
|
466
476
|
const sources = [];
|
|
467
477
|
const chosen = env.KIT_THEME ?? "";
|
|
468
478
|
const wanted = chosen === "" ? [userConfigPath("theme", { home, xdg: env.XDG_CONFIG_HOME }), findUp(join3(".kaynooo", "theme.json"), from, endsWalk(home))] : [];
|
|
@@ -1295,7 +1305,7 @@ var {Glob } = globalThis.Bun;
|
|
|
1295
1305
|
var SESSION_FILES = new Glob("*.json");
|
|
1296
1306
|
var ACCOUNT_DIRS = new Glob("*/sessions");
|
|
1297
1307
|
// package.json
|
|
1298
|
-
var version = "0.
|
|
1308
|
+
var version = "0.17.0";
|
|
1299
1309
|
|
|
1300
1310
|
// src/check.ts
|
|
1301
1311
|
import { writeFile as writeFile3 } from "fs/promises";
|
package/dist/errs-cli.js
CHANGED
|
@@ -329,19 +329,21 @@ function userConfigPath(bin, where = {}) {
|
|
|
329
329
|
}
|
|
330
330
|
|
|
331
331
|
// ../kit/src/theme.ts
|
|
332
|
+
var ENDS = new Map;
|
|
332
333
|
var DEFAULT = {
|
|
333
334
|
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" },
|
|
334
|
-
glyphs: { ok: "\u2713", warn: "\u25B2", problem: "\u2717", note: "\u203A", passed: "\u2713", failed: "\u2717", running: "\u25CF", queued: "\u25CB", skipped: "-", bar: "\u2501" },
|
|
335
|
+
glyphs: { ok: "\u2713", warn: "\u25B2", problem: "\u2717", note: "\u203A", passed: "\u2713", failed: "\u2717", running: "\u25CF", queued: "\u25CB", skipped: "-", bar: "\u2501", rule: "\u2500", corner: "\u256D" },
|
|
335
336
|
accents: ["cyan", "magenta", "green", "blue", "yellow", "redBright"],
|
|
336
|
-
bins: {}
|
|
337
|
+
bins: {},
|
|
338
|
+
gradient: ["#c084fc", "#67e8f9"]
|
|
337
339
|
};
|
|
338
340
|
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" };
|
|
339
341
|
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" };
|
|
340
|
-
var ASCII = { ok: "+", warn: "!", problem: "x", note: ">", passed: "+", failed: "x", running: "*", queued: "o", skipped: "-", bar: "#" };
|
|
342
|
+
var ASCII = { ok: "+", warn: "!", problem: "x", note: ">", passed: "+", failed: "x", running: "*", queued: "o", skipped: "-", bar: "#", rule: "-", corner: "+" };
|
|
341
343
|
var PRESETS = {
|
|
342
344
|
default: {},
|
|
343
|
-
"high-contrast": { colors: BRIGHT, accents: ["cyanBright", "magentaBright", "greenBright", "blueBright", "yellowBright", "redBright"] },
|
|
344
|
-
mono: { colors: MONO, accents: ["bold"] },
|
|
345
|
+
"high-contrast": { colors: BRIGHT, accents: ["cyanBright", "magentaBright", "greenBright", "blueBright", "yellowBright", "redBright"], gradient: ["#d8b4fe", "#a5f3fc"] },
|
|
346
|
+
mono: { colors: MONO, accents: ["bold"], gradient: undefined },
|
|
345
347
|
ascii: { glyphs: ASCII }
|
|
346
348
|
};
|
|
347
349
|
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"]);
|
|
@@ -412,6 +414,8 @@ function applyPreset(theme, name, warn, where) {
|
|
|
412
414
|
Object.assign(theme.glyphs, preset.glyphs);
|
|
413
415
|
if (preset.accents !== undefined)
|
|
414
416
|
theme.accents = [...preset.accents];
|
|
417
|
+
if (Object.hasOwn(preset, "gradient"))
|
|
418
|
+
theme.gradient = preset.gradient;
|
|
415
419
|
return name;
|
|
416
420
|
}
|
|
417
421
|
function applyFile(theme, file, where, warn) {
|
|
@@ -439,6 +443,12 @@ function applyFile(theme, file, where, warn) {
|
|
|
439
443
|
theme.accents = [...file.accents];
|
|
440
444
|
else if (file.accents !== undefined)
|
|
441
445
|
warn(`${where}: accents must be a non-empty list of colours`);
|
|
446
|
+
if (file.gradient === null)
|
|
447
|
+
theme.gradient = undefined;
|
|
448
|
+
else if (Array.isArray(file.gradient) && file.gradient.length === 2 && file.gradient.every((end) => typeof end === "string" && HEX.test(end)))
|
|
449
|
+
theme.gradient = [file.gradient[0], file.gradient[1]];
|
|
450
|
+
else if (file.gradient !== undefined)
|
|
451
|
+
warn(`${where}: gradient must be two \`#rrggbb\` colours, or null for none`);
|
|
442
452
|
if (isRecord(file.bins)) {
|
|
443
453
|
for (const [bin, value] of Object.entries(file.bins)) {
|
|
444
454
|
if (isColorSpec(value))
|
|
@@ -462,7 +472,7 @@ function isPath(chosen) {
|
|
|
462
472
|
return chosen.includes("/") || chosen.endsWith(".json");
|
|
463
473
|
}
|
|
464
474
|
function loadTheme({ env = process5.env, from = process5.cwd(), home = homedir2(), warn = warnOnce } = {}) {
|
|
465
|
-
const theme = { colors: { ...DEFAULT.colors }, glyphs: { ...DEFAULT.glyphs }, accents: [...DEFAULT.accents], bins: Object.create(null) };
|
|
475
|
+
const theme = { colors: { ...DEFAULT.colors }, glyphs: { ...DEFAULT.glyphs }, accents: [...DEFAULT.accents], bins: Object.create(null), gradient: DEFAULT.gradient };
|
|
466
476
|
const sources = [];
|
|
467
477
|
const chosen = env.KIT_THEME ?? "";
|
|
468
478
|
const wanted = chosen === "" ? [userConfigPath("theme", { home, xdg: env.XDG_CONFIG_HOME }), findUp(join3(".kaynooo", "theme.json"), from, endsWalk(home))] : [];
|
|
@@ -1295,7 +1305,7 @@ var {Glob } = globalThis.Bun;
|
|
|
1295
1305
|
var SESSION_FILES = new Glob("*.json");
|
|
1296
1306
|
var ACCOUNT_DIRS = new Glob("*/sessions");
|
|
1297
1307
|
// package.json
|
|
1298
|
-
var version = "0.
|
|
1308
|
+
var version = "0.17.0";
|
|
1299
1309
|
|
|
1300
1310
|
// src/errs.ts
|
|
1301
1311
|
import { relative as relative2 } from "path";
|
package/dist/fix-cli.js
CHANGED
|
@@ -329,19 +329,21 @@ function userConfigPath(bin, where = {}) {
|
|
|
329
329
|
}
|
|
330
330
|
|
|
331
331
|
// ../kit/src/theme.ts
|
|
332
|
+
var ENDS = new Map;
|
|
332
333
|
var DEFAULT = {
|
|
333
334
|
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" },
|
|
334
|
-
glyphs: { ok: "\u2713", warn: "\u25B2", problem: "\u2717", note: "\u203A", passed: "\u2713", failed: "\u2717", running: "\u25CF", queued: "\u25CB", skipped: "-", bar: "\u2501" },
|
|
335
|
+
glyphs: { ok: "\u2713", warn: "\u25B2", problem: "\u2717", note: "\u203A", passed: "\u2713", failed: "\u2717", running: "\u25CF", queued: "\u25CB", skipped: "-", bar: "\u2501", rule: "\u2500", corner: "\u256D" },
|
|
335
336
|
accents: ["cyan", "magenta", "green", "blue", "yellow", "redBright"],
|
|
336
|
-
bins: {}
|
|
337
|
+
bins: {},
|
|
338
|
+
gradient: ["#c084fc", "#67e8f9"]
|
|
337
339
|
};
|
|
338
340
|
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" };
|
|
339
341
|
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" };
|
|
340
|
-
var ASCII = { ok: "+", warn: "!", problem: "x", note: ">", passed: "+", failed: "x", running: "*", queued: "o", skipped: "-", bar: "#" };
|
|
342
|
+
var ASCII = { ok: "+", warn: "!", problem: "x", note: ">", passed: "+", failed: "x", running: "*", queued: "o", skipped: "-", bar: "#", rule: "-", corner: "+" };
|
|
341
343
|
var PRESETS = {
|
|
342
344
|
default: {},
|
|
343
|
-
"high-contrast": { colors: BRIGHT, accents: ["cyanBright", "magentaBright", "greenBright", "blueBright", "yellowBright", "redBright"] },
|
|
344
|
-
mono: { colors: MONO, accents: ["bold"] },
|
|
345
|
+
"high-contrast": { colors: BRIGHT, accents: ["cyanBright", "magentaBright", "greenBright", "blueBright", "yellowBright", "redBright"], gradient: ["#d8b4fe", "#a5f3fc"] },
|
|
346
|
+
mono: { colors: MONO, accents: ["bold"], gradient: undefined },
|
|
345
347
|
ascii: { glyphs: ASCII }
|
|
346
348
|
};
|
|
347
349
|
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"]);
|
|
@@ -412,6 +414,8 @@ function applyPreset(theme, name, warn, where) {
|
|
|
412
414
|
Object.assign(theme.glyphs, preset.glyphs);
|
|
413
415
|
if (preset.accents !== undefined)
|
|
414
416
|
theme.accents = [...preset.accents];
|
|
417
|
+
if (Object.hasOwn(preset, "gradient"))
|
|
418
|
+
theme.gradient = preset.gradient;
|
|
415
419
|
return name;
|
|
416
420
|
}
|
|
417
421
|
function applyFile(theme, file, where, warn) {
|
|
@@ -439,6 +443,12 @@ function applyFile(theme, file, where, warn) {
|
|
|
439
443
|
theme.accents = [...file.accents];
|
|
440
444
|
else if (file.accents !== undefined)
|
|
441
445
|
warn(`${where}: accents must be a non-empty list of colours`);
|
|
446
|
+
if (file.gradient === null)
|
|
447
|
+
theme.gradient = undefined;
|
|
448
|
+
else if (Array.isArray(file.gradient) && file.gradient.length === 2 && file.gradient.every((end) => typeof end === "string" && HEX.test(end)))
|
|
449
|
+
theme.gradient = [file.gradient[0], file.gradient[1]];
|
|
450
|
+
else if (file.gradient !== undefined)
|
|
451
|
+
warn(`${where}: gradient must be two \`#rrggbb\` colours, or null for none`);
|
|
442
452
|
if (isRecord(file.bins)) {
|
|
443
453
|
for (const [bin, value] of Object.entries(file.bins)) {
|
|
444
454
|
if (isColorSpec(value))
|
|
@@ -462,7 +472,7 @@ function isPath(chosen) {
|
|
|
462
472
|
return chosen.includes("/") || chosen.endsWith(".json");
|
|
463
473
|
}
|
|
464
474
|
function loadTheme({ env = process5.env, from = process5.cwd(), home = homedir2(), warn = warnOnce } = {}) {
|
|
465
|
-
const theme = { colors: { ...DEFAULT.colors }, glyphs: { ...DEFAULT.glyphs }, accents: [...DEFAULT.accents], bins: Object.create(null) };
|
|
475
|
+
const theme = { colors: { ...DEFAULT.colors }, glyphs: { ...DEFAULT.glyphs }, accents: [...DEFAULT.accents], bins: Object.create(null), gradient: DEFAULT.gradient };
|
|
466
476
|
const sources = [];
|
|
467
477
|
const chosen = env.KIT_THEME ?? "";
|
|
468
478
|
const wanted = chosen === "" ? [userConfigPath("theme", { home, xdg: env.XDG_CONFIG_HOME }), findUp(join3(".kaynooo", "theme.json"), from, endsWalk(home))] : [];
|
|
@@ -1295,7 +1305,7 @@ var {Glob } = globalThis.Bun;
|
|
|
1295
1305
|
var SESSION_FILES = new Glob("*.json");
|
|
1296
1306
|
var ACCOUNT_DIRS = new Glob("*/sessions");
|
|
1297
1307
|
// package.json
|
|
1298
|
-
var version = "0.
|
|
1308
|
+
var version = "0.17.0";
|
|
1299
1309
|
|
|
1300
1310
|
// src/fix.ts
|
|
1301
1311
|
import { existsSync as existsSync4, statSync as statSync2 } from "fs";
|
package/dist/j-cli.js
CHANGED
|
@@ -329,19 +329,21 @@ function userConfigPath(bin, where = {}) {
|
|
|
329
329
|
}
|
|
330
330
|
|
|
331
331
|
// ../kit/src/theme.ts
|
|
332
|
+
var ENDS = new Map;
|
|
332
333
|
var DEFAULT = {
|
|
333
334
|
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" },
|
|
334
|
-
glyphs: { ok: "\u2713", warn: "\u25B2", problem: "\u2717", note: "\u203A", passed: "\u2713", failed: "\u2717", running: "\u25CF", queued: "\u25CB", skipped: "-", bar: "\u2501" },
|
|
335
|
+
glyphs: { ok: "\u2713", warn: "\u25B2", problem: "\u2717", note: "\u203A", passed: "\u2713", failed: "\u2717", running: "\u25CF", queued: "\u25CB", skipped: "-", bar: "\u2501", rule: "\u2500", corner: "\u256D" },
|
|
335
336
|
accents: ["cyan", "magenta", "green", "blue", "yellow", "redBright"],
|
|
336
|
-
bins: {}
|
|
337
|
+
bins: {},
|
|
338
|
+
gradient: ["#c084fc", "#67e8f9"]
|
|
337
339
|
};
|
|
338
340
|
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" };
|
|
339
341
|
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" };
|
|
340
|
-
var ASCII = { ok: "+", warn: "!", problem: "x", note: ">", passed: "+", failed: "x", running: "*", queued: "o", skipped: "-", bar: "#" };
|
|
342
|
+
var ASCII = { ok: "+", warn: "!", problem: "x", note: ">", passed: "+", failed: "x", running: "*", queued: "o", skipped: "-", bar: "#", rule: "-", corner: "+" };
|
|
341
343
|
var PRESETS = {
|
|
342
344
|
default: {},
|
|
343
|
-
"high-contrast": { colors: BRIGHT, accents: ["cyanBright", "magentaBright", "greenBright", "blueBright", "yellowBright", "redBright"] },
|
|
344
|
-
mono: { colors: MONO, accents: ["bold"] },
|
|
345
|
+
"high-contrast": { colors: BRIGHT, accents: ["cyanBright", "magentaBright", "greenBright", "blueBright", "yellowBright", "redBright"], gradient: ["#d8b4fe", "#a5f3fc"] },
|
|
346
|
+
mono: { colors: MONO, accents: ["bold"], gradient: undefined },
|
|
345
347
|
ascii: { glyphs: ASCII }
|
|
346
348
|
};
|
|
347
349
|
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"]);
|
|
@@ -412,6 +414,8 @@ function applyPreset(theme, name, warn, where) {
|
|
|
412
414
|
Object.assign(theme.glyphs, preset.glyphs);
|
|
413
415
|
if (preset.accents !== undefined)
|
|
414
416
|
theme.accents = [...preset.accents];
|
|
417
|
+
if (Object.hasOwn(preset, "gradient"))
|
|
418
|
+
theme.gradient = preset.gradient;
|
|
415
419
|
return name;
|
|
416
420
|
}
|
|
417
421
|
function applyFile(theme, file, where, warn) {
|
|
@@ -439,6 +443,12 @@ function applyFile(theme, file, where, warn) {
|
|
|
439
443
|
theme.accents = [...file.accents];
|
|
440
444
|
else if (file.accents !== undefined)
|
|
441
445
|
warn(`${where}: accents must be a non-empty list of colours`);
|
|
446
|
+
if (file.gradient === null)
|
|
447
|
+
theme.gradient = undefined;
|
|
448
|
+
else if (Array.isArray(file.gradient) && file.gradient.length === 2 && file.gradient.every((end) => typeof end === "string" && HEX.test(end)))
|
|
449
|
+
theme.gradient = [file.gradient[0], file.gradient[1]];
|
|
450
|
+
else if (file.gradient !== undefined)
|
|
451
|
+
warn(`${where}: gradient must be two \`#rrggbb\` colours, or null for none`);
|
|
442
452
|
if (isRecord(file.bins)) {
|
|
443
453
|
for (const [bin, value] of Object.entries(file.bins)) {
|
|
444
454
|
if (isColorSpec(value))
|
|
@@ -462,7 +472,7 @@ function isPath(chosen) {
|
|
|
462
472
|
return chosen.includes("/") || chosen.endsWith(".json");
|
|
463
473
|
}
|
|
464
474
|
function loadTheme({ env = process5.env, from = process5.cwd(), home = homedir2(), warn = warnOnce } = {}) {
|
|
465
|
-
const theme = { colors: { ...DEFAULT.colors }, glyphs: { ...DEFAULT.glyphs }, accents: [...DEFAULT.accents], bins: Object.create(null) };
|
|
475
|
+
const theme = { colors: { ...DEFAULT.colors }, glyphs: { ...DEFAULT.glyphs }, accents: [...DEFAULT.accents], bins: Object.create(null), gradient: DEFAULT.gradient };
|
|
466
476
|
const sources = [];
|
|
467
477
|
const chosen = env.KIT_THEME ?? "";
|
|
468
478
|
const wanted = chosen === "" ? [userConfigPath("theme", { home, xdg: env.XDG_CONFIG_HOME }), findUp(join3(".kaynooo", "theme.json"), from, endsWalk(home))] : [];
|
|
@@ -1295,7 +1305,7 @@ var {Glob } = globalThis.Bun;
|
|
|
1295
1305
|
var SESSION_FILES = new Glob("*.json");
|
|
1296
1306
|
var ACCOUNT_DIRS = new Glob("*/sessions");
|
|
1297
1307
|
// package.json
|
|
1298
|
-
var version = "0.
|
|
1308
|
+
var version = "0.17.0";
|
|
1299
1309
|
|
|
1300
1310
|
// src/j.ts
|
|
1301
1311
|
import process21 from "process";
|
|
@@ -1742,7 +1752,7 @@ function listLines(state, layout, theme) {
|
|
|
1742
1752
|
const promptWidth = Bun.stringWidth(state.prompt);
|
|
1743
1753
|
const query = fit(state.query, Math.max(1, layout.listWidth - promptWidth), identity);
|
|
1744
1754
|
const place = state.matches.length > rows ? ` (${state.cursor + 1} of ${state.matches.length})` : "";
|
|
1745
|
-
const count = fit(` ${state.matches.length}/${state.items.length}${place}${marks}`, layout.listWidth, theme.label);
|
|
1755
|
+
const count = fit(` ${state.matches.length}/${state.items.length}${place}${marks} ctrl-/ keys`, layout.listWidth, theme.label);
|
|
1746
1756
|
const lines = [{ text: theme.accent(state.prompt) + query.text, width: promptWidth + query.width }, count, ...header];
|
|
1747
1757
|
if (state.matches.length === 0)
|
|
1748
1758
|
lines.push(fit(" no match", layout.listWidth, theme.label));
|
|
@@ -1750,7 +1760,7 @@ function listLines(state, layout, theme) {
|
|
|
1750
1760
|
const current = top + offset === state.cursor;
|
|
1751
1761
|
const pointer = current ? theme.accent("\u276F") : " ";
|
|
1752
1762
|
const mark = state.multi ? `${state.marked.has(match.index) ? theme.id("\u25CF") : " "} ` : "";
|
|
1753
|
-
const text = fit(state.items[match.index], layout.listWidth - prefixWidth, current ? theme.value : identity, theme.accent, new Set(match.positions), state.styles[match.index]);
|
|
1763
|
+
const text = fit(state.items[match.index], layout.listWidth - prefixWidth, current ? theme.value : identity, theme.match ?? theme.accent, new Set(match.positions), state.styles[match.index]);
|
|
1754
1764
|
lines.push({ text: `${pointer} ${mark}${text.text}`, width: prefixWidth + text.width });
|
|
1755
1765
|
}
|
|
1756
1766
|
return lines;
|
|
@@ -1781,14 +1791,24 @@ function up(lines) {
|
|
|
1781
1791
|
return lines > 0 ? `\x1B[${lines}A` : "";
|
|
1782
1792
|
}
|
|
1783
1793
|
function openTerminal() {
|
|
1784
|
-
let
|
|
1794
|
+
let mode;
|
|
1785
1795
|
try {
|
|
1786
|
-
|
|
1796
|
+
mode = new tty.ReadStream(openSync2("/dev/tty", "r"));
|
|
1787
1797
|
} catch {
|
|
1788
1798
|
return fail("no terminal to read keys from (/dev/tty)");
|
|
1789
1799
|
}
|
|
1800
|
+
const keys = Bun.file("/dev/tty").stream().getReader();
|
|
1790
1801
|
const out = process17.stderr;
|
|
1791
1802
|
let resize;
|
|
1803
|
+
async function read(onChunk) {
|
|
1804
|
+
const decoder = new TextDecoder;
|
|
1805
|
+
try {
|
|
1806
|
+
for (let chunk = await keys.read();!chunk.done; chunk = await keys.read())
|
|
1807
|
+
onChunk(decoder.decode(chunk.value, { stream: true }));
|
|
1808
|
+
} catch {
|
|
1809
|
+
onChunk("\x03");
|
|
1810
|
+
}
|
|
1811
|
+
}
|
|
1792
1812
|
return {
|
|
1793
1813
|
get columns() {
|
|
1794
1814
|
return out.columns || 80;
|
|
@@ -1796,21 +1816,22 @@ function openTerminal() {
|
|
|
1796
1816
|
get rows() {
|
|
1797
1817
|
return out.rows || 24;
|
|
1798
1818
|
},
|
|
1799
|
-
theme: { accent: role("accent", out), label: role("label", out), value: role("value", out), id: role("id", out) },
|
|
1819
|
+
theme: { accent: role("accent", out), label: role("label", out), value: role("value", out), id: role("id", out), match: (text) => paint(out).underline(role("accent", out)(text)) },
|
|
1800
1820
|
write: (text) => void out.write(text),
|
|
1801
1821
|
listen(onChunk, onResize) {
|
|
1802
1822
|
resize = onResize;
|
|
1803
|
-
|
|
1823
|
+
mode.setRawMode(true);
|
|
1804
1824
|
out.on("resize", onResize);
|
|
1805
|
-
|
|
1825
|
+
read(onChunk);
|
|
1806
1826
|
},
|
|
1807
1827
|
close() {
|
|
1808
1828
|
if (resize !== undefined)
|
|
1809
1829
|
out.off("resize", resize);
|
|
1810
1830
|
try {
|
|
1811
|
-
|
|
1831
|
+
mode.setRawMode(false);
|
|
1812
1832
|
} finally {
|
|
1813
|
-
|
|
1833
|
+
mode.destroy();
|
|
1834
|
+
keys.cancel();
|
|
1814
1835
|
}
|
|
1815
1836
|
}
|
|
1816
1837
|
};
|
|
@@ -2605,6 +2626,13 @@ function names(found) {
|
|
|
2605
2626
|
return same.length === 1 ? [[name, described(same[0])]] : [[name, same.map((entry) => entry.tag).join(", ")], ...same.map((entry) => [id(entry), described(entry)])];
|
|
2606
2627
|
});
|
|
2607
2628
|
}
|
|
2629
|
+
function completions() {
|
|
2630
|
+
try {
|
|
2631
|
+
return [...names(everything()), ["-", "the last one again, with its arguments"]];
|
|
2632
|
+
} catch {
|
|
2633
|
+
return [];
|
|
2634
|
+
}
|
|
2635
|
+
}
|
|
2608
2636
|
function listed2(found) {
|
|
2609
2637
|
const labels = labelled(found);
|
|
2610
2638
|
return byRecency(found, runs("j"), id).map((entry) => ({
|
|
@@ -2657,6 +2685,7 @@ async function j(argv) {
|
|
|
2657
2685
|
const last = args[0] === "-";
|
|
2658
2686
|
const parsed = last ? { values: {}, positionals: ["-"], rest: args.slice(1) } : parse(args, usage2, options, {
|
|
2659
2687
|
positionals: ["[name]"],
|
|
2688
|
+
candidates: { "[name]": completions },
|
|
2660
2689
|
trailing: true,
|
|
2661
2690
|
replaces: "reading the Justfile, Makefile, package.json scripts or composer scripts to find what to run, then retyping it",
|
|
2662
2691
|
examples: ["j", ["j test", "run the test recipe, script or task"], ["j api/test --watch", "a child folder's, with an argument"], ["j just:check", "the one of a runner, when several share the name"], ["j -", "the last one again"]]
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaynooo/cli-check",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.17.0",
|
|
5
5
|
"description": "check, fix and errs: run a repo's check, typecheck, lint and test steps or its fixers, inside its docker compose service when one mounts the folder, showing only what failed with each full output saved to a file, and turn tsc, eslint, bun test, vitest, playwright, phpunit, phpstan and php-cs-fixer logs into file:line:col errors.",
|
|
6
6
|
"author": "Kaynooo <contact@kaynooo.fr>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -34,6 +34,6 @@
|
|
|
34
34
|
"j": "$npm_execpath src/j-cli.ts"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@kaynooo/cli-kit": "0.
|
|
37
|
+
"@kaynooo/cli-kit": "0.32.0"
|
|
38
38
|
}
|
|
39
39
|
}
|