Bump Spree SDK to 0.6.8#46
Conversation
WalkthroughThe 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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. Comment |
There was a problem hiding this comment.
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 | 🟡 MinorHeader still bypasses the configured store name.
storeNameis now env-driven, but the header keeps a hardcoded"Spree Store". With customNEXT_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 theGiftCardItemfunction.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
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (8)
.env.examplepackage.jsonsrc/app/[country]/[locale]/(checkout)/layout.tsxsrc/app/[country]/[locale]/(storefront)/account/gift-cards/page.tsxsrc/contexts/StoreContext.tsxsrc/lib/data/index.tssrc/lib/data/orders.tssrc/lib/data/store.ts
💤 Files with no reviewable changes (2)
- src/lib/data/index.ts
- src/lib/data/store.ts
| # 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 |
There was a problem hiding this comment.
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.
| 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.
Summary by CodeRabbit
New Features
Chores
Refactor