8000 ci: consumer-test both npm packages, before tagging and after publishing by adityamukho · Pull Request #7 · project-minigraf/minigraf-wasm · GitHub
[go: up one dir, main page]

Skip to content

ci: consumer-test both npm packages, before tagging and after publishing - #7

Merged
adityamukho merged 1 commit into
mainfrom
ci/consumer-tests
Oct 21, 2026
Merged

adityamukho merged 1 commit into
mainfrom
ci/consumer-tests

Conversation

@adityamukho
Copy link
Copy Markdown
Contributor

Step 6 of the binding consumer tests plan (minigraf docs/superpowers/plans/2026-10-20-binding-consumer-tests.md).

What

  • package.yml builds dist-browser (wasm-pack, stamped name/version/description, plus licenses) and dist-wasi (core REPL for wasm32-wasip1 at core-ref, npm test, licenses). It checks the file list of each tarball.
  • consumer-test/run.sh <browser|wasi> local <dist> <version> | <browser|wasi> registry <version> installs the package into an empty project, checks both license files, then:
    • browser: a static page loads @minigraf/browser through an import map (no bundler) in headless Chromium (Playwright 1.55.0, a small node:http server). It runs the README quick start, then the contract: installed version, an in-memory transact and query, an error rejection, and an IndexedDB database written and read back across page.reload().
    • wasi: the README quick start (repl.mjs), run with the README's printf … | node repl.mjs line, then the contract: installed version, transact and query, and an error with its [XXX-NNN] code. Runs on Linux, macOS and Windows.
  • ci.yml: the package, consumer and readme-sync jobs replace the two build-only jobs. readme-sync checks the browser and WASI sections of README.md and wasi-pkg/README.md. readme_sync.py gets an optional heading argument for that.
  • release.yml: test passes version. One matrix publish job runs npm publish on the tested tarball and skips a version that's already on npm, as Node does. verify-published runs after it.
  • verify-published.yml: a registry-mode matrix plus the release-broken report job.

Fixes found by the test (both 2.0.8 packages)

  • Neither tarball shipped LICENSE-MIT or LICENSE-APACHE.
  • The @minigraf/browser description was "wasm-pack build shim for Minigraf browser and WASI targets".
  • The README's WASI snippet called instantiateMinigrafWasiWith and pointed at "the instance exports", but the package is the REPL binary. It now uses startMinigrafWasi, as the package README does, and says the REPL reads stdin. Both READMEs drop the /tmp preopen, which the binary never uses (on Windows the path doesn't exist).

Locally, against npm 2.0.8, both packages pass everything except the license check.

Deviations from the plan

  • No file-backed WASI run. On main and v3, the WASI binary is Minigraf::in_memory() plus the REPL; it reads no --file and no preopen. There's nothing to reopen, which contract.mjs notes.
  • A node:http server instead of npx http-server, so there's no extra download, and it serves .wasm as application/wasm.
  • The browser error check is weaker for now. BrowserDb rejects with the message but without the error code (Unknown command: nosuchcommand), unlike every other API. Filed as BrowserDb errors have no error code minigraf#673. The check requires a string rejection with the message, and becomes strict once the pinned core has the fix.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz

package.yml builds the @minigraf/browser and @minigraf/wasi tarballs exactly
as the release publishes them. ci.yml installs each into an empty project and
runs its README quick start and the consumer contract: the browser package in
headless Chromium (Playwright) with an IndexedDB reload, the WASI package
under node:wasi on Linux, macOS and Windows. The release tests these tarballs
at the release version and publishes exactly them; verify-published.yml
installs the published versions from npm afterwards and opens a
release-broken issue on failure.

Fixes found by the test: both packages now ship LICENSE-MIT and
LICENSE-APACHE; @minigraf/browser gets a real description instead of
"wasm-pack build shim"; the README's WASI snippet uses startMinigrafWasi
(the package is the REPL binary, not a library) and drops the /tmp preopen
the binary never uses.

readme_sync.py takes an optional heading, since this README covers two
packages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz
@adityamukho
adityamukho merged commit 3c96a20 into main Oct 21, 2026
7 checks passed
@adityamukho
adityamukho deleted the ci/consumer-tests branch October 21, 2026 04:33
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.

1 participant

0