Group the module crates under modules/

The service pseudo-clients and the ircd protocol link sat flat at the
repo root, mixed in with the daemon core and the SDK. Move them all
under modules/ so the tree separates concerns cleanly: the daemon in
src/, the SDK every module links against in api/, and the loadable
modules — the pseudo-clients plus the protocol link — in modules/.

Workspace members, the daemon's per-crate dependency paths, and each
module's api path are updated to match; the docs follow. No code change.
This commit is contained in:
Jean Chevronnet 2026-07-14 14:19:43 +00:00
parent 6f76f9722c
commit ad2a623120
No known key found for this signature in database
116 changed files with 69 additions and 46 deletions

View file

@ -11,22 +11,22 @@ There are two kinds of module.
- A **service** (a pseudo-client like NickServ) implements `Service`.
- A **protocol** (an ircd link like InspIRCd) implements `Protocol`.
Both live in their own crate under the workspace. `example/` is a complete,
minimal service to copy from; `inspircd/` is the reference protocol.
Both live in their own crate under `modules/`. `modules/example/` is a complete,
minimal service to copy from; `modules/inspircd/` is the reference protocol.
## A service, end to end
**1. The crate.** One dependency:
```toml
# mymod/Cargo.toml
# modules/mymod/Cargo.toml
[package]
name = "fedserv-mymod"
version = "0.0.1"
edition = "2021"
[dependencies]
fedserv-api = { path = "../api" }
fedserv-api = { path = "../../api" }
```
**2. The service.** A plain struct implementing `Service`:
@ -76,10 +76,10 @@ an IRC-originated one does — you do not write any replication code.
```toml
# Cargo.toml
[workspace]
members = [..., "mymod"]
members = [..., "modules/mymod"]
[dependencies]
fedserv-mymod = { path = "mymod" }
fedserv-mymod = { path = "modules/mymod" }
```
Construct it in `src/main.rs` alongside the others, behind its config name:
@ -107,7 +107,7 @@ ignored.
A protocol crate implements `Protocol`: it turns raw server-to-server lines into
the normalized `NetEvent`s the engine understands, and turns the engine's
`NetAction`s back into raw lines. The engine never sees a raw line, so supporting
another ircd is one new crate — see `inspircd/`. Wire it in `src/main.rs` where
another ircd is one new crate — see `modules/inspircd/`. Wire it in `src/main.rs` where
`InspIrcd` is constructed.
## What the SDK deliberately does not give you