@vzn/vx 0.0.618 → 0.0.619

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.618",
3
+ "version": "0.0.619",
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.618",
25
- "@vzn/vx-linux-arm64": "0.0.618",
26
- "@vzn/vx-darwin-x64": "0.0.618",
27
- "@vzn/vx-darwin-arm64": "0.0.618"
24
+ "@vzn/vx-linux-x64": "0.0.619",
25
+ "@vzn/vx-linux-arm64": "0.0.619",
26
+ "@vzn/vx-darwin-x64": "0.0.619",
27
+ "@vzn/vx-darwin-arm64": "0.0.619"
28
28
  },
29
29
  "dependencies": {
30
30
  "@anthropic-ai/sandbox-runtime": "^0.0.76"
@@ -189,6 +189,18 @@ export async function prepareRun(options: RunOptions, log: Logger): Promise<Prep
189
189
  // fingerprint. A watch cycle is a new run and reads it afresh.
190
190
  const reads: LoadReads = new Map()
191
191
  const workspaceRoot = await findWorkspaceRoot(options.cwd, reads)
192
+ // A frozen run with nothing staged reads the lock whatever discovery
193
+ // finds, so the read (1.1 MB at 1,000 projects, ~10 ms to read and
194
+ // parse) starts here and overlaps discovery's I/O instead of following
195
+ // the cache open (X-181). A missing or malformed lock still refuses at
196
+ // the config load, after any earlier refusal.
197
+ let lockRead: Promise<Lockfile> | undefined
198
+ const readLock = (): Promise<Lockfile> =>
199
+ (lockRead ??= readLockfile(workspaceRoot).then((read) => {
200
+ if (read === null) throw new UserError(FROZEN_WITHOUT_LOCK)
201
+ return read
202
+ }))
203
+ if (options.frozen === true && options.staged === undefined) void readLock().catch(() => {})
192
204
  // An UNSCOPED run (no explicit scope, at least one bare task name)
193
205
  // enumerates the whole tree whatever the configs say, so git starts
194
206
  // HERE — the walk needs only the root — and overlaps the workspace
@@ -313,13 +325,8 @@ export async function prepareRun(options: RunOptions, log: Logger): Promise<Prep
313
325
  // Read once, and only when a config is to be read from it: the CLI's
314
326
  // selection pass may have staged every config (`options.staged`), and
315
327
  // its load refused a frozen run without a lock. A 1,000-project lock is
316
- // 1.1 MB of JSON (I-27).
317
- let lockRead: Promise<Lockfile> | undefined
318
- const readLock = (): Promise<Lockfile> =>
319
- (lockRead ??= readLockfile(workspaceRoot).then((read) => {
320
- if (read === null) throw new UserError(FROZEN_WITHOUT_LOCK)
321
- return read
322
- }))
328
+ // 1.1 MB of JSON (I-27); a run with nothing staged started its read
329
+ // beside discovery, above.
323
330
  const staged = options.staged
324
331
  const allStaged =
325
332
  staged !== undefined &&
@@ -179,13 +179,18 @@ export async function frozenProjectConfigs(
179
179
  // The lock is hand-editable; the stored config crosses the same
180
180
  // boundary a freshly evaluated one does.
181
181
  const digest = store === undefined ? undefined : lockDigests.get(lock)
182
- const keys =
182
+ const prefix =
183
183
  digest === undefined
184
184
  ? undefined
185
- : metas.map(
186
- (m) =>
187
- `vx-lock-valid-v${CONFIG_EVAL_VERSION}\0${VERSION}\0${Bun.version}\0${digest}\0${m.name}`,
188
- )
185
+ : `vx-lock-valid-v${CONFIG_EVAL_VERSION}\0${VERSION}\0${Bun.version}\0${digest}`
186
+ // One row for a lock whose every entry was accepted: a warm `--all` run
187
+ // asked for 1,090 per-project rows in one `IN` query, ~10 ms of its
188
+ // config load, where the eval-cache path it replaces is cheaper (X-181).
189
+ // A scoped run still validates, and remembers, only what it loads.
190
+ if (prefix !== undefined && store !== undefined && store.getConfigEval(prefix) !== null) {
191
+ return entries.map((e) => e.config)
192
+ }
193
+ const keys = prefix === undefined ? undefined : metas.map((m) => `${prefix}\0${m.name}`)
189
194
  const known =
190
195
  keys === undefined || store === undefined
191
196
  ? new Map<string, string>()
@@ -199,6 +204,14 @@ export async function frozenProjectConfigs(
199
204
  validateProjectConfig(entries[i]!.config, `${LOCKFILE_NAME} (${metas[i]!.name})`)
200
205
  if (key !== undefined) accepted.push([key, '1'])
201
206
  }
207
+ // Every meta found its entry above, so as many distinct names as the
208
+ // lock holds is every entry of it.
209
+ if (
210
+ prefix !== undefined &&
211
+ new Set(metas.map((m) => m.name)).size === Object.keys(lock.projects).length
212
+ ) {
213
+ accepted.push([prefix, '1'])
214
+ }
202
215
  if (store !== undefined && accepted.length > 0) {
203
216
  if (store.putConfigEvals !== undefined) store.putConfigEvals(accepted)
204
217
  else for (const [k, v] of accepted) store.putConfigEval(k, v)