numux 1.23.1 → 1.23.2
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/numux.js +22 -7
- package/dist/types.d.ts +24 -0
- package/package.json +1 -1
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.23.
|
|
39
|
+
version: "1.23.2",
|
|
40
40
|
description: "Terminal multiplexer with dependency orchestration",
|
|
41
41
|
type: "module",
|
|
42
42
|
license: "MIT",
|
|
@@ -1059,6 +1059,11 @@ function validateConfig(raw, warnings) {
|
|
|
1059
1059
|
globalEnv = config.env;
|
|
1060
1060
|
}
|
|
1061
1061
|
const sort = validateSort(config.sort);
|
|
1062
|
+
const prefix = config.prefix === true ? true : undefined;
|
|
1063
|
+
const timestamps = config.timestamps === true ? true : undefined;
|
|
1064
|
+
const killOthers = config.killOthers === true ? true : undefined;
|
|
1065
|
+
const noWatch = config.noWatch === true ? true : undefined;
|
|
1066
|
+
const logDir = typeof config.logDir === "string" && config.logDir.trim() ? config.logDir.trim() : undefined;
|
|
1062
1067
|
const validated = {};
|
|
1063
1068
|
for (const name of names) {
|
|
1064
1069
|
let proc = processes[name];
|
|
@@ -1156,7 +1161,15 @@ function validateConfig(raw, warnings) {
|
|
|
1156
1161
|
showCommand
|
|
1157
1162
|
};
|
|
1158
1163
|
}
|
|
1159
|
-
return {
|
|
1164
|
+
return {
|
|
1165
|
+
...sort ? { sort } : {},
|
|
1166
|
+
...prefix ? { prefix } : {},
|
|
1167
|
+
...timestamps ? { timestamps } : {},
|
|
1168
|
+
...killOthers ? { killOthers } : {},
|
|
1169
|
+
...noWatch ? { noWatch } : {},
|
|
1170
|
+
...logDir ? { logDir } : {},
|
|
1171
|
+
processes: validated
|
|
1172
|
+
};
|
|
1160
1173
|
}
|
|
1161
1174
|
function validateStringOrStringArray(value) {
|
|
1162
1175
|
if (typeof value === "string")
|
|
@@ -3561,7 +3574,7 @@ async function main() {
|
|
|
3561
3574
|
proc.envFile = parsed.envFile;
|
|
3562
3575
|
}
|
|
3563
3576
|
}
|
|
3564
|
-
if (parsed.noWatch) {
|
|
3577
|
+
if (parsed.noWatch || config.noWatch) {
|
|
3565
3578
|
for (const proc of Object.values(config.processes)) {
|
|
3566
3579
|
delete proc.watch;
|
|
3567
3580
|
}
|
|
@@ -3577,9 +3590,11 @@ async function main() {
|
|
|
3577
3590
|
}
|
|
3578
3591
|
}
|
|
3579
3592
|
const manager = new ProcessManager(config);
|
|
3580
|
-
const
|
|
3593
|
+
const logDir = parsed.logDir ?? config.logDir;
|
|
3594
|
+
const logWriter = logDir ? new LogWriter(logDir) : LogWriter.createTemp();
|
|
3581
3595
|
printWarnings(warnings);
|
|
3582
|
-
|
|
3596
|
+
const usePrefix = parsed.prefix || config.prefix;
|
|
3597
|
+
if (usePrefix) {
|
|
3583
3598
|
if (!parsed.noRestart) {
|
|
3584
3599
|
for (const proc of Object.values(config.processes)) {
|
|
3585
3600
|
proc.maxRestarts ??= 0;
|
|
@@ -3587,8 +3602,8 @@ async function main() {
|
|
|
3587
3602
|
}
|
|
3588
3603
|
const display = new PrefixDisplay(manager, config, {
|
|
3589
3604
|
logWriter,
|
|
3590
|
-
killOthers: parsed.killOthers,
|
|
3591
|
-
timestamps: parsed.timestamps
|
|
3605
|
+
killOthers: parsed.killOthers || config.killOthers,
|
|
3606
|
+
timestamps: parsed.timestamps || config.timestamps
|
|
3592
3607
|
});
|
|
3593
3608
|
await display.start();
|
|
3594
3609
|
} else {
|
package/dist/types.d.ts
CHANGED
|
@@ -95,6 +95,25 @@ export interface NumuxConfig<K extends string = string> {
|
|
|
95
95
|
* @default 'config'
|
|
96
96
|
*/
|
|
97
97
|
sort?: SortOrder;
|
|
98
|
+
/**
|
|
99
|
+
* Use prefixed output mode instead of TUI (for CI/scripts)
|
|
100
|
+
* @default false
|
|
101
|
+
*/
|
|
102
|
+
prefix?: boolean;
|
|
103
|
+
/** Add timestamps to prefixed output lines (only applies when `prefix` is true) */
|
|
104
|
+
timestamps?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Kill all processes when any one exits
|
|
107
|
+
* @default false
|
|
108
|
+
*/
|
|
109
|
+
killOthers?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Disable file watching even if processes have watch patterns
|
|
112
|
+
* @default false
|
|
113
|
+
*/
|
|
114
|
+
noWatch?: boolean;
|
|
115
|
+
/** Directory to write per-process log files */
|
|
116
|
+
logDir?: string;
|
|
98
117
|
processes: Record<K, NumuxProcessConfig<K> | NumuxScriptPattern<K> | string>;
|
|
99
118
|
}
|
|
100
119
|
export type SortOrder = 'config' | 'alphabetical' | 'topological';
|
|
@@ -105,6 +124,11 @@ export interface ResolvedProcessConfig extends Omit<NumuxProcessConfig, 'depends
|
|
|
105
124
|
/** Validated config with all shorthand expanded to full objects */
|
|
106
125
|
export interface ResolvedNumuxConfig {
|
|
107
126
|
sort?: SortOrder;
|
|
127
|
+
prefix?: boolean;
|
|
128
|
+
timestamps?: boolean;
|
|
129
|
+
killOthers?: boolean;
|
|
130
|
+
noWatch?: boolean;
|
|
131
|
+
logDir?: string;
|
|
108
132
|
processes: Record<string, ResolvedProcessConfig>;
|
|
109
133
|
}
|
|
110
134
|
export type ProcessStatus = 'pending' | 'starting' | 'ready' | 'running' | 'stopping' | 'stopped' | 'finished' | 'failed' | 'skipped';
|