You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: template/app/.cursor/rules/project-conventions.mdc
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ This document outlines the specific conventions, file structures, and general ru
13
13
14
14
- Define app structure in the Wasp config file: [main.wasp](mdc:main.wasp) or `main.wasp.ts`.
15
15
- Define data models ("entities") in [schema.prisma](mdc:schema.prisma).
16
-
- Group feature code in `src/features/{featureName}` directories.
16
+
- Group feature code in `src/{featureName}` directories.
17
17
- Group feature config definitions (e.g. routes, pages, operations, etc.) into sections within the Wasp config file ([main.wasp](mdc:main.wasp)) using the `//#region` directive:
18
18
```wasp
19
19
// Example in @main.wasp
@@ -31,11 +31,11 @@ This document outlines the specific conventions, file structures, and general ru
31
31
- ✅ `import type { GetTasks } from 'wasp/server/operations'`
32
32
- ✅ `import { getTasks, useQuery } from 'wasp/client/operations'`
33
33
- ❌ `import { ... } from '@wasp/...'`
34
-
- ❌ `import { ... } from '@src/features/...'` (Use relative paths for non-Wasp imports within `src`)
34
+
- ❌ `import { ... } from '@src/featureName/...'` (Use relative paths for non-Wasp imports within `src`)
35
35
- If you see "Cannot find module 'wasp/...'": Double-check the import path prefix.
36
36
- **Wasp Config Imports in [main.wasp](mdc:main.wasp) :** Imports of your code *must* start with `@src/`.
37
-
- ✅ `component: import { LoginPage } from "@src/features/auth/LoginPage.tsx"`
38
-
- ❌ `component: import { LoginPage } from "../src/features/auth/LoginPage.tsx"`
37
+
- ✅ `component: import { LoginPage } from "@src/auth/LoginPage.tsx"`
38
+
- ❌ `component: import { LoginPage } from "../src/auth/LoginPage.tsx"`
39
39
- ❌ `component: import { LoginPage } from "client/pages/auth/LoginPage.tsx"`
40
40
- **General Imports in `.ts`/`.tsx`:** Use relative paths for imports within the `src/` directory. Avoid using the `@src/` alias directly in `.ts`/`.tsx` files.
41
41
- If you see "Cannot find module '@src/...'": Use a relative path instead.
@@ -70,9 +70,9 @@ This document outlines the specific conventions, file structures, and general ru
70
70
71
71
- Always reference the Wasp config file ([main.wasp](mdc:main.wasp) or `main.wasp.ts`) as your source of truth for the app's configuration and structure.
72
72
- Group feature config definitions in the Wasp config file using `//#region` (as noted above).
73
-
- Group feature code into feature directories (e.g. `src/features/transactions`).
73
+
- Group feature code into feature directories (e.g. `src/transactions`).
74
74
- Use the latest Wasp version, as defined in the Wasp configl file.
75
-
- Combine Wasp operations (queries and actions) into an `operations.ts` file within the feature directory (e.g., `src/features/transactions/operations.ts`).
75
+
- Combine Wasp operations (queries and actions) into an `operations.ts` file within the feature directory (e.g., `src/transactions/operations.ts`).
76
76
- Always use TypeScript for Wasp code (`.ts`/`.tsx`).
0 commit comments