Repository navigation
feat: publish WASI build as npm package - #222
Merged
Merged
Conversation
…consistency Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… naming Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d env-var note Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…k README note Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced May 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
minigraf-wasi/npm package for@minigraf/wasiwith ESM loader, TypeScript declarations, README, and package tests.publish-npm-wasirelease workflow job that buildswasm32-wasip1, stagesminigraf-wasi.wasm, stamps the release tag version, tests the package, and publishes to npm.Closes #178.
Test Plan
npm testinminigraf-wasi/python3 -c "import yaml; yaml.safe_load(open('.github/workflows/wasm-release.yml')); print('valid yaml')"cargo build --target wasm32-wasip1 --release --bin minigrafnode --input-type=module -e "import { compileMinigrafWasi } from './minigraf-wasi/index.js'; const module = await compileMinigrafWasi({ wasmPath: './target/wasm32-wasip1/release/minigraf.wasm' }); console.log(module instanceof WebAssembly.Module ? 'compiled' : 'not compiled');"node --input-type=module -e "import { WASI } from 'node:wasi'; import { startMinigrafWasi } from './minigraf-wasi/index.js'; const wasi = new WASI({ version: 'preview1', args: ['minigraf'], env: {}, preopens: { '/tmp': '/tmp' } }); await startMinigrafWasi(wasi, { wasmPath: './target/wasm32-wasip1/release/minigraf.wasm' }); console.log('started');"tmpdir=$(mktemp -d /tmp/minigraf-wasi-pack.XXXXXX); cp -R minigraf-wasi/. "$tmpdir"/; cp target/wasm32-wasip1/release/minigraf.wasm "$tmpdir/minigraf-wasi.wasm"; npm_config_cache=/tmp/npm-cache npm pack --dry-run "$tmpdir"cargo fmt --check,cargo clippy,cargo testNote:
cargo build --target wasm32-wasip1 --release --bin minigrafcurrently emits existing WASI dead-code warnings inpersistent_facts.rsandwal.rs, but exits successfully.