Skip to content

Commit

Permalink
📦 119 update net 8 preview packages to release (#120)
Browse files Browse the repository at this point in the history
* Minor updates

* Updated nswag

* It builds!

* Upgrade logging

* Update EF Core

* Update xUnit

* update xUnit logging

* Update identity

* Update debug logging

* Updated healthcheck

* Updated test SDK

* Updated VS code gen

* Update configuration extensions

* Updated aspnet packages

* Updated test containers

* Tided up csproj files
  • Loading branch information
danielmackay authored Nov 16, 2023
1 parent a16e6a6 commit 5c0b2a0
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 102 deletions.
8 changes: 4 additions & 4 deletions Src/Application/Application.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<ItemGroup>
<PackageReference Include="AutoMapper" Version="12.0.1" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
<PackageReference Include="FluentValidation" Version="11.7.1" />
<PackageReference Include="FluentValidation" Version="11.8.0" />
<PackageReference Include="MediatR" Version="12.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0-rc.2.23480.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0-rc.2.23479.6" />
<PackageReference Include="Ardalis.Specification.EntityFrameworkCore" Version="7.0.0"/>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Ardalis.Specification.EntityFrameworkCore" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Src/Domain/Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Ardalis.GuardClauses" Version="4.1.1" />
<PackageReference Include="Ardalis.GuardClauses" Version="4.2.0" />
<PackageReference Include="Ardalis.Specification" Version="7.0.0" />
<PackageReference Include="MediatR.Contracts" Version="2.0.1" />
</ItemGroup>
Expand Down
15 changes: 7 additions & 8 deletions Src/Infrastructure/Infrastructure.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@

<ItemGroup>
<PackageReference Include="CsvHelper" Version="30.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.0-rc.2.23480.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0-rc.2.23480.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.0" />
<PackageReference Include="Bogus" Version="34.0.2"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0-rc.2.23480.1">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0-rc.2.23479.6" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0-rc.2.23479.6" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0-rc.2.23479.6" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0-rc.2.23479.6" />
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="8.0.0-rc.2.23480.2"/>
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
20 changes: 2 additions & 18 deletions Src/WebUI/ClientApp/src/app/northwind-traders-api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//----------------------
// <auto-generated>
// Generated using the NSwag toolchain v13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
// Generated using the NSwag toolchain v14.0.0.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
// </auto-generated>
//----------------------

Expand Down Expand Up @@ -48,7 +48,7 @@ export class Client implements IClient {

constructor(@Inject(HttpClient) http: HttpClient, @Optional() @Inject(API_BASE_URL) baseUrl?: string) {
this.http = http;
this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : "";
this.baseUrl = baseUrl ?? "";
}

postRegister(registration: RegisterRequest | undefined): Observable<void> {
Expand Down Expand Up @@ -1918,7 +1918,6 @@ export interface ITwoFactorRequest {
export class InfoResponse implements IInfoResponse {
email?: string;
isEmailConfirmed?: boolean;
claims?: { [key: string]: string; };

constructor(data?: IInfoResponse) {
if (data) {
Expand All @@ -1933,13 +1932,6 @@ export class InfoResponse implements IInfoResponse {
if (_data) {
this.email = _data["email"];
this.isEmailConfirmed = _data["isEmailConfirmed"];
if (_data["claims"]) {
this.claims = {} as any;
for (let key in _data["claims"]) {
if (_data["claims"].hasOwnProperty(key))
(<any>this.claims)![key] = _data["claims"][key];
}
}
}
}

Expand All @@ -1954,21 +1946,13 @@ export class InfoResponse implements IInfoResponse {
data = typeof data === 'object' ? data : {};
data["email"] = this.email;
data["isEmailConfirmed"] = this.isEmailConfirmed;
if (this.claims) {
data["claims"] = {};
for (let key in this.claims) {
if (this.claims.hasOwnProperty(key))
(<any>data["claims"])[key] = (<any>this.claims)[key];
}
}
return data;
}
}

export interface IInfoResponse {
email?: string;
isEmailConfirmed?: boolean;
claims?: { [key: string]: string; };
}

export class InfoRequest implements IInfoRequest {
Expand Down
2 changes: 1 addition & 1 deletion Src/WebUI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
app.UseOpenApi();

//app.UseSwaggerUi3(settings => settings.DocumentPath = "/api/specification.json");
app.UseSwaggerUi3(settings => settings.Path = "/api");
app.UseSwaggerUi(settings => settings.Path = "/api");

app.UseRouting();

Expand Down
49 changes: 21 additions & 28 deletions Src/WebUI/WebUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,24 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.SpaProxy" Version="7.0.1"/>
<PackageReference Include="Microsoft.AspNetCore.SpaProxy" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.0-rc.2.23480.2"/>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.0-rc.2.23480.2"/>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.0-rc.2.23480.2"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.0-rc.2.23480.1">
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="8.0.0-rc.2.23480.2"/>
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="8.0.0-rc.2.23480.2"/>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0-rc.2.23479.6"/>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.0-rc.2.23509.1"/>
<PackageReference Include="NSwag.AspNetCore" Version="13.20.0"/>
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Identity.Core" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.0" />
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.0"/>
<PackageReference Include="NSwag.MSBuild" Version="13.20.0">
<PackageReference Include="NSwag.AspNetCore" Version="14.0.0-preview010" />
<PackageReference Include="NSwag.MSBuild" Version="14.0.0-preview010">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand All @@ -51,6 +51,9 @@
<None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**"/>
<Content Remove="ClientApp\.angular\**"/>
<None Remove="ClientApp\.angular\**"/>
<Content Update="nswag.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
Expand All @@ -75,15 +78,14 @@
<_ContentIncludedByDefault Remove="Pages\_ViewStart.cshtml" />
</ItemGroup>

<!-- <Target Name="NSwag" AfterTargets="Build" Condition="'$(Configuration)' == 'Debug'">-->
<!-- <Copy SourceFiles="@(Reference)" DestinationFolder="$(OutDir)References"/>-->
<!-- <Exec Command="nswag run /variables:Configuration=$(Configuration) /runtime:Net80"/>-->
<!-- <RemoveDir Directories="$(OutDir)References"/>-->
<!-- </Target>-->
<Target Name="NSwag" AfterTargets="PostBuildEvent" Condition=" '$(Configuration)' == 'Debug'">
<Exec ConsoleToMSBuild="true" ContinueOnError="true" WorkingDirectory="$(ProjectDir)" EnvironmentVariables="ASPNETCORE_ENVIRONMENT=Development" Command="$(NSwagExe_Net80) run nswag.json /variables:Configuration=$(Configuration)">
<Output TaskParameter="ExitCode" PropertyName="NSwagExitCode" />
<Output TaskParameter="ConsoleOutput" PropertyName="NSwagOutput" />
</Exec>

<Target Name="SwaggerPostBuildClientAndSpec" AfterTargets="PostBuildEvent">
<!-- nswag will run all *.nswag and nswag.json by default -->
<Exec WorkingDirectory="$(ProjectDir)" Command="$(NSwagExe_Net70) run /variables:Configuration=$(Configuration)"/>
<Message Text="$(NSwagOutput)" Condition="'$(NSwagExitCode)' == '0'" Importance="low" />
<Error Text="$(NSwagOutput)" Condition="'$(NSwagExitCode)' != '0'" />
</Target>

<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
Expand All @@ -99,19 +101,10 @@
<Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
<!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install"/>
<!--
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build -prod"/>
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build:ssr -prod" Condition=" '$(BuildServerSideRenderer)' == 'true' "/>
-->
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build"/>

<!-- Include the newly-built files in the publish output -->
<ItemGroup>
<!--
<DistFiles Include="$(SpaRoot)dist\**; $(SpaRoot)dist-server\**"/>
<DistFiles Include="$(SpaRoot)node_modules\**" Condition="'$(BuildServerSideRenderer)' == 'true'"/>
<RelativePath>%(DistFiles.Identity)</RelativePath>
-->
<DistFiles Include="$(SpaRoot)build\**"/>
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">

Expand Down
2 changes: 1 addition & 1 deletion Src/WebUI/nswag.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"runtime": "Net70",
"runtime": "Net80",
"defaultVariables": null,
"documentGenerator": {
"aspNetCoreToOpenApi": {
Expand Down
20 changes: 1 addition & 19 deletions Src/WebUI/wwwroot/api/specification.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"x-generator": "NSwag v13.20.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0))",
"x-generator": "NSwag v14.0.0.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))",
"openapi": "3.0.0",
"info": {
"title": "Northwind Traders API",
Expand All @@ -11,7 +11,6 @@
"operationId": "PostRegister",
"requestBody": {
"x-name": "registration",
"description": "",
"content": {
"application/json": {
"schema": {
Expand Down Expand Up @@ -63,7 +62,6 @@
],
"requestBody": {
"x-name": "login",
"description": "",
"content": {
"application/json": {
"schema": {
Expand Down Expand Up @@ -92,7 +90,6 @@
"operationId": "PostRefresh",
"requestBody": {
"x-name": "refreshRequest",
"description": "",
"content": {
"application/json": {
"schema": {
Expand Down Expand Up @@ -160,7 +157,6 @@
"operationId": "PostResendConfirmationEmail",
"requestBody": {
"x-name": "resendRequest",
"description": "",
"content": {
"application/json": {
"schema": {
Expand All @@ -182,7 +178,6 @@
"operationId": "PostForgotPassword",
"requestBody": {
"x-name": "resetRequest",
"description": "",
"content": {
"application/json": {
"schema": {
Expand Down Expand Up @@ -214,7 +209,6 @@
"operationId": "PostResetPassword",
"requestBody": {
"x-name": "resetRequest",
"description": "",
"content": {
"application/json": {
"schema": {
Expand Down Expand Up @@ -246,7 +240,6 @@
"operationId": "PostManage2fa",
"requestBody": {
"x-name": "tfaRequest",
"description": "",
"content": {
"application/json": {
"schema": {
Expand Down Expand Up @@ -316,7 +309,6 @@
"operationId": "PostManageInfo",
"requestBody": {
"x-name": "infoRequest",
"description": "",
"content": {
"application/json": {
"schema": {
Expand Down Expand Up @@ -442,7 +434,6 @@
"operationId": "CreateCustomer",
"requestBody": {
"x-name": "command",
"description": "",
"content": {
"application/json": {
"schema": {
Expand Down Expand Up @@ -548,7 +539,6 @@
],
"requestBody": {
"x-name": "command",
"description": "",
"content": {
"application/json": {
"schema": {
Expand Down Expand Up @@ -670,7 +660,6 @@
"operationId": "CreateProduct",
"requestBody": {
"x-name": "command",
"description": "",
"content": {
"application/json": {
"schema": {
Expand Down Expand Up @@ -733,7 +722,6 @@
"operationId": "UpdateProduct",
"requestBody": {
"x-name": "command",
"description": "",
"content": {
"application/json": {
"schema": {
Expand Down Expand Up @@ -1106,12 +1094,6 @@
},
"isEmailConfirmed": {
"type": "boolean"
},
"claims": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
},
Expand Down
6 changes: 3 additions & 3 deletions Tests/Application.UnitTests/Application.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
<PackageReference Include="AutoFixture" Version="4.18.0" />
<PackageReference Include="Bogus" Version="34.0.2" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.0-rc.2.23480.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit" Version="2.6.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
9 changes: 4 additions & 5 deletions Tests/Common/Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@

<ItemGroup>
<PackageReference Include="Bogus" Version="34.0.2" />
<PackageReference Include="Meziantou.Extensions.Logging.Xunit" Version="1.0.6" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0-rc.2.23480.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0-rc.2.23479.6" />
<PackageReference Include="Meziantou.Extensions.Logging.Xunit" Version="1.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0" />
<PackageReference Include="Respawn" Version="6.1.0" />
<PackageReference Include="Testcontainers.SqlEdge" Version="3.5.0" />
<PackageReference Include="xunit.extensibility.core" Version="2.5.3" />
<PackageReference Include="Testcontainers.SqlEdge" Version="3.6.0" />
<PackageReference Include="xunit.extensibility.core" Version="2.6.1" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions Tests/Domain.UnitTests/Domain.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0"/>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0-rc.2.23480.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0-rc.2.23479.6" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="Respawn" Version="6.1.0" />
<PackageReference Include="Testcontainers" Version="3.5.0" />
<PackageReference Include="Testcontainers.SqlEdge" Version="3.5.0" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="Testcontainers" Version="3.6.0" />
<PackageReference Include="Testcontainers.SqlEdge" Version="3.6.0" />
<PackageReference Include="xunit" Version="2.6.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
Loading

0 comments on commit 5c0b2a0

Please sign in to comment.