parse-book-source 0.6.0

Terminal reader for novel
Documentation
[package]
name = "parse-book-source"
version = "0.6.0"
edition = "2024"
description = "Terminal reader for novel"
authors = ["yexiyue <yexiyue666@qq.com>"]
license = "MIT"
keywords = ["CLI", "Terminal", "Novel", "Reader"]
repository = "https://github.com/yexiyue/parse-book-source"

[dependencies]
# JSONPath(对齐 RFC 9535)
jsonpath-rust = "1.0"
# v2 HTML 抽取后端(jQuery 式 API + :has()/:contains() 扩展伪类)
dom_query = "0.28"
# v2 规则正则统一用 fancy-regex(支持前后向断言/反向引用,兼容 Legado 风格规则)
fancy-regex = "0.18"
# v2 取页端口的异步 trait(dyn Fetcher 需要)
async-trait = "0.1"
# v2 按 charset 解码响应(GBK/gb18030/big5 等)
encoding_rs = "0.8"
serde = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true }
futures-util = { version = "0.3", optional = true }

# 从 Rust 类型自动生成 JSON Schema(尊重 serde 属性);以 `schema` feature 门控,
# 默认构建不含。配套 `examples/gen_schema.rs` + 防漂移测试 `schema_is_in_sync`。
schemars = { version = "0.8", optional = true }
sxd-document = "0.3.2"
sxd-xpath = "0.4.2"

# 确定性加解密/编码/哈希 transform(clean 流水线算子),全部纯 Rust、零 C 依赖。
# ⚠️ 代际锁定:必须钉在 RustCrypto 的 cipher 0.4 / digest 0.10 代——aes-gcm 0.10 依赖
#    cipher ^0.4、hmac 0.12 依赖 digest ^0.10。升级任一项须整组同步,否则 trait 不互通。
cipher = { version = "0.4", features = ["alloc", "block-padding"] }
aes = "0.8"
des = "0.8"
cbc = { version = "0.1", features = ["alloc", "block-padding"] }
ecb = { version = "0.1", features = ["alloc", "block-padding"] }
cfb-mode = "0.8"
aes-gcm = "0.10"
base64 = "0.22"
hex = "0.4"
percent-encoding = "2"
md-5 = "0.10"
sha1 = "0.10"
sha2 = "0.10"
hmac = "0.12"
# 繁简转换:纯 Rust 重实现 OpenCC + 内置词典(禁用 opencc-rust——其依赖系统 libopencc/
# libstdc++、仅 Linux,会重演 onnxruntime 的 CRT/交叉编译之痛)。
ferrous-opencc = "0.4"

# JS 逻辑编排逃生舱(纯 Rust JS 引擎),以 `js` feature 门控,默认构建不含。
# crypto 对象后端复用上面的 transform crypto fn(单一真相源)。
boa_engine = { version = "0.21", optional = true }
reqwest = { version = "0.13", default-features = false, features = ["json", "rustls", "cookies"] }
chromiumoxide = { version = "0.9", optional = true }
# 机器绑定的凭据加密密钥来源,仅 `js-host` feature 用(见 change js-host-bridge / source-auth)。
machine-uid = { version = "0.6.0", optional = true }
# 公共后缀表(纯 Rust,编译期内嵌):cookie 库按注册域(eTLD+1)归并。
psl = "2"

[features]
default = []
# 启用基于系统浏览器的反爬取页(BrowserFetcher / EscalatingFetcher)。
browser = ["dep:chromiumoxide", "dep:futures-util"]
# 启用 JSON Schema 生成(schemars 派生 + gen 示例 + 防漂移测试)。
schema = ["dep:schemars"]
# 启用 JS 逻辑编排逃生舱(Rule::Js / clean.js 求值)。变体与 schema 恒存在,
# 仅求值实现受此门控;未启用时求值到 JS 返回 Unsupported("js")。
js = ["dep:boa_engine"]
# 启用 JS host 桥:给沙箱注入有状态 `source`(状态/登录)+ `net`(网络/cookie/浏览器)对象,
# 解锁登录与多步请求编排。打破纯沙箱(攻击面变大),默认构建不含;见 change js-host-bridge。
js-host = ["js", "dep:machine-uid"]

# gen_schema 示例:`cargo run -p parse-book-source --features schema --example gen_schema`
[[example]]
name = "gen_schema"
required-features = ["schema"]