@vzn/vx 0.0.543 → 0.0.545

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.543",
3
+ "version": "0.0.545",
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.543",
25
- "@vzn/vx-linux-arm64": "0.0.543",
26
- "@vzn/vx-darwin-x64": "0.0.543",
27
- "@vzn/vx-darwin-arm64": "0.0.543"
24
+ "@vzn/vx-linux-x64": "0.0.545",
25
+ "@vzn/vx-linux-arm64": "0.0.545",
26
+ "@vzn/vx-darwin-x64": "0.0.545",
27
+ "@vzn/vx-darwin-arm64": "0.0.545"
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`,
@@ -180,6 +180,17 @@ export function validateWorkspace(config: WorkspaceConfig, configPath: string):
180
180
  `task's command runs (see docs/architecture.md § plugin capabilities).`,
181
181
  )
182
182
  }
183
+ // A misspelled hook (`excutor`, `setUp`) was never called and never
184
+ // said: tasks ran here with the plugin's executor unheard (X-19).
185
+ for (const key of Object.keys(plug)) {
186
+ if (key === 'name' || (PLUGIN_HOOKS as readonly string[]).includes(key)) continue
187
+ const near = nearest(key, PLUGIN_HOOKS)
188
+ const hint =
189
+ near === undefined ? ` (hooks: ${PLUGIN_HOOKS.join(', ')})` : ` — did you mean '${near}'?`
190
+ throw new UserError(
191
+ `${configPath}: plugin '${pkg}' declares '${key}', which is no plugin hook${hint}`,
192
+ )
193
+ }
183
194
  for (const cap of PLUGIN_FUNCTION_HOOKS) {
184
195
  if (plug[cap] !== undefined && typeof plug[cap] !== 'function') {
185
196
  throw new UserError(`${configPath}: \`plugins[${i}].${cap}\` must be a function`)