Haya.Core
0.0.2
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
<PackageReference Include="Haya.Core" Version="0.0.2" />
paket add Haya.Core --version 0.0.2
#r "nuget: Haya.Core, 0.0.2"
// 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
- Install the Haya CLI tool
dotnet tool install --global Haya.Tool
- Add the Haya attributes package to your project.
dotnet add package Haya.Core
- Run the Haya CLI tool
haya --help
Usage
- 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 | Versions 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. |
-
net8.0
- FSharp.Core (>= 8.0.400)
- FSharpPlus (>= 1.6.1)
- FuncyDown (>= 1.4.1)
- Microsoft.Build (>= 17.11.4)
- Microsoft.Build.Tasks.Core (>= 17.11.4)
- Microsoft.CodeAnalysis (>= 4.11.0)
- Microsoft.CodeAnalysis.Workspaces.MSBuild (>= 4.11.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.