numux 2.0.4 → 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 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 multiple package.json scripts matching a glob pattern:
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 'dev:*' # all scripts matching dev:*
135
- numux 'npm:*:dev' # explicit npm: prefix (same behavior)
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.4",
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 hasWildcard = entries.some(([name]) => name.startsWith("npm:") || isGlobPattern(name));
696
- if (!hasWildcard)
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.startsWith("npm:") || isGlobPattern(name))) {
723
+ if (!isScriptReference(name, value)) {
713
724
  expanded[name] = value;
714
725
  continue;
715
726
  }
@@ -3195,6 +3206,10 @@ class App {
3195
3206
  // src/ui/prefix.ts
3196
3207
  var RESET = ANSI_RESET;
3197
3208
  var DIM = "\x1B[90m";
3209
+ var CURSOR_SEQ_RE = /\x1b\[[\d;]*[ABCDEFGHJKLMSTdf]/g;
3210
+ function stripCursorSequences(text) {
3211
+ return text.replace(CURSOR_SEQ_RE, "");
3212
+ }
3198
3213
 
3199
3214
  class PrefixDisplay {
3200
3215
  manager;
@@ -3264,7 +3279,8 @@ class PrefixDisplay {
3264
3279
  }
3265
3280
  handleOutput(name, data) {
3266
3281
  const decoder = this.decoders.get(name) ?? new TextDecoder;
3267
- const text = decoder.decode(data, { stream: true });
3282
+ const raw = decoder.decode(data, { stream: true });
3283
+ const text = stripCursorSequences(raw);
3268
3284
  const buffer = (this.buffers.get(name) ?? "") + text;
3269
3285
  const lines = buffer.split(/\r*\n/);
3270
3286
  let tail = lines.pop() ?? "";
@@ -3748,7 +3764,7 @@ async function main() {
3748
3764
  let config;
3749
3765
  const warnings = [];
3750
3766
  if (parsed.commands.length > 0 || parsed.named.length > 0 || parsed.workspace) {
3751
- const isScriptPattern = (c) => c.startsWith("npm:") || /[*?[]/.test(c);
3767
+ const isScriptPattern = (c) => c.startsWith("npm:") || /[*?[]/.test(c) || c.split(/\s+/)[0].includes(":");
3752
3768
  const hasNpmPatterns = parsed.commands.some(isScriptPattern);
3753
3769
  if (hasNpmPatterns) {
3754
3770
  const npmPatterns = parsed.commands.filter(isScriptPattern);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "numux",
3
- "version": "2.0.4",
3
+ "version": "2.1.0",
4
4
  "description": "Terminal multiplexer with dependency orchestration",
5
5
  "type": "module",
6
6
  "license": "MIT",