@vzn/vx 0.0.112 → 0.0.114

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/README.md CHANGED
@@ -38,7 +38,7 @@ burns 35 s of CPU in vx, 73 s in Turborepo and 114 minutes in Nx; a
38
38
  fully cached run replays the graph in 510 ms.
39
39
  <!-- bench:end -->
40
40
 
41
- Measured on eleven real Turborepo and Nx repos too: [tried on real repos](#tried-on-real-repos).
41
+ Measured on twelve real Turborepo, Nx and moon repos too: [tried on real repos](#tried-on-real-repos).
42
42
 
43
43
  ## Install
44
44
 
@@ -145,24 +145,25 @@ Turbo and Nx feature is in vx, pinned by a test:
145
145
 
146
146
  ## Tried on real repos
147
147
 
148
- Eleven public monorepos, each run with its own `turbo.json` or Nx graph
148
+ Twelve public monorepos, each run with its own `turbo.json`, Nx graph or moon config
149
149
  and nothing rewritten, against the tool it ships with. Both tools on the same machine and
150
150
  tasks per row, medians; vx first, theirs second. Where the other tool
151
151
  wins, the row says so.
152
152
 
153
- | Repo | Against | Cold build | Restore outputs | Nothing to do |
154
- | ----------------------------------------------------------- | ------- | --------------------- | --------------- | ------------------- |
155
- | [solidjs/solid](https://github.com/solidjs/solid) | Turbo | 40.6 s / 45.5 s | 66 ms / 127 ms | 51 ms / 95 ms |
156
- | [withastro/astro](https://github.com/withastro/astro) | Turbo | 48.0 s / 57.9 s | 478 ms / 1.43 s | 249 ms / 1.38 s |
157
- | [payloadcms/payload](https://github.com/payloadcms/payload) | Turbo | 126.9 s / 127.5 s | 3.44 s / 3.46 s | 256 ms / **237 ms** |
158
- | [medusajs/medusa](https://github.com/medusajs/medusa) | Turbo | 308 s / 315 s | 3.86 s / 7.16 s | 947 ms / 3.29 s |
159
- | [n8n-io/n8n](https://github.com/n8n-io/n8n) | Turbo | 137.2 s / **133.7 s** | 8.27 s / 12.5 s | 842 ms / 1.36 s |
160
- | [calcom/cal.com](https://github.com/calcom/cal.com) | Turbo | 245.7 s / 250.7 s | 17.4 s / 19.9 s | 14.7 s / 18.5 s |
161
- | [TanStack/query](https://github.com/TanStack/query) | Nx | 47.4 s / 55.1 s | 656 ms / 1.98 s | 174 ms / 1.88 s |
162
- | [strapi/strapi](https://github.com/strapi/strapi) | Nx | 238.2 s / 245.7 s | 1.61 s / 3.94 s | 341 ms / 4.02 s |
163
- | [novuhq/novu](https://github.com/novuhq/novu) | Nx | 291.2 s / 299.4 s | 3.10 s / 9.05 s | 655 ms / 8.55 s |
164
- | [TanStack/router](https://github.com/TanStack/router) | Nx | 199.9 s / 226.7 s | 1.00 s / 3.33 s | 505 ms / 3.21 s |
165
- | [refinedev/refine](https://github.com/refinedev/refine) | Nx | 96.2 s / 105.9 s | 1.06 s / 1.19 s | 303 ms / 1.16 s |
153
+ | Repo | Against | Cold build | Restore outputs | Nothing to do |
154
+ | --------------------------------------------------------------------- | ------- | --------------------- | --------------- | ------------------- |
155
+ | [solidjs/solid](https://github.com/solidjs/solid) | Turbo | 40.6 s / 45.5 s | 66 ms / 127 ms | 51 ms / 95 ms |
156
+ | [withastro/astro](https://github.com/withastro/astro) | Turbo | 48.0 s / 57.9 s | 478 ms / 1.43 s | 249 ms / 1.38 s |
157
+ | [payloadcms/payload](https://github.com/payloadcms/payload) | Turbo | 126.9 s / 127.5 s | 3.44 s / 3.46 s | 256 ms / **237 ms** |
158
+ | [medusajs/medusa](https://github.com/medusajs/medusa) | Turbo | 308 s / 315 s | 3.86 s / 7.16 s | 947 ms / 3.29 s |
159
+ | [n8n-io/n8n](https://github.com/n8n-io/n8n) | Turbo | 137.2 s / **133.7 s** | 8.27 s / 12.5 s | 842 ms / 1.36 s |
160
+ | [calcom/cal.com](https://github.com/calcom/cal.com) | Turbo | 245.7 s / 250.7 s | 17.4 s / 19.9 s | 14.7 s / 18.5 s |
161
+ | [TanStack/query](https://github.com/TanStack/query) | Nx | 47.4 s / 55.1 s | 656 ms / 1.98 s | 174 ms / 1.88 s |
162
+ | [strapi/strapi](https://github.com/strapi/strapi) | Nx | 238.2 s / 245.7 s | 1.61 s / 3.94 s | 341 ms / 4.02 s |
163
+ | [novuhq/novu](https://github.com/novuhq/novu) | Nx | 291.2 s / 299.4 s | 3.10 s / 9.05 s | 655 ms / 8.55 s |
164
+ | [TanStack/router](https://github.com/TanStack/router) | Nx | 199.9 s / 226.7 s | 1.00 s / 3.33 s | 505 ms / 3.21 s |
165
+ | [refinedev/refine](https://github.com/refinedev/refine) | Nx | 96.2 s / 105.9 s | 1.06 s / 1.19 s | 303 ms / 1.16 s |
166
+ | [kindspells/astro-shield](https://github.com/kindspells/astro-shield) | moon | 2.64 s / 3.78 s | 125 ms / 2.46 s | 111 ms / 2.37 s |
166
167
 
167
168
  **Bold** marks the other tool winning. Versions, revisions, scopes and
168
169
  harness per repo: [benchmarks](packages/vx/docs/benchmarks.md) (astro
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vzn/vx",
3
- "version": "0.0.112",
3
+ "version": "0.0.114",
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.114",
21
+ "@vzn/vx-linux-arm64": "0.0.114",
22
+ "@vzn/vx-darwin-x64": "0.0.114",
23
+ "@vzn/vx-darwin-arm64": "0.0.114"
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