@vzn/vx 0.0.107 → 0.0.109

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.107",
3
+ "version": "0.0.109",
4
4
  "description": "A fast, correct task runner and build cache for JavaScript monorepos.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -17,10 +17,10 @@
17
17
  "node": ">=18"
18
18
  },
19
19
  "optionalDependencies": {
20
- "@vzn/vx-linux-x64": "0.0.107",
21
- "@vzn/vx-linux-arm64": "0.0.107",
22
- "@vzn/vx-darwin-x64": "0.0.107",
23
- "@vzn/vx-darwin-arm64": "0.0.107"
20
+ "@vzn/vx-linux-x64": "0.0.109",
21
+ "@vzn/vx-linux-arm64": "0.0.109",
22
+ "@vzn/vx-darwin-x64": "0.0.109",
23
+ "@vzn/vx-darwin-arm64": "0.0.109"
24
24
  },
25
25
  "dependencies": {
26
26
  "@anthropic-ai/sandbox-runtime": "^0.0.76"
@@ -385,12 +385,16 @@ export const FILE_HASH_RACY_MS = 50
385
385
  * write passed a 50 ms window: the memo served the first bytes' digest for
386
386
  * a same-size rewrite 120 ms on (A-2, reproduced on an ext2 mount). A stamp
387
387
  * with no sub-second part is read as such a second and widens the window by
388
- * it, as git judges racy entries at its index's own granularity. Pass the
389
- * UNFLOORED stamp: a kernel's nanosecond stamp lands on a whole second about
390
- * once in 10^9, one set through a millisecond `utimes` once in a thousand,
391
- * and either is then trusted a second later — never wrongly.
388
+ * it, as git judges racy entries at its index's own granularity. FAT32
389
+ * keeps even seconds, so an even stamp widens by two: a hash 1.2 s after
390
+ * one passed the single second and a rewrite later in the pair kept every
391
+ * field (A-38). Pass the UNFLOORED stamp: a kernel's nanosecond stamp lands
392
+ * on a whole second about once in 10^9, one set through a millisecond
393
+ * `utimes` once in a thousand, and either is then trusted up to two seconds
394
+ * later — never wrongly.
392
395
  */
393
396
  export function racyWindowMs(stampMs: number, windowMs: number): number {
397
+ if (stampMs % 2000 === 0) return windowMs + 2000
394
398
  return stampMs % 1000 === 0 ? windowMs + 1000 : windowMs
395
399
  }
396
400
 
@@ -135,7 +135,12 @@ export function unprovidedBareImports(
135
135
  if (up === dir) break
136
136
  dir = up
137
137
  }
138
- if (!provided && tsconfigTarget(spec, fromDir) === undefined && !out.includes(spec)) {
138
+ if (
139
+ !provided &&
140
+ !selfReference(pkg, fromDir) &&
141
+ tsconfigTarget(spec, fromDir) === undefined &&
142
+ !out.includes(spec)
143
+ ) {
139
144
  out.push(spec)
140
145
  }
141
146
  }
@@ -287,6 +292,31 @@ function expansions(named: string): string[] {
287
292
  return [named, ...RESOLVED_EXTENSIONS.flatMap((e) => [named + e, path.join(named, 'index' + e)])]
288
293
  }
289
294
 
295
+ /**
296
+ * Whether `pkg` names the package `fromDir` sits in, and that package has
297
+ * `exports`: Bun resolves such a self-reference inside it and never asks
298
+ * the registry, an unexported subpath included (strace, D-29).
299
+ */
300
+ function selfReference(pkg: string, fromDir: string): boolean {
301
+ for (let dir = path.resolve(fromDir); ;) {
302
+ const manifest = path.join(dir, 'package.json')
303
+ if (existsSync(manifest)) {
304
+ try {
305
+ const json = JSON.parse(readFileSync(manifest, 'utf8')) as {
306
+ name?: unknown
307
+ exports?: unknown
308
+ }
309
+ return json.name === pkg && json.exports !== undefined
310
+ } catch {
311
+ return false
312
+ }
313
+ }
314
+ const up = path.dirname(dir)
315
+ if (up === dir) return false
316
+ dir = up
317
+ }
318
+ }
319
+
290
320
  /**
291
321
  * A textual pass before the scan: a relative specifier opens with a quoted
292
322
  * `./` or `../`, or spells one with an escape, and most configs hold