- Node.js ≥ 20 (CI runs on Node 20)
- npm ≥ 10
git clone <repo>
cd bc3js
npm installnpm run buildRuns tsup. Output goes to dist/:
dist/index.js— ESMdist/index.cjs— CJSdist/index.d.ts— Type declarations
TypeScript type-checking happens during the tsup build. There is no standalone tsc --noEmit command.
npm test # run all tests once
npm run test:watch # re-run on file changesTests use node:test (Node.js built-in) + tsx as a TypeScript loader.
Test files live in tests/ mirroring src/ structure (tests/**/*.test.ts).
npm run check-format # check (CI gate)
npm run format # auto-fixPrettier is enforced by a husky pre-commit hook via lint-staged. Config: single quotes, trailing commas, 80 print width, LF line endings.
npm run ci # build + format checkThis is what the GitHub Actions workflow runs. Must pass before merging.
strict, noUncheckedIndexedAccess, noImplicitOverride — do not relax these.
scripts/ is gitignored. You can add ad-hoc scripts there without polluting the repo.
Example smoke test:
npm run build && node scripts/tokenize.mjs ./scripts/file.bc3BC3 real-world samples are in data/bc3-corpus/samples/real-world/.
They are read-only reference files — never modify them.
All are ISO-8859-1 + CRLF encoded.