@vzn/vx 0.0.537 → 0.0.539

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.537",
3
+ "version": "0.0.539",
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.537",
25
- "@vzn/vx-linux-arm64": "0.0.537",
26
- "@vzn/vx-darwin-x64": "0.0.537",
27
- "@vzn/vx-darwin-arm64": "0.0.537"
24
+ "@vzn/vx-linux-x64": "0.0.539",
25
+ "@vzn/vx-linux-arm64": "0.0.539",
26
+ "@vzn/vx-darwin-x64": "0.0.539",
27
+ "@vzn/vx-darwin-arm64": "0.0.539"
28
28
  },
29
29
  "dependencies": {
30
30
  "@anthropic-ai/sandbox-runtime": "^0.0.76"
package/src/cli/run.ts CHANGED
@@ -160,7 +160,8 @@ export function parseRunArgs(rawArgs: readonly string[], verb: 'run' | 'watch' =
160
160
  const a = before[i]
161
161
  if (a === '--filter' || a?.startsWith('--filter=')) {
162
162
  const v = a === '--filter' ? before[++i] : a.slice('--filter='.length)
163
- if (v === undefined || v === '')
163
+ // `--filter --dry` took `--dry` as the pattern (X-13); no filter opens with `--`.
164
+ if (v === undefined || v === '' || (a === '--filter' && v.startsWith('--')))
164
165
  return {
165
166
  ...out,
166
167
  error: `--filter requires a value (a project name, glob or path, e.g. --filter app)`,
package/src/cli/select.ts CHANGED
@@ -524,6 +524,10 @@ function didYouMeanProject(
524
524
  }
525
525
  for (const pattern of unmatched) {
526
526
  const typed = pattern.replace(/^!|\.\.\.$|^\.\.\.|\^/g, '')
527
+ // Two edits from any two-letter name: `--filter //` hinted `ui` (X-13).
528
+ if (typed === '//') {
529
+ return ". `//` is Turbo's root package, but the workspace root is no project here: give it a package.json name and a vx.config"
530
+ }
527
531
  const best = nearest(typed, names)
528
532
  if (best !== undefined) return `. Did you mean ${best}?`
529
533
  const bare = byBare.has(typed) ? typed : nearest(typed, byBare.keys())
@@ -45,6 +45,7 @@ import {
45
45
  buildTaskGraph,
46
46
  excludeDependencies,
47
47
  expandRequested,
48
+ isGroupTask,
48
49
  type TaskNode,
49
50
  undeclaredDepsError,
50
51
  unresolvedRequests,
@@ -627,6 +628,18 @@ export async function prepareRun(options: RunOptions, log: Logger): Promise<Prep
627
628
  },
628
629
  )
629
630
  }
631
+ // Args after `--` go to requested commands only; with none among them
632
+ // they reached nothing and the run passed, the `--watch` unheard.
633
+ if ((options.forwardArgs?.length ?? 0) > 0) {
634
+ const requestedNodes = [...nodes.values()].filter((n) => n.requested)
635
+ if (requestedNodes.length > 0 && requestedNodes.every(isGroupTask)) {
636
+ const ids = requestedNodes.map((n) => n.id)
637
+ const named = ids.length > 3 ? `${ids.slice(0, 3).join(', ')}, …` : ids.join(', ')
638
+ throw new UserError(
639
+ `args after \`--\` reach no task: ${named} ${ids.length === 1 ? 'has' : 'have'} no command (a group); name the task that runs one`,
640
+ )
641
+ }
642
+ }
630
643
  if (hasHook(plugins, 'key')) {
631
644
  await applyKeyHooks(plugins, nodes, { workspaceRoot, cacheDir, warn: (m) => log.status(m) })
632
645
  }
@@ -33,6 +33,7 @@ import {
33
33
  parseSize,
34
34
  printTimings,
35
35
  ulid,
36
+ isLiteralPattern,
36
37
  listed,
37
38
  nearest,
38
39
  UserError,
@@ -1577,6 +1578,21 @@ function didYouMean(
1577
1578
  continue
1578
1579
  }
1579
1580
  const [proj, task] = [spec.slice(0, at), spec.slice(at + 1)]
1581
+ // `//` is two edits from any two-letter name: it hinted `ui#build` (X-13).
1582
+ if (proj === '//') {
1583
+ lists.add(
1584
+ "`//` is Turbo's root package, but the workspace root is no project here: give it a package.json name and a vx.config with that task.",
1585
+ )
1586
+ continue
1587
+ }
1588
+ // `*` is one edit from any one-letter name and two from `ui`: `*#lint`
1589
+ // hinted `ui#lint`, though the user meant every project.
1590
+ if (!isLiteralPattern(proj) && !projects.has(proj)) {
1591
+ lists.add(
1592
+ `\`${spec}\` names one project, not a pattern: run \`${task}\` with --filter '${proj}' instead.`,
1593
+ )
1594
+ continue
1595
+ }
1580
1596
  if (!projects.has(proj)) {
1581
1597
  const p = projectNamed(proj, projects) ?? nearest(proj, projects.keys())
1582
1598
  if (p !== undefined && tasksOf(projects.get(p)).includes(task)) hints.add(`${p}#${task}`)