Skip to content

feat(cloudflareimages): add new provider#2100

Merged
danielroe merged 8 commits into
mainfrom
feat/cloudflareimages
Apr 1, 2026
Merged

feat(cloudflareimages): add new provider#2100
danielroe merged 8 commits into
mainfrom
feat/cloudflareimages

Conversation

@huang-julien
Copy link
Copy Markdown
Member

@huang-julien huang-julien commented Jan 31, 2026

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

This PR adds Cloudflare Image provider, its a bit different from the main Cloudflare provider which is the cloudflare transformation service.

This adds a variant modifier but still allows CLoudflare transformation url params (users needs to enable flexible variant)

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jan 31, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/image@2100

commit: 28e7836

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jan 31, 2026

Deploying nuxt-image with  Cloudflare Pages  Cloudflare Pages

Latest commit: 28e7836
Status: ✅  Deploy successful!
Preview URL: https://241ab5fa.nuxt-image.pages.dev
Branch Preview URL: https://feat-cloudflareimages.nuxt-image.pages.dev

View logs

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 31, 2026

📝 Walkthrough

Walkthrough

Adds Cloudflare Images as a built-in provider. Updates BuiltInProviders in src/provider.ts to include cloudflareimages, and adds a new provider module src/runtime/providers/cloudflareimages.ts exporting CloudflareImagesModifiers, CloudflareImagesOptions, and a default provider implementing getImage that builds Cloudflare Images URLs (default baseURL https://imagedelivery.net/ and default variant public), using an operations string when modifiers are present. Adds tests, an end-to-end snapshot, test data updates, documentation docs/content/3.providers/cloudflareimages.md, and playground samples/config for the provider.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains that this PR adds a Cloudflare Images provider distinct from the existing Cloudflare transformation provider, with details about variant modifiers and flexibility.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title 'feat(cloudflareimages): add new provider' accurately describes the main change—adding a new Cloudflare Images provider to the codebase with clear scope and specificity.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cloudflareimages

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 32.52%. Comparing base (de473d2) to head (28e7836).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2100   +/-   ##
=======================================
  Coverage   32.52%   32.52%           
=======================================
  Files           7        7           
  Lines         372      372           
  Branches      131      131           
=======================================
  Hits          121      121           
  Misses        194      194           
  Partials       57       57           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@test/nuxt/providers.test.ts`:
- Around line 115-143: Tests use an undefined variable emptyContext in calls to
cloudflareimages().getImage; replace uses of emptyContext with a call to
getEmptyContext() so the tests compile and match other tests in the file (update
the three occurrences in the cloudflareimages / cloudflareimage variant tests
where getImage is invoked).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 48f18279-22a1-48cb-ab4c-98b1ef55df1e

📥 Commits

Reviewing files that changed from the base of the PR and between 2f4a531 and dde2e0d.

📒 Files selected for processing (7)
  • docs/content/3.providers/cloudflareimages.md
  • playground/app/providers.ts
  • playground/nuxt.config.ts
  • src/provider.ts
  • src/runtime/providers/cloudflareimages.ts
  • test/nuxt/providers.test.ts
  • test/providers.ts
✅ Files skipped from review due to trivial changes (2)
  • playground/app/providers.ts
  • docs/content/3.providers/cloudflareimages.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/runtime/providers/cloudflareimages.ts

Comment thread test/nuxt/providers.test.ts
@danielroe danielroe changed the title feat(providers): add cloudflareimages provider feat(cloudflareimages): add new provider Apr 1, 2026
@danielroe danielroe added this pull request to the merge queue Apr 1, 2026
Merged via the queue into main with commit 2bdc581 Apr 1, 2026
11 checks passed
@danielroe danielroe deleted the feat/cloudflareimages branch April 1, 2026 11:56
@github-actions github-actions Bot mentioned this pull request Apr 1, 2026
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.

3 participants