Repository navigation
[autoconfig] Use Vite+ commands for Vite+ projects - #16588
Conversation
🦋 Changeset detectedLatest commit: faa0e96 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
I'm Bonk, and I've done a quick review of your PR. Adopts Vite+ tooling across bundled Worker starters and autoconfig.
|
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/codemods
@cloudflare/config
@cloudflare/containers-shared
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/runtime-types
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-plugin
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
|
Codeowners approval required for this PR:
Show detailed file reviewers |
|
This pull request's reviews are posted as pull request reviews: see the review of |
147a75a to
faa0e96
Compare
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
There was a problem hiding this comment.
✅ Approved — No issues found. Vite+ projects get vp dev/vp build, and other commands and custom shell build commands keep their existing behavior. Tests cover both.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
🔒 Security: ✅ LGTM
Commands are matched against a fixed allowlist and replaced with fixed strings that carry only the package manager's runner prefix. No text from the project is inserted into a command.
📖 AGENTS.md: ✅ LGTM
Follows the repository conventions: JSDoc on the exported function, tests, and a changeset.
📋 Code Quality: ✅ LGTM
getProjectCommand checks for vite-plus before the existing prefix logic, and its JSDoc now documents the new packageJson parameter. The build-override normalization in run.ts is limited to the exact Vite build command.
⚡ Performance: ✅ LGTM
No performance concerns.
📝 Documentation: ✅ LGTM
The changeset is a correctly scoped patch for @cloudflare/autoconfig.
Reviewed commit: faa0e96b
cf devandcf builduse@cloudflare/autoconfigto select the project command. For Vite+ projects, autoconfig currently selectsviteorvite build, but Vite+’s Vite alias does not provide aviteexecutable. That can fail with pnpm or cause npm to download a separate Vite.When a project declares
vite-plus, select the project-localvp devandvp buildcommands, including Vite commands selected by framework overrides such as vinext. Preserve other framework commands and custom package scripts. Normal detected framework commands keep their package-manager prefixes; manually supplied shell commands retain the base branch's behavior. InrunAutoConfig, only the recognized Vite build command is normalized after selecting a framework override.This PR is limited to autoconfig command detection, regression tests, and a patch changeset. It does not change create-cloudflare, starter templates, dependencies, or CI. It supplies the upstream fix required by cloudflare/cf#446, which must consume the released autoconfig package before merging.
Validation: all 283 autoconfig tests and all 30 Wrangler autoconfig integration tests pass, including Vite+ command tests for npm, pnpm, Yarn, and Bun runners, plus Next.js 16 vinext cases and raw custom build commands with and without Vite+. Package type checking and lint/format checks on the changed files pass.
Related PRs
Landing order:
@cloudflare/autoconfigrelease containing Vite+ command detection.@cloudflare/autoconfigto that published release, then merge and publishcf.cfrelease is available, so the documentedcf initdefaults match the released CLI.Independent: cloudflare/templates#1176 can land at any point. Its starters invoke Vite+ directly and do not depend on the autoconfig change or a new
cfrelease.