@vzn/vx 0.0.407 → 0.0.409

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.407",
3
+ "version": "0.0.409",
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.407",
25
- "@vzn/vx-linux-arm64": "0.0.407",
26
- "@vzn/vx-darwin-x64": "0.0.407",
27
- "@vzn/vx-darwin-arm64": "0.0.407"
24
+ "@vzn/vx-linux-x64": "0.0.409",
25
+ "@vzn/vx-linux-arm64": "0.0.409",
26
+ "@vzn/vx-darwin-x64": "0.0.409",
27
+ "@vzn/vx-darwin-arm64": "0.0.409"
28
28
  },
29
29
  "dependencies": {
30
30
  "@anthropic-ai/sandbox-runtime": "^0.0.76"
@@ -152,13 +152,21 @@ export class ChangeJudge {
152
152
  const editForUncached = (p: string): boolean =>
153
153
  [...this.ctx.uncached()].some((dir) => p.startsWith(dir + path.sep)) &&
154
154
  !this.writtenDuringLastCycle(p)
155
+ // A path still there names the cycle before a gone one: an editor or
156
+ // `sed -i` saving through a temporary file fires that file first, and
157
+ // the cycle was announced by a name already renamed away.
158
+ let gone: [label: string, abs: string] | undefined
155
159
  for (const [p, l] of this.pending) {
156
160
  if (ignored.has(p) && !editForUncached(p)) continue
157
- if (!this.sameState(p) && first === undefined) {
158
- first = l
159
- firstAbs = p
161
+ if (this.sameState(p) || first !== undefined) continue
162
+ if (!fs.existsSync(p)) {
163
+ gone ??= [l, p]
164
+ continue
160
165
  }
166
+ first = l
167
+ firstAbs = p
161
168
  }
169
+ if (first === undefined && gone !== undefined) [first, firstAbs] = gone
162
170
  this.pending.clear()
163
171
  const byServer = firstAbs !== undefined && this.ctx.held()
164
172
  if (firstAbs === undefined || !this.writtenDuringLastCycle(firstAbs, true)) {
@@ -352,7 +352,17 @@ export async function applyMigration(args: ApplyMigrationArgs): Promise<number>
352
352
  const report: string[] = []
353
353
  // Single-project mode with packages the root's missing `workspaces` never
354
354
  // reaches: the scripts exist, the globs do not (item 248).
355
- const unreached = empty ? await unreachedPackages(await loadWorkspace(root)) : []
355
+ const workspace = empty ? await loadWorkspace(root) : undefined
356
+ const unreached = workspace === undefined ? [] : await unreachedPackages(workspace)
357
+ // Globs that reach no package: "no scripts" was true and named nothing
358
+ // to fix (M-42).
359
+ const globs = workspace?.packageGlobs.filter((g) => g !== '.') ?? []
360
+ const noMembers =
361
+ globs.length > 0 && metas.every((m) => path.resolve(m.dir) === path.resolve(root))
362
+ ? [
363
+ `the workspace globs (${globs.map((g) => `"${g}"`).join(', ')}) match no package.json: add a package under one, or fix the glob`,
364
+ ]
365
+ : []
356
366
  if (empty && unreached.length > 0) {
357
367
  report.push(
358
368
  `${verb}: ${unreachedHint(unreached)}`,
@@ -365,7 +375,7 @@ export async function applyMigration(args: ApplyMigrationArgs): Promise<number>
365
375
  } else if (empty) {
366
376
  report.push(
367
377
  `${verb}: no package.json scripts to turn into tasks.`,
368
- ...(args.notes ?? []).map((n) => `note: ${n}`),
378
+ ...[...noMembers, ...(args.notes ?? [])].map((n) => `note: ${n}`),
369
379
  hasWorkspaceFile
370
380
  ? `${workspaceName} already exists.`
371
381
  : dry