DEV Community

Cover image for A key with nothing to run
VX
VX

Posted on Edited on Originally published at vznjs.github.io

A key with nothing to run

Test fixtures change, but no command builds them. Give them a task with
inputs and no command, and test runs again when a fixture changes.

import { defineProject } from '@vzn/vx/config'

export default defineProject({
  tasks: {
    fixtures: { inputs: { files: ['fixtures/**'] } },
    test: {
      exec: { command: 'bun test' },
      dependsOn: ['fixtures'],
      inputs: { files: ['src/**'] },
      cache: { outputs: { files: [] } },
    },
  },
})
Enter fullscreen mode Exit fullscreen mode
$ vx run packages/b#test
  tasks     1 success · 1 total
  cache     local 1✓

$ echo '{"user":"grace"}' > fixtures/user.json
$ vx run packages/b#test
  tasks     1 success · 1 total
  cache     local 1↑

$ echo "# readme" > README.md
$ vx run packages/b#test
  tasks     1 success · 1 total
  cache     local 1✓
Enter fullscreen mode Exit fullscreen mode

A fixture edit runs test again (1↑: ran and saved). A README edit
is a cache hit. It says 1 total because fixtures started no process.

Linux x64 · vx 69617eb · 2026-10-23

How the key flows

diagram

We call this a keyed group: inputs with no exec. It takes no
cache, because it writes nothing. --affected follows it like any
other dependency.

Migrations use it too

Nx keys a task on its dependencies' production files even with no task
edge between them. Turbo hashes a transit node per package.
@vzn/vx-migrate writes each as a keyed group, with no processes.

On TanStack/query, vx run build counts 25 tasks, as Nx does.

More at vznjs.github.io/vx.


Originally published on the vx blog. vx is open-source (MIT) task orchestration with a build cache: vznjs.github.io/vx · GitHub.

Written with AI assistance.

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.