Reference
Contributing
Set up the monorepo from source, run tests, and contribute to OXP.
OXP is open source and contributions are welcome. This guide covers setting up the monorepo, understanding the codebase, and submitting changes.
Prerequisites
| Tool | Version | Purpose |
|---|---|---|
| Node.js | ≥ 22 | Runtime |
| pnpm | ≥ 10 | Package manager (monorepo workspaces) |
| Docker | Any | Local Postgres + MinIO |
| Rust | stable | For hello-rust example and component testing |
| Git | Any | Version control |
Clone and Setup
bash
git clone https://github.com/oxp-dev/oxp.git
cd oxp
pnpm installBuild Everything
bash
pnpm buildThis builds all packages in dependency order:
@oxprotocol/types→ 2.@oxprotocol/schema→ 3.@oxprotocol/wit→ 4.@oxprotocol/ui→ 5.@oxprotocol/sdk→ 6.@oxprotocol/bundle→ 7.@oxprotocol/host-runtime→ 8.@oxprotocol/host-core→ 9.@oxprotocol/cli→ 10.@oxprotocol/web
Local Development
Start Infrastructure
bash
docker compose up -dThis starts:
- Postgres on port 5432 (user:
oxp, password:oxp, db:oxp) - MinIO on port 9000 (console on 9001, user:
minioadmin, password:minioadmin)
Data persists in .docker/ (gitignored). Wipe with docker compose down -v.
Database Setup
bash
cp apps/web/.env.example apps/web/.env.local
pnpm --filter @oxprotocol/web db:pushStart the Registry
bash
pnpm devOpens the registry at http://localhost:3000.
Running Tests
bash
pnpm test # all packages
pnpm -r --filter <pkg> test # specific packageKey test suites:
| Package | Tests | What They Cover |
|---|---|---|
@oxprotocol/bundle | security.test.ts, wit-pin.test.ts | Bundle policy, WIT pinning |
@oxprotocol/host-core | tofu-pinning.test.ts, permission-prompt.test.ts, activator.test.ts | TOFU, permissions, e2e activation |
@oxprotocol/host-runtime | broker.test.ts | Capability broker, permission denial |
@oxprotocol/types | token-scopes.test.ts | Scoped token validation |
@oxprotocol/wit | canonical.test.ts | WIT canonical form + sha256 |
Project Structure
| Directory | Purpose |
|---|---|
spec/v1/ | Normative specification (schema, protocol, bundle format) |
packages/ | npm packages published under @oxprotocol |
hosts/ | IDE host adapters (VS Code, Piye) |
apps/web/ | Registry website + API (Next.js) |
examples/ | Example extensions and test fixtures |
Key Scripts
| Script | Description |
|---|---|
pnpm build | Build all packages |
pnpm dev | Start the registry dev server |
pnpm test | Run all tests |
pnpm lint | Lint all packages |
pnpm clean | Remove all build artifacts |
pnpm release:dry | Dry-run publish to npm |
TypeScript Configuration
The monorepo uses a shared tsconfig.base.json:
- Target: ES2022
- Module: ESNext with Bundler resolution
- Strict mode enabled
- Declaration maps for debugging
Each package extends the base config and adds its own outDir, rootDir, and references.
Code Style
- TypeScript for all packages
- ESM (
"type": "module") everywhere - No external CLI libraries in the CLI package (keep install lean)
- Vitest for testing
- Explicit
noUncheckedIndexedAccessfor safety
Pull Request Guidelines
- One concern per PR — keep changes focused
- Tests required — add or update tests for behavioral changes
- Security review line — if your change touches security controls, confirm it doesn't regress Phase A/B/C
- Build must pass —
pnpm build && pnpm testmust succeed - Update roadmaps — if your PR completes a roadmap item, tick it off