@vzn/vx 0.0.544 → 0.0.546

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vzn/vx",
3
- "version": "0.0.544",
3
+ "version": "0.0.546",
4
4
  "description": "The fastest task runner and build cache for JavaScript monorepos.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -21,10 +21,10 @@
21
21
  "node": ">=18"
22
22
  },
23
23
  "optionalDependencies": {
24
- "@vzn/vx-linux-x64": "0.0.544",
25
- "@vzn/vx-linux-arm64": "0.0.544",
26
- "@vzn/vx-darwin-x64": "0.0.544",
27
- "@vzn/vx-darwin-arm64": "0.0.544"
24
+ "@vzn/vx-linux-x64": "0.0.546",
25
+ "@vzn/vx-linux-arm64": "0.0.546",
26
+ "@vzn/vx-darwin-x64": "0.0.546",
27
+ "@vzn/vx-darwin-arm64": "0.0.546"
28
28
  },
29
29
  "dependencies": {
30
30
  "@anthropic-ai/sandbox-runtime": "^0.0.76"
@@ -445,7 +445,17 @@ function pluginPackageName(dir: string): string {
445
445
  /* not here; look one level up */
446
446
  }
447
447
  if (text !== undefined) {
448
- const name = (JSON.parse(text) as { name?: unknown }).name
448
+ // A bare JSON.parse reached the user as a SyntaxError and a stack,
449
+ // naming no file (X-20).
450
+ let pkg: { name?: unknown } | null
451
+ try {
452
+ pkg = JSON.parse(text) as { name?: unknown } | null
453
+ } catch (err) {
454
+ throw new UserError(
455
+ `definePlugin: failed to parse ${path.join(d, 'package.json')}: ${(err as Error).message}`,
456
+ )
457
+ }
458
+ const name = pkg?.name
449
459
  if (typeof name !== 'string' || name.length === 0) {
450
460
  throw new UserError(
451
461
  `definePlugin: ${path.join(d, 'package.json')} has no name — a plugin is a package, and its name is the package's`,
@@ -219,6 +219,13 @@ export function validateWorkspace(config: WorkspaceConfig, configPath: string):
219
219
  // plugin-verb lookup — refuses it the same way. The owner is the
220
220
  // package: two plugins one package exports (`bun()` and `pnpm()`
221
221
  // both carry `prune`) are one owner, and the first declared runs.
222
+ // `vx --version` and `vx ''` never reach a plugin: a flag is
223
+ // core's, and an empty word is no verb (X-21).
224
+ if (verb.trim() === '' || verb.startsWith('-')) {
225
+ throw new UserError(
226
+ `${configPath}: plugin '${plug.name}' declares command '${verb}', which no command line reaches — a verb is a word, not a flag or empty`,
227
+ )
228
+ }
222
229
  if ((CORE_VERBS as readonly string[]).includes(verb)) {
223
230
  throw new UserError(
224
231
  `${configPath}: plugin '${plug.name}' declares command '${verb}', a core verb — core verbs cannot be shadowed`,