@vzn/vx 0.0.430 → 0.0.432

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.430",
3
+ "version": "0.0.432",
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.430",
25
- "@vzn/vx-linux-arm64": "0.0.430",
26
- "@vzn/vx-darwin-x64": "0.0.430",
27
- "@vzn/vx-darwin-arm64": "0.0.430"
24
+ "@vzn/vx-linux-x64": "0.0.432",
25
+ "@vzn/vx-linux-arm64": "0.0.432",
26
+ "@vzn/vx-darwin-x64": "0.0.432",
27
+ "@vzn/vx-darwin-arm64": "0.0.432"
28
28
  },
29
29
  "dependencies": {
30
30
  "@anthropic-ai/sandbox-runtime": "^0.0.76"
@@ -340,7 +340,8 @@ export function gitFiles(workspaceRoot: string): Set<string> | undefined {
340
340
  const files = new Set<string>()
341
341
  for (const p of new TextDecoder().decode(proc.stdout).split('\0')) {
342
342
  if (p.length === 0) continue
343
- let abs = path.join(workspaceRoot, p)
343
+ // An untracked nested repository is listed as `dir/`.
344
+ let abs = path.join(workspaceRoot, p.endsWith('/') ? p.slice(0, -1) : p)
344
345
  files.add(abs)
345
346
  for (abs = path.dirname(abs); abs !== workspaceRoot && !files.has(abs); abs = path.dirname(abs))
346
347
  files.add(abs)
@@ -111,8 +111,8 @@ export class ChangeJudge {
111
111
  // says which side of the arm it belongs to. A path already gone is a
112
112
  // change: a deletion has no date to read.
113
113
  // One exception: a path git did not list at the arm, and gone now, was
114
- // born and removed since (vim's `4913` write probe, a tool's lock file);
115
- // it started a cycle with nothing changed. The blind spot: one born in
114
+ // born and removed since (vim's `4913` write probe, a tool's lock file),
115
+ // unless a nested repository holds it (`inNestedRepo`); it started a cycle with nothing changed. The blind spot: one born in
116
116
  // the moment between a judgement and that cycle's keys, and gone by the
117
117
  // next judgement, was read and its deletion re-runs nothing. Git lists
118
118
  // no ignored path, so one of those is a deletion as before.
@@ -123,11 +123,21 @@ export class ChangeJudge {
123
123
  if (prev !== undefined) return prev === state
124
124
  if (state === ABSENT) {
125
125
  const listed = this.ctx.existedAtArm
126
- return !ignored && listed !== undefined && !listed.has(abs)
126
+ return !ignored && listed !== undefined && !listed.has(abs) && !this.inNestedRepo(abs)
127
127
  }
128
128
  return modifiedBefore(abs, this.ctx.armedAt)
129
129
  }
130
130
 
131
+ // Git lists a nested repository (a submodule, a vendored clone) as one
132
+ // entry, never the files in it, and keys read them: under one, a gone
133
+ // path the arm did not list may have existed, so it is a deletion.
134
+ private inNestedRepo(abs: string): boolean {
135
+ const root = this.ctx.workspaceRoot
136
+ for (let dir = path.dirname(abs); dir !== root && dir.startsWith(root); dir = path.dirname(dir))
137
+ if (fs.existsSync(path.join(dir, '.git'))) return true
138
+ return false
139
+ }
140
+
131
141
  private writtenDuringLastCycle(abs: string, openWhileHeld = false): boolean {
132
142
  // A server the last cycle left running is still that cycle's: its
133
143
  // writes land after the cycle ended, and with a closed window a dev