How embarkstudios/cargo-about works
Project type and purpose
• This is a Rust-based CLI tool and Cargo plugin called “cargo-about,” whose job is to scan a crate’s dependency graph, collect license metadata (using SPDX), and render a formatted license listing via a Handlebars template.
• It’s not a web app or microservice—its architecture centers on command dispatch, license-resolution logic, and template-based output generation.
File structure
• Top-level: Cargo.toml/Cargo.lock, src/, tests/, docs/, resources/ (templates, default.hbs), and .github/ (CI, issue/pr templates).
• src/:
• cargo-about/ – three sub-modules (init.rs, generate.rs, clarify.rs) plus main.rs.
• licenses/ – modules for scanning, fetching, resolution, plus per-crate workaround code.
• win_bindings.rs & bindings.toml – Windows FFI support.
• lib.rs – the core library entrypoint.
• tests/: end-to-end CLI tests and unit-test helpers under tests/utils.
• docs/: the book for user-facing documentation.
README
• Confirms use cases (“cargo about init”, “cargo about generate”).
Detail is key
• Module names (e.g., src/licenses/scan.rs, src/cargo-about/generate.rs).
• Workaround sub-modules as part of the License Engine.