numux 1.20.0 → 1.21.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 CHANGED
@@ -193,6 +193,11 @@ Top-level options apply to all processes (process-level settings override):
193
193
  | `env` | `Record<string, string>` | Environment variables merged into all processes (process `env` overrides per key) |
194
194
  | `envFile` | `string \| string[] \| false` | `.env` file(s) for all processes (process `envFile` replaces if set; `false` disables) |
195
195
  | `showCommand` | `boolean` | Print the command being run as the first line of output (default: `true`) |
196
+ | `maxRestarts` | `number` | Restart limit for all processes (default: `Infinity`) |
197
+ | `readyTimeout` | `number` | Ready timeout in ms for all processes |
198
+ | `stopSignal` | `'SIGTERM' \| 'SIGINT' \| 'SIGHUP'` | Stop signal for all processes (default: `'SIGTERM'`) |
199
+ | `errorMatcher` | `boolean \| string` | Error detection for all processes (`true` = ANSI red, string = regex) |
200
+ | `watch` | `string \| string[]` | Watch patterns for all processes (process `watch` replaces if set) |
196
201
 
197
202
  ```ts
198
203
  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.20.0",
39
+ version: "1.21.0",
40
40
  description: "Terminal multiplexer with dependency orchestration",
41
41
  type: "module",
42
42
  license: "MIT",
@@ -1035,6 +1035,11 @@ function validateConfig(raw, warnings) {
1035
1035
  const globalCwd = typeof config.cwd === "string" ? config.cwd : undefined;
1036
1036
  const globalShowCommand = typeof config.showCommand === "boolean" ? config.showCommand : undefined;
1037
1037
  const globalEnvFile = validateEnvFile(config.envFile);
1038
+ const globalMaxRestarts = typeof config.maxRestarts === "number" && config.maxRestarts >= 0 ? config.maxRestarts : undefined;
1039
+ const globalReadyTimeout = typeof config.readyTimeout === "number" && config.readyTimeout > 0 ? config.readyTimeout : undefined;
1040
+ const globalStopSignal = validateStopSignal(config.stopSignal);
1041
+ const globalErrorMatcher = validateErrorMatcher("(global)", config.errorMatcher);
1042
+ const globalWatch = validateStringOrStringArray(config.watch);
1038
1043
  let globalEnv;
1039
1044
  if (config.env && typeof config.env === "object") {
1040
1045
  for (const [k, v] of Object.entries(config.env)) {
@@ -1115,6 +1120,11 @@ function validateConfig(raw, warnings) {
1115
1120
  const processEnvFile = validateEnvFile(p.envFile);
1116
1121
  const showCommand = typeof p.showCommand === "boolean" ? p.showCommand : globalShowCommand ?? true;
1117
1122
  const platform = validatePlatform(name, p.platform);
1123
+ const processMaxRestarts = typeof p.maxRestarts === "number" && p.maxRestarts >= 0 ? p.maxRestarts : undefined;
1124
+ const processReadyTimeout = typeof p.readyTimeout === "number" && p.readyTimeout > 0 ? p.readyTimeout : undefined;
1125
+ const processStopSignal = validateStopSignal(p.stopSignal);
1126
+ const processErrorMatcher = validateErrorMatcher(name, p.errorMatcher);
1127
+ const processWatch = validateStringOrStringArray(p.watch);
1118
1128
  validated[name] = {
1119
1129
  command: p.command,
1120
1130
  cwd: processCwd ?? globalCwd,
@@ -1123,16 +1133,16 @@ function validateConfig(raw, warnings) {
1123
1133
  dependsOn: Array.isArray(p.dependsOn) ? p.dependsOn : undefined,
1124
1134
  readyPattern,
1125
1135
  persistent,
1126
- maxRestarts: typeof p.maxRestarts === "number" && p.maxRestarts >= 0 ? p.maxRestarts : undefined,
1127
- readyTimeout: typeof p.readyTimeout === "number" && p.readyTimeout > 0 ? p.readyTimeout : undefined,
1136
+ maxRestarts: processMaxRestarts ?? globalMaxRestarts,
1137
+ readyTimeout: processReadyTimeout ?? globalReadyTimeout,
1128
1138
  delay: typeof p.delay === "number" && p.delay > 0 ? p.delay : undefined,
1129
1139
  condition: typeof p.condition === "string" && p.condition.trim() ? p.condition.trim() : undefined,
1130
1140
  platform,
1131
- stopSignal: validateStopSignal(p.stopSignal),
1141
+ stopSignal: processStopSignal ?? globalStopSignal,
1132
1142
  color: typeof p.color === "string" ? p.color : Array.isArray(p.color) ? p.color : undefined,
1133
- watch: validateStringOrStringArray(p.watch),
1143
+ watch: processWatch ?? globalWatch,
1134
1144
  interactive: typeof p.interactive === "boolean" ? p.interactive : false,
1135
- errorMatcher: validateErrorMatcher(name, p.errorMatcher),
1145
+ errorMatcher: processErrorMatcher ?? globalErrorMatcher,
1136
1146
  showCommand
1137
1147
  };
1138
1148
  }
package/dist/types.d.ts CHANGED
@@ -72,6 +72,22 @@ export interface NumuxConfig<K extends string = string> {
72
72
  * @default true
73
73
  */
74
74
  showCommand?: boolean;
75
+ /**
76
+ * Global restart limit, inherited by all processes
77
+ * @default Infinity
78
+ */
79
+ maxRestarts?: number;
80
+ /** Global ready timeout (ms), inherited by all processes */
81
+ readyTimeout?: number;
82
+ /**
83
+ * Global stop signal, inherited by all processes
84
+ * @default 'SIGTERM'
85
+ */
86
+ stopSignal?: 'SIGTERM' | 'SIGINT' | 'SIGHUP';
87
+ /** Global error matcher, inherited by all processes. `true` = detect ANSI red output, string = regex */
88
+ errorMatcher?: boolean | string;
89
+ /** Global watch patterns, inherited by processes without their own watch */
90
+ watch?: string | string[];
75
91
  processes: Record<K, NumuxProcessConfig<K> | NumuxScriptPattern<K> | string>;
76
92
  }
77
93
  /** Process config after validation — dependsOn is always normalized to an array */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "numux",
3
- "version": "1.20.0",
3
+ "version": "1.21.0",
4
4
  "description": "Terminal multiplexer with dependency orchestration",
5
5
  "type": "module",
6
6
  "license": "MIT",