Skip to content

Update docs for ESM-only migration (README, api.md, CHANGELOG, CLAUDE.md) #488

Description

@derduher

Depends on #485 merging.

#485 (ESM-only migration) drops CommonJS require() support (removes the require conditional export and the main field from package.json) and bumps the minimum Node.js version to >=22. Several docs still show now-broken examples or stale references and need updating once that PR lands:

  • README.md — five // CommonJS / require('sitemap') example blocks (currently around the "Basic Usage", Express, and streaming-to-files sections) will throw ERR_REQUIRE_ESM post-merge. Remove these blocks or replace with a note that CJS is no longer supported as of the next major version.
  • api.md — same pattern: four // CommonJS / require('sitemap') blocks need the same treatment.
  • CHANGELOG.md — no entry yet for this release. The project already documents breaking Node-version bumps in detail (see the 9.0.0 entry: "Dropped Node.js < 20 Support" with explicit old/new engine requirements). This change should get the same treatment: Node >=22 requirement, CJS require() support dropped, and (as a minor dev-facing note) the Jest → node:test migration.
  • CLAUDE.md — the "Coverage Requirements (enforced by jest.config.cjs)" section still references jest.config.cjs, which feat!: esm #485 deletes. Needs updating to reflect the new node --experimental-test-coverage based test setup (and note that threshold enforcement isn't currently wired up — see review comment on feat!: esm #485).

Filing as a separate issue rather than piling onto #485 since these are follow-up doc changes rather than code review blockers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions