Skip to content

Commit

Permalink
Merge pull request #316 from xt0rted/dotnet8
Browse files Browse the repository at this point in the history
Support .net 8
  • Loading branch information
xt0rted authored Apr 9, 2024
2 parents 49f5384 + 5c67e40 commit bf458a4
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 37 deletions.
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"cSpell.words": [
"appsettings",
"tailwindcss"
]
}
],
"dotnet.defaultSolution": "TailwindCssTagHelpers.sln"
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>preview</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down
7 changes: 3 additions & 4 deletions global.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
5 changes: 0 additions & 5 deletions sample/Sample.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFrameworks></TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<Using Include="Microsoft.AspNetCore.Mvc" />
<Using Include="Microsoft.AspNetCore.Mvc.RazorPages" />
Expand Down
4 changes: 2 additions & 2 deletions src/LinkAriaCurrentStateTagHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions src/LinkChildTagHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public LinkChildTagHelper(IOptions<TagOptions> 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)
{
Expand Down
4 changes: 2 additions & 2 deletions src/LinkTagHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ public LinkTagHelper(IOptions<TagOptions> 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"));
Expand Down
2 changes: 1 addition & 1 deletion src/LinkTagHelperBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected LinkTagHelperBase(IOptions<TagOptions> 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)
Expand Down
8 changes: 0 additions & 8 deletions src/ParentContextNotFoundException.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
namespace Tailwind.Css.TagHelpers;

using System.Runtime.Serialization;

[Serializable]
public class ParentContextNotFoundException : Exception
{
public ParentContextNotFoundException()
Expand All @@ -19,9 +16,4 @@ public ParentContextNotFoundException(string? message, Exception? innerException
: base(message, innerException)
{
}

protected ParentContextNotFoundException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
8 changes: 4 additions & 4 deletions src/TailwindCssExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<TagOptions>(configuration.GetSection("TailwindCss"));

Expand All @@ -18,8 +18,8 @@ public static IServiceCollection AddTailwindCssTagHelpers(this IServiceCollectio

public static IServiceCollection AddTailwindCssTagHelpers(this IServiceCollection services, Action<TagOptions> 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);

Expand Down
4 changes: 0 additions & 4 deletions src/TailwindCssTagHelpers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/ValidationStatusTagHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public ValidationStatusTagHelper(IOptions<TagOptions> 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)
{
Expand Down

0 comments on commit bf458a4

Please sign in to comment.