A minimal project demonstrating JSON Web Proof (JWP) logic in Rust, exposed via JavaScript/TypeScript bindings. This setup is based on the json-proof-token repository.
- Rust: Install from rustup.rs. Make sure you have the
wasm32-unknown-unknown
target installed:rustup target add wasm32-unknown-unknown
- Bun (optional): Install from bun.sh.
- Package manager (recommended): @antfu/ni
Or feel free to use
npm i -g @antfu/ni
npm
,pnpm
, oryarn
.
-
Build:
nr build
(Compiles the Rust code to WASM and bundles the JS.)
-
Test:
nr test
This runs Rust tests first, then JavaScript tests.
-
Check (format & lint):
nr check
- Write and run Rust tests in
src/*.rs
(or thetests
module). - Use
nr build
to rebuild the WASM package. - Write and run JavaScript tests in
test/*.test.ts
. - Once everything passes, we can publish
nr build && npm publish
.
Happy coding!