From e1ef02d4264b1ee30660ad988b48071b09a1c407 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Wed, 20 Sep 2023 17:04:20 -0700 Subject: [PATCH] feat: support net8.0 (#317) --- .editorconfig | 2 +- .github/workflows/part-build.yml | 10 +++++++- coalesce-vue3.json | 4 ++-- playground/Coalesce.Domain/Case.cs | 2 ++ .../Coalesce.Domain/Coalesce.Domain.csproj | 8 ++++++- playground/Coalesce.Domain/MyDataSource.cs | 1 - .../Coalesce.Web.Vue3.csproj | 3 +-- playground/Coalesce.Web.Vue3/package.json | 2 +- playground/Directory.Build.props | 2 +- src/Directory.Build.props | 17 ++++++++++--- ...iTect.Coalesce.CodeGeneration.Tests.csproj | 2 +- .../TargetClassesFullGenerationTest.cs | 1 + .../IntelliTect.Coalesce.DotnetCliTool.csproj | 17 ++++++++----- .../IntelliTect.Coalesce.DotnetTool.csproj | 2 +- ...elliTect.Coalesce.Swashbuckle.Tests.csproj | 10 ++------ .../IntelliTect.Coalesce.Tests.csproj | 14 ++++------- .../Util/ReflectionRepositoryFactory.cs | 1 - .../DevMiddleware/NodeScriptRunner.cs | 11 +-------- .../IntelliTect.Coalesce.Vue.csproj | 11 +++------ .../Api/Controllers/ApiActionFilter.cs | 1 - .../Api/Controllers/BaseApiController.cs | 2 -- .../Api/DataSources/ProjectedDtoDataSource.cs | 13 +--------- .../DataSources/QueryableDataSourceBase`1.cs | 10 +------- .../Api/DataSources/StandardDataSource`1.cs | 12 +++++----- .../Api/DataSources/StandardDataSource`2.cs | 11 ++------- .../IntelliTect.Coalesce.csproj | 21 ++++++++-------- .../TypeDefinition/ClassViewModel.cs | 24 ++++++++----------- 27 files changed, 93 insertions(+), 121 deletions(-) diff --git a/.editorconfig b/.editorconfig index b12104ff7..8ee388c98 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,6 +1,6 @@ # Suppress: EC112 -[*.{vue,ts,js,scss,html,csproj,md}] +[*.{vue,ts,js,scss,html,csproj,md,props}] indent_style = space indent_size = 2 diff --git a/.github/workflows/part-build.yml b/.github/workflows/part-build.yml index eb8e0e0e1..53f79e8e2 100644 --- a/.github/workflows/part-build.yml +++ b/.github/workflows/part-build.yml @@ -100,6 +100,8 @@ jobs: 2.2.x 6.0.x 7.0.x + 8.0.x + include-prerelease: true - run: npm ci working-directory: src/coalesce-vue @@ -133,6 +135,8 @@ jobs: dotnet-version: | 6.0.x 7.0.x + 8.0.x + include-prerelease: true - run: npm ci - run: npx gulp coalesce @@ -156,6 +160,8 @@ jobs: dotnet-version: | 6.0.x 7.0.x + 8.0.x + include-prerelease: true - run: npm ci working-directory: src/coalesce-vue @@ -180,7 +186,9 @@ jobs: - run: npm i -g npm@9.5.0 # Pin NPM to avoid breaking changes like https://github.com/nodejs/node/issues/46542 - uses: actions/setup-dotnet@v2 with: - dotnet-version: 7.0.x + dotnet-version: | + 8.0.x + include-prerelease: true - run: npm ci working-directory: src/coalesce-vue diff --git a/coalesce-vue3.json b/coalesce-vue3.json index 1a19721a8..762844d4f 100644 --- a/coalesce-vue3.json +++ b/coalesce-vue3.json @@ -1,11 +1,11 @@ { "webProject": { "projectFile": "./playground/Coalesce.Web.Vue3/Coalesce.Web.Vue3.csproj", - "framework": "net7.0" + "framework": "net8.0" }, "dataProject": { "projectFile": "./playground/Coalesce.Domain/Coalesce.Domain.csproj", - "framework": "net7.0" + "framework": "net8.0" }, //"rootTypesWhitelist": [ // "CaseDto" diff --git a/playground/Coalesce.Domain/Case.cs b/playground/Coalesce.Domain/Case.cs index e6ffc100f..ef9e01256 100644 --- a/playground/Coalesce.Domain/Case.cs +++ b/playground/Coalesce.Domain/Case.cs @@ -231,6 +231,8 @@ public override IQueryable GetQuery(IDataSourceParameters parameters) => D [Coalesce] public static CaseSummary GetCaseSummary(AppDbContext db) { + int[] a = [1, 2, 3, 4, 5, 6, 7, 8]; + return CaseSummary.GetCaseSummary(db); } } diff --git a/playground/Coalesce.Domain/Coalesce.Domain.csproj b/playground/Coalesce.Domain/Coalesce.Domain.csproj index 171214b68..3b6f3d166 100644 --- a/playground/Coalesce.Domain/Coalesce.Domain.csproj +++ b/playground/Coalesce.Domain/Coalesce.Domain.csproj @@ -9,7 +9,7 @@ dotnet ef database update - -framework netcoreapp2.1 (no space between the dashes; space is there because double dash is illegal in XML comments). --> - net6.0;net7.0 + net6.0;net7.0;net8.0 false enable @@ -32,6 +32,12 @@ + + + + + + diff --git a/playground/Coalesce.Domain/MyDataSource.cs b/playground/Coalesce.Domain/MyDataSource.cs index 2b0f75e08..399a260ed 100644 --- a/playground/Coalesce.Domain/MyDataSource.cs +++ b/playground/Coalesce.Domain/MyDataSource.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Text; using System.Linq; -using System.Linq.Dynamic.Core; using IntelliTect.Coalesce.Models; using Microsoft.EntityFrameworkCore; using System.Threading.Tasks; diff --git a/playground/Coalesce.Web.Vue3/Coalesce.Web.Vue3.csproj b/playground/Coalesce.Web.Vue3/Coalesce.Web.Vue3.csproj index edf9ea3f8..205047dc7 100644 --- a/playground/Coalesce.Web.Vue3/Coalesce.Web.Vue3.csproj +++ b/playground/Coalesce.Web.Vue3/Coalesce.Web.Vue3.csproj @@ -1,14 +1,13 @@  - net7.0 + net8.0 true Latest false InProcess enable - 11.0 true diff --git a/playground/Coalesce.Web.Vue3/package.json b/playground/Coalesce.Web.Vue3/package.json index 049d02c91..0f80c24c2 100644 --- a/playground/Coalesce.Web.Vue3/package.json +++ b/playground/Coalesce.Web.Vue3/package.json @@ -11,7 +11,7 @@ "dev": "vite", "lint:fix": "eslint src --fix", "test": "vitest", - "coalesce": "dotnet run --project ../../src/IntelliTect.Coalesce.DotnetTool --framework net7.0 -- ../../coalesce-vue3.json" + "coalesce": "dotnet run --project ../../src/IntelliTect.Coalesce.DotnetTool --framework net8.0 -- ../../coalesce-vue3.json" }, "dependencies": { "@fortawesome/fontawesome-free": "5.15.4", diff --git a/playground/Directory.Build.props b/playground/Directory.Build.props index aceb32080..ffb0afe15 100644 --- a/playground/Directory.Build.props +++ b/playground/Directory.Build.props @@ -1,6 +1,6 @@ - 11.0 + 12.0 true Latest diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 0eba8d896..38f6cea98 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -5,7 +5,7 @@ Coalesce Web Framework Copyright IntelliTect © 2020, All Rights Reserved. en-US - + $(NoWarn);CS1591 true @@ -21,7 +21,7 @@ https://github.com/IntelliTect/Coalesce git - 11.0 + 12.0 true Latest @@ -34,10 +34,20 @@ snupkg + + 6.0.* + + + 7.0.* + + + 8.0.*-* + + - + true @@ -64,4 +74,5 @@ analyzers + \ No newline at end of file diff --git a/src/IntelliTect.Coalesce.CodeGeneration.Tests/IntelliTect.Coalesce.CodeGeneration.Tests.csproj b/src/IntelliTect.Coalesce.CodeGeneration.Tests/IntelliTect.Coalesce.CodeGeneration.Tests.csproj index aa2f58c2e..c2abf6190 100644 --- a/src/IntelliTect.Coalesce.CodeGeneration.Tests/IntelliTect.Coalesce.CodeGeneration.Tests.csproj +++ b/src/IntelliTect.Coalesce.CodeGeneration.Tests/IntelliTect.Coalesce.CodeGeneration.Tests.csproj @@ -1,7 +1,7 @@  - net6.0;net7.0 + net6.0;net7.0;net8.0 true false diff --git a/src/IntelliTect.Coalesce.CodeGeneration.Tests/TargetClassesFullGenerationTest.cs b/src/IntelliTect.Coalesce.CodeGeneration.Tests/TargetClassesFullGenerationTest.cs index fe8bd7f74..456859008 100644 --- a/src/IntelliTect.Coalesce.CodeGeneration.Tests/TargetClassesFullGenerationTest.cs +++ b/src/IntelliTect.Coalesce.CodeGeneration.Tests/TargetClassesFullGenerationTest.cs @@ -33,6 +33,7 @@ public async Task VueOutputCompiles() await Task.WhenAll( Task.Run(() => AssertVueSuiteTypescriptOutputCompiles(suite, "4.9")), Task.Run(() => AssertVueSuiteTypescriptOutputCompiles(suite, "5")), + Task.Run(() => AssertVueSuiteTypescriptOutputCompiles(suite, "5.2")), Task.Run(() => AssertSuiteCSharpOutputCompiles(suite)) ); } diff --git a/src/IntelliTect.Coalesce.DotnetCliTool/IntelliTect.Coalesce.DotnetCliTool.csproj b/src/IntelliTect.Coalesce.DotnetCliTool/IntelliTect.Coalesce.DotnetCliTool.csproj index ab37b4746..acc6535cb 100644 --- a/src/IntelliTect.Coalesce.DotnetCliTool/IntelliTect.Coalesce.DotnetCliTool.csproj +++ b/src/IntelliTect.Coalesce.DotnetCliTool/IntelliTect.Coalesce.DotnetCliTool.csproj @@ -10,16 +10,16 @@ --> - netcoreapp2.1;net6.0;net7.0 + netcoreapp2.1;net6.0;net7.0;net8.0 - false - + so we keep building for this target framework because it doesn't require + hacky workarounds () in the consuming project. + --> + false + AnyCPU dotnet-coalesce @@ -27,6 +27,11 @@ DotnetCliTool + + + + + diff --git a/src/IntelliTect.Coalesce.DotnetTool/IntelliTect.Coalesce.DotnetTool.csproj b/src/IntelliTect.Coalesce.DotnetTool/IntelliTect.Coalesce.DotnetTool.csproj index aaceaa954..de1663385 100644 --- a/src/IntelliTect.Coalesce.DotnetTool/IntelliTect.Coalesce.DotnetTool.csproj +++ b/src/IntelliTect.Coalesce.DotnetTool/IntelliTect.Coalesce.DotnetTool.csproj @@ -6,7 +6,7 @@ https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools-how-to-create --> - net6.0;net7.0 + net6.0;net7.0;net8.0 true coalesce diff --git a/src/IntelliTect.Coalesce.Swashbuckle.Tests/IntelliTect.Coalesce.Swashbuckle.Tests.csproj b/src/IntelliTect.Coalesce.Swashbuckle.Tests/IntelliTect.Coalesce.Swashbuckle.Tests.csproj index f1f169a53..403764216 100644 --- a/src/IntelliTect.Coalesce.Swashbuckle.Tests/IntelliTect.Coalesce.Swashbuckle.Tests.csproj +++ b/src/IntelliTect.Coalesce.Swashbuckle.Tests/IntelliTect.Coalesce.Swashbuckle.Tests.csproj @@ -1,7 +1,7 @@  - net6.0;net7.0 + net6.0;net7.0;net8.0 enable false @@ -12,13 +12,6 @@ - - - - - - - @@ -30,6 +23,7 @@ runtime; build; native; contentfiles; analyzers + diff --git a/src/IntelliTect.Coalesce.Tests/IntelliTect.Coalesce.Tests.csproj b/src/IntelliTect.Coalesce.Tests/IntelliTect.Coalesce.Tests.csproj index 2d9554239..265af8c88 100644 --- a/src/IntelliTect.Coalesce.Tests/IntelliTect.Coalesce.Tests.csproj +++ b/src/IntelliTect.Coalesce.Tests/IntelliTect.Coalesce.Tests.csproj @@ -1,7 +1,7 @@  - net6.0;net7.0 + net6.0;net7.0;net8.0 true false @@ -10,16 +10,10 @@ - - - - - - - - - + + + diff --git a/src/IntelliTect.Coalesce.Tests/Util/ReflectionRepositoryFactory.cs b/src/IntelliTect.Coalesce.Tests/Util/ReflectionRepositoryFactory.cs index 497b05783..afbe88e33 100644 --- a/src/IntelliTect.Coalesce.Tests/Util/ReflectionRepositoryFactory.cs +++ b/src/IntelliTect.Coalesce.Tests/Util/ReflectionRepositoryFactory.cs @@ -4,7 +4,6 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.Text; -using Microsoft.EntityFrameworkCore.InMemory.Infrastructure.Internal; using System; using System.Collections.Generic; using System.Linq; diff --git a/src/IntelliTect.Coalesce.Vue/DevMiddleware/NodeScriptRunner.cs b/src/IntelliTect.Coalesce.Vue/DevMiddleware/NodeScriptRunner.cs index 90792598a..753a9e820 100644 --- a/src/IntelliTect.Coalesce.Vue/DevMiddleware/NodeScriptRunner.cs +++ b/src/IntelliTect.Coalesce.Vue/DevMiddleware/NodeScriptRunner.cs @@ -1,19 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Diagnostics; -using System.Globalization; -using System.Text.RegularExpressions; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.AspNetCore.NodeServices.Npm; -using Microsoft.AspNetCore.NodeServices.Util; -using Microsoft.AspNetCore.SpaServices.Extensions.Util; -using Microsoft.AspNetCore.SpaServices.Util; -using Microsoft.Extensions.Logging; - namespace IntelliTect.Coalesce.Vue.DevMiddleware { diff --git a/src/IntelliTect.Coalesce.Vue/IntelliTect.Coalesce.Vue.csproj b/src/IntelliTect.Coalesce.Vue/IntelliTect.Coalesce.Vue.csproj index aea840102..07766e4eb 100644 --- a/src/IntelliTect.Coalesce.Vue/IntelliTect.Coalesce.Vue.csproj +++ b/src/IntelliTect.Coalesce.Vue/IntelliTect.Coalesce.Vue.csproj @@ -2,8 +2,7 @@ Vue.js shared code for server projects for IntelliTect.Coalesce - net6.0;net7.0 - 10.0 + net6.0;net7.0;net8.0 enable @@ -11,12 +10,8 @@ - - - - - - + + diff --git a/src/IntelliTect.Coalesce/Api/Controllers/ApiActionFilter.cs b/src/IntelliTect.Coalesce/Api/Controllers/ApiActionFilter.cs index c1571289d..c97512915 100644 --- a/src/IntelliTect.Coalesce/Api/Controllers/ApiActionFilter.cs +++ b/src/IntelliTect.Coalesce/Api/Controllers/ApiActionFilter.cs @@ -1,6 +1,5 @@ using System; using System.Linq; -using System.Linq.Dynamic.Core; using IntelliTect.Coalesce.Models; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; diff --git a/src/IntelliTect.Coalesce/Api/Controllers/BaseApiController.cs b/src/IntelliTect.Coalesce/Api/Controllers/BaseApiController.cs index 7957de039..6d3539032 100644 --- a/src/IntelliTect.Coalesce/Api/Controllers/BaseApiController.cs +++ b/src/IntelliTect.Coalesce/Api/Controllers/BaseApiController.cs @@ -6,11 +6,9 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; using System; using System.Collections.Generic; using System.Linq; -using System.Linq.Dynamic.Core; using System.Net; using System.Threading.Tasks; diff --git a/src/IntelliTect.Coalesce/Api/DataSources/ProjectedDtoDataSource.cs b/src/IntelliTect.Coalesce/Api/DataSources/ProjectedDtoDataSource.cs index 832f0f564..82ac25d9c 100644 --- a/src/IntelliTect.Coalesce/Api/DataSources/ProjectedDtoDataSource.cs +++ b/src/IntelliTect.Coalesce/Api/DataSources/ProjectedDtoDataSource.cs @@ -3,19 +3,8 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Linq.Dynamic.Core; -using System.Security.Claims; -using System.Text; -using System.Threading.Tasks; -using IntelliTect.Coalesce.TypeDefinition; -using Microsoft.EntityFrameworkCore.Query.Internal; -using IntelliTect.Coalesce.Mapping.IncludeTrees; -using IntelliTect.Coalesce.Mapping; -using IntelliTect.Coalesce.Api; -using IntelliTect.Coalesce.Utilities; -using System.Collections.ObjectModel; -using IntelliTect.Coalesce.Api.DataSources; using System.Threading; +using System.Threading.Tasks; namespace IntelliTect.Coalesce { diff --git a/src/IntelliTect.Coalesce/Api/DataSources/QueryableDataSourceBase`1.cs b/src/IntelliTect.Coalesce/Api/DataSources/QueryableDataSourceBase`1.cs index 8803e03fc..378afbb63 100644 --- a/src/IntelliTect.Coalesce/Api/DataSources/QueryableDataSourceBase`1.cs +++ b/src/IntelliTect.Coalesce/Api/DataSources/QueryableDataSourceBase`1.cs @@ -1,16 +1,8 @@ -using IntelliTect.Coalesce.Models; -using Microsoft.EntityFrameworkCore; +using IntelliTect.Coalesce.TypeDefinition; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Dynamic.Core; -using System.Threading.Tasks; -using IntelliTect.Coalesce.TypeDefinition; -using IntelliTect.Coalesce.Mapping; -using IntelliTect.Coalesce.Api; -using System.Collections.ObjectModel; -using System.Threading; -using Microsoft.EntityFrameworkCore.Query.Internal; using System.Security.Claims; namespace IntelliTect.Coalesce diff --git a/src/IntelliTect.Coalesce/Api/DataSources/StandardDataSource`1.cs b/src/IntelliTect.Coalesce/Api/DataSources/StandardDataSource`1.cs index 002a49eef..744138780 100644 --- a/src/IntelliTect.Coalesce/Api/DataSources/StandardDataSource`1.cs +++ b/src/IntelliTect.Coalesce/Api/DataSources/StandardDataSource`1.cs @@ -1,14 +1,14 @@ -using IntelliTect.Coalesce.Models; +using IntelliTect.Coalesce.Api; +using IntelliTect.Coalesce.Mapping; +using IntelliTect.Coalesce.Models; +using IntelliTect.Coalesce.TypeDefinition; using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Linq; using System.Linq.Dynamic.Core; -using System.Threading.Tasks; -using IntelliTect.Coalesce.TypeDefinition; -using IntelliTect.Coalesce.Mapping; -using System.Collections.ObjectModel; using System.Threading; -using IntelliTect.Coalesce.Api; +using System.Threading.Tasks; namespace IntelliTect.Coalesce { diff --git a/src/IntelliTect.Coalesce/Api/DataSources/StandardDataSource`2.cs b/src/IntelliTect.Coalesce/Api/DataSources/StandardDataSource`2.cs index 72bf98692..72923c152 100644 --- a/src/IntelliTect.Coalesce/Api/DataSources/StandardDataSource`2.cs +++ b/src/IntelliTect.Coalesce/Api/DataSources/StandardDataSource`2.cs @@ -1,17 +1,10 @@ -using IntelliTect.Coalesce.Models; -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; using System.Linq.Dynamic.Core; -using System.Threading.Tasks; -using IntelliTect.Coalesce.TypeDefinition; -using IntelliTect.Coalesce.Mapping; -using IntelliTect.Coalesce.Api; -using System.Collections.ObjectModel; using System.Threading; -using Microsoft.EntityFrameworkCore.Query.Internal; -using System.Security.Claims; +using System.Threading.Tasks; namespace IntelliTect.Coalesce { diff --git a/src/IntelliTect.Coalesce/IntelliTect.Coalesce.csproj b/src/IntelliTect.Coalesce/IntelliTect.Coalesce.csproj index f304eb2cf..f2c26cd6c 100644 --- a/src/IntelliTect.Coalesce/IntelliTect.Coalesce.csproj +++ b/src/IntelliTect.Coalesce/IntelliTect.Coalesce.csproj @@ -1,7 +1,7 @@  Core framework library for IntelliTect.Coalesce - netstandard2.0;net6.0;net7.0 + netstandard2.0;net6.0;net7.0;net8.0 AnyCPU enable @@ -34,20 +34,21 @@ + + + + + + - - - - - - - - - + + + + \ No newline at end of file diff --git a/src/IntelliTect.Coalesce/TypeDefinition/ClassViewModel.cs b/src/IntelliTect.Coalesce/TypeDefinition/ClassViewModel.cs index f7d35f350..a07eaf2c0 100644 --- a/src/IntelliTect.Coalesce/TypeDefinition/ClassViewModel.cs +++ b/src/IntelliTect.Coalesce/TypeDefinition/ClassViewModel.cs @@ -1,20 +1,16 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Dynamic; -using System.Reflection; -using System.Linq.Expressions; -using System.ComponentModel; -using System.Text.RegularExpressions; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using IntelliTect.Coalesce.DataAnnotations; +using IntelliTect.Coalesce.DataAnnotations; +using IntelliTect.Coalesce.Helpers.Search; +using IntelliTect.Coalesce.TypeUsage; using IntelliTect.Coalesce.Utilities; using Microsoft.CodeAnalysis; -using IntelliTect.Coalesce.Helpers; -using IntelliTect.Coalesce.Helpers.Search; using Microsoft.EntityFrameworkCore; -using IntelliTect.Coalesce.TypeUsage; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; namespace IntelliTect.Coalesce.TypeDefinition {