Skip to content

workspace: crates/ layout with shared workspace package and deps - #14

Merged
macalinao merged 2 commits into
mainfrom
workspace-layout
Nov 6, 2026
Merged

macalinao merged 2 commits into
mainfrom
workspace-layout

Conversation

@macalinao

Copy link
Copy Markdown
Contributor

Moves both crates under crates/, modeled on ffcine's layout:

  • Virtual root Cargo.toml: [workspace] with members = ["crates/*"] and resolver = "3"; [workspace.package] holds edition, license, repository, authors and rust-version; [workspace.dependencies] lists every dependency; [workspace.lints.clippy] is the two crates' shared lint set. struct_excessive_bools = "allow", which only ccwire had, now applies to ccwire-oauth too, so its lints only get looser. missing_docs stays as #![warn(missing_docs)] in ccwire-oauth's lib.rs.
  • crates/ccwire, crates/ccwire-oauth: names, versions (0.1.1 / 0.1.0), description, docs, keywords and exclude lists are unchanged, and so is the public API. Shared fields use x.workspace = true, deps use dep.workspace = true (each crate adds its own tokio features), and lints use [lints] workspace = true.
  • README and LICENSE: each crate's LICENSE, and ccwire's README.md, is a symlink to the root's, so there is one copy. cargo package includes them as regular files.
  • Cargo.lock stays at the root, byte-for-byte unchanged.
  • Other files: flake.nix reads crates/ccwire/Cargo.toml. ci.yml's MSRV job reads [workspace.package] rust-version and checks every crate inherits it. newest-cli.yml and check_cli_flags.py use the new source paths. release-plz.toml changelog paths are now crates/*/CHANGELOG.md, with the tags unchanged. The root README links to crates/ccwire-oauth. clippy.toml and deny.toml stay at the root, and clippy still finds clippy.toml from the parent dirs.
  • deny.toml: one new license exception, CDLA-Permissive-2.0 for webpki-root-certs (Mozilla's root certs, via reqwest → rustls-platform-verifier). Before, cargo deny only checked the root package ccwire. With a virtual root it checks every member, which brings in ccwire-oauth's reqwest tree.

Local gate (nix develop), all passing:

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets --locked [--all-features] -- -D warnings, plus per-crate --lib
  • cargo test --workspace --locked: 113 tests; with --all-features: 143, the same as main
  • RUSTDOCFLAGS=-Dwarnings cargo doc --workspace --no-deps --all-features
  • cargo deny check
  • cargo package -p ccwire and cargo package -p ccwire-oauth: both build, and the file lists match main's exactly (README and LICENSE included; tests/corpus and tests/corpus.rs excluded)
  • nix flake check

Paolo Santos added 2 commits November 6, 2026 23:48
Both crates move under crates/ (crates/ccwire, crates/ccwire-oauth) with a
virtual root Cargo.toml: [workspace.package] (edition, license, repository,
authors, rust-version), [workspace.dependencies] and [workspace.lints].
Crate names, versions, metadata and exclude lists are unchanged, as is
Cargo.lock. Each crate's LICENSE (and ccwire's README) is a symlink to the
root's, which cargo package includes as a file.

flake.nix, ci.yml (MSRV now read from [workspace.package]), newest-cli.yml,
release-plz.toml changelog paths and the README link follow the move.
With a virtual root, cargo deny checks every member, ccwire-oauth's
reqwest tree included (before, only the root package ccwire was checked).
@macalinao
macalinao merged commit f52bd63 into main Nov 6, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant