@vzn/vx 0.0.68 → 0.0.70
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 +5 -5
- package/src/cache/inputs.ts +17 -2
- package/src/graph/scheduler.ts +11 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vzn/vx",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.70",
|
|
4
4
|
"description": "An open, extensible monorepo task runner.",
|
|
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.
|
|
21
|
-
"@vzn/vx-linux-arm64": "0.0.
|
|
22
|
-
"@vzn/vx-darwin-x64": "0.0.
|
|
23
|
-
"@vzn/vx-darwin-arm64": "0.0.
|
|
20
|
+
"@vzn/vx-linux-x64": "0.0.70",
|
|
21
|
+
"@vzn/vx-linux-arm64": "0.0.70",
|
|
22
|
+
"@vzn/vx-darwin-x64": "0.0.70",
|
|
23
|
+
"@vzn/vx-darwin-arm64": "0.0.70"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@anthropic-ai/sandbox-runtime": "^0.0.76"
|
package/src/cache/inputs.ts
CHANGED
|
@@ -488,6 +488,19 @@ async function resolveRuntimeValues(
|
|
|
488
488
|
*/
|
|
489
489
|
const OUTPUT_NEVER = ['**/.git/**', '**/.vx/**']
|
|
490
490
|
|
|
491
|
+
/**
|
|
492
|
+
* What a set of output globs may not reach: `OUTPUT_NEVER`, and every
|
|
493
|
+
* `node_modules` unless a glob names one. `**\/*.js` meant the build's
|
|
494
|
+
* files, and the clean before each run deleted every installed `.js`
|
|
495
|
+
* under `node_modules` with them (A-13); an install task declares
|
|
496
|
+
* `node_modules/**` and keeps it. Workspace outputs took none of this, not
|
|
497
|
+
* even `.git`.
|
|
498
|
+
*/
|
|
499
|
+
function outputExcludes(outputs: readonly string[]): Bun.Glob[] {
|
|
500
|
+
const namesNodeModules = outputs.some((o) => normalizeGlob(o).split('/').includes('node_modules'))
|
|
501
|
+
return (namesNodeModules ? OUTPUT_NEVER : [...OUTPUT_NEVER, '**/node_modules/**']).map(globFor)
|
|
502
|
+
}
|
|
503
|
+
|
|
491
504
|
/** Resolve declared output globs (project-relative) to actual produced files. */
|
|
492
505
|
export async function resolveOutputs(args: {
|
|
493
506
|
projectDir: string
|
|
@@ -495,7 +508,7 @@ export async function resolveOutputs(args: {
|
|
|
495
508
|
nestedProjectDirs: string[]
|
|
496
509
|
}): Promise<string[]> {
|
|
497
510
|
if (args.outputs.length === 0) return []
|
|
498
|
-
const excludeGlobs =
|
|
511
|
+
const excludeGlobs = outputExcludes(args.outputs)
|
|
499
512
|
const scanned = [
|
|
500
513
|
...(await scanUnion(
|
|
501
514
|
asTrees(args.outputs),
|
|
@@ -741,7 +754,9 @@ export async function resolveWorkspaceOutputs(args: {
|
|
|
741
754
|
outputs: string[]
|
|
742
755
|
}): Promise<string[]> {
|
|
743
756
|
if (args.outputs.length === 0) return []
|
|
744
|
-
const scanned = [
|
|
757
|
+
const scanned = [
|
|
758
|
+
...(await scanUnion(asTrees(args.outputs), outputExcludes(args.outputs), args.workspaceRoot)),
|
|
759
|
+
]
|
|
745
760
|
// Same containment as the project twin, anchored one level out. These globs
|
|
746
761
|
// deliberately ignore PROJECT boundaries — that is the escape hatch — but
|
|
747
762
|
// escaping the WORKSPACE was never part of it, and `cleanWorkspaceOutputs`
|
package/src/graph/scheduler.ts
CHANGED
|
@@ -428,23 +428,24 @@ export async function runGraph(options: ScheduleOptions): Promise<Map<string, Ta
|
|
|
428
428
|
const poolOf = options.poolOf
|
|
429
429
|
const poolActive = new Map<string, number>()
|
|
430
430
|
// A pooled task is admitted against ITS pool's capacity, a local one
|
|
431
|
-
// against `concurrency`; pooled tasks reserve no local resources.
|
|
431
|
+
// against `concurrency`; pooled tasks reserve no local resources. A
|
|
432
|
+
// restore is local disk work wherever its task was placed: on the pool's
|
|
433
|
+
// arm it bypassed the restore lane's cap.
|
|
432
434
|
const hasRoom = (id: string): boolean => {
|
|
435
|
+
if (inRestoreTier(id)) return restoreRoom()
|
|
433
436
|
const pool = poolOf?.(id)
|
|
434
|
-
if (pool === undefined)
|
|
435
|
-
return inRestoreTier(id) ? restoreRoom() : execRoom()
|
|
436
|
-
}
|
|
437
|
+
if (pool === undefined) return execRoom()
|
|
437
438
|
return (poolActive.get(pool.name) ?? 0) < pool.capacity
|
|
438
439
|
}
|
|
439
440
|
const admit = (id: string): (() => void) => {
|
|
441
|
+
if (inRestoreTier(id)) {
|
|
442
|
+
activeRestore++
|
|
443
|
+
return () => {
|
|
444
|
+
activeRestore--
|
|
445
|
+
}
|
|
446
|
+
}
|
|
440
447
|
const pool = poolOf?.(id)
|
|
441
448
|
if (pool === undefined) {
|
|
442
|
-
if (inRestoreTier(id)) {
|
|
443
|
-
activeRestore++
|
|
444
|
-
return () => {
|
|
445
|
-
activeRestore--
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
449
|
active++
|
|
449
450
|
return () => {
|
|
450
451
|
active--
|