Skip to content

Commit

Permalink
feature: Rename project from OneOf.Extensions.Blazor to Fenris.OneOfC…
Browse files Browse the repository at this point in the history
…ontrib.Blazor
  • Loading branch information
asser-dk committed Jan 26, 2024
1 parent d905fa7 commit 442e2ff
Show file tree
Hide file tree
Showing 82 changed files with 129 additions and 151 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dotnet-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Pack OneOf.Extensions.Blazor
run: dotnet pack src/OneOf.Extensions.Blazor/ -c Release -o ./artifacts --include-source --verbosity minimal -p:PackageVersion=0.1.${{ github.run_number }}-alpha
- name: Pack Fenris.OneOfContrib.Blazor
run: dotnet pack src/Fenris.OneOfContrib.Blazor/ -c Release -o ./artifacts --include-source --verbosity minimal -p:PackageVersion=0.1.${{ github.run_number }}-alpha
- name: Push to nuget.org
run: dotnet nuget push ./artifacts/*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key ${{ secrets.NUGET_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/release-created.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Pack OneOf.Extensions.Blazor
run: dotnet pack src/OneOf.Extensions.Blazor/ -c Release -o ./artifacts --include-source --verbosity minimal -p:PackageVersion=${{ github.event.release.tag_name }}-${{ github.run_number }}-rc
- name: Pack Fenris.OneOfContrib.Blazor
run: dotnet pack src/Fenris.OneOfContrib.Blazor/ -c Release -o ./artifacts --include-source --verbosity minimal -p:PackageVersion=${{ github.event.release.tag_name }}-${{ github.run_number }}-rc
- name: Push to nuget.org
run: dotnet nuget push ./artifacts/*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key ${{ secrets.NUGET_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/release-published.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
run: dotnet build --configuration Release --no-restore --verbosity minimal
- name: Test
run: dotnet test --configuration Release --no-build --verbosity minimal
- name: Pack OneOf.Extensions.Blazor
run: dotnet pack src/OneOf.Extensions.Blazor/ -c Release -o ./artifacts --include-source --verbosity minimal -p:PackageVersion=${{ github.event.release.tag_name }}
- name: Pack Fenris.OneOfContrib.Blazor
run: dotnet pack src/Fenris.OneOfContrib.Blazor/ -c Release -o ./artifacts --include-source --verbosity minimal -p:PackageVersion=${{ github.event.release.tag_name }}
- name: Push to nuget.org
run: dotnet nuget push ./artifacts/*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key ${{ secrets.NUGET_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{04559151-CE50-43AF-9288-B2BF8D7329CA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneOf.Extensions.Blazor", "src\OneOf.Extensions.Blazor\OneOf.Extensions.Blazor.csproj", "{954CE396-7B84-45A7-9D2B-2FF04342A7AB}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fenris.OneOfContrib.Blazor", "src\Fenris.OneOfContrib.Blazor\Fenris.OneOfContrib.Blazor.csproj", "{954CE396-7B84-45A7-9D2B-2FF04342A7AB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{00E966CE-CB47-48A9-BC6B-54749544A049}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{AD185D98-E3F5-4C5E-AA53-33A5F6CD770E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneOf.Extensions.Blazor.Examples", "examples\OneOf.Extensions.Blazor.Examples\OneOf.Extensions.Blazor.Examples.csproj", "{2E64AB13-C096-442B-B1D1-2C71EB9D6B0E}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fenris.OneOfContrib.Blazor.Examples", "examples\Fenris.OneOfContrib.Blazor.Examples\Fenris.OneOfContrib.Blazor.Examples.csproj", "{2E64AB13-C096-442B-B1D1-2C71EB9D6B0E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OneOf.Extensions.Blazor.Test", "test\OneOf.Extensions.Blazor.Test\OneOf.Extensions.Blazor.Test.csproj", "{161F07BA-0F32-49FD-9708-3001E6F267AE}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Fenris.OneOfContrib.Blazor.Test", "test\Fenris.OneOfContrib.Blazor.Test\Fenris.OneOfContrib.Blazor.Test.csproj", "{161F07BA-0F32-49FD-9708-3001E6F267AE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# OneOf.Extensions.Blazor
# Fenris.OneOfContrib.Blazor

A collection of Blazor components for working with [OneOf](https://github.com/mcintyre321/OneOf) types in your Blazor project.

Expand All @@ -16,25 +16,25 @@ and found it made my Blazor components much more readable and in general nicer t
- Blazor components for `OneOf` types with up to **8** type parameters.
- Blazor components for types that inherit from `OneOfBase`, also with up to **8** type parameters.

That's, that's it. It's a pretty simple library 😁
That's it. It's a pretty simple library 😁

## 💿 Installation

Install the [OneOf.Extensions.Blazor](https://www.nuget.org/packages/OneOf.Extensions.Blazor/) NuGet package.
Install the [Fenris.OneOfContrib.Blazor](https://www.nuget.org/packages/Fenris.OneOfContrib.Blazor/) NuGet package.

```bash
dotnet add package OneOf.Extensions.Blazor
dotnet add package Fenris.OneOfContrib.Blazor
```

## 🚀 Usage

See the [Examples](examples/OneOf.Extensions.Blazor.Examples/Pages/Index.razor) project for a full, simple example.
See the [Examples](examples/OneOfContrib.Blazor.Examples/Pages/Index.razor) project for a full, simple example.

Let's make a small example where we have to deal with a `OneOf<string, int>`.

First, add the using either to your `_Imports.razor` file, or directly in your specific pages/components:
```csharp
@using OneOf.Extensions.Blazor
@using Fenris.OneOfContrib.Blazor.Components
```

Then use the component in your blazor pages or components
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\OneOf.Extensions.Blazor\OneOf.Extensions.Blazor.csproj" />
<ProjectReference Include="..\..\src\Fenris.OneOfContrib.Blazor\Fenris.OneOfContrib.Blazor.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace OneOf.Extensions.Blazor.Examples.Models;
namespace Fenris.OneOfContrib.Blazor.Examples.Models;

using OneOf;

[GenerateOneOf]
public partial class StringOrInt : OneOfBase<int, string?>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page
@model OneOf.Extensions.Blazor.Example1.Pages.ErrorModel
@model Fenris.OneOfContrib.Blazor.Example1.Pages.ErrorModel

<!DOCTYPE html>
<html lang="en">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace OneOf.Extensions.Blazor.Example1.Pages;
namespace Fenris.OneOfContrib.Blazor.Example1.Pages;

[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
[IgnoreAntiforgeryToken]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@page "/"
@using Microsoft.AspNetCore.Components.Web
@namespace OneOf.Extensions.Blazor.Examples.Pages
@namespace Fenris.OneOfContrib.Blazor.Examples.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

<!DOCTYPE html>
Expand All @@ -11,7 +11,7 @@
<base href="~/"/>
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css"/>
<link href="css/site.css" rel="stylesheet"/>
<link href="OneOf.Extensions.Blazor.Examples.styles.css" rel="stylesheet"/>
<link href="Fenris.OneOfContrib.Blazor.Examples.styles.css" rel="stylesheet"/>
<link rel="icon" type="image/png" href="favicon.png"/>
<component type="typeof(HeadOutlet)" render-mode="ServerPrerendered"/>
</head>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using Microsoft.JSInterop
@using OneOf.Extensions.Blazor.Examples
@using OneOf.Extensions.Blazor.Examples.Shared
@using OneOf.Extensions.Blazor.Examples.Models
@using Fenris.OneOfContrib.Blazor.Components
@using Fenris.OneOfContrib.Blazor.Examples
@using Fenris.OneOfContrib.Blazor.Examples.Shared
@using Fenris.OneOfContrib.Blazor.Examples.Models
@using OneOf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@typeparam T0;
@typeparam T1;
@using global::OneOf
@typeparam T2;

@{
Expand Down
53 changes: 53 additions & 0 deletions src/Fenris.OneOfContrib.Blazor/Fenris.OneOfContrib.Blazor.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

<OutputType>Library</OutputType>
<PackageId>Fenris.OneOfContrib.Blazor</PackageId>
<Title>Fenris.OneOfContrib.Blazor</Title>
<Authors>fenris.io</Authors>
<Description>
A collection of Blazor components for dealing with OneOf types in your Blazor project.

Instead of writing a switch statement to handle the different cases of a OneOf type, you can use these components to render the correct component for the case.

Example:

&lt;OneOfSwitch2 Value="myOneOfWithTwoTypeParameters"&gt;
&lt;T0Template&gt;
&lt;p&gt;I am of type T0 and my value is @context!.&lt;/p&gt;
&lt;/T0Template&gt;
&lt;T1Template&gt;
&lt;p&gt;I am of type T1 and my value is @context!.&lt;/p&gt;
&lt;/T1Template&gt;
&lt;/OneOfSwitch2&gt;
</Description>
<PackageProjectUrl>https://github.com/fenrisdotio/OneOfContrib.Blazor</PackageProjectUrl>
<PackageTags>oneof contrib blazor components switch</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageReleaseNotes>https://github.com/fenrisdotio/OneOfContrib.Blazor/blob/main/CHANGELOG.md</PackageReleaseNotes>

<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<IsPackable>true</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.1"/>
<PackageReference Include="OneOf" Version="3.0.263"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>

<ItemGroup>
<None Include="../../README.md" Pack="true" PackagePath="/"/>
<None Include="../../LICENSE.txt" Pack="true" PackagePath="/"/>
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions src/Fenris.OneOfContrib.Blazor/Usings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using OneOf;
53 changes: 0 additions & 53 deletions src/OneOf.Extensions.Blazor/OneOf.Extensions.Blazor.csproj

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\OneOf.Extensions.Blazor\OneOf.Extensions.Blazor.csproj" />
<ProjectReference Include="..\..\src\Fenris.OneOfContrib.Blazor\Fenris.OneOfContrib.Blazor.csproj" />
</ItemGroup>


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace OneOf.Extensions.Blazor.Test.Models;
namespace Fenris.OneOfContrib.Blazor.Test.Models;

using global::OneOf;

[GenerateOneOf]
public partial class OneOfBase2Example : OneOfBase<T0Record, T1Record>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace OneOf.Extensions.Blazor.Test.Models;
namespace Fenris.OneOfContrib.Blazor.Test.Models;

using global::OneOf;

[GenerateOneOf]
public partial class OneOfBase3Example : OneOfBase<T0Record, T1Record, T2Record>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace OneOf.Extensions.Blazor.Test.Models;
namespace Fenris.OneOfContrib.Blazor.Test.Models;

using global::OneOf;

[GenerateOneOf]
public partial class OneOfBase4Example : OneOfBase<T0Record, T1Record, T2Record, T3Record>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace OneOf.Extensions.Blazor.Test.Models;
namespace Fenris.OneOfContrib.Blazor.Test.Models;

using global::OneOf;

[GenerateOneOf]
public partial class OneOfBase5Example : OneOfBase<T0Record, T1Record, T2Record, T3Record, T4Record>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace OneOf.Extensions.Blazor.Test.Models;
namespace Fenris.OneOfContrib.Blazor.Test.Models;

using global::OneOf;

[GenerateOneOf]
public partial class OneOfBase6Example : OneOfBase<T0Record, T1Record, T2Record, T3Record, T4Record, T5Record>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace OneOf.Extensions.Blazor.Test.Models;
namespace Fenris.OneOfContrib.Blazor.Test.Models;

using global::OneOf;

[GenerateOneOf]
public partial class OneOfBase7Example : OneOfBase<T0Record, T1Record, T2Record, T3Record, T4Record, T5Record, T6Record>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace OneOf.Extensions.Blazor.Test.Models;
namespace Fenris.OneOfContrib.Blazor.Test.Models;

using global::OneOf;

[GenerateOneOf]
public partial class OneOfBase8Example : OneOfBase<T0Record, T1Record, T2Record, T3Record, T4Record, T5Record, T6Record, T7Record>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace OneOf.Extensions.Blazor.Test.Models;
namespace Fenris.OneOfContrib.Blazor.Test.Models;

using global::OneOf;

[GenerateOneOf]
public partial class OneOfBase9Example : OneOfBase<T0Record, T1Record, T2Record, T3Record, T4Record, T5Record, T6Record, T7Record, T8Record>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace OneOf.Extensions.Blazor.Test.Models;
namespace Fenris.OneOfContrib.Blazor.Test.Models;

public record T0Record(string Value);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
@using FluentAssertions
@using OneOf.Extensions.Blazor.Test.Models

@inherits TestContext
@inherits TestContext

@code
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
@using FluentAssertions
@using OneOf.Extensions.Blazor.Test.Models

@inherits TestContext
@inherits TestContext

@code
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
@using FluentAssertions
@using OneOf.Extensions.Blazor.Test.Models

@inherits TestContext
@inherits TestContext

@code
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
@using FluentAssertions
@using OneOf.Extensions.Blazor.Test.Models

@inherits TestContext
@inherits TestContext

@code
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
@using FluentAssertions
@using OneOf.Extensions.Blazor.Test.Models

@inherits TestContext
@inherits TestContext

@code
{
Expand Down

0 comments on commit 442e2ff

Please sign in to comment.