{
	"$schema": "node_modules/wrangler/config-schema.json",
	"name": "nucleic-updates",
	"main": "src/index.ts",
	"compatibility_date": "2026-06-01",
	"observability": {
		"enabled": true
	},
	// Bind the same bucket that backs updates.nucleic.blakeslee.xyz, so the Worker reads the channel
	// appcasts directly (no extra network hop, no dependency on the public path being up).
	"r2_buckets": [
		{
			"binding": "UPDATES",
			"bucket_name": "nucleic-updates"
		}
	],
	// Path-scoped routes — NOT a custom_domain. The updates hostname already exists as the R2
	// bucket's custom domain; Worker routes take precedence over that custom domain for matching
	// paths, so only these alias paths hit the Worker. Every other path (appcast-*.xml,
	// Nucleic-*.dmg) keeps being served straight from R2 and stays fully CDN-cacheable.
	// Requires the blakeslee.xyz zone on this account.
	//
	// Four "latest" aliases resolve the newest macOS DMG per channel from the appcast; two
	// "/testflight/<channel>" aliases are static redirects to the iOS TestFlight invite links.
	"routes": [
		{
			"pattern": "updates.nucleic.blakeslee.xyz/canary/latest",
			"zone_name": "blakeslee.xyz"
		},
		{
			"pattern": "updates.nucleic.blakeslee.xyz/beta/latest",
			"zone_name": "blakeslee.xyz"
		},
		{
			"pattern": "updates.nucleic.blakeslee.xyz/rc/latest",
			"zone_name": "blakeslee.xyz"
		},
		{
			"pattern": "updates.nucleic.blakeslee.xyz/stable/latest",
			"zone_name": "blakeslee.xyz"
		},
		{
			"pattern": "updates.nucleic.blakeslee.xyz/testflight/canary",
			"zone_name": "blakeslee.xyz"
		},
		{
			"pattern": "updates.nucleic.blakeslee.xyz/testflight/beta",
			"zone_name": "blakeslee.xyz"
		}
	]
}
