This guide provides detailed information on the design ideas, implementation principles, and development guidelines of the tool's internal implementation. It enables developers to have a deeper understanding of and participate in the development of Perigon.
The Perigon project mainly includes the following components:
Implemented based on Spectre.Console.Cli. Implemented in the CommandLine project by calling CommandService to invoke specific logic.
The AterStudio project is a Web application implemented based on Blazor Server. The AterStudio/Components directory contains implementations of various components.
Components call Manager classes in the Modules/StudioMod module to implement specific business logic.
Code generation primarily relies on Roslyn for implementation, with core code in the Definition/CodeGenerator directory.
Currently, there are two methods for parsing entities:
EntityFrameworkCore.Design to obtain relevant information.Through EntityFrameworkCore.Design, more entity information can be obtained, including entity relationships and properties, which is very helpful for code generation and frontend requests.
Comments are extracted through XmlDocHelper for documentation information.
Parse OpenAPI specifications using Microsoft.OpenApi to extract relevant API information.
Different types of client request service generation are implemented by inheriting the ClientRequestBase abstract class. Type parsing for each language is implemented by inheriting LanguageFormatterBase.
The simplest and most intuitive way is to run the AterStudio project directly, which will start the Web application providing the Studio management interface.
For the CommandLine project, use the dotnet run command with parameters.