|
| 1 | +--- |
| 2 | +alwaysApply: true |
| 3 | +--- |
| 4 | + |
| 5 | +# Monorepo Cursor Rules |
| 6 | + |
| 7 | +## Package Structure |
| 8 | +- `apps/` - Applications (todo-app) |
| 9 | +- `packages/` - Shared packages (ui, utils) |
| 10 | +- Each package has its own package.json with proper exports |
| 11 | + |
| 12 | +## Workspace Dependencies |
| 13 | +- Use `workspace:*` for internal package dependencies |
| 14 | +- Keep external dependencies in sync across packages |
| 15 | +- Use peerDependencies for shared libraries like React |
| 16 | + |
| 17 | +## Import Patterns |
| 18 | +```tsx |
| 19 | +// Import from workspace packages |
| 20 | +import { Button } from '@todo-starter/ui'; |
| 21 | +import { cn, type Todo } from '@todo-starter/utils'; |
| 22 | + |
| 23 | +// Import from local files |
| 24 | +import { TodoItem } from '~/components/todo-item'; |
| 25 | +import type { Route } from './+types/home'; |
| 26 | +``` |
| 27 | + |
| 28 | +## Package Naming |
| 29 | +- Use scoped packages: `@todo-starter/package-name` |
| 30 | +- Keep names descriptive and consistent |
| 31 | +- Use kebab-case for package names |
| 32 | + |
| 33 | +## Scripts and Tasks |
| 34 | +- Define scripts at both root and package level |
| 35 | +- Use Turbo for orchestrating build tasks |
| 36 | +- Prefer package-specific scripts for development |
| 37 | + |
| 38 | +## TypeScript Configuration |
| 39 | +- Use Tailwind CSS v4's CSS-first configuration with `@theme` directive |
| 40 | +- Use path mapping for workspace packages |
| 41 | +- Keep tsconfig.json files minimal and focused |
| 42 | + |
| 43 | +## Best Practices |
| 44 | +- Keep packages focused and single-purpose |
| 45 | +- Avoid circular dependencies between packages |
| 46 | +- Use proper exports in package.json |
| 47 | +- Document package APIs and usage patterns |
| 48 | +# Monorepo Cursor Rules |
| 49 | + |
| 50 | +## Package Structure |
| 51 | +- `apps/` - Applications (todo-app) |
| 52 | +- `packages/` - Shared packages (ui, utils) |
| 53 | +- Each package has its own package.json with proper exports |
| 54 | + |
| 55 | +## Workspace Dependencies |
| 56 | +- Use `workspace:*` for internal package dependencies |
| 57 | +- Keep external dependencies in sync across packages |
| 58 | +- Use peerDependencies for shared libraries like React |
| 59 | + |
| 60 | +## Import Patterns |
| 61 | +```tsx |
| 62 | +// Import from workspace packages |
| 63 | +import { Button } from '@todo-starter/ui'; |
| 64 | +import { cn, type Todo } from '@todo-starter/utils'; |
| 65 | + |
| 66 | +// Import from local files |
| 67 | +import { TodoItem } from '~/components/todo-item'; |
| 68 | +import type { Route } from './+types/home'; |
| 69 | +``` |
| 70 | + |
| 71 | +## Package Naming |
| 72 | +- Use scoped packages: `@todo-starter/package-name` |
| 73 | +- Keep names descriptive and consistent |
| 74 | +- Use kebab-case for package names |
| 75 | + |
| 76 | +## Scripts and Tasks |
| 77 | +- Define scripts at both root and package level |
| 78 | +- Use Turbo for orchestrating build tasks |
| 79 | +- Prefer package-specific scripts for development |
| 80 | + |
| 81 | +## TypeScript Configuration |
| 82 | +- Use Tailwind CSS v4's CSS-first configuration with `@theme` directive |
| 83 | +- Use path mapping for workspace packages |
| 84 | +- Keep tsconfig.json files minimal and focused |
| 85 | + |
| 86 | +## Best Practices |
| 87 | +- Keep packages focused and single-purpose |
| 88 | +- Avoid circular dependencies between packages |
| 89 | +- Use proper exports in package.json |
| 90 | +- Document package APIs and usage patterns |
0 commit comments