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: .github/instructions/general.instructions.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,24 @@ applyTo: "**"
19
19
- Always create TypeScript files, not JavaScript files.
20
20
- Prefer destructured imports over namespace imports when importing specific functions from modules (e.g., `import { resolve } from 'path'` instead of `import * as path from 'path'`).
21
21
22
+
# Code Organization and Directory Structure
23
+
24
+
## src/lib Directory Restrictions
25
+
-**The src/lib directory is for server-side build code ONLY**
26
+
- NO client-side code can go in src/lib (it gets bundled into server-side builds)
27
+
- Client-side utilities should go in src/components/scripts/ or appropriate component directories
28
+
29
+
## API Code Organization
30
+
-**API endpoints** go in `src/pages/api/`
31
+
-**Code files related to API endpoints** go in `src/pages/api/` and are prefixed with `_` (e.g., `_utils/`, `_contracts/`)
32
+
-**API utility files** go specifically in the `_utils/` folder
33
+
-**API contract/type files** go in `_contracts/` folder for centralized type definitions
34
+
35
+
## Mixed Concern Files
36
+
- Files that straddle server-side API and client-side concerns (like API client wrappers) require clarification
37
+
-**Ask before placing such files** - they may need special handling or alternative organization
38
+
- Example: gdpr.client.ts (API client wrapper) - unclear placement due to mixed server/client concerns
39
+
22
40
# Astro View Transitions Navigation
23
41
24
42
Components may have behavior dependent on Astro View Transitions navigation events. Choose the appropriate navigation method:
0 commit comments