Thank you for your interest in contributing to the Runtime Environment Protocol. This guide covers everything you need to get started.
- Node.js >= 20.0.0
- pnpm >= 9.0.0 —
npm install -g pnpm - Go >= 1.24.5 (only needed for gateway development)
git clone https://github.com/ruachtech/rep.git
cd rep
# Install all TypeScript workspace dependencies
pnpm install
# Build all packages
pnpm run build
# Run all TypeScript tests
pnpm run test
# Run Go gateway tests
cd gateway && go test -race ./...rep/
├── spec/ # Protocol specification documents
├── schema/ # JSON schemas for payload and manifest
├── gateway/ # Go reference implementation (stdlib only, zero deps)
├── sdk/ # @rep-protocol/sdk — core TypeScript client (zero runtime deps)
├── cli/ # @rep-protocol/cli — validation, typegen, dev server
├── adapters/ # Framework adapters (React, Vue, Svelte)
├── codemod/ # @rep-protocol/codemod — migration tool
└── examples/ # Example applications
All TypeScript packages are managed as a pnpm workspace. The Go gateway is independent and has its own build system via Makefile.
# Work on a specific package
pnpm --filter @rep-protocol/sdk run dev # Watch mode
pnpm --filter @rep-protocol/sdk run test # Run tests
pnpm --filter @rep-protocol/sdk run build # Build
# Or use the root shortcuts
pnpm run dev:sdk
pnpm run dev:cli
# Run everything
pnpm run build # Build all packages
pnpm run test # Test all packagescd gateway
make build # Build for current platform → bin/rep-gateway
make test # Run all tests with race detector
make run-example # Run locally with example env vars
make docker # Build Docker imageThis project uses conventional commits to automate versioning and changelog generation. Every commit to main must follow this format:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
| Type | Semver Effect | When to Use |
|---|---|---|
fix |
Patch | Bug fixes |
feat |
Minor | New features |
feat! |
Major | Breaking changes (also via BREAKING CHANGE: footer) |
docs |
— | Documentation only |
chore |
— | Maintenance, deps, CI |
refactor |
— | Code changes that don't fix bugs or add features |
test |
— | Adding or updating tests |
perf |
Patch | Performance improvements |
Use a scope to indicate which part of the project is affected:
feat(sdk): add batch API— SDK changefix(gateway): handle chunked encoding— Gateway changefeat(react): add useRepSecure hook— React adapter changedocs(spec): clarify session key TTL— Spec change
# Bug fix → 0.1.0 → 0.1.1
git commit -m "fix(sdk): handle missing payload gracefully"
# New feature → 0.1.0 → 0.2.0
git commit -m "feat(cli): add rep validate command"
# Breaking change → 0.1.0 → 1.0.0
git commit -m "feat(sdk)!: rename getSecure to getSensitive
BREAKING CHANGE: getSecure() has been renamed to getSensitive() to align with spec terminology."
# Non-release commits (no version bump)
git commit -m "docs: update integration guide examples"
git commit -m "test(gateway): add chunked encoding test"
git commit -m "chore: update CI node version"Note: While the project is pre-1.0,
bump-minor-pre-majorandbump-patch-for-minor-pre-majorare enabled. This means breaking changes bump minor (not major) and features bump patch (not minor), keeping iteration safe.
All npm packages share a single version number and are released together using release-please.
- Push conventional commits to
main(directly or via merged PRs) - release-please automatically creates or updates a Release PR with:
- Bumped
versionin allpackage.jsonfiles - Updated
CHANGELOG.mdentries
- Bumped
- Review and merge the Release PR
- On merge, GitHub Actions automatically:
- Creates a GitHub Release with the new tag
- Publishes all packages to npm with provenance attestations
- Never manually edit
versioninpackage.json— release-please handles this - Never manually create git tags for npm packages
- Never run
npm publishlocally
The Go gateway is versioned independently via gateway/version.txt and released through GoReleaser when a gateway/v* tag is pushed.
- Branch from
main— use descriptive branch names likefeat/cli-validateorfix/sdk-payload-parsing - Keep PRs focused — one logical change per PR
- Write tests for new functionality or bug fixes
- Ensure all tests pass before requesting review:
pnpm run test # TypeScript cd gateway && go test -race ./... # Go
- Use conventional commit messages — the PR title should also follow the convention since we squash-merge
- Standard library only. No third-party dependencies.
- Structured logging via
log/slogwith specific event names (e.g.,rep.guardrail.warning) - Error wrapping with
fmt.Errorf("context: %w", err) - No
init()functions except where strictly necessary - Run with
-raceflag:go test -race ./...
- Zero runtime dependencies for the SDK package
- Vitest + jsdom for testing
- SDK tests must use
vi.resetModules()+ dynamicimport('../index')because_init()runs on module load - Use
t.Setenv()(Go) orbeforeEachDOM cleanup (TS) for test isolation
cd gateway
go test -race ./... # All tests with race detector
go test -race -count=1 ./... # Bypass test cache
go test -race ./internal/inject/ # Single packagepnpm run test # All packages
pnpm --filter @rep-protocol/sdk run test # SDK only
pnpm --filter @rep-protocol/cli run test # CLI only- Specification documents (
spec/) are licensed under CC BY 4.0 - All code is licensed under Apache 2.0
By contributing, you agree that your contributions will be licensed under the same terms.