#cargo-workspace #workspace #analyzer #cargo #pacakges #command-line-tool

app cargo-workspace-analyzer

A CLI tool that prases manifest files and gives insights about the workspace

3 unstable releases

new 0.2.0 Oct 29, 2024
0.1.1 Oct 27, 2024
0.1.0 Oct 27, 2024

#215 in Development tools

Download history 328/week @ 2024-10-27

328 downloads per month

GPL-3.0-only

24KB
411 lines

Cargo workspace analyzer

A CLI tool which provides insights about a Cargo workspace. Currently, the following is supported:

  • count the number of packages within a workspace
  • create a Mermaid diagram to show how packages depend on each other

Installation

Install it globally:

cargo install cargo-workspace-analyzer

Then navigate to a Cargo workspace and run the tool:

cd path/to/your/workspace
cargo-workspace-analyzer

or use an argument to specify the location of the workspace.

cd path/to/your/workspace
cargo-workspace-analyzer --working-dir /path/to/your/workspace

For further details, use cargo-workspace-analyzer --help

Dependency analysis

After running the analyzer, an Mermaid diagram is printed.

graph TD
    service-1 --> db-connector
    API --> service-2
    API --> service-1
    service-2 --> db-connector

You can copy it and paste it in the Mermaid Live editor. It will give you the diagram.

component-diagram

Package Count

Roadmap

Regarding features this is still in early stage. A lot can and will be analyzed in the future. The following is currently planed:

  • show how packages are related to each other
  • notice dependencies which are used in multiple packages, but not declared as workspace dependency
  • notice circular dependencies
  • ability to specify layers for the diagram

Dependencies

~0.7–8MB
~65K SLoC