Skip to content

Bump packages to add supoort for cart/order/line items metadata - #37

Merged
damianlegawiec merged 1 commit into
mainfrom
fix/metadata-support
Mar 1, 2026
Merged

Bump packages to add supoort for cart/order/line items metadata#37
damianlegawiec merged 1 commit into
mainfrom
fix/metadata-support

Conversation

@damianlegawiec

@damianlegawiec damianlegawiec commented Mar 1, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Chores

    • Updated @spree/next and @spree/sdk dependencies to version 0.6.0
  • Bug Fixes

    • Improved default currency and locale handling with consistent fallback values (USD and English)
    • Fixed cart item update functionality to properly handle quantity modifications

@coderabbitai

coderabbitai Bot commented Mar 1, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Dependencies are updated for @spree/next and @spree/sdk from ^0.5.0 to ^0.6.0. StoreContext.tsx replaces dynamic fallbacks using storeData properties with hard-coded defaults ("USD" and "en"). Cart handling is updated to pass quantity as an object payload rather than a raw number.

Changes

Cohort / File(s) Summary
Dependencies
package.json
Updated @spree/next and @spree/sdk from ^0.5.0 to ^0.6.0.
Store Context
src/contexts/StoreContext.tsx
Replaced dynamic fallbacks using storeData.default_currency and storeData.default_locale with hard-coded defaults ("USD" and "en") across all code paths in resolveCountryAndCurrency.
Cart Operations
src/lib/data/cart.ts, src/lib/data/__tests__/cart.test.ts
Modified updateCartItem to pass quantity as an object payload { quantity } instead of a raw number to updateItem; test expectations updated accordingly.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 Hopping through the code with glee,
Dependencies bumped to point-six decree!
Context defaults now carved in stone,
Cart payloads dressed up, no longer alone—
A tidy refactor, clean and right! 🌟

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title mentions bumping packages for metadata support, and the PR does update dependencies (@spree/next and @spree/sdk from 0.5.0 to 0.6.0). However, it also includes other substantive changes (StoreContext logic modifications and cart item update handling) that are not reflected in the title.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/metadata-support

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/contexts/StoreContext.tsx (1)

49-87: ⚠️ Potential issue | 🟡 Minor

Remove the unused storeData parameter from resolveCountryAndCurrency.

The storeData parameter is accepted but never used in the function body. Remove it from both the function signature and the call site to comply with the guideline to remove unused variables.

Changes required:
 function resolveCountryAndCurrency(
   countries: StoreCountry[],
-  storeData: StoreStore,
   urlCountry: string,
 ): {
         const resolved = resolveCountryAndCurrency(
           countriesData.data,
-          storeData,
           initialCountry,
         );
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/contexts/StoreContext.tsx` around lines 49 - 87, The function
resolveCountryAndCurrency currently accepts an unused parameter storeData;
remove storeData from the function signature and update every call site to pass
only (countries, urlCountry) instead of three arguments, keeping the return type
and body unchanged (leave the findCountry(countries, urlCountry) logic intact);
search for references to resolveCountryAndCurrency and update their argument
lists so no unused parameter is passed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/contexts/StoreContext.tsx`:
- Around line 49-87: The function resolveCountryAndCurrency currently accepts an
unused parameter storeData; remove storeData from the function signature and
update every call site to pass only (countries, urlCountry) instead of three
arguments, keeping the return type and body unchanged (leave the
findCountry(countries, urlCountry) logic intact); search for references to
resolveCountryAndCurrency and update their argument lists so no unused parameter
is passed.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7a6e53a and 4b5ca93.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • package.json
  • src/contexts/StoreContext.tsx
  • src/lib/data/__tests__/cart.test.ts
  • src/lib/data/cart.ts

@damianlegawiec
damianlegawiec merged commit d12b43e into main Mar 1, 2026
4 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Mar 3, 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.

1 participant