convert mcp and ui to typescript#144
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughMigrates MCP and UI packages from JavaScript to TypeScript/TSX, adds tsconfigs and build scripts, tightens types across MCP tools and UI components, updates MCP binary to Changes
Sequence Diagram(s)(Skipped — changes span many independent components and files; no single concise multi-component control flow to visualize.) Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
Comment |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
corates | 2668f35 | Commit Preview URL | Dec 24 2025, 11:50 PM |
There was a problem hiding this comment.
Actionable comments posted: 7
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (6)
packages/mcp/package.json (1)
6-27: The Zod version constraint is invalid and will fail installation.The package.json specifies
zod: "^4.2.1", which requires version 4.2.1 or higher. However, the latest stable Zod version available is 4.1.12 (released October 6, 2025). This version constraint cannot be satisfied and will causenpm installto fail.Update to a valid version such as
"^4.1.12"or"^4.1.0".packages/ui/src/zag/Collapsible.tsx (1)
57-77: Type mismatch: passing non-accessor to functions expecting Accessor.Lines 62 and 73 pass
collapsibleApidirectly to render functions, but the type signature inCollapsiblePropsspecifies these functions receiveAccessor<CollapsibleApi>(a function that returns the API). The value returned byuseCollapsibleis likely a reactive object/store, not an accessor function.Either:
- The prop type definition should be
(api: CollapsibleApi)instead of(api: Accessor<CollapsibleApi>)- Or wrap the API in an accessor:
() => collapsibleApi🔎 Proposed fixes
Option 1: Fix the type definition (if the API object is stable and reactive)
/** Trigger element or render function receiving collapsible API */ - trigger?: JSX.Element | ((api: Accessor<CollapsibleApi>) => JSX.Element); + trigger?: JSX.Element | ((api: CollapsibleApi) => JSX.Element); /** Indicator element or render function receiving collapsible API */ - indicator?: JSX.Element | ((api: Accessor<CollapsibleApi>) => JSX.Element); + indicator?: JSX.Element | ((api: CollapsibleApi) => JSX.Element);Option 2: Wrap the API in an accessor (if consumers need a function)
if (typeof triggerValue === 'function') { - return triggerValue(collapsibleApi); + return triggerValue(() => collapsibleApi); }if (typeof indicatorValue === 'function') { - return indicatorValue(collapsibleApi); + return indicatorValue(() => collapsibleApi); }packages/ui/src/zag/__tests__/tabs.test.tsx (1)
37-47: Replace emoji characters with proper icon components.The test fixtures use emoji characters (
📁,📄) which violates the coding guideline that states "NEVER use emojis anywhere in code, comments, documentation". Use components from thesolid-iconslibrary instead.Suggested fix using solid-icons
+import { FiFolder, FiFile } from 'solid-icons/fi'; + it('should render with icons', () => { const tabsWithIcons = [ - { value: 'tab1', label: 'Tab 1', icon: <span data-testid='icon1'>📁</span> }, - { value: 'tab2', label: 'Tab 2', icon: <span data-testid='icon2'>📄</span> }, + { value: 'tab1', label: 'Tab 1', icon: <FiFolder data-testid='icon1' /> }, + { value: 'tab2', label: 'Tab 2', icon: <FiFile data-testid='icon2' /> }, ];As per coding guidelines, always use 'solid-icons' library for icons.
packages/ui/src/zag/Select.tsx (1)
127-142: Unsafe type cast for multiple selection mode.The cast
details.value as unknown as stringon line 131 is type-unsafe. Whenmultipleis true,onChangereceives astring[]but the prop type declaresonChange?: (value: string) => void. Consider updating theonChangesignature to handle both cases.Proposed fix - update onChange signature
export interface SelectProps { // ... /** Callback when value changes */ - onChange?: (value: string) => void; + onChange?: (value: string | string[]) => void; // ... }Then update the handler:
const handleValueChange = (details: { value: string[] }) => { if (!local.onChange) return; if (merged.multiple) { - local.onChange(details.value as unknown as string); + local.onChange(details.value); } else { // ... } };packages/ui/src/zag/Clipboard.tsx (1)
70-83: API stub implementations may cause runtime issues.The
getRootProps,getLabelProps,getControlProps,getInputProps, andgetTriggerPropsmethods return empty objects{}. If consumers of the render prop API call these methods expecting actual props, they won't work correctly. Consider either removing these stubs or documenting that they're not fully implemented.packages/ui/src/zag/Avatar.tsx (1)
32-38: Potential runtime error ingetInitialswith edge cases.If
namecontains leading/trailing spaces or multiple consecutive spaces,partscould have empty strings, causingparts[0][0]to throw.Proposed defensive fix
const getInitials = () => { const displayName = name(); if (!displayName) return ''; - const parts = displayName.trim().split(' '); + const parts = displayName.trim().split(/\s+/).filter(Boolean); + if (parts.length === 0) return ''; if (parts.length === 1) return parts[0][0].toUpperCase(); return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase(); };
♻️ Duplicate comments (4)
packages/ui/src/zag/__tests__/tooltip.test.tsx (1)
7-7: Same concern: explicit.tsxextension in import.As noted in RadioGroup.test.tsx, verify that explicit file extensions work correctly with your build setup.
packages/ui/src/zag/__tests__/progress.test.tsx (1)
7-7: Same concern: explicit.tsxextension in import.See RadioGroup.test.tsx for details on verifying explicit file extensions.
packages/ui/src/zag/__tests__/Dialog.test.tsx (1)
7-7: Same concern: explicit.tsxextension in import.See RadioGroup.test.tsx for details on verifying explicit file extensions.
packages/ui/src/zag/Popover.tsx (1)
12-25: DuplicatePlacementtype.Same duplication issue as noted in
Tooltip.tsx. This is the fourth file with an identicalPlacementtype definition.
🧹 Nitpick comments (18)
renovate.json (1)
6-13: Overlapping package rules may cause unexpected grouping.A devDependency in
apps/**orpackages/**will match both rules. Renovate processes rules in order, so the first match (workspace dependencies) takes precedence. This means workspace devDependencies won't be grouped with other devDependencies as might be expected.If you intend to keep devDependencies separate regardless of location, reorder the rules or make them mutually exclusive using
excludeDepTypesin the first rule.Suggested reordering to clarify precedence
"packageRules": [ + { + "matchDepTypes": ["devDependencies"], + "groupName": "dev dependencies" + }, { "matchPaths": ["apps/**", "packages/**"], "groupName": "workspace dependencies" - }, - { - "matchDepTypes": ["devDependencies"], - "groupName": "dev dependencies" } ]Or make them mutually exclusive:
"packageRules": [ { "matchPaths": ["apps/**", "packages/**"], + "excludeDepTypes": ["devDependencies"], "groupName": "workspace dependencies" }, { "matchDepTypes": ["devDependencies"], "groupName": "dev dependencies" } ]packages/mcp/__tests__/icons.test.ts (1)
9-11: Consider importingIconManifestfrom a shared location.The
IconManifestinterface is duplicated here, inscrape-icons.ts, and potentially inicons.ts. For maintainability, consider exporting this interface from a central types file (e.g.,types.ts) and importing it in all three locations.packages/mcp/src/scrape-icons.ts (1)
15-32: Redundant type annotation withas const.Using
as constalready makes the array readonly with literal types, soreadonly string[]is redundant and actually widens the type. Consider removing the explicit type annotation:Suggested change
-const iconSets: readonly string[] = [ +const iconSets = [ 'ai', 'bi', // ... rest of items ] as const;packages/mcp/src/tools/lint.ts (1)
8-12: Refinecodeproperty type for accuracy.Node's
child_processexec errors typically havecodeasnumber | null, notstring. The current typing may be overly permissive.Suggested refinement
interface ExecError extends Error { stdout?: string; stderr?: string; - code?: number | string; + code?: number | null; }packages/mcp/src/tools/code-review.ts (2)
25-45: Redundantreadonlyannotation withas const.Using
as constalready makes the array readonly and infers literal types. The explicitreadonly string[]annotation widens the type back tostring[]elements, defeating the purpose ofas const.Proposed fix
-const IGNORED_EXTENSIONS: readonly string[] = [ +const IGNORED_EXTENSIONS = [ '.txt', '.lock', '.png', '.jpg', '.jpeg', '.gif', '.svg', '.ico', '.woff', '.woff2', '.ttf', '.eot', ] as const; -const IGNORED_FILES: readonly string[] = [ +const IGNORED_FILES = [ 'package-lock.json', 'pnpm-lock.yaml', 'yarn.lock', 'bun.lockb', ] as const;
68-70: Consider narrowingCompareTargetif possible.The type
'staged' | 'unstaged' | stringeffectively collapses to juststringsincestringis a supertype of the literals. This is fine if branch names need to be any string, but the literals provide no additional type safety. If intentional, a branded type or template literal could make the intent clearer, though this is optional.packages/ui/src/zag/Tabs.tsx (1)
85-87: Consider adding a default export for consistency.Other Zag components in this PR (QRCode, PinInput, Switch) include both named and default exports. For consistency across the UI package:
Suggested change
}; export { TabsComponent as Tabs }; +export default TabsComponent;packages/ui/src/zag/PasswordInput.tsx (1)
78-79: Redundant default export alongside named export.The component has both a named export (
PasswordInput) and a default export. Other components in this PR (e.g.,Drawer,TagsInput,ToggleGroup) only use named exports. Consider removing the default export for consistency.Proposed fix
export { PasswordInputComponent as PasswordInput }; -export default PasswordInputComponent;packages/ui/src/zag/Select.tsx (1)
259-267: Redundant default export alongside named export.Similar to
PasswordInput.tsx, this component has both default and named exports. Consider keeping only the named export for consistency with other components in this PR.Proposed fix
-export default SelectComponent; - // Export hook for programmatic control export { useSelect }; // Export component export { SelectComponent as Select };packages/ui/src/zag/Tooltip.tsx (1)
12-24: DuplicatePlacementtype across multiple files.The
Placementtype is identically defined inMenu.tsx,Popover.tsx,Tour.tsx, and this file. Consider extracting it to a shared types file to maintain DRY principle.Suggested approach
Create a shared types file:
// packages/ui/src/zag/types.ts export type Placement = | 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end';Then import and re-export from each component file:
import { Placement } from './types'; export { Placement };packages/ui/src/zag/Tour.tsx (2)
23-23: Inconsistent import extension.This file uses
.tsextension for importingzIndex, while other files in this PR (e.g.,Popover.tsxline 10,Tooltip.tsxline 10) use.jsextension for the same import. Standardize on one approach across all files.
161-161: Type assertion may warrant refinement, but implementation is currently sound.The
as TourApicast does assert a type without explicit verification, which could theoretically mask incompatibilities. However, the TourApi interface is explicitly defined in the same file with comprehensive method signatures, and all usages throughout the component (api().open, api().getBackdropProps(), etc.) align with the interface. Withstrict: trueTypeScript configuration enabled, there are no detected mismatches.Consider whether an explicit type mapping or validation could be more robust, though the current approach is functional and TypeScript-safe given the explicit interface definition.
packages/ui/src/zag/RadioGroup.tsx (1)
84-84: PreferShowcomponent for conditional rendering.Per coding guidelines, use the
Showcomponent from solid-js for conditional rendering instead of logical AND operators.Suggested change
- {item.description && <span class='text-xs text-gray-500'>{item.description}</span>} + <Show when={item.description}> + <span class='text-xs text-gray-500'>{item.description}</span> + </Show>You'll also need to add
Showto the imports on line 6:-import { Component, For, splitProps, createMemo } from 'solid-js'; +import { Component, For, Show, splitProps, createMemo } from 'solid-js';packages/ui/src/zag/Editable.tsx (2)
234-235: Inconsistent export pattern: both default and named exports.This file exports both
export default EditableComponentandexport { EditableComponent as Editable }. Other migrated components in this PR (Accordion, FileUpload, Menu, etc.) use only named exports. This inconsistency could cause confusion about which import style to use.Suggested fix: Remove default export for consistency
export { EditableComponent as Editable }; -export default EditableComponent;
114-125: Type assertions can be avoided with stricter prop handling.The type assertions on lines 114-116 and 122-124 are necessary because
mergePropswidens the types. While these work correctly, the pattern could be simplified.Alternative: Define defaults with explicit literal types
const merged = mergeProps( { placeholder: 'Click to edit...', - activationMode: 'dblclick', - submitMode: 'both', + activationMode: 'dblclick' as const, + submitMode: 'both' as const, selectOnFocus: true, autoResize: true, showControls: false, showEditIcon: false, - variant: 'default', + variant: 'default' as const, }, props, );This would preserve literal types through
mergePropsand eliminate the need for assertions in accessor functions.packages/ui/src/zag/Menu.tsx (1)
10-22: Placement type is duplicated across multiple components.The
Placementtype is identically defined inMenu.tsx,Popover.tsx,Tooltip.tsx, andTour.tsx(as shown in relevant code snippets). Consider extracting this to a shared types file to avoid duplication and ensure consistency.Suggested: Extract to shared types file
Create a shared types file (e.g.,
packages/ui/src/zag/types.ts):export type Placement = | 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end';Then import in each component:
import { Placement } from './types.js';packages/ui/src/zag/Dialog.tsx (1)
232-238: ConfirmDialogConfig duplicates ConfirmDialogProps fields.The
ConfirmDialogConfiginterface repeats the same fields asConfirmDialogPropsminus the control/callback properties. Consider using TypeScript utility types for DRY.Suggested: Use Pick or Omit utility types
-export interface ConfirmDialogConfig { - title?: string; - description?: string; - confirmText?: string; - cancelText?: string; - variant?: 'danger' | 'warning' | 'info'; -} +export type ConfirmDialogConfig = Pick< + ConfirmDialogProps, + 'title' | 'description' | 'confirmText' | 'cancelText' | 'variant' +>;packages/ui/src/zag/index.ts (1)
9-9: Mixed export patterns reflect inconsistent source file exports.Several components use
export { default as X }(Collapsible, Editable, PasswordInput, PinInput, QRCode, Select, Switch) while others use direct named exports. This is a consequence of some source files still having default exports. Consider standardizing all source files to named exports for consistency.As noted in the Editable.tsx review, standardizing to named-only exports across all components would simplify this barrel file and make the codebase more consistent.
Also applies to: 13-13, 18-18, 19-19, 22-22, 24-24, 26-26
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (73)
.github/dependabot.ymlpackages/mcp/.gitignorepackages/mcp/__tests__/better-auth.test.tspackages/mcp/__tests__/drizzle.test.tspackages/mcp/__tests__/icons.test.tspackages/mcp/__tests__/zag.test.tspackages/mcp/constants.jspackages/mcp/package.jsonpackages/mcp/src/constants.tspackages/mcp/src/scrape-icons.tspackages/mcp/src/server.tspackages/mcp/src/tools/better-auth.tspackages/mcp/src/tools/code-review.tspackages/mcp/src/tools/drizzle.tspackages/mcp/src/tools/icons.tspackages/mcp/src/tools/lint.tspackages/mcp/src/tools/local-docs.tspackages/mcp/src/tools/zag.tspackages/mcp/src/types.tspackages/mcp/tsconfig.jsonpackages/mcp/vitest.config.tspackages/ui/jsconfig.jsonpackages/ui/package.jsonpackages/ui/src/__tests__/setup.tspackages/ui/src/constants/zIndex.tspackages/ui/src/index.d.tspackages/ui/src/index.tspackages/ui/src/lib/cn.tspackages/ui/src/primitives/useWindowDrag.tspackages/ui/src/zag/Accordion.tsxpackages/ui/src/zag/Avatar.tsxpackages/ui/src/zag/Checkbox.tsxpackages/ui/src/zag/Clipboard.tsxpackages/ui/src/zag/Collapsible.tsxpackages/ui/src/zag/Combobox.tsxpackages/ui/src/zag/Dialog.tsxpackages/ui/src/zag/Drawer.tsxpackages/ui/src/zag/Editable.tsxpackages/ui/src/zag/FileUpload.tsxpackages/ui/src/zag/FloatingPanel.tsxpackages/ui/src/zag/Menu.tsxpackages/ui/src/zag/NumberInput.tsxpackages/ui/src/zag/PasswordInput.tsxpackages/ui/src/zag/PinInput.tsxpackages/ui/src/zag/Popover.tsxpackages/ui/src/zag/Progress.tsxpackages/ui/src/zag/QRCode.tsxpackages/ui/src/zag/RadioGroup.tsxpackages/ui/src/zag/Select.tsxpackages/ui/src/zag/Splitter.jsxpackages/ui/src/zag/Splitter.tsxpackages/ui/src/zag/Switch.tsxpackages/ui/src/zag/Tabs.tsxpackages/ui/src/zag/TagsInput.tsxpackages/ui/src/zag/Toast.tsxpackages/ui/src/zag/ToggleGroup.tsxpackages/ui/src/zag/Tooltip.tsxpackages/ui/src/zag/Tour.jsxpackages/ui/src/zag/Tour.tsxpackages/ui/src/zag/__tests__/Dialog.test.tsxpackages/ui/src/zag/__tests__/RadioGroup.test.tsxpackages/ui/src/zag/__tests__/checkbox.test.tsxpackages/ui/src/zag/__tests__/progress.test.tsxpackages/ui/src/zag/__tests__/switch.test.tsxpackages/ui/src/zag/__tests__/tabs.test.tsxpackages/ui/src/zag/__tests__/tooltip.test.tsxpackages/ui/src/zag/index.jspackages/ui/src/zag/index.tspackages/ui/tsconfig.jsonpackages/ui/vitest.config.jspackages/workers/turbo.jsonrenovate.jsonturbo.json
💤 Files with no reviewable changes (7)
- packages/mcp/constants.js
- packages/ui/src/zag/Splitter.jsx
- packages/ui/src/zag/Tour.jsx
- packages/workers/turbo.json
- packages/ui/src/zag/index.js
- packages/ui/jsconfig.json
- packages/ui/src/index.d.ts
🧰 Additional context used
📓 Path-based instructions (5)
**/*
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Do not use emojis in code, comments, documentation, or commit messages
NEVER use emojis anywhere in code, comments, documentation, plan files, or commit messages. This includes unicode symbols. For UI icons, use solid-icons library or SVGs only.
Files:
renovate.jsonpackages/mcp/tsconfig.jsonpackages/ui/src/zag/__tests__/tabs.test.tsxpackages/ui/src/zag/Switch.tsxpackages/mcp/src/tools/lint.tspackages/ui/tsconfig.jsonpackages/ui/src/zag/Popover.tsxpackages/mcp/src/types.tspackages/ui/src/zag/__tests__/tooltip.test.tsxpackages/ui/src/zag/QRCode.tsxpackages/ui/src/lib/cn.tspackages/ui/src/zag/__tests__/switch.test.tsxpackages/ui/vitest.config.jspackages/ui/src/zag/Progress.tsxpackages/ui/src/zag/Tooltip.tsxpackages/ui/src/zag/Tour.tsxpackages/ui/src/primitives/useWindowDrag.tspackages/ui/src/zag/FloatingPanel.tsxpackages/mcp/src/tools/better-auth.tspackages/mcp/vitest.config.tspackages/mcp/src/tools/zag.tspackages/mcp/src/tools/local-docs.tspackages/ui/src/zag/Clipboard.tsxpackages/ui/src/constants/zIndex.tspackages/ui/src/zag/Splitter.tsxpackages/ui/src/zag/__tests__/checkbox.test.tsxpackages/ui/src/zag/__tests__/Dialog.test.tsxpackages/ui/src/zag/__tests__/RadioGroup.test.tsxpackages/ui/package.jsonpackages/ui/src/index.tspackages/ui/src/zag/index.tspackages/mcp/__tests__/icons.test.tspackages/ui/src/zag/FileUpload.tsxpackages/ui/src/zag/Tabs.tsxturbo.jsonpackages/mcp/package.jsonpackages/ui/src/zag/Avatar.tsxpackages/mcp/src/tools/code-review.tspackages/mcp/src/scrape-icons.tspackages/ui/src/zag/__tests__/progress.test.tsxpackages/ui/src/zag/Menu.tsxpackages/ui/src/__tests__/setup.tspackages/ui/src/zag/Dialog.tsxpackages/ui/src/zag/RadioGroup.tsxpackages/ui/src/zag/TagsInput.tsxpackages/ui/src/zag/PinInput.tsxpackages/mcp/src/constants.tspackages/ui/src/zag/ToggleGroup.tsxpackages/ui/src/zag/Combobox.tsxpackages/ui/src/zag/NumberInput.tsxpackages/ui/src/zag/Select.tsxpackages/mcp/src/tools/icons.tspackages/mcp/src/tools/drizzle.tspackages/ui/src/zag/Editable.tsxpackages/ui/src/zag/Checkbox.tsxpackages/ui/src/zag/Collapsible.tsxpackages/ui/src/zag/PasswordInput.tsxpackages/ui/src/zag/Drawer.tsxpackages/mcp/src/server.tspackages/ui/src/zag/Accordion.tsxpackages/ui/src/zag/Toast.tsx
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{js,jsx,ts,tsx}: Prefer modern ES6+ syntax and features
Use aliases for imports when appropriate to improve readability
**/*.{js,jsx,ts,tsx}: Prefer modern ES6+ syntax and features in JavaScript/TypeScript code
Comments should explain why something is being done, not narrate what the code does. Avoid comments that repeat variable names or describe obvious code behavior.
Files:
packages/ui/src/zag/__tests__/tabs.test.tsxpackages/ui/src/zag/Switch.tsxpackages/mcp/src/tools/lint.tspackages/ui/src/zag/Popover.tsxpackages/mcp/src/types.tspackages/ui/src/zag/__tests__/tooltip.test.tsxpackages/ui/src/zag/QRCode.tsxpackages/ui/src/lib/cn.tspackages/ui/src/zag/__tests__/switch.test.tsxpackages/ui/vitest.config.jspackages/ui/src/zag/Progress.tsxpackages/ui/src/zag/Tooltip.tsxpackages/ui/src/zag/Tour.tsxpackages/ui/src/primitives/useWindowDrag.tspackages/ui/src/zag/FloatingPanel.tsxpackages/mcp/src/tools/better-auth.tspackages/mcp/vitest.config.tspackages/mcp/src/tools/zag.tspackages/mcp/src/tools/local-docs.tspackages/ui/src/zag/Clipboard.tsxpackages/ui/src/constants/zIndex.tspackages/ui/src/zag/Splitter.tsxpackages/ui/src/zag/__tests__/checkbox.test.tsxpackages/ui/src/zag/__tests__/Dialog.test.tsxpackages/ui/src/zag/__tests__/RadioGroup.test.tsxpackages/ui/src/index.tspackages/ui/src/zag/index.tspackages/mcp/__tests__/icons.test.tspackages/ui/src/zag/FileUpload.tsxpackages/ui/src/zag/Tabs.tsxpackages/ui/src/zag/Avatar.tsxpackages/mcp/src/tools/code-review.tspackages/mcp/src/scrape-icons.tspackages/ui/src/zag/__tests__/progress.test.tsxpackages/ui/src/zag/Menu.tsxpackages/ui/src/__tests__/setup.tspackages/ui/src/zag/Dialog.tsxpackages/ui/src/zag/RadioGroup.tsxpackages/ui/src/zag/TagsInput.tsxpackages/ui/src/zag/PinInput.tsxpackages/mcp/src/constants.tspackages/ui/src/zag/ToggleGroup.tsxpackages/ui/src/zag/Combobox.tsxpackages/ui/src/zag/NumberInput.tsxpackages/ui/src/zag/Select.tsxpackages/mcp/src/tools/icons.tspackages/mcp/src/tools/drizzle.tspackages/ui/src/zag/Editable.tsxpackages/ui/src/zag/Checkbox.tsxpackages/ui/src/zag/Collapsible.tsxpackages/ui/src/zag/PasswordInput.tsxpackages/ui/src/zag/Drawer.tsxpackages/mcp/src/server.tspackages/ui/src/zag/Accordion.tsxpackages/ui/src/zag/Toast.tsx
packages/{web,ui}/src/**/*.{jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/corates.mdc)
Group related components in subdirectories with barrel exports
Files:
packages/ui/src/zag/__tests__/tabs.test.tsxpackages/ui/src/zag/Switch.tsxpackages/ui/src/zag/Popover.tsxpackages/ui/src/zag/__tests__/tooltip.test.tsxpackages/ui/src/zag/QRCode.tsxpackages/ui/src/zag/__tests__/switch.test.tsxpackages/ui/src/zag/Progress.tsxpackages/ui/src/zag/Tooltip.tsxpackages/ui/src/zag/Tour.tsxpackages/ui/src/zag/FloatingPanel.tsxpackages/ui/src/zag/Clipboard.tsxpackages/ui/src/zag/Splitter.tsxpackages/ui/src/zag/__tests__/checkbox.test.tsxpackages/ui/src/zag/__tests__/Dialog.test.tsxpackages/ui/src/zag/__tests__/RadioGroup.test.tsxpackages/ui/src/zag/FileUpload.tsxpackages/ui/src/zag/Tabs.tsxpackages/ui/src/zag/Avatar.tsxpackages/ui/src/zag/__tests__/progress.test.tsxpackages/ui/src/zag/Menu.tsxpackages/ui/src/zag/Dialog.tsxpackages/ui/src/zag/RadioGroup.tsxpackages/ui/src/zag/TagsInput.tsxpackages/ui/src/zag/PinInput.tsxpackages/ui/src/zag/ToggleGroup.tsxpackages/ui/src/zag/Combobox.tsxpackages/ui/src/zag/NumberInput.tsxpackages/ui/src/zag/Select.tsxpackages/ui/src/zag/Editable.tsxpackages/ui/src/zag/Checkbox.tsxpackages/ui/src/zag/Collapsible.tsxpackages/ui/src/zag/PasswordInput.tsxpackages/ui/src/zag/Drawer.tsxpackages/ui/src/zag/Accordion.tsxpackages/ui/src/zag/Toast.tsx
packages/{web,ui}/**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
packages/{web,ui}/**/*.{js,jsx,ts,tsx}: Import UI components from '@corates/ui' package instead of local component files. Do not import Ark UI components from local paths like '@/components/zag/' or 'packages/web/src/components/zag/'
Always use 'solid-icons' library for icons. Never use emoji characters or text as icon replacements. Import from specific icon sets like 'solid-icons/bi', 'solid-icons/fi', 'solid-icons/ai', etc.
Files:
packages/ui/src/zag/__tests__/tabs.test.tsxpackages/ui/src/zag/Switch.tsxpackages/ui/src/zag/Popover.tsxpackages/ui/src/zag/__tests__/tooltip.test.tsxpackages/ui/src/zag/QRCode.tsxpackages/ui/src/lib/cn.tspackages/ui/src/zag/__tests__/switch.test.tsxpackages/ui/vitest.config.jspackages/ui/src/zag/Progress.tsxpackages/ui/src/zag/Tooltip.tsxpackages/ui/src/zag/Tour.tsxpackages/ui/src/primitives/useWindowDrag.tspackages/ui/src/zag/FloatingPanel.tsxpackages/ui/src/zag/Clipboard.tsxpackages/ui/src/constants/zIndex.tspackages/ui/src/zag/Splitter.tsxpackages/ui/src/zag/__tests__/checkbox.test.tsxpackages/ui/src/zag/__tests__/Dialog.test.tsxpackages/ui/src/zag/__tests__/RadioGroup.test.tsxpackages/ui/src/index.tspackages/ui/src/zag/index.tspackages/ui/src/zag/FileUpload.tsxpackages/ui/src/zag/Tabs.tsxpackages/ui/src/zag/Avatar.tsxpackages/ui/src/zag/__tests__/progress.test.tsxpackages/ui/src/zag/Menu.tsxpackages/ui/src/__tests__/setup.tspackages/ui/src/zag/Dialog.tsxpackages/ui/src/zag/RadioGroup.tsxpackages/ui/src/zag/TagsInput.tsxpackages/ui/src/zag/PinInput.tsxpackages/ui/src/zag/ToggleGroup.tsxpackages/ui/src/zag/Combobox.tsxpackages/ui/src/zag/NumberInput.tsxpackages/ui/src/zag/Select.tsxpackages/ui/src/zag/Editable.tsxpackages/ui/src/zag/Checkbox.tsxpackages/ui/src/zag/Collapsible.tsxpackages/ui/src/zag/PasswordInput.tsxpackages/ui/src/zag/Drawer.tsxpackages/ui/src/zag/Accordion.tsxpackages/ui/src/zag/Toast.tsx
packages/{web,ui}/**/*.{jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
Use Tailwind CSS classes for styling components
Files:
packages/ui/src/zag/__tests__/tabs.test.tsxpackages/ui/src/zag/Switch.tsxpackages/ui/src/zag/Popover.tsxpackages/ui/src/zag/__tests__/tooltip.test.tsxpackages/ui/src/zag/QRCode.tsxpackages/ui/src/zag/__tests__/switch.test.tsxpackages/ui/src/zag/Progress.tsxpackages/ui/src/zag/Tooltip.tsxpackages/ui/src/zag/Tour.tsxpackages/ui/src/zag/FloatingPanel.tsxpackages/ui/src/zag/Clipboard.tsxpackages/ui/src/zag/Splitter.tsxpackages/ui/src/zag/__tests__/checkbox.test.tsxpackages/ui/src/zag/__tests__/Dialog.test.tsxpackages/ui/src/zag/__tests__/RadioGroup.test.tsxpackages/ui/src/zag/FileUpload.tsxpackages/ui/src/zag/Tabs.tsxpackages/ui/src/zag/Avatar.tsxpackages/ui/src/zag/__tests__/progress.test.tsxpackages/ui/src/zag/Menu.tsxpackages/ui/src/zag/Dialog.tsxpackages/ui/src/zag/RadioGroup.tsxpackages/ui/src/zag/TagsInput.tsxpackages/ui/src/zag/PinInput.tsxpackages/ui/src/zag/ToggleGroup.tsxpackages/ui/src/zag/Combobox.tsxpackages/ui/src/zag/NumberInput.tsxpackages/ui/src/zag/Select.tsxpackages/ui/src/zag/Editable.tsxpackages/ui/src/zag/Checkbox.tsxpackages/ui/src/zag/Collapsible.tsxpackages/ui/src/zag/PasswordInput.tsxpackages/ui/src/zag/Drawer.tsxpackages/ui/src/zag/Accordion.tsxpackages/ui/src/zag/Toast.tsx
🧠 Learnings (34)
📚 Learning: 2025-12-24T17:23:17.309Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/ui-components.mdc:0-0
Timestamp: 2025-12-24T17:23:17.309Z
Learning: Applies to packages/web/**/*.{js,jsx,ts,tsx} : Use import aliases from 'packages/web/jsconfig.json' instead of relative paths. Aliases include: '@/*' (src/*), 'components/*' (src/components/*), 'auth-ui/*' (src/components/auth-ui/*), 'checklist-ui/*' (src/components/checklist-ui/*), 'project-ui/*' (src/components/project-ui/*), 'routes/*' (src/routes/*), 'primitives/*' (src/primitives/*), 'api/*' (src/api/*), 'config/*' (src/config/*), and 'lib/*' (src/lib/*)
Applied to files:
packages/mcp/tsconfig.jsonpackages/ui/src/zag/__tests__/tabs.test.tsxpackages/ui/tsconfig.jsonpackages/ui/src/zag/__tests__/tooltip.test.tsxpackages/ui/src/zag/__tests__/switch.test.tsxpackages/ui/vitest.config.jspackages/mcp/vitest.config.tspackages/ui/src/zag/__tests__/checkbox.test.tsxpackages/ui/src/zag/__tests__/Dialog.test.tsxpackages/ui/package.jsonpackages/ui/src/index.tspackages/ui/src/zag/index.tspackages/mcp/package.jsonpackages/ui/src/zag/__tests__/progress.test.tsx
📚 Learning: 2025-12-24T17:22:48.927Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/corates.mdc:0-0
Timestamp: 2025-12-24T17:22:48.927Z
Learning: Applies to packages/web/src/**/*.{js,jsx,ts,tsx} : Use import aliases from jsconfig.json instead of relative paths
Applied to files:
packages/mcp/tsconfig.jsonpackages/ui/src/zag/__tests__/tabs.test.tsxpackages/ui/tsconfig.jsonpackages/ui/src/zag/__tests__/tooltip.test.tsxpackages/ui/src/zag/__tests__/switch.test.tsxpackages/ui/vitest.config.jspackages/mcp/vitest.config.tspackages/ui/src/zag/__tests__/checkbox.test.tsxpackages/ui/src/zag/__tests__/Dialog.test.tsxpackages/ui/package.jsonpackages/ui/src/index.tspackages/ui/src/zag/__tests__/progress.test.tsx
📚 Learning: 2025-12-24T17:22:48.927Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/corates.mdc:0-0
Timestamp: 2025-12-24T17:22:48.927Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Prefer modern ES6+ syntax and features in JavaScript/TypeScript code
Applied to files:
packages/mcp/tsconfig.jsonpackages/ui/tsconfig.jsonpackages/ui/vitest.config.js
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Prefer modern ES6+ syntax and features
Applied to files:
packages/mcp/tsconfig.jsonpackages/ui/tsconfig.json
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/web/src/components/**/*.{js,jsx,ts,tsx} : Use Zag.js for UI components and design system
Applied to files:
packages/ui/src/zag/__tests__/tabs.test.tsxpackages/ui/src/zag/Switch.tsxpackages/ui/tsconfig.jsonpackages/ui/src/zag/Popover.tsxpackages/ui/src/zag/__tests__/tooltip.test.tsxpackages/ui/src/zag/QRCode.tsxpackages/ui/src/zag/__tests__/switch.test.tsxpackages/ui/src/zag/Progress.tsxpackages/ui/src/zag/Tooltip.tsxpackages/ui/src/zag/Tour.tsxpackages/ui/src/zag/FloatingPanel.tsxpackages/mcp/src/tools/zag.tspackages/ui/src/zag/Clipboard.tsxpackages/ui/src/zag/Splitter.tsxpackages/ui/src/zag/__tests__/checkbox.test.tsxpackages/ui/src/zag/__tests__/Dialog.test.tsxpackages/ui/package.jsonpackages/ui/src/index.tspackages/ui/src/zag/index.tspackages/ui/src/zag/FileUpload.tsxpackages/ui/src/zag/Tabs.tsxpackages/ui/src/zag/Avatar.tsxpackages/ui/src/zag/__tests__/progress.test.tsxpackages/ui/src/zag/Menu.tsxpackages/ui/src/__tests__/setup.tspackages/ui/src/zag/Dialog.tsxpackages/ui/src/zag/RadioGroup.tsxpackages/ui/src/zag/TagsInput.tsxpackages/ui/src/zag/PinInput.tsxpackages/ui/src/zag/ToggleGroup.tsxpackages/ui/src/zag/Combobox.tsxpackages/ui/src/zag/NumberInput.tsxpackages/mcp/.gitignorepackages/ui/src/zag/Editable.tsxpackages/ui/src/zag/Checkbox.tsxpackages/ui/src/zag/Collapsible.tsxpackages/ui/src/zag/PasswordInput.tsxpackages/ui/src/zag/Drawer.tsxpackages/ui/src/zag/Accordion.tsx
📚 Learning: 2025-12-24T17:23:17.309Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/ui-components.mdc:0-0
Timestamp: 2025-12-24T17:23:17.309Z
Learning: Applies to packages/{web,ui}/**/*.{js,jsx,ts,tsx} : Import UI components from 'corates/ui' package instead of local component files. Do not import Ark UI components from local paths like '@/components/zag/' or 'packages/web/src/components/zag/'
Applied to files:
packages/ui/src/zag/__tests__/tabs.test.tsxpackages/ui/tsconfig.jsonpackages/ui/src/zag/__tests__/tooltip.test.tsxpackages/ui/src/zag/__tests__/switch.test.tsxpackages/ui/vitest.config.jspackages/ui/src/zag/Tour.tsxpackages/ui/src/zag/Splitter.tsxpackages/ui/src/zag/__tests__/checkbox.test.tsxpackages/ui/src/zag/__tests__/Dialog.test.tsxpackages/ui/package.jsonpackages/ui/src/index.tspackages/ui/src/zag/index.tspackages/ui/src/zag/__tests__/progress.test.tsxpackages/ui/src/zag/TagsInput.tsxpackages/ui/src/zag/Select.tsx
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Use aliases for imports when appropriate to improve readability
Applied to files:
packages/ui/src/zag/__tests__/tabs.test.tsxpackages/ui/tsconfig.jsonpackages/ui/src/zag/__tests__/tooltip.test.tsxpackages/ui/src/zag/__tests__/switch.test.tsxpackages/ui/src/zag/__tests__/checkbox.test.tsxpackages/ui/src/zag/__tests__/Dialog.test.tsxpackages/ui/src/index.tspackages/ui/src/zag/__tests__/progress.test.tsx
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/web/src/components/**/*.{js,jsx,ts,tsx} : Zag component exist in `packages/web/src/components/zag/*` and should be reused. Check the README.md in that folder for a list of existing components before adding new components and when debugging
Applied to files:
packages/ui/src/zag/__tests__/tabs.test.tsxpackages/ui/src/zag/Switch.tsxpackages/ui/src/zag/Tour.tsxpackages/mcp/src/tools/zag.tspackages/ui/src/zag/Splitter.tsxpackages/ui/src/zag/__tests__/checkbox.test.tsxpackages/ui/package.jsonpackages/ui/src/index.tspackages/ui/src/zag/index.tspackages/ui/src/zag/Tabs.tsxpackages/ui/src/zag/Menu.tsxpackages/ui/src/zag/Dialog.tsxpackages/ui/src/zag/TagsInput.tsxpackages/ui/src/zag/ToggleGroup.tsxpackages/mcp/.gitignorepackages/ui/src/zag/Editable.tsxpackages/ui/src/zag/Checkbox.tsxpackages/ui/src/zag/Accordion.tsx
📚 Learning: 2025-12-24T17:22:48.927Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/corates.mdc:0-0
Timestamp: 2025-12-24T17:22:48.927Z
Learning: Applies to packages/{web,landing}/src/**/*.{jsx,tsx} : Use Ark UI components from corates/ui package, not local component implementations
Applied to files:
packages/ui/src/zag/__tests__/tabs.test.tsxpackages/ui/src/zag/Switch.tsxpackages/ui/src/zag/QRCode.tsxpackages/ui/vitest.config.jspackages/ui/src/zag/Tour.tsxpackages/ui/src/zag/Splitter.tsxpackages/ui/src/zag/__tests__/checkbox.test.tsxpackages/ui/src/zag/__tests__/Dialog.test.tsxpackages/ui/package.jsonpackages/ui/src/index.tspackages/ui/src/zag/index.tspackages/ui/src/zag/Combobox.tsxpackages/ui/src/zag/Select.tsxpackages/ui/src/zag/Checkbox.tsxpackages/ui/src/zag/Collapsible.tsx
📚 Learning: 2025-12-24T17:23:10.082Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-24T17:23:10.082Z
Learning: Applies to {packages/web/**,packages/landing/**}/**/*.{jsx,tsx,js,ts} : Import stores directly in components rather than prop-drilling store data through component hierarchies.
Applied to files:
packages/ui/src/zag/__tests__/tabs.test.tsxpackages/ui/src/zag/index.ts
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/web/src/components/**/*.{js,jsx,ts,tsx} : Do not destructure props in SolidJS components as it breaks reactivity. Instead, access props directly from the props object or wrap them in a function to ensure they are always up-to-date
Applied to files:
packages/ui/src/zag/Switch.tsxpackages/ui/src/zag/Progress.tsxpackages/ui/src/zag/Avatar.tsxpackages/ui/src/zag/TagsInput.tsxpackages/ui/src/zag/PinInput.tsxpackages/ui/src/zag/Checkbox.tsxpackages/ui/src/zag/Drawer.tsxpackages/ui/src/zag/Accordion.tsx
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/web/src/**/*.{js,jsx,ts,tsx} : Ensure browser compatibility for all frontend code (Safari is usually problematic)
Applied to files:
packages/ui/tsconfig.jsonpackages/ui/vitest.config.jspackages/ui/src/index.tspackages/ui/src/__tests__/setup.ts
📚 Learning: 2025-12-24T17:22:48.927Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/corates.mdc:0-0
Timestamp: 2025-12-24T17:22:48.927Z
Learning: Applies to packages/workers/src/**/*.{js,ts} : Use Zod for schema and input validation on the backend
Applied to files:
packages/ui/tsconfig.jsonpackages/mcp/src/tools/zag.tspackages/ui/package.jsonpackages/mcp/package.jsonpackages/mcp/src/tools/code-review.ts
📚 Learning: 2025-12-24T17:22:48.927Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/corates.mdc:0-0
Timestamp: 2025-12-24T17:22:48.927Z
Learning: Applies to packages/{web,landing}/src/**/*.{jsx,tsx} : Use solid-icons library (e.g., solid-icons/bi, solid-icons/fi) for icon imports
Applied to files:
packages/ui/vitest.config.jspackages/ui/package.jsonpackages/mcp/__tests__/icons.test.tspackages/mcp/src/scrape-icons.tspackages/mcp/src/tools/icons.ts
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/web/src/components/**/*.{js,jsx,ts,tsx} : Components should receive at most 1–5 props, and only for local configuration, not shared state. If a component would need more than 5 props, move the shared data into an external store, a primitive, or Solid context
Applied to files:
packages/ui/src/zag/Progress.tsxpackages/ui/src/zag/TagsInput.tsxpackages/ui/src/zag/PinInput.tsxpackages/ui/src/zag/NumberInput.tsxpackages/ui/src/zag/Accordion.tsx
📚 Learning: 2025-12-24T17:23:10.082Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-24T17:23:10.082Z
Learning: Applies to {packages/web/**,packages/landing/**}/**/*.{jsx,tsx,js,ts} : Use the `Show` component from solid-js for conditional rendering instead of JavaScript ternary operators or logical AND operators.
Applied to files:
packages/ui/src/zag/Tour.tsxpackages/ui/src/zag/Tabs.tsxpackages/ui/src/zag/Menu.tsxpackages/ui/src/zag/Editable.tsxpackages/ui/src/zag/Checkbox.tsxpackages/ui/src/zag/Collapsible.tsxpackages/ui/src/zag/Drawer.tsx
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/web/src/components/**/*.{js,jsx,ts,tsx} : Use responsive design principles for UI components
Applied to files:
packages/ui/src/zag/FloatingPanel.tsxpackages/ui/src/zag/index.ts
📚 Learning: 2025-12-24T17:22:48.927Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/corates.mdc:0-0
Timestamp: 2025-12-24T17:22:48.927Z
Learning: Applies to packages/workers/src/**/*.{js,ts} : Use Better-Auth for authentication and user management
Applied to files:
packages/mcp/src/tools/better-auth.ts
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Use the Corates MCP tools to explore local documentation sources for Better-Auth, Drizzle, Icons, and Zag documentation
Applied to files:
packages/mcp/src/tools/better-auth.ts
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/web/src/**/*.{js,jsx,ts,tsx} : Keep files small, focused, and modular. If a file exceeds a high number of lines, consider refactoring by extracting sub-modules into a folder with index.jsx and helper components, moving complex logic into separate utility files or primitives, or splitting large forms into section components
Applied to files:
packages/ui/src/zag/Splitter.tsx
📚 Learning: 2025-12-24T17:22:48.927Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/corates.mdc:0-0
Timestamp: 2025-12-24T17:22:48.927Z
Learning: Applies to packages/{web,ui}/src/**/*.{jsx,tsx} : Group related components in subdirectories with barrel exports
Applied to files:
packages/ui/package.jsonpackages/ui/src/index.tspackages/ui/src/zag/index.ts
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/web/src/components/**/*.{js,jsx,ts,tsx} : Group related components in subdirectories with an index.js barrel export
Applied to files:
packages/ui/package.jsonpackages/ui/src/index.tspackages/ui/src/zag/index.ts
📚 Learning: 2025-12-24T17:22:48.927Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/corates.mdc:0-0
Timestamp: 2025-12-24T17:22:48.927Z
Learning: Applies to packages/web/src/stores/**/*.{js,ts} : In SolidJS, shared state should live in external stores under packages/web/src/stores/
Applied to files:
packages/ui/package.json
📚 Learning: 2025-12-24T17:23:17.309Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/ui-components.mdc:0-0
Timestamp: 2025-12-24T17:23:17.309Z
Learning: Applies to packages/{web,ui}/**/*.{js,jsx,ts,tsx} : Always use 'solid-icons' library for icons. Never use emoji characters or text as icon replacements. Import from specific icon sets like 'solid-icons/bi', 'solid-icons/fi', 'solid-icons/ai', etc.
Applied to files:
packages/ui/package.jsonpackages/mcp/__tests__/icons.test.tspackages/mcp/src/scrape-icons.tspackages/mcp/src/tools/icons.ts
📚 Learning: 2025-12-24T17:22:48.927Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/corates.mdc:0-0
Timestamp: 2025-12-24T17:22:48.927Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx,js,ts} : In SolidJS, use createMemo for derived values
Applied to files:
packages/ui/package.json
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/web/src/primitives/**/*.{js,ts} : Create reusable logic in primitives (hooks) that can be shared across components to keep components clean and focused on rendering
Applied to files:
packages/ui/src/index.tspackages/ui/src/zag/index.ts
📚 Learning: 2025-12-24T17:23:10.082Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-24T17:23:10.082Z
Learning: Applies to {packages/web/**,packages/landing/**}/src/primitives/**/*.{jsx,tsx,js,ts} : Create reusable component logic in primitives (custom hooks) rather than embedding business logic directly in components. Primitives should encapsulate store access and complex logic patterns.
Applied to files:
packages/ui/src/zag/index.ts
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/web/src/**/*.{js,jsx,ts,tsx} : For UI icons, use the `solid-icons` library or SVGs only. Do not use emojis
Applied to files:
packages/mcp/__tests__/icons.test.tspackages/mcp/src/scrape-icons.ts
📚 Learning: 2025-12-24T17:23:10.082Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-24T17:23:10.082Z
Learning: Applies to {packages/web/**,packages/landing/**}/**/*.{jsx,tsx,js,ts} : Use the `For` component from solid-js for rendering lists. It provides better performance and keying compared to JavaScript's map function in JSX.
Applied to files:
packages/ui/src/zag/Tabs.tsxpackages/ui/src/zag/Menu.tsx
📚 Learning: 2025-12-24T17:23:10.082Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-24T17:23:10.082Z
Learning: Applies to {packages/web/**,packages/landing/**}/**/*.{jsx,tsx,js,ts} : When manipulating children in wrapper components, use the `children` helper from solid-js to ensure proper reactivity and handling of child elements.
Applied to files:
packages/ui/src/zag/Tabs.tsx
📚 Learning: 2025-12-24T17:22:48.927Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/corates.mdc:0-0
Timestamp: 2025-12-24T17:22:48.927Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx} : In SolidJS components, components should receive at most 1-5 props (local config only, not shared state)
Applied to files:
packages/ui/src/zag/TagsInput.tsxpackages/ui/src/zag/Accordion.tsx
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/workers/src/**/*.{js,ts} : Use Drizzle ORM for database interactions and migrations
Applied to files:
packages/mcp/src/tools/drizzle.ts
📚 Learning: 2025-12-24T17:22:48.927Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/corates.mdc:0-0
Timestamp: 2025-12-24T17:22:48.927Z
Learning: Applies to packages/workers/**/*.{ts,sql} : Use Drizzle ORM for ALL database interactions and migrations
Applied to files:
packages/mcp/src/tools/drizzle.ts
📚 Learning: 2025-12-24T17:22:56.372Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/error-handling.mdc:0-0
Timestamp: 2025-12-24T17:22:56.372Z
Learning: Applies to packages/workers/src/**/*.{js,ts} : Always use `createDomainError` from `corates/shared` for error handling in backend routes with predefined error constants (PROJECT_ERRORS, AUTH_ERRORS, VALIDATION_ERRORS, SYSTEM_ERRORS, USER_ERRORS)
Applied to files:
packages/mcp/src/server.ts
🧬 Code graph analysis (19)
packages/mcp/src/tools/lint.ts (1)
packages/mcp/src/types.ts (1)
McpServerType(3-3)
packages/ui/src/zag/Popover.tsx (3)
packages/ui/src/zag/Menu.tsx (1)
Placement(10-22)packages/ui/src/zag/Tooltip.tsx (1)
Placement(12-24)packages/ui/src/zag/Tour.tsx (1)
Placement(25-37)
packages/ui/src/lib/cn.ts (1)
packages/ui/src/index.ts (1)
cn(10-10)
packages/ui/src/zag/Tooltip.tsx (3)
packages/ui/src/zag/Menu.tsx (1)
Placement(10-22)packages/ui/src/zag/Popover.tsx (1)
Placement(12-24)packages/ui/src/zag/Tour.tsx (1)
Placement(25-37)
packages/ui/src/primitives/useWindowDrag.ts (2)
packages/ui/src/index.ts (1)
useWindowDrag(7-7)packages/web/src/primitives/useWindowDrag.js (2)
isDraggingOverWindow(10-10)dragCounter(11-11)
packages/mcp/src/tools/better-auth.ts (1)
packages/mcp/src/types.ts (1)
McpServerType(3-3)
packages/mcp/src/tools/local-docs.ts (1)
packages/mcp/src/types.ts (1)
McpServerType(3-3)
packages/ui/src/zag/Clipboard.tsx (1)
packages/ui/src/zag/index.ts (1)
CopyButton(8-8)
packages/ui/src/zag/Splitter.tsx (1)
packages/ui/src/zag/index.ts (1)
Splitter(25-25)
packages/mcp/__tests__/icons.test.ts (1)
packages/mcp/iconSearch.js (1)
manifest(20-20)
packages/ui/src/zag/FileUpload.tsx (2)
packages/web/src/components/checklist-ui/pdf/PdfEmptyState.jsx (1)
handleFileAccept(21-25)packages/web/src/primitives/useWindowDrag.js (1)
isDraggingOverWindow(10-10)
packages/mcp/src/tools/code-review.ts (1)
packages/mcp/src/types.ts (1)
McpServerType(3-3)
packages/mcp/src/scrape-icons.ts (2)
packages/workers/src/auth/routes.js (1)
path(114-114)packages/mcp/iconSearch.js (1)
manifest(20-20)
packages/ui/src/zag/Menu.tsx (3)
packages/ui/src/zag/Popover.tsx (1)
Placement(12-24)packages/ui/src/zag/Tooltip.tsx (1)
Placement(12-24)packages/ui/src/zag/Tour.tsx (1)
Placement(25-37)
packages/ui/src/zag/Dialog.tsx (1)
packages/ui/src/zag/index.ts (1)
useConfirmDialog(11-11)
packages/mcp/src/tools/icons.ts (2)
packages/mcp/iconSearch.js (3)
manifestCache(8-8)manifestPath(11-11)manifest(20-20)packages/mcp/src/types.ts (1)
McpServerType(3-3)
packages/mcp/src/tools/drizzle.ts (1)
packages/mcp/src/types.ts (1)
McpServerType(3-3)
packages/ui/src/zag/Drawer.tsx (2)
packages/web/src/components/project-ui/PdfPreviewPanel.jsx (1)
handleOpenChange(14-18)packages/ui/src/zag/index.ts (1)
Dialog(11-11)
packages/ui/src/zag/Toast.tsx (1)
packages/ui/src/zag/index.ts (2)
showToast(29-29)toaster(29-29)
⏰ 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: Workers Builds: corates
- GitHub Check: Workers Builds: corates-workers-prod
| const manifestPath = path.join(__dirname, '..', '..', 'icon-manifest.json'); | ||
| const content = await fs.readFile(manifestPath, 'utf8'); | ||
| manifestCache = JSON.parse(content) as IconManifest; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify icon-manifest.json exists at the expected location relative to the tools directory
fd -t f "icon-manifest.json" packages/mcp --max-depth 2Repository: InfinityBowman/corates
Length of output: 48
🏁 Script executed:
#!/bin/bash
# Search for icon-manifest.json anywhere in the repository
fd -t f "icon-manifest.json"Repository: InfinityBowman/corates
Length of output: 48
🏁 Script executed:
#!/bin/bash
# Read the icons.ts file to see the context around lines 25-27
cat -n packages/mcp/src/tools/icons.ts | head -40
# Also search for any references to icon-manifest in the codebase
rg "icon-manifest" --type ts --type jsRepository: InfinityBowman/corates
Length of output: 2288
Fix the manifest path — it traverses one level too many.
The path path.join(__dirname, '..', '..', 'icon-manifest.json') traverses two levels up from src/tools/, landing at packages/mcp/. However, based on the path used in src/scrape-icons.ts and the test files (__tests__/icons.test.ts), the manifest should be one level up: path.join(__dirname, '..', 'icon-manifest.json'). All references in the codebase expect the file at packages/mcp/icon-manifest.json, not deeper.
Additionally, the file does not currently exist in the repository, which will cause a runtime error when loadManifest() is called.
🤖 Prompt for AI Agents
In packages/mcp/src/tools/icons.ts around lines 25 to 27, the manifest path
currently goes up two directories but should go up one; change the path to use
path.join(__dirname, '..', 'icon-manifest.json') so it resolves to
packages/mcp/icon-manifest.json, and add or commit the missing
icon-manifest.json file at that location (or add a guard with a clear error
message if the file is optional) so loadManifest() does not fail at runtime.
| export interface CopyButtonProps { | ||
| /** Value to copy */ | ||
| value: string; | ||
| /** Callback when copy status changes */ | ||
| onStatusChange?: (details: { copied: boolean }) => void; | ||
| /** Time in ms before resetting (default: 3000) */ | ||
| timeout?: number; | ||
| /** Button label (default: 'Copy') */ | ||
| label?: string; | ||
| /** Label when copied (default: 'Copied!') */ | ||
| copiedLabel?: string; | ||
| /** Button size (default: 'md') */ | ||
| size?: 'sm' | 'md' | 'lg'; | ||
| /** Button variant (default: 'solid') */ | ||
| variant?: 'solid' | 'outline' | 'ghost'; | ||
| /** Show copy/check icon (default: true) */ | ||
| showIcon?: boolean; | ||
| /** Show text label (default: true) */ | ||
| showLabel?: boolean; | ||
| /** Additional class for button */ | ||
| class?: string; | ||
| } |
There was a problem hiding this comment.
Missing defaultValue in CopyButtonProps interface.
The CopyButton component passes defaultValue={machineProps.defaultValue} to Clipboard.Root (line 214), but defaultValue is not declared in the CopyButtonProps interface. This will cause a TypeScript error or silently ignore the prop.
Proposed fix
export interface CopyButtonProps {
/** Value to copy */
value: string;
+ /** Initial value to copy */
+ defaultValue?: string;
/** Callback when copy status changes */
onStatusChange?: (details: { copied: boolean }) => void;
// ...
}Also applies to: 211-216
🤖 Prompt for AI Agents
In packages/ui/src/zag/Clipboard.tsx around lines 124 to 145 (and related usage
at 211–216), the CopyButtonProps interface is missing the defaultValue prop that
CopyButton passes to Clipboard.Root (defaultValue={machineProps.defaultValue});
add a new optional property defaultValue?: string to CopyButtonProps, update the
JSDoc comment to describe it (value to initialize the clipboard state), and
ensure any usage/tests/types are adjusted accordingly so TypeScript recognizes
the prop.
| const arkProps = () => props.arkProps; | ||
| const collapsibleApi = useCollapsible(arkProps()); |
There was a problem hiding this comment.
Critical: Breaking reactivity by passing snapshot to useCollapsible hook.
Line 55 calls arkProps() which creates a snapshot of the props at that moment. In Solid.js, hooks like useCollapsible need reactive access to props to track changes. Passing a snapshot means the collapsible won't respond to prop updates (e.g., controlled open state changes).
🔎 Proposed fix to preserve reactivity
- const arkProps = () => props.arkProps;
- const collapsibleApi = useCollapsible(arkProps());
+ const collapsibleApi = useCollapsible(() => props.arkProps);Or if useCollapsible expects a direct object, wrap it in a reactive getter:
- const arkProps = () => props.arkProps;
- const collapsibleApi = useCollapsible(arkProps());
+ const collapsibleApi = useCollapsible(props.arkProps);Check Ark UI's documentation for the expected prop format.
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In packages/ui/src/zag/Collapsible.tsx around lines 54 to 55, you're creating a
snapshot by calling arkProps() and passing that value to useCollapsible, which
breaks Solid reactivity; instead pass a reactive getter/function so
useCollapsible can track changes — e.g. call useCollapsible(arkProps) (or
directly useCollapsible(() => props.arkProps)) rather than
useCollapsible(arkProps()).
| const handleFileReject = (details: { files: unknown[] }) => { | ||
| merged.onFileReject?.(details); | ||
| }; |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Ark UI FileUpload onFileReject callback type signature file rejection
💡 Result:
onFileReject signature
- Type: (details: FileRejectDetails) => void. Source docs show the prop as onFileReject with a FileRejectDetails parameter. [1]
what FileRejectDetails contains (from docs)
- It includes rejectedFiles (an array of FileRejection) — the files that were rejected. FileRejection entries include the original File plus one or more error codes from the built-in errors (TOO_MANY_FILES, FILE_INVALID_TYPE, FILE_TOO_LARGE, FILE_TOO_SMALL, FILE_INVALID, FILE_EXISTS). Use these to show messages or handle rejections. [1][2]
example (TypeScript / usage)
- onFileReject: (details) => {
// details.rejectedFiles: FileRejection[]
details.rejectedFiles.forEach(r => {
// r.file: File
// r.errors: FileUploadFileError[] (one or more of the built-in error codes)
})
}
References
- Ark UI FileUpload docs — props & error types. [1]
- Ark UI package source (file-upload root) showing onFileReject in prop list. [2]
Sources
[1] Ark UI — File Upload component docs.
[2] @ark-ui/react file-upload (dist) listing onFileReject in exported props.
🏁 Script executed:
# Search for Ark UI types in the repository
fd -e "package.json" | head -5 | xargs grep -l "@ark-ui\|ark-ui" 2>/dev/null
# Look for FileUpload usage in the codebase
rg "onFileReject" --type tsx --type ts -A 3 -B 3Repository: InfinityBowman/corates
Length of output: 93
🏁 Script executed:
# Search for onFileReject usage with proper syntax
rg "onFileReject" -A 3 -B 3
# Look at the FileUpload.tsx file to see imports and current implementation
fd "FileUpload.tsx" -x cat -n {}
# Check if Ark UI types are available in package.json
fd "package.json" | xargs grep "@ark-ui" 2>/dev/null | head -10Repository: InfinityBowman/corates
Length of output: 9063
Use proper Ark UI types for rejected files.
The files: unknown[] type in both the FileUploadProps interface and handleFileReject should match Ark UI's actual FileRejectDetails structure, which contains rejectedFiles: FileRejection[] (where FileRejection includes file: File and errors: FileUploadFileError[]). Update the type signature to match Ark UI's API for proper type safety.
🤖 Prompt for AI Agents
In packages/ui/src/zag/FileUpload.tsx around lines 79 to 81, the rejected-files
parameter is typed as files: unknown[]; update the FileUploadProps interface and
the handleFileReject signature to use Ark UI's actual types (use
FileRejectDetails which contains rejectedFiles: FileRejection[] and ensure
FileRejection includes file: File and errors: FileUploadFileError[]). Import the
correct types from Ark UI (where those types are exported) and replace the
unknown[] occurrences so merged.onFileReject?.(details) and handleFileReject
accept the properly typed FileRejectDetails object.
| const SplitterComponent: Component<SplitterProps> = (props) => { | ||
| return ( | ||
| <Splitter.Root | ||
| panels={props.panels || [ | ||
| { id: 'a', minSize: 10 }, | ||
| { id: 'b', minSize: 10 }, | ||
| ]} | ||
| defaultSize={props.defaultSize || [80, 20]} | ||
| orientation={props.orientation || 'horizontal'} | ||
| class={props.class} | ||
| > | ||
| <Splitter.Panel id='a'> | ||
| <p>A</p> | ||
| </Splitter.Panel> | ||
| <Splitter.ResizeTrigger id='a:b' aria-label='Resize' /> | ||
| <Splitter.Panel id='b'> | ||
| <p>B</p> | ||
| </Splitter.Panel> | ||
| </Splitter.Root> | ||
| ); | ||
| }; |
There was a problem hiding this comment.
Panels render hardcoded placeholder content, making this component unusable.
The component accepts panels configuration but renders hardcoded <p>A</p> and <p>B</p> content. There's no way for consumers to provide their own panel content, which defeats the purpose of a reusable splitter component.
Consider adding a children prop (similar to the Tabs component pattern) or a render function per panel:
Suggested approach using children
export interface SplitterProps {
/** Default panel sizes as percentages */
defaultSize?: number[];
/** Panel configurations */
panels?: SplitterPanel[];
/** Orientation (default: 'horizontal') */
orientation?: 'horizontal' | 'vertical';
/** Additional class for root element */
class?: string;
+ /** Content for panels [panelA, panelB] */
+ children?: [JSX.Element, JSX.Element];
}
const SplitterComponent: Component<SplitterProps> = (props) => {
+ const children = () => props.children;
+
return (
<Splitter.Root
panels={props.panels || [
{ id: 'a', minSize: 10 },
{ id: 'b', minSize: 10 },
]}
defaultSize={props.defaultSize || [80, 20]}
orientation={props.orientation || 'horizontal'}
class={props.class}
>
<Splitter.Panel id='a'>
- <p>A</p>
+ {children()?.[0]}
</Splitter.Panel>
<Splitter.ResizeTrigger id='a:b' aria-label='Resize' />
<Splitter.Panel id='b'>
- <p>B</p>
+ {children()?.[1]}
</Splitter.Panel>
</Splitter.Root>
);
};📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const SplitterComponent: Component<SplitterProps> = (props) => { | |
| return ( | |
| <Splitter.Root | |
| panels={props.panels || [ | |
| { id: 'a', minSize: 10 }, | |
| { id: 'b', minSize: 10 }, | |
| ]} | |
| defaultSize={props.defaultSize || [80, 20]} | |
| orientation={props.orientation || 'horizontal'} | |
| class={props.class} | |
| > | |
| <Splitter.Panel id='a'> | |
| <p>A</p> | |
| </Splitter.Panel> | |
| <Splitter.ResizeTrigger id='a:b' aria-label='Resize' /> | |
| <Splitter.Panel id='b'> | |
| <p>B</p> | |
| </Splitter.Panel> | |
| </Splitter.Root> | |
| ); | |
| }; | |
| export interface SplitterProps { | |
| /** Default panel sizes as percentages */ | |
| defaultSize?: number[]; | |
| /** Panel configurations */ | |
| panels?: SplitterPanel[]; | |
| /** Orientation (default: 'horizontal') */ | |
| orientation?: 'horizontal' | 'vertical'; | |
| /** Additional class for root element */ | |
| class?: string; | |
| /** Content for panels [panelA, panelB] */ | |
| children?: [JSX.Element, JSX.Element]; | |
| } | |
| const SplitterComponent: Component<SplitterProps> = (props) => { | |
| const childElements = () => props.children; | |
| return ( | |
| <Splitter.Root | |
| panels={props.panels || [ | |
| { id: 'a', minSize: 10 }, | |
| { id: 'b', minSize: 10 }, | |
| ]} | |
| defaultSize={props.defaultSize || [80, 20]} | |
| orientation={props.orientation || 'horizontal'} | |
| class={props.class} | |
| > | |
| <Splitter.Panel id='a'> | |
| {childElements()?.[0]} | |
| </Splitter.Panel> | |
| <Splitter.ResizeTrigger id='a:b' aria-label='Resize' /> | |
| <Splitter.Panel id='b'> | |
| {childElements()?.[1]} | |
| </Splitter.Panel> | |
| </Splitter.Root> | |
| ); | |
| }; |
🤖 Prompt for AI Agents
In packages/ui/src/zag/Splitter.tsx around lines 28 to 48, the component renders
hardcoded placeholder content ("A" and "B") instead of exposing panel content to
consumers; update the component to accept and render dynamic content by
supporting either a children prop (paired panels as children nodes) or a panels
array that includes content/render functions per panel, then map over
props.panels (or children) to produce <Splitter.Panel id=...> elements with the
provided content and render the corresponding <Splitter.ResizeTrigger> between
panels; keep existing defaults for panels/defaultSize/orientation when props are
missing.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
turbo.json (1)
19-22: Consider using["^build"]for consistency with the build task.The deploy task uses
dependsOn: ["build"]while the build task uses["^build"]. While your current deployment strategy (orchestrated through package.json scripts) explicitly handles dependency builds, this inconsistency could cause issues if someone directly invokesturbo run deploywith--filter. Aligning this to["^build"]improves consistency and prevents potential missed transitive dependencies.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
packages/ui/tsconfig.jsonpackages/workers/src/middleware/__tests__/rateLimit.test.jspackages/workers/src/routes/__tests__/contact.test.jspackages/workers/src/routes/__tests__/email.test.jsturbo.json
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/ui/tsconfig.json
🧰 Additional context used
📓 Path-based instructions (7)
**/*
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Do not use emojis in code, comments, documentation, or commit messages
NEVER use emojis anywhere in code, comments, documentation, plan files, or commit messages. This includes unicode symbols. For UI icons, use solid-icons library or SVGs only.
Files:
packages/workers/src/routes/__tests__/email.test.jspackages/workers/src/routes/__tests__/contact.test.jspackages/workers/src/middleware/__tests__/rateLimit.test.jsturbo.json
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{js,jsx,ts,tsx}: Prefer modern ES6+ syntax and features
Use aliases for imports when appropriate to improve readability
**/*.{js,jsx,ts,tsx}: Prefer modern ES6+ syntax and features in JavaScript/TypeScript code
Comments should explain why something is being done, not narrate what the code does. Avoid comments that repeat variable names or describe obvious code behavior.
Files:
packages/workers/src/routes/__tests__/email.test.jspackages/workers/src/routes/__tests__/contact.test.jspackages/workers/src/middleware/__tests__/rateLimit.test.js
packages/workers/src/**/*.{js,ts}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
packages/workers/src/**/*.{js,ts}: Use Zod for schema and input validation on the backend
Use Drizzle ORM for database interactions and migrations
Use Better-Auth for authentication and user management
packages/workers/src/**/*.{js,ts}: Use Zod for schema and input validation on the backend
Use Better-Auth for authentication and user management
packages/workers/src/**/*.{js,ts}: Always usecreateDomainErrorfrom@corates/sharedfor error handling in backend routes with predefined error constants (PROJECT_ERRORS, AUTH_ERRORS, VALIDATION_ERRORS, SYSTEM_ERRORS, USER_ERRORS)
Wrap database operations in try-catch blocks and return domain errors usingcreateDomainError(SYSTEM_ERRORS.DB_ERROR, {...})instead of throwing raw errors
Use validation middleware withvalidateRequest(schema)to handle validation errors automatically rather than manually creating validation errors in routes
Files:
packages/workers/src/routes/__tests__/email.test.jspackages/workers/src/routes/__tests__/contact.test.jspackages/workers/src/middleware/__tests__/rateLimit.test.js
packages/workers/src/routes/**/*.js
📄 CodeRabbit inference engine (.cursor/rules/api-routes.mdc)
packages/workers/src/routes/**/*.js: Always usevalidateRequestmiddleware for request body validation in API routes, passing appropriate schema from validation config
UsevalidateQueryParamsmiddleware for validating query string parameters with Zod schemas
Always create database client from environment usingcreateDb(c.env.DB)in route handlers
Usedb.batch()for related database operations that must be atomic (succeed or fail together)
Always use Drizzle ORM for database queries; never use raw SQL
Always usecreateDomainErrorfrom@corates/sharedfor error responses, with appropriate error constants (PROJECT_ERRORS, AUTH_ERRORS, VALIDATION_ERRORS, SYSTEM_ERRORS, USER_ERRORS)
Never create error objects manually or throw error strings; use error constants from@corates/shared
Order middleware chain in routes as: authentication (requireAuth), authorization (requireEntitlement,requireQuota), validation (validateRequest,validateQueryParams), then route handler
UsegetAuth(c)to retrieve authenticated user information in route handlers
Usec.get('validatedBody')to access request body data after validation middleware
Usec.get('validatedQuery')to access query parameters after validation middleware
Files:
packages/workers/src/routes/__tests__/email.test.jspackages/workers/src/routes/__tests__/contact.test.js
packages/{web,workers}/src/**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/error-handling.mdc)
packages/{web,workers}/src/**/*.{js,ts,jsx,tsx}: Never throw string literals; always throw Error objects or return domain errors from API routes
Use error utility functions likeisErrorCodefrom@corates/sharedor@/lib/error-utils.jsto check specific error types instead of manual string comparisons
Files:
packages/workers/src/routes/__tests__/email.test.jspackages/workers/src/routes/__tests__/contact.test.jspackages/workers/src/middleware/__tests__/rateLimit.test.js
packages/workers/src/**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/workers.mdc)
ALWAYS use
db.batch()for multiple related database operations to ensure atomicity in Drizzle transactions. Single independent operations do not need batch.
Files:
packages/workers/src/routes/__tests__/email.test.jspackages/workers/src/routes/__tests__/contact.test.jspackages/workers/src/middleware/__tests__/rateLimit.test.js
packages/workers/src/routes/**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/workers.mdc)
ALWAYS validate request bodies using
validateRequestmiddleware from validation config. Do not perform manual validation.
Files:
packages/workers/src/routes/__tests__/email.test.jspackages/workers/src/routes/__tests__/contact.test.js
⏰ 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: Workers Builds: corates-workers-prod
- GitHub Check: Workers Builds: corates
🔇 Additional comments (7)
packages/workers/src/routes/__tests__/email.test.js (1)
52-52: LGTM: Production environment applied to all email tests.Adding
ENVIRONMENT: 'production'to thefetchEmailhelper ensures all email route tests run with production-like behavior, which is particularly important for rate limiting tests.packages/workers/src/middleware/__tests__/rateLimit.test.js (1)
43-43: LGTM: Consistent production environment setup across rate limit tests.The production environment is now consistently applied across all rate limit middleware test cases, ensuring that rate limiting behavior is tested under production-like conditions. The approach of creating a
testEnvobject and passing it as the second argument toapp.request()is clean and maintainable.Also applies to: 90-90, 124-124, 158-158, 208-208, 248-248
packages/workers/src/routes/__tests__/contact.test.js (1)
305-305: No action needed - this inconsistency is intentional and correct.The different environment configurations between email and contact tests reflect the different testing needs of each route. Rate limiting middleware (in
rateLimit.jsline 62) explicitly skips rate limiting whenENVIRONMENT !== 'production', making the production environment essential only for rate limiting tests. The contact.test.js approach of settingENVIRONMENT: 'production'only in the rate limiting test is appropriate since no other contact route features are environment-dependent. If email.test.js applies it globally, that reflects broader testing requirements for the email route (such as queue behavior), not an inconsistency that needs to be resolved.turbo.json (4)
4-7: LGTM! Build task properly configured.The addition of
dependsOn: ["^build"]ensures dependency builds complete first, and the expanded outputs correctly capture additional build artifacts (.output/**,.vinxi/**) likely from Vinxi/SolidStart frameworks.
8-14: LGTM! Test tasks properly configured.The test task correctly depends on
["^build"]to ensure all dependencies are built before tests run. The watch variant appropriately disables caching for continuous feedback during development.
15-18: LGTM! Dev task properly configured.Disabling cache and enabling persistence is appropriate for the development server task.
23-28: LGTM! Lint and format tasks properly configured.Empty outputs arrays correctly indicate these tasks don't produce build artifacts, which is appropriate for code quality checks and formatting operations.
…om/InfinityBowman/corates into 143-convert-packages-to-typescript
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 (2)
packages/mcp/src/tools/code-review.ts (1)
94-213: Replace emojis with text markers to comply with coding guidelines.The prompt template uses emoji characters (🔴, 🟠, 🟡) for severity indicators, which violates the project's strict no-emoji policy: "NEVER use emojis anywhere in code, comments, documentation, plan files, or commit messages."
Ironically, line 112 of this same prompt instructs reviewers to avoid emojis ("solid-icons (NO emoji characters)"). The severity markers should use text-based alternatives.
Proposed fix using text markers
-### 🔴 CRITICAL +### [CRITICAL] Issues that can: // ... -### 🟠 MODERATE +### [MODERATE] Issues that: // ... -### 🟡 LOW +### [LOW] Issues that: // ... ## Output Format (STRICT) -### 🔴 CRITICAL ISSUES +### [CRITICAL] ISSUES [Important and dangerous] // ... -### 🟠 MODERATE ISSUES +### [MODERATE] ISSUES [Important but not immediately dangerous] // ... -### 🟡 LOW ISSUES +### [LOW] ISSUES [Cleanups and improvements]As per coding guidelines.
packages/ui/src/zag/Select.tsx (1)
131-146: Type mismatch betweenonChangesignature and multiple select handling.The
onChangecallback is typed as(value: string) => void, but for multiple selection, an array is passed using an unsafe castdetails.value as unknown as string. This breaks type safety.🔎 Suggested fix to support both single and multiple selection
Update the interface to handle both cases:
export interface SelectProps { // ... /** Callback when value changes */ - onChange?: (value: string) => void; + onChange?: (value: string | string[]) => void; // ... }Then update the handler:
const handleValueChange = (details: { value: string[] }) => { if (!local.onChange) return; if (merged.multiple) { - local.onChange(details.value as unknown as string); + local.onChange(details.value); } else { // ... existing single select logic } };
♻️ Duplicate comments (2)
packages/ui/src/zag/Collapsible.tsx (1)
54-55: Reactivity issue: snapshot passed touseCollapsiblehook.The concern from the past review remains valid. Calling
arkProps()creates a snapshot that breaks Solid.js reactivity. The hook won't respond to prop changes.packages/ui/src/zag/Clipboard.tsx (1)
124-232: MissingdefaultValuein CopyButtonProps interface.The
CopyButtoncomponent passesdefaultValue={machineProps.defaultValue}toClipboard.Rootat line 214, butdefaultValueis not declared in theCopyButtonPropsinterface (lines 124-145). TypeScript will reject this or silently ignore the prop.Proposed fix
export interface CopyButtonProps { /** Value to copy */ value: string; + /** Initial value to copy */ + defaultValue?: string; /** Callback when copy status changes */ onStatusChange?: (details: { copied: boolean }) => void;
🧹 Nitpick comments (9)
packages/mcp/src/tools/code-review.ts (2)
25-45: Consider simplifying the redundant immutability annotations.Both
readonly string[]type annotation andas constassertion are used together. Sinceas constalready provides readonly + literal types, the explicitreadonlyannotation is redundant. You can either keep the type annotation and removeas const, or remove the explicit type and rely on type inference fromas const.Proposed simplification
Option 1 - Keep explicit type, remove
as const:-const IGNORED_EXTENSIONS: readonly string[] = [ +const IGNORED_EXTENSIONS: readonly string[] = [ '.txt', '.lock', // ... -] as const; +];Option 2 - Use
as constwith inferred type:-const IGNORED_EXTENSIONS: readonly string[] = [ +const IGNORED_EXTENSIONS = [ '.txt', '.lock', // ... ] as const;
268-271: Consider extracting buffer size magic numbers as named constants.The buffer sizes
1024 * 1024(1MB) and1024 * 1024 * 5(5MB) are repeated throughout the code as magic numbers. Extracting them as named constants would improve maintainability and make the intent clearer.Proposed refactor
Add constants at the top of the file:
+const MAX_FILE_LIST_BUFFER = 1024 * 1024; // 1MB +const MAX_DIFF_BUFFER = 1024 * 1024 * 5; // 5MB + // Files to exclude from review (binary, generated, lock files) const IGNORED_EXTENSIONS: readonly string[] = [Then use them in the code:
const { stdout: rawFiles } = (await execFileAsync('git', filesArgs, { cwd: repoRoot, - maxBuffer: 1024 * 1024, + maxBuffer: MAX_FILE_LIST_BUFFER, })) as ExecFileResult; // ... later ... const { stdout: diff } = (await execFileAsync( 'git', ['diff', '--', ...unstagedFiles.trim().split('\n')], { cwd: repoRoot, - maxBuffer: 1024 * 1024 * 5, + maxBuffer: MAX_DIFF_BUFFER, }, )) as ExecFileResult;Also applies to: 305-307, 337-340
packages/ui/src/zag/Menu.tsx (1)
10-22: Consider extracting thePlacementtype to a shared module.The
Placementtype is duplicated across at least three files:Menu.tsx,Popover.tsx, andTooltip.tsx. This violates DRY and will require multiple updates if placement options change.🔎 Suggested approach
Create a shared types file:
// packages/ui/src/zag/types.ts export type Placement = | 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end';Then import from the shared file in each component.
packages/ui/src/zag/PinInput.tsx (1)
93-94: Inconsistent export pattern: uses both named and default exports.Other components in this PR (Menu, Drawer, TagsInput, RadioGroup, etc.) use only named exports. PinInput exports both a named export and a default export, which is inconsistent.
🔎 Suggested fix for consistency
export { PinInputComponent as PinInput }; -export default PinInputComponent;If a default export is needed for backward compatibility, consider keeping it but documenting why.
packages/ui/src/zag/Select.tsx (1)
265-265: Dual export pattern for backward compatibility.The component exports both a default export and a named export. If this is intentional for backward compatibility, consider adding a comment explaining why. Otherwise, align with the named-export-only pattern used by other components.
Also applies to: 271-271
packages/ui/src/zag/QRCode.tsx (1)
60-61: Consider removing the default export for consistency.QRCode exports both a named export (
QRCode) and a default export (QRCodeComponent). Other migrated components in this PR (Combobox, FloatingPanel, Progress, NumberInput, Avatar, Tooltip) use only named exports. For consistency across the Zag UI package, consider removing the default export.Suggested change
export { QRCodeComponent as QRCode }; -export default QRCodeComponent;packages/ui/src/zag/Tooltip.tsx (1)
12-24: Consider extracting the duplicated Placement type.The
Placementtype is duplicated across multiple Zag components:
Menu.tsx(lines 9-21)Popover.tsx(lines 11-23)Tour.tsx(lines 24-36)Tooltip.tsx(lines 12-24)Consider extracting this to a shared types file (e.g.,
packages/ui/src/zag/types.tsorpackages/ui/src/types/placement.ts) and importing it across these components to follow DRY principles.Example shared type
Create
packages/ui/src/zag/types.ts:export type Placement = | 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end';Then import in each component:
import { Placement } from './types.js';packages/ui/src/zag/index.ts (1)
5-32: Consider whether explicit.tsxextensions are necessary.All re-export statements include explicit
.tsxfile extensions. While this can be required for ESM compatibility or specificmoduleResolutionsettings, TypeScript typically resolves these automatically. If your build configuration handles extension resolution, these explicit extensions may be redundant.Optional: Verify extension resolution requirements
Check your
tsconfig.jsonand build setup to confirm whether explicit extensions are required:#!/bin/bash # Check tsconfig moduleResolution and module settings cat tsconfig.json | jq '.compilerOptions | {module, moduleResolution, allowImportingTsExtensions}'packages/ui/src/zag/Tabs.tsx (1)
33-36: Optional: Simplify by removing redundant accessor wrappers.The accessor wrapper functions (
value(),defaultValue(),tabsList(),children()) are unnecessary in SolidJS. Thepropsobject is already a reactive proxy, so you can directly accessprops.value,props.tabs, etc., and reactivity will be maintained.Proposed simplification
- const value = () => props.value; - const defaultValue = () => props.defaultValue; - const tabsList = () => props.tabs; - const children = () => props.children; - const handleValueChange = (details: { value: string }) => { if (props.onValueChange) { props.onValueChange(details.value); } }; return ( <Tabs.Root - value={value()} - defaultValue={defaultValue() || tabsList()[0]?.value} + value={props.value} + defaultValue={props.defaultValue || props.tabs[0]?.value} onValueChange={handleValueChange} > - <Tabs.List class='flex overflow-x-auto rounded-t-lg border-b border-gray-200 bg-white'> - <For each={tabsList()}> + <Tabs.List class='flex overflow-x-auto rounded-t-lg border-b border-gray-200 bg-white'> + <For each={props.tabs}>And similarly update
children()references toprops.children.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (35)
.github/dependabot.yml.github/workflows/prettier.ymlpackages/mcp/src/tools/better-auth.tspackages/mcp/src/tools/code-review.tspackages/mcp/src/tools/drizzle.tspackages/mcp/src/tools/lint.tspackages/ui/src/zag/Accordion.tsxpackages/ui/src/zag/Avatar.tsxpackages/ui/src/zag/Checkbox.tsxpackages/ui/src/zag/Clipboard.tsxpackages/ui/src/zag/Collapsible.tsxpackages/ui/src/zag/Combobox.tsxpackages/ui/src/zag/Dialog.tsxpackages/ui/src/zag/Drawer.tsxpackages/ui/src/zag/FloatingPanel.tsxpackages/ui/src/zag/Menu.tsxpackages/ui/src/zag/NumberInput.tsxpackages/ui/src/zag/PasswordInput.tsxpackages/ui/src/zag/PinInput.tsxpackages/ui/src/zag/Popover.tsxpackages/ui/src/zag/Progress.tsxpackages/ui/src/zag/QRCode.tsxpackages/ui/src/zag/RadioGroup.tsxpackages/ui/src/zag/Select.tsxpackages/ui/src/zag/Splitter.tsxpackages/ui/src/zag/Switch.tsxpackages/ui/src/zag/Tabs.tsxpackages/ui/src/zag/TagsInput.tsxpackages/ui/src/zag/Toast.tsxpackages/ui/src/zag/ToggleGroup.tsxpackages/ui/src/zag/Tooltip.tsxpackages/ui/src/zag/Tour.tsxpackages/ui/src/zag/index.tspackages/workers/src/middleware/__tests__/rateLimit.test.jsturbo.json
💤 Files with no reviewable changes (1)
- .github/workflows/prettier.yml
🚧 Files skipped from review as they are similar to previous changes (7)
- packages/ui/src/zag/Checkbox.tsx
- packages/ui/src/zag/Popover.tsx
- packages/mcp/src/tools/drizzle.ts
- packages/workers/src/middleware/tests/rateLimit.test.js
- packages/ui/src/zag/Splitter.tsx
- packages/ui/src/zag/Switch.tsx
- .github/dependabot.yml
🧰 Additional context used
📓 Path-based instructions (5)
**/*
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Do not use emojis in code, comments, documentation, or commit messages
NEVER use emojis anywhere in code, comments, documentation, plan files, or commit messages. This includes unicode symbols. For UI icons, use solid-icons library or SVGs only.
Files:
packages/ui/src/zag/Toast.tsxpackages/mcp/src/tools/better-auth.tspackages/ui/src/zag/QRCode.tsxpackages/ui/src/zag/Tooltip.tsxpackages/ui/src/zag/NumberInput.tsxpackages/ui/src/zag/RadioGroup.tsxpackages/ui/src/zag/ToggleGroup.tsxpackages/ui/src/zag/Select.tsxpackages/mcp/src/tools/lint.tspackages/ui/src/zag/Tour.tsxturbo.jsonpackages/ui/src/zag/Tabs.tsxpackages/ui/src/zag/index.tspackages/ui/src/zag/Accordion.tsxpackages/ui/src/zag/Avatar.tsxpackages/ui/src/zag/Collapsible.tsxpackages/ui/src/zag/Combobox.tsxpackages/ui/src/zag/Drawer.tsxpackages/ui/src/zag/TagsInput.tsxpackages/ui/src/zag/PinInput.tsxpackages/ui/src/zag/Dialog.tsxpackages/ui/src/zag/Menu.tsxpackages/ui/src/zag/PasswordInput.tsxpackages/ui/src/zag/Clipboard.tsxpackages/mcp/src/tools/code-review.tspackages/ui/src/zag/FloatingPanel.tsxpackages/ui/src/zag/Progress.tsx
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{js,jsx,ts,tsx}: Prefer modern ES6+ syntax and features
Use aliases for imports when appropriate to improve readability
**/*.{js,jsx,ts,tsx}: Prefer modern ES6+ syntax and features in JavaScript/TypeScript code
Comments should explain why something is being done, not narrate what the code does. Avoid comments that repeat variable names or describe obvious code behavior.
Files:
packages/ui/src/zag/Toast.tsxpackages/mcp/src/tools/better-auth.tspackages/ui/src/zag/QRCode.tsxpackages/ui/src/zag/Tooltip.tsxpackages/ui/src/zag/NumberInput.tsxpackages/ui/src/zag/RadioGroup.tsxpackages/ui/src/zag/ToggleGroup.tsxpackages/ui/src/zag/Select.tsxpackages/mcp/src/tools/lint.tspackages/ui/src/zag/Tour.tsxpackages/ui/src/zag/Tabs.tsxpackages/ui/src/zag/index.tspackages/ui/src/zag/Accordion.tsxpackages/ui/src/zag/Avatar.tsxpackages/ui/src/zag/Collapsible.tsxpackages/ui/src/zag/Combobox.tsxpackages/ui/src/zag/Drawer.tsxpackages/ui/src/zag/TagsInput.tsxpackages/ui/src/zag/PinInput.tsxpackages/ui/src/zag/Dialog.tsxpackages/ui/src/zag/Menu.tsxpackages/ui/src/zag/PasswordInput.tsxpackages/ui/src/zag/Clipboard.tsxpackages/mcp/src/tools/code-review.tspackages/ui/src/zag/FloatingPanel.tsxpackages/ui/src/zag/Progress.tsx
packages/{web,ui}/src/**/*.{jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/corates.mdc)
Group related components in subdirectories with barrel exports
Files:
packages/ui/src/zag/Toast.tsxpackages/ui/src/zag/QRCode.tsxpackages/ui/src/zag/Tooltip.tsxpackages/ui/src/zag/NumberInput.tsxpackages/ui/src/zag/RadioGroup.tsxpackages/ui/src/zag/ToggleGroup.tsxpackages/ui/src/zag/Select.tsxpackages/ui/src/zag/Tour.tsxpackages/ui/src/zag/Tabs.tsxpackages/ui/src/zag/Accordion.tsxpackages/ui/src/zag/Avatar.tsxpackages/ui/src/zag/Collapsible.tsxpackages/ui/src/zag/Combobox.tsxpackages/ui/src/zag/Drawer.tsxpackages/ui/src/zag/TagsInput.tsxpackages/ui/src/zag/PinInput.tsxpackages/ui/src/zag/Dialog.tsxpackages/ui/src/zag/Menu.tsxpackages/ui/src/zag/PasswordInput.tsxpackages/ui/src/zag/Clipboard.tsxpackages/ui/src/zag/FloatingPanel.tsxpackages/ui/src/zag/Progress.tsx
packages/{web,ui}/**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
packages/{web,ui}/**/*.{js,jsx,ts,tsx}: Import UI components from '@corates/ui' package instead of local component files. Do not import Ark UI components from local paths like '@/components/zag/' or 'packages/web/src/components/zag/'
Always use 'solid-icons' library for icons. Never use emoji characters or text as icon replacements. Import from specific icon sets like 'solid-icons/bi', 'solid-icons/fi', 'solid-icons/ai', etc.
Files:
packages/ui/src/zag/Toast.tsxpackages/ui/src/zag/QRCode.tsxpackages/ui/src/zag/Tooltip.tsxpackages/ui/src/zag/NumberInput.tsxpackages/ui/src/zag/RadioGroup.tsxpackages/ui/src/zag/ToggleGroup.tsxpackages/ui/src/zag/Select.tsxpackages/ui/src/zag/Tour.tsxpackages/ui/src/zag/Tabs.tsxpackages/ui/src/zag/index.tspackages/ui/src/zag/Accordion.tsxpackages/ui/src/zag/Avatar.tsxpackages/ui/src/zag/Collapsible.tsxpackages/ui/src/zag/Combobox.tsxpackages/ui/src/zag/Drawer.tsxpackages/ui/src/zag/TagsInput.tsxpackages/ui/src/zag/PinInput.tsxpackages/ui/src/zag/Dialog.tsxpackages/ui/src/zag/Menu.tsxpackages/ui/src/zag/PasswordInput.tsxpackages/ui/src/zag/Clipboard.tsxpackages/ui/src/zag/FloatingPanel.tsxpackages/ui/src/zag/Progress.tsx
packages/{web,ui}/**/*.{jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/ui-components.mdc)
Use Tailwind CSS classes for styling components
Files:
packages/ui/src/zag/Toast.tsxpackages/ui/src/zag/QRCode.tsxpackages/ui/src/zag/Tooltip.tsxpackages/ui/src/zag/NumberInput.tsxpackages/ui/src/zag/RadioGroup.tsxpackages/ui/src/zag/ToggleGroup.tsxpackages/ui/src/zag/Select.tsxpackages/ui/src/zag/Tour.tsxpackages/ui/src/zag/Tabs.tsxpackages/ui/src/zag/Accordion.tsxpackages/ui/src/zag/Avatar.tsxpackages/ui/src/zag/Collapsible.tsxpackages/ui/src/zag/Combobox.tsxpackages/ui/src/zag/Drawer.tsxpackages/ui/src/zag/TagsInput.tsxpackages/ui/src/zag/PinInput.tsxpackages/ui/src/zag/Dialog.tsxpackages/ui/src/zag/Menu.tsxpackages/ui/src/zag/PasswordInput.tsxpackages/ui/src/zag/Clipboard.tsxpackages/ui/src/zag/FloatingPanel.tsxpackages/ui/src/zag/Progress.tsx
🧠 Learnings (26)
📓 Common learnings
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/ui-components.mdc:0-0
Timestamp: 2025-12-24T17:23:17.309Z
Learning: Applies to packages/web/**/*.{js,jsx,ts,tsx} : Use import aliases from 'packages/web/jsconfig.json' instead of relative paths. Aliases include: '@/*' (src/*), 'components/*' (src/components/*), 'auth-ui/*' (src/components/auth-ui/*), 'checklist-ui/*' (src/components/checklist-ui/*), 'project-ui/*' (src/components/project-ui/*), 'routes/*' (src/routes/*), 'primitives/*' (src/primitives/*), 'api/*' (src/api/*), 'config/*' (src/config/*), and 'lib/*' (src/lib/*)
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/web/src/**/*.{js,jsx,ts,tsx} : Ensure browser compatibility for all frontend code (Safari is usually problematic)
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/web/src/components/**/*.{js,jsx,ts,tsx} : Use Zag.js for UI components and design system
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/corates.mdc:0-0
Timestamp: 2025-12-24T17:22:48.927Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Prefer modern ES6+ syntax and features in JavaScript/TypeScript code
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/corates.mdc:0-0
Timestamp: 2025-12-24T17:22:48.927Z
Learning: Applies to packages/web/src/**/*.{js,jsx,ts,tsx} : Use import aliases from jsconfig.json instead of relative paths
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Prefer modern ES6+ syntax and features
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/web/src/components/**/*.{js,jsx,ts,tsx} : Use responsive design principles for UI components
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/ui-components.mdc:0-0
Timestamp: 2025-12-24T17:23:17.309Z
Learning: Applies to packages/{web,ui}/**/*.{jsx,tsx} : Use Tailwind CSS classes for styling components
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/corates.mdc:0-0
Timestamp: 2025-12-24T17:22:48.927Z
Learning: Applies to packages/{web,ui}/src/**/*.{jsx,tsx} : Group related components in subdirectories with barrel exports
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/web/src/**/*.{js,jsx,ts,tsx} : Keep files small, focused, and modular. If a file exceeds a high number of lines, consider refactoring by extracting sub-modules into a folder with index.jsx and helper components, moving complex logic into separate utility files or primitives, or splitting large forms into section components
📚 Learning: 2025-12-24T17:22:56.372Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/error-handling.mdc:0-0
Timestamp: 2025-12-24T17:22:56.372Z
Learning: Applies to packages/web/src/**/*.{js,ts,jsx,tsx} : Always use `handleFetchError` from `@/lib/error-utils.js` for fetch calls in frontend code with options like `{ showToast: true }` for error handling
Applied to files:
packages/ui/src/zag/Toast.tsx
📚 Learning: 2025-12-24T17:22:48.927Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/corates.mdc:0-0
Timestamp: 2025-12-24T17:22:48.927Z
Learning: Applies to packages/{web,landing}/src/**/*.{jsx,tsx} : Use Ark UI components from corates/ui package, not local component implementations
Applied to files:
packages/ui/src/zag/Toast.tsxpackages/ui/src/zag/Select.tsxpackages/ui/src/zag/Tour.tsxpackages/ui/src/zag/index.tspackages/ui/src/zag/Collapsible.tsxpackages/ui/src/zag/Combobox.tsxpackages/ui/src/zag/TagsInput.tsx
📚 Learning: 2025-12-24T17:22:48.927Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/corates.mdc:0-0
Timestamp: 2025-12-24T17:22:48.927Z
Learning: Applies to packages/workers/src/**/*.{js,ts} : Use Better-Auth for authentication and user management
Applied to files:
packages/mcp/src/tools/better-auth.ts
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Use the Corates MCP tools to explore local documentation sources for Better-Auth, Drizzle, Icons, and Zag documentation
Applied to files:
packages/mcp/src/tools/better-auth.ts
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/web/src/components/**/*.{js,jsx,ts,tsx} : Use Zag.js for UI components and design system
Applied to files:
packages/ui/src/zag/QRCode.tsxpackages/ui/src/zag/Tooltip.tsxpackages/ui/src/zag/NumberInput.tsxpackages/ui/src/zag/ToggleGroup.tsxpackages/ui/src/zag/Select.tsxpackages/ui/src/zag/Tour.tsxpackages/ui/src/zag/Tabs.tsxpackages/ui/src/zag/index.tspackages/ui/src/zag/Accordion.tsxpackages/ui/src/zag/Avatar.tsxpackages/ui/src/zag/Collapsible.tsxpackages/ui/src/zag/Combobox.tsxpackages/ui/src/zag/Drawer.tsxpackages/ui/src/zag/TagsInput.tsxpackages/ui/src/zag/Dialog.tsxpackages/ui/src/zag/Menu.tsxpackages/ui/src/zag/PasswordInput.tsxpackages/ui/src/zag/Clipboard.tsxpackages/ui/src/zag/FloatingPanel.tsxpackages/ui/src/zag/Progress.tsx
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/web/src/components/**/*.{js,jsx,ts,tsx} : Components should receive at most 1–5 props, and only for local configuration, not shared state. If a component would need more than 5 props, move the shared data into an external store, a primitive, or Solid context
Applied to files:
packages/ui/src/zag/NumberInput.tsxpackages/ui/src/zag/Accordion.tsxpackages/ui/src/zag/Collapsible.tsxpackages/ui/src/zag/TagsInput.tsxpackages/ui/src/zag/PinInput.tsx
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/web/src/components/**/*.{js,jsx,ts,tsx} : Zag component exist in `packages/web/src/components/zag/*` and should be reused. Check the README.md in that folder for a list of existing components before adding new components and when debugging
Applied to files:
packages/ui/src/zag/ToggleGroup.tsxpackages/ui/src/zag/Tour.tsxpackages/ui/src/zag/Tabs.tsxpackages/ui/src/zag/index.tspackages/ui/src/zag/Accordion.tsxpackages/ui/src/zag/Combobox.tsxpackages/ui/src/zag/Drawer.tsxpackages/ui/src/zag/TagsInput.tsxpackages/ui/src/zag/Dialog.tsxpackages/ui/src/zag/Menu.tsx
📚 Learning: 2025-12-24T17:23:17.309Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/ui-components.mdc:0-0
Timestamp: 2025-12-24T17:23:17.309Z
Learning: Applies to packages/{web,ui}/**/*.{js,jsx,ts,tsx} : Import UI components from 'corates/ui' package instead of local component files. Do not import Ark UI components from local paths like '@/components/zag/' or 'packages/web/src/components/zag/'
Applied to files:
packages/ui/src/zag/Select.tsxpackages/ui/src/zag/Tour.tsxpackages/ui/src/zag/Tabs.tsxpackages/ui/src/zag/index.tspackages/ui/src/zag/Collapsible.tsxpackages/ui/src/zag/TagsInput.tsxpackages/ui/src/zag/Progress.tsx
📚 Learning: 2025-12-24T17:23:10.082Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-24T17:23:10.082Z
Learning: Applies to {packages/web/**,packages/landing/**}/**/*.{jsx,tsx,js,ts} : Use the `Show` component from solid-js for conditional rendering instead of JavaScript ternary operators or logical AND operators.
Applied to files:
packages/ui/src/zag/Tour.tsxpackages/ui/src/zag/Tabs.tsxpackages/ui/src/zag/Collapsible.tsxpackages/ui/src/zag/Drawer.tsxpackages/ui/src/zag/Menu.tsx
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/workers/src/**/*.{js,ts} : Use Zod for schema and input validation on the backend
Applied to files:
turbo.jsonpackages/mcp/src/tools/code-review.ts
📚 Learning: 2025-12-24T17:23:10.082Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-24T17:23:10.082Z
Learning: Applies to {packages/web/**,packages/landing/**}/**/*.{jsx,tsx,js,ts} : Use the `For` component from solid-js for rendering lists. It provides better performance and keying compared to JavaScript's map function in JSX.
Applied to files:
packages/ui/src/zag/Tabs.tsx
📚 Learning: 2025-12-24T17:22:48.927Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/corates.mdc:0-0
Timestamp: 2025-12-24T17:22:48.927Z
Learning: Applies to packages/{web,ui}/src/**/*.{jsx,tsx} : Group related components in subdirectories with barrel exports
Applied to files:
packages/ui/src/zag/index.ts
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/web/src/components/**/*.{js,jsx,ts,tsx} : Group related components in subdirectories with an index.js barrel export
Applied to files:
packages/ui/src/zag/index.ts
📚 Learning: 2025-12-24T17:23:17.309Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/ui-components.mdc:0-0
Timestamp: 2025-12-24T17:23:17.309Z
Learning: Applies to packages/web/**/*.{js,jsx,ts,tsx} : Use import aliases from 'packages/web/jsconfig.json' instead of relative paths. Aliases include: '@/*' (src/*), 'components/*' (src/components/*), 'auth-ui/*' (src/components/auth-ui/*), 'checklist-ui/*' (src/components/checklist-ui/*), 'project-ui/*' (src/components/project-ui/*), 'routes/*' (src/routes/*), 'primitives/*' (src/primitives/*), 'api/*' (src/api/*), 'config/*' (src/config/*), and 'lib/*' (src/lib/*)
Applied to files:
packages/ui/src/zag/index.ts
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/web/src/components/**/*.{js,jsx,ts,tsx} : Use responsive design principles for UI components
Applied to files:
packages/ui/src/zag/index.ts
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/web/src/primitives/**/*.{js,ts} : Create reusable logic in primitives (hooks) that can be shared across components to keep components clean and focused on rendering
Applied to files:
packages/ui/src/zag/index.ts
📚 Learning: 2025-12-24T17:23:10.082Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-24T17:23:10.082Z
Learning: Applies to {packages/web/**,packages/landing/**}/src/primitives/**/*.{jsx,tsx,js,ts} : Create reusable component logic in primitives (custom hooks) rather than embedding business logic directly in components. Primitives should encapsulate store access and complex logic patterns.
Applied to files:
packages/ui/src/zag/index.ts
📚 Learning: 2025-12-24T17:23:17.309Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/ui-components.mdc:0-0
Timestamp: 2025-12-24T17:23:17.309Z
Learning: Applies to packages/{web,ui}/**/*.{jsx,tsx} : Use Tailwind CSS classes for styling components
Applied to files:
packages/ui/src/zag/index.ts
📚 Learning: 2025-12-19T14:49:49.730Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-19T14:49:49.730Z
Learning: Applies to packages/web/src/components/**/*.{js,jsx,ts,tsx} : Do not destructure props in SolidJS components as it breaks reactivity. Instead, access props directly from the props object or wrap them in a function to ensure they are always up-to-date
Applied to files:
packages/ui/src/zag/Accordion.tsxpackages/ui/src/zag/Collapsible.tsxpackages/ui/src/zag/TagsInput.tsx
📚 Learning: 2025-12-24T17:22:48.927Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/corates.mdc:0-0
Timestamp: 2025-12-24T17:22:48.927Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx} : In SolidJS components, components should receive at most 1-5 props (local config only, not shared state)
Applied to files:
packages/ui/src/zag/Accordion.tsxpackages/ui/src/zag/Collapsible.tsxpackages/ui/src/zag/TagsInput.tsx
📚 Learning: 2025-12-24T17:23:10.082Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-24T17:23:10.082Z
Learning: Applies to {packages/web/**,packages/landing/**}/**/*.{jsx,tsx,js,ts} : Never destructure props in SolidJS components - destructuring breaks reactivity. Access props directly (e.g., `props.name`) or wrap in a function (e.g., `const name = () => props.name`) to maintain reactivity.
Applied to files:
packages/ui/src/zag/Collapsible.tsx
📚 Learning: 2025-12-24T17:23:10.082Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-24T17:23:10.082Z
Learning: Applies to {packages/web/**,packages/landing/**}/**/*.{jsx,tsx,js,ts} : When manipulating children in wrapper components, use the `children` helper from solid-js to ensure proper reactivity and handling of child elements.
Applied to files:
packages/ui/src/zag/Collapsible.tsx
📚 Learning: 2025-12-24T17:22:48.927Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/corates.mdc:0-0
Timestamp: 2025-12-24T17:22:48.927Z
Learning: Applies to packages/web/src/**/*.{jsx,tsx} : In SolidJS, do NOT destructure props. Access props.field directly or wrap in a function: () => props.field
Applied to files:
packages/ui/src/zag/Collapsible.tsx
📚 Learning: 2025-12-24T17:23:10.082Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-24T17:23:10.082Z
Learning: Applies to {packages/web/**,packages/landing/**}/**/*.{jsx,tsx,js,ts} : Use `createMemo` from solid-js for derived values that depend on reactive state, ensuring computed values update only when their dependencies change.
Applied to files:
packages/ui/src/zag/Collapsible.tsx
📚 Learning: 2025-12-24T17:23:10.082Z
Learnt from: CR
Repo: InfinityBowman/corates PR: 0
File: .cursor/rules/solidjs.mdc:0-0
Timestamp: 2025-12-24T17:23:10.082Z
Learning: Applies to {packages/web/**,packages/landing/**}/**/*.{jsx,tsx,js,ts} : Use `createSignal` from solid-js for managing simple reactive values. Prefer derived state with signals or memo over effects when possible.
Applied to files:
packages/ui/src/zag/Collapsible.tsx
🧬 Code graph analysis (5)
packages/mcp/src/tools/better-auth.ts (1)
packages/mcp/src/types.ts (1)
McpServerType(3-3)
packages/ui/src/zag/Tooltip.tsx (3)
packages/ui/src/zag/Menu.tsx (1)
Placement(10-22)packages/ui/src/zag/Popover.tsx (1)
Placement(12-24)packages/ui/src/zag/Tour.tsx (1)
Placement(25-37)
packages/mcp/src/tools/lint.ts (1)
packages/mcp/src/types.ts (1)
McpServerType(3-3)
packages/ui/src/zag/Dialog.tsx (4)
packages/web/src/api/google-drive.js (1)
size(146-146)packages/web/src/components/project-ui/PdfPreviewPanel.jsx (1)
handleOpenChange(14-18)packages/web/src/lib/form-errors.js (1)
details(23-23)packages/ui/src/zag/index.ts (1)
useConfirmDialog(11-11)
packages/ui/src/zag/Menu.tsx (3)
packages/ui/src/zag/Popover.tsx (1)
Placement(12-24)packages/ui/src/zag/Tooltip.tsx (1)
Placement(12-24)packages/web/src/components/checklist-ui/pdf/PdfSelector.jsx (1)
handleSelect(39-41)
⏰ 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: Workers Builds: corates
🔇 Additional comments (47)
packages/mcp/src/tools/better-auth.ts (4)
1-3: LGTM! Clean TypeScript imports.The type-only import of
McpServerTypeand the.jsextension in the import path are correct patterns for TypeScript ESM compatibility.
7-9: LGTM! Proper TypeScript typing for cache.The explicit
Map<string, string>type annotation adds clarity and type safety to the cache implementation.
11-32: LGTM! Well-typed async function with safe non-null assertion.The explicit type annotations strengthen the function signature. The non-null assertion on line 21 is safe because it's guarded by the
has()check on line 20—this is an idiomatic TypeScript pattern for Map access.
34-73: LGTM! Solid TypeScript conversion with improved error handling.The explicit typing of the
serverparameter and the enhanced error handling on lines 67-70 strengthen the code. Checkingerror instanceof Errorbefore accessing.messageis a TypeScript best practice that prevents runtime errors when non-Error values are thrown.turbo.json (8)
4-6: LGTM! Build task properly configured.The
dependsOn: ["^build"]ensures dependencies build first, and the expanded outputs cover multiple build tool conventions (standarddist, Nitro.output, Vinxi.vinxi).
11-13: LGTM! Test task properly depends on build.Ensuring packages are built before running tests is a best practice.
14-17: LGTM! Watch mode configured correctly.Disabling cache for watch mode ensures fresh results, and
persistent: trueis appropriate for long-running watch processes.
18-21: LGTM! Dev task properly configured for development.Disabling cache for dev servers ensures fresh builds, and
persistent: truecorrectly handles the long-running development server.
22-25: LGTM! Deploy task configuration is reasonable.The
dependsOn: ["build"]ensures builds complete first, andcache: falseis appropriate since deployment involves side effects (uploading to external services) that can't be meaningfully cached.
26-28: LGTM! Lint task configured correctly.Empty outputs is appropriate since linting is a check that doesn't produce build artifacts. Turbo will still cache results based on input files.
29-31: LGTM! Format task configured correctly.Empty outputs is appropriate for format checking tasks. Turbo will cache results based on source file inputs.
8-10: The emptyoutputsarray is intentional and correct for this Cloudflare Workers project. The workers package uses Wrangler CLI for bundling and direct deployment to the edge platform, not traditional local build artifacts. The build script only builds the shared dependency; Cloudflare's deployment pipeline handles the rest.Likely an incorrect or invalid review comment.
packages/mcp/src/tools/code-review.ts (4)
1-11: LGTM! Clean imports with proper TypeScript types.The imports are well-structured and align with the TypeScript conversion. Using Zod for validation follows backend best practices.
13-22: LGTM! Well-defined interfaces for git command results.The interfaces accurately model the return types from Node.js
execFileand provide proper type safety for the async operations.
48-66: LGTM! Robust validation with proper type safety.The branch name validation prevents command injection attacks, and the file filtering logic correctly excludes unwanted file types. Type annotations are properly applied.
234-376: LGTM! Well-structured function with robust security and error handling.The TypeScript conversion provides excellent type safety throughout. Security concerns are properly addressed:
- Branch name validation prevents command injection
execFileusage (no shell) prevents shell injection- Buffer limits prevent DoS from large diffs
- Error messages are sanitized to avoid leaking internal paths
The fallback logic to unstaged changes when no branch diff is found improves user experience.
packages/mcp/src/tools/lint.ts (3)
14-14: LGTM!The function signature is properly typed with
McpServerTypeand an explicitvoidreturn type.
21-21: LGTM!The explicit return type annotation provides good type safety and clearly documents the handler's response shape.
34-44: LGTM!The error handling is well-structured with defensive property access and appropriate fallbacks. The use of nullish coalescing on Line 44 correctly handles the case where
codemight be 0,null, orundefined.packages/ui/src/zag/Menu.tsx (1)
24-57: Well-typed interfaces and event handlers.The
MenuItemandMenuPropsinterfaces are well-defined with JSDoc comments. The event handler signatures (handleSelectandhandleOpenChange) are correctly typed with object parameters matching Ark UI's callback patterns.Also applies to: 62-76, 81-86
packages/ui/src/zag/Drawer.tsx (2)
11-32: Clean interface design with appropriate JSDoc documentation.The
DrawerPropsinterface is well-structured with sensible defaults documented in comments. The prop types cover all necessary drawer functionality.
37-51: Correct internal event handler typing and prop unwrapping.The
handleOpenChangecorrectly receives{ open: boolean }from Ark UI internally while exposing a simplified(open: boolean)callback to consumers. This is a clean API design.packages/ui/src/zag/TagsInput.tsx (2)
9-42: Comprehensive and well-documented props interface.The
TagsInputPropsinterface covers all necessary configuration options with clear JSDoc comments. TheblurBehaviorunion type correctly matches Ark UI's expected values.
47-71: Proper TypeScript migration with correct handler typing.The component is correctly typed as
Component<TagsInputProps>. ThevalidateandhandleValueChangehandlers have appropriate type annotations. The named export pattern (TagsInputComponent as TagsInput) is consistent with other components in the PR.Also applies to: 121-123
packages/ui/src/zag/PinInput.tsx (1)
8-25: Well-defined props interface with sensible defaults documented.The
PinInputPropsinterface is clean and properly typed. Default values are documented in JSDoc comments.packages/ui/src/zag/Collapsible.tsx (3)
10-43: Well-structured interfaces for API and props.The
CollapsibleApiinterface clearly defines the programmatic control surface. TheCollapsiblePropsinterface properly types all configuration options including the render function signatures fortriggerandindicator.
80-81: Proper event typing for click handlers.The
handleTriggerClickhandlers are correctly typed withMouseEventand the target is properly cast toHTMLElement.Also applies to: 147-148
117-190: Clean component structure with conditional API usage.The
CollapsibleComponentcorrectly usescreateMemoto determine when the API-enabled path is needed, and theShowcomponent properly switches between the two rendering modes.packages/ui/src/zag/RadioGroup.tsx (2)
8-34: Clean interface design for radio group items and props.Both
RadioGroupItemandRadioGroupPropsinterfaces are well-defined. The item interface supports optional description and disabled state per item.
39-49: Correct TypeScript component declaration and handler typing.The component is properly typed as
Component<RadioGroupProps>. ThehandleValueChangehas the correct signature matching Ark UI's callback pattern. The export pattern is consistent with other components.Also applies to: 92-94
packages/ui/src/zag/Select.tsx (1)
13-54: Comprehensive interface with positioning options.The
SelectOptionandSelectPropsinterfaces are well-defined. The positioning options type allows for Ark UI's flexible configuration.packages/ui/src/zag/Dialog.tsx (3)
11-24: Well-structured interfaces for dialog components and configuration.The
DialogProps,ConfirmDialogProps, andConfirmDialogConfiginterfaces are comprehensive and properly typed. The separation between component props and hook configuration is clean.Also applies to: 94-113, 232-238
29-92: Properly typed dialog components with correct handler signatures.Both
DialogComponentandConfirmDialogComponentare correctly typed asComponent<...Props>. ThehandleOpenChangehandlers correctly receive{ open: boolean }from Ark UI and unwrap appropriately.Also applies to: 118-230
243-321: Clean promise-based confirmation hook implementation.The
useConfirmDialoghook is well-typed with proper generics for the promise resolution. TheresolvePromisevariable is correctly typed as((value: boolean) => void) | null, and the returned API surface is clean.packages/ui/src/zag/Combobox.tsx (1)
14-183: LGTM! TypeScript migration is well-structured.The conversion to TypeScript is solid:
ComboboxItemandComboboxPropsinterfaces clearly define the public API- Type predicate filter at lines 112 correctly narrows
undefinedfrom mapped items- Event handlers are explicitly typed with proper
detailsparameter shapes- Consistent with the broader PR migration pattern
packages/ui/src/zag/FloatingPanel.tsx (1)
12-217: LGTM! Comprehensive TypeScript conversion.The FloatingPanel migration is thorough:
- Clear separation of
FloatingPanelSizeandFloatingPanelPositiontypes- Comprehensive
FloatingPanelPropsinterface covering all configuration options- All event handlers (
onOpenChange,onSizeChange,onPositionChange,onStageChange) properly typed- Explicit return type on
getResizeTriggerStylehelperpackages/ui/src/zag/Clipboard.tsx (1)
9-122: LGTM! Clipboard component TypeScript conversion is solid.The main
Clipboardcomponent migration is well-executed:
ClipboardApiinterface provides a clear programmatic surfaceClipboardPropsincludes all necessary fields includingdefaultValue- Event handlers properly typed
- Render prop pattern correctly typed with
Accessor<ClipboardApi>packages/ui/src/zag/Progress.tsx (1)
8-101: LGTM! Clean TypeScript migration.The Progress component conversion is straightforward and correct:
ProgressPropsinterface clearly defines all configuration options- Component properly typed as
Component<ProgressProps>- Consistent with PR-wide migration pattern
packages/ui/src/zag/QRCode.tsx (1)
8-58: LGTM! TypeScript conversion is correct.The QRCode component migration properly types all props and converts to
Component<QRCodeProps>.packages/ui/src/zag/NumberInput.tsx (1)
9-133: LGTM! Comprehensive TypeScript migration.The NumberInput component conversion is thorough:
NumberInputPropsinterface covers all numeric input configuration options- Properly typed as
Component<NumberInputProps>- Event handlers correctly typed
- Consistent with PR migration pattern
packages/ui/src/zag/Avatar.tsx (1)
8-57: LGTM! Clean TypeScript migration.The Avatar component conversion is well-executed:
AvatarPropsinterface clearly defines the component surface- Status callback properly typed with union literal
'loading' | 'loaded' | 'error'- Component correctly typed as
Component<AvatarProps>packages/ui/src/zag/Tooltip.tsx (1)
26-157: LGTM! Solid TypeScript conversion with comprehensive props.The Tooltip component migration is well-executed:
TooltipPropsinterface thoroughly defines all tooltip configuration options- Event handlers properly typed
- Positioning logic correctly typed with explicit
'fixed' as constat line 132- Component properly typed as
Component<TooltipProps>packages/ui/src/zag/Toast.tsx (1)
5-5: Past review concern resolved.The previous review flagged that
ToastOptionswas incompatible with thetoaster.promiseAPI. This has been correctly addressed by:
- Importing
ToastPromiseOptionsfrom@ark-ui/solid/toast(line 5)- Using
ToastPromiseOptionsas the type for the promise method parameter (line 116)- Re-exporting the
ToastPromiseOptionstype (line 125)The local
ToastOptionsinterface is appropriately used for basic toast operations (success, error, info, loading, update).Also applies to: 116-117, 125-125
packages/ui/src/zag/Tour.tsx (1)
157-157: Verify type assertion compatibility with actual @zag-js/tour API.The type assertion
as TourApiat line 157 cannot be definitively verified as safe without inspecting the actual return type oftour.connect()from the @zag-js/tour package. The project'stsconfig.jsonhasskipLibCheck: true, which prevents TypeScript from validating this assertion against the library's type definitions. While allapi()method calls in the render function align with theTourApiinterface and this pattern is consistent with other Zag.js components in the codebase, the actual type compatibility should be confirmed, especially since this component is deferred from migration and not currently in use.packages/ui/src/zag/Accordion.tsx (1)
6-87: LGTM! Excellent TypeScript conversion with proper SolidJS patterns.The TypeScript conversion is well-executed:
- Comprehensive type definitions with JSDoc comments
- Proper use of
splitPropsto maintain SolidJS reactivity- Correctly typed event handlers
- Clean migration to named exports
The component follows SolidJS best practices by avoiding prop destructuring and using the
Forcomponent for list rendering.packages/ui/src/zag/Tabs.tsx (1)
6-87: Strong TypeScript conversion with comprehensive type definitions.The component properly defines
TabDefinitionandTabsPropsinterfaces with clear documentation, uses typed event handlers, and follows the named export pattern. The use ofShowandForcomponents aligns with SolidJS best practices.packages/ui/src/zag/ToggleGroup.tsx (1)
6-97: LGTM! Comprehensive TypeScript conversion with excellent reactive patterns.The TypeScript conversion demonstrates strong SolidJS patterns:
- Well-structured type definitions with extensive documentation
- Proper use of
splitPropsto maintain reactivity- Correct use of
createMemofor derived state (isVertical)- Clean helper function for size classes
- Properly typed event handlers
- Correct use of
Forcomponent with index trackingThe component exposes a rich API surface with sensible defaults while maintaining type safety throughout.
| interface ExecError extends Error { | ||
| stdout?: string; | ||
| stderr?: string; | ||
| code?: number | string; | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, let's see the complete file to understand the error handling context
cat -n packages/mcp/src/tools/lint.ts | head -50Repository: InfinityBowman/corates
Length of output: 2086
🏁 Script executed:
# Check if ExecException is already being used in the codebase
rg -n "ExecException" --type tsRepository: InfinityBowman/corates
Length of output: 48
🏁 Script executed:
# Check how the error is actually being used around lines 34-44
sed -n '30,50p' packages/mcp/src/tools/lint.tsRepository: InfinityBowman/corates
Length of output: 811
🏁 Script executed:
# Check if error utility functions from corates/shared are being used
rg -n "isErrorCode|error-utils" --type ts packages/Repository: InfinityBowman/corates
Length of output: 48
🌐 Web query:
Node.js child_process ExecException type definition code property
💡 Result:
Short answer — types:
- child_process.ExecException.code: optional number (code?: number). [1][3]
- child_process.ExecFileException (used by execFile): code is string | number | null (merged with ErrnoException). [2]
Sources: Type definitions from @types/node and Node docs. References: [1] child_process.d.ts (@types/node). [2] ExecFileException type (Node/Bun reference). [3] Node.js child_process docs describing error.code as the process exit code.
Update the ExecError.code type to number instead of number | string.
Node.js exec errors have code as a numeric exit code, not a string. Consider using the built-in ExecException type from child_process instead of the custom interface: interface ExecError extends ExecException with stdout and stderr properties.
🤖 Prompt for AI Agents
In packages/mcp/src/tools/lint.ts around lines 8 to 12, the custom ExecError
defines code as number | string but Node exec errors use a numeric exit code;
change the type to number and preferably extend Node's built-in ExecException
instead of redefining the whole interface: import ExecException from
child_process (or use the built-in type), declare interface ExecError extends
ExecException { stdout?: string; stderr?: string } so code is inherited as
number, or at minimum change the current code?: number | string to code?: number
and update any call sites/types accordingly.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.