Skip to content

fix: remove duplicated provider key in generated image options#2279

Open
DamianGlowala wants to merge 1 commit into
mainfrom
fix/duplicate-provider-key
Open

fix: remove duplicated provider key in generated image options#2279
DamianGlowala wants to merge 1 commit into
mainfrom
fix/duplicate-provider-key

Conversation

@DamianGlowala

Copy link
Copy Markdown
Member

🔗 Linked issue

resolves #2242

📚 Description

Removes duplicated provider key in generated image options and slightly adjusts formatting.

@DamianGlowala DamianGlowala requested a review from danielroe as a code owner July 11, 2026 12:47
@pkg-pr-new

pkg-pr-new Bot commented Jul 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 82b9d0b

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying nuxt-image with  Cloudflare Pages  Cloudflare Pages

Latest commit: 82b9d0b
Status: ✅  Deploy successful!
Preview URL: https://f25691a5.nuxt-image.pages.dev
Branch Preview URL: https://fix-duplicate-provider-key.nuxt-image.pages.dev

View logs

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 32.61%. Comparing base (458b9ac) to head (82b9d0b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2279   +/-   ##
=======================================
  Coverage   32.61%   32.61%           
=======================================
  Files           7        7           
  Lines         371      371           
  Branches      131      131           
=======================================
  Hits          121      121           
  Misses        194      194           
  Partials       56       56           

☔ View full report in Codecov by Harness.
📢 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.

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

generateImageOptions now constructs a serialized string from imageOptions entries while excluding provider. The generated imageOptions export explicitly writes each remaining field, followed by provider and providers entries. The provider mapping and import structure remain unchanged.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: removing the duplicated provider key in generated image options.
Description check ✅ Passed The description is directly related to the change and accurately mentions the duplicate provider key fix.
Linked Issues check ✅ Passed The change removes provider from the generated spread while keeping the explicit provider entry, matching issue #2242.
Out of Scope Changes check ✅ Passed The formatting/serialization updates stay within the stated fix and do not introduce unrelated scope.
✨ 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 fix/duplicate-provider-key

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/module.ts`:
- Around line 238-246: Update the generated `imageOptions` template in the
serialization flow around `serializedImageOptions` so the comma after its
interpolated entries is emitted only when non-`provider` fields exist. Preserve
valid output when `imageOptions` contains only `provider`, while retaining
separators for configurations with serialized entries.
🪄 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: b06c2f3b-cc20-4863-b566-488fd0842ac3

📥 Commits

Reviewing files that changed from the base of the PR and between cb54284 and 82b9d0b.

📒 Files selected for processing (1)
  • src/module.ts

Comment thread src/module.ts
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.

duplicate-object-key warning: provider key written twice in generateImageOptions output

3 participants