Open Michael-F-Bryan opened 2 years ago
Thank you! I will have a look at this over the weekend. The package itself and the code changes are fine, I'm super unsure about how to best publish this. I think if this ends up in the package I might as well bite the bullet and publish this to wapm.
I'm super unsure about how to best publish this
The easiest way to publish Rust packages to WAPM is with the cargo wapm
subcommand. It's a thin wrapper around the wapm
CLI which uses information from your Cargo.toml
to figure out how to build your crate and generate the wapm.toml
file.
Otherwise, you can publish to WAPM directly by following these instructions.
I also wrote up an explanatory blog post about how publishing to WAPM via the wapm
CLI and cargo wapm
works.
This PR fixes #39 by introducing a
wasm
crate which exposes a simplified version ofsimilar
's API to WebAssembly. The simplified API is defined inwasm/similar.wit
and can be used bywit-bindgen
to generate bindings for various other languages.The code is fairly straightforward, although we needed to pull in
ouroboros
so the text being diffed and its results could be stored in the same'static
struct (TextDiff
).For now, I've published the package to wapm.dev under
Michael-F-Bryan/similar
, but that can be changed by updating thenamespace = "..."
bit inwasm/Cargo.toml
.I also added a CI job to automatically publish a new version to WAPM whenever a tagged commit is pushed to this repo. It might be useful if forgetting to publish to WAPM is a concern, otherwise we can easily remove
.github/workflows/releases.yml
.