@vzn/vx 0.0.128 → 0.0.130
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.130",
|
|
4
4
|
"description": "A fast, correct task runner and build cache for JavaScript monorepos.",
|
|
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.130",
|
|
21
|
+
"@vzn/vx-linux-arm64": "0.0.130",
|
|
22
|
+
"@vzn/vx-darwin-x64": "0.0.130",
|
|
23
|
+
"@vzn/vx-darwin-arm64": "0.0.130"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@anthropic-ai/sandbox-runtime": "^0.0.76"
|
package/src/util/index.ts
CHANGED
|
@@ -51,4 +51,5 @@ export { CORE_VERBS, MOVED_VERBS } from './verbs.js'
|
|
|
51
51
|
export { isUnsupportedBun, MIN_BUN, unsupportedBunMessage } from './bun-version.js'
|
|
52
52
|
export { executablePath, shellArgv } from './which.js'
|
|
53
53
|
export { procfsIsOwn } from './procfs.js'
|
|
54
|
+
export { realPath } from './real-path.js'
|
|
54
55
|
export { maskedCommand, maskedEmitter, MASKED, secretMask, type SecretMask } from './secret-mask.js'
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { realpathSync } from 'node:fs'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A path's canonical spelling. On Windows `realpathSync` keeps an 8.3
|
|
5
|
+
* short name (`C:\Users\RUNNER~1\…`) where git, `fs.promises.realpath`
|
|
6
|
+
* and every other reader say `runneradmin`, so one file had two
|
|
7
|
+
* spellings and a key or a comparison that folds the path split on
|
|
8
|
+
* them (O-16). The native call asks the OS for the final path.
|
|
9
|
+
*/
|
|
10
|
+
export function realPath(p: string): string {
|
|
11
|
+
return realpathSync.native(p)
|
|
12
|
+
}
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
// `vx lock` both go through `JSON.stringify` — so a cached config derives
|
|
29
29
|
// the same cache key as a live evaluation of the same bytes.
|
|
30
30
|
|
|
31
|
-
import { lstatSync, readFileSync,
|
|
31
|
+
import { lstatSync, readFileSync, statSync } from 'node:fs'
|
|
32
32
|
import path from 'node:path'
|
|
33
|
-
import { xxh3 } from '../util/index.js'
|
|
33
|
+
import { realPath, xxh3 } from '../util/index.js'
|
|
34
34
|
import { VERSION } from '../version.js'
|
|
35
35
|
|
|
36
36
|
/** Bump when the key derivation or the stored shape changes. */
|
|
@@ -395,8 +395,8 @@ const EXPLICIT_EXT = /\.(?:m?[jt]s|cjs|cts)$/
|
|
|
395
395
|
* per run (`read-once.unsafe.test.ts`).
|
|
396
396
|
*/
|
|
397
397
|
function realDirOf(file: string): string {
|
|
398
|
-
if (lstatSync(file).isSymbolicLink()) return path.dirname(
|
|
399
|
-
return
|
|
398
|
+
if (lstatSync(file).isSymbolicLink()) return path.dirname(realPath(file))
|
|
399
|
+
return realPath(path.dirname(file))
|
|
400
400
|
}
|
|
401
401
|
|
|
402
402
|
/** Each workspace root's real path, asked once per process. */
|
|
@@ -418,7 +418,7 @@ function reachedThroughNoLink(file: string, realDir: string, root: string | unde
|
|
|
418
418
|
if (root === undefined) return true
|
|
419
419
|
let realRoot = realRoots.get(root)
|
|
420
420
|
if (realRoot === undefined) {
|
|
421
|
-
realRoot =
|
|
421
|
+
realRoot = realPath(root)
|
|
422
422
|
realRoots.set(root, realRoot)
|
|
423
423
|
}
|
|
424
424
|
return path.relative(realRoot, realDir) === path.relative(root, dir)
|
|
@@ -427,7 +427,7 @@ function reachedThroughNoLink(file: string, realDir: string, root: string | unde
|
|
|
427
427
|
/** A regular file reached through no symlink: the path IS the file. */
|
|
428
428
|
function isCanonicalFile(file: string): boolean {
|
|
429
429
|
try {
|
|
430
|
-
return
|
|
430
|
+
return realPath(file) === file && statSync(file).isFile()
|
|
431
431
|
} catch {
|
|
432
432
|
return false
|
|
433
433
|
}
|
|
@@ -500,7 +500,7 @@ export async function configEvalKey(a: ConfigEvalKeyArgs): Promise<ConfigEvalKey
|
|
|
500
500
|
// workspace under /var vs /private/var), and the key folds the
|
|
501
501
|
// path — a spelling that drifts between runs is a spurious miss
|
|
502
502
|
// and a duplicated memo row.
|
|
503
|
-
resolved =
|
|
503
|
+
resolved = realPath(Bun.resolveSync(spec, dir))
|
|
504
504
|
} catch {
|
|
505
505
|
return null
|
|
506
506
|
}
|
|
@@ -574,7 +574,7 @@ export async function configImports(configPath: string): Promise<string[]> {
|
|
|
574
574
|
let resolved: string
|
|
575
575
|
try {
|
|
576
576
|
dir ??= realDirOf(file)
|
|
577
|
-
resolved =
|
|
577
|
+
resolved = realPath(Bun.resolveSync(spec, dir))
|
|
578
578
|
} catch {
|
|
579
579
|
continue
|
|
580
580
|
}
|
|
@@ -722,6 +722,26 @@ const FOREIGN_FIELDS: ReadonlyMap<ReadonlySet<string>, Readonly<Record<string, s
|
|
|
722
722
|
},
|
|
723
723
|
],
|
|
724
724
|
[EXEC_FIELDS, { cmd: '`command`', script: '`command`' }],
|
|
725
|
+
// Turbo's turbo.json and Nx's nx.json keys, written into vx.workspace
|
|
726
|
+
// (D-38).
|
|
727
|
+
[
|
|
728
|
+
WORKSPACE_FIELDS,
|
|
729
|
+
{
|
|
730
|
+
pipeline:
|
|
731
|
+
"each package's `vx.config` `tasks` (`bunx @vzn/vx-migrate` writes them from turbo.json)",
|
|
732
|
+
tasks:
|
|
733
|
+
"each package's `vx.config` `tasks` (`bunx @vzn/vx-migrate` writes them from turbo.json)",
|
|
734
|
+
targetDefaults:
|
|
735
|
+
"each package's `vx.config` `tasks`, sharing defaults through an imported module",
|
|
736
|
+
namedInputs: 'a module each `vx.config` imports, spread into `cache.inputs.files`',
|
|
737
|
+
globalEnv: '`cache.inputs.env` on the tasks it keys',
|
|
738
|
+
globalDependencies: '`cache.inputs.workspaceFiles` on the tasks it keys',
|
|
739
|
+
remoteCache:
|
|
740
|
+
'a cache plugin in `plugins` (`turboCache()` or `nxCache()` from `@vzn/vx-migrate`)',
|
|
741
|
+
parallel: '`concurrency`',
|
|
742
|
+
cacheDirectory: '`cacheDir`',
|
|
743
|
+
},
|
|
744
|
+
],
|
|
725
745
|
])
|
|
726
746
|
|
|
727
747
|
function assertKnownFields(value: object, allowed: ReadonlySet<string>, where: string): void {
|