Skip to content

Conversation

ela-codes
Copy link
Member

@ela-codes ela-codes commented Oct 9, 2025

This pull request adds support for deploying and previewing a Cloudflare Worker for the frontend project. The most important changes include new scripts for worker deployment, the addition of the wrangler dependency, and the creation of a wrangler.toml configuration file.

Cloudflare Worker integration:

  • Added preview:worker and deploy:worker scripts to package.json for building and running/deploying the worker using Wrangler.
  • Added wrangler as a project dependency in package.json to enable Cloudflare Worker development and deployment.
  • Created wrangler.toml with configuration for the worker, including asset directory, compatibility date, and observability settings.

Summary by Sourcery

Add Cloudflare Worker support for the frontend by introducing Wrangler scripts and configuration.

New Features:

  • Add preview:worker and deploy:worker scripts to package.json for building and running/deploying the Cloudflare Worker
  • Add wrangler as a project dependency to enable Cloudflare Worker development and deployment
  • Create wrangler.toml configuration file with asset directory, compatibility date, and observability settings

Copy link

sourcery-ai bot commented Oct 9, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR integrates Cloudflare Worker support into the frontend pipeline by adding Wrangler-based build, preview, and deploy scripts, installing the Wrangler dependency, and introducing a dedicated configuration file.

File-Level Changes

Change Details Files
Integrated Worker build and deployment scripts
  • Added preview:worker and deploy:worker scripts to invoke build then Wrangler
  • Retained existing local preview script
  • Installed wrangler as a project dependency
package.json
Added Wrangler configuration
  • Created wrangler.toml with project name and compatibility date
  • Configured assets directory to point at dist
  • Enabled observability and set head_sampling_rate
wrangler.toml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • I don’t see any worker entrypoint source file added—please include your worker script (e.g. index.ts/worker.ts) and reference it in wrangler.toml so wrangler dev/deploy can pick it up.
  • Consider moving wrangler from dependencies to devDependencies since it’s only needed for build/deploy and shouldn’t ship in production packages.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- I don’t see any worker entrypoint source file added—please include your worker script (e.g. `index.ts`/`worker.ts`) and reference it in wrangler.toml so `wrangler dev`/`deploy` can pick it up.
- Consider moving `wrangler` from dependencies to devDependencies since it’s only needed for build/deploy and shouldn’t ship in production packages.

## Individual Comments

### Comment 1
<location> `wrangler.toml:7` </location>
<code_context>
+
+[observability]
+enabled = true
+head_sampling_rate = 1
\ No newline at end of file
</code_context>

<issue_to_address>
**suggestion (performance):** Review the observability head_sampling_rate setting for production use.

Setting head_sampling_rate to 1 will sample all traces, which can impact performance and cost in production. Adjust this value for production if full sampling is not required.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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.

1 participant