Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 1.37 KB

CONTRIBUTING.md

File metadata and controls

47 lines (35 loc) · 1.37 KB

Contributing to jsOFD

Thanks for your interest in contributing!

Development setup

git clone <your-fork>
cd jsOFD
npm install

Toolchain: Node ≥ 18, TypeScript (strict), Vitest, tsup, ESLint + Prettier.

Common tasks

npm run dev          # launch the interactive playground (Vite)
npm test             # run the full test suite
npm run typecheck    # tsc --noEmit
npm run lint         # ESLint
npm run lint:fix     # ESLint --fix
npm run format       # Prettier
npm run build        # build dist/ (ESM + CJS + UMD + types)

Pull requests

  1. Create a feature branch (git checkout -b feat/my-feature).
  2. Make your change with tests — aim to keep coverage of public APIs.
  3. Ensure pnpm lint, pnpm typecheck and pnpm test all pass.
  4. Add a note to CHANGELOG.md under Unreleased.
  5. Open the PR with a clear description and motivation.

Code style

  • TypeScript strict mode; no any in src/ (tests may relax).
  • English JSDoc for public APIs; keep comments about why, not what.
  • Units: the internal model stores points (pt); serialisation converts to mm.
  • OFD output must stay compliant with GB/T 33190-2016. When in doubt, cross-validate with an independent reader such as ofdrw.

Reporting bugs

Please include a minimal reproduction (code sample or PDF input) and the generated .ofd when relevant.