rustledger 0.20.2

Drop-in replacement for Beancount. Pure Rust, 10-30x faster.
Documentation
[package]
name = "rustledger"
description = "Drop-in replacement for Beancount. Pure Rust, 10-30x faster."
version = "0.20.2"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
keywords.workspace = true
categories.workspace = true
authors.workspace = true
readme = "../../README.md"
default-run = "rledger"

[lib]
bench = false

[features]
default = ["python-plugin-wasm"]
# `mimalloc` global allocator for the `rledger` binary (see src/bin/rledger.rs):
# ~7% lower load instruction count. **Opt-in, NOT default** — default features
# apply to library consumers too, and the `rustledger` lib is published to
# crates.io, so a default would force a vendored C dependency (+ a C toolchain)
# onto every embedder. Enable it for the binary with `--features mimalloc`
# (the release builds do; see release-build.yml). Never on wasm.
mimalloc = ["dep:mimalloc"]
# Heap-profiling harness (`examples/profile_pipeline` + the nightly `profile.yml`
# workflow). Off by default; pulls the optional `dhat` dep and installs its
# global allocator in the example. Never enabled for the shipped binary.
dhat-heap = ["dep:dhat"]
# CPU flamegraph harness (`examples/flamegraph_pipeline` + the nightly
# `profile.yml`). Off by default; pulls the optional `pprof` dep. Never shipped.
flamegraph = ["dep:pprof"]
# Enable Python plugin support via WASM sandbox (adds ~30s to build time).
# This allows running existing Python beancount plugins, the WASM importer
# loader, and the directive-plugin runtime — all of which pull `wasmtime`
# (→ `cranelift-codegen`). Off via `--no-default-features` for a slim native
# binary that builds where cranelift can't (e.g. Termux/aarch64); see #1427.
python-plugin-wasm = [
    "rustledger-plugin/python-plugins",
    "rustledger-importer/wasm-importer",
    "rustledger-loader/wasm-plugins",
    "rustledger-loader/python-plugins",
]
# Agent-native CLI (#1291). Pulls in the async/agent-only dependencies
# (`agcli`, `tokio`) so the synchronous `rledger` CLI/lib don't carry them by
# default. Required to build the `ag-rledger` binary and to run its
# integration test (`tests/ag_rledger_test.rs`).
ag-rledger = ["dep:agcli", "dep:tokio"]

# Primary binary - unified CLI with subcommands
[[bin]]
name = "rledger"
path = "src/bin/rledger.rs"

# Agent-native CLI (#1291). Separate binary; keeps `rledger` synchronous.
# Gated behind the `ag-rledger` feature so the async deps (agcli/tokio) are
# only pulled when this binary is actually built.
[[bin]]
name = "ag-rledger"
path = "src/bin/ag-rledger.rs"
required-features = ["ag-rledger"]

[dependencies]
# Agent-native CLI deps (#1291), enabled only by the `ag-rledger` feature so
# the sync `rledger` CLI/lib don't carry the async runtime by default.
agcli = { workspace = true, optional = true }
tokio = { workspace = true, features = ["macros", "rt"], optional = true }
# Heap profiling, only under the `dhat-heap` feature (see examples/profile_pipeline.rs).
dhat = { workspace = true, optional = true }
# CPU flamegraph profiling, only under the `flamegraph` feature (see examples/flamegraph_pipeline.rs).
pprof = { workspace = true, optional = true }
# Global allocator for the `rledger` binary (default-on `mimalloc` feature).
mimalloc = { version = "0.1", optional = true }
rustledger-core.workspace = true
rustledger-parser.workspace = true
rustledger-loader.workspace = true
rustledger-booking.workspace = true
rustledger-validate.workspace = true
rustledger-query.workspace = true
# Both default to their wasmtime-free feature set (rustledger-plugin's workspace
# entry is default-features = false; rustledger-importer's `default` is empty).
# `python-plugin-wasm` re-enables `rustledger-plugin/python-plugins` and
# `rustledger-importer/wasm-importer`; the CLI's base build uses only the
# wasmtime-free APIs (`convert`/`types`) and gates the plugin-runtime + WASM
# importer paths behind that feature. See #1427.
rustledger-plugin.workspace = true
rustledger-ops.workspace = true
rustledger-importer.workspace = true
clap.workspace = true
clap_complete.workspace = true
clap_complete_nushell.workspace = true
rustyline.workspace = true
dirs.workspace = true
edit.workspace = true
shell-words.workspace = true
serde.workspace = true
serde_json.workspace = true
toml.workspace = true
miette.workspace = true
anyhow.workspace = true
rust_decimal.workspace = true
format_num_pattern.workspace = true
glob.workspace = true
jiff.workspace = true
ureq.workspace = true
sha2.workspace = true

[dev-dependencies]
rust_decimal_macros.workspace = true
criterion.workspace = true
tempfile.workspace = true
insta.workspace = true
# WAT (WebAssembly text format) — used by extract_cmd integration
# tests to author tiny .wasm fixtures for build_registry coverage
# without checking compiled binaries into the repo.
wat = { workspace = true }

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

# Baseline for the v0.16.0 perf-sensitive paths. Not wired into PR CI — too
# heavy at 100k. Run locally before/after structural changes.
[[bench]]
name = "v016_baseline"
harness = false

[lints]
workspace = true

[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/rustledger-v{ version }-{ target }.tar.gz"
pkg-fmt = "tgz"
bin-dir = "{ bin }{ binary-ext }"

[package.metadata.binstall.overrides.x86_64-pc-windows-msvc]
pkg-url = "{ repo }/releases/download/v{ version }/rustledger-v{ version }-{ target }.zip"
pkg-fmt = "zip"

[package.metadata.binstall.overrides.aarch64-pc-windows-msvc]
pkg-url = "{ repo }/releases/download/v{ version }/rustledger-v{ version }-{ target }.zip"
pkg-fmt = "zip"