@vzn/vx 0.0.78 → 0.0.80

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.
Files changed (2) hide show
  1. package/package.json +5 -5
  2. package/src/cli/index.ts +13 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vzn/vx",
3
- "version": "0.0.78",
3
+ "version": "0.0.80",
4
4
  "description": "An open, extensible monorepo task runner.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -17,10 +17,10 @@
17
17
  "node": ">=18"
18
18
  },
19
19
  "optionalDependencies": {
20
- "@vzn/vx-linux-x64": "0.0.78",
21
- "@vzn/vx-linux-arm64": "0.0.78",
22
- "@vzn/vx-darwin-x64": "0.0.78",
23
- "@vzn/vx-darwin-arm64": "0.0.78"
20
+ "@vzn/vx-linux-x64": "0.0.80",
21
+ "@vzn/vx-linux-arm64": "0.0.80",
22
+ "@vzn/vx-darwin-x64": "0.0.80",
23
+ "@vzn/vx-darwin-arm64": "0.0.80"
24
24
  },
25
25
  "dependencies": {
26
26
  "@anthropic-ai/sandbox-runtime": "^0.0.76"
package/src/cli/index.ts CHANGED
@@ -6,7 +6,7 @@ import { VERSION } from '../version.js'
6
6
  import { runCmd } from './run.js'
7
7
  import { CORE_VERBS, printHelp } from './help.js'
8
8
  import { pluginCommandHelp, resolvePluginCommand, pluginVerbs } from './plugin-commands.js'
9
- import { MOVED_VERBS, nearest, UserError } from '../util/index.js'
9
+ import { isUserError, MOVED_VERBS, nearest, UserError } from '../util/index.js'
10
10
 
11
11
  // Every verb but `run` is imported when invoked. `vx run` is the hot path
12
12
  // and nearly every invocation; the other verbs' modules are code that
@@ -78,7 +78,18 @@ export async function run(argv: readonly string[]): Promise<number> {
78
78
  // nothing here can shadow them.
79
79
  const resolved = await resolvePluginCommand(command)
80
80
  if (resolved !== null && !('loadError' in resolved) && !('declaredVerbs' in resolved)) {
81
- const code = await resolved.command.run(rest, resolved.ctx)
81
+ let code: number
82
+ try {
83
+ code = await resolved.command.run(rest, resolved.ctx)
84
+ } catch (err) {
85
+ // A verb's own refusal is its one line; anything else is the
86
+ // plugin's crash, named as every other stage names one.
87
+ if (isUserError(err)) throw err
88
+ const message = err instanceof Error ? err.message : String(err)
89
+ throw new UserError(
90
+ `plugin '${resolved.plugin.name}' failed in command '${command}': ${message}`,
91
+ )
92
+ }
82
93
  // A plugin is a boundary: a JS-authored verb that resolves nothing
83
94
  // would reach `process.exit(undefined)` and read as SUCCESS. A verb
84
95
  // that cannot say whether it succeeded fails, naming its owner. So