Brackets in a glob mean brackets
Brackets in a glob mean brackets
In a vx glob, [jt] matches one character, as in Turbo, Nx and your shell. A Next.js route folder like app/[id] needs escaping.
One command turns package.json scripts or Vite Task config into vx tasks. npm pre and post hooks keep their order.
bunx @vzn/vx-migrate turns your package.json scripts or Vite Task
config into vx tasks. (Coming from Turbo or
Nx? They have their own posts.)
flowchart LR P[package.json scripts] --> M[bunx @vzn/vx-migrate] V["vite.config.* run.tasks"] --> M M --> C[vx.config.ts per package] M --> T[TODO list: inputs and outputs to fill in]
npm calls prebuild before build and postbuild after it. The
migrator puts the hooks into the task’s command, in that order, and
tells you:
$ cat packages/app/package.json{"name":"app","scripts":{"prebuild":"rimraf dist","build":"vite build","postbuild":"node scripts/copy.js"}}
$ bunx @vzn/vx-migrate --dry
─ vx-migrate 0.0.637 ───────────────────────────────────────── from package.json scripts dry run nothing written tasks 1 todo todo app#build: npm ran `prebuild` and `postbuild` around this script without being asked; folded into the command in that order app#build: cache: add `inputs: { files: ['**'] }, outputs: { files: ['dist/**'] }, cache: true` with this package's real outputs, and narrow the inputs to what it reads …The && list stops at the first part that fails. Arguments after -- reach
build only, as with npm.
If your package manager skips these hooks (Yarn 2+, or npm with
ignore-scripts), each hook stays its own task. Hooks like prepack
never become tasks.
A vite-plus repo keeps tasks in each package’s vite.config.* under
run. The migrator reads them the way vp run does:
$ bunx @vzn/vx-migrate --from vite-taskcommand, cwd, dependsOn and cache settings map across. A command
starting with vp run x becomes a dependsOn edge.
Anything that does not map stays in the command with a TODO, so nothing gets lost.
The full mapping table is in the vx-migrate README. More at vznjs.github.io/vx.