Restructure into a crates/ workspace layout#22
Merged
Conversation
All Rust crates now live under crates/ (busbar, api, auth-tokens, auth-admin-tokens, hooks-ranking), so code is cleanly separated from non-code (examples/, scripts/, docs/, bench/, config). No behavior change — the binary and every crate are functionally identical; only paths move. - crates/busbar/ holds the engine + binary (was root src/ + the root package). The root Cargo.toml is now a virtual workspace manifest; [profile.release] stays there (Cargo reads profiles only from the workspace root). - Plugin path deps rewired (../api); the four CARGO_MANIFEST_DIR test reads gain ../../ to reach the repo-root providers.yaml/config.yaml. - scripts/structure-lint.sh scans crates/; docs/code-layout.md documents the workspace layout. Verified: cargo test, clippy -D warnings, fmt, structure-lint, and the --no-default-features build all pass. No version bump / no changelog entry — internal reorganization, invisible to users.
The ../../ path fix pushed the concat! read past rustfmt's 100-col limit; stable rustfmt breaks .unwrap() onto its own line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Move all five Rust crates under a single
crates/directory, so code is cleanly separated from non-code at the repo root:Previously the binary sat at the root (
src/+ the rootCargo.tomlpackage) with the satellite crates scattered asauth/tokens,hooks/ranking, etc. — which made it hard to tell code from non-code at a glance. This is the layout newcomers expect:crates/= Rust, everything else = not.Why
Pure navigability. The dependency architecture is unchanged (
busbar → api ← plugins; each plugin is an optional, default-on feature). It just reads more clearly.Notes
Cargo.tomlis now a virtual workspace manifest;[profile.release]stays there (Cargo reads profiles only from the workspace root). Each crate's[package]is incrates/<name>/Cargo.toml.CARGO_MANIFEST_DIRtest reads gained../../to reach the repo-rootproviders.yaml/config.yaml.scripts/structure-lint.shnow scanscrates/;docs/code-layout.mddocuments the workspace layout.sync-docs.mjsreads the crate version fromcrates/busbar/Cargo.toml(updated in the marketing repo, with a root fallback so it works across the transition).Verification (local)
cargo test— full suite passescargo clippy --all-targets -- -D warnings— cleancargo fmt --check— cleancargo build --no-default-features— cleanscripts/structure-lint.sh— passes