@vzn/vx 0.0.602 → 0.0.604

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.602",
3
+ "version": "0.0.604",
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.602",
25
- "@vzn/vx-linux-arm64": "0.0.602",
26
- "@vzn/vx-darwin-x64": "0.0.602",
27
- "@vzn/vx-darwin-arm64": "0.0.602"
24
+ "@vzn/vx-linux-x64": "0.0.604",
25
+ "@vzn/vx-linux-arm64": "0.0.604",
26
+ "@vzn/vx-darwin-x64": "0.0.604",
27
+ "@vzn/vx-darwin-arm64": "0.0.604"
28
28
  },
29
29
  "dependencies": {
30
30
  "@anthropic-ai/sandbox-runtime": "^0.0.76"
@@ -272,6 +272,7 @@ export function makeRootEventFilter(
272
272
  (isWorkspaceFingerprintFile(rel) ||
273
273
  isWorkspaceConfigFile(rel) ||
274
274
  rel === 'package.json' ||
275
+ rel === '.gitignore' ||
275
276
  claimedRootFiles.has(rel))
276
277
  ) {
277
278
  return true
package/src/cli/watch.ts CHANGED
@@ -164,7 +164,15 @@ export async function watchCmd(args: readonly string[]): Promise<number> {
164
164
  const workspaceRoot = await findWorkspaceRoot(cwd, reads)
165
165
  const workspace = await loadWorkspace(workspaceRoot, reads)
166
166
  const allProjects = await discoverCliProjects(workspace)
167
- const anchored = opts.tasks.filter((t) => t.includes('#')).map((t) => t.slice(0, t.indexOf('#')))
167
+ // `//#check` is the root project's task, named by its package.json name
168
+ // as the run names it (prepare.ts, D-39): taken literally, no project
169
+ // was in scope and the watch exited 1 after a green run.
170
+ const rootDir = path.resolve(workspaceRoot)
171
+ const rootName = allProjects.find((p) => path.resolve(p.dir) === rootDir)?.name
172
+ const anchored = opts.tasks
173
+ .filter((t) => t.includes('#'))
174
+ .map((t) => t.slice(0, t.indexOf('#')))
175
+ .map((p) => (p === '//' && rootName !== undefined ? rootName : p))
168
176
  const named =
169
177
  anchored.length === opts.tasks.length
170
178
  ? new Set(anchored)
@@ -424,6 +432,11 @@ async function runWatchLoop(args: WatchLoopArgs): Promise<void> {
424
432
  try {
425
433
  let label: string | undefined = first
426
434
  while (label !== undefined && !stop.aborted) {
435
+ // A member came or went: armed before the run keys it, an edit in a
436
+ // new package while its first cycle runs queues like any other; armed
437
+ // only after, it fell in the gap and ran nothing (X-138). The re-read
438
+ // after the run stays, for what the run itself changed.
439
+ if (reread) await rearm(false)
427
440
  process.stdout.write(`\nvx watch: ${label}; re-running...\n\n`)
428
441
  try {
429
442
  await held?.stop()
@@ -586,6 +599,7 @@ async function runWatchLoop(args: WatchLoopArgs): Promise<void> {
586
599
  isWorkspaceFingerprintFile(filename) ||
587
600
  isWorkspaceConfigFile(filename) ||
588
601
  filename === 'package.json' ||
602
+ filename === '.gitignore' ||
589
603
  claimedRootFiles.has(filename)
590
604
  ) {
591
605
  if (shapesWatchedSet(filename) || filename === LOCKFILE_NAME) reread = true
@@ -720,7 +734,7 @@ async function runWatchLoop(args: WatchLoopArgs): Promise<void> {
720
734
  ? 'vx watch: watching the workspace root (workspaceFiles inputs in use)'
721
735
  : `vx watch: watching ${count} project(s)`
722
736
 
723
- const rearm = async (): Promise<void> => {
737
+ const rearm = async (say = true): Promise<void> => {
724
738
  let next: Rediscovered
725
739
  try {
726
740
  next = await args.rediscover()
@@ -769,7 +783,7 @@ async function runWatchLoop(args: WatchLoopArgs): Promise<void> {
769
783
  // A new arm proves delivery like the first ones: an edit in the new
770
784
  // package right after this cycle is seen, not lost in the gap.
771
785
  await pool.proved()
772
- process.stdout.write(`${watchingLine(next.projects.length)}\n`)
786
+ if (say) process.stdout.write(`${watchingLine(next.projects.length)}\n`)
773
787
  }
774
788
 
775
789
  armMode(projects)
@@ -845,6 +859,15 @@ async function runWatchLoop(args: WatchLoopArgs): Promise<void> {
845
859
  base,
846
860
  arm(base, false, (filename) => {
847
861
  if (isIgnoredWatchPath(filename)) return
862
+ // Inputs are gitignore-aware: an edit here changes what the
863
+ // members' keys read, and `vx run` would miss on it.
864
+ if (filename === '.gitignore') {
865
+ trigger(
866
+ path.relative(workspaceRoot, path.join(base, filename)),
867
+ path.join(base, filename),
868
+ )
869
+ return
870
+ }
848
871
  // Only a member coming or going. On macOS a non-recursive watcher
849
872
  // also reports a member whose CONTENTS changed (FSEvents names the
850
873
  // directory a write landed in), so a task writing into its own