@williamthorsen/nmr 0.2.0 → 0.3.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/dist/esm/.cache CHANGED
@@ -1 +1 @@
1
- 9e1d1640b1b02f3f57e2de2be7b213428f2179a5addb9c4dcfdc6dc9fb35597d
1
+ 75a615bf272a9fdadb44845d2a33161432fe36543278a1abdfa819bdeb581654
package/dist/esm/cli.js CHANGED
@@ -78,14 +78,19 @@ async function main() {
78
78
  process.exit(code2);
79
79
  }
80
80
  if (parsed.recursive) {
81
+ process.env.NMR_RUN_IF_PRESENT = "1";
81
82
  const delegateCmd = `pnpm --recursive exec nmr ${command}${passthrough}`;
82
83
  const code2 = runCommand(delegateCmd, context.monorepoRoot, runOptions);
83
84
  process.exit(code2);
84
85
  }
85
86
  const useRoot = parsed.workspaceRoot || context.isRoot;
86
87
  const registry = useRoot ? buildRootRegistry(context.config) : buildWorkspaceRegistry(context.config, parsed.intTest);
87
- const resolved = resolveScript(command, registry, context.packageDir);
88
+ const packageDir = context.packageDir ?? context.monorepoRoot;
89
+ const resolved = resolveScript(command, registry, packageDir);
88
90
  if (!resolved) {
91
+ if (process.env.NMR_RUN_IF_PRESENT === "1") {
92
+ process.exit(0);
93
+ }
89
94
  console.error(`Unknown command: ${command}`);
90
95
  process.exit(1);
91
96
  }
@@ -95,7 +100,7 @@ async function main() {
95
100
  }
96
101
  process.exit(0);
97
102
  }
98
- if (resolved.source === "package" && !parsed.quiet) {
103
+ if (resolved.source === "package" && !parsed.quiet && registry[command] !== void 0) {
99
104
  console.info(`Using override script: ${resolved.command}`);
100
105
  }
101
106
  const fullCommand = resolved.command + passthrough;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@williamthorsen/nmr",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "private": false,
5
5
  "description": "Context-aware script runner for PNPM monorepos",
6
6
  "keywords": [