Setup Rust, wasm-pack and NodeJS as directed in https://developer.mozilla.org/en-US/docs/WebAssembly/Rust_to_wasm
Installing wasm-pack on windows may be easier via: https://rustwasm.github.io/wasm-pack/installer/
run:
cargo test
to make sure rust is setupcd ./site
npm run build
to wasm-pack for both bundler and nodejs, and compile site's test.ts file with tscnpm run webpack
to test that webpack works with the wasm module and our typescript settingsnpm run test:ts-node
run nodejs via ts-mochanpm run test:node
run node with the compiled js filenpm run serve
serve webpacked data with webpack dev server
To make this all work, we run wasm pack twice and combine the results into one package (workaround for not having rustwasm/wasm-pack#313)
This is done in ./site
's build script.
It deletes the inner package.json (which is unneeded).
Excluding those nested package.json files using gitignore or npmignore does not work.
Deleting these nested package.json files causes the .gitignore in the nested folders to over ride the top level files list, so we delete those as well.
I tried to copy the readme into the cop level package with copyfiles -V ../pkg_combo/bundler/README.md ../pkg_combo/
but that fails to do anything useful:
unglobed path: ../pkg_combo/bundler/README.md
copy from: ../pkg_combo/bundler/README.md
copy to: ../pkg_combo/bundler/README.md
so no package readme for now.
Issues:
cd ./site
- Update version in
Cargo.toml
npm run build
cd ../pkg_combo
- Update version in
pkg_combo\package.json
npm publish
(I recommendnpm publish --dry-run
first)
If you see an error like
npm ERR! code E404
npm ERR! 404 Not Found - PUT https://registry.npmjs.org/uuid-cluster - Not found
npm ERR! 404
npm ERR! 404 '[email protected]' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
This means you need to npm login
.