Skip to main content

Contributing

Use whenyou are opening a pull request against this repository.

You getthe setup, the commit format Release Please needs, and what review looks for.

We welcome contributions from the community. The full contribution guidelines live in the CONTRIBUTING.md file at the repository root.

Quick Start​

  1. Fork the repository on GitHub

  2. Clone your fork and install dependencies:

    git clone https://github.com/your-username/nestjs-jetstream.git
    cd nestjs-jetstream
    pnpm install
  3. Create a branch for your change:

    git checkout -b feat/your-feature-name
  4. Make your changes, write tests, and verify everything passes:

    pnpm lint
    pnpm test
  5. Push and open a Pull Request

Prerequisites​

  • Node.js >= 22.0.0
  • pnpm >= 12.15
  • Docker (integration tests use Testcontainers to start NATS automatically)

Development Commands​

CommandDescription
pnpm buildBuild the library with tsdown, dual CJS/ESM
pnpm build:watchBuild in watch mode
pnpm typecheckType-check against tsconfig.build.json
pnpm lintLint with oxlint, type-aware rules included
pnpm lint:fixLint and apply fixes
pnpm lint:mdLint markdown structure with markdownlint
pnpm formatFormat source and docs with oxfmt
pnpm format:checkCheck formatting without writing
pnpm testRun unit and integration tests in parallel
pnpm test:watchRun tests in watch mode
pnpm test:covRun tests with coverage
pnpm benchRun the benchmark harness
pnpm docs:apiRegenerate the TypeDoc API reference
pnpm docs:devRegenerate the API reference, then start the Docusaurus dev server
pnpm docs:buildRegenerate the API reference, then build the site
pnpm docs:serveServe the built site locally

See Testing for detailed test conventions and setup.

Port collision between docs:dev and dev:example

Docusaurus' dev server and the example apps both default to port 3000. If you run pnpm docs:dev and pnpm dev:example in the same pass, the second one fails with EADDRINUSE. Launch Docusaurus with PORT=3100 pnpm docs:dev (or edit the example's bootstrap port) when you need both running side-by-side.

Commit Message Format​

The project uses Conventional Commits with Release Please for automated releases. Your commit messages determine how the changelog and version bumps are generated.

PrefixPurposeVersion Bump
feat:New featureMinor
fix:Bug fixPatch
docs:DocumentationNone
refactor:Code refactoringNone
test:Adding/updating testsNone
chore:MaintenanceNone

Examples:

feat: add support for custom stream configuration
fix(strategy): remove private logger that shadows Server base class
docs: update module configuration examples
tip

Use a scope in parentheses (e.g., feat(client):, fix(strategy):) to show the area of the codebase affected. This shows up in the generated changelog.

Pull Request Guidelines​

  • Ensure the build passes (pnpm build)
  • All linting checks must pass (pnpm lint)
  • All existing tests must pass, and new code should include tests
  • Use clear, descriptive PR titles: they become changelog entries via Release Please
  • Keep PRs focused on a single concern

Coding Standards​

  • TypeScript for all code
  • JSDoc comments on all public APIs
  • Follow existing code style (enforced by oxlint and oxfmt)
  • See Testing for test conventions (sut naming, createMock<T>(), Given-When-Then, etc.)

License​

By contributing, you agree that your contributions will be licensed under the MIT License.