numux 1.10.1 → 1.10.3
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 +25 -3
- package/package.json +1 -1
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.10.
|
|
25
|
+
version: "1.10.3",
|
|
26
26
|
description: "Terminal multiplexer with dependency orchestration",
|
|
27
27
|
type: "module",
|
|
28
28
|
license: "MIT",
|
|
@@ -608,6 +608,24 @@ function detectPackageManager(pkgJson, cwd) {
|
|
|
608
608
|
function isGlobPattern(name) {
|
|
609
609
|
return /[*?[]/.test(name);
|
|
610
610
|
}
|
|
611
|
+
function deriveShortName(pattern, scriptName) {
|
|
612
|
+
let prefixEnd = 0;
|
|
613
|
+
while (prefixEnd < pattern.length && !"*?[".includes(pattern[prefixEnd])) {
|
|
614
|
+
prefixEnd++;
|
|
615
|
+
}
|
|
616
|
+
let suffixStart = pattern.length;
|
|
617
|
+
while (suffixStart > 0 && !"*?[".includes(pattern[suffixStart - 1])) {
|
|
618
|
+
suffixStart--;
|
|
619
|
+
}
|
|
620
|
+
const prefix = pattern.slice(0, prefixEnd);
|
|
621
|
+
const suffix = pattern.slice(suffixStart);
|
|
622
|
+
let short = scriptName;
|
|
623
|
+
if (prefix && short.startsWith(prefix))
|
|
624
|
+
short = short.slice(prefix.length);
|
|
625
|
+
if (suffix && short.endsWith(suffix))
|
|
626
|
+
short = short.slice(0, short.length - suffix.length);
|
|
627
|
+
return short || scriptName;
|
|
628
|
+
}
|
|
611
629
|
function splitPatternArgs(raw) {
|
|
612
630
|
const i = raw.indexOf(" ");
|
|
613
631
|
if (i === -1)
|
|
@@ -652,12 +670,13 @@ function expandScriptPatterns(config, cwd) {
|
|
|
652
670
|
const singleColor = typeof template.color === "string" ? template.color : undefined;
|
|
653
671
|
for (let i = 0;i < matches.length; i++) {
|
|
654
672
|
const scriptName = matches[i];
|
|
655
|
-
|
|
673
|
+
const displayName = deriveShortName(globPattern, scriptName);
|
|
674
|
+
if (expanded[displayName]) {
|
|
656
675
|
throw new Error(`"${name}": expanded script "${scriptName}" collides with an existing process name`);
|
|
657
676
|
}
|
|
658
677
|
const color = colors ? colors[i % colors.length] : singleColor;
|
|
659
678
|
const { color: _color, ...rest } = template;
|
|
660
|
-
expanded[
|
|
679
|
+
expanded[displayName] = {
|
|
661
680
|
...rest,
|
|
662
681
|
command: `${pm} run ${scriptName}${extraArgs}`,
|
|
663
682
|
...color ? { color } : {}
|
|
@@ -1728,6 +1747,9 @@ class ProcessManager {
|
|
|
1728
1747
|
updateStatus(name, status) {
|
|
1729
1748
|
const state = this.states.get(name);
|
|
1730
1749
|
state.status = status;
|
|
1750
|
+
if (status === "ready" && this.config.processes[name].readyPattern) {
|
|
1751
|
+
this.restartAttempts.set(name, 0);
|
|
1752
|
+
}
|
|
1731
1753
|
this.emit({ type: "status", name, status });
|
|
1732
1754
|
}
|
|
1733
1755
|
restart(name, cols, rows) {
|