Skip to content

fix: correct herbatika package name and lint failures - #463

Merged
BleedingDev merged 8 commits into
masterfrom
codex/fix-herbatika-lint
Jun 22, 2026
Merged

fix: correct herbatika package name and lint failures#463
BleedingDev merged 8 commits into
masterfrom
codex/fix-herbatika-lint

Conversation

@BleedingDev

@BleedingDev BleedingDev commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

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

  • Rename the Herbatika package to herbatika and update Docker pnpm filters to match.
  • Extract the storefront-auth registration flow into register-flow.ts so route.ts remains a thin request/response adapter and stays under the file-size guardrail.
  • Reduce review error-message complexity by moving known status/message handling into small helpers.
  • Replace the checkout constants direct re-export with explicit local aliases.
  • Apply the remaining Biome formatting, import ordering, and JSX prop ordering fixes reported by lint.

Validation

  • pnpm install --frozen-lockfile --ignore-scripts
  • pnpm lint:nx
  • pnpm exec nx run new-engine-ctl:test
  • pnpm exec nx run herbatika:lint
  • pnpm exec nx affected -t lint test
  • pnpm exec nx run herbatika:build

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

    • Added a customer registration and login flow, including automatic customer profile creation.
    • Enabled optional wholesale business profile registration during signup.
  • Bug Fixes

    • Improved product review submit error messaging with clearer handling for validation issues, duplicate submissions, and account-related responses, ensuring more consistent user-facing feedback.

@semanticdiff-com

semanticdiff-com Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review changes with  SemanticDiff

Changed Files
File Status
  apps/herbatika/src/components/reviews/product-review-errors.ts  18% smaller
  apps/herbatika/src/app/api/storefront-auth/register/register-flow.ts  17% smaller

@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
new-engine-ui-storybook Ready Ready Preview, Comment Jun 22, 2026 9:11am

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 19b2d938-9167-4f00-b35c-18331fede22a

📥 Commits

Reviewing files that changed from the base of the PR and between 886df13 and 052c689.

📒 Files selected for processing (1)
  • apps/herbatika/src/components/reviews/product-review-errors.ts

Walkthrough

A new register-flow.ts module is added, exporting ParsedRegisterPayload and five helper functions (refreshCustomerToken, createCustomerIdentity, loginCustomerIdentity, createCustomerProfile, createWholesaleProfile) that encapsulate Medusa API calls for storefront registration. Separately, product-review-errors.ts is refactored to centralise error-to-message mapping using rule-based constants and a new resolveKnownReviewErrorMessage helper.

Changes

Register flow extraction

Layer / File(s) Summary
New register-flow module: types and helpers
apps/herbatika/src/app/api/storefront-auth/register/register-flow.ts
Defines ParsedRegisterPayload type and exports refreshCustomerToken, createCustomerIdentity, loginCustomerIdentity, createCustomerProfile, and createWholesaleProfile; each function wraps a Medusa fetch call with structured error and null-on-success return shapes. Internally uses buildCustomerProfile to map registration payload fields into Medusa customer create shape.

Product review error handling refactor

Layer / File(s) Summary
Error resolution constants and detection helpers
apps/herbatika/src/components/reviews/product-review-errors.ts
Adds validation and duplicate-message rule constants (REVIEW_VALIDATION_MESSAGE_RULES, DUPLICATE_REVIEW_MESSAGE_RULES, BAD_REQUEST_REVIEW_STATUSES), and helper functions for duplicate-review and validation-message detection using AND-semantics pattern matching with multi-keyword sequences.
Consolidated error resolution pipeline
apps/herbatika/src/components/reviews/product-review-errors.ts
Extends resolveKnownReviewErrorMessage with ordered precedence for token-related, 409 conflict, purchase-required, duplicate-review, and 400/422 validation messages; updates resolveProductReviewSubmitErrorMessage to delegate to the consolidated resolver with knownMessage || message || GENERIC_REVIEW_SUBMIT_ERROR precedence.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • TechsioCZ/new-engine#457: Directly related — updates /register/route.ts and wholesale parsing/request helpers that are the intended consumers of the register-flow.ts helpers introduced in this PR.
🚥 Pre-merge checks | ✅ 3 | ❌ 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 title references package naming and lint failures, which aligns with the PR's stated objectives, but the changeset includes two substantial refactorings (storefront-auth registration flow extraction and review error-message handling refactoring) that represent the bulk of the work and are only tangentially mentioned in the title. Consider a more specific title that captures the primary code changes, such as 'refactor: extract storefront registration flow and centralise review error handling' to better reflect the substantial refactorings beyond lint fixes.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-herbatika-lint
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch codex/fix-herbatika-lint

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps

