automerge/rust/automerge-wasm/Cargo.toml
Alex Good 0ab6a770d8 wasm: improve error messages
The error messages produced by various conversions in `automerge-wasm`
were quite uninformative - often consisting of just returning the
offending value with no description of the problem. The logic of these
error messages was often hard to trace due to the use of `JsValue` to
represent both error conditions and valid values - evidenced by most of
the public functions of `automerge-wasm` having return types of
`Result<JsValue, JsValue>`. Change these return types to mention
specific errors, thus enlisting the compilers help in ensuring that
specific error messages are emitted.
2022-12-02 14:42:55 +00:00

61 lines
1.6 KiB
TOML

# You must change these to your own details.
[package]
name = "automerge-wasm"
description = "An js/wasm wrapper for the rust implementation of automerge-backend"
repository = "https://github.com/automerge/automerge-rs"
version = "0.1.0"
authors = ["Alex Good <alex@memoryandthought.me>","Orion Henry <orion@inkandswitch.com>", "Martin Kleppmann"]
categories = ["wasm"]
readme = "README.md"
edition = "2021"
license = "MIT"
rust-version = "1.57.0"
[lib]
crate-type = ["cdylib","rlib"]
bench = false
[features]
# default = ["console_error_panic_hook", "wee_alloc"]
default = ["console_error_panic_hook"]
[dependencies]
console_error_panic_hook = { version = "^0.1", optional = true }
# wee_alloc = { version = "^0.4", optional = true }
automerge = { path = "../automerge", features=["wasm"] }
js-sys = "^0.3"
serde = "^1.0"
serde_json = "^1.0"
rand = { version = "^0.8.4" }
getrandom = { version = "^0.2.2", features=["js"] }
uuid = { version = "^1.2.1", features=["v4", "js", "serde"] }
serde-wasm-bindgen = "0.4.3"
serde_bytes = "0.11.5"
hex = "^0.4.3"
regex = "^1.5"
itertools = "^0.10.3"
thiserror = "^1.0.16"
[dependencies.wasm-bindgen]
version = "^0.2.83"
#features = ["std"]
features = ["serde-serialize", "std"]
[package.metadata.wasm-pack.profile.release]
# wasm-opt = false
[package.metadata.wasm-pack.profile.profiling]
wasm-opt = false
# The `web-sys` crate allows you to interact with the various browser APIs,
# like the DOM.
[dependencies.web-sys]
version = "0.3.22"
features = ["console"]
[dev-dependencies]
futures = "^0.1"
wasm-bindgen-futures = "^0.4"
wasm-bindgen-test = "^0.3"