Repository navigation
feat(create-vite): support Vite+ (vp) package manager - #22788
Merged
Merged
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
fengmk2
added a commit
to voidzero-dev/vite-plus
that referenced
this pull request
Nov 10, 2026
Tools started by `vp` cannot reliably detect Vite+ because package managers replace `npm_config_user_agent`. The global and local `vp`, `vpr`, and `vpx` entry points now set `VP_USER_AGENT=vp/<version>`. Each invocation reports its own version. When the global CLI delegates to a local CLI, the local version takes over. Ordinary tool shims preserve an inherited value without creating one. Child tools can read the first product token to detect Vite+ and allow for future fields. The value identifies the CLI; it does not include command names or arguments. Companion change: vitejs/vite#22788.
Detect Vite+ from the `VP_USER_AGENT` env var that `vp` sets (the underlying package manager overwrites `npm_config_user_agent`), and emit vp commands: `vp install`, `vp dev`, and `vp dlx` for template custom commands.
`vp dev` starts the Vite+ built-in dev server and ignores the project's `dev` script. In a project without a local `vite-plus`, it also uses the Vite that the global Vite+ toolchain bundles, not the installed `vite`. Use `vp run dev` so the `dev` script runs, like `npm run dev`. Also fall back to `npm_config_user_agent` when `VP_USER_AGENT` is empty, and let the test helper pass env overrides again after the move to `tinyexec`, so the Vite+ test sets `VP_USER_AGENT`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fengmk2
force-pushed
the
feat/create-vite-vp-support
branch
from
November 12, 2026 16:41
81caa05 to
6efb33d
Compare
fengmk2
marked this pull request as ready for review
November 12, 2026 16:48
Contributor
Author
|
@sapphi-red ready now! |
sapphi-red
approved these changes
Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When
create-viteruns throughvp dlx create-vite(Vite+), it falls back tonpmcommands. The underlying package manager (pnpm/npm/yarn/bun) overwritesnpm_config_user_agent, socreate-vitecannot see thatvpstarted it.Since vite-plus v1.6.0 (voidzero-dev/vite-plus#1958),
vp,vpr, andvpxsetVP_USER_AGENT=vp/<version>for child processes. This PR teachescreate-viteto read it:VP_USER_AGENT. When it is unset or empty, usenpm_config_user_agentas before.--immediateusevp installandvp run dev.getFullCustomCommandmapsnpm createtovp dlx create-andnpm exectovp dlx, the same shape as the bun/pnpm/deno branches.custom-create-vuevp dlx create-vue@latest TARGET_DIRcustom-vike-vuevp dlx create-vike@latest --vue TARGET_DIRcustom-nuxtvp dlx nuxi init TARGET_DIRember-appvp dlx ember-cli@latest new TARGET_DIRWhy
vp run devand notvp devvp devis a Vite+ built-in command. It starts the Vite+ dev server and ignores thedevscript inpackage.json. A scaffolded project has no localvite-plus, sovp devuses the Vite that the global Vite+ toolchain bundles (vite@8.3.7in vite-plus 1.6.0), not thevitethat the project installs (vite@8.3.8today).vp run devruns thedevscript with the installedvite, the same asnpm run dev.Why
vp dlx create-and notvp createnpm create Xis defined asnpm exec create-X, andvp dlx create-Xis the structural equivalent (dlx=exec). It passes all positionals and flags to thecreate-*binary.vp createconsumes the target-dir positional itself (it uses its own--directoryflag), so theTARGET_DIRconvention breaks. Thenpm create -- vike@latest --vue TARGET_DIRtemplates also need their flags after a--separator that a prefix-only replacement cannot produce.vp createis also an opinionated flow (agent/editor/git/hooks setup), not a transparent passthrough.🤖 Generated with Claude Code