[package]
name = "wasm-lib"
version = "0.1.0"
edition = "2021"
repository = "https://github.com/KittyCAD/modeling-app"
rust-version = "1.83"

[lib]
crate-type = ["cdylib"]

[dependencies]
bson = { version = "2.13.0", features = ["uuid-1", "chrono"] }
data-encoding = "2.6.0"
gloo-utils = "0.2.0"
kcl-lib = { path = "kcl" }
kittycad.workspace = true
lazy_static = "1.5.0"
serde_json = "1.0.138"
tokio = { version = "1.41.1", features = ["sync"] }
toml = "0.8.19"
uuid = { version = "1.11.0", features = ["v4", "js", "serde"] }
wasm-bindgen = "0.2.99"
wasm-bindgen-futures = "0.4.49"

[dev-dependencies]
anyhow = "1"
image = { version = "0.25.5", default-features = false, features = ["png"] }
kittycad = { workspace = true, default-features = true }
kittycad-modeling-cmds = { workspace = true }
pretty_assertions = "1.4.1"
reqwest = { version = "0.12", default-features = false }
tokio = { version = "1.41.1", features = ["rt-multi-thread", "macros", "time"] }
twenty-twenty = "0.8"
uuid = { version = "1.11.0", features = ["v4", "js", "serde"] }

[features]
dhat-heap = ["kcl-lib/dhat-heap"]

[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1.7"
futures = "0.3.31"
js-sys = "0.3.72"
tower-lsp = { version = "0.20.0", default-features = false, features = ["runtime-agnostic"] }
wasm-bindgen-futures = { version = "0.4.44", features = ["futures-core-03-stream"] }
wasm-streams = "0.4.2"

[target.'cfg(target_arch = "wasm32")'.dependencies.web-sys]
version = "0.3.76"
features = [
  "console",
  "HtmlTextAreaElement",
  "ReadableStream",
  "WritableStream",
]

[profile.release]
panic = "abort"
debug = true

[profile.dev]
debug = 0

[profile.dev.package]
insta.opt-level = 3
similar.opt-level = 3

[profile.test]
debug = "line-tables-only"

[workspace]
members = [
	"derive-docs",
	"kcl",
	"kcl-test-server",
	"kcl-to-core",
]

[workspace.dependencies]
http = "1"
kittycad = { version = "0.3.28", default-features = false, features = ["js", "requests"] }
kittycad-modeling-cmds = { version = "0.2.93", features = [
  "ts-rs",
  "websocket",
] }

[workspace.lints.clippy]
assertions_on_result_states = "warn"
dbg_macro = "warn"
iter_over_hash_type = "warn"
lossy_float_literal = "warn"

[[test]]
name = "executor"
path = "tests/executor/main.rs"

[[test]]
name = "modify"
path = "tests/modify/main.rs"

# Example: how to point modeling-api at a different repo (e.g. a branch or a local clone)
#[patch.crates-io]
#kittycad-modeling-cmds = { path = "../../../modeling-api/modeling-cmds" }
#kittycad-modeling-session = { path = "../../../modeling-api/modeling-session" }
