Skip to content

[autoconfig] Use Vite+ commands for Vite+ projects - #16588

Merged
dario-piotrowicz merged 8 commits into
mainfrom
codex/viteplus-project-defaults
Oct 30, 2026
Merged

dario-piotrowicz merged 8 commits into
mainfrom
codex/viteplus-project-defaults

Conversation

@irvinebroque

@irvinebroque irvinebroque commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

cf dev and cf build use @cloudflare/autoconfig to select the project command. For Vite+ projects, autoconfig currently selects vite or vite build, but Vite+’s Vite alias does not provide a vite executable. That can fail with pnpm or cause npm to download a separate Vite.

When a project declares vite-plus, select the project-local vp dev and vp build commands, 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. In runAutoConfig, 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.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation

Related PRs

Landing order:

  1. [autoconfig] Use Vite+ commands for Vite+ projects #16588 — merge first, then publish the @cloudflare/autoconfig release containing Vite+ command detection.
  2. feat(init): use Vite+ for new Worker projects cf#446 — update @cloudflare/autoconfig to that published release, then merge and publish cf.
  3. [cf] Document Vite+ project defaults cloudflare-docs#34741 — land after the cf release is available, so the documented cf init defaults 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 cf release.

@changeset-bot

changeset-bot Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: faa0e96

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cloudflare/autoconfig Patch

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

ask-bonk[bot]

This comment was marked as resolved.

@ask-bonk

ask-bonk Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

I'm Bonk, and I've done a quick review of your PR.

Adopts Vite+ tooling across bundled Worker starters and autoconfig.

  1. P1: 1 inline suggestion posted.

github run

@pkg-pr-new

pkg-pr-new Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@16588

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@16588

@cloudflare/codemods

npm i https://pkg.pr.new/@cloudflare/codemods@16588

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@16588

@cloudflare/containers-shared

npm i https://pkg.pr.new/@cloudflare/containers-shared@16588

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@16588

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@16588

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@16588

miniflare

npm i https://pkg.pr.new/miniflare@16588

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@16588

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@16588

@cloudflare/runtime-types

npm i https://pkg.pr.new/@cloudflare/runtime-types@16588

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@16588

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@16588

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/@cloudflare/vitest-plugin@16588

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@16588

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@16588

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@16588

wrangler

npm i https://pkg.pr.new/wrangler@16588

commit: faa0e96

@github-project-automation github-project-automation Bot moved this from Untriaged to Done in workers-sdk Oct 29, 2026
@irvinebroque irvinebroque reopened this Oct 29, 2026
@github-project-automation github-project-automation Bot moved this from Done to Untriaged in workers-sdk Oct 29, 2026
@irvinebroque irvinebroque changed the title [create-cloudflare] Adopt Vite+ in bundled Worker starters [autoconfig] Use Vite+ commands for Vite+ projects Oct 29, 2026
@irvinebroque
irvinebroque marked this pull request as ready for review October 29, 2026 23:10
@workers-devprod
workers-devprod requested review from a team and dario-piotrowicz and removed request for a team October 29, 2026 23:10
@workers-devprod

workers-devprod commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

devin-ai-integration[bot]

This comment was marked as resolved.

@clanky-the-clanker

clanky-the-clanker Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

This pull request's reviews are posted as pull request reviews: see the review of faa0e96b.

devin-ai-integration[bot]

This comment was marked as resolved.

@dario-piotrowicz
dario-piotrowicz force-pushed the codex/viteplus-project-defaults branch from 147a75a to faa0e96 Compare October 30, 2026 16:23

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Oct 30, 2026

@clanky-the-clanker clanky-the-clanker Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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

@dario-piotrowicz
dario-piotrowicz merged commit 3f14c76 into main Oct 30, 2026
86 checks passed
@dario-piotrowicz
dario-piotrowicz deleted the codex/viteplus-project-defaults branch October 30, 2026 16:56
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants