@vzn/vx 0.0.572 → 0.0.574

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.572",
3
+ "version": "0.0.574",
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.572",
25
- "@vzn/vx-linux-arm64": "0.0.572",
26
- "@vzn/vx-darwin-x64": "0.0.572",
27
- "@vzn/vx-darwin-arm64": "0.0.572"
24
+ "@vzn/vx-linux-x64": "0.0.574",
25
+ "@vzn/vx-linux-arm64": "0.0.574",
26
+ "@vzn/vx-darwin-x64": "0.0.574",
27
+ "@vzn/vx-darwin-arm64": "0.0.574"
28
28
  },
29
29
  "dependencies": {
30
30
  "@anthropic-ai/sandbox-runtime": "^0.0.76"
package/src/cli/watch.ts CHANGED
@@ -22,6 +22,7 @@ import {
22
22
  run as runOrchestrator,
23
23
  type HeldPersistent,
24
24
  type RunOptions,
25
+ shellQuote,
25
26
  } from '../orchestrator/index.js'
26
27
  import {
27
28
  findWorkspaceRoot,
@@ -125,7 +126,7 @@ export async function watchCmd(args: readonly string[]): Promise<number> {
125
126
  // Every cycle's `invocations` row names the verb, as `vx run`'s does;
126
127
  // run()'s process.argv fallback put the bin's absolute path there, so
127
128
  // `vx last --list` showed `$ /…/bin.ts watch build` beside `$ vx run build`.
128
- opts.command = ['vx', 'watch', ...args].join(' ')
129
+ opts.command = ['vx', 'watch', ...args.map(shellQuote)].join(' ')
129
130
  // A staged load and a discovery from the selection pass are one run's
130
131
  // worth; every cycle after an edit must load and list live.
131
132
  delete opts.staged
package/src/cli/why.ts CHANGED
@@ -106,7 +106,7 @@ export function parseWhyArgs(args: readonly string[]): WhyArgs {
106
106
  * every recorded id (the same rule `vx run` hints with) and the hint is
107
107
  * the runnable `project#task`; an anchored query is matched whole.
108
108
  */
109
- function suggest(query: string, ids: readonly string[]): string {
109
+ function suggest(query: string, ids: readonly string[], invoked: boolean): string {
110
110
  let hits: string[]
111
111
  if (query.includes('#')) {
112
112
  hits = nearMatches(query, ids)
@@ -120,9 +120,12 @@ function suggest(query: string, ids: readonly string[]): string {
120
120
  }
121
121
  if (hits.length > 0) return ` — did you mean ${hits.slice(0, 3).join(', ')}?`
122
122
  // No near name: say where to look, or that there is nothing yet.
123
- return ids.length === 0
124
- ? `; nothing has run here yet (vx run ${query}, then vx why)`
125
- : '; `vx last --list` shows what has run'
123
+ // A run of only group tasks records no task row: "nothing has run" was
124
+ // false there, and its advice re-ran the group to the same answer.
125
+ if (ids.length > 0) return '; `vx last --list` shows what has run'
126
+ return invoked
127
+ ? '; no recorded run executed a task (a group records none: ask about a task it depends on)'
128
+ : `; nothing has run here yet (vx run ${query}, then vx why)`
126
129
  }
127
130
 
128
131
  /**
@@ -151,8 +154,9 @@ async function resolveTarget(
151
154
  .query('SELECT DISTINCT project, task FROM runs ORDER BY project, task')
152
155
  .all() as Array<{ project: string; task: string }>
153
156
  const ids = pairs.map((p) => `${p.project}#${p.task}`)
157
+ const invoked = ids.length === 0 && db.query('SELECT 1 FROM invocations LIMIT 1').get() !== null
154
158
  if (target.includes('#')) {
155
- throw new UserError(`vx why: no recorded runs for "${target}"${suggest(target, ids)}`)
159
+ throw new UserError(`vx why: no recorded runs for "${target}"${suggest(target, ids, invoked)}`)
156
160
  }
157
161
  const matches = ids.filter((id) => id.endsWith(`#${target}`))
158
162
  if (matches.length === 1) return matches[0]!
@@ -164,7 +168,9 @@ async function resolveTarget(
164
168
  matches.map((m) => ` ${m}`).join('\n'),
165
169
  )
166
170
  }
167
- throw new UserError(`vx why: no recorded runs for task "${target}"${suggest(target, ids)}`)
171
+ throw new UserError(
172
+ `vx why: no recorded runs for task "${target}"${suggest(target, ids, invoked)}`,
173
+ )
168
174
  }
169
175
 
170
176
  const fmtWhen = (ms: number): string => new Date(ms).toISOString()