Haya.Tool 0.0.3

dotnet tool install --global Haya.Tool --version 0.0.3                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local Haya.Tool --version 0.0.3                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Haya.Tool&version=0.0.3                
nuke :add-package Haya.Tool --version 0.0.3                

haya-net

Haya automates the generating of documentation and diagrams for a .NET codebase. It uses attributes to define concepts like Responsibilities and Collaborators. The tool uses these concepts to generate CRC descriptions and C4 Level 1 diagrams.

See the examples folder of the attribute annotations and the generated CRC.

Note: This currently only works for C# codebases.

This is not meant to be a replacement for good documentation practices, but rather a tool to help you get started, or at the least have a minimum level for a new joiner to start exploring the codebase.

Getting Started

  1. Install the Haya CLI tool
dotnet tool install --global Haya.Tool
  1. Add the Haya attributes package to your project.
dotnet add package Haya
  1. Run the Haya CLI tool
haya --help

Usage

  1. Add the Haya attributes to your codebase. See Attributes docs for more information.
using Haya;
[assembly:Meta(AppName = "CheckoutApi", Description = "Handles processing payment for a shopping cart", System = "HayaEcomm")]

namespace Example;

[Responsibility(Description = "Handles order processing")]
public class CreditCardPaymentUsecase
{ }

[Collaborator(AppName = "Checkout",
    Relationship = Relationship.Internal,
    Direction = Direction.Upstream,
    System = "WebShop",
    Description = "Handles cart checkout for a customer",
    DataDescription = "Request payment")]
public class PaymentsController
{ }

Running the Haya CLI tool will generate a CRC document and a C4 Level 1 diagram.

haya crc --format md --c4 ./Example.sln
USAGE: haya crc [--help] [--outputpath <output path>] [--format <md|json>] [--c4] <path to sln>

PATHTOSLN:

    <path to sln>         Path to solution file

OPTIONS:

    --outputpath, -o <output path>
                          Path to output folder or file (default: ./CRC.md)
    --format, -f <md|json>
                          Output format: md | json (default: md)
    --c4, -c              Include diagram (markdown only). -c for C4 Level 1, -cc for C4 Level 2
    --help                display this list of options.

USAGE: haya [--help] [<subcommand> [<options>]]

SUBCOMMANDS:

    crc <options>         Generate Components, Responsibilities, and Collaborator data

    Use 'haya <subcommand> --help' for additional information.

OPTIONS:

    --help                display this list of options.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
0.0.3 135 9/21/2024
0.0.2 130 9/20/2024
0.0.1 186 9/16/2024