Skip to content

feat(create-vite): support Vite+ (vp) package manager#22788

Draft
fengmk2 wants to merge 1 commit into
vitejs:mainfrom
fengmk2:feat/create-vite-vp-support
Draft

feat(create-vite): support Vite+ (vp) package manager#22788
fengmk2 wants to merge 1 commit into
vitejs:mainfrom
fengmk2:feat/create-vite-vp-support

Conversation

@fengmk2

@fengmk2 fengmk2 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Description

When create-vite is run via vp dlx create-vite (Vite+), it currently falls back to npm commands because the underlying package manager (pnpm/npm/yarn/bun) overwrites npm_config_user_agent, hiding that vp launched it.

This teaches create-vite to recognize vp:

  • Detect vp from a dedicated VP_USER_AGENT env var that vp sets (falls back to npm_config_user_agent as before).
  • getRunCommand emits vp dev; getInstallCommand already yields vp install.
  • getFullCustomCommand maps npm create to vp dlx create- and npm exec to vp dlx (same shape as the existing bun/pnpm/deno branches).

Result: a vp dlx create-vite run finishes with vp install / vp dev, and template custom commands use vp dlx.

Why vp dlx create- and not vp create

npm create X is defined as npm exec create-X, and vp dlx create-X is the exact structural equivalent (dlx = exec), forwarding all positionals and flags straight to the create-* binary. vp create was considered but is unsuitable here: it consumes the target-dir positional itself (uses its own --directory flag), so the TARGET_DIR convention is dropped, and the npm create -- vike@latest --vue TARGET_DIR templates need their template flags after a -- separator that a prefix-only replacement cannot produce. vp create is also a richer, opinionated flow (adds agent/editor/git/hooks setup) rather than a transparent passthrough.

Note

The companion change that makes vp set VP_USER_AGENT ships in the vite-plus repo (voidzero-dev/vite-plus#1958). Until that lands, behavior is unchanged for all existing package managers.

Test

Added a create-vite CLI test asserting that VP_USER_AGENT takes precedence over npm_config_user_agent and produces vp install / vp dev.

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.
@fengmk2

fengmk2 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@sapphi-red sapphi-red added p3-significant High priority enhancement (priority) feat: create-vite create-vite package labels Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: create-vite create-vite package p3-significant High priority enhancement (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants