Skip to content

Contributing Guide

Thank you for your interest in contributing to TypoKit! This guide covers everything you need to set up your development environment, understand the codebase, and submit high-quality contributions.

Before you begin, make sure you have the following installed:

ToolVersionPurpose
Node.js24+Runtime for all packages
pnpmLatestPackage manager (monorepo workspaces)
GitLatestVersion control
Rust toolchainLatest stableOnly needed for transform-native or plugin-axum development
  1. Fork and clone the repository

    Terminal window
    git clone https://github.com/<your-username>/typokit.git
    cd typokit
  2. Install dependencies

    Terminal window
    pnpm install

    This installs all workspace dependencies and links local packages together.

  3. Build all packages

    Terminal window
    pnpm build

    This runs nx run-many --target=build, which builds all packages in dependency order using Nx.

  4. Run the test suite

    Terminal window
    pnpm test

    This runs nx run-many --target=test across all packages. Tests use the rstest runner.

  5. Verify everything passes

    Terminal window
    pnpm typecheck
    pnpm lint

TypoKit is organized as a pnpm monorepo with Nx for build orchestration. All packages live under packages/ and are published as @typokit/*.

PackageDescription
@typokit/coreCentral framework — router, handler execution, middleware pipeline
@typokit/typesShared TypeScript type definitions and interfaces
@typokit/errorsStructured error types and error handling utilities
@typokit/cliCommand-line interface for scaffolding and development
PackageDescription
@typokit/transform-nativeRust-based native transform (SWC, NAPI bindings)
@typokit/transform-typiaTypia-based runtime type transformations
PackageDescription
@typokit/server-nativeBuilt-in native HTTP server
@typokit/server-expressExpress.js adapter
@typokit/server-fastifyFastify adapter
@typokit/server-honoHono framework adapter
PackageDescription
@typokit/platform-nodeNode.js runtime support
@typokit/platform-bunBun runtime support
@typokit/platform-denoDeno runtime support
PackageDescription
@typokit/db-drizzleDrizzle ORM adapter
@typokit/db-kyselyKysely query builder adapter
@typokit/db-prismaPrisma ORM adapter
@typokit/db-rawRaw SQL queries adapter
PackageDescription
@typokit/clientBase type-safe HTTP client
@typokit/client-react-queryReact Query integration
@typokit/client-swrSWR (stale-while-revalidate) integration
PackageDescription
@typokit/plugin-debugDebug and inspection plugin
@typokit/plugin-wsWebSocket support plugin
@typokit/otelOpenTelemetry observability integration
@typokit/testingTesting utilities and helpers
PackageDescription
@typokit/nxNx plugin with custom executors and generators
@typokit/turboTurbo integration
@typokit/docsDocumentation site (Astro Starlight)

Nx manages all build tasks with dependency-aware execution. The key targets are:

TargetCommandDescription
buildtsc -p tsconfig.jsonCompile TypeScript to JavaScript
testrstest run --passWithNoTestsRun tests with rstest
linteslint src/Lint source files with ESLint
typechecktsc --noEmit -p tsconfig.jsonType-check without emitting
Terminal window
# Build a single package
pnpm nx build core
# Test a single package
pnpm nx test server-express
# Run all targets
pnpm nx run-many --target=build
pnpm nx run-many --target=test

You can visualize the package dependency graph:

Terminal window
pnpm nx graph

The packages/transform-native/ package contains a Rust crate that compiles to a Node.js native addon via NAPI-RS.

Install the Rust toolchain via rustup:

Terminal window
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Terminal window
cd packages/transform-native
pnpm build:native

The build produces an index.node binary using @napi-rs/cli. The crate uses SWC for parsing and supports multiple platforms (Windows x64, macOS x64/ARM64, Linux GNU/musl).

  1. Create a feature branch

    Terminal window
    git checkout -b feat/my-feature
  2. Make your changes — keep changes focused on a single concern.

  3. Run quality checks before committing

    Terminal window
    pnpm typecheck && pnpm lint && pnpm test
  4. Commit with a descriptive message

    Follow Conventional Commits:

    Terminal window
    git commit -m "feat(core): add middleware chaining support"

    Common prefixes: feat:, fix:, docs:, refactor:, test:, chore:

  5. Push and open a pull request

    Terminal window
    git push origin feat/my-feature
  • All packages use ESM modules ("type": "module")
  • TypeScript strict mode is enabled
  • Follow existing patterns in the package you’re modifying
  • Run pnpm lint to check for style issues
  1. Ensure CI passes — the CI pipeline runs build, typecheck, lint, and test across all affected packages.
  2. Keep PRs focused — one logical change per PR makes review easier.
  3. Update documentation if your change affects public APIs or behavior.
  4. Add tests for new functionality or bug fixes.
  5. Respond to review feedback promptly — reviewers may request changes before merging.

The CI pipeline validates every pull request with the following checks:

  • Build — all packages compile successfully
  • Typecheck — no TypeScript errors
  • Lint — ESLint passes on all source files
  • Test — all test suites pass

All checks must pass before a PR can be merged.