greptile-apps Bot commented Jun 18, 2026

Copy link
Copy Markdown

Greptile Summary

This PR fixes lint failures in the Herbatika app by extracting the register flow into its own file and refactoring the product-review error-resolution module to reduce cyclomatic complexity.

  • createWholesaleProfile gains async, aligning its return type to Promise<T | null> instead of the inconsistent Promise<T> | null.
  • product-review-errors.ts introduces named helper functions (resolveKnownReviewErrorMessage, isDuplicateReviewError, resolveReviewValidationMessage) that consolidate status/message handling; HTTP status checks now take priority over message-pattern matching, and 400/422 responses always surface a localized Slovak validation message rather than the raw upstream string.
  • Broad duplicate-keyword detection is explicitly suppressed for 400/422 statuses (documented via comment), while the more specific multi-keyword rules still fire regardless of status.

Confidence Score: 5/5

Safe to merge — both changes are narrow and well-scoped: a one-line async annotation and a complexity-reducing refactor that preserves the same observable error messages in all expected scenarios.

The async addition to createWholesaleProfile correctly fixes a type inconsistency without changing runtime behavior for await-ing callers. The error-message refactoring introduces no new logic paths — it reorganises existing conditions into named helpers and makes two deliberate, documented improvements (status codes take priority over message patterns; 400/422 always surface localized text). Edge-case ordering changes (401/403 before purchase-required) are arguably more correct than the previous behaviour and are unlikely to manifest in a real API response.

No files require special attention.

Important Files Changed

