Skip to content

Commit 66730ef

Browse files
committed
Update copilot-instructions.md
1 parent f886ac7 commit 66730ef

1 file changed

Lines changed: 16 additions & 11 deletions

File tree

.github/copilot-instructions.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
## Repository Overview
44

5-
**Sveltia CMS** is a modern, Git-based headless content management system built as a drop-in replacement for Netlify/Decap CMS. The project is written in Svelte 5 with JavaScript, using Vite as the build tool and Vitest 4 for testing.
5+
**Sveltia CMS** is a modern, Git-based headless content management system built as a drop-in replacement for Netlify/Decap CMS. The project is written in Svelte 5 with JavaScript, using Vite 7 as the build tool and Vitest 4 for testing.
66

77
**Key Details:**
88

9-
- **Size**: ~800 source files, 170+ test files, 2748+ tests
9+
- **Size**: ~800 source files, 170+ test files, 4200+ tests
1010
- **Languages**: TypeScript-flavoured JavaScript (ES2024/JSDoc), Svelte 5, SCSS/CSS, HTML
1111
- **Target Runtime**: Browser (IIFE and ES modules)
1212
- **Package Manager**: **pnpm only** (npm will cause issues)
@@ -17,7 +17,7 @@
1717

1818
### Prerequisites
1919

20-
**CRITICAL**: Always use `pnpm` - npm will not work correctly with this project.
20+
**CRITICAL**: Always use `pnpm` - `npm` will not work correctly with this project.
2121

2222
```bash
2323
# Install pnpm if not available
@@ -60,8 +60,8 @@ pnpm check:imports # Unused import detection
6060
pnpm check:audit # Security audit
6161

6262
# Testing
63-
vitest run test # Run all tests
64-
vitest run test:coverage # Test coverage report
63+
pnpm exec vitest run test # Run all tests
64+
pnpm exec vitest run test:coverage # Test coverage report
6565

6666
# Code formatting
6767
pnpm format # Auto-fix Prettier formatting
@@ -71,7 +71,7 @@ pnpm format # Auto-fix Prettier formatting
7171

7272
- `pnpm install`: ~25-30 seconds
7373
- `pnpm check`: ~30-45 seconds
74-
- `pnpm test`: ~30 seconds (2748 tests)
74+
- `pnpm exec vitest run`: ~35 seconds (4200+ tests)
7575
- `pnpm build`: ~15-20 seconds
7676

7777
### Common Issues & Solutions
@@ -138,9 +138,9 @@ src/lib/
138138

139139
**Validation Steps for PRs:**
140140

141-
1. All ESLint rules pass (strict Airbnb config + Svelte rules)
141+
1. All ESLint rules pass (strict Airbnb config + Svelte rules + some customizations)
142142
2. Prettier formatting enforced
143-
3. All 2748+ tests pass
143+
3. All 4200+ tests pass
144144
4. Svelte compiler checks pass
145145
5. Production build succeeds
146146
6. No unused imports (custom script validation)
@@ -167,7 +167,7 @@ src/lib/
167167
- **Framework**: Vitest 4 with coverage reporting
168168
- **Location**: Co-located `*.test.js` files
169169
- **Coverage**: Focuses on `src/lib/{components,services}/**/*.js`
170-
- **Standards**: 2748+ tests must continue passing
170+
- **Standards**: 4200+ tests must continue passing
171171

172172
### File Patterns
173173

@@ -184,21 +184,26 @@ import { get } from 'svelte/store';
184184
// Internal with $lib alias
185185
import { siteConfig } from '$lib/services/config';
186186
import Button from '$lib/components/common/button.svelte';
187+
188+
/**
189+
* @import { SiteConfig } from '$lib/types/public';
190+
*/
187191
```
188192

189193
### Making Changes
190194

191195
1. **Always run `pnpm install` first**
192196
2. **Use `pnpm check` before committing** - fixes many issues automatically
193-
3. **Run tests frequently**: `pnpm test` or `pnpm test:watch`
197+
3. **Run tests frequently**: `pnpm exec vitest run`
194198
4. **Follow existing patterns** - this codebase has consistent conventions
195199
5. **Test in browser**: Use `pnpm dev` to verify UI changes work correctly
196200

197201
### Special Notes
198202

199-
- **Svelte 5**: Uses new runes syntax - avoid legacy Svelte patterns
203+
- **Svelte 5**: Uses new runes syntax - avoid legacy Svelte patterns; use the [MCP server](https://mcp.svelte.dev/mcp) if needed
200204
- **Bundle size**: Watch for large dependencies - final bundle should stay under 1.5MB
201205
- **Browser support**: Targets modern browsers (ES2024)
202206
- **CMS Domain**: Understanding of headless CMS concepts helpful for meaningful contributions
207+
- **Test coverage**: Use `sed` to find uncovered lines in reports
203208

204209
**Trust these instructions** - they are validated against the current codebase. Only search for additional information if these instructions are incomplete or incorrect.

0 commit comments

Comments
 (0)