node-motoko
node-motoko copied to clipboard
Groundwork for WASI debugging
This PR adapts the logic from this WASI polyfill file for a headless Node.js environment.
Progress:
- [x] Refactor to TypeScript
- [x] Decouple Wasm functionality from user interface
- [x] Expose
hexdump()andshow()functions - [x] Allow custom handling of
debug_printoutput - [x] Run WASI modules from a file for quick testing (creating
tests/wasm/Debug.test.wasmwill activate another unit test)
Future work:
- [ ] Source maps?
- [ ] JS return value?
- [ ] Breakpoints?
- [ ] Stack inspection?
size-limit report 📦
| Path | Size |
|---|---|
| lib/index.js | 15.3 KB (+13.05% 🔺) |
| packages/latest/base.json | 87.82 KB (0%) |
| versions/latest/moc.min.js | 487.72 KB (0%) |
| versions/latest/moc_interpreter.min.js | 280.9 KB (0%) |
| versions/latest/didc.min.js | 60.46 KB (0%) |