Skip to content

Commit

Permalink
✨ Updated .NET templates with improved short names for template optio…
Browse files Browse the repository at this point in the history
…ns (e.g. ca-sln and ca-usecase).
  • Loading branch information
jasontaylordev committed Jul 5, 2023
1 parent 8ffe7f2 commit 7ec9cb4
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 10 deletions.
8 changes: 8 additions & 0 deletions .template.config/dotnetcli.host.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"symbolInfo": {
"clientFramework": {
"longName": "client-framework",
"shortName": "cf"
}
}
}
4 changes: 2 additions & 2 deletions CleanArchitecture.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<metadata>

<id>Clean.Architecture.Solution.Template</id>
<version>8.0.0-preview.5.3</version>
<version>8.0.0-preview.5.4</version>
<title>Clean Architecture Solution Template</title>
<authors>JasonTaylorDev</authors>
<description>Clean Architecture Solution Template for .NET 8.</description>
<summary>
A Clean Architecture Solution Template for creating a Single-Page Application (SPA) with ASP.NET Core.
</summary>
<releaseNotes>
Added support for Web API only.
Updated .NET templates with improved short names for template options (e.g. ca-sln and ca-usecase).
</releaseNotes>

<projectUrl>/~https://github.com/JasonTaylorDev/CleanArchitecture</projectUrl>
Expand Down
27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,24 @@ The template depends on the latest versions of:

The easiest way to get started is to install the [.NET template](https://www.nuget.org/packages/Clean.Architecture.Solution.Template):
```
dotnet new install Clean.Architecture.Solution.Template::8.0.0-preview.5.3
dotnet new install Clean.Architecture.Solution.Template::8.0.0-preview.5.4
```

Once installed, create a new solution using the template. You can choose to use Angular, React, or create a Web API-only solution. Specify the client framework using the `-c` or `--clientFramework` option, and provide the output directory where your project will be created. Here are some examples:
Once installed, create a new solution using the template. You can choose to use Angular, React, or create a Web API-only solution. Specify the client framework using the `-cf` or `--client-framework` option, and provide the output directory where your project will be created. Here are some examples:

To create a SPA with Angular:
```
dotnet new ca-sln -c Angular --output YourProjectName
dotnet new ca-sln --client-framework Angular --output YourProjectName
```

To create a SPA with React:
```
dotnet new ca-sln -c React --output YourProjectName
dotnet new ca-sln -cf React -o YourProjectName
```

To create a Web API-only solution:
```
dotnet new ca-sln -c None --output YourProjectName
dotnet new ca-sln -cf None -o YourProjectName
```

The above commands will create a Single-Page Application (SPA) with Angular or React on top of ASP.NET Core, or a Web API-only solution.
Expand All @@ -56,13 +56,24 @@ Start the application by navigating to ``./src/WebUI`` (SPA) or ``./src/WebApi``
dotnet run
```

Create use cases (commands or queries) by navigating to `./src/Application` and running:
To learn more, run the following command:
```
dotnet new ca-usecase --feature TodoLists --name CreateTodoList --useCaseType command --returnType int
dotnet new ca-sln --help
```

To learn more, run the following command:
You can create use cases (commands or queries) by navigating to `./src/Application` and running `dotnet new ca-usecase`. Here are some examples:

To create a new command:
```
dotnet new ca-usecase --name CreateTodoList --feature-name TodoLists --usecase-type command --return-type int
```

To create a query:
```
dotnet new ca-usecase -n GetTodos -fn TodoLists -ut query -rt TodosVm
```

To learn more, run the following command:
```
dotnet new ca-usecase --help
```
Expand Down
16 changes: 16 additions & 0 deletions templates/ca-use-case/.template.config/dotnetcli.host.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"symbolInfo": {
"featureName": {
"longName": "feature-name",
"shortName": "fn"
},
"returnType": {
"longName": "return-type",
"shortName": "rt"
},
"useCaseType": {
"longName": "usecase-type",
"shortName": "ut"
}
}
}

0 comments on commit 7ec9cb4

Please sign in to comment.