fix(cf): reject unsupported OpenNext builds before setup #833
LGTM!
[github run](/cloudflare/cf/actions/runs/46277284018)
npm i https://pkg.pr.new/cf@833
_commit: <a href="https://github.com/cloudflare/cf/runs/142804692830"><code>51c7f6f</code></a>_
cf --help startup
| | mean | stddev | min | max |
| --- | --- | --- | --- | --- |
| PR | 179.1 ms | 2.6 ms | 174.9 ms | 185.7 ms |
| base | 179.5 ms | 2.3 ms | 175.5 ms | 183.8 ms |
Δ (PR vs base): — -0.4 ms (-0.2%)
_Measured with hyperfine on ubuntu-latest (3 warmup runs, 20 timed runs). CI numbers carry ±a few ms of runner jitter; treat small deltas as noise._
<!-- Sticky Pull Request Commentcf-startup-bench -->
LGTM!
[github run](/cloudflare/cf/actions/runs/46279874004)
cf migrate still bypasses this guard: commands/migrate/index.ts resolves a Wrangler config and calls runWranglerMigration() directly without analyzing the project or calling assertCfBuildSupported. Consequently, running cf migrate in an OpenNext project can still modify cloudflare.config.ts/package.json, contrary to the new requirement to reject before migration. Add the same preflight immediately after resolving the config path (analyze its directory, then call assertCfBuildSupported when detection succeeds) before bundler detection and runWranglerMigration, with coverage for the explicit command.
Review: 1 findings.
Posted 1 inline finding.
[github run](/cloudflare/cf/actions/runs/46632078243)
Note this test was removed because the latest auto-config now supports hono
Fixed in add19f4df. cf migrate now analyzes the resolved Wrangler config directory and applies the OpenNext guard before bundler detection or migration. The regression test passes a nested config path and verifies the migration never runs. All 20 migration tests and pnpm check passed.
LGTM
[github run](/cloudflare/cf/actions/runs/46678759888)
LGTM
[github run](/cloudflare/cf/actions/runs/46692628674)
petebacondarwin
Closes #807.
Reject unsupported OpenNext builds before automatic setup, migration, or build. The docs point to the vinext migration guide. Explicit static and valid Build Output v1 prebuilt deployments remain available; the existing local dev behavior for configured projects is unchanged.
Uses the published
@cloudflare/autoconfig@0.15.0already onmain. Removal of the undocumented custom build script is tracked separately in cloudflare/workers-sdk#17314 and is not a dependency of this PR.Validation on Node 22: root
pnpm checkand 316 focused tests covering build, dev, init, migration, and deploy.