Try it
This is vx’s own planner, running in your page on four small packages.
Edit a file, the environment or a config, press Run, and read which tasks would run and why.
env
vx run--all
| Task | Key | Cache | Key moved |
|---|
packages/utils/vx.config.mjs
import { defineProject } from '@vzn/vx'
export default defineProject({
tasks: {
build: {
dependsOn: ['^build'],
exec: { command: 'tsc -b' },
cache: {
inputs: { files: ['src/**'] },
outputs: { files: ['dist/**'] },
},
},
test: {
dependsOn: ['build'],
exec: { command: 'bun test' },
cache: {
inputs: { files: ['src/**', 'test/**'] },
outputs: { files: [] },
},
},
},
})
packages/ui/vx.config.mjs
import { defineProject } from '@vzn/vx'
export default defineProject({
tasks: {
build: {
dependsOn: ['^build'],
exec: { command: 'vite build' },
cache: {
inputs: { files: ['src/**'] },
outputs: { files: ['dist/**'] },
},
},
test: {
dependsOn: ['build'],
exec: { command: 'bun test' },
cache: {
inputs: { files: ['src/**', 'test/**'] },
outputs: { files: [] },
},
},
},
})
packages/api/vx.config.mjs
import { defineProject } from '@vzn/vx'
export default defineProject({
tasks: {
build: {
dependsOn: ['^build'],
exec: { command: 'bun build src/server.ts --outdir dist' },
cache: {
inputs: { files: ['src/**'], env: ['API_URL'] },
outputs: { files: ['dist/**'] },
},
},
test: {
dependsOn: ['build'],
exec: { command: 'bun test' },
cache: {
inputs: { files: ['src/**', 'test/**'] },
outputs: { files: [] },
},
},
},
})
packages/app/vx.config.mjs
import { defineProject } from '@vzn/vx'
export default defineProject({
tasks: {
build: {
dependsOn: ['^build'],
exec: { command: 'vite build' },
cache: {
inputs: { files: ['src/**'] },
outputs: { files: ['dist/**'] },
},
},
test: {
dependsOn: ['build'],
exec: { command: 'bun test' },
cache: {
inputs: { files: ['src/**', 'test/**'] },
outputs: { files: [] },
},
},
docs: {
exec: { command: 'astro build --root docs' },
cache: {
inputs: { files: ['docs/src/**'] },
outputs: { files: ['docs/dist/**'] },
},
},
},
})
| Task | Waits for | Inputs |
|---|---|---|
| utils#build | nothing | src/** |
| utils#test | utils#build | src/**, test/** |
| ui#build | utils#build | src/** |
| ui#test | ui#build | src/**, test/** |
| api#build | utils#build | src/**, env API_URL |
| api#test | api#build | src/**, test/** |
| app#build | ui#build, api#build | src/** |
| app#test | app#build | src/**, test/** |
The planner plans: it runs no command and writes no file.
On your own repository, after the quickstart, the same plan is one command:
vx run build test --all --dry