Contributing
Thanks for wanting to help with the RedSpaceM SDK! This page covers how to build, test and publish the packages.
Requirements
- Bun 1.3+ — runtime, package manager and test runner.
- Git for version control.
Repository layout
packages/@redspacem/
server-types/ # typed mp.* contract + helpers
rpc/ # type-safe RPC layer
client-types/ # client-side API types
browser-types/ # CEF/NUI bridge types
di/ # tiny DI container
testing/ # mocks for unit tests
examples/freeroam # example gamemode resource
docs/ # documentation (EN + RU)
Setup
bun installCommon commands
bun run lint # Biome check (formatter + linter)
bun run format # Biome format --write
bun run typecheck # tsc --noEmit in every workspace package
bun test # bun test across the workspace
bun run build # compile dist/ for every package (topological order)bun run build compiles each package with tsc -p tsconfig.build.json into
dist/index.js + dist/index.d.ts. Packages are built in dependency order
(see the root package.json).
Note: typecheck/test resolve sibling packages through their published
exports(which point atdist/), so runbun run buildat least once after a fresh clone beforebun run typecheck/bun test.
Code conventions
- Strict TypeScript; the per-package
tsconfig.jsonextends../../tsconfig.base.json. - Biome: line width 100, double quotes, semicolons always, imports organized,
noExplicitAnyis an error. - No comments unless they add real value (doc comments on public API are welcome).
- Tests live next to sources as
src/*.test.tsand import from../src/index.ts(notdist/).
Adding or changing a package
- Keep packages focused and dependency-light.
- Update
src/index.ts, add/adjustsrc/*.test.ts. - Keep the package's
package.jsonmetadata accurate (description, keywords, license, repository). - Run the full suite:
bun run lint,bun run build,bun run typecheck,bun test.
Publishing
Publishing is done per-package, in dependency order, from a tagged release
(vX.Y.Z). CI runs it automatically via the publish workflow; to publish
locally:
bun run build # ensure dist/ is current
bun pm login # authenticate with npm
for pkg in server-types rpc client-types di browser-types testing; do
(cd packages/@redspacem/$pkg && bun publish --access public)
doneOrder matters: server-types → rpc → client-types → di → browser-types → testing.
Checklist before publishing
-
bun run lint,bun run build,bun run typecheck,bun testall green -
versionbumped and tagged in git -
bun publish --dry-runshowspackage.json,dist/*andLICENSE - No secrets in the repository (
.envfiles are git-ignored)