Filename Overview
apps/herbatika/src/app/api/storefront-auth/register/register-flow.ts Single-line fix: adds async to createWholesaleProfile, correcting its return type from `Promise
apps/herbatika/src/components/reviews/product-review-errors.ts Refactors error resolution into small named helpers (resolveKnownReviewErrorMessage, isDuplicateReviewError, resolveReviewValidationMessage). Status-code checks now take priority over message-pattern checks; 400/422 paths always return a localized Slovak message rather than the raw API string; broad duplicate keywords are intentionally suppressed for validation statuses.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A([resolveProductReviewSubmitErrorMessage]) --> B{message & status present?}
    B -- No --> Z([GENERIC_ERROR])
    B -- Yes --> C[resolveKnownReviewErrorMessage]

    C --> D{token message?}
    D -- Yes --> E([token-specific message])
    D -- No --> F{status === 409?}
    F -- Yes --> G([duplicate message])
    F -- No --> H{status === 401?}
    H -- Yes --> I([auth message])
    H -- No --> J{status === 403?}
    J -- Yes --> K([forbidden message])
    J -- No --> L{purchase-required message?}
    L -- Yes --> M([PURCHASE_REQUIRED_ERROR])
    L -- No --> N{isDuplicateReviewError?}
    N -- specific patterns match OR 409 --> G
    N -- status 400/422 suppress broad keywords --> O{status 400 or 422?}
    O -- Yes --> P([resolveReviewValidationMessage - localized Slovak])
    O -- No --> Q{status >= 500?}
    Q -- Yes --> Z
    Q -- No --> R([null - fallback to raw message or GENERIC_ERROR])
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A([resolveProductReviewSubmitErrorMessage]) --> B{message & status present?}
    B -- No --> Z([GENERIC_ERROR])
    B -- Yes --> C[resolveKnownReviewErrorMessage]

    C --> D{token message?}
    D -- Yes --> E([token-specific message])
    D -- No --> F{status === 409?}
    F -- Yes --> G([duplicate message])
    F -- No --> H{status === 401?}
    H -- Yes --> I([auth message])
    H -- No --> J{status === 403?}
    J -- Yes --> K([forbidden message])
    J -- No --> L{purchase-required message?}
    L -- Yes --> M([PURCHASE_REQUIRED_ERROR])
    L -- No --> N{isDuplicateReviewError?}
    N -- specific patterns match OR 409 --> G
    N -- status 400/422 suppress broad keywords --> O{status 400 or 422?}
    O -- Yes --> P([resolveReviewValidationMessage - localized Slovak])
    O -- No --> Q{status >= 500?}
    Q -- Yes --> Z
    Q -- No --> R([null - fallback to raw message or GENERIC_ERROR])
Loading

Reviews (8): Last reviewed commit: "Merge branch 'master' into codex/fix-her..." | Re-trigger Greptile

@BleedingDev
BleedingDev marked this pull request as ready for review June 18, 2026 20:36
@BleedingDev

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@kilo-code-bot

kilo-code-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
apps/herbatika/src/components/reviews/product-review-errors.ts 91 Duplicate review detection uses narrow AND-pattern matching (DUPLICATE_REVIEW_MESSAGE_RULES) that may miss backend messages unless status is 409. Original OR-based matching was broader.
apps/herbatika/src/components/reviews/product-review-errors.ts 123 status === 401 check comes AFTER isPurchaseRequiredReviewMessage, causing incorrect behavior: a 401 response with purchase-related message text returns purchase-required copy instead of login prompt.
Other Observations (not in diff)

None.

Files Reviewed (2 files)
  • apps/herbatika/src/app/api/storefront-auth/register/register-flow.ts - 0 issues
  • apps/herbatika/src/components/reviews/product-review-errors.ts - 2 issues
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

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
apps/herbatika/src/components/reviews/product-review-errors.ts 91 Duplicate review detection uses narrow AND-pattern matching (DUPLICATE_REVIEW_MESSAGE_RULES) that may miss backend messages unless status is 409. Original OR-based matching was broader.
apps/herbatika/src/components/reviews/product-review-errors.ts 123 status === 401 check comes AFTER isPurchaseRequiredReviewMessage, causing incorrect behavior: a 401 response with purchase-related message text returns purchase-required copy instead of login prompt.
Other Observations (not in diff)

None.

Files Reviewed (2 files)
  • apps/herbatika/src/app/api/storefront-auth/register/register-flow.ts - 0 issues
  • apps/herbatika/src/components/reviews/product-review-errors.ts - 2 issues

Reviewed by laguna-m.1-20260312:free · Input: 1.1M · Output: 32.6K · Cached: 125.2K

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between ef4c3c0 and bcb6bc8.

📒 Files selected for processing (11)
  • apps/herbatika/package.json
  • apps/herbatika/src/app/api/storefront-auth/register/register-flow.ts
  • apps/herbatika/src/app/api/storefront-auth/register/route.ts
  • apps/herbatika/src/components/auth/register-account-type-field.tsx
  • apps/herbatika/src/components/auth/register-form.tsx
  • apps/herbatika/src/components/auth/use-auth-controller.ts
  • apps/herbatika/src/components/checkout/checkout.constants.ts
  • apps/herbatika/src/components/reviews/product-review-errors.ts
  • apps/herbatika/src/lib/auth/auth-form-validators.ts
  • apps/herbatika/src/styles/tokens/components/molecules/_herbatika-toast.css
  • docker/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-kit namespace, not @libs/ui, for runtime apps

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
**/*.{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.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
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.ts
  • apps/herbatika/package.json
  • apps/herbatika/src/styles/tokens/components/molecules/_herbatika-toast.css
  • 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
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.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
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.ts
  • apps/herbatika/src/styles/tokens/components/molecules/_herbatika-toast.css
  • 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
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.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
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.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
**/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.css
  • apps/herbatika/src/components/auth/register-form.tsx
  • apps/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-kit instead 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.

Comment thread apps/herbatika/src/app/api/storefront-auth/register/register-flow.ts Outdated
Comment thread apps/herbatika/src/components/reviews/product-review-errors.ts
@BleedingDev BleedingDev changed the title [codex] fix herbatika lint fix: correct herbatika package name and lint failures Jun 19, 2026
Comment thread apps/herbatika/src/components/reviews/product-review-errors.ts
Comment thread apps/herbatika/src/components/reviews/product-review-errors.ts
Comment thread apps/herbatika/src/components/reviews/product-review-errors.ts
@BleedingDev
BleedingDev merged commit 2f4bca4 into master Jun 22, 2026
5 of 6 checks passed
@BleedingDev
BleedingDev deleted the codex/fix-herbatika-lint branch June 22, 2026 09:14
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.17.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants