Thank you for your interest in contributing to NHSERVER! We welcome contributions, bug reports, and suggestions from the community.
To maintain code quality, modularity, and a clean Git history, please read and follow this guide carefully before submitting your contributions.
NHSERVER uses a strict branch separation policy to keep development, releases, and testing environments clearly decoupled.
main (Stable, tagged releases)
▲
│ (Release PRs)
develop (Active feature & core development - NO test suites here)
▲
│ (Feature / Fix PRs)
feature/*, fix/*, refactor/*, docs/*
test-server (Dedicated testing branch: Vitest suites & test cases)
▲
│ (Test PRs)
test/*
- Contains only production-ready, tagged, and released code.
- Direct commits are not permitted.
- The active integration branch for framework core development, features, adapters, and documentation.
- CRITICAL RULE: Unit tests and test suites do NOT belong in
develop. PRs submitted todevelopmust focus solely on source code (src/), examples (examples/), or project documentation.
- The dedicated branch for all unit, integration, and E2E test suites (
test/). - All test maintenance, new Vitest test cases, and mock setups are developed and PR'd directly against
test-server. - This keeps the core source lean while providing an independent environment for rigorous automated validation.
- Fork the repository on GitHub.
- Clone your fork:
git clone https://github.com/<your-username>/nhserver.git cd nhserver
- Branch from
develop:git checkout develop git pull origin develop git checkout -b feature/your-feature-name # or fix/your-fix-name - Make your changes inside
src/orexamples/. - Verify TypeScript types:
npx tsc --noEmit
- Commit and Push:
git commit -m "feat(router): add regex path matching support" git push origin feature/your-feature-name - Open a Pull Request targeting the
developbranch. Ensure no test files (test/) are included in this PR.
- Checkout the
test-serverbranch:git checkout test-server git pull origin test-server git checkout -b test/your-test-suite
- Add or update test files under the
test/directory. - Run Vitest:
pnpm test - Commit and Push:
git commit -m "test(http): add comprehensive error status tests" git push origin test/your-test-suite - Open a Pull Request targeting the
test-serverbranch.
- File Naming: All filenames must be lowercase with words separated by underscores (e.g.,
nh_server.ts,route.test.ts). No camelCase, PascalCase, or kebab-case filenames. - No
index.ts: Do not useindex.tsas an entrypoint. Use explicit filenames and export fromsrc/app.ts. - TypeScript Strictness: Always keep
strict: true. Avoid usinganyunless absolutely required and documented. - Commit Messages: Follow Conventional Commits:
feat:New featuresfix:Bug fixesdocs:Documentation updatesrefactor:Code restructuring without behavioral changestest:Test additions or modifications (targetingtest-server)
Feel free to open an issue on GitHub for discussions, feature requests, or architecture proposals. Thank you for making NHSERVER better!