Skip to content

fix(release): regenerate iroh-js/index.js in prepare-release#266

Merged
dignifiedquire merged 1 commit into
mainfrom
fix/release-regen-js-index
Jul 11, 2026
Merged

fix(release): regenerate iroh-js/index.js in prepare-release#266
dignifiedquire merged 1 commit into
mainfrom
fix/release-regen-js-index

Conversation

@dignifiedquire

Copy link
Copy Markdown
Contributor

napi's build step bakes the current package.json version into iroh-js/index.js at ~13 sites (bindingPackageVersion !== '<V>' checks + matching error strings). Publish CI has always regenerated this on the runner and shipped a fresh copy to npm, but the committed file on main was never re-run through napi build after the initial 1.0.0-rc.1 checkin — every release since then drifted further from the actual published state.

Two-part fix:

  • Add cargo make js-build to the prepare-release task so authoring a release regenerates index.js locally alongside the package.json / Cargo.toml / etc. version bumps, keeping the committed file honest.

  • Re-run the same regeneration now to catch main up to the current published 1.0.0.

The runtime version check is opt-in (gated on
NAPI_RS_ENFORCE_VERSION_CHECK=1), so default consumers weren't affected — but strict-mode consumers on v1.0.0 would have seen 'expected 1.0.0-rc.1' errors.

napi's build step bakes the current package.json version into
iroh-js/index.js at ~13 sites (`bindingPackageVersion !== '<V>'`
checks + matching error strings). Publish CI has always regenerated
this on the runner and shipped a fresh copy to npm, but the committed
file on main was never re-run through napi build after the initial
1.0.0-rc.1 checkin — every release since then drifted further from
the actual published state.

Two-part fix:

- Add `cargo make js-build` to the prepare-release task so
  authoring a release regenerates index.js locally alongside the
  package.json / Cargo.toml / etc. version bumps, keeping the
  committed file honest.

- Re-run the same regeneration now to catch main up to the current
  published 1.0.0.

The runtime version check is opt-in (gated on
NAPI_RS_ENFORCE_VERSION_CHECK=1), so default consumers weren't
affected — but strict-mode consumers on v1.0.0 would have seen
'expected 1.0.0-rc.1' errors.

@ramfox ramfox left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@dignifiedquire dignifiedquire merged commit 66e628e into main Jul 11, 2026
43 checks passed
@github-project-automation github-project-automation Bot moved this from 🚑 Needs Triage to ✅ Done in iroh Jul 11, 2026
@dignifiedquire dignifiedquire deleted the fix/release-regen-js-index branch July 11, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants