tsrun 0.1.19

A TypeScript interpreter designed for embedding in applications
Documentation
[workspace]
members = ["."]
exclude = ["fuzz"]

[package]
name = "tsrun"
version = "0.1.19"
edition = "2024"
description = "A TypeScript interpreter designed for embedding in applications"
license = "MIT"
repository = "https://github.com/DmitryBochkarev/tsrun"
keywords = ["typescript", "javascript", "interpreter", "embedding"]
categories = ["parser-implementations"]

[lib]
crate-type = ["rlib", "cdylib", "staticlib"]

[[bin]]
name = "tsrun"
path = "src/bin/tsrun.rs"
required-features = ["std"]

[[example]]
name = "profile_parser"
required-features = ["dev-tools"]

[[example]]
name = "test262-runner"
required-features = ["dev-tools"]

[features]
default = ["std"]

# Full std support (current behavior)
std = ["regex", "console", "serde/std", "serde_json/std", "rustc-hash/std"]

# Development tools (profilers, test runners) - not installed by default
dev-tools = ["std"]

# Regex support (requires std due to fancy-regex)
regex = ["dep:fancy-regex"]

# Console builtin (now works with any ConsoleProvider)
console = []

# C API for embedding (no_std compatible)
c-api = []

# WASM exports for all runtimes (browser, wazero, wasmer, wasmtime)
# Uses C-style FFI, host provides platform functions via imports
wasm = ["c-api", "console", "dep:dlmalloc"]

[dependencies]
serde = { version = "1.0", default-features = false, features = ["derive", "alloc"] }
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
indexmap = { version = "2.0", default-features = false, features = ["serde"] }
fancy-regex = { version = "0.17", optional = true }
rustc-hash = { version = "2.1", default-features = false }
hashbrown = { version = "0.15", default-features = false, features = ["default-hasher"] }
libm = "0.2"

# WASM dependencies (optional)
[target.'cfg(target_arch = "wasm32")'.dependencies]
dlmalloc = { version = "0.2", optional = true, features = ["global"] }

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }

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

[lints.clippy]
unwrap_used = "deny"
expect_used = "deny"
indexing_slicing = "deny"
panic = "deny"
unreachable = "deny"
todo = "deny"
unimplemented = "deny"
string_slice = "deny"

[profile.release]
lto = true
codegen-units = 1
opt-level = "z"
strip = true
panic = "abort"

[profile.profiling]
inherits = "release"
debug = true
strip = false

[build-dependencies]
trampoline-parser = { version = "0.1", path = "../trampoline-parser/trampoline-parser" }