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.
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
.