@vzn/vx 0.0.531 → 0.0.533
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/cache.ts +10 -2
- package/src/cli/select.ts +4 -4
- package/src/workspace/affected.ts +0 -32
- package/src/workspace/index.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vzn/vx",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.533",
|
|
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.533",
|
|
25
|
+
"@vzn/vx-linux-arm64": "0.0.533",
|
|
26
|
+
"@vzn/vx-darwin-x64": "0.0.533",
|
|
27
|
+
"@vzn/vx-darwin-arm64": "0.0.533"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@anthropic-ai/sandbox-runtime": "^0.0.76"
|
package/src/cache/cache.ts
CHANGED
|
@@ -1473,9 +1473,17 @@ export class Cache implements CacheLayer {
|
|
|
1473
1473
|
// leaves it or loops (item 748).
|
|
1474
1474
|
const code = (err as NodeJS.ErrnoException).code
|
|
1475
1475
|
if (code === 'EISDIR' || code === 'ENOTDIR' || code === 'EEXIST' || code === 'ENOTEMPTY') {
|
|
1476
|
+
// Bun's message already opens with the code: `EEXIST: EEXIST: …` read
|
|
1477
|
+
// as a stutter. EEXIST and ENOTDIR are a FILE in a directory's
|
|
1478
|
+
// place; the told-backwards sentence named only the reverse (X-7).
|
|
1479
|
+
const msg = (err as Error).message
|
|
1480
|
+
const what =
|
|
1481
|
+
code === 'EISDIR' || code === 'ENOTEMPTY'
|
|
1482
|
+
? 'a directory stands where the entry holds a file'
|
|
1483
|
+
: 'a file stands where the entry needs a directory'
|
|
1476
1484
|
throw new UserError(
|
|
1477
|
-
`restore of ${hash} into ${projectDir} was blocked by what is on disk (${code}: ${
|
|
1478
|
-
`The clean before a restore removes the files the output globs select
|
|
1485
|
+
`restore of ${hash} into ${projectDir} was blocked by what is on disk (${msg.startsWith(code) ? msg : `${code}: ${msg}`}): ${what}. ` +
|
|
1486
|
+
`The clean before a restore removes the files the output globs select and the directories that empties, not this — remove it and re-run.`,
|
|
1479
1487
|
)
|
|
1480
1488
|
}
|
|
1481
1489
|
// A legal name under a destination deep enough that the two together
|
package/src/cli/select.ts
CHANGED
|
@@ -21,11 +21,11 @@ import {
|
|
|
21
21
|
parseFilter,
|
|
22
22
|
type ProjectMeta,
|
|
23
23
|
readLockfile,
|
|
24
|
-
workspaceGlobsMatch,
|
|
25
24
|
} from '../workspace/index.js'
|
|
26
25
|
import type { ProjectConfig } from '../config.js'
|
|
27
26
|
import type { ProjectEntry } from '../workspace/index.js'
|
|
28
27
|
import { parseDependencySpec } from '../graph/index.js'
|
|
28
|
+
import { declaresInput } from '../cache/index.js'
|
|
29
29
|
import { listed, maskedLine, nearest, UserError } from '../util/index.js'
|
|
30
30
|
import {
|
|
31
31
|
claimedAffected,
|
|
@@ -61,9 +61,9 @@ export async function workspaceGlobOwners(
|
|
|
61
61
|
): Promise<string[]> {
|
|
62
62
|
const declaresMatch = (config: ProjectConfig): boolean => {
|
|
63
63
|
for (const task of Object.values(config.tasks ?? {})) {
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
66
|
-
if (changed.some((rel) =>
|
|
64
|
+
const cache = task.cache
|
|
65
|
+
if (cache === undefined) continue
|
|
66
|
+
if (changed.some((rel) => declaresInput(cache, null, rel))) return true
|
|
67
67
|
}
|
|
68
68
|
return false
|
|
69
69
|
}
|
|
@@ -10,14 +10,12 @@ import { realpathSync, statSync } from 'node:fs'
|
|
|
10
10
|
import { realpath } from 'node:fs/promises'
|
|
11
11
|
import path from 'node:path'
|
|
12
12
|
import {
|
|
13
|
-
asTrees,
|
|
14
13
|
executablePath,
|
|
15
14
|
UserError,
|
|
16
15
|
gitSpawnRefusal,
|
|
17
16
|
isExecutableMissing,
|
|
18
17
|
isInstalledPath,
|
|
19
18
|
relPosix,
|
|
20
|
-
taskGlob,
|
|
21
19
|
} from '../util/index.js'
|
|
22
20
|
import { LOCKFILE_NAME } from './lockfile.js'
|
|
23
21
|
import { configImportOwners } from './config-imports.js'
|
|
@@ -576,36 +574,6 @@ async function workspaceConfigChanged(
|
|
|
576
574
|
return false
|
|
577
575
|
}
|
|
578
576
|
|
|
579
|
-
/**
|
|
580
|
-
* Does any `cache.inputs.workspaceFiles` entry in `globs` match `rel`?
|
|
581
|
-
*
|
|
582
|
-
* Mirrors `resolveWorkspaceFiles`' partition: a leading `!` is an EXCLUDE, and
|
|
583
|
-
* with no positive glob nothing matches. Paths are workspace-root-relative and
|
|
584
|
-
* POSIX-separated, which is the form both git enumeration and the glob
|
|
585
|
-
* resolver already speak.
|
|
586
|
-
*
|
|
587
|
-
* `asTrees` on BOTH sides, because the resolver runs it on both and this
|
|
588
|
-
* has to answer the same question the KEY answers. It did not, and the
|
|
589
|
-
* gap decided whether a changed file rebuilt anything: with
|
|
590
|
-
* `workspaceFiles: ['./generated/**']` or the literal `['generated']` —
|
|
591
|
-
* five spellings in all — the resolver folds `generated/x.txt` into the
|
|
592
|
-
* project's key while a raw `Bun.Glob` matched none of them, so
|
|
593
|
-
* `--affected` left the project out of a run its own key says is stale
|
|
594
|
-
* (item 445). A mirror that normalizes differently from what it mirrors
|
|
595
|
-
* is not a mirror.
|
|
596
|
-
*/
|
|
597
|
-
export function workspaceGlobsMatch(globs: readonly string[], rel: string): boolean {
|
|
598
|
-
const positive: string[] = []
|
|
599
|
-
const negative: string[] = []
|
|
600
|
-
for (const entry of globs) {
|
|
601
|
-
if (entry.startsWith('!')) negative.push(entry.slice(1))
|
|
602
|
-
else positive.push(entry)
|
|
603
|
-
}
|
|
604
|
-
if (positive.length === 0) return false
|
|
605
|
-
if (!asTrees(positive).some((g) => taskGlob(g).match(rel))) return false
|
|
606
|
-
return !asTrees(negative).some((g) => taskGlob(g).match(rel))
|
|
607
|
-
}
|
|
608
|
-
|
|
609
577
|
/**
|
|
610
578
|
* The fingerprint files as workspace-root-relative paths. Read from the same
|
|
611
579
|
* constant the fingerprint itself walks, so a new lockfile format cannot be
|