Tooling
The developer toolchain - pnpm, Nx, vite-plus, and the testing conventions that keep the monorepo predictable.
The repository is a pnpm workspace orchestrated by Nx, with vite-plus (vp) as the developer-experience toolchain for linting, testing, formatting, and typechecking. This section documents how it fits together.
Nx and pnpm
Workspaces, the dependency catalog, tasks, and caching.
vite-plus
The vp commands that run quality gates.
Testing
Effect-aware tests, PGlite, and the strongest-invariant rule.
Africa OS deliberately keeps its toolchain small: pnpm for packages, Nx for task orchestration, and vite-plus for the quality gates.
- pnpm owns the dependency graph: workspaces, the catalog, and the lockfile. It is the package manager for the entire repository. The pinned version is
pnpm@11.20.0(enforced bypackageManagerin the rootpackage.json). - Nx owns running tasks across the workspace: it understands the dependency graph, caches results, and runs only what changed. Root scripts like
pnpm devdelegate to Nx. - vite-plus (aliased as
vp) owns the per-package quality gates: linting, tests, typechecking, and formatting. Every package’slint,test, andtypecheckscripts callvp. - tsx runs the infrastructure scripts under
infra/database/scripts(exposed aspnpm db:*).
The rule of thumb
Use vp (or the pnpm scripts that wrap it) for installs, builds, tests, linting, and typechecking - not raw tool binaries. Keep shared tool versions in the catalog so every package stays on the same toolchain.
Quality expectations
The project’s standards live in .patterns/ at the repository root - read docs.md and testing.md before writing or changing docs and tests. The two hard rules that touch the toolchain:
- Always use
pnpm- nevernpmor bareyarn. - Always use
vpfor installs, builds, and test/lint/typecheck runs rather than calling the underlying binaries directly.
Database scripts
Database chores are plain tsx scripts under infra/database/scripts, exposed as root pnpm db:* commands. See Migrations for how they work.
| Command | Script |
|---|---|
pnpm db:migrate |
infra/database/scripts/migrate.ts |
pnpm db:seed / db:seed:production |
infra/database/scripts/seed.ts |
pnpm db:register-apps |
infra/database/scripts/register-apps.ts |
pnpm db:seed:admin |
infra/database/scripts/seed-admin.ts |
pnpm db:verify:org |
infra/database/scripts/verify-org.ts |