Skip to content

Comments

Setup Cloudflare Workers deployment via EdgeZero#23

Merged
aram356 merged 13 commits intomainfrom
22-as-developer-i-want-to-be-able-to-deploy-mocktioneer-on-cloudflare
Feb 11, 2026
Merged

Setup Cloudflare Workers deployment via EdgeZero#23
aram356 merged 13 commits intomainfrom
22-as-developer-i-want-to-be-able-to-deploy-mocktioneer-on-cloudflare

Conversation

@prk-Jr
Copy link
Contributor

@prk-Jr prk-Jr commented Jan 28, 2026

Summary

Adds Cloudflare Workers deployment support for Mocktioneer via EdgeZero, enabling the mock auction server to run as a WASM-based Cloudflare Worker alongside the existing Axum and Fastly adapters.

Cloudflare Adapter Changes

  • Add lib.rs with #[event(fetch)] handler for WASM target, separating the WASM entry point from the native main.rs stub
  • Configure cdylib + rlib crate type in Cargo.toml for worker-build compatibility
  • Update dependency wiring: make edgezero-adapter-cloudflare non-optional, use feature forwarding (edgezero-adapter-cloudflare/cloudflare) instead of dep: syntax
  • Add edgezero-core dependency
  • Update Cloudflare commands in edgezero.toml to use wrangler build/dev/deploy --cwd instead of raw cargo/wrangler with --config

Fastly Adapter Alignment

  • Switch feature activation to use feature forwarding (edgezero-adapter-fastly/fastly) instead of dep: syntax
  • Make edgezero-adapter-fastly non-optional
  • Set default build target to wasm32-wasip1 in .cargo/config.toml
  • Update commands in edgezero.toml to use fastly compute build instead of raw cargo build
  • Clean up fastly.toml (remove comments and cloned_from field)

Workspace & Dependency Updates

  • Add js feature to uuid for WASM compatibility
  • Alphabetize workspace members and dependency lists across multiple Cargo.toml files
  • Remove rust-toolchain.toml (no longer pinning toolchain at workspace level)

Testing & Docs

  • Add Playwright E2E test support for both adapters via ADAPTER env var (axum or cloudflare)
  • Playwright config dynamically selects the web server command based on adapter
  • Add @types/node dev dependency and update Playwright to v1.58.2
  • Add tests/playwright/README.md documenting adapter test usage
  • Update docs/guide/adapters/cloudflare.md: wrangler publishwrangler deploy
  • Update README.md with Cloudflare local dev command

Other

  • Update .gitignore for .wrangler/ and **/build/ directories

Test plan

  • Run cargo build -p mocktioneer-adapter-cloudflare (native stub compiles)
  • Run npx playwright test in tests/playwright/ (Axum adapter)
  • Run ADAPTER=cloudflare npx playwright test in tests/playwright/ (Cloudflare adapter)
  • Verify wrangler deploy --cwd crates/mocktioneer-adapter-cloudflare succeeds with configured secrets

Closes #22

- Configure wrangler.toml for worker-build
- Add lib.rs with #[event(fetch)] handler for WASM
- Update Cargo.toml with cdylib lib target
- Add Playwright tests for both Axum and Cloudflare adapters
- Add GitHub Actions workflow for Cloudflare deployment
- Update .gitignore for .wrangler and build folders
- Add tests/playwright README with adapter usage
Requires EdgeZero fix/web-time-wasm branch for WASM time compatibility.
Requires CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID secrets.
Closes #22
@prk-Jr prk-Jr linked an issue Jan 28, 2026 that may be closed by this pull request
33 tasks
Prakash Bhatt and others added 2 commits February 11, 2026 15:31
@prk-Jr prk-Jr requested a review from aram356 February 11, 2026 10:15
Copy link
Contributor

@aram356 aram356 left a comment

Choose a reason for hiding this comment

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

Thanks for moving it forward. I made changes directly and will merge it.

@aram356 aram356 merged commit 9a16ec3 into main Feb 11, 2026
10 checks passed
@aram356 aram356 deleted the 22-as-developer-i-want-to-be-able-to-deploy-mocktioneer-on-cloudflare branch February 11, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

As developer I want to be able to deploy mocktioneer on Cloudflare

2 participants