Should two related workers be developed in a single codebase, with separate wrangler.toml to bind?

Trying to understand how codebases related to CloudFlare workers. AI and docs appear to suggest different things. If building WorkerA, WorkerB, and DurableObjectC. And WorkerA will receive API requests from the web, call APIs on WorkerB and DurableObjectC. Should they be developed and tested in a single repository, or split out into separate repositories, one per worker?
4 Replies
Hello, I’m Allie!
It's mostly a matter of preference. Everything should work whether in the same repo or not, but for typing, it might be easier to have them all in one repo
Marc Siegel
Marc SiegelOP4w ago
Thank you! How does that work with the github repo integration in the CloudFlare dashboard? What I mean is: if you have a src/worker_a and a src/worker_b in the same repo, how does one configure CloudFlare?
Iván
Iván3w ago
I haven't tried this but recently was investigating the same, this is an example for many workers monorepo: https://github.com/ardislu/cloudflare-workers
GitHub
GitHub - ardislu/cloudflare-workers: Monorepo for my personal Cloud...
Monorepo for my personal Cloudflare Workers. Contribute to ardislu/cloudflare-workers development by creating an account on GitHub.
Iván
Iván3w ago
And seems here's some guidance on configuration with github: https://developers.cloudflare.com/workers/ci-cd/builds/advanced-setups/
Cloudflare Docs
Advanced Setups | Cloudflare Workers docs
Learn how to use Workers Builds with more advanced setups
Want results from more Discord servers?
Add your server