Thank you for considering contributing to @panmdaa/validate.
@panmdaa/validate is a zero-dependency TypeScript validation library: chain-style schemas, lazy compilation, abort-early parsing, and compile-time type inference. It ships as pure ESM and is tree-shakeable. Contributions that improve correctness, performance, documentation, tests, and API clarity are welcome.
src/— source, organized in three layers:schemas/(declarative schema factories),compilers/(runtime backends), andcore/(compilation, codegen, and shared types).test/— vitest test suite (primitives, strings, numbers, compounds, wrappers, errors, type inference).bench/— benchmarks against zod, valibot, arktype, yup and ajv.misc/— branding assets (banner).
The package exposes a single entry point — @panmdaa/validate — which re-exports the core types, the schema factories, and the Validator namespace.
- reporting bugs or regressions in library behavior
- improving documentation, README, or examples
- adding tests for edge cases and public API behavior
- optimizing hot paths or reducing allocation
- proposing API improvements aligned with the project's design goals
For small fixes, open a pull request directly.
For larger changes, open an issue first so we can align on scope, API design, and compatibility impact.
Changes that should usually be discussed first:
- new public exports or schema kinds
- changes to the compiler or codegen backends
- changes to public function signatures or inferred types
- adding runtime dependencies
- breaking changes to public API or output
npm installUseful commands during development:
npm run typecheck
npm test
npm run lint
npm run format
npm run buildIf you touch performance-sensitive code, run the benchmark suite to check for regressions:
npm run bench # comparisons against other validation libraries
npm run bench:memory # allocation counts- Use English for code, comments, issues, and pull requests.
- Keep the public API minimal and predictable.
- Zero runtime dependencies is a hard constraint.
- Avoid breaking changes unless clearly justified and documented.
- Add or update tests when changing behavior or public API.
- Update documentation when public behavior or output changes.
- Preserve existing naming conventions and import patterns.
- Keep the
Validatornamespace as the single factory entry point for users.
- Use strict TypeScript with explicit return types on public API functions.
- Prefer readable, explicit code over clever abstractions.
- Keep modules focused: each file should have a single clear responsibility.
- Preserve the existing file structure under
src/(schemas/compilers/core). - Performance-sensitive paths should avoid unnecessary allocation.
- Formatting and linting are enforced by Biome; run
npm run lintandnpm run formatbefore pushing. - Use tabs for indentation and double quotes for strings (repo convention).
Before opening a PR, make sure:
npm run typecheckpassesnpm testpasses- new behavior is covered by tests
- docs are updated when public API or behavior changes
- breaking changes or migration notes are called out clearly
- if performance-sensitive, benchmark results are included
Use Conventional Commits. Scope the change when it touches a subsystem:
feat: add safeParseAll error collection
fix(codegen): keep tuple inference for heterogeneous items
perf(compilers): avoid allocation in object identity fast path
docs: document object strip/passthrough/strict modes
Reviews focus on:
- correctness of behavior and edge cases
- API clarity and consistency
- backward compatibility
- documentation quality
- test coverage
- maintainability
- performance in hot paths
Feedback is meant to improve the project. Questions, iterations, and design discussion are welcome.
If you are unsure whether an idea fits @panmdaa/validate, open an issue and describe:
- the use case
- the proposed API or behavior
- alternatives you considered
- compatibility or performance concerns