8000 feat: publish WASI build as npm package by adityamukho · Pull Request #222 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

feat: publish WASI build as npm package - #222

Merged
adityamukho merged 8 commits into
mainfrom
issue-178-wasi-npm-package
May 2, 2026
Merged

adityamukho merged 8 commits into
mainfrom
issue-178-wasi-npm-package

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

Summary

  • Adds a dedicated minigraf-wasi/ npm package for @minigraf/wasi with ESM loader, TypeScript declarations, README, and package tests.
  • Adds a publish-npm-wasi release workflow job that builds wasm32-wasip1, stages minigraf-wasi.wasm, stamps the release tag version, tests the package, and publishes to npm.
  • Keeps actual npm publishing tied to the release/tag workflow so it can land before Phase 8 completion: docs sync, version bump, and release publish #133 without publishing early.

Closes #178.

Test Plan

  • npm test in minigraf-wasi/
  • python3 -c "import yaml; yaml.safe_load(open('.github/workflows/wasm-release.yml')); print('valid yaml')"
  • cargo build --target wasm32-wasip1 --release --bin minigraf
  • node --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"
  • Pre-push hook: cargo fmt --check, cargo clippy, cargo test

Note: cargo build --target wasm32-wasip1 --release --bin minigraf currently emits existing WASI dead-code warnings in persistent_facts.rs and wal.rs, but exits successfully.

adityamukho and others added 8 commits May 1, 2026 15:58
…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>
@adityamukho
adityamukho merged commit 649a280 into main May 2, 2026
35 checks passed
@adityamukho
adityamukho deleted the issue-178-wasi-npm-package branch May 2, 2026 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Publish @minigraf/wasi to npm

1 participant

0