dixscript 1.0.0

Config, code, and encryption in one file — a data interchange format with compile-time functions, AES-256/ChaCha20 built-in, and cross-platform FFI
Documentation
[package]
name = "dixscript"
version = "1.0.0"
edition = "2021"
rust-version = "1.85"
authors = ["MidManStudio"]
description = "Config, code, and encryption in one file — a data interchange format with compile-time functions, AES-256/ChaCha20 built-in, and cross-platform FFI"
license = "MIT"
readme = "README.md"
repository = "https://github.com/Mid-D-Man/DixScript-Rust"
keywords = ["config", "encryption", "serialization", "data-format", "gamedev"]
categories = ["config", "parser-implementations", "encoding", "data-structures", "cryptography"]
homepage = "https://dixscript-docs.pages.dev"
# Consumers of the crate never need any of this: dev-dependencies (criterion
# for benches, proptest/fuzz harnesses) only apply to these directories, and
# CI config is irrelevant once published. examples/ is deliberately NOT
# excluded -- it's what renders on docs.rs and what `cargo run --example`
# needs.
exclude = [
    "benches/",
    "tests/",
    "fuzz/",
    ".github/",
]

[lib]
name = "dixscript"
crate-type = ["lib"]

[dependencies]
rand       = { version = "0.8", features = ["getrandom"] }
uuid       = { version = "1.0", features = ["v4", "serde", "js"] }
chrono     = { version = "0.4", features = ["serde", "wasmbind"] }
# std::time::Instant::now() panics ("time not implemented on this platform")
# on wasm32-unknown-unknown. web-time is a drop-in replacement: std passthrough
# on native, Performance.now() (via js-sys) on wasm32. Duration is untouched —
# only Instant needed swapping. See the 8 `use web_time::Instant;` call sites.
web-time   = "1.1"
bitflags   = "2.4"

serde      = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
toml       = "0.8"

phf         = { version = "0.11", features = ["macros"] }
memchr      = "2.7"
base64      = "0.21"
regex       = "1.10"
itertools   = "0.13"
lazy_static = "1.4"
unicase     = "2.7"
rustc-hash  = "2.0"

sha2 = "0.10"

flate2           = { version = "1.0", default-features = false, features = ["rust_backend"] }
aes-gcm          = "0.10"
chacha20poly1305 = "0.10"
argon2           = "0.5"
hex              = "0.4"

# ── Cloud import deps ──────────────────────────────────────────────────────────
# Both optional — activated via the `cloud-import` feature (on by default).
# can opt out with  default-features = false  in their dependency declaration.

async-trait = "0.1"
url         = "2.5"

# --- Compression backends ──────────────────────────────────────────────────────────
bzip2       = { version = "0.6", optional = true }
# lzma-rust2: real LZMA2/XZ codec (ported from tukaani's xz-for-java), not a
# liblzma C binding. Zero non-Rust deps (only optional pure-Rust `sha2` for
# the XZ integrity checksum). `optimization` is deliberately left off — it's
# sound per upstream, but disabling it guarantees 100% safe standard Rust
# with zero hand-written-asm surface across every target, which matters more
# here than the speed it buys back on x86_64/aarch64 hosts.
lzma-rust2  = { version = "0.16", default-features = false, features = ["std", "encoder", "xz"], optional = true }

# ── Non-WASM native deps ───────────────────────────────────────────────────────
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
# Optional: only pulled in when `rayon-support` is enabled (on by default).
# Used in exactly three places — general_parser.rs's section-level parsing,
# and binary_packer.rs/binary_unpacker.rs's section-level (de)serialization —
# all three already had a sequential fallback for wasm32 before this feature
# existed; the feature just extends that same fallback to any native build
# that wants to opt out too (smaller binary, no thread-pool spin-up, fully
# deterministic single-threaded execution for debugging).
rayon    = { version = "1.8", optional = true }
hostname = "0.3"
reqwest  = { version = "0.11", default-features = false, features = ["json", "rustls-tls"], optional = true }
# tokio: trimmed from "full" to only the runtime features actually used
# (rt-multi-thread for block_on, macros for #[tokio::main] if needed, fs + time for
# the cloud download path).  "full" pulled in every tokio sub-crate unnecessarily.
tokio    = { version = "1", features = ["rt-multi-thread", "macros", "fs", "time"], optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2", features = ["js"] }
# Only used by CloudFileCache's localStorage backend — Window to reach
# `window.localStorage`, Storage for the get/set/remove/key/length calls.
# Not the whole web-sys surface, just these two, to keep the wasm binary lean.
web-sys   = { version = "0.3", features = ["Window", "Storage"] }

# Bench/test-only deps. Gated off wasm32 on purpose: criterion pulls in
# rayon (one of its default features) plus a pile of native-only tooling
# (walkdir, is-terminal, plotters, ...) that has no business resolving
# against a wasm32 target.  Nothing in CI currently runs
# `cargo bench`/`cargo test --benches` against wasm32 — the wasm job only
# does `wasm-pack build mdix-wasm`, which never touches dev-dependencies —
# but this makes that guarantee explicit at the manifest level instead of
# relying on nobody ever running a broad `--workspace --all-targets
# --target wasm32-unknown-unknown` check.
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
criterion  = { version = "0.5", features = ["html_reports"] }
tempfile   = "3.10"
bincode    = "1.3"
rmp-serde  = "1.1"
postcard   = { version = "1.0", features = ["alloc"] }
ciborium   = "0.2"

[[bench]]
name    = "format_comparison_benchmark"
harness = false
[[bench]]
name    = "throughput_benchmark"
harness = false
[[bench]]
name    = "lexer_throughput"
harness = false
[[bench]]
name    = "config_throughput"
harness = false
[[bench]]
name    = "stress_test_benchmark"
harness = false
[[bench]]
name    = "general_parser_benchmark"
harness = false
[[bench]]
name    = "semantics_benchmark"
harness = false
[[bench]]
name    = "ast_enhancement_benchmark"
harness = false
[[bench]]
name    = "value_resolution_benchmark"
harness = false
[[bench]]
name    = "binary_serialization_benchmark"
harness = false
[[bench]]
name    = "runtime_benchmark"
harness = false

# ── Feature flags ──────────────────────────────────────────────────────────────
# Default pulls in everything — existing consumers (desktop, CI, mdix-cli,
# mdix-lsp, mdix-ffi) get identical behaviour with no changes to their
# dependency declarations.
#
# To build without cloud or compression deps (e.g. mxross-brush-lua):
#   dixscript = { path = "...", default-features = false }
#
# To restore just one group:
#   dixscript = { path = "...", default-features = false, features = ["cloud-import"] }
[features]
default        = ["cloud-import", "bzip2-support", "xz-support", "rayon-support"]
cloud-import   = ["dep:reqwest", "dep:tokio"]
bzip2-support  = ["dep:bzip2"]
xz-support     = ["dep:lzma-rust2"]
rayon-support  = ["dep:rayon"]