@vzn/vx 0.0.456 → 0.0.457
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/archive.ts +11 -4
- package/src/cli/index.ts +14 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vzn/vx",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.457",
|
|
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.457",
|
|
25
|
+
"@vzn/vx-linux-arm64": "0.0.457",
|
|
26
|
+
"@vzn/vx-darwin-x64": "0.0.457",
|
|
27
|
+
"@vzn/vx-darwin-arm64": "0.0.457"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@anthropic-ai/sandbox-runtime": "^0.0.76"
|
package/src/cache/archive.ts
CHANGED
|
@@ -41,6 +41,7 @@ import { chmodSync, renameSync, statSync, utimesSync } from 'node:fs'
|
|
|
41
41
|
import { lstat, mkdir, readlink, realpath, rmdir, stat, unlink, writeFile } from 'node:fs/promises'
|
|
42
42
|
import path from 'node:path'
|
|
43
43
|
import { UserError } from '../util/index.js'
|
|
44
|
+
import { WORKSPACE_OUTPUT_PREFIX } from './layer.js'
|
|
44
45
|
import { TarFormatError, type TarInput, tarEntries, tarPack, tarSize } from './tar-stream.js'
|
|
45
46
|
|
|
46
47
|
/** Archive entry name carrying the per-output mode/mtime sidecar. */
|
|
@@ -236,11 +237,17 @@ export async function planArtifact(args: PackArgs): Promise<ArtifactPlan> {
|
|
|
236
237
|
// file's bytes and comes back as a regular file. A link to a
|
|
237
238
|
// directory, or a dangling one, has no bytes to pack: refuse loudly
|
|
238
239
|
// rather than store an entry that restores to nothing.
|
|
239
|
-
|
|
240
|
+
// The path as the config spells it: a root-anchored output's entry
|
|
241
|
+
// name is vx's own `workspace-outputs/…` (M-66).
|
|
242
|
+
const shown = name.startsWith('outputs/')
|
|
243
|
+
? `output ${name.slice('outputs/'.length)}`
|
|
244
|
+
: name.startsWith(WORKSPACE_OUTPUT_PREFIX)
|
|
245
|
+
? `workspaceFiles output ${name.slice(WORKSPACE_OUTPUT_PREFIX.length)}`
|
|
246
|
+
: `output ${name}`
|
|
240
247
|
const dangling = (err: NodeJS.ErrnoException): never => {
|
|
241
248
|
if (err.code === 'ENOENT') {
|
|
242
249
|
throw new UserError(
|
|
243
|
-
|
|
250
|
+
`${shown} is a dangling symlink: vx stores regular files only — emit a file there, or narrow cache.outputs.files to the files the task produces, or take it back with a '!' entry`,
|
|
244
251
|
)
|
|
245
252
|
}
|
|
246
253
|
throw err
|
|
@@ -256,7 +263,7 @@ export async function planArtifact(args: PackArgs): Promise<ArtifactPlan> {
|
|
|
256
263
|
const root = await withinReal
|
|
257
264
|
if (!src.startsWith(root + path.sep) && !(await ownOutputs()).has(src)) {
|
|
258
265
|
throw new UserError(
|
|
259
|
-
|
|
266
|
+
`${shown} is a symlink to ${src}, outside the project: vx packs a symlinked output as its target's bytes, and a project's outputs come from its own directory — emit a file there, or take it back with a '!' entry`,
|
|
260
267
|
)
|
|
261
268
|
}
|
|
262
269
|
}
|
|
@@ -264,7 +271,7 @@ export async function planArtifact(args: PackArgs): Promise<ArtifactPlan> {
|
|
|
264
271
|
}
|
|
265
272
|
if (!st.isFile()) {
|
|
266
273
|
throw new UserError(
|
|
267
|
-
|
|
274
|
+
`${shown} is not a regular file (a symlink to a directory?): vx stores regular files only — emit a file there, or narrow cache.outputs.files to the files the task produces, or take it back with a '!' entry`,
|
|
268
275
|
)
|
|
269
276
|
}
|
|
270
277
|
const mode = st.mode & 0o777
|
package/src/cli/index.ts
CHANGED
|
@@ -28,7 +28,20 @@ export async function run(argv: readonly string[]): Promise<number> {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
switch (command) {
|
|
31
|
-
case undefined:
|
|
31
|
+
case undefined: {
|
|
32
|
+
// A bare `vx` where no workspace is printed 151 lines of help, none
|
|
33
|
+
// of which says the one thing wrong: there is nothing here to run.
|
|
34
|
+
const { findWorkspaceRoot } = await import('../workspace/index.js')
|
|
35
|
+
try {
|
|
36
|
+
await findWorkspaceRoot(process.cwd())
|
|
37
|
+
} catch (err) {
|
|
38
|
+
if (!isUserError(err)) throw err
|
|
39
|
+
process.stderr.write(`vx: ${err.message}; \`vx help\` lists the verbs\n`)
|
|
40
|
+
return 1
|
|
41
|
+
}
|
|
42
|
+
printHelp(await (await plugins()).pluginCommandHelp())
|
|
43
|
+
return 0
|
|
44
|
+
}
|
|
32
45
|
case '--help':
|
|
33
46
|
case '-h':
|
|
34
47
|
printHelp(await (await plugins()).pluginCommandHelp())
|