@vzn/vx 0.0.225 → 0.0.226

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.225",
3
+ "version": "0.0.226",
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.225",
21
- "@vzn/vx-linux-arm64": "0.0.225",
22
- "@vzn/vx-darwin-x64": "0.0.225",
23
- "@vzn/vx-darwin-arm64": "0.0.225"
20
+ "@vzn/vx-linux-x64": "0.0.226",
21
+ "@vzn/vx-linux-arm64": "0.0.226",
22
+ "@vzn/vx-darwin-x64": "0.0.226",
23
+ "@vzn/vx-darwin-arm64": "0.0.226"
24
24
  },
25
25
  "dependencies": {
26
26
  "@anthropic-ai/sandbox-runtime": "^0.0.76"
@@ -17,8 +17,8 @@
17
17
  // be a git work tree; non-git environments are not supported.
18
18
 
19
19
  import path from 'node:path'
20
- import { lstatSync, readdirSync } from 'node:fs'
21
- import { realpath, rm, rmdir } from 'node:fs/promises'
20
+ import { lstatSync, readdirSync, realpathSync } from 'node:fs'
21
+ import { rm, rmdir } from 'node:fs/promises'
22
22
  import type { CacheInputs } from '../config.js'
23
23
  import {
24
24
  asTrees,
@@ -533,7 +533,7 @@ export async function resolveOutputs(args: {
533
533
  // outside the project, so any future caller reaching it by another route (a
534
534
  // programmatic embedder, a config source that skips the loader) is contained
535
535
  // by construction.
536
- return (await containedIn(args.projectDir, scanned)).sort()
536
+ return containedIn(args.projectDir, scanned).sort()
537
537
  }
538
538
 
539
539
  /**
@@ -558,7 +558,7 @@ export async function resolveOutputs(args: {
558
558
  * task that produced it) is REFUSED. When the caller deletes, unresolvable
559
559
  * means leave it alone.
560
560
  */
561
- async function containedIn(root: string, paths: readonly string[]): Promise<string[]> {
561
+ function containedIn(root: string, paths: readonly string[]): string[] {
562
562
  // One `path.dirname` per path, kept alongside — computing it again in the
563
563
  // final filter measured as the DOMINANT added cost on a wide output tree
564
564
  // (string work, not syscalls: 10k files in 20 dirs cost more than 5k files
@@ -571,9 +571,19 @@ async function containedIn(root: string, paths: readonly string[]): Promise<stri
571
571
  lexDirs.push(path.dirname(p))
572
572
  }
573
573
  if (lexical.length === 0) return []
574
- const realRoot = await realpath(root).catch(() => root)
574
+ // Sync, as `hashFile`'s lstat: a realpath is microseconds, and the
575
+ // promise round trip per call was most of this function's cost on every
576
+ // miss (B, 2026-09-30).
577
+ const real = (p: string): string | null => {
578
+ try {
579
+ return realpathSync(p)
580
+ } catch {
581
+ return null
582
+ }
583
+ }
584
+ const realRoot = real(root) ?? root
575
585
  const uniqueDirs = [...new Set(lexDirs)]
576
- const resolved = await Promise.all(uniqueDirs.map((d) => realpath(d).catch(() => null)))
586
+ const resolved = uniqueDirs.map(real)
577
587
  const contained = new Set<string>()
578
588
  for (const [i, dir] of uniqueDirs.entries()) {
579
589
  const real = resolved[i]
@@ -795,7 +805,7 @@ export async function resolveWorkspaceOutputs(args: {
795
805
  // deliberately ignore PROJECT boundaries — that is the escape hatch — but
796
806
  // escaping the WORKSPACE was never part of it, and `cleanWorkspaceOutputs`
797
807
  // deletes what this returns.
798
- return (await containedIn(args.workspaceRoot, scanned)).sort()
808
+ return containedIn(args.workspaceRoot, scanned).sort()
799
809
  }
800
810
 
801
811
  /**