@vzn/vx 0.0.112 → 0.0.113

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.112",
3
+ "version": "0.0.113",
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.112",
21
- "@vzn/vx-linux-arm64": "0.0.112",
22
- "@vzn/vx-darwin-x64": "0.0.112",
23
- "@vzn/vx-darwin-arm64": "0.0.112"
20
+ "@vzn/vx-linux-x64": "0.0.113",
21
+ "@vzn/vx-linux-arm64": "0.0.113",
22
+ "@vzn/vx-darwin-x64": "0.0.113",
23
+ "@vzn/vx-darwin-arm64": "0.0.113"
24
24
  },
25
25
  "dependencies": {
26
26
  "@anthropic-ai/sandbox-runtime": "^0.0.76"
@@ -1046,6 +1046,14 @@ export class Cache implements CacheLayer {
1046
1046
  // Same distinction for a tree the process cannot write into — a
1047
1047
  // `dist/` another user owns, a read-only checkout, a full disk: the
1048
1048
  // artifact is intact, the tree is not the process's to change.
1049
+ // A refusal to READ the artifact is the cache directory's, not the
1050
+ // outputs': the old line sent the reader to the wrong tree (A-40).
1051
+ if (isFsRefusal(err) && err.path === src) {
1052
+ throw new UserError(
1053
+ `restore of ${hash} could not read its artifact (${code}: ${err.message}). ` +
1054
+ `Make the cache directory readable by this user, or point cacheDir / --cache-dir at one that is.`,
1055
+ )
1056
+ }
1049
1057
  if (isFsRefusal(err)) {
1050
1058
  const remedy = isDiskFull(err)
1051
1059
  ? 'Free space on that disk and re-run.'
package/src/cli/help.ts CHANGED
@@ -221,10 +221,10 @@ export function flagHint(verb: string, arg: string): string {
221
221
  * reading every flag on it put `--check` in the list, so `vx run --chek`
222
222
  * was told "did you mean --check?" and `--check` was then refused.
223
223
  */
224
- export function documentedFlags(verb: string): string[] {
224
+ export function documentedFlags(verb: string, text = helpText()): string[] {
225
225
  const flags = new Set<string>()
226
226
  let inVerb = false
227
- for (const line of helpText().split('\n')) {
227
+ for (const line of text.split('\n')) {
228
228
  if (/^[A-Z][A-Za-z ]*(?: \(for [a-z]+\))?:$/.test(line))
229
229
  inVerb = line.endsWith(`(for ${verb}):`)
230
230
  if (!inVerb) continue
@@ -140,8 +140,11 @@ function trailingCommentStart(command: string): number {
140
140
  export function withForwardArgs(command: string, args: readonly string[] | undefined): string {
141
141
  if (!args || args.length === 0) return command
142
142
  const quoted = args.map(shellQuote).join(' ')
143
- const comment = trailingCommentStart(command)
143
+ let comment = trailingCommentStart(command)
144
144
  if (comment < 0) return `${command} ${quoted}`
145
+ // A comment-only last line after a commented line: the args go before
146
+ // the earliest comment, or they land inside it (`echo one # c\n# two`).
147
+ for (let c = comment; c >= 0; c = trailingCommentStart(command.slice(0, c).trimEnd())) comment = c
145
148
  return `${command.slice(0, comment).trimEnd()} ${quoted} ${command.slice(comment)}`
146
149
  }
147
150
 
@@ -171,10 +171,11 @@ function compilerPaths(file: string, memo?: TsconfigMemo, depth = 0): CompilerPa
171
171
  if (typeof json !== 'object' || json === null) return {}
172
172
  const dir = path.dirname(file)
173
173
  const out: CompilerPaths = {}
174
+ // A string only: Bun follows no array `extends` (TS 5's form), and an
175
+ // alias only an array maps went to the registry (D-30).
174
176
  const ext = (json as { extends?: unknown }).extends
175
- for (const base of typeof ext === 'string' ? [ext] : Array.isArray(ext) ? ext : []) {
176
- if (depth > 8 || typeof base !== 'string' || !base.startsWith('.')) continue
177
- const f = path.resolve(dir, base)
177
+ if (typeof ext === 'string' && ext.startsWith('.') && depth <= 8) {
178
+ const f = path.resolve(dir, ext)
178
179
  Object.assign(out, compilerPaths(f.endsWith('.json') ? f : f + '.json', memo, depth + 1))
179
180
  }
180
181
  const opts = (json as { compilerOptions?: unknown }).compilerOptions