fix: correct herbatika package name and lint failures - #463
Conversation
Changed Files
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughA new ChangesRegister flow extraction
Product review error handling refactor
Sequence Diagram(s)sequenceDiagram
participant Client as Client/Route
participant createCustomerIdentity as createCustomerIdentity<br/>(Medusa register)
participant loginCustomerIdentity as loginCustomerIdentity<br/>(Medusa login)
participant createCustomerProfile as createCustomerProfile<br/>(Medusa /store/customers)
participant refreshCustomerToken as refreshCustomerToken<br/>(Medusa token refresh)
participant createWholesaleProfile as createWholesaleProfile<br/>(Wholesale request)
Client->>createCustomerIdentity: email, password, wholesale
createCustomerIdentity-->>Client: null or error
Client->>loginCustomerIdentity: email, password
loginCustomerIdentity-->>Client: {token, error}
Client->>createCustomerProfile: loginToken, payload
createCustomerProfile-->>Client: null or error
Client->>refreshCustomerToken: loginToken
refreshCustomerToken-->>Client: sessionToken
Client->>createWholesaleProfile: email, sessionToken, wholesale
createWholesaleProfile-->>Client: null or error
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. 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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Code Review SummaryStatus: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Other Observations (not in diff)None. Files Reviewed (2 files)
Previous Review Summary (commit 4460d6a)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 4460d6a)Status: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Other Observations (not in diff)None. Files Reviewed (2 files)
Reviewed by laguna-m.1-20260312:free · Input: 1.1M · Output: 32.6K · Cached: 125.2K |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@apps/herbatika/src/app/api/storefront-auth/register/register-flow.ts`:
- Around line 170-185: The function createWholesaleProfile has inconsistent
return types: it returns null synchronously when wholesale is falsy, but returns
a Promise when wholesale is truthy. Mark the function as async to normalize the
return type to always be Promise<null | ...>, which will make it consistent with
the rest of the module and improve readability. When declared as async, the
function will automatically wrap both the null and the Promise result in a
Promise, ensuring callers always know to await the function result.
In `@apps/herbatika/src/components/reviews/product-review-errors.ts`:
- Around line 98-100: The condition checking BAD_REQUEST_REVIEW_STATUSES
currently returns the raw backend message without sanitization, which could
expose implementation details. Instead of returning the raw message directly,
implement a mapping or validation layer that converts known backend validation
error patterns to localized user-friendly messages. For any backend message that
doesn't match a known pattern, fall back to the default localized message
"Skontrolujte prosím hodnotenie a text recenzie." This ensures consistency and
prevents accidental exposure of backend implementation details in the
user-facing error message.
🪄 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: 233124e2-9daf-4e9c-b9e3-a61f3e0e3ffc
📒 Files selected for processing (11)
apps/herbatika/package.jsonapps/herbatika/src/app/api/storefront-auth/register/register-flow.tsapps/herbatika/src/app/api/storefront-auth/register/route.tsapps/herbatika/src/components/auth/register-account-type-field.tsxapps/herbatika/src/components/auth/register-form.tsxapps/herbatika/src/components/auth/use-auth-controller.tsapps/herbatika/src/components/checkout/checkout.constants.tsapps/herbatika/src/components/reviews/product-review-errors.tsapps/herbatika/src/lib/auth/auth-form-validators.tsapps/herbatika/src/styles/tokens/components/molecules/_herbatika-toast.cssdocker/development/herbatika/Dockerfile
📜 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). (1)
- GitHub Check: Kilo Code Review
🧰 Additional context used
📓 Path-based instructions (11)
apps/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Import UI components using the
@techsio/ui-kitnamespace, not@libs/ui, for runtime apps
Files:
apps/herbatika/src/components/auth/use-auth-controller.tsapps/herbatika/src/components/checkout/checkout.constants.tsapps/herbatika/src/components/auth/register-form.tsxapps/herbatika/src/lib/auth/auth-form-validators.tsapps/herbatika/src/app/api/storefront-auth/register/route.tsapps/herbatika/src/components/reviews/product-review-errors.tsapps/herbatika/src/components/auth/register-account-type-field.tsxapps/herbatika/src/app/api/storefront-auth/register/register-flow.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Run Biome linting and formatting only on changed files using 'bunx biome check --write path/to/file'
Files:
apps/herbatika/src/components/auth/use-auth-controller.tsapps/herbatika/src/components/checkout/checkout.constants.tsapps/herbatika/src/components/auth/register-form.tsxapps/herbatika/src/lib/auth/auth-form-validators.tsapps/herbatika/src/app/api/storefront-auth/register/route.tsapps/herbatika/src/components/reviews/product-review-errors.tsapps/herbatika/src/components/auth/register-account-type-field.tsxapps/herbatika/src/app/api/storefront-auth/register/register-flow.ts
apps/herbatika/**
📄 CodeRabbit inference engine (AGENTS.md)
apps/herbatika/**: Read apps/herbatika/AGENTS.md before editing Herbatika app and follow its specific configuration which overrides root assumptions
Herbatika app runs on http://localhost:3001 and routes work through libs/ui/skills and libs/storefront-data/skills workflows
Files:
apps/herbatika/src/components/auth/use-auth-controller.tsapps/herbatika/package.jsonapps/herbatika/src/styles/tokens/components/molecules/_herbatika-toast.cssapps/herbatika/src/components/checkout/checkout.constants.tsapps/herbatika/src/components/auth/register-form.tsxapps/herbatika/src/lib/auth/auth-form-validators.tsapps/herbatika/src/app/api/storefront-auth/register/route.tsapps/herbatika/src/components/reviews/product-review-errors.tsapps/herbatika/src/components/auth/register-account-type-field.tsxapps/herbatika/src/app/api/storefront-auth/register/register-flow.ts
apps/**/!(medusa-be)/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use modern React patterns and React 19 for frontend applications in the monorepo
Files:
apps/herbatika/src/components/auth/use-auth-controller.tsapps/herbatika/src/components/checkout/checkout.constants.tsapps/herbatika/src/components/auth/register-form.tsxapps/herbatika/src/lib/auth/auth-form-validators.tsapps/herbatika/src/app/api/storefront-auth/register/route.tsapps/herbatika/src/components/reviews/product-review-errors.tsapps/herbatika/src/components/auth/register-account-type-field.tsxapps/herbatika/src/app/api/storefront-auth/register/register-flow.ts
apps/herbatika/src/**
📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md)
apps/herbatika/src/**: Put Herbatika visual differences in src/styles/tokens/**; avoid JSX className overrides that duplicate UI-kit component props/tokens.
Use kebab-case for file names and PascalCase for React component names in Herbatika.
Files:
apps/herbatika/src/components/auth/use-auth-controller.tsapps/herbatika/src/styles/tokens/components/molecules/_herbatika-toast.cssapps/herbatika/src/components/checkout/checkout.constants.tsapps/herbatika/src/components/auth/register-form.tsxapps/herbatika/src/lib/auth/auth-form-validators.tsapps/herbatika/src/app/api/storefront-auth/register/route.tsapps/herbatika/src/components/reviews/product-review-errors.tsapps/herbatika/src/components/auth/register-account-type-field.tsxapps/herbatika/src/app/api/storefront-auth/register/register-flow.ts
apps/herbatika/src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md)
apps/herbatika/src/**/*.{ts,tsx}: Use explicit package subpath imports from@techsio/storefront-data. Do not import from package roots or dist/.
Keep server-only and client-only boundaries explicit in Herbatika app code; use 'server-only' and 'getServerQueryClient' for Server Component/SSR data paths.
Files:
apps/herbatika/src/components/auth/use-auth-controller.tsapps/herbatika/src/components/checkout/checkout.constants.tsapps/herbatika/src/components/auth/register-form.tsxapps/herbatika/src/lib/auth/auth-form-validators.tsapps/herbatika/src/app/api/storefront-auth/register/route.tsapps/herbatika/src/components/reviews/product-review-errors.tsapps/herbatika/src/components/auth/register-account-type-field.tsxapps/herbatika/src/app/api/storefront-auth/register/register-flow.ts
apps/herbatika/src/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md)
Keep source files at a soft limit of ~200 lines; exceeding this should trigger refactor consideration.
Files:
apps/herbatika/src/components/auth/use-auth-controller.tsapps/herbatika/src/components/checkout/checkout.constants.tsapps/herbatika/src/components/auth/register-form.tsxapps/herbatika/src/lib/auth/auth-form-validators.tsapps/herbatika/src/app/api/storefront-auth/register/route.tsapps/herbatika/src/components/reviews/product-review-errors.tsapps/herbatika/src/components/auth/register-account-type-field.tsxapps/herbatika/src/app/api/storefront-auth/register/register-flow.ts
**/package.json
📄 CodeRabbit inference engine (CLAUDE.md)
Use pnpm CLI to add dependencies; never edit package.json directly
Files:
apps/herbatika/package.json
apps/herbatika/src/**/*.{jsx,tsx,css}
📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md)
Use token-based utility classes instead of raw Tailwind palette/spacing values. Prefer tokenized classes like p-200, mt-300, gap-150, text-success, bg-danger over raw Tailwind values like p-4, mt-8, bg-red-600.
Files:
apps/herbatika/src/styles/tokens/components/molecules/_herbatika-toast.cssapps/herbatika/src/components/auth/register-form.tsxapps/herbatika/src/components/auth/register-account-type-field.tsx
apps/herbatika/src/**/*.{jsx,tsx}
📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md)
apps/herbatika/src/**/*.{jsx,tsx}: Use internal UI primitives/components from@techsio/ui-kitinstead of native controls in app code. Avoid raw , , , <textarea>, , inline SVG icons. For Next.js links/images, prefer the UI-kit component with next/link or next/image adapter support when that component exposes it. Files: apps/herbatika/src/components/auth/register-form.tsx apps/herbatika/src/components/auth/register-account-type-field.tsx apps/herbatika/src/lib/**/*.{ts,tsx} 📄 CodeRabbit inference engine (apps/herbatika/AGENTS.md) Keep app-local storefront code thin: SDK instance, field defaults, localized text, toasts, analytics, form DTOs, address adapters, and Herbatika-specific read models can stay in app code. Move repeated backend communication, query key construction, cache sync, and mutation invalidation into libs/storefront-data. Files: apps/herbatika/src/lib/auth/auth-form-validators.ts 🧠 Learnings (7) 📚 Learning: 2026-06-14T17:05:00.817Z Learnt from: KaiUweCZE Repo: TechsioCZ/new-engine PR: 442 File: apps/herbatika/src/components/reviews/product-review-token-page.tsx:36-42 Timestamp: 2026-06-14T17:05:00.817Z Learning: When reviewing code in apps/herbatika that calls `useProducts(input: ProductListInput, options?)`, treat `enabled` provided inside the first argument (`input`) as intentional and valid. The `ProductListInput` type includes an optional `enabled?: boolean` (via `BaseStorefrontProductListInput & { enabled?: boolean }`), and the hook infrastructure strips `enabled` before constructing the HTTP request and query key (following the same `stripListInput` behavior used elsewhere). Therefore, do NOT flag `useProducts({ enabled: ... , ... }, options)` as a contract violation; `enabled` belongs in the input object, not in the `options` argument. Applied to files: apps/herbatika/src/components/auth/use-auth-controller.ts apps/herbatika/src/components/checkout/checkout.constants.ts apps/herbatika/src/components/auth/register-form.tsx apps/herbatika/src/lib/auth/auth-form-validators.ts apps/herbatika/src/app/api/storefront-auth/register/route.ts apps/herbatika/src/components/reviews/product-review-errors.ts apps/herbatika/src/components/auth/register-account-type-field.tsx apps/herbatika/src/app/api/storefront-auth/register/register-flow.ts 📚 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: apps/herbatika/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: apps/herbatika/package.json 📚 Learning: 2026-05-20T15:58:53.048Z Learnt from: redeyecz Repo: TechsioCZ/new-engine PR: 413 File: apps/medusa-be/package.json:77-80 Timestamp: 2026-05-20T15:58:53.048Z Learning: When reviewing monorepo `package.json` files, treat any dependencies/devDependencies using the `paykit-sdk/*` scope (e.g., `paykit-sdk/core`, `paykit-sdk/stripe`, `paykit-sdk/comgate`, `paykit-sdk/gopay`) as coming from the TechsioCZ/new-engine private npm registry. Do not flag dependency version constraints (e.g., `^1.2.0`) as invalid merely because those packages/versions are not found on the public npm registry. Public-web/private-web availability checks against the public npm API are not applicable for these packages; if validation is needed, rely on the private registry/CI install behavior instead. Applied to files: apps/herbatika/package.json 📚 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: apps/herbatika/src/components/auth/register-form.tsx apps/herbatika/src/components/auth/register-account-type-field.tsx 📚 Learning: 2026-05-07T22:45:20.745Z Learnt from: BleedingDev Repo: TechsioCZ/new-engine PR: 397 File: docker/development/medusa-be/Dockerfile:34-38 Timestamp: 2026-05-07T22:45:20.745Z Learning: For pnpm-based monorepo Dockerfiles that run `pnpm fetch --frozen-lockfile`, ensure the `patches/` directory is copied into the image (e.g., `COPY patches ./patches`) before running `pnpm fetch`. pnpm’s `fetch` reads `patchedDependencies` from the lockfile/workspace configuration and will fail (e.g., `ERR_PNPM_PATCH_NOT_FOUND`) if patch files aren’t present yet—do not move the `COPY patches` step to after `pnpm fetch`. Applied to files: docker/development/herbatika/Dockerfile 📚 Learning: 2026-05-07T22:45:38.566Z Learnt from: BleedingDev Repo: TechsioCZ/new-engine PR: 397 File: docker/development/n1/Dockerfile:40-44 Timestamp: 2026-05-07T22:45:38.566Z Learning: When building this repo in Docker, ensure the `patches/` directory is copied into the image (e.g., `COPY patches ./patches`) before running `pnpm fetch --frozen-lockfile`. `pnpm fetch` validates `patchedDependencies` patch file paths from `pnpm-workspace.yaml`/`package.json`, and if `./patches` doesn’t exist yet it will fail with `ERR_PNPM_PATCH_NOT_FOUND`. Place the `COPY patches` step before the `RUN pnpm fetch` step in the relevant service Dockerfiles; this ordering is intentional and should not be flagged as an unnecessary cache-busting change. Applied to files: docker/development/herbatika/Dockerfile 🪛 Biome (2.5.0) apps/herbatika/src/styles/tokens/components/molecules/_herbatika-toast.css [error] 1-4: Tailwind-specific syntax is disabled. (parse) 🔇 Additional comments (19) apps/herbatika/src/components/checkout/checkout.constants.ts (1) 2-10: LGTM! apps/herbatika/src/components/auth/register-account-type-field.tsx (1) 37-48: LGTM! apps/herbatika/src/components/auth/register-form.tsx (1) 106-108: LGTM! apps/herbatika/src/components/auth/use-auth-controller.ts (1) 15-15: LGTM! Also applies to: 30-30 apps/herbatika/src/lib/auth/auth-form-validators.ts (1) 1-1: LGTM! Also applies to: 60-61 apps/herbatika/src/styles/tokens/components/molecules/_herbatika-toast.css (1) 1-4: Verify the static analysis error in the CSS file. Biome has flagged a parse error: "Tailwind-specific syntax is disabled" on lines 1–4. The content appears to be valid CSS custom property declarations within a @theme static block. Verify whether: This error blocks the build or is a known false positive. The @theme static syntax is valid and correctly configured in your project's CSS/Tailwind setup. The error is resolved after running bunx biome check --write per the coding guidelines. Please run Biome's check on this file to confirm the build will pass. apps/herbatika/src/components/reviews/product-review-errors.ts (2) 6-6: LGTM! 57-66: False-positives risk in duplicate review detection due to overly broad keywords. The keywords "exist" and "reviewed" in isDuplicateReviewMessage are quite broad and may match unrelated error messages. For example, a validation error such as "rating field does not exist" would incorrectly trigger the duplicate-review message ("Tento produkt ste už hodnotili."), confusing users. Consider narrowing the detection to multi-word phrases or verifying the backend error messages will never contain these words in non-duplicate contexts. apps/herbatika/src/app/api/storefront-auth/register/register-flow.ts (5) 16-22: LGTM! 24-41: LGTM! 43-75: LGTM! 77-122: LGTM! 124-168: LGTM! apps/herbatika/src/app/api/storefront-auth/register/route.ts (2) 1-11: LGTM! 86-124: LGTM! apps/herbatika/package.json (1) 2-2: LGTM! docker/development/herbatika/Dockerfile (3) 23-25: LGTM! 56-57: LGTM! 62-64: Manual verification required for remaining "herbatica" references. Automated verification of the codebase could not be completed due to infrastructure issues. Please manually verify that no remaining references to the old package name "herbatica" exist outside of expected locations (such as CHANGELOG entries or dependency lock files). This will ensure the typo fix is complete across the entire codebase.
|
🎉 This PR is included in version 0.17.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
This PR fixes the Herbatika lint failure in the affected pipeline and aligns the workspace metadata with the app path/project name.
The affected lint target was failing on Biome diagnostics in Herbatika, including excessive complexity, import/attribute ordering, formatting, and a direct re-export that triggered the barrel-file rule. Local Nx resolution also exposed that apps/herbatika/package.json still used the old herbatica package name while the app path and CI affected output use herbatika.
Fix
Validation
Note: Herbatika guardrails still report existing token/file-size baseline debt unrelated to this fix; validate:ui-primitives passes, and this PR avoids adding a new file-size error.
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes