diff --git a/.vscode/settings.json b/.vscode/settings.json index 7fd0d81..727e83e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,5 +2,6 @@ "cSpell.words": [ "appsettings", "tailwindcss" - ] -} \ No newline at end of file + ], + "dotnet.defaultSolution": "TailwindCssTagHelpers.sln" +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 53c5133..51a8374 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +- Dropped support for .NET 6 +- Dropped support for .NET 7 +- Added support for .NET 8 + ## [0.5.0](https://github.com/xt0rted/tailwindcss-tag-helpers/compare/v0.4.0...v0.5.0) - 2023-02-24 - Dropped support for .NET Core 3.1 diff --git a/Directory.Build.props b/Directory.Build.props index 5477e8a..7df8cef 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - net7.0;net6.0 + net8.0 preview enable enable diff --git a/global.json b/global.json index 31683ae..dd48e7e 100644 --- a/global.json +++ b/global.json @@ -1,16 +1,15 @@ { "sdk": { - "version": "7.0.407" + "version": "8.0.203" }, "scripts": { "clean": "dotnet rimraf artifacts", "clean:bin": "dotnet rimraf **/bin **/obj", "build": "dotnet build", "test": "dotnet test", - "test:31": "dotnet test --framework netcoreapp3.1", - "test:6": "dotnet test --framework net6.0", "pack": "dotnet pack --output ./artifacts", "ci": "dotnet r build test pack", - "watch": "dotnet watch [env:DOTNET_WATCH_RESTART_ON_RUDE_EDIT=true] --verbose --project sample" + "watch": "dotnet r [env:DOTNET_WATCH_RESTART_ON_RUDE_EDIT=true] watch:sample", + "watch:sample": "dotnet watch --verbose --project sample" } } diff --git a/sample/Sample.csproj b/sample/Sample.csproj index cb28918..0355d87 100644 --- a/sample/Sample.csproj +++ b/sample/Sample.csproj @@ -1,10 +1,5 @@ - - net7.0 - - - diff --git a/src/LinkAriaCurrentStateTagHelper.cs b/src/LinkAriaCurrentStateTagHelper.cs index 3a947cf..79f0d75 100644 --- a/src/LinkAriaCurrentStateTagHelper.cs +++ b/src/LinkAriaCurrentStateTagHelper.cs @@ -29,8 +29,8 @@ public LinkAriaCurrentStateTagHelper( public override void Process(TagHelperContext context, TagHelperOutput output) { - if (context is null) throw new ArgumentNullException(nameof(context)); - if (output is null) throw new ArgumentNullException(nameof(output)); + ArgumentNullException.ThrowIfNull(context); + ArgumentNullException.ThrowIfNull(output); if (!context.Items.TryGetValue(typeof(LinkContext), out var ctx) || ctx is not LinkContext linkContext) { diff --git a/src/LinkChildTagHelper.cs b/src/LinkChildTagHelper.cs index b58ff91..d35bd05 100644 --- a/src/LinkChildTagHelper.cs +++ b/src/LinkChildTagHelper.cs @@ -14,8 +14,8 @@ public LinkChildTagHelper(IOptions settings) public override void Process(TagHelperContext context, TagHelperOutput output) { - if (context is null) throw new ArgumentNullException(nameof(context)); - if (output is null) throw new ArgumentNullException(nameof(output)); + ArgumentNullException.ThrowIfNull(context); + ArgumentNullException.ThrowIfNull(output); if (!context.Items.TryGetValue(typeof(LinkContext), out var contextItem) || contextItem is not LinkContext linkContext) { diff --git a/src/LinkTagHelper.cs b/src/LinkTagHelper.cs index 29571d2..4f57207 100644 --- a/src/LinkTagHelper.cs +++ b/src/LinkTagHelper.cs @@ -21,8 +21,8 @@ public LinkTagHelper(IOptions settings) public override void Process(TagHelperContext context, TagHelperOutput output) { - if (context is null) throw new ArgumentNullException(nameof(context)); - if (output is null) throw new ArgumentNullException(nameof(output)); + ArgumentNullException.ThrowIfNull(context); + ArgumentNullException.ThrowIfNull(output); var currentPath = ViewContext.HttpContext.Request.Path; var linkPath = new PathString(output.Attributes.GetValue("href")); diff --git a/src/LinkTagHelperBase.cs b/src/LinkTagHelperBase.cs index f410766..f396a7e 100644 --- a/src/LinkTagHelperBase.cs +++ b/src/LinkTagHelperBase.cs @@ -37,7 +37,7 @@ protected LinkTagHelperBase(IOptions settings) protected void MergeClassLists(TagHelperOutput output, bool isMatch) { - if (output is null) throw new ArgumentNullException(nameof(output)); + ArgumentNullException.ThrowIfNull(output); var classList = isMatch ? Utilities.SplitClassList(CurrentClass) diff --git a/src/ParentContextNotFoundException.cs b/src/ParentContextNotFoundException.cs index 15e4836..ceb0a75 100644 --- a/src/ParentContextNotFoundException.cs +++ b/src/ParentContextNotFoundException.cs @@ -1,8 +1,5 @@ namespace Tailwind.Css.TagHelpers; -using System.Runtime.Serialization; - -[Serializable] public class ParentContextNotFoundException : Exception { public ParentContextNotFoundException() @@ -19,9 +16,4 @@ public ParentContextNotFoundException(string? message, Exception? innerException : base(message, innerException) { } - - protected ParentContextNotFoundException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } } diff --git a/src/TailwindCssExtensions.cs b/src/TailwindCssExtensions.cs index 572df62..c736068 100644 --- a/src/TailwindCssExtensions.cs +++ b/src/TailwindCssExtensions.cs @@ -8,8 +8,8 @@ public static class TailwindCssExtensions { public static IServiceCollection AddTailwindCssTagHelpers(this IServiceCollection services, IConfiguration configuration) { - if (services is null) throw new ArgumentNullException(nameof(services)); - if (configuration is null) throw new ArgumentNullException(nameof(configuration)); + ArgumentNullException.ThrowIfNull(services); + ArgumentNullException.ThrowIfNull(configuration); services.Configure(configuration.GetSection("TailwindCss")); @@ -18,8 +18,8 @@ public static IServiceCollection AddTailwindCssTagHelpers(this IServiceCollectio public static IServiceCollection AddTailwindCssTagHelpers(this IServiceCollection services, Action configureOptions) { - if (services is null) throw new ArgumentNullException(nameof(services)); - if (configureOptions is null) throw new ArgumentNullException(nameof(configureOptions)); + ArgumentNullException.ThrowIfNull(services); + ArgumentNullException.ThrowIfNull(configureOptions); services.Configure(configureOptions); diff --git a/src/TailwindCssTagHelpers.csproj b/src/TailwindCssTagHelpers.csproj index ae0bed5..fc34923 100644 --- a/src/TailwindCssTagHelpers.csproj +++ b/src/TailwindCssTagHelpers.csproj @@ -40,10 +40,6 @@ - - all - runtime; build; native; contentfiles; analyzers - diff --git a/src/ValidationStatusTagHelper.cs b/src/ValidationStatusTagHelper.cs index 76170de..3a93c7c 100644 --- a/src/ValidationStatusTagHelper.cs +++ b/src/ValidationStatusTagHelper.cs @@ -46,8 +46,8 @@ public ValidationStatusTagHelper(IOptions settings) public override void Process(TagHelperContext context, TagHelperOutput output) { - if (context is null) throw new ArgumentNullException(nameof(context)); - if (output is null) throw new ArgumentNullException(nameof(output)); + ArgumentNullException.ThrowIfNull(context); + ArgumentNullException.ThrowIfNull(output); if (For is null) {