chore(release): npm 0.5.3#283
Conversation
There was a problem hiding this comment.
Pull request overview
This PR stabilizes pnpm-based npm releases by ensuring the generated per-platform bindings/* workspace packages are “anchored” in git, so pnpm-lock.yaml importers don’t get dropped on clean checkouts (and --frozen-lockfile remains reliable in CI release workflows).
Changes:
- Stop blanket-ignoring
bindings/and instead commit only each binding workspace’spackage.json(keep artifacts ignored viabindings/.gitignore). - Exclude
bindings/from Prettier checks to avoid enforcing formatting on generated files. - Align the
bindings/wasm32-wasiimporter inpnpm-lock.yamlto@napi-rs/wasm-runtime^1.1.5.
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
pnpm-lock.yaml |
Updates the bindings/wasm32-wasi importer specifier to match current generated deps (^1.1.5). |
.gitignore |
Removes the top-level ignore for bindings/ so the directory can be tracked. |
.prettierignore |
Adds bindings to skip formatting checks for generated binding workspace files. |
bindings/.gitignore |
Ignores all binding artifacts while allowing */package.json (and the ignore file) to be committed. |
bindings/wasm32-wasi/package.json |
Adds the WASI binding workspace manifest with its runtime dependencies. |
bindings/win32-x64-msvc/package.json |
Adds the Windows x64 binding workspace manifest. |
bindings/win32-ia32-msvc/package.json |
Adds the Windows ia32 binding workspace manifest. |
bindings/win32-arm64-msvc/package.json |
Adds the Windows arm64 binding workspace manifest. |
bindings/linux-x64-musl/package.json |
Adds the Linux x64 musl binding workspace manifest. |
bindings/linux-x64-gnu/package.json |
Adds the Linux x64 glibc binding workspace manifest. |
bindings/linux-arm64-musl/package.json |
Adds the Linux arm64 musl binding workspace manifest. |
bindings/linux-arm64-gnu/package.json |
Adds the Linux arm64 glibc binding workspace manifest. |
bindings/darwin-x64/package.json |
Adds the macOS x64 binding workspace manifest. |
bindings/darwin-arm64/package.json |
Adds the macOS arm64 binding workspace manifest. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📝 WalkthroughWalkthroughThe pull request tracks the 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
…mporters npm release failed with ERR_PNPM_OUTDATED_LOCKFILE on bindings/wasm32-wasi. napi create-npm-dirs regenerates the binding workspace packages at release time, but bindings/ was gitignored, so a renovate lockfile regeneration on a clean checkout (no bindings/ dir) silently dropped every bindings/* importer. Track bindings/*/package.json in git (rspack-style) so a clean checkout always carries the importers and renovate can no longer drop them; restore the importers in pnpm-lock.yaml. Exclude the generated bindings from prettier since napi output is not prettier-formatted.
740a286 to
6228906
Compare
Why
The npm 0.5.3 release (
release-npm.yml) fails at thenapi artifactsstep with:napi create-npm-dirsgenerates the per-platform binding workspace packages at release time, butbindings/is gitignored, so the lockfile'sbindings/*importers are not anchored to any committed file. A renovate lockfile regeneration on a clean checkout (wherebindings/does not exist) silently drops those importers — and even after they were re-added by hand, thebindings/wasm32-wasiimporter kept a stale@napi-rs/wasm-runtime^1.1.4specifier that no longer matches the^1.1.5thatcreate-npm-dirsnow generates (root devDep was bumped in #256). Either waypnpm install --frozen-lockfilefails during release.Only
bindings/wasm32-wasitriggers this — it is the one platform package with real dependencies (@napi-rs/wasm-runtime,@emnapi/*); the others are dependency-free.What
Track the binding
package.jsonfiles in git (the same approach rspack uses fornpm/*), so a clean checkout always carries the importers and renovate can no longer drop them:bindingsignore from.gitignorebindings/.gitignorethat tracks onlypackage.json(all.wasm/.cjs/ glue /.nodeartifacts stay ignored)bindingsto.prettierignore(the generated files are not prettier-formatted and must not be style-enforced)bindings/wasm32-wasilockfile importer to^1.1.5release-npm.ymlneeds no change:create-npm-dirsrewrites the version at release time (working-tree only) and version is not a dependency specifier, so--frozen-lockfilestays green.Verification (local, on a clean checkout)
pnpm install --frozen-lockfile→Lockfile is up to datepnpm install --lockfile-only→ lockfile byte-identical, importers retainedcreate-npm-dirs→artifacts→prepublish→ noERR_PNPM_OUTDATED_LOCKFILEprettier --check .→ clean