Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Fix 927 #928

Merged
merged 1 commit into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
node-version: '18.x'
cache: 'npm'
cache-dependency-path: src/WebUI/ClientApp/package-lock.json
cache-dependency-path: src/Web/ClientApp/package-lock.json

- name: Cache NuGet packages
uses: actions/cache@v3
Expand Down Expand Up @@ -52,22 +52,22 @@ jobs:
dotnet publish --configuration Release --runtime win-x86 --self-contained --output ./publish
cd publish
zip -r ./publish.zip .
working-directory: ./src/WebUI/
working-directory: ./src/Web/

- name: Upload Website Artifact
if: ${{ inputs.build-artifacts == true }}
uses: actions/upload-artifact@v2
with:
name: website
path: ./src/WebUI/publish/publish.zip
path: ./src/Web/publish/publish.zip
if-no-files-found: error

- name: Create EFBundle Artifact
if: ${{ inputs.build-artifacts == true }}
run: |
dotnet new tool-manifest
dotnet tool install dotnet-ef --prerelease
dotnet ef migrations bundle --configuration Release -p ./src/Infrastructure/ -s ./src/WebUI/ -o efbundle.exe
dotnet ef migrations bundle --configuration Release -p ./src/Infrastructure/ -s ./src/Web/ -o efbundle.exe
zip -r ./efbundle.zip efbundle.exe
env:
SkipNSwag: True
Expand Down
54 changes: 17 additions & 37 deletions .template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,6 @@
"UseLocalDB": {
"type": "computed",
"value": "(!UseSQLite)"
},
"WebProjectName": {
"type": "generated",
"generator": "switch",
"replaces": "WebUI",
"parameters": {
"evaluator": "C++",
"datatype": "text",
"cases": [
{
"condition": "(UseApiOnly)",
"value": "WebApi"
},
{
"condition": "",
"value": "WebUI"
}
]
}
}
},
"sources": [
Expand All @@ -96,18 +77,18 @@
{
"condition": "(UseAngular)",
"exclude": [
"src/WebUI/config-react.nswag",
"src/WebUI/config-webapi.nswag",
"src/WebUI/ClientApp-React/**",
"src/WebUI/Templates/**"
"src/Web/config-react.nswag",
"src/Web/config-webapi.nswag",
"src/Web/ClientApp-React/**",
"src/Web/Templates/**"
]
},
{
"condition": "(UseReact)",
"exclude": [
"src/WebUI/config.nswag",
"src/WebUI/config-webapi.nswag",
"src/WebUI/ClientApp/**"
"src/Web/config.nswag",
"src/Web/config-webapi.nswag",
"src/Web/ClientApp/**"
],
"rename": {
"config-react.nswag": "config.nswag",
Expand All @@ -117,32 +98,31 @@
{
"condition": "(UseApiOnly)",
"exclude": [
"src/WebUI/config.nswag",
"src/WebUI/ClientApp/**",
"src/WebUI/config-react.nswag",
"src/WebUI/ClientApp-React/**",
"src/WebUI/Templates/**",
"tests/WebUI.AcceptanceTests/**"
"src/Web/config.nswag",
"src/Web/ClientApp/**",
"src/Web/config-react.nswag",
"src/Web/ClientApp-React/**",
"src/Web/Templates/**",
"tests/Web.AcceptanceTests/**"
],
"rename": {
"config-webapi.nswag": "config.nswag",
"WebUI": "WebApi"
"config-webapi.nswag": "config.nswag"
}
},
{
"condition": "(UseLocalDB)",
"exclude": [
"src/Infrastructure/Data/SQLite/**",
"src/WebUI/appsettings.SQLite.json",
"src/WebUI/app.db",
"src/Web/appsettings.SQLite.json",
"src/Web/app.db",
"tests/Application.IntegrationTests/TestDatabase.Sqlite.cs"
]
},
{
"condition": "(UseSQLite)",
"exclude": [
"src/Infrastructure/Data/Migrations/**",
"src/WebUI/appsettings.json",
"src/Web/appsettings.json",
"tests/Application.IntegrationTests/TestDatabase.cs"
],
"rename": {
Expand Down
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.6</version>
<version>8.0.0-preview.6.1</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>
Update to .NET 8 Preview 6
Rename `WebUI` / `WebApi` projects to `Web`
</releaseNotes>

<projectUrl>https://github.com/JasonTaylorDev/CleanArchitecture</projectUrl>
Expand Down
32 changes: 16 additions & 16 deletions CleanArchitecture.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Domain.UnitTests", "tests\D
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Application.IntegrationTests", "tests\Application.IntegrationTests\Application.IntegrationTests.csproj", "{277029AF-D9E1-4B75-9F11-48FEA7345AD7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebUI", "src\WebUI\WebUI.csproj", "{22454EE9-16B3-4B7A-8352-37E59B858155}"
EndProject
#if (!UseApiOnly)
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebUI.AcceptanceTests", "tests\WebUI.AcceptanceTests\WebUI.AcceptanceTests.csproj", "{B2A33F8A-CD4F-46D3-B04F-AF794952DB33}"
EndProject
#endif
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E2DA20AA-28D1-455C-BF50-C49A8F831633}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
Expand All @@ -34,6 +28,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
global.json = global.json
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
Expand Down Expand Up @@ -64,15 +64,15 @@ Global
{277029AF-D9E1-4B75-9F11-48FEA7345AD7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{277029AF-D9E1-4B75-9F11-48FEA7345AD7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{277029AF-D9E1-4B75-9F11-48FEA7345AD7}.Release|Any CPU.Build.0 = Release|Any CPU
{22454EE9-16B3-4B7A-8352-37E59B858155}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{22454EE9-16B3-4B7A-8352-37E59B858155}.Debug|Any CPU.Build.0 = Debug|Any CPU
{22454EE9-16B3-4B7A-8352-37E59B858155}.Release|Any CPU.ActiveCfg = Release|Any CPU
{22454EE9-16B3-4B7A-8352-37E59B858155}.Release|Any CPU.Build.0 = Release|Any CPU
{4E4EE20C-F06A-4A1B-851F-C5577796941C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{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)
{B2A33F8A-CD4F-46D3-B04F-AF794952DB33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2A33F8A-CD4F-46D3-B04F-AF794952DB33}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2A33F8A-CD4F-46D3-B04F-AF794952DB33}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2A33F8A-CD4F-46D3-B04F-AF794952DB33}.Release|Any CPU.Build.0 = Release|Any CPU
{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
Expand All @@ -85,9 +85,9 @@ Global
{DEFF4009-1FAB-4392-80B6-707E2DC5C00B} = {664D406C-2F83-48F0-BFC3-408D5CB53C65}
{DC37FD87-552C-4613-9F16-1537CA522898} = {664D406C-2F83-48F0-BFC3-408D5CB53C65}
{277029AF-D9E1-4B75-9F11-48FEA7345AD7} = {664D406C-2F83-48F0-BFC3-408D5CB53C65}
{22454EE9-16B3-4B7A-8352-37E59B858155} = {6ED356A7-8B47-4613-AD01-C85CF28491BD}
{4E4EE20C-F06A-4A1B-851F-C5577796941C} = {6ED356A7-8B47-4613-AD01-C85CF28491BD}
#if (!UseApiOnly)
{B2A33F8A-CD4F-46D3-B04F-AF794952DB33} = {664D406C-2F83-48F0-BFC3-408D5CB53C65}
{21334974-6B07-47BB-B664-AC62FE58C12B} = {664D406C-2F83-48F0-BFC3-408D5CB53C65}
#endif
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
dotnet new install Clean.Architecture.Solution.Template::8.0.0-preview.6.1
```

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:
Expand All @@ -35,8 +35,9 @@ To create a ASP.NET Core Web API-only solution:
dotnet new ca-sln -cf None -o YourProjectName
```

Launch the app by navigating to ``./src/WebUI`` (SPA) or ``./src/WebApi`` and running:
Launch the app:
```bash
cd src/Web
dotnet run
```

Expand Down Expand Up @@ -75,12 +76,12 @@ When you run the application the database will be automatically created (if nece
Running database migrations is easy. Ensure you add the following flags to your command (values assume you are executing from repository root)

* `--project src/Infrastructure` (optional if in this folder)
* `--startup-project src/WebUI` or `--startup-project src/WebApi` (Web API only)
* `--startup-project src/Web`
* `--output-dir Data/Migrations`

For example, to add a new migration from the root folder:

`dotnet ef migrations add "SampleMigration" --project src\Infrastructure --startup-project src\WebUI --output-dir Data\Migrations`
`dotnet ef migrations add "SampleMigration" --project src\Infrastructure --startup-project src\Web --output-dir Data\Migrations`

## Deploy

Expand Down
File renamed without changes.
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "cleanarchitecture.webui",
"name": "cleanarchitecture.web",
"version": "0.1.0",
"private": true,
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>WebUI</title>
<title>CleanArchitecture.Web</title>
</head>
<body>
<noscript>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"short_name": "CleanArchitecture.WebUI",
"name": "CleanArchitecture.WebUI",
"short_name": "CleanArchitecture.Web",
"name": "CleanArchitecture.Web",
"icons": [
{
"src": "favicon.ico",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class FetchData extends Component {

async populateWeatherData() {
let client = new WeatherForecastsClient();
const data = await client.get();
const data = await client.getWeatherForecasts();
this.setState({ forecasts: data, loading: false });
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class NavMenu extends Component {
return (
<header>
<Navbar className="navbar-expand-sm navbar-toggleable-sm ng-white border-bottom box-shadow mb-3" container light>
<NavbarBrand tag={Link} to="/">WebUI</NavbarBrand>
<NavbarBrand tag={Link} to="/">CleanArchitecture.Web</NavbarBrand>
<NavbarToggler onClick={this.toggleNavbar} className="mr-2" />
<Collapse className="d-sm-inline-flex flex-sm-row-reverse" isOpen={!this.state.collapsed} navbar>
<ul className="navbar-nav flex-grow">
Expand Down
Loading