numux 2.0.5 → 2.1.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 +4 -3
- package/dist/numux.js +16 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -128,11 +128,12 @@ numux -n api="bun dev:api" -n web="bun dev:web"
|
|
|
128
128
|
|
|
129
129
|
### Script patterns
|
|
130
130
|
|
|
131
|
-
Run
|
|
131
|
+
Run package.json scripts by name — any colon-containing name is automatically recognized as a script reference:
|
|
132
132
|
|
|
133
133
|
```sh
|
|
134
|
-
numux '
|
|
135
|
-
numux '
|
|
134
|
+
numux 'lint:eslint --fix' # runs: yarn run lint:eslint --fix
|
|
135
|
+
numux 'dev:*' # all scripts matching dev:*
|
|
136
|
+
numux 'npm:*:dev' # explicit npm: prefix (same behavior)
|
|
136
137
|
```
|
|
137
138
|
|
|
138
139
|
`*` does not match across `:` separators (like `/` in file paths), so `format:*` matches `format:store` but not `format:check:store`. Use `format:*:*` to match two levels deep.
|
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: "2.0
|
|
39
|
+
version: "2.1.0",
|
|
40
40
|
description: "Terminal multiplexer with dependency orchestration",
|
|
41
41
|
type: "module",
|
|
42
42
|
license: "MIT",
|
|
@@ -666,6 +666,17 @@ function detectPackageManager(pkgJson, cwd) {
|
|
|
666
666
|
function isGlobPattern(name) {
|
|
667
667
|
return /[*?[]/.test(name);
|
|
668
668
|
}
|
|
669
|
+
function isScriptReference(name, value) {
|
|
670
|
+
if (name.startsWith("npm:") || isGlobPattern(name))
|
|
671
|
+
return true;
|
|
672
|
+
if (!name.includes(":"))
|
|
673
|
+
return false;
|
|
674
|
+
if (typeof value === "string")
|
|
675
|
+
return false;
|
|
676
|
+
if (value && typeof value === "object" && "command" in value)
|
|
677
|
+
return false;
|
|
678
|
+
return true;
|
|
679
|
+
}
|
|
669
680
|
function deriveShortName(pattern, scriptName) {
|
|
670
681
|
let prefixEnd = 0;
|
|
671
682
|
while (prefixEnd < pattern.length && !"*?[".includes(pattern[prefixEnd])) {
|
|
@@ -692,8 +703,8 @@ function splitPatternArgs(raw) {
|
|
|
692
703
|
}
|
|
693
704
|
function expandScriptPatterns(config, cwd) {
|
|
694
705
|
const entries = Object.entries(config.processes);
|
|
695
|
-
const
|
|
696
|
-
if (!
|
|
706
|
+
const hasScriptRef = entries.some(([name, value]) => isScriptReference(name, value));
|
|
707
|
+
if (!hasScriptRef)
|
|
697
708
|
return config;
|
|
698
709
|
const dir = config.cwd ?? cwd ?? process.cwd();
|
|
699
710
|
const pkgPath = resolve(dir, "package.json");
|
|
@@ -709,7 +720,7 @@ function expandScriptPatterns(config, cwd) {
|
|
|
709
720
|
const pm = detectPackageManager(pkgJson, dir);
|
|
710
721
|
const expanded = {};
|
|
711
722
|
for (const [name, value] of entries) {
|
|
712
|
-
if (!(name
|
|
723
|
+
if (!isScriptReference(name, value)) {
|
|
713
724
|
expanded[name] = value;
|
|
714
725
|
continue;
|
|
715
726
|
}
|
|
@@ -3753,7 +3764,7 @@ async function main() {
|
|
|
3753
3764
|
let config;
|
|
3754
3765
|
const warnings = [];
|
|
3755
3766
|
if (parsed.commands.length > 0 || parsed.named.length > 0 || parsed.workspace) {
|
|
3756
|
-
const isScriptPattern = (c) => c.startsWith("npm:") || /[*?[]/.test(c);
|
|
3767
|
+
const isScriptPattern = (c) => c.startsWith("npm:") || /[*?[]/.test(c) || c.split(/\s+/)[0].includes(":");
|
|
3757
3768
|
const hasNpmPatterns = parsed.commands.some(isScriptPattern);
|
|
3758
3769
|
if (hasNpmPatterns) {
|
|
3759
3770
|
const npmPatterns = parsed.commands.filter(isScriptPattern);
|