fix(release): regenerate iroh-js/index.js in prepare-release#266
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-buildto 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.