diff --git a/.template.config/template.json b/.template.config/template.json index 5e00fc94e..d4beaf608 100644 --- a/.template.config/template.json +++ b/.template.config/template.json @@ -73,6 +73,9 @@ "**/*.lock.json", "*.nuspec" ], + "rename": { + "README-template.md": "README.md" + }, "modifiers": [ { "condition": "(UseAngular)", diff --git a/CleanArchitecture.nuspec b/CleanArchitecture.nuspec index 486902279..a6d23e58f 100644 --- a/CleanArchitecture.nuspec +++ b/CleanArchitecture.nuspec @@ -3,7 +3,7 @@ Clean.Architecture.Solution.Template - 8.0.0-preview.6.6 + 8.0.0-preview.6.7 Clean Architecture Solution Template JasonTaylorDev Clean Architecture Solution Template for .NET 8. @@ -11,7 +11,7 @@ A Clean Architecture Solution Template for creating a Single-Page Application (SPA) with ASP.NET Core. - Update Web API template to include endpoints for using ASP.NET Core Identity. + Added README for solutions generated with the template. https://github.com/JasonTaylorDev/CleanArchitecture diff --git a/CleanArchitecture.sln b/CleanArchitecture.sln index 9d43e22b7..79f1854de 100644 --- a/CleanArchitecture.sln +++ b/CleanArchitecture.sln @@ -26,14 +26,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Directory.Build.props = Directory.Build.props Directory.Packages.props = Directory.Packages.props global.json = global.json + README.md = README.md EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Web", "src\Web\Web.csproj", "{4E4EE20C-F06A-4A1B-851F-C5577796941C}" EndProject -#if (!UseApiOnly) Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Web.AcceptanceTests", "tests\Web.AcceptanceTests\Web.AcceptanceTests.csproj", "{21334974-6B07-47BB-B664-AC62FE58C12B}" EndProject -#endif Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -68,12 +67,10 @@ Global {4E4EE20C-F06A-4A1B-851F-C5577796941C}.Debug|Any CPU.Build.0 = Debug|Any CPU {4E4EE20C-F06A-4A1B-851F-C5577796941C}.Release|Any CPU.ActiveCfg = Release|Any CPU {4E4EE20C-F06A-4A1B-851F-C5577796941C}.Release|Any CPU.Build.0 = Release|Any CPU - #if (!UseApiOnly) {21334974-6B07-47BB-B664-AC62FE58C12B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {21334974-6B07-47BB-B664-AC62FE58C12B}.Debug|Any CPU.Build.0 = Debug|Any CPU {21334974-6B07-47BB-B664-AC62FE58C12B}.Release|Any CPU.ActiveCfg = Release|Any CPU {21334974-6B07-47BB-B664-AC62FE58C12B}.Release|Any CPU.Build.0 = Release|Any CPU - #endif EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -86,9 +83,7 @@ Global {DC37FD87-552C-4613-9F16-1537CA522898} = {664D406C-2F83-48F0-BFC3-408D5CB53C65} {277029AF-D9E1-4B75-9F11-48FEA7345AD7} = {664D406C-2F83-48F0-BFC3-408D5CB53C65} {4E4EE20C-F06A-4A1B-851F-C5577796941C} = {6ED356A7-8B47-4613-AD01-C85CF28491BD} - #if (!UseApiOnly) {21334974-6B07-47BB-B664-AC62FE58C12B} = {664D406C-2F83-48F0-BFC3-408D5CB53C65} - #endif EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {3CB609D9-5D54-4C11-A371-DAAC8B74E430} diff --git a/README-template.md b/README-template.md new file mode 100644 index 000000000..90f0775a3 --- /dev/null +++ b/README-template.md @@ -0,0 +1,67 @@ +# CleanArchitecture + +The project was generated using the [Clean.Architecture.Solution.Template](https://github.com/jasontaylordev/CleanArchitecture) version 8.0.0-preview.6.7. + +## Build + +Run `dotnet build -tl` to build the solution. + +## Run + +To run the web application: + +```bash +cd .\src\Web\ +dotnet watch run +``` + +Navigate to https://localhost:5001. The application will automatically reload if you change any of the source files. + +## Code Scaffolding + +The template includes support to scaffold new commands and queries. + +Start in the `.\src\Application\` folder. + +Create a new command: + +``` +dotnet new ca-usecase --name CreateTodoList --feature-name TodoLists --usecase-type command --return-type int +``` + +Create a new query: + +``` +dotnet new ca-usecase -n GetTodos -fn TodoLists -ut query -rt TodosVm +``` + +If you encounter the error *"No templates or subcommands found matching: 'ca-usecase'."*, install the template and try again: + +```bash +dotnet new install Clean.Architecture.Solution.Template::8.0.0-preview.6.7 +``` + +## Test + +The solution contains unit, integration, and acceptance tests. + +To run the unit and integration tests (excluding acceptance tests): +```bash +dotnet test --filter "FullyQualifiedName!~AcceptanceTests" +``` + +To run the acceptance tests, first start the application: + +```bash +cd .\src\Web\ +dotnet run +``` + +Then, in a new console, run the tests: +```bash +cd .\src\Web\ +dotnet test +``` + +## Help +To learn more about the template go to the [project website](https://github.com/JasonTaylorDev/CleanArchitecture). Here you can find additional guidance, request new features, report a bug, and discuss the template with other users. \ No newline at end of file diff --git a/README.md b/README.md index d3861ab51..d7b6c3a3e 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ If you find this project useful, please give it a star. Thanks! ⭐ 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.6.6 +dotnet new install Clean.Architecture.Solution.Template::8.0.0-preview.6.7 ``` 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: