Repository navigation
impl(031): the WebAssembly npm package ships its entry points - #352
Conversation
The 0.1.0 wasm tarball named web, bundler and node index.js and index.d.ts in its exports but packed none of them: artifacts.sh pack never ran wrap-wasm.mjs. The pack now stages them as make bindings does, and npm-audit refuses a tarball missing any file its main, types, typings or exports name, or naming a wildcard.
AI review (no-findings)Reviewing the four changed files for bugs, security issues, and inconsistencies.
node tools/rustev-conformance/js/wrap-wasm.mjs integrations/rustev-wasmInserted after the
Path traversal protection: the combination of
Wildcard check:
The No defects found. {"head": "2a197700fde66b29ee9e85fa451750dca917a4d4", "verdict": "no-findings", "findings": []}Subject: 70410fb...2a19770, diff digest d283530dc1b714b5ae59046cbb8da57061f1e73c22b3e2b8853e1c74fdd205c9, 1 call(s). An AI comment is not an approval. |
Summary
The published
@rustev/[email protected]tarball declaresexportstargets./{web,bundler,node}/index.{js,d.ts}but contains none of them:artifacts.sh packran wasm-bindgen and wasm-opt and never staged the wrappers. The npm declaration comparison caught it (missing or external declaration entry @rustev/rustev-wasm ./bundler: ./bundler/index.d.ts).tools/rustev-release/artifacts.sh:packrunsnode tools/rustev-conformance/js/wrap-wasm.mjs integrations/rustev-wasmafter the wasm-bindgen loop, asmake bindingsdoes. The generatedindex.jsinlines the wrapper factory andindex.d.tsre-exports./rustev_wasm, sofilesneeds no change.tools/rustev-release/src/artifacts.rs:npm_audit(031 3.9.2) now refuses a tarball missing a file named bymain,types,typings, or any string leaf ofexportsunder every condition (package/<target>). It also refuses targets that are external (.., absolute) or name a directory, and refuses wildcards, asnpm-api-diff.mjsdoes.tools/rustev-release/tests/artifacts.rs: the wasm manifest passes with all of its entry points; droppingbundler/index.d.ts(thetypescondition) orweb/index.js(theimportcondition) each gives exactly one problem naming the target; a wildcard and an externalmainare refused. The existing fixtures now pack the node package's declared files.Verification
lane1 cargo test -p rustev-release --locked: every suite ok,tests/artifacts.rstest result: ok. 10 passed; 0 failed, includingnpm_audit_refuses_a_tarball_missing_a_declared_entry_point ... oklane1 cargo clippy -p rustev-release --all-targets --locked -- -D warnings: cleanlane1 cargo fmt --check: cleansh -n tools/rustev-release/artifacts.sh: okmake refreshthenmake gate: exit 0spec-spine couple --base origin/main --head HEAD:OK: 4 path(s) checked, no drift.bash scripts/check-authored-content.sh:2180 authored file(s) clean (U+2014, session links)lane1 make bindings(wasm-bindgen 0.2.129, wasm-opt 116): exit 0,conformance native: 192 case(s), 0 failure(s);target/bindings/rustev-wasm/{web,bundler,node}/index.{js,d.ts}all presentwrap-wasm.mjson a copy ofintegrations/rustev-wasmfollowed bynpm pack --dry-runlistsweb/,bundler/,node/index.jsandindex.d.ts