@vzn/vx 0.0.414 → 0.0.416

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.414",
3
+ "version": "0.0.416",
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.414",
25
- "@vzn/vx-linux-arm64": "0.0.414",
26
- "@vzn/vx-darwin-x64": "0.0.414",
27
- "@vzn/vx-darwin-arm64": "0.0.414"
24
+ "@vzn/vx-linux-x64": "0.0.416",
25
+ "@vzn/vx-linux-arm64": "0.0.416",
26
+ "@vzn/vx-darwin-x64": "0.0.416",
27
+ "@vzn/vx-darwin-arm64": "0.0.416"
28
28
  },
29
29
  "dependencies": {
30
30
  "@anthropic-ai/sandbox-runtime": "^0.0.76"
@@ -682,6 +682,11 @@ export function refusedWrites(
682
682
  if (/^\/(?:dev|proc)\//.test(raw)) continue
683
683
  const abs = toRealPath(raw)
684
684
  if (isUnderAny(abs, binds) || underGlob(abs, globs)) continue
685
+ // A directory a write bind lies in exists, since bwrap made it to mount
686
+ // the bind: `mkdir -p node_modules/.cache/tool` under a grant of
687
+ // `node_modules/.cache/` met EEXIST on `node_modules`, wrote nothing,
688
+ // and the attempt failed a clean task (2026-10-03).
689
+ if (syscall.startsWith('mkdir') && [...binds].some((b) => atOrUnder(b, abs))) continue
685
690
  const key = `${syscall}|${abs}`
686
691
  if (seen.has(key)) continue
687
692
  seen.add(key)
@@ -557,6 +557,9 @@ function usesPnp(dir: string): boolean {
557
557
  const PNP_NOTE =
558
558
  "Yarn Plug'n'Play installs this repo: a package's bins live in `.pnp.cjs`, not `node_modules/.bin`, so a task's `tsc` is not found under vx — set `nodeLinker: node-modules` in `.yarnrc.yml` and run `yarn install`, or write each command as `yarn exec '<command>'`"
559
559
 
560
+ /** A runner of this package's scripts by name: `run-p build:*`. */
561
+ const RUNS_OWN = /(?:^|\s)(?:run-s|run-p|npm-run-all)(?:\s|$)/
562
+
560
563
  /** A package manager running a script by name: `pnpm build`, `npm run x`, `bun run x`. */
561
564
  const RUNS_SCRIPT =
562
565
  /(?:^|[\s;&|(])(?:pnpm|pn|npm|yarn|bun)\s+(?:run(?:-script)?\s+)?([^\s;&|()'"-][^\s;&|()'"]*)/g
@@ -835,6 +838,9 @@ export function migrateScripts(
835
838
  }
836
839
  const tasks: GeneratedTask[] = []
837
840
  let readsManifest = false
841
+ const text = Object.entries(scripts).filter(
842
+ (e): e is [string, string] => typeof e[1] === 'string',
843
+ )
838
844
  for (const name of names) {
839
845
  if (!isTask(name)) continue
840
846
 
@@ -886,19 +892,34 @@ export function migrateScripts(
886
892
  // pnpm run lint`) ran each again inside the command, beside the task
887
893
  // of that name: `vx run check` built twice. The chain's order may
888
894
  // matter, so it is named rather than turned into a group.
895
+ // Through `run-s` / `run-p` / `npm-run-all` too (`build: run-p
896
+ // build:*`), each segment naming every task it runs (M-48). A
897
+ // persistent one has PERSISTENT_TODO.
898
+ const persistent = isPersistent(name, scripts)
899
+ let ranTasks = 0
889
900
  const ownRuns = own
890
901
  .split(/&&|\|\||;/)
891
902
  .map((part) => part.trim())
892
903
  .filter((part) => {
893
904
  const d = delegatedScript(part)
894
- return d !== null && d !== name && isTask(d)
905
+ if (d !== null) {
906
+ if (d === name || !isTask(d)) return false
907
+ ranTasks++
908
+ return true
909
+ }
910
+ if (persistent || !RUNS_OWN.test(part)) return false
911
+ const refs = new Set(scriptRefs(part, text).filter((r) => r !== name && isTask(r)))
912
+ ranTasks += refs.size
913
+ return refs.size > 0
895
914
  })
896
915
  if (ownRuns.length > 0) {
897
916
  const list = ownRuns.map((r) => `\`${r}\``).join(', ')
898
917
  todos.push(
899
- ownRuns.length === 1
900
- ? `${list} runs this package's own task again inside the command, beside that task: name it under dependsOn and drop it from the command`
901
- : `${list} run this package's own tasks again inside the command, beside those tasks: name them under dependsOn and drop them from the command`,
918
+ `${list} ${ownRuns.length === 1 ? 'runs' : 'run'} this package's own ${
919
+ ranTasks === 1
920
+ ? 'task again inside the command, beside that task: name it'
921
+ : 'tasks again inside the command, beside those tasks: name them'
922
+ } under dependsOn and drop ${ownRuns.length === 1 ? 'it' : 'them'} from the command`,
902
923
  )
903
924
  }
904
925
  const exec: Record<string, unknown> = { command }
@@ -911,7 +932,7 @@ export function migrateScripts(
911
932
  )
912
933
  }
913
934
  const task: Record<string, unknown> = { exec }
914
- if (isPersistent(name, scripts)) {
935
+ if (persistent) {
915
936
  exec['persistent'] = {}
916
937
  todos.push(PERSISTENT_TODO)
917
938
  }