chore: open-source hygiene — CI, contributing guide, changelog, version fix

Merged
TO
5mo ago
+211-2

Cleanup pass to make citecheck genuinely adoptable by outside contributors.

Adoptability infrastructure

  • CI (.github/workflows/ci.yml) — runs on push to main and every PR:
    bun install --frozen-lockfile → bun run build (tsc) → bun test → bun run smoke.
    Uses bun (the suite is written with bun:test) plus Node 20 (smoke runs the
    compiled CLI under Node to honor engines: >=18). Fully offline — all 105
    tests mock globalThis.fetch, so no secrets or network access are required.
  • CONTRIBUTING.md — dev setup, project-layout table, the offline fetch-mock
    test convention, and PR/commit conventions.
  • CHANGELOG.md — backfilled 1.0.0 → 1.2.0 from tags + PR history
    (Keep a Changelog format).

Bug fix: version drift

src/http.ts hardcoded VERSION = "1.1.1" and was never bumped, so the
published 1.2.0 reports 1.1.1 for --version, the --help banner, and
the Crossref/OpenAlex User-Agent. It now reads the version from package.json
(always shipped in the npm tarball, one level up from dist/), so it can never
drift again. Verified the compiled CLI, the help banner, and the src path all
report 1.2.0.

The source self-corrects, but the published 1.2.0 will keep reporting
1.1.1 until a new release (e.g. a 1.2.1 patch) is published.

README

  • Added a CI badge.
  • Fixed the "Programmatic use" example — it used Bun.file(...), which throws
    Bun is not defined for the Node users this package targets; now uses
    node:fs/promises readFile.
  • Added a Contributing section linking the two new docs.

Verification

tsc clean · 105/105 tests pass · bun run smoke exits 0 · --version → 1.2.0.


Summary by cubic

Adds offline CI, a contributing guide, and a backfilled changelog, and fixes version reporting by reading from package.json. This makes citecheck easier to contribute to and prevents CLI/API version drift.

  • New Features

    • CI on push to main and PRs using bun and Node 20: bun install --frozen-lockfile → build (tsc) → bun test → smoke run under Node; fully offline (no network/secrets).
    • Docs: added CONTRIBUTING.md (dev setup, test convention) and CHANGELOG.md (1.0.0–1.2.0). README adds a CI badge, fixes the programmatic example to use node:fs/promises, and links to the new docs.
  • Bug Fixes

    • Version drift: VERSION now reads from package.json, so --version, --help, and API User-Agent always match the published version. Note: published 1.2.0 still reports 1.1.1 until the next release.

Summary by CodeRabbit

  • New Features

    • Added automated CI/CD workflow for running tests and builds on each push and pull request.
  • Documentation

    • Added CHANGELOG documenting release history across versions.
    • Added CONTRIBUTING guide for developers with setup and development instructions.
    • Updated README with CI status badge and improved examples.