tauri-plugin-midi 0.3.0

A WebMIDI-compatible plugin for Tauri
docs.rs failed to build tauri-plugin-midi-0.3.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: tauri-plugin-midi-0.3.1

tauri-plugin-midi

A Tauri plugin designed to emulate the WebMIDI API.

Documentation

Contributing

To run the example:

pnpm i
pnpm build

cd example/
pnpm tauri dev

To run the tests:

pnpm i
pnpm test

pnpm test bundles the Web MIDI polyfill and drives it against a fake Tauri IPC layer, so the polyfill's behaviour can be asserted from Node.

Releasing

Publishing to crates.io uses crates.io trusted publishing: the release workflow exchanges its GitHub OIDC identity for a short-lived crates.io token, so no long-lived CARGO_REGISTRY_TOKEN is stored in this repository or in Actions secrets.

One-time setup — a crate owner adds a trusted publisher in the crates.io UI (the crate's Settings → Trusted Publishing). These values must match .github/workflows/release.yml exactly, or the token exchange is refused:

Field Value
Owner specta-rs
Repository tauri-plugin-midi
Workflow filename release.yml
Environment release

Adding required reviewers to the release GitHub environment is recommended: it turns publishing into an approved action rather than something any tag push does.

Cutting a release:

  1. Bump version in Cargo.toml, add a CHANGELOG.md entry, and merge both to main.

  2. Tag the merge commit and push the tag:

    git tag v0.3.0
    git push origin v0.3.0
    

The release workflow then verifies the release (the tag matches Cargo.toml; src/polyfill.js and guest-js/bindings.ts regenerate without changes; the JS and Rust tests pass), publishes to crates.io, and creates the GitHub release.

Iframe support

Web MIDI works in same-origin iframes; the plugin injects its polyfill into every frame and bridges a subframe's calls to the top frame. Because that bridge depends on how the webview serialises the Tauri custom-scheme origin — which cannot be tested from Node — it has a manual check: example/iframe-check.html plus example/IFRAME-CHECKLIST.md.