numux 1.21.0 → 1.22.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 +2 -0
- package/dist/numux.js +33 -3
- package/dist/types.d.ts +8 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -164,6 +164,7 @@ Template properties (color, env, dependsOn, etc.) are inherited by all matched p
|
|
|
164
164
|
| `--exclude <a,b,...>` | Exclude these processes |
|
|
165
165
|
| `--kill-others` | Kill all processes when any exits |
|
|
166
166
|
| `--no-restart` | Disable auto-restart for crashed processes |
|
|
167
|
+
| `-s, --sort <mode>` | Tab display order: `config` (default), `alphabetical`, `topological` |
|
|
167
168
|
| `--no-watch` | Disable file watching even if config has `watch` patterns |
|
|
168
169
|
| `-t, --timestamps` | Add `[HH:MM:SS]` timestamps to prefixed output |
|
|
169
170
|
| `--log-dir <path>` | Write per-process output to `<path>/<name>.log` |
|
|
@@ -198,6 +199,7 @@ Top-level options apply to all processes (process-level settings override):
|
|
|
198
199
|
| `stopSignal` | `'SIGTERM' \| 'SIGINT' \| 'SIGHUP'` | Stop signal for all processes (default: `'SIGTERM'`) |
|
|
199
200
|
| `errorMatcher` | `boolean \| string` | Error detection for all processes (`true` = ANSI red, string = regex) |
|
|
200
201
|
| `watch` | `string \| string[]` | Watch patterns for all processes (process `watch` replaces if set) |
|
|
202
|
+
| `sort` | `'config' \| 'alphabetical' \| 'topological'` | Tab display order (default: `'config'` — definition order) |
|
|
201
203
|
|
|
202
204
|
```ts
|
|
203
205
|
export default defineConfig({
|
package/dist/numux.js
CHANGED
|
@@ -36,7 +36,7 @@ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports,
|
|
|
36
36
|
var require_package = __commonJS((exports, module) => {
|
|
37
37
|
module.exports = {
|
|
38
38
|
name: "numux",
|
|
39
|
-
version: "1.
|
|
39
|
+
version: "1.22.0",
|
|
40
40
|
description: "Terminal multiplexer with dependency orchestration",
|
|
41
41
|
type: "module",
|
|
42
42
|
license: "MIT",
|
|
@@ -95,6 +95,15 @@ import { resolve as resolve8 } from "path";
|
|
|
95
95
|
// src/cli-flags.ts
|
|
96
96
|
var commaSplit = (raw) => raw.split(",").map((s) => s.trim()).filter(Boolean);
|
|
97
97
|
var FLAGS = [
|
|
98
|
+
{
|
|
99
|
+
type: "value",
|
|
100
|
+
long: "--sort",
|
|
101
|
+
short: "-s",
|
|
102
|
+
key: "sort",
|
|
103
|
+
description: "Tab display order",
|
|
104
|
+
valueName: "<config|alphabetical|topological>",
|
|
105
|
+
completionHint: "none"
|
|
106
|
+
},
|
|
98
107
|
{
|
|
99
108
|
type: "value",
|
|
100
109
|
long: "--workspace",
|
|
@@ -1049,6 +1058,7 @@ function validateConfig(raw, warnings) {
|
|
|
1049
1058
|
}
|
|
1050
1059
|
globalEnv = config.env;
|
|
1051
1060
|
}
|
|
1061
|
+
const sort = validateSort(config.sort);
|
|
1052
1062
|
const validated = {};
|
|
1053
1063
|
for (const name of names) {
|
|
1054
1064
|
let proc = processes[name];
|
|
@@ -1146,7 +1156,7 @@ function validateConfig(raw, warnings) {
|
|
|
1146
1156
|
showCommand
|
|
1147
1157
|
};
|
|
1148
1158
|
}
|
|
1149
|
-
return { processes: validated };
|
|
1159
|
+
return { ...sort ? { sort } : {}, processes: validated };
|
|
1150
1160
|
}
|
|
1151
1161
|
function validateStringOrStringArray(value) {
|
|
1152
1162
|
if (typeof value === "string")
|
|
@@ -1176,6 +1186,16 @@ function validateErrorMatcher(name, value) {
|
|
|
1176
1186
|
}
|
|
1177
1187
|
return;
|
|
1178
1188
|
}
|
|
1189
|
+
var VALID_SORT_VALUES = new Set(["config", "alphabetical", "topological"]);
|
|
1190
|
+
function validateSort(value) {
|
|
1191
|
+
if (typeof value === "string") {
|
|
1192
|
+
if (!VALID_SORT_VALUES.has(value)) {
|
|
1193
|
+
throw new Error(`sort must be one of: ${[...VALID_SORT_VALUES].join(", ")}. Got "${value}"`);
|
|
1194
|
+
}
|
|
1195
|
+
return value;
|
|
1196
|
+
}
|
|
1197
|
+
return;
|
|
1198
|
+
}
|
|
1179
1199
|
var VALID_PLATFORMS = new Set(["aix", "darwin", "freebsd", "linux", "openbsd", "sunos", "win32"]);
|
|
1180
1200
|
function validatePlatform(name, value) {
|
|
1181
1201
|
const arr = validateStringOrStringArray(value);
|
|
@@ -1743,7 +1763,14 @@ class ProcessManager {
|
|
|
1743
1763
|
return [...this.states.values()];
|
|
1744
1764
|
}
|
|
1745
1765
|
getProcessNames() {
|
|
1746
|
-
|
|
1766
|
+
switch (this.config.sort) {
|
|
1767
|
+
case "alphabetical":
|
|
1768
|
+
return Object.keys(this.config.processes).sort();
|
|
1769
|
+
case "topological":
|
|
1770
|
+
return this.tiers.flat();
|
|
1771
|
+
default:
|
|
1772
|
+
return Object.keys(this.config.processes);
|
|
1773
|
+
}
|
|
1747
1774
|
}
|
|
1748
1775
|
async startAll(cols, rows) {
|
|
1749
1776
|
log("Starting all processes");
|
|
@@ -3479,6 +3506,9 @@ async function main() {
|
|
|
3479
3506
|
}
|
|
3480
3507
|
}
|
|
3481
3508
|
}
|
|
3509
|
+
if (parsed.sort) {
|
|
3510
|
+
config.sort = parsed.sort;
|
|
3511
|
+
}
|
|
3482
3512
|
if (parsed.envFile !== undefined) {
|
|
3483
3513
|
for (const proc of Object.values(config.processes)) {
|
|
3484
3514
|
proc.envFile = parsed.envFile;
|
package/dist/types.d.ts
CHANGED
|
@@ -88,14 +88,22 @@ export interface NumuxConfig<K extends string = string> {
|
|
|
88
88
|
errorMatcher?: boolean | string;
|
|
89
89
|
/** Global watch patterns, inherited by processes without their own watch */
|
|
90
90
|
watch?: string | string[];
|
|
91
|
+
/**
|
|
92
|
+
* Tab display order. `'config'` preserves definition order (package.json script order for wildcards),
|
|
93
|
+
* `'alphabetical'` sorts by process name, `'topological'` sorts by dependency tiers.
|
|
94
|
+
* @default 'config'
|
|
95
|
+
*/
|
|
96
|
+
sort?: SortOrder;
|
|
91
97
|
processes: Record<K, NumuxProcessConfig<K> | NumuxScriptPattern<K> | string>;
|
|
92
98
|
}
|
|
99
|
+
export type SortOrder = 'config' | 'alphabetical' | 'topological';
|
|
93
100
|
/** Process config after validation — dependsOn is always normalized to an array */
|
|
94
101
|
export interface ResolvedProcessConfig extends Omit<NumuxProcessConfig, 'dependsOn'> {
|
|
95
102
|
dependsOn?: string[];
|
|
96
103
|
}
|
|
97
104
|
/** Validated config with all shorthand expanded to full objects */
|
|
98
105
|
export interface ResolvedNumuxConfig {
|
|
106
|
+
sort?: SortOrder;
|
|
99
107
|
processes: Record<string, ResolvedProcessConfig>;
|
|
100
108
|
}
|
|
101
109
|
export type ProcessStatus = 'pending' | 'starting' | 'ready' | 'running' | 'stopping' | 'stopped' | 'finished' | 'failed' | 'skipped';
|