Development Setup
Audience: contributors.
Prerequisites
Section titled “Prerequisites”- Node.js
20locally (18and20are validated in CI) pnpmgit
Clone and Install
Section titled “Clone and Install”git clone https://github.com/erayates/roomful.gitcd roomfulpnpm installExpected Workspace Commands
Section titled “Expected Workspace Commands”pnpm buildpnpm testpnpm test:typespnpm test:watchpnpm lintpnpm format:checkpnpm format:writepnpm typecheckpnpm typecheck:rootpnpm typecheck:allpnpm verify:package-typespnpm smoke:publishpnpm changesetpnpm version-packagespnpm release:statusAdditional integration workflow:
pnpm test:integrationInstall the Playwright browsers before running the browser suite locally:
pnpm exec playwright install chromium firefox webkitpnpm test:integration runs the real multi-tab browser transport suite for Chromium, Firefox,
and Playwright WebKit. WebKit is used as the Safari-equivalent coverage target in CI. The WebRTC
scenario is skipped automatically when the underlying WebKit runtime does not expose
RTCPeerConnection.
Run the self-hostable @roomful/relay signaling server locally for WebRTC validation:
pnpm --filter @roomful/relay buildpnpm --filter @roomful/relay startOptional relay env overrides:
HOST=0.0.0.0 PORT=8787 MAX_CONNECTIONS=1000 pnpm --filter @roomful/relay startcurl http://127.0.0.1:8787/healthOptional multi-instance relay mode:
ROOMFUL_REDIS_URL=redis://127.0.0.1:6379/0 pnpm --filter @roomful/relay startWorking Norms
Section titled “Working Norms”- Prefer small, focused PRs.
- Keep docs and tests in the same PR as behavior changes.
- Preserve strict TypeScript compatibility.
- Follow the canonical code conventions policy.
- Keep imports sorted and lint-clean before commit.
- Run Prettier checks before opening a PR.
- Keep package unit tests in
src/**/*.test.tsfor Vitest convention consistency. - Keep declaration-only type tests in
test-d/**/*.test-d.ts. - Core package coverage threshold must stay at or above 80%.
- Add a changeset file for release-relevant changes in
packages/*.
CI and Release
Section titled “CI and Release”- PR workflow:
.github/workflows/ci.yml - Release workflow:
.github/workflows/release.yml - PR validation matrix: Node
18,20 - Validation order: install -> lint -> format -> typecheck -> test -> docs snippets -> build -> test:types -> verify:package-types -> publish smoke
- Release trigger: push tag matching
v* - Release output: npm packages, relay Docker image, and generated GitHub Release
Required GitHub secrets for release:
NPM_TOKEN(required)DOCKERHUB_USERNAME(required)DOCKERHUB_TOKEN(required)TURBO_TEAM(optional, for remote cache)TURBO_TOKEN(optional, for remote cache)
Local Hooks
Section titled “Local Hooks”Husky is configured to enforce quality checks during commits:
pre-commit:pnpm lint+pnpm typecheckcommit-msg: commitlint conventional-commit validation
Use --no-verify only for emergency situations.
Troubleshooting
Section titled “Troubleshooting”- If workspace linking fails, reinstall dependencies from repository root.
- If type errors look stale, clear local build artifacts and rerun typecheck.
- If
pnpm typecheckpasses butpnpm typecheck:rootfails, verify roottsconfig.jsonincludes only intended sources and excludes tests/build output. - If coverage output is missing, confirm tests are under
packages/*/src/**/*.test.tsand rerunpnpm test. - If declaration-only tests fail, rebuild workspace packages before rerunning
pnpm test:types. - If packaged declaration verification fails, run
pnpm buildand thenpnpm verify:package-typesto inspect the reported package. - If packed consumer smoke tests fail, run
pnpm buildand thenpnpm smoke:publishto reproduce the install/build failure in.smoke/workdirs. - If releases fail before publish, confirm
NPM_TOKEN,DOCKERHUB_USERNAME, andDOCKERHUB_TOKENare configured in repository secrets. - If WebRTC peers do not connect, verify
relayUrlpoints to a reachable@roomful/relayinstance and check browser console ICE errors. - Same-origin BroadcastChannel fallback only occurs during the initial WebRTC connect attempt when signaling is unavailable.