Haya.Core 0.0.2

Suggested Alternatives

Haya

Additional Details

Attributes have been moved from `Haya.Core` to `Haya` package. Use `Haya` for the latest changes.

dotnet add package Haya.Core --version 0.0.2                
NuGet\Install-Package Haya.Core -Version 0.0.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Haya.Core" Version="0.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Haya.Core --version 0.0.2                
#r "nuget: Haya.Core, 0.0.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Haya.Core as a Cake Addin
#addin nuget:?package=Haya.Core&version=0.0.2

// Install Haya.Core as a Cake Tool
#tool nuget:?package=Haya.Core&version=0.0.2                

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.Core
  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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.