Skip to content

Contributing

  • Node.js >= 20.0.0
  • pnpm >= 9.0.0 — npm install -g pnpm
  • Go >= 1.24.5 (for gateway development only)
Terminal window
git clone https://github.com/ruachtech/rep.git
cd rep
pnpm install
pnpm run build
pnpm run test

For gateway:

Terminal window
cd gateway
go test -race ./...
rep/
├── spec/ # Protocol specification documents
├── schema/ # JSON schemas for payload and manifest
├── gateway/ # Go reference implementation (stdlib only)
├── sdk/ # @rep-protocol/sdk (zero runtime deps)
├── cli/ # @rep-protocol/cli
├── adapters/ # React, Vue, Svelte adapters
├── codemod/ # Migration tool
├── docs/ # This documentation site (Astro/Starlight)
└── examples/ # Example applications

This project uses Conventional Commits. Every commit to main must follow this format:

<type>(<scope>): <description>
[optional body]
TypeEffectExample
fixPatch releasefix(sdk): handle missing meta field
featMinor releasefeat(gateway): add poll mode for hot reload
feat!Major releasefeat!(sdk)!: rename getSecure to decrypt
docsNo releasedocs(spec): clarify SRI verification
choreNo releasechore: update dev dependencies
refactorNo releaserefactor(gateway): extract inject middleware
testNo releasetest(sdk): add hot reload tests
perfNo releaseperf(gateway): reduce allocation in inject

sdk, gateway, cli, react, vue, svelte, codemod, spec, docs

  • Standard library only. No third-party dependencies.
  • Structured logging via log/slog
  • Error wrapping: fmt.Errorf("context: %w", err)
  • No init() functions
  • Tests use stdlib only (testing, net/http/httptest)
  • Use t.Setenv() for env var tests (never os.Setenv directly)
  • Run with -race flag
  • Zero runtime dependencies for the SDK
  • Vitest + jsdom for testing
  • vi.resetModules() before each SDK test (because _init() runs on module load)
  • DOM cleanup in beforeEach
Terminal window
# All TypeScript packages
pnpm run test
# Gateway (from gateway/)
go test -race ./...
# Specific package
pnpm --filter @rep-protocol/sdk run test

Releases are automated via release-please:

  1. Push conventional commits to main
  2. Release-please creates/updates a Release PR with version bumps and changelogs
  3. Merging the Release PR triggers npm publishing for all packages
  4. The gateway is versioned independently via gateway/VERSION and released through GoReleaser
  • Branch from main
  • Keep PRs focused on a single change
  • Include tests for new functionality
  • Use squash-merge with a conventional commit message