Skip to content

Commit 17b18e3

Browse files
KJ7LNWEric Wheeler
andauthored
docs: add monorepo management rules (#4296)
Co-authored-by: Eric Wheeler <[email protected]>
1 parent 314ccca commit 17b18e3

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.roo/rules/monorepo.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Monorepo (pnpm)
2+
3+
- Work primarily in:
4+
• src/
5+
• webview-ui/package
6+
• packages/types (shared DTOs)
7+
- Other workspaces (modify only if instructed):
8+
• evals/
9+
• packages/_/
10+
• apps/_/
11+
[others]
12+
- To install deps:
13+
→ run `pnpm add <package>` in `<cwd>workspace/directory</cwd>` (updates `<workspace>/package.json`)
14+
- ⚠️ DO NOT run pnpm in root (root only holds CLI dev-tools in devDependencies, e.g. prettier)
15+
16+
# Turborepo
17+
18+
- ❌ Don’t modify `turbo` config without instruction
19+
- ✅ You may propose config changes when:
20+
1. Adding a shared, cacheable npm task
21+
2. Declaring an internal-package dependency that affects the extension build
22+
23+
# Running tests
24+
25+
- Always execute commands using `<cwd>workspace/directory</cwd>` when running any test command
26+
- To fix failures:
27+
1. Target one failing test:
28+
`npx vitest relative/path/__tests__/name.spec.ts -t "substring"`
29+
2. Verify all tests in that module pass:
30+
`npx vitest relative/path/__tests__/name.spec.ts`
31+
- File conventions:
32+
`.spec.ts` → vitest
33+
`.test.ts` → jest (deprecated)
34+
- If a test in `.test.ts` fails:
35+
→ delete it & recreate in `.spec.ts`
36+
- Keep passing tests in `.test.ts`
37+
- Use `npx jest <file> -t "substring"` for deprecated test execution using the same strategy above
38+
- Run all tests in the root workspace:
39+
`pnpm test`
40+
41+
# Creating tests
42+
43+
- Use vitest (native ESM, jest-compatible)
44+
- Steps:
45+
1. Create `path/to/__tests__/name.spec.ts` (must be `.spec.ts`)
46+
2. Omit ESM mocks unless necessary
47+
3. Run via vitest
48+
- For modules with existing `.test.ts`:
49+
1. Move any failing tests → `name.spec.ts`
50+
2. Add new tests → `name.spec.ts`
51+
3. Leave successful tests in `.test.ts`

0 commit comments

Comments
 (0)