[package]
name = "kcl-lib"
description = "KittyCAD Language implementation and tools"
version = "0.2.116"
edition = "2024"
license = "MIT"
repository = "https://github.com/KittyCAD/modeling-app"
authors = ["Jess Frazelle", "Adam Chalmers", "KittyCAD, Inc"]
keywords = ["kcl", "KittyCAD", "CAD"]
exclude = [
    "tests/*",
    "benches/*",
    "examples/*",
    "e2e/*",
    "bindings/*",
    "fuzz/*",
]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
bench = false

[[bin]]
name = "kcl-lib-bin"
path = "src/main.rs"
bench = false

[features]
default = ["cli", "engine"]
artifact-graph = []
benchmark-execution = []
cli = ["dep:clap", "kittycad/clap"]
dhat-heap = ["dep:dhat"]
# For the lsp server, when run with stdout for rpc we want to disable println.
# This is used for editor extensions that use the lsp server.
disable-println = []
engine = []
pyo3 = ["dep:pyo3", "dep:pyo3-stub-gen"]
# Helper functions also used in benchmarks.
lsp-test-util = []
tabled = ["dep:tabled"]

[dependencies]
ahash = { workspace = true }
anyhow = { workspace = true, features = ["backtrace"] }
async-recursion = "1.1.1"
async-trait = { workspace = true }
base64 = "0.22.1"
chrono = "0.4.42"
clap = { version = "4.5.53", default-features = false, optional = true, features = [
  "std",
  "derive",
] }
convert_case = "0.10.0"
csscolorparser = "0.8.1"
dashmap = { workspace = true }
dhat = { version = "0.3", optional = true }
fnv = "1.0.7"
form_urlencoded = "1.2.2"
futures = { version = "0.3.31" }
git_rev = "0.1.0"
gltf-json = "1.4.1"
http = { workspace = true }
image = { version = "0.25.9", default-features = false, features = ["png"] }
indexmap = { workspace = true, features = ["serde", "rayon"] }
itertools = "0.14.0"
kcl-derive-docs = { version = "0.1", path = "../kcl-derive-docs" }
kcl-error = { version = "0.1", path = "../kcl-error" }
kcl-ezpz = { workspace = true }
kittycad = { workspace = true }
kittycad-modeling-cmds = { workspace = true }
lazy_static = { workspace = true }
libm = "0.2.15"
measurements = "0.11.1"
miette = { workspace = true }
mime_guess = "2.0.5"
nalgebra-glm = "0.20.0"
parse-display = "0.10.0"
pyo3 = { workspace = true, optional = true }
pyo3-stub-gen = { workspace = true, optional = true }
rayon = { workspace = true }
regex = "1.12.2"
reqwest = { version = "0.12", default-features = false, features = [
  "stream",
  "rustls-tls",
] }
rgba_simple = "0.10.0"
rmp-serde = { workspace = true }
ropey = "1.6.1"
schemars = { version = "0.8.17", features = [
  "impl_json_schema",
  "indexmap2",
  "url",
  "uuid1",
  "preserve_order",
] }
serde = { workspace = true }
serde_json = { workspace = true }
sha2 = "0.10.9"
tabled = { version = "0.20.0", optional = true }
tempfile = "3.23"
thiserror = "2.0.17"
toml = "0.9.8"
ts-rs = { version = "11.1.0", features = [
  "uuid-impl",
  "url-impl",
  "chrono-impl",
  "indexmap-impl",
  "no-serde-warnings",
  "serde-json-impl",
] }
tynm = "0.2.0"
url = { version = "2.5.7", features = ["serde"] }
uuid = { workspace = true, features = ["v4", "v5", "js", "serde"] }
validator = { version = "0.20.0", features = ["derive"] }
walkdir = "2.5.0"
web-time = "1.1"
winnow = "0.7"
zip = { workspace = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { workspace = true, features = ["full"] }
tokio-tungstenite = { version = "0.28.0", features = [
  "rustls-tls-native-roots",
] }
tower-lsp = { workspace = true, features = ["proposed", "default"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = { workspace = true }
futures-lite = "2.6.1"
js-sys = { version = "0.3.72" }
tokio = { workspace = true, features = ["sync", "time"] }
tower-lsp = { workspace = true, features = ["runtime-agnostic"] }
typed-path = "0.12.0"
wasm-bindgen = "0.2.99"
wasm-bindgen-futures = "0.4.49"
wasm-timer = { package = "zduny-wasm-timer", version = "0.2.5" }
web-sys = { version = "0.3.76", features = ["console"] }

[dev-dependencies]
approx = "0.5"
base64 = "0.22.1"
criterion = { version = "0.8.0", features = ["async_tokio"] }
expectorate = "1.2.0"
handlebars = "6.3.2"
image = { version = "0.25.9", default-features = false, features = ["png"] }
insta = { version = "1.44.3", features = ["json", "filters", "redactions"] }
kcl-directory-test-macro = { version = "0.1", path = "../kcl-directory-test-macro" }
miette = { version = "7.6.0", features = ["fancy"] }
pretty_assertions = "1.4.1"
tokio = { version = "1.48.0", features = ["rt-multi-thread", "macros", "time"] }
twenty-twenty = "0.8.3"

[lints]
workspace = true

[[bench]]
name = "compiler_benchmark_criterion"
harness = false

[[bench]]
name = "digest_benchmark"
harness = false

[[bench]]
name = "lsp_semantic_tokens_benchmark_criterion"
harness = false
required-features = ["lsp-test-util"]

[[bench]]
name = "benchmark_kcl_samples"
harness = false

[[test]]
name = "executor"
path = "e2e/executor/main.rs"
required-features = ["engine"]
