@vzn/vx 0.0.571 → 0.0.573
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/show.ts +20 -12
- package/src/cli/watch.ts +2 -1
- package/src/cli/workspace-config.ts +12 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vzn/vx",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.573",
|
|
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.573",
|
|
25
|
+
"@vzn/vx-linux-arm64": "0.0.573",
|
|
26
|
+
"@vzn/vx-darwin-x64": "0.0.573",
|
|
27
|
+
"@vzn/vx-darwin-arm64": "0.0.573"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@anthropic-ai/sandbox-runtime": "^0.0.76"
|
package/src/cli/show.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import path from 'node:path'
|
|
10
10
|
import type { ProjectConfig, TaskConfig } from '../config.js'
|
|
11
11
|
import { declaredTask } from '../graph/index.js'
|
|
12
|
+
import { isDefaultBuild } from '../orchestrator/index.js'
|
|
12
13
|
import { flagHint, seeHelp } from './help.js'
|
|
13
14
|
import { listed, nearMatches, relPosix, secretMask, UserError } from '../util/index.js'
|
|
14
15
|
import { discoverCliProjects, loadCliProjects } from './workspace-config.js'
|
|
@@ -103,7 +104,7 @@ export async function showCmd(args: readonly string[]): Promise<number> {
|
|
|
103
104
|
const bareTask = projectName !== undefined && taskName === undefined && !byName.has(projectName)
|
|
104
105
|
const scope = projectName === undefined || bareTask ? 'all' : [projectName]
|
|
105
106
|
|
|
106
|
-
const projects = await loadCliProjects(root, metas, scope, { noCreate: true })
|
|
107
|
+
const projects = await loadCliProjects(root, metas, scope, { noCreate: true, closure: true })
|
|
107
108
|
|
|
108
109
|
if (parsed.target === undefined) {
|
|
109
110
|
process.stdout.write(renderList(root, metas, projects, parsed.format))
|
|
@@ -221,13 +222,17 @@ function renderList(
|
|
|
221
222
|
projects: ReadonlyMap<string, ProjectEntry>,
|
|
222
223
|
format: 'pretty' | 'json',
|
|
223
224
|
): string {
|
|
224
|
-
const rows = metas.map((meta) =>
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
225
|
+
const rows = metas.map((meta) => {
|
|
226
|
+
const tasks = projects.get(meta.name)?.config.tasks ?? {}
|
|
227
|
+
return {
|
|
228
|
+
name: meta.name,
|
|
229
|
+
dir: projectDir(root, meta),
|
|
230
|
+
tags: projects.get(meta.name)?.config.tags ?? [],
|
|
231
|
+
tasks: Object.keys(tasks),
|
|
232
|
+
onlyDefault: Object.values(tasks).every((t) => isDefaultBuild(t)),
|
|
233
|
+
configured: meta.configPath !== null,
|
|
234
|
+
}
|
|
235
|
+
})
|
|
231
236
|
if (format === 'json') {
|
|
232
237
|
return `${JSON.stringify(
|
|
233
238
|
rows.map(({ name, dir, tags, tasks }) => ({ name, dir, tags, tasks })),
|
|
@@ -240,12 +245,15 @@ function renderList(
|
|
|
240
245
|
const lines = rows.map((r) => {
|
|
241
246
|
const n = r.tasks.length
|
|
242
247
|
const count = `${n} task${n === 1 ? '' : 's'}`
|
|
243
|
-
// A package with no config file only
|
|
248
|
+
// A package with no config file has only tasks a plugin gave it, or the
|
|
249
|
+
// default `build` a configured dependant's closure gave it.
|
|
244
250
|
const tasks = r.configured
|
|
245
251
|
? count
|
|
246
|
-
: n
|
|
247
|
-
?
|
|
248
|
-
:
|
|
252
|
+
: n === 0
|
|
253
|
+
? '(no vx config)'
|
|
254
|
+
: r.onlyDefault
|
|
255
|
+
? `${count} (no vx config; default build)`
|
|
256
|
+
: `${count} (no vx config; from plugins)`
|
|
249
257
|
const tags = r.tags.length > 0 ? ` [${r.tags.join(', ')}]` : ''
|
|
250
258
|
return `${r.name.padEnd(nameW)} ${r.dir.padEnd(dirW)} ${tasks}${tags}`
|
|
251
259
|
})
|
package/src/cli/watch.ts
CHANGED
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
run as runOrchestrator,
|
|
23
23
|
type HeldPersistent,
|
|
24
24
|
type RunOptions,
|
|
25
|
+
shellQuote,
|
|
25
26
|
} from '../orchestrator/index.js'
|
|
26
27
|
import {
|
|
27
28
|
findWorkspaceRoot,
|
|
@@ -125,7 +126,7 @@ export async function watchCmd(args: readonly string[]): Promise<number> {
|
|
|
125
126
|
// Every cycle's `invocations` row names the verb, as `vx run`'s does;
|
|
126
127
|
// run()'s process.argv fallback put the bin's absolute path there, so
|
|
127
128
|
// `vx last --list` showed `$ /…/bin.ts watch build` beside `$ vx run build`.
|
|
128
|
-
opts.command = ['vx', 'watch', ...args].join(' ')
|
|
129
|
+
opts.command = ['vx', 'watch', ...args.map(shellQuote)].join(' ')
|
|
129
130
|
// A staged load and a discovery from the selection pass are one run's
|
|
130
131
|
// worth; every cycle after an edit must load and list live.
|
|
131
132
|
delete opts.staged
|
|
@@ -12,6 +12,7 @@ import { Cache } from '../cache/index.js'
|
|
|
12
12
|
import { discoverProjects, loadProjects, loadWorkspacePlugins } from '../orchestrator/index.js'
|
|
13
13
|
import type { VxPlugin } from '../orchestrator/index.js'
|
|
14
14
|
import {
|
|
15
|
+
buildPackageGraph,
|
|
15
16
|
computeWorkspaceFingerprint,
|
|
16
17
|
FROZEN_WITHOUT_LOCK,
|
|
17
18
|
type Workspace,
|
|
@@ -111,14 +112,20 @@ export interface CliLoadOptions {
|
|
|
111
112
|
* create one.
|
|
112
113
|
*/
|
|
113
114
|
noCreate?: boolean
|
|
115
|
+
/**
|
|
116
|
+
* Load what each seed's package closure reaches too, as a run does: a
|
|
117
|
+
* config-less package a configured one depends on gets the default
|
|
118
|
+
* `build` there, and a reader that skipped it showed less than a run.
|
|
119
|
+
*/
|
|
120
|
+
closure?: boolean
|
|
114
121
|
}
|
|
115
122
|
|
|
116
123
|
/**
|
|
117
124
|
* The run path's project-config load (`loadProjects`) for a verb that only
|
|
118
125
|
* reads: the plugin `project` stage applies, and the local cache opens only
|
|
119
126
|
* to serve cached evaluations — a pure config costs a stat, not an
|
|
120
|
-
* evaluation. `scope` is every project or a list of names;
|
|
121
|
-
* lock (a verb reads live, as a default run does).
|
|
127
|
+
* evaluation. `scope` is every project or a list of names; their closure
|
|
128
|
+
* only with `closure`, no lock (a verb reads live, as a default run does).
|
|
122
129
|
*/
|
|
123
130
|
export async function loadCliProjects(
|
|
124
131
|
workspaceRoot: string,
|
|
@@ -154,7 +161,9 @@ export async function loadCliProjects(
|
|
|
154
161
|
plugins,
|
|
155
162
|
projectMetas: metas,
|
|
156
163
|
seeds: scope,
|
|
157
|
-
closure
|
|
164
|
+
...(opts.closure === true
|
|
165
|
+
? { closure: true as const, packageGraph: buildPackageGraph([...metas]) }
|
|
166
|
+
: { closure: false as const }),
|
|
158
167
|
lock: lock === null ? null : async () => lock,
|
|
159
168
|
evalCache:
|
|
160
169
|
cache === null
|