[wasm/npm] @vowpalwabbit/[email protected] is missing transpiled JS files in published tarball
Describe the bug
The npm package @vowpalwabbit/[email protected] is published with an incomplete dist/ directory. The TypeScript sources under src/ were not transpiled before publishing, so the JavaScript entry points declared in [package.json] are missing from the tarball.
[package.json] of 0.0.9 declares:
"main": "dist/vwnode.js""exports": { ".": { "node": { "require": "./dist/vwnode.js" } } }
But the published tarball only contains: dist/vw-wasm.js
The expected files dist/vw.js, dist/vwnode.js and dist/vwbrowser.js (the transpiled outputs of src/vw.ts, src/vwnode.ts and src/vwbrowser.ts) are missing.
Behavior: any consumer that does require('@vowpalwabbit/vowpalwabbit') on Node.js gets:
Error: Cannot find module '.../node_modules/@vowpalwabbit/vowpalwabbit/dist/vwnode.js' at createEsmNotFoundErr (node:internal/modules/cjs/loader:1419:15) at finalizeEsmResolution (node:internal/modules/cjs/loader:1408:15) at resolveExports (node:internal/modules/cjs/loader:650:14) ... code: 'MODULE_NOT_FOUND'
Expected: module loads successfully, exactly as in 0.0.8.
Version 0.0.8 ships with dist/vw.js, dist/vwnode.js, dist/vwbrowser.js and dist/vw-wasm.js, so this is a regression introduced in the 0.0.9 release pipeline (the TS transpilation step appears to have been skipped before publish).
How to reproduce
mkdir vw-repro && cd vw-repro
npm init -y
npm install @vowpalwabbit/[email protected]
node -e "require('@vowpalwabbit/vowpalwabbit')"Version
@vowpalwabbit/vowpalwabbit 0.0.9 (npm package)
OS
Linux
Language
JavaScript / TypeScript (Node.js wasm package)
Additional context
No response
Source: VowpalWabbit/vowpal_wabbit