`vpr` is a global-only shim and is unusable in CI (Vercel etc.) — expose it as a package bin or document `vp run` as the CI path
contribution welcome
### Summary
`vpr` (the task-runner shorthand for `vp run`) is only installed as a global shim by `vp env setup` / the install script. It is **not** placed in the project's `node_modules/.bin`, because the `vite-plus` npm package only ships `vp`, `oxfmt`, and `oxlint` bins. As a result, any build/CI environment that does a clean install without the global Vite+ shims — e.g. Vercel's build container — cannot run a `vpr <task>` command and fails with `command not found` (exit 127).
### Environment
- `vite-plus` / `@voidzero-dev/vite-plus-core` `0.1.24`
- Clean dependency install (no global `vp env setup`), e.g. Vercel build image, generic CI runner.
### Reproduction
1. In a project using Vite+ tasks, set the platform build command to `vpr build` (a task defined under `run.tasks` in `vite.config.ts`).
2. Run a clean install + build the way a CI container does (only `node_modules/.bin` on `PATH`, no global Vite+ shim dir).
3. The build fails: `vpr: command not found` (exit 127).
Confirmed against the package contents: `node_modules/vite-plus/package.json` `bin` lists only `oxfmt`, `oxlint`, `vp`; there is no `vpr` entry, and nothing creates `node_modules/.bin/vpr`. `vpr` is implemented in the global CLI crate (`crates/vite_global_cli/src/commands/vpr.rs`) and resolved through global shim dispatch (`crates/vite_global_cli/src/shim/mod.rs`), so it only exists where the global shims were installed.
### Current workaround
Use the `vp run` subcommand, which **is** present in `node_modules/.bin` and runs the same `run.tasks` task:
```
vp run build # works in CI; equivalent to `vpr build`
```
The docs already confirm these are equivalent ("`vpr` is available as a standalone shorthand for `vp run`", `docs/guide/run.md`), and the CI guide's examples all use `vp run`. But the asymmetry isn't called out anywhere, so it's an easy trap when setting a platform's build command to `vpr <task>`.
### Proposed fix (happy to send a PR)
Either or both:
1. **Expose `vpr` as a package bin.** Add a `bin/vpr` entry to the `vite-plus` package alongside the existing `bin/vp`, so `vpr` lands in `node_modules/.bin` on a normal install and behaves identically in CI. (`vp` is already shipped this way as `./bin/vp`.)
2. **Document the limitation.** In `docs/guide/ci` and `docs/guide/run`, explicitly note that `vpr` is a global shim that may be absent in clean CI installs, and that `vp run <task>` is the CI-safe equivalent to use in build commands.
Option 1 removes the foot-gun entirely; option 2 is a cheap stopgap. Happy to open a PR for whichever direction you prefer.
1 条评论