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

Bump to .Net 8 + Update Nuget Packages to non vulnerable version #278

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ jobs:
NUGET_CERT_REVOCATION_MODE: offline
steps:
- name: Get Source
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
3.1.x
6.0.x
8.0.x
9.0.x
- name: Build and Test
run: dotnet test --logger "trx;LogFileName=test-results.trx"
- name: Upload Test Results
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-results-${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ TestResult.xml
*.pfx
.idea
.ionide
cache/
cache/
31 changes: 18 additions & 13 deletions src/core/Statiq.App/Statiq.App.csproj
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>Statiq is a configurable static content generation framework. This library provides everything you need to start using it to make your own static generator.</Description>
<PackageTags>Statiq Static StaticContent StaticSite</PackageTags>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904;CA1724;CA1062;CA1725;VSTHRD103;CA1711</WarningsNotAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904;CA1724;CA1062;CA1725;VSTHRD103;CA1711</WarningsNotAsErrors>
</PropertyGroup>

<ItemGroup>
<None Include="Statiq.App.targets" Pack="true" PackagePath="build\$(TargetFramework)\" />
<None Include="Statiq.App.targets" Pack="true" PackagePath="buildTransitive\$(TargetFramework)\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.1.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="3.1.18" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="3.1.18" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.18" />
<PackageReference Include="Microsoft.Extensions.Configuration.Xml" Version="3.1.18" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.18" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.18" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="3.1.18" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.10.0" />
<PackageReference Include="NetEscapades.Configuration.Yaml" Version="3.1.0" />
<PackageReference Include="NetEscapades.Extensions.Logging.RollingFile" Version="2.2.0" />
<PackageReference Include="Spectre.Console" Version="0.45.0" />
<PackageReference Include="Spectre.Console.Cli" Version="0.45.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Xml" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Statiq.Common\Statiq.Common.csproj" />
<ProjectReference Include="..\Statiq.Core\Statiq.Core.csproj" />
<ProjectReference Include="..\Statiq.Testing\Statiq.Testing.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="Microsoft.VisualStudio.Threading.Analyzers" Version="17.10.48" />
</ItemGroup>
</Project>
24 changes: 17 additions & 7 deletions src/core/Statiq.Common/Statiq.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,23 @@
<PropertyGroup>
<Description>Statiq is a configurable static content generation framework. This library provides a common set of abstractions and other classes to make writing extensions easier.</Description>
<PackageTags>Statiq Static StaticContent StaticSite Blog BlogEngine</PackageTags>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904;CA1724;CA1062;CA1040;CA1711;CA1725;CA1021;CA1720;CS0672;CA1721;CA1710;SYSLIB0010;VSTHRD110</WarningsNotAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904;CA1724;CA1062;CA1040;CA1711;CA1725;CA1021;CA1720;CS0672;CA1721;CA1710;SYSLIB0010;VSTHRD110</WarningsNotAsErrors>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AngleSharp" Version="0.16.1" />
<PackageReference Include="ConcurrentHashSet" Version="1.1.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="3.1.18" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.18" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="3.1.6" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="3.1.18" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.1.18" />
<PackageReference Include="AngleSharp" Version="1.1.2" />
<PackageReference Include="ConcurrentHashSet" Version="1.3.0" />
<PackageReference Include="NetFabric.Hyperlinq" Version="3.0.0-beta48" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
</ItemGroup>
<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
Expand All @@ -21,4 +28,7 @@
<_Parameter1>Statiq.Testing</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.VisualStudio.Threading.Analyzers" Version="17.10.48" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions src/core/Statiq.Core/Execution/Engine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public Engine(
FileCleaner = Services.GetRequiredService<IFileCleaner>();

_diagnosticsTraceListener = new DiagnosticsTraceListener(Logger);
Trace.Listeners.Add(_diagnosticsTraceListener);
System.Diagnostics.Trace.Listeners.Add(_diagnosticsTraceListener);

// Add the service-based pipelines as late as possible so other services have been configured
AddServicePipelines();
Expand Down Expand Up @@ -1140,7 +1140,7 @@ public void Dispose()
}
}

