numux 1.6.0 → 1.7.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/README.md +1 -1
- package/dist/numux.js +41 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -178,7 +178,7 @@ Each process accepts:
|
|
|
178
178
|
| `delay` | `number` | — | Milliseconds to wait before starting the process |
|
|
179
179
|
| `condition` | `string` | — | Env var name; process skipped if falsy. Prefix with `!` to negate |
|
|
180
180
|
| `stopSignal` | `string` | `SIGTERM` | Signal for graceful stop (`SIGTERM`, `SIGINT`, or `SIGHUP`) |
|
|
181
|
-
| `color` | `string` | auto | Hex
|
|
181
|
+
| `color` | `string \| string[]` | auto | Hex (e.g. `"#ff6600"`) or basic name: black, red, green, yellow, blue, magenta, cyan, white, gray, orange, purple |
|
|
182
182
|
| `watch` | `string \| string[]` | — | Glob patterns — restart process when matching files change |
|
|
183
183
|
| `interactive` | `boolean` | `false` | When `true`, keyboard input is forwarded to the process |
|
|
184
184
|
|
package/dist/numux.js
CHANGED
|
@@ -22,7 +22,7 @@ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports,
|
|
|
22
22
|
var require_package = __commonJS((exports, module) => {
|
|
23
23
|
module.exports = {
|
|
24
24
|
name: "numux",
|
|
25
|
-
version: "1.
|
|
25
|
+
version: "1.7.0",
|
|
26
26
|
description: "Terminal multiplexer with dependency orchestration",
|
|
27
27
|
type: "module",
|
|
28
28
|
license: "MIT",
|
|
@@ -592,6 +592,31 @@ function findCycle(remaining, config) {
|
|
|
592
592
|
}
|
|
593
593
|
|
|
594
594
|
// src/utils/color.ts
|
|
595
|
+
var BASIC_COLORS = {
|
|
596
|
+
black: "#000000",
|
|
597
|
+
red: "#ff0000",
|
|
598
|
+
green: "#00ff00",
|
|
599
|
+
yellow: "#ffff00",
|
|
600
|
+
blue: "#0000ff",
|
|
601
|
+
magenta: "#ff00ff",
|
|
602
|
+
cyan: "#00ffff",
|
|
603
|
+
white: "#ffffff",
|
|
604
|
+
gray: "#808080",
|
|
605
|
+
grey: "#808080",
|
|
606
|
+
orange: "#ffa500",
|
|
607
|
+
purple: "#800080"
|
|
608
|
+
};
|
|
609
|
+
function isValidColor(color) {
|
|
610
|
+
if (HEX_COLOR_RE.test(color))
|
|
611
|
+
return true;
|
|
612
|
+
return color.toLowerCase() in BASIC_COLORS;
|
|
613
|
+
}
|
|
614
|
+
function resolveToHex(color) {
|
|
615
|
+
if (HEX_COLOR_RE.test(color))
|
|
616
|
+
return color.startsWith("#") ? color : `#${color}`;
|
|
617
|
+
const hex = BASIC_COLORS[color.toLowerCase()];
|
|
618
|
+
return hex ?? "";
|
|
619
|
+
}
|
|
595
620
|
function hexToAnsi(hex) {
|
|
596
621
|
const h = hex.replace("#", "");
|
|
597
622
|
const r = Number.parseInt(h.slice(0, 2), 16);
|
|
@@ -641,7 +666,11 @@ function buildProcessColorMap(names, config) {
|
|
|
641
666
|
for (const name of names) {
|
|
642
667
|
const explicit = resolveColor(config.processes[name]?.color);
|
|
643
668
|
if (explicit) {
|
|
644
|
-
|
|
669
|
+
const hex = resolveToHex(explicit);
|
|
670
|
+
if (hex)
|
|
671
|
+
map.set(name, hexToAnsi(hex));
|
|
672
|
+
else
|
|
673
|
+
map.set(name, DEFAULT_ANSI_COLORS[paletteIndex++ % DEFAULT_ANSI_COLORS.length]);
|
|
645
674
|
} else {
|
|
646
675
|
map.set(name, DEFAULT_ANSI_COLORS[paletteIndex % DEFAULT_ANSI_COLORS.length]);
|
|
647
676
|
paletteIndex++;
|
|
@@ -657,7 +686,11 @@ function buildProcessHexColorMap(names, config) {
|
|
|
657
686
|
for (const name of names) {
|
|
658
687
|
const explicit = resolveColor(config.processes[name]?.color);
|
|
659
688
|
if (explicit) {
|
|
660
|
-
|
|
689
|
+
const hex = resolveToHex(explicit);
|
|
690
|
+
if (hex)
|
|
691
|
+
map.set(name, hex);
|
|
692
|
+
else
|
|
693
|
+
map.set(name, DEFAULT_HEX_COLORS[paletteIndex++ % DEFAULT_HEX_COLORS.length]);
|
|
661
694
|
} else {
|
|
662
695
|
map.set(name, DEFAULT_HEX_COLORS[paletteIndex % DEFAULT_HEX_COLORS.length]);
|
|
663
696
|
paletteIndex++;
|
|
@@ -721,13 +754,13 @@ function validateConfig(raw, warnings) {
|
|
|
721
754
|
}
|
|
722
755
|
}
|
|
723
756
|
if (typeof p.color === "string") {
|
|
724
|
-
if (!
|
|
725
|
-
throw new Error(`Process "${name}".color must be a
|
|
757
|
+
if (!isValidColor(p.color)) {
|
|
758
|
+
throw new Error(`Process "${name}".color must be a hex color (e.g. "#ff8800") or basic name (black, red, green, yellow, blue, magenta, cyan, white, gray, orange, purple), got "${p.color}"`);
|
|
726
759
|
}
|
|
727
760
|
} else if (Array.isArray(p.color)) {
|
|
728
761
|
for (const c of p.color) {
|
|
729
|
-
if (typeof c !== "string" || !
|
|
730
|
-
throw new Error(`Process "${name}".color entries must be
|
|
762
|
+
if (typeof c !== "string" || !isValidColor(c)) {
|
|
763
|
+
throw new Error(`Process "${name}".color entries must be hex or basic names (black, red, green, yellow, blue, magenta, cyan, white, gray, orange), got "${c}"`);
|
|
731
764
|
}
|
|
732
765
|
}
|
|
733
766
|
}
|
|
@@ -2403,7 +2436,7 @@ Usage:
|
|
|
2403
2436
|
|
|
2404
2437
|
Options:
|
|
2405
2438
|
-n, --name <name=command> Add a named process
|
|
2406
|
-
-c, --color <colors> Comma-separated colors
|
|
2439
|
+
-c, --color <colors> Comma-separated colors (hex or names: black, red, green, yellow, blue, magenta, cyan, white, gray, orange, purple)
|
|
2407
2440
|
--config <path> Config file path (default: auto-detect)
|
|
2408
2441
|
-p, --prefix Prefixed output mode (no TUI, for CI/scripts)
|
|
2409
2442
|
--only <a,b,...> Only run these processes (+ their dependencies)
|