Skip to content

Bump Spree SDK to 0.6.8#46

Merged
damianlegawiec merged 1 commit into
mainfrom
fix/bump-spree-sdk-0-6-8
Mar 5, 2026
Merged

Bump Spree SDK to 0.6.8#46
damianlegawiec merged 1 commit into
mainfrom
fix/bump-spree-sdk-0-6-8

Conversation

@damianlegawiec
Copy link
Copy Markdown
Member

@damianlegawiec damianlegawiec commented Mar 5, 2026

Summary by CodeRabbit

  • New Features

    • Store name now configurable via environment variable.
  • Chores

    • Updated @spree/next and @spree/sdk dependencies.
  • Refactor

    • Improved gift card type definitions and metadata handling.
    • Optimized store context architecture.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 5, 2026

Walkthrough

The changes refactor store configuration by removing StoreContext-based store state management and replacing it with a static NEXT_PUBLIC_STORE_NAME environment variable. Dependency versions are bumped, type definitions are updated, and the store data layer is eliminated.

Changes

Cohort / File(s) Summary
Configuration & Dependencies
.env.example, package.json
Added NEXT_PUBLIC_STORE_NAME environment variable; bumped @spree/next and @spree/sdk from ^0.6.7 to ^0.6.8.
Store Context Removal
src/contexts/StoreContext.tsx, src/lib/data/store.ts, src/lib/data/index.ts
Removed store state, store fetch logic, and getStore() wrapper function. Removed StoreStore import and store property from StoreContextValue interface. Eliminated store module re-export.
Component Updates
src/app/[country]/[locale]/(checkout)/layout.tsx, src/app/[country]/[locale]/(storefront)/account/gift-cards/page.tsx
Replaced StoreContext dependency with env-based storeName constant in checkout layout. Replaced local GiftCard type with StoreGiftCard across gift-cards page, updating amount field conversions to Number().
Data Schema
src/lib/data/orders.ts
Expanded getOrders meta object with additional pagination fields (from, to, in, previous, next) alongside existing fields (page, limit, count, pages).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 The context hops away, no more store to trace,
Environment variables now take its place,
Gift cards wear new types with grace,
Orders bloom with metadata's embrace,
Simpler systems—a cleaner space! 🌿

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

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.
Title check ❓ Inconclusive The pull request title 'Bump Spree SDK to 0.6.8' accurately reflects the primary change (dependency updates from 0.6.7 to 0.6.8), but this is only one aspect of a larger refactoring. The changeset includes substantial architectural changes such as removing StoreContext's store property, eliminating the getStore function, and migrating gift card type handling—changes that are arguably more significant than the dependency bump itself. Consider whether the title should reflect the full scope of changes (e.g., 'Remove store context and migrate to environment-based configuration') or clarify in the PR description that this includes additional refactoring beyond the SDK version bump.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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/bump-spree-sdk-0-6-8

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

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

Caution

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

⚠️ Outside diff range comments (1)
src/app/[country]/[locale]/(checkout)/layout.tsx (1)

14-24: ⚠️ Potential issue | 🟡 Minor

Header still bypasses the configured store name.

storeName is now env-driven, but the header keeps a hardcoded "Spree Store". With custom NEXT_PUBLIC_STORE_NAME, header/footer will diverge.