Trace.Listeners.Remove(_diagnosticsTraceListener);
System.Diagnostics.Trace.Listeners.Remove(_diagnosticsTraceListener);
FileCleaner.CleanDirectory(FileSystem.GetTempDirectory(), "temp");
_serviceScope.Dispose();
_disposed = true;
Expand Down
8 changes: 4 additions & 4 deletions src/core/Statiq.Core/Execution/IEngineExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ public static void LogAndCheckVersion(this IEngine engine, Assembly assembly, st
// Get and print the version
string informationalVersion = versionAttribute.InformationalVersion;
engine.Logger.LogInformation($"{name} version {informationalVersion}", true);
SemVer.Version version = new SemVer.Version(informationalVersion, true);
SemanticVersioning.Version version = new SemanticVersioning.Version(informationalVersion, true);

// Get all version ranges
(string Key, SemVer.Version Version)[] minimumVersions = engine.Settings.Keys
(string Key, SemanticVersioning.Version Version)[] minimumVersions = engine.Settings.Keys
.Where(k => k.StartsWith(minimumVersionKey))
.Select(k => (Key: k, Value: engine.Settings.GetString(k)))
.Where(x => !x.Value.IsNullOrWhiteSpace())
.Select(x => (x.Key, new SemVer.Version(x.Value, true)))
.Select(x => (x.Key, new SemanticVersioning.Version(x.Value, true)))
.ToArray();
foreach ((string Key, SemVer.Version Version) minimumVersion in minimumVersions)
foreach ((string Key, SemanticVersioning.Version Version) minimumVersion in minimumVersions)
{
if (version < minimumVersion.Version)
{
Expand Down
12 changes: 6 additions & 6 deletions src/core/Statiq.Core/Execution/MemoryStreamFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ public class MemoryStreamFactory : IMemoryStreamFactory
private const int BlockSize = 16384;

private readonly RecyclableMemoryStreamManager _manager =
new RecyclableMemoryStreamManager(
BlockSize,
RecyclableMemoryStreamManager.DefaultLargeBufferMultiple,
RecyclableMemoryStreamManager.DefaultMaximumBufferSize)
new RecyclableMemoryStreamManager(new RecyclableMemoryStreamManager.Options
{
MaximumFreeSmallPoolBytes = BlockSize * 32768L * 2, // 1 GB
};
BlockSize = BlockSize,
LargeBufferMultiple = RecyclableMemoryStreamManager.DefaultLargeBufferMultiple,
MaximumBufferSize = RecyclableMemoryStreamManager.DefaultMaximumBufferSize,
MaximumSmallPoolFreeBytes = BlockSize * 32768L * 2, // 1 GB
});

public virtual MemoryStream GetStream() => _manager.GetStream();

Expand Down
2 changes: 1 addition & 1 deletion src/core/Statiq.Core/Modules/Content/InsertLinks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public InsertLinks WithEndWordSeparators(params char[] endWordSeparators)
foreach (IElement element in htmlDocument.QuerySelectorAll(_querySelector).Where(t => !t.Ancestors<IHtmlAnchorElement>().Any()))
{
// Enumerate all descendant text nodes not already in a link element
foreach (IText text in element.Descendents().OfType<IText>().Where(t => !t.Ancestors<IHtmlAnchorElement>().Any()))
foreach (IText text in element.Descendants<IText>().Where(t => !t.Ancestors<IHtmlAnchorElement>().Any()))
{
if (ReplaceStrings(text, links, out string newText))
{
Expand Down
28 changes: 19 additions & 9 deletions src/core/Statiq.Core/Statiq.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,26 @@
<PropertyGroup>
<Description>Statiq is a configurable static content generation framework.</Description>
<PackageTags>Statiq Static StaticContent StaticSite Blog BlogEngine</PackageTags>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904;CA1724;CA1062;CA1725;CA1711;CA1505</WarningsNotAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904;CA1724;CA1062;CA1725;CA1711;CA1505</WarningsNotAsErrors>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JavaScriptEngineSwitcher.Core" Version="3.21.0" />
<PackageReference Include="JavaScriptEngineSwitcher.Jint" Version="3.21.2" />
<PackageReference Include="JavaScriptEngineSwitcher.Core" Version="3.24.1" />
<PackageReference Include="JavaScriptEngineSwitcher.Jint" Version="3.27.0" />
<PackageReference Include="JSPool" Version="2.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.18" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="1.2.2" />
<PackageReference Include="Polly" Version="7.1.1" />
<PackageReference Include="SemanticVersioning" Version="1.2.2" />
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
<PackageReference Include="Polly" Version="8.4.1" />
<PackageReference Include="SemanticVersioning" Version="2.0.2" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.1" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="System.Collections.Immutable" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Statiq.Common\Statiq.Common.csproj" />
Expand All @@ -24,4 +31,7 @@
<_Parameter1>Statiq.Common.Tests</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.VisualStudio.Threading.Analyzers" Version="17.10.48" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
<PropertyGroup>
<Description>Statiq is a configurable static content generation framework. This library provides utility classes to make testing JavaScript components easier.</Description>
<PackageTags>Statiq Static StaticContent StaticSite Blog BlogEngine</PackageTags>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JavaScriptEngineSwitcher.Core" Version="3.21.0" />
<PackageReference Include="JavaScriptEngineSwitcher.Jint" Version="3.21.2" />
<PackageReference Include="JavaScriptEngineSwitcher.Core" Version="3.24.1" />
<PackageReference Include="JavaScriptEngineSwitcher.Jint" Version="3.27.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Statiq.Common\Statiq.Common.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.VisualStudio.Threading.Analyzers" Version="17.10.48" />
</ItemGroup>
</Project>
20 changes: 15 additions & 5 deletions src/core/Statiq.Testing/Statiq.Testing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,28 @@
<PropertyGroup>
<Description>Statiq is a configurable static content generation framework. This library provides utility classes to make testing easier.</Description>
<PackageTags>Statiq Static StaticContent StaticSite Blog BlogEngine</PackageTags>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904;CA1724;CA1725;CA1062;CA1710;CA1711;CA1721</WarningsNotAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904;CA1724;CA1725;CA1062;CA1710;CA1711;CA1721</WarningsNotAsErrors>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.18" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.18" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="Shouldly" Version="4.0.3">
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="Shouldly" Version="4.2.1">
<!-- See https://github.com/shouldly/shouldly/issues/795 -->
<ExcludeAssets>build</ExcludeAssets>
</PackageReference>
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="System.Collections.Immutable" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Statiq.Common\Statiq.Common.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.VisualStudio.Threading.Analyzers" Version="17.10.48" />
</ItemGroup>
</Project>
12 changes: 11 additions & 1 deletion src/extensions/Statiq.CodeAnalysis/Statiq.CodeAnalysis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@
<PropertyGroup>
<Description>Statiq is a configurable static content generation framework. This library provides support for performing code analysis.</Description>
<PackageTags>Statiq Static StaticContent StaticSite Blog BlogEngine CodeAnalysis Roslyn XmlDocComments DocComments</PackageTags>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904;CA1724;CA1062</WarningsNotAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904;CA1724;CA1062</WarningsNotAsErrors>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Buildalyzer.Workspaces" Version="4.1.2" />
<PackageReference Include="Buildalyzer.Workspaces" Version="7.0.2" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\core\Statiq.Common\Statiq.Common.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.VisualStudio.Threading.Analyzers" Version="17.10.48" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/extensions/Statiq.Feeds/GenerateFeeds.cs
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ private static string MakeLinksAbsolute(HtmlParser parser, HtmlMarkupFormatter f
{
IHtmlDocument dom = parser.ParseDocument(string.Empty);
INodeList nodes = parser.ParseFragment(value, dom.Body);
IEnumerable<IElement> elements = nodes.SelectMany(x => x.Descendents<IElement>().Where(y => y.HasAttribute("href") || y.HasAttribute("src")));
IEnumerable<IElement> elements = nodes.SelectMany(x => x.Descendants<IElement>().Where(y => y.HasAttribute("href") || y.HasAttribute("src")));
bool replaced = false;
foreach (IElement element in elements)
{
Expand Down
10 changes: 10 additions & 0 deletions src/extensions/Statiq.Feeds/Statiq.Feeds.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@
<PropertyGroup>
<Description>Statiq is a configurable static content generation framework. This library provides support for feeds and syndication including RSS and Atom.</Description>
<PackageTags>Statiq Static StaticContent StaticSite RSS Atom Syndication</PackageTags>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904;CA1724;CA1062;SYSLIB0013;CA1720</WarningsNotAsErrors>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<WarningsNotAsErrors>NU1901;NU1902;NU1903;NU1904;CA1724;CA1062;SYSLIB0013;CA1720</WarningsNotAsErrors>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\core\Statiq.Common\Statiq.Common.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Update="Microsoft.VisualStudio.Threading.Analyzers" Version="17.10.48" />
</ItemGroup>
</Project>
Loading
Loading