Split the single-binary crate into a reusable `rustbot` library (src/lib.rs)
plus a thin supervisor binary. The monolithic irc.rs and bot.rs become module
folders:
irc/ message (wire parsing), connection (TCP/TLS transport), encoding
bot/ mod (state + event loop), caps (IRCv3 cap negotiation + SASL),
commands (message routing + command table)
config Config + layered loading, moved out of main.rs and bot.rs
main.rs is now just the per-network connect/reconnect supervisor over the
library API. Unit tests move out of the source files into tests/ integration
tests (config.rs, protocol.rs) that drive the public surface — prefix parsing
is now covered through Message::parse, and config layering through the new
public config::parse_str. Behavior is unchanged; no new dependencies.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
26 lines
671 B
TOML
26 lines
671 B
TOML
[package]
|
|
name = "rustbot"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
description = "A modular, dependency-free IRC bot in Rust with a hand-rolled IRC protocol layer"
|
|
license = "MIT"
|
|
authors = ["a.srenov"]
|
|
|
|
[lib]
|
|
name = "rustbot"
|
|
path = "src/lib.rs"
|
|
|
|
[[bin]]
|
|
name = "rustbot"
|
|
path = "src/main.rs"
|
|
|
|
# The IRC protocol layer is hand-rolled in `src/irc/` (modern IRC client
|
|
# spec: https://modern.ircdocs.horse/). The sole dependency is native-tls for
|
|
# the optional TLS transport; it wraps the system OpenSSL, so TLS security
|
|
# fixes arrive through normal OS updates rather than a vendored crypto crate.
|
|
[dependencies]
|
|
native-tls = "0.2"
|
|
|
|
[profile.release]
|
|
lto = true
|
|
strip = true
|