- All dependency versions are managed in the default pnpm catalog.
- To add a new dependency, run
pnpm add --filter "<project>" --save-catalog "<package>".
- Project uses
moonto run tasks, tests, lint etc. (moon run package-name:task-name). - Build all:
moon :build --quiet --no-bail. - Build package:
moon run package-name:build. - Run single test file:
moon run package-name:test -- path/to/test.test.ts. - Run all tests:
MOON_CONCURRENCY=4 moon run :test -- --no-file-parallelism. - Lint & fix:
moon run :lint -- --fix. - Check package tasks: see
moon.ymlin package directory.
- Do NOT cast values to fix build issues; instead create a refactoring plan and get permission.
- Use TypeScript with single quotes for strings.
- Prefer functional programming and arrow functions.
- Use inline type imports:
import { type Foo } from 'bar'. - Format: max line 120 chars, trailing commas, JSX single quotes.
- Import order: builtin → external → @dxos → internal → parent → sibling (with blank lines between groups).
- Error handling: use Effect-TS patterns.
- Testing: place tests near modules as
module.test.ts, use vitest withdescribe/test(notit), prefertest('foo', ({ expect }) => ...). - JSDoc comments for public functions, all comments end with period.
- React: arrow function components, TailwindCSS for styles, proper event handler types.
- Remember to remove/update TODOs as you go.
IMPORTANT: Run this after every review & change cycle before submitting a PR:
pnpm -w pre-ci- Never work on main, create a new git worktree for the branch you are working on.
- Check
moon.ymlfor available package tasks - Run linter at natural stopping points
- Confirm work complete before final build/lint check
IMPORTANT: All PR titles MUST use conventional commit format:
feat: <description>- New features or functionalityfix: <description>- Bug fixesrefactor: <description>- Code refactoring without behavior changesdocs: <description>- Documentation changestest: <description>- Adding or updating testschore: <description>- Maintenance tasks, dependency updatesperf: <description>- Performance improvementsstyle: <description>- Code style/formatting changesci: <description>- CI/CD configuration changesbuild: <description>- Build system changes
Use scope when relevant: feat(package-name): <description>
Examples:
feat: add user authentication flowfix(echo): resolve memory leak in subscription handlerrefactor: simplify error handling in client SDKdocs: update API reference for Space class
- Use
ghCLI to create and manage PRs - After you have completed your work, run
pnpm -w pre-cito run a series of code-quality checks. - At the end you can monitor the CI status with
pnpm -w gh-action --verify --watch - When the user asks you to submit a PR, make sure that:
pnpm -w pre-cipassespnpm -w gh-action --verify --watchshows green CI- The PR description is up-to-date and has a description of the changes and reasoning behind them.
- Reference linear issues if available in PR description as "closes DX-123" or "part of DX-123"
- Repeat the process if you made any new code changes