@vzn/vx 0.0.30 → 0.0.32
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/select.ts +26 -5
- package/src/orchestrator/prepare.ts +25 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vzn/vx",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.32",
|
|
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.32",
|
|
21
|
+
"@vzn/vx-linux-arm64": "0.0.32",
|
|
22
|
+
"@vzn/vx-darwin-x64": "0.0.32",
|
|
23
|
+
"@vzn/vx-darwin-arm64": "0.0.32"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@anthropic-ai/sandbox-runtime": "^0.0.76"
|
package/src/cli/select.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import readline from 'node:readline/promises'
|
|
7
7
|
import path from 'node:path'
|
|
8
|
+
import fs from 'node:fs'
|
|
8
9
|
import {
|
|
9
10
|
affectedProjects,
|
|
10
11
|
refIsHead,
|
|
@@ -115,13 +116,33 @@ async function loadWorkspaceProjects(cwd: string): Promise<ProjectMeta[]> {
|
|
|
115
116
|
export async function findCwdProject(cwd: string): Promise<string | null> {
|
|
116
117
|
const projects = await loadWorkspaceProjects(cwd)
|
|
117
118
|
const abs = path.resolve(cwd)
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
const within = (dirOf: (p: ProjectMeta) => string): string | null => {
|
|
120
|
+
let best: string | null = null
|
|
121
|
+
let bestLength = -1
|
|
122
|
+
for (const p of projects) {
|
|
123
|
+
const dir = dirOf(p)
|
|
124
|
+
if ((abs === dir || abs.startsWith(dir + path.sep)) && dir.length > bestLength) {
|
|
125
|
+
best = p.name
|
|
126
|
+
bestLength = dir.length
|
|
127
|
+
}
|
|
122
128
|
}
|
|
129
|
+
return best
|
|
123
130
|
}
|
|
124
|
-
|
|
131
|
+
// The cwd is a real path (the kernel's), and a member discovery reached
|
|
132
|
+
// through a link keeps the link's (`packages/b -> ../ext/b`, item 987),
|
|
133
|
+
// so inside such a member nothing matched and a run from there was "not
|
|
134
|
+
// inside a project" (item 1025). Only then are the members realpathed:
|
|
135
|
+
// one syscall each, paid only by a run no plain match could place.
|
|
136
|
+
return (
|
|
137
|
+
within((p) => p.dir) ??
|
|
138
|
+
within((p) => {
|
|
139
|
+
try {
|
|
140
|
+
return fs.realpathSync(p.dir)
|
|
141
|
+
} catch {
|
|
142
|
+
return p.dir
|
|
143
|
+
}
|
|
144
|
+
})
|
|
145
|
+
)
|
|
125
146
|
}
|
|
126
147
|
|
|
127
148
|
export type FilterResolution =
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import path from 'node:path'
|
|
11
11
|
import type { WorkspaceConfig } from '../config.js'
|
|
12
|
-
import { mark, UserError } from '../util/index.js'
|
|
12
|
+
import { mark, nearest, UserError } from '../util/index.js'
|
|
13
13
|
import {
|
|
14
14
|
Cache,
|
|
15
15
|
noteSchemaReset,
|
|
@@ -408,6 +408,30 @@ export async function prepareRun(options: RunOptions, log: Logger): Promise<Prep
|
|
|
408
408
|
loadProjects({ ...loadArgs, seeds: 'all', closure: false, staged: projects }),
|
|
409
409
|
)
|
|
410
410
|
}
|
|
411
|
+
// An `--exclude-dependencies` name no project declares drops nothing:
|
|
412
|
+
// `=biuld` planned the whole chain and ran it, exit 0 (item 1026). Every
|
|
413
|
+
// other name the user types must resolve; so must this one. After the
|
|
414
|
+
// graph, so a config error (`^biuld` nobody declares) is named first.
|
|
415
|
+
const excludeNames = options.excludeDependencies
|
|
416
|
+
if (Array.isArray(excludeNames) && excludeNames.length > 0) {
|
|
417
|
+
const declared = new Set<string>()
|
|
418
|
+
for (const p of projects.values())
|
|
419
|
+
for (const t of Object.keys(p.config.tasks ?? {})) declared.add(t)
|
|
420
|
+
let unknown = excludeNames.filter((n) => !declared.has(n))
|
|
421
|
+
if (unknown.length > 0 && projects.size < projectsWithConfigs.length) {
|
|
422
|
+
unknown = await declaredNowhere(unknown, () =>
|
|
423
|
+
loadProjects({ ...loadArgs, seeds: 'all', closure: false, staged: projects }),
|
|
424
|
+
)
|
|
425
|
+
}
|
|
426
|
+
if (unknown.length > 0) {
|
|
427
|
+
cache.close()
|
|
428
|
+
const hints = new Set(unknown.flatMap((n) => nearest(n, declared) ?? []))
|
|
429
|
+
const hint = hints.size === 0 ? '' : ` Did you mean ${[...hints].join(', ')}?`
|
|
430
|
+
throw new UserError(
|
|
431
|
+
`--exclude-dependencies names a task no project declares: ${unknown.join(', ')}.${hint}`,
|
|
432
|
+
)
|
|
433
|
+
}
|
|
434
|
+
}
|
|
411
435
|
// The graph is built; what follows is the plugins' (graph, key,
|
|
412
436
|
// schedule). Two rows, so a plugin's key stage reads as its own cost
|
|
413
437
|
// and not as graph building — a lockfile plugin's 1000 stats per run
|