@vzn/vx 0.0.552 → 0.0.553
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/last.ts +18 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vzn/vx",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.553",
|
|
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.553",
|
|
25
|
+
"@vzn/vx-linux-arm64": "0.0.553",
|
|
26
|
+
"@vzn/vx-darwin-x64": "0.0.553",
|
|
27
|
+
"@vzn/vx-darwin-arm64": "0.0.553"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@anthropic-ai/sandbox-runtime": "^0.0.76"
|
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,
|