🔧 Suggested fix
-        <span className="text-xl font-bold text-gray-900">Spree Store</span>
+        <span className="text-xl font-bold text-gray-900">{storeName}</span>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/app/`[country]/[locale]/(checkout)/layout.tsx around lines 14 - 24, The
header currently hardcodes "Spree Store" inside the CheckoutHeader component
which ignores the env-driven storeName constant; update CheckoutHeader to use
the existing storeName variable (declared at top-level) instead of the literal
string so the Link/span that renders the store title reflects
NEXT_PUBLIC_STORE_NAME (falling back to the default already provided by
storeName).
🧹 Nitpick comments (1)
src/app/[country]/[locale]/(storefront)/account/gift-cards/page.tsx (1)

98-98: Add an explicit return type to the GiftCardItem function.

The function declaration on line 98 is missing an explicit return type annotation. TypeScript strict mode and the project's coding guidelines require defining explicit return types for all functions.

🔧 Suggested fix
-function GiftCardItem({ card }: { card: StoreGiftCard }) {
+function GiftCardItem({ card }: { card: StoreGiftCard }): JSX.Element {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/app/`[country]/[locale]/(storefront)/account/gift-cards/page.tsx at line
98, The GiftCardItem function lacks an explicit return type; update its
declaration for strict TypeScript by annotating the return type (e.g., change
the signature of GiftCardItem({ card }: { card: StoreGiftCard }) to include a
React return type such as : JSX.Element or React.ReactElement) so the
component's returned JSX is explicitly typed; keep the parameter type
StoreGiftCard as-is and ensure any imported React types are available.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.env.example:
- Line 10: Wrap the NEXT_PUBLIC_STORE_NAME value in quotes in the .env.example
to prevent parsing issues with dotenv-like tools; update the line containing
NEXT_PUBLIC_STORE_NAME to use quoted value (e.g., NEXT_PUBLIC_STORE_NAME="Spree
Store") so spaces are preserved and dotenv-linter no longer flags it.

---

Outside diff comments:
In `@src/app/`[country]/[locale]/(checkout)/layout.tsx:
- Around line 14-24: The header currently hardcodes "Spree Store" inside the
CheckoutHeader component which ignores the env-driven storeName constant; update
CheckoutHeader to use the existing storeName variable (declared at top-level)
instead of the literal string so the Link/span that renders the store title
reflects NEXT_PUBLIC_STORE_NAME (falling back to the default already provided by
storeName).

---

Nitpick comments:
In `@src/app/`[country]/[locale]/(storefront)/account/gift-cards/page.tsx:
- Line 98: The GiftCardItem function lacks an explicit return type; update its
declaration for strict TypeScript by annotating the return type (e.g., change
the signature of GiftCardItem({ card }: { card: StoreGiftCard }) to include a
React return type such as : JSX.Element or React.ReactElement) so the
component's returned JSX is explicitly typed; keep the parameter type
StoreGiftCard as-is and ensure any imported React types are available.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8fc88df4-d8ff-49e5-b1b1-7b03d4c9b5df

📥 Commits

Reviewing files that changed from the base of the PR and between fd44fea and 0ff2d74.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • .env.example
  • package.json
  • src/app/[country]/[locale]/(checkout)/layout.tsx
  • src/app/[country]/[locale]/(storefront)/account/gift-cards/page.tsx
  • src/contexts/StoreContext.tsx
  • src/lib/data/index.ts
  • src/lib/data/orders.ts
  • src/lib/data/store.ts
💤 Files with no reviewable changes (2)
  • src/lib/data/index.ts
  • src/lib/data/store.ts

Comment thread .env.example
# Set these to your store's default_country_iso and default_locale
NEXT_PUBLIC_DEFAULT_COUNTRY=us
NEXT_PUBLIC_DEFAULT_LOCALE=en
NEXT_PUBLIC_STORE_NAME=Spree Store
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Quote NEXT_PUBLIC_STORE_NAME to avoid parsing inconsistencies.

This value contains spaces and is already flagged by dotenv-linter; quoting it avoids tool/parser ambiguity.

🔧 Suggested fix
-NEXT_PUBLIC_STORE_NAME=Spree Store
+NEXT_PUBLIC_STORE_NAME="Spree Store"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
NEXT_PUBLIC_STORE_NAME=Spree Store
NEXT_PUBLIC_STORE_NAME="Spree Store"
🧰 Tools
🪛 dotenv-linter (4.0.0)

[warning] 10-10: [ValueWithoutQuotes] This value needs to be surrounded in quotes

(ValueWithoutQuotes)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.env.example at line 10, Wrap the NEXT_PUBLIC_STORE_NAME value in quotes in
the .env.example to prevent parsing issues with dotenv-like tools; update the
line containing NEXT_PUBLIC_STORE_NAME to use quoted value (e.g.,
NEXT_PUBLIC_STORE_NAME="Spree Store") so spaces are preserved and dotenv-linter
no longer flags it.

@damianlegawiec damianlegawiec merged commit 6b714fa into main Mar 5, 2026
4 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Mar 10, 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