rumoca 0.7.28

Modelica compiler written in RUST
Documentation
[package]
name = "rumoca"
version = "0.7.28"
edition = "2024"
description = "Modelica compiler written in RUST"
license = "Apache-2.0"
repository = "https://github.com/cognipilot/rumoca"
homepage = "https://github.com/cognipilot/rumoca"
documentation = "https://docs.rs/rumoca"
keywords = ["modelica", "compiler", "dae", "simulation"]
categories = ["compilers", "science", "simulation"]
readme = "README.md"
default-run = "rumoca"
exclude = [
    "editors/",
    "bindings/",
    "examples/",
    ".github/",
    "docs/",
    "tools/",
    "*.swp",
]

[dependencies]
# Core dependencies (WASM compatible)
anyhow = "1.0"
chksum-md5 = "0.1.0"
git-version = "0.3.9"
indexmap = { version = "2.7.1", features = ["serde"] }
miette = { version = "7.4.0", features = ["fancy"] }
minijinja = { version = "2.8.0", features = ["json"] }
owo-colors = "4.0"
parol_runtime = "4.1.0"
serde = { version = "1.0.218", features = ["derive"] }
serde_json = "1.0"
toml = "0.8"
thiserror = "2.0"
scnr2 = "0.3.3"

# Parallel parsing (core dependency - works in WASM with wasm-bindgen-rayon)
rayon = "1.10"
num_cpus = "1.16"

# LSP types (WASM compatible - used by both native LSP and WASM)
# Non-optional because it's just types with no runtime cost
lsp-types = "0.97"

# WASM target dependencies (automatically included when targeting wasm32)
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "0.2"
wasm-bindgen-rayon = "1.3"
wasm-bindgen-futures = "0.4"
js-sys = "0.3"
web-sys = { version = "0.3", features = ["Window", "console"] }
getrandom = { version = "0.3", features = ["wasm_js"] }
getrandom_02 = { package = "getrandom", version = "0.2", features = ["js"] }
# web-time provides Instant::now() polyfill for WASM
web-time = "1.1"

# Native-only dependencies (automatically excluded on WASM)
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
# CLI dependencies
clap = { version = "4.5.31", features = ["derive"], optional = true }
env_logger = { version = "0.11", optional = true }
# LSP server dependencies (requires stdio/TCP)
lsp-server = { version = "0.7", optional = true }
notify = { version = "6.1", optional = true }
crossbeam-channel = { version = "0.5", optional = true }
# Python bindings
pyo3 = { version = "0.27", features = ["extension-module"], optional = true }
# Fast memory allocator
mimalloc = { version = "0.1", default-features = false, optional = true }
# AST caching (requires filesystem)
bincode = { version = "1.3", optional = true }
dirs = { version = "5.0", optional = true }

[features]
default = ["cli", "lsp", "cache", "allocator"]
cli = ["clap", "env_logger"]
# Full LSP: includes server protocol (NOT WASM compatible)
# lsp-types is always available since it's a non-optional dependency
lsp = ["lsp-server", "notify", "crossbeam-channel"]
cache = ["bincode", "dirs"]
allocator = ["mimalloc"]
python = ["pyo3"]
regen-parser = []

[lib]
name = "rumoca"
# rlib: for pure Rust library usage
# cdylib: for WASM (wasm-pack) and Python (maturin)
crate-type = ["cdylib", "rlib"]

[[bin]]
name = "rumoca"
path = "src/main.rs"
required-features = ["cli"]

[[bin]]
name = "rumoca-lsp"
path = "src/bin/rumoca_lsp.rs"
required-features = ["cli", "lsp"]

[[bin]]
name = "rumoca-fmt"
path = "src/bin/rumoca_fmt.rs"
required-features = ["cli"]

[[bin]]
name = "rumoca-lint"
path = "src/bin/rumoca_lint.rs"
required-features = ["cli"]

[[example]]
name = "basic_usage"
path = "examples/rust/basic_usage.rs"

[[example]]
name = "file_compilation"
path = "examples/rust/file_compilation.rs"

[dev-dependencies]
rand = "0.8"
regex = "1.10"
tempfile = "3.23.0"

[build-dependencies]
parol = "4.2.1"

# For faster builds.
[profile.dev.build-override]
opt-level = 3
[profile.release.build-override]
opt-level = 3

# WASM-pack configuration - disable wasm-opt as it strips threading support
# See: https://github.com/nicksenger/wasm-rayon
[package.metadata.wasm-pack.profile.release]
wasm-opt = false

[package.metadata.wasm-pack.profile.dev]
wasm-opt = false