[wrangler] Expand auto-config deploy flows to support express.js, index.html, containers#14554
[wrangler] Expand auto-config deploy flows to support express.js, index.html, containers#14554irvinebroque wants to merge 12 commits into
Conversation
🦋 Changeset detectedLatest commit: d4443fc The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
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 |
|
✅ All changesets look good |
@cloudflare/autoconfig
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
There was a problem hiding this comment.
I'm Bonk, and I've done a quick review of your PR.
Summary: Expands auto-config to more project shapes (Express, single-file HTML, static apps, Dockerfile containers), adds structured container/auto-config fields to deploy output, and refines container build/deploy diagnostics.
The code changes look solid and well-tested. The one clearly actionable item is unrelated development artifacts committed to the repo:
1. (High) Internal planning docs committed to repo root
Three AI/development planning documents totaling ~2,191 lines are committed at the repository root:
auto-config-expansion-plan.md(1,433 lines)auto-config-live-deploy-findings.md(482 lines)auto-config-live-issue-fix-plan.md(276 lines)
These are internal working notes (e.g. "fixes implemented locally; targeted tests ... still pending", dated status lines) and should not ship in the repo. Please remove all three from the PR (or relocate to an untracked scratch location). They aren't referenced by any code or build.
2. (Low, non-blocking) Inconsistent default instance state in instances.ts
In rowsToJsonOutput the no-instance fallback state is "unknown" (line 160), but hasActionableInstanceState uses "inactive" (line 174) for the same case. Neither value triggers the diagnostic hint, so there is no functional bug, but the two fallbacks should match to avoid confusion for future readers.
Everything else — the container deploy result plumbing, tryFindRemoteManifestDigest refactor (behavior-preserving), the no-write temp-dir cleanup in finally, and the .wrangler/** asset ignore — looks correct and is covered by tests.
|
Review posted to PR #14554. Summary of what I found: Actionable:
Verified as correct:
|
What Users Can Now Do
Deploy a standalone HTML file without creating project files:
For a named file, Wrangler serves it as both
/and its original filename:Uploads assets like:
{ "/index.html": { "hash": "...", "size": 20 }, "/landing.html": { "hash": "...", "size": 20 } }Deploy an explicit static folder through the default no-write path:
Example folder:
Wrangler deploys it as static assets without writing
wrangler.jsonc.Deploy a static app directory, such as a Vite app, directly:
Example app:
{ "scripts": { "build": "vite build" }, "devDependencies": { "vite": "7.0.0" } }Wrangler detects the app, runs the build, verifies
dist/index.html, and deploysdist.Deploy an Express-style Node server directly:
Input:
Wrangler generates something equivalent to:
And creates config like:
{ "$schema": "node_modules/wrangler/config-schema.json", "name": "express-app", "main": "src/worker.js", "compatibility_date": "2026-07-04", "compatibility_flags": ["nodejs_compat"], "observability": { "enabled": true } }For TypeScript Express-style apps, Wrangler generates
src/worker.ts:Set up Dockerfile-backed Containers projects non-interactively:
Example Dockerfile:
Wrangler generates:
{ "$schema": "node_modules/wrangler/config-schema.json", "name": "container-project", "main": "src/worker.js", "compatibility_date": "2026-07-04", "observability": { "enabled": true }, "containers": [ { "name": "container-project", "class_name": "AppContainer", "image": "./Dockerfile", "max_instances": 1 } ], "durable_objects": { "bindings": [ { "name": "APP_CONTAINER", "class_name": "AppContainer" } ] }, "migrations": [ { "tag": "v1", "new_sqlite_classes": ["AppContainer"] } ] }Generated Worker:
Deploy an explicit Dockerfile target in CI-style flows:
Nested targets, such as
services/api/Dockerfile, use the Dockerfile's directory as the project root. Barewrangler deploycan also fall back to a root Dockerfile when no stronger project detection applies.After a Containers project is configured, use plain deploy:
If you accidentally run this:
Wrangler now gives targeted guidance instead of treating
Dockerfileas a Worker entrypoint.Use output files for automation with richer deployment data:
Autoconfig entry:
{ "type": "autoconfig", "version": 1, "command": "deploy", "summary": { "adapterId": "single-file-site", "projectKind": "single-file-site", "deployMode": "no-write", "sourceCategory": "html-file" } }Deploy entry:
{ "type": "deploy", "version": 1, "worker_name": "my-site", "auto_config_adapter_id": "single-file-site", "auto_config_project_kind": "single-file-site", "auto_config_deploy_mode": "no-write", "auto_config_source_category": "html-file", "live_url": "https://my-site.example.workers.dev" }Container deploy output now includes app changes:
{ "type": "deploy", "version": 1, "containers_rollout": "gradual", "containers": [ { "name": "my-container", "application_id": "app-id", "action": "created", "image": "registry.cloudflare.com/account/my-container@sha256:...", "image_digest": "sha256:..." } ] }Check container health/details more directly:
Now includes:
[ { "id": "app-id", "name": "my-container", "state": "active", "instances": 1, "health": { "instances": { "active": 1, "failed": 0, "starting": 0, "scheduling": 0 } }, "image": "registry.cloudflare.com/...", "version": 3, "updated_at": "2026-07-04T00:00:00Z", "created_at": "2026-07-04T00:00:00Z" } ]Inspect placement status:
Now includes:
[ { "id": "instance-id", "state": "running", "status": { "health": "running", "container_status": "running" }, "location": "sfo06", "version": 3, "created": "2026-07-04T00:00:00Z" } ]If instances are stopped or unhealthy, normal table output now nudges you toward:
Internal Changes
Autoconfig now has an explicit deploy-intent model:
Wrangler computes that intent before autoconfig:
Autoconfig checks explicit/high-confidence project adapters before framework detection:
Root Dockerfile fallback is evaluated later, after stronger framework/static detection has had a chance to match.
Adapters return configuration plans instead of pretending everything is a framework:
Single-file HTML is represented as a no-write plan:
Express is represented as a persistent plan:
Dockerfile Containers are represented as a persistent plan:
runAutoConfig()now branches into framework config or adapter config:Adapter execution handles generated files safely:
No-write deployment preparation mutates deploy args instead of writing config:
Persistent explicit-target autoconfig clears the original target after generating config:
Container deploy now returns data instead of only printing:
Wrangler maps that into output-file shape:
Deploy helpers print readiness guidance based on returned results:
Docker manifest preflight is now quiet unless debug logging is enabled:
Asset manifests now exclude Wrangler-generated output/temp files:
And root
.wranglerfiles are ignored by default: