Skip to content

Contributing

  1. Fork and clone

    Terminal window
    git clone https://github.com/sqrcz/numerik-js.git
    cd numerik-js
  2. Install dependencies

    Terminal window
    pnpm install
  3. Run the test suite

    Terminal window
    pnpm test
CommandWhat it runs
pnpm testVitest test suite
pnpm test:watchVitest in watch mode
pnpm test:coverVitest with coverage
pnpm typechecktsc --noEmit
pnpm lintBiome lint + format check
pnpm lint:fixBiome lint + format — auto-fix
pnpm buildCompile to dist/
pnpm checktypecheck + lint + test in sequence

Run pnpm check before opening a PR to catch all issues locally.

Adding a new identifier requires touching several files. PRs missing any item will not be merged:

  • Create src/value-objects/NewIdentifier.ts (implements IdentifierInterface)
  • Create src/identifiers/NewIdentifierIdentifier.ts (implements both ValidatorInterface and ParserInterface; accepts strict: boolean = true)
  • Add new ValidationFailureReason cases if the identifier introduces new failure types
  • Add an entry to src/Numerik.ts and export it from src/index.ts
  • Add Zod schemas to src/zod/index.ts
  • Add tests/new-identifier.test.ts
  • Add an identifier page under docs/src/content/docs/identifiers/
  • Update CHANGELOG.md
TypePatternExample
Featurefeat/<short-name>feat/passport-identifier
Fixfix/<short-name>fix/pesel-century-calc
Chorechore/<short-name>chore/update-dependencies

Use Conventional Commits:

feat: add PassportIdentifier
fix: correct PESEL century calculation for 2000s
docs: update REGON algorithm description
test: add NIP fixtures for invalid tax office codes
chore: bump vitest to 4.x
refactor: extract checksum calculation to dedicated method
  1. Fork the repository and create your branch from main.
  2. Add tests for any new behaviour — all tests must pass.
  3. Ensure pnpm check passes.
  4. Open a PR against main and fill in the template completely.

Use the Bug Report template on GitHub.

Do not open a public issue. Report via GitHub’s private advisory system. See SECURITY.md.