Refactor/herbatica implement storefront data changes - #436
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThis PR adds a full product-lists domain to ChangesProduct Lists Domain & Integration
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
|
Greptile SummaryThis PR moves the product-list data-fetching layer out of
Confidence Score: 5/5Safe to merge — the refactoring faithfully replicates existing app behaviour through the shared library, the app adapter remains a thin wrapper, and the new code is covered by four test suites including an end-to-end cart-sync test. The PR removes ~370 lines of hand-rolled app-level code and replaces it with a well-structured generic factory that matches every other domain in the library. Auth invalidation, cart synchronisation, and query-key consistency are all tested. The only findings are a type-inference gap in a helper that has no runtime impact. No files require special attention beyond the Important Files Changed
Sequence DiagramsequenceDiagram
participant App as herbatika App
participant Hooks as createProductListHooks
participant Service as createMedusaProductListService
participant Medusa as Medusa SDK / Backend
App->>Hooks: useProductLists(input)
Hooks->>Service: listProductLists(params, signal)
Service->>Medusa: fetch GET /store/product-lists?...
Medusa-->>Service: ProductListListResponse
Service-->>Hooks: ProductListListResult
Hooks-->>App: productLists, count, limit, offset
App->>Hooks: useCreateProductListCart(input)
Hooks->>Service: createProductListCart(input)
Service->>Medusa: POST /store/product-lists/:id/cart
Medusa-->>Service: ProductListCartResponse
Service-->>Hooks: TCart
Hooks->>Hooks: syncCartCaches + invalidateQueries
Hooks->>Hooks: cartStorage.set(cart.id)
Hooks-->>App: mutation result
App->>Hooks: useAddFavoriteProductListItem(input)
Hooks->>Service: addFavoriteProductListItem(input)
Service->>Medusa: POST /store/product-lists/favorites/items
Medusa-->>Service: ProductListItemResponse
Service-->>Hooks: TProductListItem or null
Hooks->>Hooks: invalidateProductLists(queryClient)
Hooks-->>App: mutation result
Reviews (2): Last reviewed commit: "fix: prevent false unavailable state in ..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
libs/storefront-data/src/product-lists/query-options.ts (1)
1-223: 🧹 Nitpick | 🔵 Trivial | ⚖️ Poor tradeoffFile exceeds 200-line soft limit guideline.
This file contains 223 lines, exceeding the approximate 200-line soft limit. Consider extracting helper functions (stripListInput, stripDetailInput, createDefaultListParams, withCustomerScope) into a separate utilities file to reduce the size of this module.
🤖 Prompt for 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. In `@libs/storefront-data/src/product-lists/query-options.ts` around lines 1 - 223, This file is over the 200-line guideline; extract the helper functions stripListInput, stripDetailInput, createDefaultListParams, and withCustomerScope into a new utils module (e.g., product-list-utils) and update createProductListQueryOptionsFactory to import them; ensure the new module exports those four functions with the same signatures so buildList (createDefaultListParams), buildDetail (stripDetailInput), and the default buildListKey/buildDetailKey (withCustomerScope) continue to work unchanged, then remove the local definitions from this file and run type checks to confirm no breaking changes.Source: Coding guidelines
libs/storefront-data/src/product-lists/medusa-service.ts (1)
1-413: 🧹 Nitpick | 🔵 Trivial | ⚖️ Poor tradeoffFile exceeds 200-line soft limit guideline.
This file contains 413 lines, significantly exceeding the approximate 200-line soft limit. Consider splitting the service implementation into:
- Core service factory and config (main file)
- Response normalisation helpers (separate file)
- Quantity normalisation helpers (separate file)
This would improve maintainability and make the structure clearer.
🤖 Prompt for 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. In `@libs/storefront-data/src/product-lists/medusa-service.ts` around lines 1 - 413, The file is too large and should be split: extract the response normalization helpers (normalizeProductListsResponse, resolveProductListFromResponse, resolveProductListItemFromResponse, resolveProductListCartFromResponse) into a new "response-normalizers" module and the quantity helpers (normalizeQuantity, normalizeQuantityDelta) into a new "quantity-utils" module; export those functions from the new modules and update createMedusaProductListService to import them instead of declaring inline, keeping the factory (createMedusaProductListService), its config types (MedusaProductListServiceConfig), and mapping helpers (mapList/mapItem/resolveListQuery/resolveItemFromResponse) in the main file; ensure all exported types used across modules remain exported and update any relative imports (e.g., references to ProductList* types and compactRecord) so existing callers keep the same public API.Source: Coding guidelines
libs/storefront-data/src/product-lists/types.ts (1)
1-264: 🧹 Nitpick | 🔵 Trivial | ⚖️ Poor tradeoffFile exceeds 200-line soft limit guideline.
This file contains 264 lines, exceeding the approximate 200-line soft limit specified in the coding guidelines. Whilst type definition files often grow large, consider whether this module could benefit from splitting into logical groupings (e.g., base types, input types, service contracts, hook result types) to improve maintainability and navigability.
🤖 Prompt for 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. In `@libs/storefront-data/src/product-lists/types.ts` around lines 1 - 264, The file is too long—split the large types file into smaller logical modules: extract core model types (e.g., ProductListItemBase, ProductListBase, ProductListType, ProductListAccessType) into a product-list-models.ts, move input/response types (e.g., CreateCustomProductListInput, AddProductListItemInput, ProductListResponse, ProductListListResponse) into product-list-io.ts, and put service/query/hook contracts (e.g., ProductListService, ProductListQueryKeys, UseProductListsResult, UseProductListResult) into product-list-service.ts (or similar); update existing imports/exports so each symbol (ProductListItemBase, ProductListBase, ProductListService, ProductListQueryKeys, UseProductListsResult, etc.) is exported from the new modules and re-exported from the original barrel if needed to preserve external API.Source: Coding guidelines
libs/storefront-data/src/product-lists/hooks.ts (1)
1-866: 🛠️ Refactor suggestion | 🟠 Major | 🏗️ Heavy liftFile significantly exceeds 200-line soft limit guideline.
This file contains 866 lines, more than four times the approximate 200-line soft limit. Consider splitting into multiple files:
- Query hooks (useProductLists, useProductList, etc.)
- Mutation hooks (useCreate*, useUpdate*, useDelete*, useAdd*)
- Query option builders (getListQueryOptions, getDetailQueryOptions)
- Helper functions (stripInputs, createDefaultParams, etc.)
This would significantly improve maintainability and make the code easier to navigate.
🤖 Prompt for 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. In `@libs/storefront-data/src/product-lists/hooks.ts` around lines 1 - 866, The file is too large; split createProductListHooks into smaller modules: move helper utilities (stripListInput, stripDetailInput, createDefaultListParams, withCustomerScope, resolve defaults and types) into a new helpers module and export them for use; move query option builders (getListQueryOptions, getDetailQueryOptions) into a query-options module that imports service, resolvedQueryKeys and resolvedCacheConfig from the factory or accepts them as arguments; move query hooks (useProductLists, useSuspenseProductLists, useProductList, useSuspenseProductList, useProductListDetails) into a queries module that imports the query-option builders; move mutation hooks (useCreateFavoriteProductList, useCreateCustomProductList, useUpdateProductList, useDeleteProductList, useAddProductListItem, useAddFavoriteProductListItem, useCreateProductListCart, useUpdateProductListItem, useChangeProductListItemQuantity, useIncrementProductListItem, useDeleteProductListItem) into a mutations module that accepts service and invalidateProductLists/queryClient helpers; keep createProductListHooks as the small factory that composes these modules (wiring service, buildList/buildDetail/build*Key, resolvedQueryKeys, resolvedCacheConfig, defaultPageSize, cartQueryKeys/cartStorage/isActiveCartQueryKey) and re-exports the same API surface so existing imports remain unchanged.Source: Coding guidelines
🤖 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 `@libs/storefront-data/src/product-lists/query-options.ts`:
- Around line 78-135: The four helpers stripListInput, stripDetailInput,
createDefaultListParams, and withCustomerScope are duplicated; extract them into
a single shared module (e.g., product-lists/query-input-utils.ts), export each
function (preserve their generic signatures and behavior, including use of
resolvePagination and compactRecord inside createDefaultListParams), then
replace the local definitions in query-options.ts and hooks.ts with imports from
that new module; update both files to import the exported functions and ensure
types (ProductListListInputBase, ProductListDetailInputBase) remain referenced
or re-exported so existing call sites (createDefaultListParams, stripListInput,
stripDetailInput, withCustomerScope) compile.
In `@libs/storefront-data/src/product-lists/types.ts`:
- Around line 29-43: ProductListBase currently exposes both items_count and
item_count which is ambiguous for consumers; update the data model and mapping
layer so consumers see a single canonical count field (e.g., itemCount) and
ensure the service/utility that normalizes API responses (where ProductListBase
is constructed) maps either incoming items_count or item_count into that
canonical field and removes the duplicate; update any constructors, mappers, or
factory functions that produce ProductListBase objects to prefer one source
(document the precedence) and populate only the canonical property.
---
Outside diff comments:
In `@libs/storefront-data/src/product-lists/hooks.ts`:
- Around line 1-866: The file is too large; split createProductListHooks into
smaller modules: move helper utilities (stripListInput, stripDetailInput,
createDefaultListParams, withCustomerScope, resolve defaults and types) into a
new helpers module and export them for use; move query option builders
(getListQueryOptions, getDetailQueryOptions) into a query-options module that
imports service, resolvedQueryKeys and resolvedCacheConfig from the factory or
accepts them as arguments; move query hooks (useProductLists,
useSuspenseProductLists, useProductList, useSuspenseProductList,
useProductListDetails) into a queries module that imports the query-option
builders; move mutation hooks (useCreateFavoriteProductList,
useCreateCustomProductList, useUpdateProductList, useDeleteProductList,
useAddProductListItem, useAddFavoriteProductListItem, useCreateProductListCart,
useUpdateProductListItem, useChangeProductListItemQuantity,
useIncrementProductListItem, useDeleteProductListItem) into a mutations module
that accepts service and invalidateProductLists/queryClient helpers; keep
createProductListHooks as the small factory that composes these modules (wiring
service, buildList/buildDetail/build*Key, resolvedQueryKeys,
resolvedCacheConfig, defaultPageSize,
cartQueryKeys/cartStorage/isActiveCartQueryKey) and re-exports the same API
surface so existing imports remain unchanged.
In `@libs/storefront-data/src/product-lists/medusa-service.ts`:
- Around line 1-413: The file is too large and should be split: extract the
response normalization helpers (normalizeProductListsResponse,
resolveProductListFromResponse, resolveProductListItemFromResponse,
resolveProductListCartFromResponse) into a new "response-normalizers" module and
the quantity helpers (normalizeQuantity, normalizeQuantityDelta) into a new
"quantity-utils" module; export those functions from the new modules and update
createMedusaProductListService to import them instead of declaring inline,
keeping the factory (createMedusaProductListService), its config types
(MedusaProductListServiceConfig), and mapping helpers
(mapList/mapItem/resolveListQuery/resolveItemFromResponse) in the main file;
ensure all exported types used across modules remain exported and update any
relative imports (e.g., references to ProductList* types and compactRecord) so
existing callers keep the same public API.
In `@libs/storefront-data/src/product-lists/query-options.ts`:
- Around line 1-223: This file is over the 200-line guideline; extract the
helper functions stripListInput, stripDetailInput, createDefaultListParams, and
withCustomerScope into a new utils module (e.g., product-list-utils) and update
createProductListQueryOptionsFactory to import them; ensure the new module
exports those four functions with the same signatures so buildList
(createDefaultListParams), buildDetail (stripDetailInput), and the default
buildListKey/buildDetailKey (withCustomerScope) continue to work unchanged, then
remove the local definitions from this file and run type checks to confirm no
breaking changes.
In `@libs/storefront-data/src/product-lists/types.ts`:
- Around line 1-264: The file is too long—split the large types file into
smaller logical modules: extract core model types (e.g., ProductListItemBase,
ProductListBase, ProductListType, ProductListAccessType) into a
product-list-models.ts, move input/response types (e.g.,
CreateCustomProductListInput, AddProductListItemInput, ProductListResponse,
ProductListListResponse) into product-list-io.ts, and put service/query/hook
contracts (e.g., ProductListService, ProductListQueryKeys,
UseProductListsResult, UseProductListResult) into product-list-service.ts (or
similar); update existing imports/exports so each symbol (ProductListItemBase,
ProductListBase, ProductListService, ProductListQueryKeys,
UseProductListsResult, etc.) is exported from the new modules and re-exported
from the original barrel if needed to preserve external API.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: a9ff5b67-b41e-4095-87ed-fe8dd6cdf9c6
📒 Files selected for processing (25)
apps/herbatika/src/lib/storefront/product-lists.client.tsapps/herbatika/src/lib/storefront/product-lists.tsapps/herbatika/src/lib/storefront/product-lists.types.tsapps/herbatika/src/lib/storefront/storefront-config.tsapps/herbatika/src/lib/storefront/storefront-core-definition.tsapps/herbatika/src/lib/storefront/storefront-server.tsapps/herbatika/src/lib/storefront/storefront.tslibs/storefront-data/AGENTS.mdlibs/storefront-data/README.mdlibs/storefront-data/package.jsonlibs/storefront-data/src/medusa/foundation.tslibs/storefront-data/src/medusa/preset.tslibs/storefront-data/src/medusa/server-read.tslibs/storefront-data/src/product-lists/hooks.tslibs/storefront-data/src/product-lists/medusa-service.tslibs/storefront-data/src/product-lists/query-keys.tslibs/storefront-data/src/product-lists/query-options.tslibs/storefront-data/src/product-lists/types.tslibs/storefront-data/src/product-lists/utils.tslibs/storefront-data/src/shared/object-utils.tslibs/storefront-data/tests/medusa.preset.test.tsxlibs/storefront-data/tests/medusa.server-read.test.tslibs/storefront-data/tests/product-lists.medusa-service.test.tslibs/storefront-data/tests/product-lists.utils.test.tslibs/storefront-data/tests/regression.catalog-customers-exports.test.tsx
💤 Files with no reviewable changes (2)
- apps/herbatika/src/lib/storefront/product-lists.types.ts
- apps/herbatika/src/lib/storefront/product-lists.client.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: main
- GitHub Check: Greptile Review
- GitHub Check: Kilo Code Review
🧰 Additional context used
📓 Path-based instructions (6)
libs/storefront-data/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (libs/storefront-data/AGENTS.md)
libs/storefront-data/**/*.{ts,tsx,js,jsx}: Do not import from./dist/paths - use source files instead
Keep the"use client"directive only in client components
Files:
libs/storefront-data/src/shared/object-utils.tslibs/storefront-data/src/product-lists/query-keys.tslibs/storefront-data/tests/product-lists.utils.test.tslibs/storefront-data/tests/regression.catalog-customers-exports.test.tsxlibs/storefront-data/tests/medusa.server-read.test.tslibs/storefront-data/tests/product-lists.medusa-service.test.tslibs/storefront-data/src/medusa/foundation.tslibs/storefront-data/src/product-lists/utils.tslibs/storefront-data/src/product-lists/query-options.tslibs/storefront-data/tests/medusa.preset.test.tsxlibs/storefront-data/src/product-lists/medusa-service.tslibs/storefront-data/src/product-lists/types.tslibs/storefront-data/src/medusa/server-read.tslibs/storefront-data/src/medusa/preset.tslibs/storefront-data/src/product-lists/hooks.ts
libs/storefront-data/**/*.{ts,tsx}
📄 CodeRabbit inference engine (libs/storefront-data/AGENTS.md)
libs/storefront-data/**/*.{ts,tsx}: Do not useanytype - use proper generics instead
Do not hardcode query keys - usecreateQueryKey()utility instead
Do not mix server/client code in the same file
Always use the factory pattern for creating hooks (e.g.,createProductHooks,createCollectionHooks)
Always type service interfaces with generics
Always use cache strategies fromCacheConfig(static, semiStatic, realtime, userData)
UsegetServerQueryClientfromserver/get-query-clientfor Server Components in the storefront-data library
Files:
libs/storefront-data/src/shared/object-utils.tslibs/storefront-data/src/product-lists/query-keys.tslibs/storefront-data/tests/product-lists.utils.test.tslibs/storefront-data/tests/regression.catalog-customers-exports.test.tsxlibs/storefront-data/tests/medusa.server-read.test.tslibs/storefront-data/tests/product-lists.medusa-service.test.tslibs/storefront-data/src/medusa/foundation.tslibs/storefront-data/src/product-lists/utils.tslibs/storefront-data/src/product-lists/query-options.tslibs/storefront-data/tests/medusa.preset.test.tsxlibs/storefront-data/src/product-lists/medusa-service.tslibs/storefront-data/src/product-lists/types.tslibs/storefront-data/src/medusa/server-read.tslibs/storefront-data/src/medusa/preset.tslibs/storefront-data/src/product-lists/hooks.ts
apps/herbatika/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md)
apps/herbatika/src/**/*.{ts,tsx}: Use internal UI primitives/components from@techsio/ui-kitinstead of native HTML controls in app code; avoid raw<button>,<input>,<select>,<textarea>,<img>, and inline SVG icons unless documented exceptions exist
Use token-based utility classes instead of raw Tailwind palette/spacing values; preferp-200 mt-300 gap-150 text-success bg-dangeroverp-4 mt-8 gap-4 bg-red-600 text-green-300
Soft limit of approximately 200 lines per source file; exceeding this should trigger refactor consideration as a red flag
Use kebab-case for file names and PascalCase for React component names
Files:
apps/herbatika/src/lib/storefront/storefront-server.tsapps/herbatika/src/lib/storefront/storefront-core-definition.tsapps/herbatika/src/lib/storefront/storefront-config.tsapps/herbatika/src/lib/storefront/storefront.tsapps/herbatika/src/lib/storefront/product-lists.ts
libs/storefront-data/**/AGENTS.md
📄 CodeRabbit inference engine (libs/storefront-data/CLAUDE.md)
libs/storefront-data/**/AGENTS.md: Document agent definitions and configurations in AGENTS.md
Maintain an up-to-date AGENTS.md file documenting all agents in the system
Files:
libs/storefront-data/AGENTS.md
libs/storefront-data/{AGENTS,CLAUDE}.md
📄 CodeRabbit inference engine (libs/storefront-data/AGENTS.md)
Edit only
libs/storefront-data/AGENTS.mdas the canonical source of truth -CLAUDE.mdis a symlink
Files:
libs/storefront-data/AGENTS.md
**/package.json
📄 CodeRabbit inference engine (CLAUDE.md)
Use pnpm CLI to add dependencies; never edit package.json directly
Files:
libs/storefront-data/package.json
🧠 Learnings (3)
📚 Learning: 2025-12-16T19:45:17.746Z
Learnt from: BleedingDev
Repo: NMIT-WR/new-engine PR: 207
File: libs/ui/src/molecules/select.tsx:50-50
Timestamp: 2025-12-16T19:45:17.746Z
Learning: When reviewing Tailwind classes in TSX/TS files, prefer using square brackets for arbitrary CSS values and complex expressions. Specifically: - Do not use the parentheses syntax (z-(--z-index)) for anything beyond simple CSS variable references; this syntax auto-wraps in var() and cannot handle calc or complex functions. - Use the square brackets syntax (e.g., h-[calc(var(--available-height)-var(--spacing-content))]) for calc expressions, var with calc, and any complex CSS expressions. This rule applies broadly to Tailwind v4 usage in TSX code across the project.
Applied to files:
libs/storefront-data/tests/regression.catalog-customers-exports.test.tsxlibs/storefront-data/tests/medusa.preset.test.tsx
📚 Learning: 2026-02-05T14:43:17.404Z
Learnt from: KaiUweCZE
Repo: NMIT-WR/new-engine PR: 324
File: apps/medusa-be/package.json:0-0
Timestamp: 2026-02-05T14:43:17.404Z
Learning: Validate and enforce React 19 compatibility across monorepo workspaces. Since Medusa UI supports React 19 via root package.json overrides and Medusa Cloud prerequisites show React 19 overrides for npm workspaces, ensure workspace root and all relevant package.json files align with React 19 (18+ requirement is satisfied). When reviewing, verify that overrides exist in the root package.json and that dependent packages in apps or packages directories declare React 19 (or compatible) in their peerDependencies or dependencies as appropriate for workspace usage.
Applied to files:
libs/storefront-data/package.json
📚 Learning: 2026-05-07T19:05:58.339Z
Learnt from: redeyecz
Repo: TechsioCZ/new-engine PR: 390
File: apps/medusa-be/package.json:78-81
Timestamp: 2026-05-07T19:05:58.339Z
Learning: When reviewing changes to `package.json`, do not automatically flag dependency additions/removals as "manually edited" or as "bypassing the pnpm lockfile" just because the `package.json` diff shows only that file changed. First verify whether `pnpm-lock.yaml` is missing the corresponding entries. Since `pnpm add` updates both `package.json` and `pnpm-lock.yaml` together, legitimate changes can appear in the `package.json` diff while still being properly tracked in the lockfile.
Applied to files:
libs/storefront-data/package.json
🔇 Additional comments (37)
libs/storefront-data/tests/product-lists.medusa-service.test.ts (1)
1-128: LGTM!libs/storefront-data/tests/product-lists.utils.test.ts (1)
1-63: LGTM!libs/storefront-data/tests/medusa.preset.test.tsx (1)
32-36: LGTM!Also applies to: 76-83, 232-247, 249-288, 387-495, 497-568
libs/storefront-data/tests/medusa.server-read.test.ts (1)
6-10: LGTM!Also applies to: 35-48, 87-90, 104-136, 152-166
libs/storefront-data/tests/regression.catalog-customers-exports.test.tsx (1)
291-294: LGTM!libs/storefront-data/src/product-lists/types.ts (5)
14-27: LGTM!
45-74: LGTM!
76-168: LGTM!
175-233: LGTM!
235-263: LGTM!libs/storefront-data/src/product-lists/utils.ts (4)
3-8: LGTM!Also applies to: 10-29, 31-41
50-76: LGTM!
78-100: LGTM!
43-48: Revisit zero/invalid handling inresolveProductListItemQuantity(libs/storefront-data/src/product-lists/utils.ts:43-48)
resolveProductListItemQuantityfloors positive numbers and returns1for0, negatives,null/undefined, andNaN. If0is a meaningful quantity in product list items, this silently turns it into1; handle0explicitly or document the intended semantics.libs/storefront-data/src/shared/object-utils.ts (1)
16-19: LGTM!libs/storefront-data/src/product-lists/medusa-service.ts (4)
51-63: 💤 Low valueVerify error message clarity for quantity delta validation.
normalizeQuantityDeltathrows an error when the quantity delta is zero. Whilst this validation is correct, the error message "Quantity change must be a non-zero integer" might be unclear to consumers who pass floating-point numbers. Consider whether the message should also mention that the value will be truncated to an integer.
335-356: 💤 Low valueVerify cart creation error handling is sufficient.
createProductListCartthrows a generic error if the cart is missing from the response (line 352). Whilst this is correct, the error doesn't include contextual information like thelistIdthat was used, which could aid debugging. Consider enriching the error message.💡 Proposed enhancement
if (!cart) { - throw new Error("Product list cart response did not include a cart.") + throw new Error(`Product list cart response did not include a cart for list ${input.listId}.`) }
43-49: LGTM!Also applies to: 110-143, 165-191, 200-238, 240-293, 295-333, 358-410
389-400: Clarify Medusa/items/:itemId/incrementquantity semantics inincrementProductListItem.
Inlibs/storefront-data/src/product-lists/medusa-service.ts(lines 389-400), the code posts{ quantity: normalizeQuantity(input.quantity) ?? 1 }to/items/${input.itemId}/increment. Confirm whether Medusa treats thisquantityas an absolute target or a delta; if it’s a target value, the method naming/normalisation are potentially misleading and may need renaming or request-shape adjustment.libs/storefront-data/src/product-lists/query-keys.ts (1)
5-28: LGTM!libs/storefront-data/src/product-lists/query-options.ts (2)
210-216: ⚡ Quick winVerify error handling approach in
queryFn.
getDetailQueryOptionsthrows an error inside thequeryFn(lines 211-212) wheninput.idis missing. Whilst this prevents invalid queries, React Query will treat this as a query error, which triggers error boundaries and retry logic.Consider whether this should instead:
- Return
nullimmediately (current service behaviour for missing IDs)- Throw before creating the query options
- Be handled by the
enabledflag in calling hooksThe current implementation is functional but may result in unnecessary error logging and retry attempts.
23-76: LGTM!Also applies to: 78-97, 99-123, 125-135, 137-201
libs/storefront-data/src/product-lists/hooks.ts (3)
418-424: ⚡ Quick winError handling in
getDetailQueryOptionsthrows insidequeryFn.Similar to query-options.ts,
getDetailQueryOptionsthrows an error inside thequeryFnwheninput.idis missing (lines 419-421). This will be treated as a query error by React Query, potentially triggering error boundaries and retry logic.The calling hooks (
useProductListat line 497 anduseProductListDetailsat line 557) already handle theenabledflag based oninput.id, which prevents the query from running when the ID is missing. However,useSuspenseProductListthrows immediately at line 520-522, which is a cleaner approach.Consider aligning the error handling strategy across all hooks for consistency.
370-390: LGTM!Also applies to: 430-461, 463-489, 491-512, 543-560, 562-664, 666-843, 845-864
718-739: fix(storefront-data): verify cart cache synchronisation and invalidation side effects
useCreateProductListCartsyncs cart caches and storescart.idafter mutation success; ensure the implementation aligns with the expectedsyncCartCachescart shape, thatisActiveCartQueryKeyonly matches the intended active-cart queries, and thatinvalidateQueries({ queryKey: cartQueryKeys.all() })won’t cause redundant refetches or conflict with other cart flows. Also ensurecartStorage?.set(cart.id)failure (or an unset storage) can’t leave caches inconsistent; add appropriate guarding/error handling if needed.apps/herbatika/src/lib/storefront/storefront-config.ts (1)
32-36: LGTM!Also applies to: 167-170
apps/herbatika/src/lib/storefront/storefront-core-definition.ts (1)
38-40: LGTM!apps/herbatika/src/lib/storefront/storefront-server.ts (1)
56-58: LGTM!apps/herbatika/src/lib/storefront/storefront.ts (1)
36-38: LGTM!apps/herbatika/src/lib/storefront/product-lists.ts (1)
4-37: LGTM!Also applies to: 41-58, 75-109, 111-184
libs/storefront-data/src/medusa/foundation.ts (1)
19-20: LGTM!Also applies to: 41-44, 59-62, 93-96
libs/storefront-data/src/medusa/preset.ts (1)
126-145: LGTM!Also applies to: 247-262, 280-286, 435-447, 532-532, 605-611, 762-763, 788-793, 831-831, 856-856, 861-861, 944-963
libs/storefront-data/src/medusa/server-read.ts (1)
56-76: LGTM!Also applies to: 140-159, 219-222, 242-248, 272-284, 344-344, 382-386, 469-470, 490-495, 531-537
libs/storefront-data/package.json (2)
232-255: LGTM!
309-310: Confirm Medusa deps were updated via pnpm CLI (and lockfile updated)
@medusajs/js-sdkand@medusajs/typesinlibs/storefront-data/package.jsonwere changed to^2.15.2, but the diff doesn’t include/reflectpnpm-lock.yaml. Please confirm these were applied usingpnpm add -D@medusajs/js-sdk@^2.15.2@medusajs/types@^2.15.2(or equivalent) and thatpnpm-lock.yamlnow contains the corresponding2.15.xresolutions for both packages.libs/storefront-data/AGENTS.md (1)
35-35: LGTM!libs/storefront-data/README.md (1)
174-174: LGTM!Also applies to: 177-178, 189-189
Code Review SummaryStatus: Issues Found | Recommendation: Review suggested changes Overview
Issue Details (click to expand)SUGGESTION
Other Observations (not in diff)No additional issues found in unchanged code. Files Reviewed (4 files)
|
Code Review SummaryStatus: 2 Suggestions | Recommendation: Consider addressing for consistency Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (6 files)
|
|
SUGGESTION: Body payload uses direct object literal without |
|
SUGGESTION: Body payload uses direct object literal without |
Code Review SummaryStatus: 2 Suggestions | Recommendation: Consider addressing for consistency Overview
Issue Details (click to expand)SUGGESTION
Other Observations (not in diff)No additional issues found in unchanged code. Files Reviewed (6 files)
Fix these issues in Kilo Cloud Reviewed by laguna-m.1-20260312:free · 71,910 tokens |
…tica-implement-storefront-data-changes
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 (5)
libs/storefront-data/skills/implement-auth-and-customer-session-flows/SKILL.md (1)
234-234: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winAdd trailing newline at end of file.
Text files should end with a newline character as per POSIX standards and common Markdown conventions.
📝 Proposed fix
See also: `decide-app-specific-overrides-vs-shared-platform` for thin wrapper rules. +🤖 Prompt for 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. In `@libs/storefront-data/skills/implement-auth-and-customer-session-flows/SKILL.md` at line 234, The file SKILL.md is missing a trailing newline at EOF; open SKILL.md and add a single newline character at the end of the file so the file terminates with a newline (ensure your editor saves the file with a trailing newline to satisfy POSIX/Markdown conventions).libs/storefront-data/skills/implement-cart-and-checkout-platform-flows/SKILL.md (1)
243-243: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winAdd trailing newline at end of file.
Text files should end with a newline character as per POSIX standards and common Markdown conventions.
📝 Proposed fix
See also: `configure-pagination-prefetch-and-cache-policy` for shared query-key behavior and cache semantics. +🤖 Prompt for 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. In `@libs/storefront-data/skills/implement-cart-and-checkout-platform-flows/SKILL.md` at line 243, The file SKILL.md is missing a trailing newline; open SKILL.md and add a single newline character at the end of the file so the file ends with a newline (POSIX/Markdown convention), then save and commit the change.libs/storefront-data/skills/migrate-custom-hooks-to-storefront-data/SKILL.md (1)
193-193: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winAdd trailing newline at end of file.
Text files should end with a newline character as per POSIX standards and common Markdown conventions.
📝 Proposed fix
See also: `decide-app-specific-overrides-vs-shared-platform` for promotion rules. +🤖 Prompt for 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. In `@libs/storefront-data/skills/migrate-custom-hooks-to-storefront-data/SKILL.md` at line 193, Add a trailing newline to the end of SKILL.md so the file ends with a newline character (POSIX/Markdown convention); open libs/storefront-data/skills/migrate-custom-hooks-to-storefront-data/SKILL.md and ensure the final line is terminated with a newline before committing.libs/storefront-data/skills/use-catalog-and-product-read-flows/SKILL.md (1)
238-238: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winAdd trailing newline at end of file.
Text files should end with a newline character as per POSIX standards and common Markdown conventions.
📝 Proposed fix
See also: `configure-pagination-prefetch-and-cache-policy` for prefetch behavior and normalized query-key rules. +🤖 Prompt for 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. In `@libs/storefront-data/skills/use-catalog-and-product-read-flows/SKILL.md` at line 238, The file SKILL.md is missing a trailing newline at EOF; open SKILL.md and add a single newline character at the end of the file (ensure the final line ends with '\n') then save and commit the change so the file conforms to POSIX/Markdown newline conventions.libs/storefront-data/skills/implement-ssr-prefetch-and-query-client-boundaries/SKILL.md (1)
225-225: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winAdd trailing newline at end of file.
Text files should end with a newline character as per POSIX standards and common Markdown conventions.
📝 Proposed fix
See also: `configure-pagination-prefetch-and-cache-policy` for skip modes, page planning, and normalized query inputs. +🤖 Prompt for 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. In `@libs/storefront-data/skills/implement-ssr-prefetch-and-query-client-boundaries/SKILL.md` at line 225, Add a single trailing newline character to the end of SKILL.md so the file ends with a newline (POSIX/Markdown convention); open SKILL.md, move to the file end and insert a newline, then save to ensure the file ends with exactly one newline character.
🤖 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
`@libs/storefront-data/skills/implement-cart-and-checkout-platform-flows/SKILL.md`:
- Around line 183-199: Update the example to include the missing import for
resolveSelectedPaymentProviderId and replace the incorrect direct-access
snippet; specifically, import resolveSelectedPaymentProviderId from
"`@techsio/storefront-data/shared/checkout-flow-utils`" and use
resolveSelectedPaymentProviderId(cart) instead of accessing
cart.payment_collection?.payment_sessions?.[0]?.provider_id so the example shows
the correct selected-payment-session semantics (reference the
resolveSelectedPaymentProviderId symbol in the example).
---
Outside diff comments:
In
`@libs/storefront-data/skills/implement-auth-and-customer-session-flows/SKILL.md`:
- Line 234: The file SKILL.md is missing a trailing newline at EOF; open
SKILL.md and add a single newline character at the end of the file so the file
terminates with a newline (ensure your editor saves the file with a trailing
newline to satisfy POSIX/Markdown conventions).
In
`@libs/storefront-data/skills/implement-cart-and-checkout-platform-flows/SKILL.md`:
- Line 243: The file SKILL.md is missing a trailing newline; open SKILL.md and
add a single newline character at the end of the file so the file ends with a
newline (POSIX/Markdown convention), then save and commit the change.
In
`@libs/storefront-data/skills/implement-ssr-prefetch-and-query-client-boundaries/SKILL.md`:
- Line 225: Add a single trailing newline character to the end of SKILL.md so
the file ends with a newline (POSIX/Markdown convention); open SKILL.md, move to
the file end and insert a newline, then save to ensure the file ends with
exactly one newline character.
In
`@libs/storefront-data/skills/migrate-custom-hooks-to-storefront-data/SKILL.md`:
- Line 193: Add a trailing newline to the end of SKILL.md so the file ends with
a newline character (POSIX/Markdown convention); open
libs/storefront-data/skills/migrate-custom-hooks-to-storefront-data/SKILL.md and
ensure the final line is terminated with a newline before committing.
In `@libs/storefront-data/skills/use-catalog-and-product-read-flows/SKILL.md`:
- Line 238: The file SKILL.md is missing a trailing newline at EOF; open
SKILL.md and add a single newline character at the end of the file (ensure the
final line ends with '\n') then save and commit the change so the file conforms
to POSIX/Markdown newline conventions.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: 319a96fd-1734-4181-807e-fc3211fa83d2
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (24)
apps/herbatika/src/components/product-lists/product-list-tabs.tsxapps/herbatika/src/components/product-lists/use-account-product-lists.tslibs/storefront-data/package.jsonlibs/storefront-data/skills/audit-storefront-before-release/SKILL.mdlibs/storefront-data/skills/configure-pagination-prefetch-and-cache-policy/SKILL.mdlibs/storefront-data/skills/configure-pagination-prefetch-and-cache-policy/references/prefetch-and-pagination.mdlibs/storefront-data/skills/decide-app-specific-overrides-vs-shared-platform/SKILL.mdlibs/storefront-data/skills/extend-storefront-data-for-new-backend-use-cases/SKILL.mdlibs/storefront-data/skills/extend-storefront-data-for-new-backend-use-cases/references/extension-recipe.mdlibs/storefront-data/skills/implement-auth-and-customer-session-flows/SKILL.mdlibs/storefront-data/skills/implement-cart-and-checkout-platform-flows/SKILL.mdlibs/storefront-data/skills/implement-ssr-prefetch-and-query-client-boundaries/SKILL.mdlibs/storefront-data/skills/migrate-custom-hooks-to-storefront-data/SKILL.mdlibs/storefront-data/skills/setup-storefront-platform-in-next-app/SKILL.mdlibs/storefront-data/skills/use-catalog-and-product-read-flows/SKILL.mdlibs/storefront-data/skills/use-storefront-data-skills/SKILL.mdlibs/storefront-data/src/product-lists/hooks.tslibs/storefront-data/src/product-lists/input-utils.tslibs/storefront-data/src/product-lists/medusa-service.tslibs/storefront-data/src/product-lists/query-options.tslibs/storefront-data/src/product-lists/utils.tslibs/storefront-data/tests/product-lists.hooks.test.tsxlibs/storefront-data/tests/product-lists.medusa-service.test.tslibs/storefront-data/tests/product-lists.utils.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Greptile Review
- GitHub Check: main
🧰 Additional context used
📓 Path-based instructions (4)
apps/herbatika/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md)
apps/herbatika/src/**/*.{ts,tsx}: Use internal UI primitives/components from@techsio/ui-kitinstead of native HTML controls in app code; avoid raw<button>,<input>,<select>,<textarea>,<img>, and inline SVG icons unless documented exceptions exist
Use token-based utility classes instead of raw Tailwind palette/spacing values; preferp-200 mt-300 gap-150 text-success bg-dangeroverp-4 mt-8 gap-4 bg-red-600 text-green-300
Soft limit of approximately 200 lines per source file; exceeding this should trigger refactor consideration as a red flag
Use kebab-case for file names and PascalCase for React component names
Files:
apps/herbatika/src/components/product-lists/use-account-product-lists.tsapps/herbatika/src/components/product-lists/product-list-tabs.tsx
libs/storefront-data/**/*.{ts,tsx}
📄 CodeRabbit inference engine (libs/storefront-data/AGENTS.md)
libs/storefront-data/**/*.{ts,tsx}: Never import from./dist/paths - use source files instead
Never useanytype - use proper generics instead
Never hardcode query keys - usecreateQueryKey()utility instead
Never mix server and client code in the same file
Files:
libs/storefront-data/tests/product-lists.hooks.test.tsxlibs/storefront-data/tests/product-lists.utils.test.tslibs/storefront-data/src/product-lists/input-utils.tslibs/storefront-data/tests/product-lists.medusa-service.test.tslibs/storefront-data/src/product-lists/utils.tslibs/storefront-data/src/product-lists/hooks.tslibs/storefront-data/src/product-lists/medusa-service.tslibs/storefront-data/src/product-lists/query-options.ts
libs/storefront-data/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (libs/storefront-data/AGENTS.md)
libs/storefront-data/src/**/*.{ts,tsx}: Always use factory pattern for creating hooks (createProductHooks,createCollectionHooks,createCategoryHooks,createRegionHooks,createAuthHooks,createCartHooks,createCheckoutHooks,createOrderHooks,createCustomerHooks,createProductListHooks)
Always type service interfaces with generics in the storefront-data library
Always use cache strategies fromCacheConfig(static, semiStatic, realtime, userData) for query configuration
Files:
libs/storefront-data/src/product-lists/input-utils.tslibs/storefront-data/src/product-lists/utils.tslibs/storefront-data/src/product-lists/hooks.tslibs/storefront-data/src/product-lists/medusa-service.tslibs/storefront-data/src/product-lists/query-options.ts
**/package.json
📄 CodeRabbit inference engine (CLAUDE.md)
Use pnpm CLI to add dependencies; never edit package.json directly
Files:
libs/storefront-data/package.json
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: TechsioCZ/new-engine
Timestamp: 2026-06-10T15:27:40.970Z
Learning: On Windows, enable Developer Mode and set `git config core.symlinks true` so symlinks work properly
Learnt from: CR
Repo: TechsioCZ/new-engine
Timestamp: 2026-06-10T15:27:40.970Z
Learning: For TanStack Query implementation, check official docs before implementing SSR/prefetch patterns in the storefront-data library
Learnt from: CR
Repo: TechsioCZ/new-engine
Timestamp: 2026-06-10T15:27:40.970Z
Learning: For Medusa SDK implementation, reference official SDK documentation for API response types and SDK methods
📚 Learning: 2025-12-16T19:45:17.746Z
Learnt from: BleedingDev
Repo: NMIT-WR/new-engine PR: 207
File: libs/ui/src/molecules/select.tsx:50-50
Timestamp: 2025-12-16T19:45:17.746Z
Learning: When reviewing Tailwind classes in TSX/TS files, prefer using square brackets for arbitrary CSS values and complex expressions. Specifically: - Do not use the parentheses syntax (z-(--z-index)) for anything beyond simple CSS variable references; this syntax auto-wraps in var() and cannot handle calc or complex functions. - Use the square brackets syntax (e.g., h-[calc(var(--available-height)-var(--spacing-content))]) for calc expressions, var with calc, and any complex CSS expressions. This rule applies broadly to Tailwind v4 usage in TSX code across the project.
Applied to files:
libs/storefront-data/tests/product-lists.hooks.test.tsxapps/herbatika/src/components/product-lists/product-list-tabs.tsx
📚 Learning: 2026-02-05T14:43:17.404Z
Learnt from: KaiUweCZE
Repo: NMIT-WR/new-engine PR: 324
File: apps/medusa-be/package.json:0-0
Timestamp: 2026-02-05T14:43:17.404Z
Learning: Validate and enforce React 19 compatibility across monorepo workspaces. Since Medusa UI supports React 19 via root package.json overrides and Medusa Cloud prerequisites show React 19 overrides for npm workspaces, ensure workspace root and all relevant package.json files align with React 19 (18+ requirement is satisfied). When reviewing, verify that overrides exist in the root package.json and that dependent packages in apps or packages directories declare React 19 (or compatible) in their peerDependencies or dependencies as appropriate for workspace usage.
Applied to files:
libs/storefront-data/package.json
📚 Learning: 2026-05-07T19:05:58.339Z
Learnt from: redeyecz
Repo: TechsioCZ/new-engine PR: 390
File: apps/medusa-be/package.json:78-81
Timestamp: 2026-05-07T19:05:58.339Z
Learning: When reviewing changes to `package.json`, do not automatically flag dependency additions/removals as "manually edited" or as "bypassing the pnpm lockfile" just because the `package.json` diff shows only that file changed. First verify whether `pnpm-lock.yaml` is missing the corresponding entries. Since `pnpm add` updates both `package.json` and `pnpm-lock.yaml` together, legitimate changes can appear in the `package.json` diff while still being properly tracked in the lockfile.
Applied to files:
libs/storefront-data/package.json
🪛 LanguageTool
libs/storefront-data/skills/extend-storefront-data-for-new-backend-use-cases/references/extension-recipe.md
[style] ~8-~8: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... helpers through createQueryKey(). 4. Add the Medusa service and forward `AbortSi...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~9-~9: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...a service and forward AbortSignal. 5. Add hooks or helper functions that match ex...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
libs/storefront-data/skills/use-catalog-and-product-read-flows/SKILL.md
[uncategorized] ~161-~161: Possible missing comma found.
Context: ...already exist. During routing or region bootstrap they throw instead of waiting. Source:...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~208-~208: Possible missing comma found.
Context: ...alize region-aware inputs. Missing them fragments payload shape and cache identity across...
(AI_HYDRA_LEO_MISSING_COMMA)
libs/storefront-data/skills/implement-cart-and-checkout-platform-flows/SKILL.md
[misspelling] ~238-~238: This word is normally spelled as one.
Context: ...tching is now shared platform behavior. Hand-written heuristics drift from the tested cache ...
(EN_COMPOUNDS_HAND_WRITTEN)
libs/storefront-data/skills/audit-storefront-before-release/SKILL.md
[misspelling] ~78-~78: This word is normally spelled as one.
Context: ...tQueryDataorinvalidateQueries` with hand-written cart keys. Fix: reuse the shared cart-c...
(EN_COMPOUNDS_HAND_WRITTEN)
libs/storefront-data/skills/configure-pagination-prefetch-and-cache-policy/references/prefetch-and-pagination.md
[uncategorized] ~5-~5: Loose punctuation mark.
Context: ...ference ## Cache strategies - static: very slow-changing data such as regions...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~10-~10: Use a comma before ‘so’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...defaults. Keep the strategy names intact so the rest of the package still reasons a...
(COMMA_COMPOUND_SENTENCE_2)
[uncategorized] ~14-~14: Loose punctuation mark.
Context: ... ## Skip modes - skipIfCached: false: always prefetch - skipIfCached: true ...
(UNLIKELY_OPENING_PUNCTUATION)
libs/storefront-data/skills/implement-auth-and-customer-session-flows/SKILL.md
[misspelling] ~152-~152: This word is normally spelled as one.
Context: ...c/auth/hooks.ts` ### CRITICAL Assuming multi-step auth is already supported Wrong: ```t...
(EN_COMPOUNDS_MULTI_STEP)
[misspelling] ~169-~169: This word is normally spelled as one.
Context: ...The current Medusa auth adapter rejects multi-step flows. The obvious generic-provider sha...
(EN_COMPOUNDS_MULTI_STEP)
libs/storefront-data/skills/extend-storefront-data-for-new-backend-use-cases/SKILL.md
[uncategorized] ~140-~140: Use a comma before ‘or’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...participate in normalized key generation or they drift from invalidation and cache-...
(COMMA_COMPOUND_SENTENCE)
[duplication] ~169-~169: Possible typo: you repeated a word.
Context: ...src/orders/medusa-service.ts`, TanStack Query query cancellation docs ### HIGH Shared beha...
(ENGLISH_WORD_REPEAT_RULE)
libs/storefront-data/skills/configure-pagination-prefetch-and-cache-policy/SKILL.md
[misspelling] ~30-~30: This word is normally spelled as one.
Context: ...h helpers instead of app-local loops or hand-written query keys. ```ts // src/lib/storefron...
(EN_COMPOUNDS_HAND_WRITTEN)
🪛 markdownlint-cli2 (0.22.1)
libs/storefront-data/skills/use-catalog-and-product-read-flows/SKILL.md
[warning] 25-25: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
libs/storefront-data/skills/implement-cart-and-checkout-platform-flows/SKILL.md
[warning] 26-26: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
libs/storefront-data/skills/audit-storefront-before-release/SKILL.md
[warning] 23-23: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
libs/storefront-data/skills/implement-ssr-prefetch-and-query-client-boundaries/SKILL.md
[warning] 24-24: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
libs/storefront-data/skills/implement-auth-and-customer-session-flows/SKILL.md
[warning] 22-22: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
libs/storefront-data/skills/migrate-custom-hooks-to-storefront-data/SKILL.md
[warning] 21-21: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
libs/storefront-data/skills/extend-storefront-data-for-new-backend-use-cases/SKILL.md
[warning] 23-23: First line in a file should be a top-level heading
(MD041, first-line-heading, first-line-h1)
🔇 Additional comments (29)
libs/storefront-data/package.json (2)
5-9: LGTM!Also applies to: 283-284, 329-331
237-260: Lockfile matches the dependency changes
pnpm-lock.yamlcontains entries for the bumped Medusa SDK/types and the added TanStack intent:@medusajs/js-sdk2.15.2 (specifier^2.15.2/2.15.2),@medusajs/types2.15.2 (specifier^2.15.2/2.15.2), and@tanstack/intent0.0.42 (specifier^0.0.42).apps/herbatika/src/components/product-lists/use-account-product-lists.ts (1)
115-120: LGTM!Also applies to: 442-442
apps/herbatika/src/components/product-lists/product-list-tabs.tsx (1)
30-67: LGTM!Also applies to: 120-120, 127-129
libs/storefront-data/tests/product-lists.medusa-service.test.ts (1)
1-176: LGTM!libs/storefront-data/tests/product-lists.utils.test.ts (1)
1-71: LGTM!libs/storefront-data/tests/product-lists.hooks.test.tsx (1)
1-210: LGTM!libs/storefront-data/src/product-lists/input-utils.ts (1)
1-68: LGTM!libs/storefront-data/src/product-lists/utils.ts (1)
20-21: LGTM!libs/storefront-data/src/product-lists/medusa-service.ts (1)
372-374: LGTM!Also applies to: 387-389
libs/storefront-data/src/product-lists/query-options.ts (1)
11-15: LGTM!libs/storefront-data/src/product-lists/hooks.ts (6)
74-87: LGTM!
11-35: LGTM!
424-470: LGTM!
604-668: LGTM!
670-738: LGTM!
1023-1045: LGTM!libs/storefront-data/skills/audit-storefront-before-release/SKILL.md (1)
1-192: LGTM!libs/storefront-data/skills/configure-pagination-prefetch-and-cache-policy/SKILL.md (1)
1-236: LGTM!libs/storefront-data/skills/configure-pagination-prefetch-and-cache-policy/references/prefetch-and-pagination.md (1)
1-46: LGTM!libs/storefront-data/skills/setup-storefront-platform-in-next-app/SKILL.md (1)
1-210: LGTM!libs/storefront-data/skills/use-storefront-data-skills/SKILL.md (1)
1-82: LGTM!libs/storefront-data/skills/decide-app-specific-overrides-vs-shared-platform/SKILL.md (1)
1-195: LGTM!libs/storefront-data/skills/extend-storefront-data-for-new-backend-use-cases/SKILL.md (1)
1-192: LGTM!libs/storefront-data/skills/extend-storefront-data-for-new-backend-use-cases/references/extension-recipe.md (1)
1-21: LGTM!libs/storefront-data/skills/implement-auth-and-customer-session-flows/SKILL.md (1)
1-234: LGTM!libs/storefront-data/skills/implement-ssr-prefetch-and-query-client-boundaries/SKILL.md (1)
1-224: LGTM!libs/storefront-data/skills/migrate-custom-hooks-to-storefront-data/SKILL.md (1)
1-192: LGTM!libs/storefront-data/skills/use-catalog-and-product-read-flows/SKILL.md (1)
1-237: LGTM!
Summary by CodeRabbit
New Features
Refactor
Tests