@vzn/vx 0.0.552 → 0.0.554
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/layer.ts +2 -1
- package/src/cli/last.ts +18 -3
- package/src/workspace/config-schema.ts +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vzn/vx",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.554",
|
|
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.554",
|
|
25
|
+
"@vzn/vx-linux-arm64": "0.0.554",
|
|
26
|
+
"@vzn/vx-darwin-x64": "0.0.554",
|
|
27
|
+
"@vzn/vx-darwin-arm64": "0.0.554"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@anthropic-ai/sandbox-runtime": "^0.0.76"
|
package/src/cache/layer.ts
CHANGED
|
@@ -329,7 +329,8 @@ export interface PruneResult {
|
|
|
329
329
|
* the full `workspace-outputs/<rel-to-root>` tar entry name as the
|
|
330
330
|
* discriminator — least-invasive row format, no schema change. A
|
|
331
331
|
* project output dir literally named `workspace-outputs/` would
|
|
332
|
-
* collide with the namespace; the name is reserved
|
|
332
|
+
* collide with the namespace; the name is reserved, and a project
|
|
333
|
+
* output glob under it is refused at load (config-schema.ts).
|
|
333
334
|
*/
|
|
334
335
|
export const WORKSPACE_OUTPUT_PREFIX = 'workspace-outputs/'
|
|
335
336
|
|
package/src/cli/last.ts
CHANGED
|
@@ -34,6 +34,12 @@ interface LastArgs {
|
|
|
34
34
|
error?: string
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* A run id as typed beside `--list`: a UUIDv7's first group (8 hex digits)
|
|
39
|
+
* at least, whole or cut as `--list` prints it.
|
|
40
|
+
*/
|
|
41
|
+
const RUN_ID_SHAPE = /^[0-9a-f]{8}(?:-|$)/i
|
|
42
|
+
|
|
37
43
|
export function parseLastArgs(args: readonly string[]): LastArgs {
|
|
38
44
|
const out: LastArgs = { format: 'pretty' }
|
|
39
45
|
for (let i = 0; i < args.length; i++) {
|
|
@@ -41,10 +47,15 @@ export function parseLastArgs(args: readonly string[]): LastArgs {
|
|
|
41
47
|
if (a === '--list' || a.startsWith('--list=')) {
|
|
42
48
|
// `--list 5` is the count, like every other value flag's space form:
|
|
43
49
|
// it read as a run id, which `--list` then ignored, and ten runs came
|
|
44
|
-
// back (item 899).
|
|
45
|
-
//
|
|
50
|
+
// back (item 899). The next argument is the count unless it is a flag
|
|
51
|
+
// or has a run id's shape: `1.5`, `-3` and `abc` read as run ids and
|
|
52
|
+
// were told a run id does not combine with --list (X-29).
|
|
46
53
|
const next = args[i + 1]
|
|
47
|
-
const spaced =
|
|
54
|
+
const spaced =
|
|
55
|
+
a === '--list' &&
|
|
56
|
+
next !== undefined &&
|
|
57
|
+
(/^\d+$/.test(next) ||
|
|
58
|
+
(!RUN_ID_SHAPE.test(next) && (!next.startsWith('-') || /^-\d/.test(next))))
|
|
48
59
|
const lv = a === '--list' ? (spaced ? next : '10') : a.slice(7)
|
|
49
60
|
if (spaced) i++
|
|
50
61
|
const n = Number(lv)
|
|
@@ -86,6 +97,10 @@ export function parseLastArgs(args: readonly string[]): LastArgs {
|
|
|
86
97
|
out.runId = a
|
|
87
98
|
}
|
|
88
99
|
// One run's replay or a list of runs, not both: the id was dropped.
|
|
100
|
+
// Beside --list, a word no run id could be is just an extra one.
|
|
101
|
+
if (out.runId !== undefined && out.list !== undefined && !RUN_ID_SHAPE.test(out.runId)) {
|
|
102
|
+
return { ...out, error: `unexpected argument: ${out.runId}${seeHelp('last')}` }
|
|
103
|
+
}
|
|
89
104
|
if (out.runId !== undefined && out.list !== undefined) {
|
|
90
105
|
return {
|
|
91
106
|
...out,
|
|
@@ -650,6 +650,15 @@ export function validateProjectConfig(config: ProjectConfig, configPath: string)
|
|
|
650
650
|
`name the directory the task writes, such as "dist/**"`,
|
|
651
651
|
)
|
|
652
652
|
}
|
|
653
|
+
// An artifact stores workspace outputs under `workspace-outputs/`,
|
|
654
|
+
// and its index read a project output there as one: every hit was
|
|
655
|
+
// a "corrupt artifact", dropped and run again.
|
|
656
|
+
if (!g.startsWith('!') && normalizeGlob(g).split('/')[0] === 'workspace-outputs') {
|
|
657
|
+
throw new UserError(
|
|
658
|
+
`${where}.cache.outputs.files: "${g}" is under workspace-outputs/, a name vx's ` +
|
|
659
|
+
`artifacts reserve for outputs.workspaceFiles — write the task's files to another directory`,
|
|
660
|
+
)
|
|
661
|
+
}
|
|
653
662
|
// A `!` entry takes a path back from the outputs (A-44): it is not
|
|
654
663
|
// cleaned, saved or restored, and it stays an input.
|
|
655
664
|
assertNotDoubleNegated(g, `${where}.cache.outputs.files`)
|