@vzn/vx 0.0.561 → 0.0.563
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/cli/run.ts +16 -11
- package/src/cli/watch.ts +21 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vzn/vx",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.563",
|
|
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.
|
|
25
|
-
"@vzn/vx-linux-arm64": "0.0.
|
|
26
|
-
"@vzn/vx-darwin-x64": "0.0.
|
|
27
|
-
"@vzn/vx-darwin-arm64": "0.0.
|
|
24
|
+
"@vzn/vx-linux-x64": "0.0.563",
|
|
25
|
+
"@vzn/vx-linux-arm64": "0.0.563",
|
|
26
|
+
"@vzn/vx-darwin-x64": "0.0.563",
|
|
27
|
+
"@vzn/vx-darwin-arm64": "0.0.563"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@anthropic-ai/sandbox-runtime": "^0.0.76"
|
package/src/cli/run.ts
CHANGED
|
@@ -500,19 +500,24 @@ export async function resolveRunOptions(
|
|
|
500
500
|
let selectedByDiff = false
|
|
501
501
|
let affected: RunOptions['affected']
|
|
502
502
|
let outright: string[] | undefined
|
|
503
|
+
// Resolved even when every task is anchored and the scope goes unused:
|
|
504
|
+
// a filter or ref the user typed is judged, as it is beside a bare task.
|
|
505
|
+
const resolved =
|
|
506
|
+
filterStrings.length > 0
|
|
507
|
+
? await resolveFilters(
|
|
508
|
+
cwd,
|
|
509
|
+
filterStrings,
|
|
510
|
+
{
|
|
511
|
+
...(parsed.cacheDir !== undefined ? { cacheDir: parsed.cacheDir } : {}),
|
|
512
|
+
...(parsed.frozen ? { frozen: true } : {}),
|
|
513
|
+
},
|
|
514
|
+
affectedFilter,
|
|
515
|
+
)
|
|
516
|
+
: undefined
|
|
517
|
+
if (resolved !== undefined && 'error' in resolved) return { error: resolved.error }
|
|
503
518
|
if (bareTasks.length === 0) {
|
|
504
519
|
projects = undefined
|
|
505
|
-
} else if (
|
|
506
|
-
const resolved = await resolveFilters(
|
|
507
|
-
cwd,
|
|
508
|
-
filterStrings,
|
|
509
|
-
{
|
|
510
|
-
...(parsed.cacheDir !== undefined ? { cacheDir: parsed.cacheDir } : {}),
|
|
511
|
-
...(parsed.frozen ? { frozen: true } : {}),
|
|
512
|
-
},
|
|
513
|
-
affectedFilter,
|
|
514
|
-
)
|
|
515
|
-
if ('error' in resolved) return { error: resolved.error }
|
|
520
|
+
} else if (resolved !== undefined) {
|
|
516
521
|
if ('empty' in resolved) {
|
|
517
522
|
// "Nothing changed" is a clean exit for the BARE tasks the filter
|
|
518
523
|
// scopes — but it must never cancel an explicitly anchored
|
package/src/cli/watch.ts
CHANGED
|
@@ -138,11 +138,12 @@ export async function watchCmd(args: readonly string[]): Promise<number> {
|
|
|
138
138
|
// closing reaches the loop alone, and the loop passes it on.
|
|
139
139
|
process.once('SIGHUP', () => stop.abort('SIGHUP'))
|
|
140
140
|
|
|
141
|
-
// Enumerate projects-in-scope so we know what dirs to watch
|
|
142
|
-
// `opts.projects
|
|
143
|
-
//
|
|
144
|
-
//
|
|
145
|
-
//
|
|
141
|
+
// Enumerate projects-in-scope so we know what dirs to watch: the bare
|
|
142
|
+
// tasks' scope (`opts.projects`; undefined means "every project", or
|
|
143
|
+
// nothing when every task is anchored) and each `pkg#task`'s own
|
|
144
|
+
// project, which no scope reaches. The watched set is what a cycle can
|
|
145
|
+
// RUN: the scope plus its transitive dependencies (a cycle runs
|
|
146
|
+
// `lib#build` for `app#build`'s `^build`, so a `lib` edit is an edit) — the same
|
|
146
147
|
// closure `--filter 'app...'` walks, computed below once the initial
|
|
147
148
|
// run has staged the configs. Plus the workspace root, for lockfile
|
|
148
149
|
// changes.
|
|
@@ -150,15 +151,17 @@ export async function watchCmd(args: readonly string[]): Promise<number> {
|
|
|
150
151
|
const workspaceRoot = await findWorkspaceRoot(cwd, reads)
|
|
151
152
|
const workspace = await loadWorkspace(workspaceRoot, reads)
|
|
152
153
|
const allProjects = await discoverCliProjects(workspace)
|
|
154
|
+
const anchored = opts.tasks.filter((t) => t.includes('#')).map((t) => t.slice(0, t.indexOf('#')))
|
|
155
|
+
const named =
|
|
156
|
+
anchored.length === opts.tasks.length
|
|
157
|
+
? new Set(anchored)
|
|
158
|
+
: opts.projects === undefined
|
|
159
|
+
? undefined
|
|
160
|
+
: new Set([...opts.projects, ...anchored])
|
|
153
161
|
const inScope = (all: readonly ProjectMeta[]): ProjectMeta[] =>
|
|
154
|
-
|
|
162
|
+
named === undefined ? [...all] : all.filter((p) => named.has(p.name))
|
|
155
163
|
const scope = inScope(allProjects)
|
|
156
164
|
|
|
157
|
-
if (scope.length === 0) {
|
|
158
|
-
process.stderr.write(`vx watch: no projects in scope\n`)
|
|
159
|
-
return 1
|
|
160
|
-
}
|
|
161
|
-
|
|
162
165
|
// Initial run — same code path as `vx run`.
|
|
163
166
|
//
|
|
164
167
|
// Watchers do not exist yet, so an edit made WHILE this run is executing is
|
|
@@ -198,6 +201,13 @@ export async function watchCmd(args: readonly string[]): Promise<number> {
|
|
|
198
201
|
return 0
|
|
199
202
|
}
|
|
200
203
|
if (refusedToStart) return 1
|
|
204
|
+
// After the initial run, so a `pkg#task` naming no project gets the
|
|
205
|
+
// run's own refusal and its "did you mean".
|
|
206
|
+
if (scope.length === 0) {
|
|
207
|
+
await held?.stop()
|
|
208
|
+
process.stderr.write(`vx watch: no projects in scope\n`)
|
|
209
|
+
return 1
|
|
210
|
+
}
|
|
201
211
|
// `--affected`'s diff is the tree at start; judged again, it held every
|
|
202
212
|
// later edit out of the scope it picked. A cycle is an edit, and the
|
|
203
213
|
// cache keys decide what in the scope it re-runs.
|