[package]
name = "trnovel"
version = "0.10.3"
edition = "2024"
default-run = "trnovel"
description = "Terminal reader for novel"
authors = ["yexiyue <yexiyue666@qq.com>"]
license = "MIT"
keywords = ["CLI", "Terminal", "Novel", "Reader"]
repository = "https://github.com/yexiyue/TRNovel"
homepage = "https://yexiyue.github.io/TRNovel"

[[bin]]
name = "trnovel"
path = "src/bin/main.rs"

[[bin]]
name = "trn"
path = "src/bin/trn.rs"

[dependencies]
async-trait = "0.1"
chrono = { version = "0.4.44", features = ["serde"] }
clap = { version = "4.6", features = ["derive"] }
crossterm = { version = "0.28.1", features = ["event-stream"] }
encoding_rs = { version = "0.8.35", features = ["serde"] }
fancy-regex = "0.18"
md5 = "0.8.0"
parse-book-source = { path = "crates/parse-book-source", version = "0.4.0", features = [
    "browser",
    "js",
] }
ratatui = { version = "0.29.0", features = ["unstable", "serde"] }
throbber-widgets-tui = "0.9.0"
tui-scrollview = "0.5.1"
tui-textarea = "0.7.0"
tui-tree-widget = "0.23.0"
tui-widget-list = "0.13.0"
tui-big-text = "0.7.0"
walkdir = "2.5.0"
anyhow = { workspace = true }
regex = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true }
tokio-util = { workspace = true }
futures = { workspace = true }
dirs = { workspace = true }
ratatui-kit = { version = "0.5.9", features = ["full"] }
# ratatui-kit = { features = [
#     "full",
# ], path = "../ratatui-kit/packages/ratatui-kit" }
textwrap = { version = "0.16.2" }
# 注:rodio 0.22 为音频 API 重构(OutputStreamBuilder / Sink::connect_new / SamplesBuffer·Zero 签名变更),
# 需配合音频实测单独迁移,暂留 0.21.x。
rodio = { version = "0.21.1", default-features = false, features = ["playback", "wav"] }
novel-tts = { path = "crates/novel-tts", version = "0.1.8" }
strum = { version = "0.28", features = ["derive"] }


[workspace]
members = ["crates/novel-tts", "crates/parse-book-source"]
exclude = ["crates/parse-book-source/examples/json"]

[workspace.dependencies]
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.150"
regex = "1.12"
anyhow = "1.0.102"
thiserror = "2.0.18"
tokio = { version = "1.52", features = [
    "fs",
    "macros",
    "rt",
    "rt-multi-thread",
    "sync",
    "time",
] }
tokio-util = "0.7.18"
futures = "0.3.32"
dirs = "6.0.0"

[profile.release]
lto = true
opt-level = 3
panic = "abort"

# The profile that 'dist' will build with
[profile.dist]
inherits = "release"

# Config for 'dist'
[workspace.metadata.dist]
# The preferred dist version to use in CI (Cargo.toml SemVer syntax)
cargo-dist-version = "0.32.0"
# CI backends to support
ci = "github"
# The installers to generate for each app
installers = ["shell", "powershell", "npm", "homebrew"]
# Target platforms to build apps for (Rust target-triple syntax)
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"]
# A namespace to use when publishing this package to the npm registry
npm-scope = "@trnovel"
# Only treat tags prefixed with this namespace as dist releases (keeps the
# workspace library tags like `parse-book-source-v*` from triggering this workflow)
tag-namespace = "trnovel"
# Publish jobs to run in CI (auto-publishes the npm package to the registry; needs NPM_TOKEN secret)
# homebrew needs the `yexiyue/homebrew-tap` repo to exist + a HOMEBREW_TAP_TOKEN secret (PAT with repo scope)
publish-jobs = ["npm", "homebrew"]
# Homebrew tap repository that dist publishes the formula to
tap = "yexiyue/homebrew-tap"
# Path that installers should place binaries in
install-path = "CARGO_HOME"
# Whether to install an updater program
install-updater = false
# 动态链接 Windows C 运行时（默认 true=静态）。ort/onnxruntime 预编译库按动态 CRT 编译，
# 静态链接会导致 __imp_tolower 等符号未解析的 LNK2001 链接错误，故必须设为 false。
msvc-crt-static = false

[workspace.metadata.dist.dependencies.apt]
libasound2-dev = '*'
libssl-dev = '*'
pkg-config = '*'
