Skip to content
GitHubRSS

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.

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/**'] },
      },
    },
  },
})
vx run build test --all plans:
TaskWaits forInputs
utils#buildnothingsrc/**
utils#testutils#buildsrc/**, test/**
ui#buildutils#buildsrc/**
ui#testui#buildsrc/**, test/**
api#buildutils#buildsrc/**, env API_URL
api#testapi#buildsrc/**, test/**
app#buildui#build, api#buildsrc/**
app#testapp#buildsrc/**, test/**
vx's own planner, in your browser. It plans and runs nothing. A test holds its keys to the CLI's.

The planner plans: it runs no command and writes no file.

On your own repository, after the quickstart, the same plan is one command:

Terminal window
vx run build test --all --dry