@vzn/vx 0.0.636 → 0.0.638
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 +39 -11
- package/docs/caching.md +246 -213
- package/docs/cli.md +791 -705
- package/docs/execution.md +68 -76
- package/docs/features.md +47 -42
- package/docs/patterns.md +26 -25
- package/docs/schema.md +392 -205
- package/docs/security.md +76 -39
- package/launcher.sh +43 -0
- package/package.json +5 -5
- package/schemas/cache.json +41 -19
- package/schemas/info.json +23 -11
- package/schemas/last.json +48 -2
- package/schemas/lock.json +1 -1
- package/schemas/plan.json +4 -4
- package/schemas/show.json +5 -3
- package/schemas/why.json +15 -1
- package/skills/vx/SKILL.md +28 -13
- package/src/bin.ts +30 -9
- package/src/cache/archive.ts +11 -0
- package/src/cache/cache.ts +124 -53
- package/src/cache/chained-cache.ts +4 -0
- package/src/cache/git-inputs.ts +277 -63
- package/src/cache/index.ts +15 -1
- package/src/cache/inputs.ts +102 -36
- package/src/cache/key-fold.ts +8 -7
- package/src/cache/layer.ts +15 -18
- package/src/cache/layered-cache.ts +20 -102
- package/src/cache/plugin-cache.ts +248 -0
- package/src/cache/policy.ts +32 -27
- package/src/cache/run-history.ts +104 -14
- package/src/cache/run-store.ts +77 -0
- package/src/cache/schema.ts +58 -31
- package/src/cache/scoped-cache.ts +237 -0
- package/src/cli/cache.ts +173 -34
- package/src/cli/completions.ts +11 -7
- package/src/cli/core-alias.ts +1 -1
- package/src/cli/foreign-flags.ts +13 -12
- package/src/cli/help.ts +110 -70
- package/src/cli/index.ts +67 -24
- package/src/cli/info.ts +43 -27
- package/src/cli/init.ts +115 -407
- package/src/cli/last.ts +157 -9
- package/src/cli/lock.ts +356 -122
- package/src/cli/plan-format.ts +7 -5
- package/src/cli/plugin-commands.ts +81 -14
- package/src/cli/plugin-templates.ts +11 -11
- package/src/cli/run.ts +116 -160
- package/src/cli/select.ts +50 -47
- package/src/cli/show.ts +83 -59
- package/src/cli/task-verb.ts +6 -13
- package/src/cli/upgrade.ts +415 -149
- package/src/cli/watch-cycle.ts +9 -2
- package/src/cli/watch-filter.ts +39 -61
- package/src/cli/watch-fs.ts +29 -16
- package/src/cli/watch-judge.ts +18 -4
- package/src/cli/watch-set.ts +16 -42
- package/src/cli/watch.ts +227 -230
- package/src/cli/why.ts +38 -18
- package/src/cli/workspace-config.ts +33 -70
- package/src/config.ts +169 -70
- package/src/exec/env.ts +1 -31
- package/src/exec/executor.ts +1 -5
- package/src/exec/kill-tree.ts +2 -1
- package/src/exec/sandbox-runtime.ts +12 -1
- package/src/exec/sandbox-violations.ts +9 -1
- package/src/graph/dependency-spec.ts +1 -1
- package/src/graph/index.ts +1 -0
- package/src/graph/priorities.ts +1 -1
- package/src/graph/scheduler.ts +27 -7
- package/src/graph/task-graph.ts +76 -24
- package/src/handoff.ts +169 -0
- package/src/index.ts +35 -58
- package/src/orchestrator/affected-tasks.ts +15 -8
- package/src/orchestrator/command-windows.ts +44 -0
- package/src/orchestrator/deferred-outputs.ts +12 -10
- package/src/orchestrator/doctor.ts +98 -110
- package/src/orchestrator/download-policy.ts +3 -3
- package/src/orchestrator/events.ts +19 -3
- package/src/orchestrator/excluded-keys.ts +0 -2
- package/src/orchestrator/execute-task.ts +147 -69
- package/src/orchestrator/failure-mode.ts +19 -10
- package/src/orchestrator/fingerprint-watch.ts +18 -15
- package/src/orchestrator/forecast.ts +10 -2
- package/src/orchestrator/framed-output.ts +9 -5
- package/src/orchestrator/graph-stage.ts +5 -5
- package/src/orchestrator/history.ts +126 -30
- package/src/orchestrator/hit-restore.ts +15 -3
- package/src/orchestrator/index.ts +20 -5
- package/src/orchestrator/local-shortcircuit.ts +2 -1
- package/src/orchestrator/lockfile-claim.ts +79 -20
- package/src/orchestrator/logger.ts +80 -41
- package/src/orchestrator/metrics.ts +78 -9
- package/src/orchestrator/miss-save.ts +3 -0
- package/src/orchestrator/options.ts +42 -29
- package/src/orchestrator/output-host.ts +72 -0
- package/src/orchestrator/plan.ts +6 -8
- package/src/orchestrator/plugin-host.ts +100 -66
- package/src/orchestrator/plugin.ts +173 -67
- package/src/orchestrator/prepare.ts +163 -78
- package/src/orchestrator/projects.ts +105 -99
- package/src/orchestrator/remote-prefetch.ts +11 -6
- package/src/orchestrator/run-context.ts +25 -6
- package/src/orchestrator/run-failures.ts +17 -8
- package/src/orchestrator/run-lock.ts +1 -1
- package/src/orchestrator/run-records.ts +1 -1
- package/src/orchestrator/run-report.ts +9 -9
- package/src/orchestrator/run-settings.ts +48 -0
- package/src/orchestrator/run.ts +244 -119
- package/src/orchestrator/sandbox-fix.ts +39 -20
- package/src/orchestrator/sandbox-request.ts +84 -13
- package/src/orchestrator/signals.ts +1 -1
- package/src/orchestrator/stable-keys.ts +13 -11
- package/src/orchestrator/status-line.ts +49 -7
- package/src/orchestrator/summary.ts +115 -106
- package/src/orchestrator/task-hash.ts +12 -83
- package/src/orchestrator/telemetry.ts +4 -4
- package/src/settings.ts +428 -0
- package/src/{orchestrator → util}/colors.ts +5 -0
- package/src/util/config-frame.ts +31 -2
- package/src/util/errors.ts +33 -1
- package/src/util/essential-env.ts +31 -0
- package/src/util/hide-env.ts +107 -0
- package/src/util/index.ts +16 -3
- package/src/util/paths.ts +10 -0
- package/src/util/refusal-notice.ts +111 -0
- package/src/util/report.ts +31 -0
- package/src/util/settle.ts +49 -30
- package/src/util/size.ts +23 -4
- package/src/util/timing.ts +3 -2
- package/src/util/ui.ts +186 -0
- package/src/util/ulid.ts +1 -1
- package/src/util/verbs.ts +0 -15
- package/src/workspace/affected.ts +84 -232
- package/src/workspace/config-eval.ts +15 -20
- package/src/workspace/config-imports.ts +78 -3
- package/src/workspace/config-schema.ts +209 -268
- package/src/workspace/dependency-rules.ts +65 -0
- package/src/workspace/filter.ts +2 -2
- package/src/workspace/fingerprint.ts +11 -121
- package/src/workspace/index.ts +20 -27
- package/src/workspace/load-reads.ts +4 -4
- package/src/workspace/lockfile.ts +96 -140
- package/src/workspace/migration.ts +307 -215
- package/src/workspace/package-graph.ts +30 -216
- package/src/workspace/project-loader.ts +80 -285
- package/src/workspace/repo-id.ts +2 -1
- package/src/workspace/workspace.ts +363 -831
- package/src/cache/config-evals.ts +0 -130
- package/src/workspace/config-cache.ts +0 -661
- package/src/workspace/migrate-scripts.ts +0 -1121
package/README.md
CHANGED
|
@@ -38,10 +38,23 @@ Windows: run vx inside WSL2.
|
|
|
38
38
|
In a git repo with a `package.json` workspace:
|
|
39
39
|
|
|
40
40
|
```sh
|
|
41
|
-
|
|
41
|
+
npm install -D @vzn/vx # the scope matters: npm's `vx` is an unrelated package
|
|
42
|
+
npx @vzn/vx init # beside turbo.json or nx.json: migrates them; else a vx.config.ts per package
|
|
43
|
+
npx @vzn/vx run build --all # builds in dependency order and stores the results
|
|
44
|
+
npx @vzn/vx run build --all # nothing changed: every task up-to-date
|
|
42
45
|
```
|
|
43
46
|
|
|
44
|
-
|
|
47
|
+
Bun workspaces: `bun add -d @vzn/vx` and `bunx @vzn/vx` (npm refuses to run in
|
|
48
|
+
a repo whose `devEngines` names Bun).
|
|
49
|
+
|
|
50
|
+
Without Turbo or Nx, tasks run uncached until you declare what they read (below).
|
|
51
|
+
|
|
52
|
+
`init` prints what it wrote and anything left to decide (a `TODO`). A miss you did not expect?
|
|
53
|
+
`npx @vzn/vx why <task>` names the input that moved.
|
|
54
|
+
|
|
55
|
+
### Without Turbo or Nx
|
|
56
|
+
|
|
57
|
+
`init` writes one task per package script, uncached. Cache one by saying what it reads and writes:
|
|
45
58
|
|
|
46
59
|
```ts
|
|
47
60
|
// packages/app/vx.config.ts
|
|
@@ -62,15 +75,31 @@ export default defineProject({
|
|
|
62
75
|
```
|
|
63
76
|
|
|
64
77
|
```sh
|
|
65
|
-
npx vx run build --all # builds, in dependency order; stores the results
|
|
66
|
-
npx vx run build --all # nothing changed: up-to-date, in milliseconds
|
|
78
|
+
npx @vzn/vx run build --all # builds, in dependency order; stores the results
|
|
79
|
+
npx @vzn/vx run build --all # nothing changed: up-to-date, in milliseconds
|
|
67
80
|
rm -rf packages/*/dist
|
|
68
|
-
npx vx run build --all # restored from the cache, not rebuilt
|
|
81
|
+
npx @vzn/vx run build --all # restored from the cache, not rebuilt
|
|
69
82
|
```
|
|
70
83
|
|
|
71
84
|
<img src="https://vznjs.github.io/vx/demo.svg" width="760" alt="vx run ci --all on examples/basic: cold, three tasks run; again, three up-to-date.">
|
|
72
85
|
|
|
73
|
-
|
|
86
|
+
### When to run `vx lock`
|
|
87
|
+
|
|
88
|
+
`init` also writes `.vx/projects.lock.json`, every project's config as it evaluated.
|
|
89
|
+
Commit it. Every run reads its configs from the lock, so run
|
|
90
|
+
`npx @vzn/vx lock` and commit the lock again after you:
|
|
91
|
+
|
|
92
|
+
- edit any `vx.config.ts` or `.vx/workspace.ts`,
|
|
93
|
+
- update dependencies or plugins,
|
|
94
|
+
- change a file a config imports.
|
|
95
|
+
|
|
96
|
+
Otherwise runs keep the old configs. On CI, `vx lock --check` fails a
|
|
97
|
+
stale lock before any task runs.
|
|
98
|
+
|
|
99
|
+
Starters: [`examples/basic`](examples/basic), and
|
|
100
|
+
[`examples/ci`](examples/ci) with a GitHub Actions workflow; CI runs both
|
|
101
|
+
on every commit. The [CI guide](https://vznjs.github.io/vx/guides/ci/)
|
|
102
|
+
explains the workflow.
|
|
74
103
|
More: [Quickstart](https://vznjs.github.io/vx/quickstart/) ·
|
|
75
104
|
[Configure](https://vznjs.github.io/vx/guides/configure/) ·
|
|
76
105
|
[CLI](packages/vx/docs/cli.md) · [every config field](packages/vx/docs/schema.md) ·
|
|
@@ -84,13 +113,13 @@ More: [Quickstart](https://vznjs.github.io/vx/quickstart/) ·
|
|
|
84
113
|
- **Sandboxed tasks:** opt in per task; a workspace file the task did
|
|
85
114
|
not declare is out of its reach, so it cannot poison the cache.
|
|
86
115
|
- **Clean exits:** Ctrl-C reaps each task's process group.
|
|
87
|
-
- **Plugins at every stage** (
|
|
116
|
+
- **Plugins at every stage** (15 hooks, `commands` included): remote cache, remote execution, telemetry,
|
|
88
117
|
CLI verbs. Core ships none and needs none.
|
|
89
118
|
- **Free:** MIT. No paywall, no cloud, no account.
|
|
90
119
|
|
|
91
120
|
## Plugins
|
|
92
121
|
|
|
93
|
-
What vx can do, not what it is limited to. Declared in
|
|
122
|
+
What vx can do, not what it is limited to. Declared in `.vx/workspace.ts`; without any, vx runs and caches locally.
|
|
94
123
|
|
|
95
124
|
| Package | What it adds |
|
|
96
125
|
| ---------------------------------------------------------- | ----------------------------------------------------------------------------- |
|
|
@@ -99,7 +128,6 @@ What vx can do, not what it is limited to. Declared in `vx.workspace.ts`; withou
|
|
|
99
128
|
| [`@vzn/vx-lockfile`](packages/vx-lockfile) | Key each project on its own lockfile slice: pnpm, bun, npm, yarn |
|
|
100
129
|
| [`@vzn/vx-otel`](packages/vx-otel) | OpenTelemetry traces, metrics and logs, no SDK |
|
|
101
130
|
| [`@vzn/vx-ci`](packages/vx-ci) | GitHub Actions job summary and Checks API |
|
|
102
|
-
| [`@vzn/vx-mcp`](packages/vx-mcp) | `vx mcp`: an MCP server for AI coding agents that also runs tasks |
|
|
103
131
|
| [`@vzn/vx-schedule-history`](packages/vx-schedule-history) | Schedule by the critical path learned from past runs |
|
|
104
132
|
|
|
105
133
|
Write your own: [plugin guide](https://vznjs.github.io/vx/guides/plugins/) ·
|
|
@@ -107,10 +135,10 @@ Write your own: [plugin guide](https://vznjs.github.io/vx/guides/plugins/) ·
|
|
|
107
135
|
|
|
108
136
|
## Coming from Turbo or Nx
|
|
109
137
|
|
|
110
|
-
Beside `turbo.json` or `nx.json`, `npx vx init` runs `@vzn/vx-migrate`:
|
|
138
|
+
Beside `turbo.json` or `nx.json`, `npx @vzn/vx init` runs `@vzn/vx-migrate`:
|
|
111
139
|
it writes a `vx.config.ts` per package from `turbo.json` or the Nx graph,
|
|
112
140
|
and you keep those and delete the old config. `vx init --keep` writes only
|
|
113
|
-
a
|
|
141
|
+
a `.vx/workspace.ts` that maps the old config instead, and its lock: a temporary start,
|
|
114
142
|
not a way to run the repo. The benchmark below uses native vx config.
|
|
115
143
|
[Migration guide](https://vznjs.github.io/vx/guides/migrate/).
|
|
116
144
|
|