@vzn/vx 0.0.358 → 0.0.359

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.358",
3
+ "version": "0.0.359",
4
4
  "description": "A fast, correct 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.358",
25
- "@vzn/vx-linux-arm64": "0.0.358",
26
- "@vzn/vx-darwin-x64": "0.0.358",
27
- "@vzn/vx-darwin-arm64": "0.0.358"
24
+ "@vzn/vx-linux-x64": "0.0.359",
25
+ "@vzn/vx-linux-arm64": "0.0.359",
26
+ "@vzn/vx-darwin-x64": "0.0.359",
27
+ "@vzn/vx-darwin-arm64": "0.0.359"
28
28
  },
29
29
  "dependencies": {
30
30
  "@anthropic-ai/sandbox-runtime": "^0.0.76"
@@ -438,33 +438,6 @@ export async function prepareRun(options: RunOptions, log: Logger): Promise<Prep
438
438
  // cycle under `vx watch` (item 1029). run() owns both only once this
439
439
  // returns.
440
440
  try {
441
- const gitFilesCache = new GitFilesCache()
442
- // Bulk-populate via a single `git ls-files` at the workspace root —
443
- // partitions the output by project. Avoids one fork+exec per project
444
- // (~5-10ms each on Linux; the dominant cold-start cost on big
445
- // monorepos). When any loaded task declares inputs.workspaceFiles,
446
- // the enumeration must see every file from the root (no pathspec
447
- // scoping) and additionally stores a workspace-wide partition.
448
- const usesWorkspaceInputs = [...projects.values()].some((p) =>
449
- Object.values(p.config.tasks ?? {}).some(
450
- (t) => (t.cache?.inputs.workspaceFiles?.length ?? 0) > 0,
451
- ),
452
- )
453
- const projectDirs = [...projects.values()].map((p) => p.dir)
454
- const enumeration = await (git.started ??
455
- startGitEnumeration(
456
- workspaceRoot,
457
- gitPathspecs(workspaceRoot, projectDirs, usesWorkspaceInputs),
458
- ))
459
- await applyGitEnumeration(
460
- enumeration,
461
- workspaceRoot,
462
- projectDirs,
463
- gitFilesCache,
464
- usesWorkspaceInputs,
465
- localCache,
466
- )
467
- mark('git enumeration')
468
441
  const hashCache = createHashCache()
469
442
  const fingerprintWatch = new FingerprintWatch(workspaceRoot, fingerprints, fingerprintsAt)
470
443
 
@@ -490,7 +463,7 @@ export async function prepareRun(options: RunOptions, log: Logger): Promise<Prep
490
463
  workspaceFingerprint,
491
464
  fingerprintWatch,
492
465
  nestedDirsByProject,
493
- gitFilesCache,
466
+ gitFilesCache: new GitFilesCache(),
494
467
  hashCache,
495
468
  workspaceProjectCount: projectMetas.length,
496
469
  empty:
@@ -545,11 +518,45 @@ export async function prepareRun(options: RunOptions, log: Logger): Promise<Prep
545
518
  )
546
519
  }
547
520
  }
548
- // The graph is built; what follows is the plugins' (graph, key,
549
- // schedule). Two rows, so a plugin's key stage reads as its own cost
550
- // and not as graph building — a lockfile plugin's 1000 stats per run
551
- // hid inside one `prepare (graph)` row until 2026-09-10.
521
+ // The graph is built; what follows is git's enumeration over its
522
+ // projects, then the plugins' stages (graph, key, schedule). Separate
523
+ // rows, so a plugin's key stage reads as its own cost and not as graph
524
+ // building — a lockfile plugin's 1000 stats per run hid inside one
525
+ // `prepare (graph)` row until 2026-09-10.
552
526
  mark('build graph')
527
+ const gitFilesCache = new GitFilesCache()
528
+ // Bulk-populate via a single `git ls-files` at the workspace root —
529
+ // partitions the output by project. Avoids one fork+exec per project
530
+ // (~5-10ms each on Linux; the dominant cold-start cost on big
531
+ // monorepos). When any task in the graph declares inputs.workspaceFiles,
532
+ // the enumeration must see every file from the root (no pathspec
533
+ // scoping) and additionally stores a workspace-wide partition.
534
+ // Over the projects that own a task, not every project loaded: a scoped
535
+ // run loads its dependency closure for the `^` walk, and a `lint` of one
536
+ // package walked the whole tree for it (~60 ms of git where one
537
+ // project's pathspec takes ~7, 1,000 projects). A node a `graph` hook
538
+ // adds in another project keys through `resolveFiles`' own spawn.
539
+ const graphDirs = new Set<string>()
540
+ let usesWorkspaceInputs = false
541
+ for (const n of nodes.values()) {
542
+ graphDirs.add(n.projectDir)
543
+ if ((n.config.cache?.inputs.workspaceFiles?.length ?? 0) > 0) usesWorkspaceInputs = true
544
+ }
545
+ const projectDirs = [...graphDirs]
546
+ const enumeration = await (git.started ??
547
+ startGitEnumeration(
548
+ workspaceRoot,
549
+ gitPathspecs(workspaceRoot, projectDirs, usesWorkspaceInputs),
550
+ ))
551
+ await applyGitEnumeration(
552
+ enumeration,
553
+ workspaceRoot,
554
+ projectDirs,
555
+ gitFilesCache,
556
+ usesWorkspaceInputs,
557
+ localCache,
558
+ )
559
+ mark('git enumeration')
553
560
  if (hasHook(plugins, 'graph')) {
554
561
  await applyGraphHooks(plugins, nodes, {
555
562
  workspaceRoot,
@@ -41,6 +41,7 @@ import {
41
41
  UserError,
42
42
  machineParallelism,
43
43
  teardownTimeoutMs,
44
+ secretMask,
44
45
  } from '../util/index.js'
45
46
  import { keyedProjects } from './keyed-projects.js'
46
47
  import { prepareSandbox } from './sandbox-request.js'
@@ -191,6 +192,10 @@ export function shouldShortCircuit(
191
192
  * GitHub job summary and a check-run posted over the API verbatim (item
192
193
  * 1057). Local history (`vx last`) keeps the whole line, on this machine.
193
194
  */
195
+ function maskInvocation(command: string): string {
196
+ return secretMask([process.env])?.mask(command) ?? command
197
+ }
198
+
194
199
  export function invocationCommand(argv: readonly string[]): string {
195
200
  const sep = argv.indexOf('--')
196
201
  if (sep === -1) return argv.join(' ')
@@ -1046,7 +1051,10 @@ async function runOnBus(
1046
1051
  endedAtMs,
1047
1052
  totalMs,
1048
1053
  ok,
1049
- command: options.command ?? process.argv.slice(1).join(' '),
1054
+ // The invocation is stored and `vx last` prints it: a secret passed
1055
+ // after `--` (`-- --token=$NPM_TOKEN`) is masked here as the task's
1056
+ // own output masks it, so cache.db holds no plaintext value.
1057
+ command: maskInvocation(options.command ?? process.argv.slice(1).join(' ')),
1050
1058
  requestedTasks: options.tasks,
1051
1059
  cachePolicy: compactCachePolicy(policy),
1052
1060
  concurrency,