numux 1.16.0 → 1.16.1
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 +42 -31
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -300,7 +300,7 @@ Falsy values: unset, empty string, `"0"`, `"false"`, `"no"`, `"off"` (case-insen
|
|
|
300
300
|
|
|
301
301
|
### Dependency orchestration
|
|
302
302
|
|
|
303
|
-
|
|
303
|
+
Each process starts as soon as its declared `dependsOn` dependencies are ready — it does not wait for unrelated processes. If a process fails, its dependents are skipped.
|
|
304
304
|
|
|
305
305
|
A process becomes **ready** when:
|
|
306
306
|
- **persistent + readyPattern** — the pattern matches in stdout
|
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.16.
|
|
39
|
+
version: "1.16.1",
|
|
40
40
|
description: "Terminal multiplexer with dependency orchestration",
|
|
41
41
|
type: "module",
|
|
42
42
|
license: "MIT",
|
|
@@ -1691,38 +1691,49 @@ class ProcessManager {
|
|
|
1691
1691
|
log("Starting all processes");
|
|
1692
1692
|
this.lastCols = cols;
|
|
1693
1693
|
this.lastRows = rows;
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
continue;
|
|
1712
|
-
}
|
|
1713
|
-
const { promise, resolve: resolve8 } = Promise.withResolvers();
|
|
1714
|
-
readyPromises.push(promise);
|
|
1715
|
-
this.pendingReadyResolvers.set(name, resolve8);
|
|
1716
|
-
this.createRunner(name, () => {
|
|
1717
|
-
this.pendingReadyResolvers.delete(name);
|
|
1718
|
-
resolve8();
|
|
1719
|
-
});
|
|
1720
|
-
this.startProcess(name, cols, rows);
|
|
1694
|
+
const readyPromises = new Map;
|
|
1695
|
+
const readyResolvers = new Map;
|
|
1696
|
+
for (const name of this.tiers.flat()) {
|
|
1697
|
+
const { promise, resolve: resolve8 } = Promise.withResolvers();
|
|
1698
|
+
readyPromises.set(name, promise);
|
|
1699
|
+
readyResolvers.set(name, resolve8);
|
|
1700
|
+
}
|
|
1701
|
+
const launches = this.tiers.flat().map(async (name) => {
|
|
1702
|
+
const proc = this.config.processes[name];
|
|
1703
|
+
const resolve8 = readyResolvers.get(name);
|
|
1704
|
+
const deps = proc.dependsOn ?? [];
|
|
1705
|
+
if (deps.length > 0) {
|
|
1706
|
+
await Promise.all(deps.map((d) => readyPromises.get(d)));
|
|
1707
|
+
}
|
|
1708
|
+
if (this.stopping) {
|
|
1709
|
+
resolve8();
|
|
1710
|
+
return;
|
|
1721
1711
|
}
|
|
1722
|
-
if (
|
|
1723
|
-
|
|
1712
|
+
if (proc.condition && !evaluateCondition(proc.condition)) {
|
|
1713
|
+
log(`Skipping ${name}: condition "${proc.condition}" not met`);
|
|
1714
|
+
this.updateStatus(name, "skipped");
|
|
1715
|
+
resolve8();
|
|
1716
|
+
return;
|
|
1724
1717
|
}
|
|
1725
|
-
|
|
1718
|
+
const failedDep = deps.find((d) => {
|
|
1719
|
+
const s = this.states.get(d).status;
|
|
1720
|
+
return s === "failed" || s === "skipped";
|
|
1721
|
+
});
|
|
1722
|
+
if (failedDep) {
|
|
1723
|
+
log(`Skipping ${name}: dependency ${failedDep} failed`);
|
|
1724
|
+
this.updateStatus(name, "skipped");
|
|
1725
|
+
resolve8();
|
|
1726
|
+
return;
|
|
1727
|
+
}
|
|
1728
|
+
this.pendingReadyResolvers.set(name, resolve8);
|
|
1729
|
+
this.createRunner(name, () => {
|
|
1730
|
+
this.pendingReadyResolvers.delete(name);
|
|
1731
|
+
resolve8();
|
|
1732
|
+
});
|
|
1733
|
+
this.startProcess(name, cols, rows);
|
|
1734
|
+
await readyPromises.get(name);
|
|
1735
|
+
});
|
|
1736
|
+
await Promise.all(launches);
|
|
1726
1737
|
this.setupWatchers();
|
|
1727
1738
|
}
|
|
1728
1739
|
startProcess(name, cols, rows) {
|