@vzn/vx 0.0.352 → 0.0.353

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
@@ -180,7 +180,7 @@ keep your Turbo or Nx remote cache. [Parity map](packages/vx/docs/parity.md) ·
180
180
  | Config | TypeScript, evaluated into the cache key | JSON (static) | JSON (static) |
181
181
  | Output ownership | **Strict**: wiped before exec and restore | Additive (stale files survive) | Additive |
182
182
  | Clean-tree hashing | **Zero reads** (git index OIDs) | git OIDs | re-hash / daemon |
183
- | Daemon required for speed | **No** | Optional | Yes |
183
+ | Daemon required for speed | **No** | No (`turbo run` has none) | Yes |
184
184
  | Per-task sandbox | **Yes**: kernel-level, opt-in | No | No |
185
185
  | Plugin API | **Yes**: every pipeline stage | No | Yes (TS-tied) |
186
186
  | OTel CI/CD spans | **Yes**: `otel()` plugin, no OTel SDK | No | Paid |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vzn/vx",
3
- "version": "0.0.352",
3
+ "version": "0.0.353",
4
4
  "description": "A fast, correct 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.352",
25
- "@vzn/vx-linux-arm64": "0.0.352",
26
- "@vzn/vx-darwin-x64": "0.0.352",
27
- "@vzn/vx-darwin-arm64": "0.0.352"
24
+ "@vzn/vx-linux-x64": "0.0.353",
25
+ "@vzn/vx-linux-arm64": "0.0.353",
26
+ "@vzn/vx-darwin-x64": "0.0.353",
27
+ "@vzn/vx-darwin-arm64": "0.0.353"
28
28
  },
29
29
  "dependencies": {
30
30
  "@anthropic-ai/sandbox-runtime": "^0.0.76"
@@ -8,7 +8,7 @@
8
8
  import { existsSync } from 'node:fs'
9
9
  import { unlink } from 'node:fs/promises'
10
10
  import path from 'node:path'
11
- import { relPosix, UserError } from '../util/index.js'
11
+ import { executablePath, relPosix, UserError } from '../util/index.js'
12
12
  import type { ProjectMeta } from './workspace.js'
13
13
  import { loadWorkspace, unreachedHint, unreachedPackages } from './workspace.js'
14
14
  import { WORKSPACE_CONFIG_FILENAMES } from './project-loader.js'
@@ -412,14 +412,36 @@ export async function applyMigration(args: ApplyMigrationArgs): Promise<number>
412
412
  report.push('', 'no task caches yet: add the cache block a TODO shows, and a second run hits')
413
413
  }
414
414
  const installed = existsSync(path.join(root, 'node_modules', '@vzn', 'vx', 'package.json'))
415
- report.push(
416
- '',
417
- `next: ${vxInvocation(process.env['npm_config_user_agent'], installed)} run ${firstTask} --all`,
418
- )
415
+ // The line is the next thing to type, so it names what that run would
416
+ // refuse without: a git work tree (vx keys inputs on git's view) and,
417
+ // with no scripts mapped, a task to run.
418
+ const run = `${vxInvocation(process.env['npm_config_user_agent'], installed)} run ${firstTask} --all`
419
+ const steps = [
420
+ ...(inGitWorkTree(root) ? [] : ['git init']),
421
+ ...(empty ? [`declare a task as the example shows`] : []),
422
+ ]
423
+ report.push('', `next: ${steps.length === 0 ? run : `${steps.join(', ')}, then ${run}`}`)
419
424
  process.stdout.write(`${report.join('\n')}\n`)
420
425
  return 0
421
426
  }
422
427
 
428
+ function inGitWorkTree(root: string): boolean {
429
+ try {
430
+ return (
431
+ Bun.spawnSync({
432
+ cmd: [executablePath('git'), 'rev-parse', '--is-inside-work-tree'],
433
+ cwd: root,
434
+ stdout: 'pipe',
435
+ stderr: 'ignore',
436
+ })
437
+ .stdout.toString()
438
+ .trim() === 'true'
439
+ )
440
+ } catch {
441
+ return false
442
+ }
443
+ }
444
+
423
445
  /**
424
446
  * How the user runs vx, for the report's `next:` line. After `npx vx init`
425
447
  * or `bunx @vzn/vx init` a bare `vx` is on no PATH (the first-five-minutes