Skip to content

Commit 46d43d0

Browse files
committed
Add wasm+npm package
This lets us compile the lib into wasm and adds a npm wrapper package for it I had to rearrange the code slightly to split out any methods using wasm incompatible types. Not sure if there's a better way to do this
1 parent 4b41c26 commit 46d43d0

7 files changed

Lines changed: 3989 additions & 45 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ Cargo.lock
33
/crates/*/target/
44
/crates/*/Cargo.lock
55
.vscode/
6+
.DS_Store

crates/string-offsets/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
pkg
3+

crates/string-offsets/Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ license = "MIT"
99
keywords = ["unicode", "positions", "utf16", "characters", "lines"]
1010
categories = ["algorithms", "data-structures", "text-processing", "development-tools::ffi"]
1111

12+
[lib]
13+
crate-type = ["cdylib", "rlib"]
14+
15+
[dependencies]
16+
wasm-bindgen = "0.2"
17+
1218
[dev-dependencies]
1319
rand = "0.8"
14-
rand_chacha = "0.3"
20+
rand_chacha = "0.3"

0 commit comments

Comments
 (0)