DEV Community

Cover image for Brackets in a glob mean brackets
VX
VX

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

Brackets in a glob mean brackets

In a vx glob, [jt] matches one character, j or t. A Next.js route
folder like app/[id] needs escaping.

Glob Matches
src/*.[jt]s .js and .ts files in src
app/[id]/** app/i/**, app/d/**
app/\[id\]/** the app/[id]/ folder

Turbo, Nx and shells read brackets the same way. A glob you copy from
turbo.json or an Nx project means the same thing in vx.config.ts.

See it in a run

route: {
  exec: { command: 'ls src app/*' },
  inputs: { files: ['src/*.[jt]s', 'app/\\[id\\]/**'] },
  outputs: { files: [] },
  cache: true,
}
Enter fullscreen mode Exit fullscreen mode

The double backslash is the escape inside a TypeScript string.

$ echo "// e" >> app/i/x.ts          # not an input
$ vx run packages/c#route
  cache     local 1✓

$ echo "// e" >> 'app/[id]/page.ts'  # the escaped route
$ vx run packages/c#route
  cache     local 1↑

$ echo "// e" >> src/j.js            # matched by [jt]
$ vx run packages/c#route
  cache     local 1↑
Enter fullscreen mode Exit fullscreen mode

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

An edit to an input runs the task again (1↑). Any other edit is a
cache hit (1✓). @vzn/vx-migrate keeps Turbo's and Nx's brackets as
they are, and escapes brackets in any path it writes.

Glob rules: Caching. 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)