@vzn/vx 0.0.32 → 0.0.34
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.
|
|
3
|
+
"version": "0.0.34",
|
|
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.34",
|
|
21
|
+
"@vzn/vx-linux-arm64": "0.0.34",
|
|
22
|
+
"@vzn/vx-darwin-x64": "0.0.34",
|
|
23
|
+
"@vzn/vx-darwin-arm64": "0.0.34"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@anthropic-ai/sandbox-runtime": "^0.0.76"
|
|
@@ -188,7 +188,21 @@ export async function applyKeyHooks(
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
if (parts.length > 0) {
|
|
191
|
-
|
|
191
|
+
const byName = (a: readonly [string, string], b: readonly [string, string]): number =>
|
|
192
|
+
a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : 0
|
|
193
|
+
parts.sort(byName)
|
|
194
|
+
// A plugin's name is its package's, and one package may define two
|
|
195
|
+
// plugins (`@vzn/vx-migrate`'s `turbo()` and `turboCache()`): two
|
|
196
|
+
// parts named alike folded both values under one name, and `vx why`
|
|
197
|
+
// could not say which moved (item 1028). The repeats take `#2`, `#3`
|
|
198
|
+
// in value order, so declaration order still keys nothing.
|
|
199
|
+
let previous = ''
|
|
200
|
+
let n = 0
|
|
201
|
+
for (const [i, [name, value]] of parts.entries()) {
|
|
202
|
+
n = name === previous ? n + 1 : 1
|
|
203
|
+
previous = name
|
|
204
|
+
if (n > 1) parts[i] = [`${name}#${n}`, value]
|
|
205
|
+
}
|
|
192
206
|
node.keyParts = parts
|
|
193
207
|
}
|
|
194
208
|
}
|
|
@@ -70,6 +70,7 @@ export async function subscribeTelemetry(
|
|
|
70
70
|
extraSinks?: readonly TelemetrySink[],
|
|
71
71
|
): Promise<TelemetryHandle | undefined> {
|
|
72
72
|
const sinks: TelemetrySink[] = extraSinks === undefined ? [] : [...extraSinks]
|
|
73
|
+
const owners = new Map<TelemetrySink, string>()
|
|
73
74
|
for (const plugin of plugins) {
|
|
74
75
|
if (plugin.telemetry === undefined) continue
|
|
75
76
|
// A plugin's return value is user input, so it is checked here rather
|
|
@@ -100,12 +101,15 @@ export async function subscribeTelemetry(
|
|
|
100
101
|
)
|
|
101
102
|
continue
|
|
102
103
|
}
|
|
104
|
+
for (const [i, sink] of accepted.entries()) {
|
|
105
|
+
owners.set(sink, accepted.length === 1 ? plugin.name : `${plugin.name} #${i + 1}`)
|
|
106
|
+
}
|
|
103
107
|
sinks.push(...accepted)
|
|
104
108
|
}
|
|
105
109
|
|
|
106
110
|
if (sinks.length === 0) return undefined
|
|
107
111
|
|
|
108
|
-
const source = createTelemetrySource({ sinks, run, warn: (m) => ctx.warn(m) })
|
|
112
|
+
const source = createTelemetrySource({ sinks, run, warn: (m) => ctx.warn(m), owners })
|
|
109
113
|
// The bus's unsubscribe is idempotent, so it is the handle's dispose as
|
|
110
114
|
// is (a once-flag here survived item 654).
|
|
111
115
|
const dispose = bus.subscribe(source.subscriber)
|
|
@@ -364,9 +364,15 @@ export function createTelemetrySource(args: {
|
|
|
364
364
|
run: RunContextRecord
|
|
365
365
|
/** Where a dropped-flush notice goes; absent = stay silent. */
|
|
366
366
|
warn?: (message: string) => void
|
|
367
|
+
/** What a sink with no `name` of its own is called: its plugin's (the host's map). */
|
|
368
|
+
owners?: ReadonlyMap<TelemetrySink, string>
|
|
367
369
|
}): TelemetrySource {
|
|
368
370
|
const { sinks, run, warn } = args
|
|
369
371
|
const runId = run.runId
|
|
372
|
+
// `name` is optional, and a nameless sink was reported as 'undefined'
|
|
373
|
+
// (item 1027): it goes by its plugin's name, else its place in the list.
|
|
374
|
+
const label = (sink: TelemetrySink): string =>
|
|
375
|
+
sink.name ?? args.owners?.get(sink) ?? `#${sinks.indexOf(sink) + 1}`
|
|
370
376
|
// A sink is disabled the first time it throws — its name (or index) goes
|
|
371
377
|
// here and it's skipped for the rest of the run, FLUSH INCLUDED. Flushing a
|
|
372
378
|
// disabled sink would write a buffer that is incomplete by construction: it
|
|
@@ -381,7 +387,7 @@ export function createTelemetrySource(args: {
|
|
|
381
387
|
const disable = (sink: TelemetrySink, hook: string, err: unknown): void => {
|
|
382
388
|
disabled.add(sink)
|
|
383
389
|
warn?.(
|
|
384
|
-
`[vx] telemetry sink '${sink
|
|
390
|
+
`[vx] telemetry sink '${label(sink)}' threw in ${hook}; disabled for this run: ${err instanceof Error ? err.message : String(err)}`,
|
|
385
391
|
)
|
|
386
392
|
}
|
|
387
393
|
// Precompute which sinks want each kind, so per-event fan-out is a plain
|
|
@@ -500,7 +506,7 @@ export function createTelemetrySource(args: {
|
|
|
500
506
|
// A flush failure can never break the run — but it still costs
|
|
501
507
|
// this sink its export, so say so rather than dropping it.
|
|
502
508
|
warn?.(
|
|
503
|
-
`[vx] telemetry sink '${sink
|
|
509
|
+
`[vx] telemetry sink '${label(sink)}' failed to flush: ${err instanceof Error ? err.message : String(err)}`,
|
|
504
510
|
)
|
|
505
511
|
}
|
|
506
512
|
}),
|