Skip to content

fix(release): include ed25519_bip32_wasm.js in the published npm tarball - #223

Merged
patextreme merged 2 commits into
release/1.8.5from
fix/npm-bip32-wasm-assemble-dependency
Jun 11, 2026
Merged

patextreme merged 2 commits into
release/1.8.5from
fix/npm-bip32-wasm-assemble-dependency

Conversation

@patextreme

@patextreme patextreme commented Jun 10, 2026 •

Copy link
Copy Markdown

Description

The 1.8.5 npm release of @hyperledger/identus-apollo shipped a tarball missing ed25519_bip32_wasm.js. The file is required at runtime by apollo.js (line 2497 of the bundled output does require('./ed25519_bip32_wasm.js')), and consumers fail at module load with Cannot find module './ed25519_bip32_wasm.js'. Observed in the Identus integration test suite against [email protected], which transitively pulls identus-apollo@^1.4.5 and resolves to the broken 1.8.5.

Root cause — commit 6c8640f ("fix(release): use npm OIDC publishing") switched the release workflow's NPM publish step from a gradle task (./gradlew :apollo:publishJsPackageToNpmjsRegistry) to a plain npm publish shell command. The npmBip32Wasm task (which copies the wasm artifact into apollo/build/packages/js/) was only wired as a dependsOn of NpmPublishTask from the dev.petuska.npm.publish gradle plugin, so bypassing that task severed the chain. The build directory at publish time no longer contained ed25519_bip32_wasm.js, but the require call in apollo.js was still there.

Changes

  • apollo/build.gradle.kts — add tasks.named("assembleJsPackage") { dependsOn("npmBip32Wasm") }. This makes the staged build directory complete on its own, regardless of whether the publish step is invoked via gradle or the npm CLI. Mirrors the pattern already used for jsBrowserProductionLibraryDistribution and jsNodeProductionLibraryDistribution (which both depend on copyBip32Wasm).

  • .github/workflows/release.yml — add an "NPM publish smoke test" step that runs npm pack on the staged directory and asserts ed25519_bip32_wasm.js is in the tarball. Harmless under the current gradle-based publish; fails loudly if a future change bypasses the gradle task again. This is regression protection, not a fix in its own right.

How to verify the fix locally

After this lands, a release run should produce an npm tarball that contains ed25519_bip32_wasm.js. You can confirm by downloading the artifact from the workflow's npmBip32Wasm task output, or by inspecting the published tarball:

npm view @hyperledger/[email protected] dist.tarball | xargs curl -sSL | tar -tz | grep ed25519
# expected: package/ed25519_bip32_wasm.js

Checklist

  • My PR follows the contribution guidelines of this project
  • My PR is free of third-party dependencies that don't comply with the Allowlist
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (no user-facing doc change needed)
  • I have added tests that prove my fix is effective or that my feature works (release smoke test)
  • I have checked the PR title to follow the conventional commit specification

Related

  • Bug-introducing commit: 6c8640f on release/1.8.5
  • Consumer impact: hyperledger-identus/integration test runs 27255955264 and 27277022285 (the first hit this in the wild via [email protected] → [email protected])

@patextreme
patextreme requested a review from a team as a code owner June 10, 2026 13:43
@patextreme
patextreme force-pushed the fix/npm-bip32-wasm-assemble-dependency branch from 6e9ebf8 to aaacd0a Compare June 10, 2026 14:05
@patextreme
patextreme changed the base branch from main to release/1.8.5 June 10, 2026 14:06
Reverting to the gradle publish task would run without credentials:
6c8640f removed NPM_TOKEN from the workflow env, and the petuska
plugin's bundled npm is not the OIDC-capable CLI. The assembleJsPackage
dependency on npmBip32Wasm already makes the staged directory complete
for the npm CLI path, and the smoke test guards the tarball contents.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Signed-off-by: Pat Losoponkul <[email protected]>
@patextreme
patextreme force-pushed the fix/npm-bip32-wasm-assemble-dependency branch from 106aed2 to 8b59ef8 Compare June 10, 2026 14:29
@sonarqubecloud

Copy link
Copy Markdown

@patextreme
patextreme merged commit 54dea5c into release/1.8.5 Jun 11, 2026
3 of 5 checks passed
@patextreme
patextreme deleted the fix/npm-bip32-wasm-assemble-dependency branch June 11, 2026 08:22
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.

2 participants