Netspark.CleanArchitecture.Scaffold
2.0.1
dotnet tool install --global Netspark.CleanArchitecture.Scaffold --version 2.0.1
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local Netspark.CleanArchitecture.Scaffold --version 2.0.1
#tool dotnet:?package=Netspark.CleanArchitecture.Scaffold&version=2.0.1
nuke :add-package Netspark.CleanArchitecture.Scaffold --version 2.0.1
Netspark.CleanArchitecture.Scaffolder
This is a dotnet tool for generating clean architecture commands, queries controllers along with respective unit and integration test stubs.
CLI Options
a:gen-api Generate controllers and actions
c:config-file Configuration file in yaml format for this tool (absolute or relative to the command process working directory)
d:gen-commands Generate applicaiton commands
e:gen-events Generate events for executed commands
f:gen-full Generate all possible templates
h:gen-handlers Generate applicaiton command/query handlers
i:gen-integration-tests Generate integration tests
m:merge-strategy Merge strategy for the scaffolding: Append|Overwrite|Skip
o:output-folder The root folder for commands/queries tree generation (absolute or relative to the command process working directory)
q:gen-queries Generate applicaiton queries
t:templates-version The version of template files used in scaffolder (v1 or v2)
u:gen-unit-tests Generate unit tests
v:gen-validators Generate fluent validators for commands or queries
x:gen-examples Generate swagger examples for controller actions
-?, help Show this help message
Config File Structure
There are 2 variants of the cleanasc.yaml file structure.
Variant 1: Only Domains
Document
# Domains
---
Global:
Commands:
- CreateCountry
- DeleteCountry
- CreateLanguage
- DeleteLanguage
- CreateCurrency
- RemoveCurrency
Queries:
- GetCurrenciesList
- GetLanguagesList
- GetCountriesList
Customer
Commands:
- UpsertCustomer
- DeleteCustomer
Queries:
- GetCustomersList
- GetCustomerDetail
Variant 2: Settings
and Domains
Documents
# Settings
---
Namespace: MyCompany
ApiUrlPrefix: api/v1
DbContext: IMyDbContext
UiSuffix: WebUI
DtoSuffix: Dto
VmSuffix: Vm
UiPath: ./WebUI
AppPath: ./Applicaiton
ActionSuffix: Action
TemplatesVersion: v2
SrcPath: ./Src
TestsPath: ./Tests
# Domains
---
Global:
Commands:
- CreateCountry
- DeleteCountry
- CreateLanguage
- DeleteLanguage
- CreateCurrency
- RemoveCurrency
Queries:
- GetCurrenciesList
- GetLanguagesList
- GetCountriesList
Customer
Commands:
- UpsertCustomer
- DeleteCustomer
Queries:
- GetCustomersList
- GetCustomerDetail
Settings.SrcPath
and Settings.TestsPath
can be either absolute or relative to the folder, containing this yaml configuration.
Folder containing yaml config file is treated as source of the merge process, i.e. files in there will be probed for existence before executing merge strategy.
If passed in config-file
is located in output-folder
, the process will do merge as well as if you want to write generated files into another directory.
Examples
Command for generating new API controllers and appending actions to existing API controllers, with commands, queries, view models and swagger examples would look like this:
cleanasc -c "c:/Path/To/Config/File/cleanasc.orders.yml" -o "c:/Path/To/My/Projects/MyProjectFolder" -adqx -t "v2" -m Append
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
This package has no dependencies.
Version | Downloads | Last updated | |
---|---|---|---|
2.0.1 | 1,109 | 7/20/2023 | |
2.0.0 | 1,004 | 7/18/2023 | |
2.0.0-beta | 1,102 | 7/15/2023 | |
1.4.3 | 1,145 | 4/28/2021 | |
1.4.2 | 1,104 | 4/28/2021 | |
1.4.1 | 1,085 | 4/28/2021 | |
1.3.2 | 1,031 | 4/28/2021 | |
1.3.1 | 1,273 | 10/31/2020 | |
1.2.2 | 1,339 | 10/31/2020 | |
1.2.1 | 1,198 | 3/24/2020 | |
1.1.6 | 1,438 | 1/2/2020 | |
1.1.5 | 1,243 | 12/24/2019 | |
1.1.4 | 1,314 | 12/23/2019 | |
1.0.3 | 1,449 | 12/17/2019 | |
1.0.2 | 1,471 | 12/15/2019 | |
1.0.1 | 1,382 | 12/15/2019 | |
1.0.0 | 1,517 | 12/15/2019 |
- Controllers and integration tests are generated for each entity (inferred from query name)
- Fixed usings template generator issues
- Fixed integration test generator issues
- Fixed namespace for integration test fixture
- Fixed pathname for controllers in *nix systems
- Added config params for UiSuffix and UiPath
- Added config params for AppPath
- Extended controller actions annotations
- Separate controllers for each subdomain
- Optional generation of test files
- Support of dotnet7
- Swagger examples for actions
- configurable action suffix