From 8830af2cbb5f84ae2acdd1e77d2c5f3df001d89d Mon Sep 17 00:00:00 2001 From: chamikaJ Date: Tue, 29 Jul 2025 14:16:52 +0530 Subject: [PATCH 1/2] refactor: update .gitignore and remove obsolete files - Added .cursor and .claude directories to .gitignore to prevent tracking of temporary files. - Deleted obsolete .claude/settings.local.json and .cursor/rules/antd-components.mdc files to clean up the repository and remove unnecessary configurations. --- .claude/settings.local.json | 11 -- .cursor/rules/antd-components.mdc | 237 ------------------------------ .gitignore | 2 + 3 files changed, 2 insertions(+), 248 deletions(-) delete mode 100644 .claude/settings.local.json delete mode 100644 .cursor/rules/antd-components.mdc diff --git a/.claude/settings.local.json b/.claude/settings.local.json deleted file mode 100644 index 06f61982..00000000 --- a/.claude/settings.local.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "permissions": { - "allow": [ - "Bash(find:*)", - "Bash(npm run build:*)", - "Bash(npm run type-check:*)", - "Bash(npm run:*)" - ], - "deny": [] - } -} \ No newline at end of file diff --git a/.cursor/rules/antd-components.mdc b/.cursor/rules/antd-components.mdc deleted file mode 100644 index 7db5eb05..00000000 --- a/.cursor/rules/antd-components.mdc +++ /dev/null @@ -1,237 +0,0 @@ ---- -alwaysApply: true ---- -# Ant Design Import Rules for Worklenz - -## 🚨 CRITICAL: Always Use Centralized Imports - -**NEVER import Ant Design components directly from 'antd' or '@ant-design/icons'** - -### ✅ Correct Import Pattern -```typescript -import { Button, Input, Select, EditOutlined, PlusOutlined } from '@antd-imports'; -// or -import { Button, Input, Select, EditOutlined, PlusOutlined } from '@/shared/antd-imports'; -``` - -### ❌ Forbidden Import Patterns -```typescript -// NEVER do this: -import { Button, Input, Select } from 'antd'; -import { EditOutlined, PlusOutlined } from '@ant-design/icons'; -``` - -## Why This Rule Exists - -### Benefits of Centralized Imports: -- **Better Tree-Shaking**: Optimized bundle size through centralized management -- **Consistent React Context**: Proper context sharing across components -- **Type Safety**: Centralized TypeScript definitions -- **Maintainability**: Single source of truth for all Ant Design imports -- **Performance**: Reduced bundle size and improved loading times - -## What's Available in `@antd-imports` - -### Core Components -- **Layout**: Layout, Row, Col, Flex, Divider, Space -- **Navigation**: Menu, Tabs, Breadcrumb, Pagination -- **Data Entry**: Input, Select, DatePicker, TimePicker, Form, Checkbox, InputNumber -- **Data Display**: Table, List, Card, Tag, Avatar, Badge, Progress, Statistic -- **Feedback**: Modal, Drawer, Alert, Message, Notification, Spin, Skeleton, Result -- **Other**: Button, Typography, Tooltip, Popconfirm, Dropdown, ConfigProvider - -### Icons -Common icons including: EditOutlined, DeleteOutlined, PlusOutlined, MoreOutlined, CheckOutlined, CloseOutlined, CalendarOutlined, UserOutlined, TeamOutlined, and many more. - -### Utilities -- **appMessage**: Centralized message utility -- **appNotification**: Centralized notification utility -- **antdConfig**: Default Ant Design configuration -- **taskManagementAntdConfig**: Task-specific configuration - -## Implementation Guidelines - -### When Creating New Components: -1. **Always** import from `@/shared/antd-imports` -2. Use `appMessage` and `appNotification` for user feedback -3. Apply `antdConfig` for consistent styling -4. Use `taskManagementAntdConfig` for task-related components - -### When Refactoring Existing Code: -1. Replace direct 'antd' imports with `@/shared/antd-imports` -2. Replace direct '@ant-design/icons' imports with `@/shared/antd-imports` -3. Update any custom message/notification calls to use the utilities - -### File Location -The centralized import file is located at: `worklenz-frontend/src/shared/antd-imports.ts` - -## Examples - -### Component Creation -```typescript -import React from 'react'; -import { Button, Input, Modal, EditOutlined, appMessage } from '@antd-imports'; - -const MyComponent = () => { - const handleClick = () => { - appMessage.success('Operation completed!'); - }; - - return ( - - ); -}; -``` - -### Form Implementation -```typescript -import { Form, Input, Select, Button, DatePicker } from '@antd-imports'; - -const MyForm = () => { - return ( -
- - - - - - - -