Skip to content

chore: add release tooling and drop invariant and shallowequal - #278

Merged
staylor merged 1 commit into
mainfrom
modernize-release-tooling
Nov 11, 2026
Merged

staylor merged 1 commit into
mainfrom
modernize-release-tooling

Conversation

@staylor

@staylor staylor commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Problem

Releasing was manual and left no trail: npm has 3.0.0, but the newest GitHub release is 0.2.0 from 2018, and v3.0.0 is the only version tag. Pull requests from forks got no CI at all (#259 only showed a stale CircleCI check). The README said React 19 needs no code changes, although <HelmetProvider> doesn't fill in context there. invariant and shallowequal were runtime dependencies for what a five-line helper and PureComponent do.

Fix

  • pnpm release <major|minor|patch|x.y.z> moves the [Unreleased] entries in CHANGELOG.md into a version section, bumps package.json and opens a release/v<version> PR. --dry-run prints the notes.
  • Merging that PR runs publish.yml. If npm doesn't have the version, it runs tsc and the unit tests and publishes through npm trusted publishing (provenance included), then creates the GitHub release and tag with the changelog section as notes. Merging this PR publishes nothing, since 3.0.0 is on npm, and creates the missing v3.0.0 release.
  • CI now runs on fork PRs; branches in this repository keep running it on push only, so nothing runs twice. Dependabot proposes npm and action updates weekly, after a 7-day cooldown.
  • exports includes ./package.json again, and the README gains Installation and Releasing sections and accurate React 19 server caveats. [Unreleased] covers everything merged since 3.0.0.

Notes

Before merging the first release PR, add the trusted publisher on npmjs.com: GitHub Actions, staylor / react-helmet-async / publish.yml, with npm publish allowed (new configurations only allow npm stage publish by default). A configuration that isn't used within 2 days expires.

Tests

  • release-helpers.test.ts covers version bumps and the changelog rewrite. In a sandbox clone with a stubbed gh, pnpm release minor pushed a one-commit release/v3.1.0 that changes only the version, the heading and the compare links.
  • The workflow's check step, run locally, reports release for 3.0.0 and publish plus release for an unpublished version; actionlint passes.
  • The built lib/ differs from main only by the dependency swap, and the packed file list is unchanged.

Releases were manual: npm has 3.0.0, but the newest GitHub release is
0.2.0 and only v3.0.0 has a tag. `pnpm release <bump>` now moves the
[Unreleased] changelog entries into a version section and opens a
release pull request. Merging it runs publish.yml, which publishes the
version through npm trusted publishing if npm doesn't have it, then
creates the GitHub release and tag from the changelog.

Pull requests from forks never ran CI; they do now, while branches in
this repository keep running it on push only. Dependabot proposes npm
and GitHub Actions updates weekly.

invariant and shallowequal are replaced by a small helper and
PureComponent. The README's React 19 section no longer says server code
works unchanged, and CHANGELOG.md covers everything since 3.0.0.
@staylor
staylor force-pushed the modernize-release-tooling branch from bc41243 to 531ad40 Compare November 11, 2026 20:34
@staylor
staylor merged commit 87920f9 into main Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant