chore: pin @napi-rs/wasm-runtime through a pnpm catalog - #289
Conversation
📝 WalkthroughWalkthroughThe workspace adds a pnpm catalog entry for 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR stabilizes the workspace’s @napi-rs/wasm-runtime version by pinning it via a pnpm catalog, preventing napi create-npm-dirs from overwriting committed dependency ranges and causing CI/release drift.
Changes:
- Add a pnpm catalog entry pinning
@napi-rs/wasm-runtimeto1.1.6, and update workspace consumers to use thecatalog:protocol. - Update the npm release workflow to run
napi version(instead ofnapi create-npm-dirs) before moving artifacts. - Remove the
napi deps checkCI job that regenerated manifests and then required a frozen lockfile.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Adds a catalog pin for @napi-rs/wasm-runtime to enforce a consistent workspace version. |
| pnpm-lock.yaml | Records the catalog in the lockfile and updates workspace importer specifiers to catalog:. |
| package.json | Switches the root dev dependency on @napi-rs/wasm-runtime to catalog:. |
| bindings/wasm32-wasi/package.json | Switches the binding package dependency on @napi-rs/wasm-runtime to catalog:. |
| .github/workflows/release-npm.yml | Uses pnpm napi version instead of regenerating npm dirs before publishing artifacts. |
| .github/workflows/ci.yml | Removes the napi deps check job that was incompatible with keeping manifests as committed source. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ac19b0c to
23ddf99
Compare
Merging this PR will improve performance by 3.18%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | resolver[tsconfig resolve] |
5 ms | 4.8 ms | +3.18% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing chore/pin-wasm-runtime-catalog (1527f6e) with main (9a600a4)
23ddf99 to
fe93bf8
Compare
`napi create-npm-dirs` fetches the registry's latest dist-tag and stamps `^<latest>` into bindings/wasm32-wasi/package.json, overwriting whatever is committed. The `napi deps check` job regenerated the dirs and then required the lockfile to stay frozen, so it broke on every wasm-runtime release, and a release published whatever range happened to be latest at that moment. Follow rspack: keep the binding manifests as committed source, resolve the version through a pnpm catalog, and stop regenerating them. `napi version` still stamps the release version, and only the version.
fe93bf8 to
1527f6e
Compare
Why
@napi-rs/wasm-runtimewas pinned nowhere that survived CI.napi create-npm-dirsresolves it from the registry's latest dist-tag at run time and overwritesbindings/wasm32-wasi/package.jsonwith^<latest>, discarding whatever is committed. Sonapi deps check— which regenerated the manifests and then required a frozen lockfile — broke on every upstream release, twice in the two days1.2.0and1.2.1landed, and a release published whatever range was latest at that moment rather than the version the tests ran against.1.2.xis why that matters: it carries the stablelatestdist-tag but peers on@emnapi/core: ^2.0.0-alpha.3, and@emnapi/corehas no stable 2.x, so it fails to load.What
The version is now locked in a pnpm catalog and maintained by renovate, which already groups
@napi-rs/*and reads catalog entries frompnpm-workspace.yaml. Both consumers — the binding manifest and the root dev dependency — referencecatalog:.Nothing regenerates the binding manifests any more, so
napi deps checkis gone.release-npm.ymlcallsnapi version, which stamps the release version into each manifest without touching dependencies; that is still needed becausescripts/prepublish.mjspins each binding in the main package'soptionalDependenciestonpm/package.json's version.catalog:never reaches consumers:pnpm packonbindings/wasm32-wasiyields a tarball reading"@napi-rs/wasm-runtime": "1.1.6", andpnpm publish -rsubstitutes the same way.Split out of #288.