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/copilot-instructions.md
+136-2Lines changed: 136 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,72 @@
2
2
applyTo: "**/*.{ts,tsx}"
3
3
---
4
4
5
-
# Evolu project guidelines
5
+
# Evolu Plan B - Copilot Instructions
6
+
7
+
## Project Overview
8
+
9
+
Evolu Plan B is a TypeScript-based local-first platform forked from [evoluhq/evolu](https://github.com/evoluhq/evolu). This monorepo uses **Bun** as the package manager and runtime, and **Biome** for linting and formatting.
10
+
11
+
**Key characteristics:**
12
+
- Local-first architecture with CRDT-based synchronization
13
+
- TypeScript strict mode throughout
14
+
- Functional programming patterns with explicit dependency injection
15
+
- Multi-platform support (Web, React Native, Node.js, Svelte, Vue)
16
+
17
+
**Tech Stack:**
18
+
- Package Manager: Bun 1.3.8
19
+
- Linter/Formatter: Biome 2.3.13
20
+
- Test Framework: Vitest
21
+
- Build System: Turbo (monorepo)
22
+
- Target: Node.js >=24.0.0
23
+
24
+
**Directory Structure:**
25
+
```
26
+
packages/
27
+
├── common/ # Core logic, CRDTs, sync engine
28
+
├── web/ # Browser adapter (wa-sqlite)
29
+
├── react/ # React bindings
30
+
├── react-native/ # React Native adapter
31
+
├── nodejs/ # Node.js adapter
32
+
├── svelte/ # Svelte bindings
33
+
└── vue/ # Vue bindings
34
+
apps/
35
+
├── relay/ # Sync relay server
36
+
└── web/ # Documentation site (deprecated)
37
+
```
38
+
39
+
## Repository-Specific Guidelines
40
+
41
+
### Package Management
42
+
-**MUST** use Bun commands: `bun install`, `bun run`, etc.
43
+
-**MUST NOT** use npm, pnpm, or yarn
44
+
-**MUST** run `bun run verify` before submitting changes (includes format, build, test, lint)
45
+
46
+
### Linting and Formatting
47
+
-**MUST** use Biome for all linting and formatting
48
+
-**MUST NOT** add ESLint or Prettier configurations
49
+
-**MUST** follow the rules defined in `biome.json`
50
+
- Use `bun run lint` to check, `bun run format` to auto-fix
51
+
52
+
### Testing
53
+
-**MUST** write tests using Vitest
54
+
-**MUST** create isolated test dependencies using `testCreateDeps()` from `@evolu/common`
55
+
-**SHOULD** run targeted tests during development: `bun run test:watch`
56
+
57
+
### Security Requirements
58
+
-**MUST NOT** commit secrets, tokens, or credentials
59
+
-**MUST** validate all external inputs using the Evolu Type system
60
+
-**MUST** handle errors explicitly with `Result<T, E>` pattern
61
+
-**MUST** use `trySync`/`tryAsync` for unsafe operations
62
+
-**SHOULD** use CodeQL scanning for vulnerability detection
63
+
-**MUST** document security implications in code reviews
64
+
65
+
### Upstream Sync
66
+
- This is a fork; upstream commits are cherry-picked
67
+
-**MUST** reference upstream issues as `upstream#XXX`
68
+
-**SHOULD** maintain compatibility with upstream API surface
bun run test --filter @evolu/common -- -t "yields and returns ok"
612
+
```
613
+
536
614
## Monorepo TypeScript issues
537
615
538
-
**ESLint "Unsafe..." errors after changes** - In a monorepo, ESLint may show "Unsafe call", "Unsafe member access", or "Unsafe assignment" errors after modifying packages that other packages depend on. These errors are caused by stale TypeScript type cache. Solution: run "ESLint: Restart ESLint Server" command (Cmd+Shift+P)
616
+
**TypeScript "Unsafe..." errors after changes** - In a monorepo, you may see "Unsafe call", "Unsafe member access", or "Unsafe assignment" errors after modifying packages that other packages depend on. These are TypeScript language server errors, not Biome linting errors. They should be investigated but may be false positives. Solution: use VS Code's "Developer: Reload Window" command (Cmd+Shift+P) to refresh the TypeScript language server.
539
617
540
618
## Git commit messages
541
619
@@ -557,4 +635,60 @@ Added support for custom error formatters
557
635
Add support for custom error formatters
558
636
```
559
637
638
+
## Workflow Commands
639
+
640
+
### Development
641
+
```bash
642
+
bun install # Install dependencies
643
+
bun run dev # Start dev mode (packages + web + relay)
644
+
bun run build # Build all packages
645
+
```
646
+
647
+
### Quality Checks
648
+
```bash
649
+
bun run lint # Lint with Biome
650
+
bun run format # Format with Biome
651
+
bun run test# Run tests
652
+
bun run test:coverage # Tests with coverage
653
+
bun run verify # Full verification (format + build + test + lint)
654
+
```
655
+
656
+
### Release
657
+
```bash
658
+
bun run changeset # Add changeset for release
659
+
bun run version # Bump versions
660
+
bun run release # Publish packages
661
+
```
662
+
663
+
## Deprecated Patterns
664
+
665
+
**DO NOT use these patterns:**
666
+
- ❌ Default exports (use named exports only)
667
+
- ❌ Namespace imports (`import * as Foo`)
668
+
- ❌ `function` keyword (except for overloads)
669
+
- ❌ Class components in React (use functional components)
670
+
- ❌ `any` type (use proper typing or `unknown`)
671
+
- ❌ Global static instances (use dependency injection)
0 commit comments