Skip to content

Commit 919c4ae

Browse files
authored
Add NuGet package for Fluent UI (#253)
1 parent 2a5e391 commit 919c4ae

File tree

12 files changed

+122
-22
lines changed

12 files changed

+122
-22
lines changed

.github/workflows/azure-dev-build-only.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,18 @@ jobs:
5959
dotnet test ./test/AzureOpenAIProxy.AppHost.Tests --logger "trx" --collect:"XPlat Code Coverage"
6060
dotnet test ./test/AzureOpenAIProxy.ApiApp.Tests --logger "trx" --collect:"XPlat Code Coverage"
6161
62-
# - name: Run integration tests
63-
# shell: bash
64-
# run: |
65-
# dotnet test ./test/AzureOpenAIProxy.PlaygroundApp.Tests --logger "trx" --collect:"XPlat Code Coverage"
62+
- name: Run integration tests
63+
shell: bash
64+
run: |
65+
dotnet run --project ./src/AzureOpenAIProxy.AppHost &
66+
67+
DOTNET_PID=$!
68+
69+
sleep 30
70+
71+
dotnet test ./test/AzureOpenAIProxy.PlaygroundApp.Tests --logger "trx" --collect:"XPlat Code Coverage"
72+
73+
kill $DOTNET_PID
6674
6775
- name: Publish test results
6876
if: ${{ !cancelled() }}

.github/workflows/azure-dev.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,24 @@ jobs:
6767
run: |
6868
dotnet build
6969
70-
- name: Test solution
70+
- name: Run unit tests
7171
shell: bash
7272
run: |
73-
dotnet test --logger "trx" --collect:"XPlat Code Coverage"
73+
dotnet test ./test/AzureOpenAIProxy.AppHost.Tests --logger "trx" --collect:"XPlat Code Coverage"
74+
dotnet test ./test/AzureOpenAIProxy.ApiApp.Tests --logger "trx" --collect:"XPlat Code Coverage"
75+
76+
- name: Run integration tests
77+
shell: bash
78+
run: |
79+
dotnet run --project ./src/AzureOpenAIProxy.AppHost &
80+
81+
DOTNET_PID=$!
82+
83+
sleep 30
84+
85+
dotnet test ./test/AzureOpenAIProxy.PlaygroundApp.Tests --logger "trx" --collect:"XPlat Code Coverage"
86+
87+
kill $DOTNET_PID
7488
7589
- name: Publish test results
7690
uses: bibipkins/dotnet-test-reporter@main

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<OpenTelemetryExtensionsVersion>1.*</OpenTelemetryExtensionsVersion>
1616
<OpenTelemetryInstrumentationVersion>1.*</OpenTelemetryInstrumentationVersion>
1717
<SwashbuckleVersion>6.*</SwashbuckleVersion>
18+
<FluentUIVersion>4.*</FluentUIVersion>
1819

1920
<CoverletVersion>6.*</CoverletVersion>
2021
<FluentAssertionsVersion>6.*</FluentAssertionsVersion>

src/AzureOpenAIProxy.ApiApp/AzureOpenAIProxy.ApiApp.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
5-
<Nullable>enable</Nullable>
6-
<ImplicitUsings>enable</ImplicitUsings>
7-
84
<AssemblyName>AzureOpenAIProxy.ApiApp</AssemblyName>
95
<RootNamespace>AzureOpenAIProxy.ApiApp</RootNamespace>
106
</PropertyGroup>

src/AzureOpenAIProxy.AppHost/AzureOpenAIProxy.AppHost.csproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
6-
<ImplicitUsings>enable</ImplicitUsings>
7-
<Nullable>enable</Nullable>
85
<IsAspireHost>true</IsAspireHost>
6+
97
<UserSecretsId>f6c81741-4dbe-4a07-86e3-83a42810f5ec</UserSecretsId>
8+
9+
<AssemblyName>AzureOpenAIProxy.AppHost</AssemblyName>
10+
<RootNamespace>AzureOpenAIProxy.AppHost</RootNamespace>
1011
</PropertyGroup>
1112

1213
<ItemGroup>

src/AzureOpenAIProxy.PlaygroundApp/AzureOpenAIProxy.PlaygroundApp.csproj

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
5-
<Nullable>enable</Nullable>
6-
<ImplicitUsings>enable</ImplicitUsings>
7-
8-
94
<AssemblyName>AzureOpenAIProxy.PlaygroundApp</AssemblyName>
105
<RootNamespace>AzureOpenAIProxy.PlaygroundApp</RootNamespace>
116
</PropertyGroup>
127

138
<ItemGroup>
149
<PackageReference Include="Azure.AI.OpenAI" Version="$(AzureOpenAIVersion)" />
10+
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components" Version="$(FluentUIVersion)" />
11+
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components.Emoji" Version="$(FluentUIVersion)" />
12+
<PackageReference Include="Microsoft.FluentUI.AspNetCore.Components.Icons" Version="$(FluentUIVersion)" />
1513
</ItemGroup>
1614

1715
<ItemGroup>

src/AzureOpenAIProxy.PlaygroundApp/Components/App.razor

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
<link rel="stylesheet" href="bootstrap/bootstrap.min.css" />
99
<link rel="stylesheet" href="app.css" />
1010
<link rel="stylesheet" href="AzureOpenAIProxy.PlaygroundApp.styles.css" />
11+
<link href="_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css" rel="stylesheet" />
1112
<link rel="icon" type="image/png" href="favicon.png" />
1213
<HeadOutlet />
1314
</head>
1415

1516
<body>
1617
<Routes />
1718
<script src="_framework/blazor.web.js"></script>
19+
<script src="_content/Microsoft.FluentUI.AspNetCore.Components/Microsoft.FluentUI.AspNetCore.Components.lib.module.js" type="module" async></script>
1820
</body>
1921

2022
</html>

src/AzureOpenAIProxy.PlaygroundApp/Components/Layout/MainLayout.razor

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@
2121
<a href="" class="reload">Reload</a>
2222
<a class="dismiss">🗙</a>
2323
</div>
24+
25+
<FluentToastProvider />
26+
<FluentDialogProvider />
27+
<FluentTooltipProvider />
28+
<FluentMessageBarProvider />
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
@using System.Net.Http
22
@using System.Net.Http.Json
3+
34
@using Microsoft.AspNetCore.Components.Forms
45
@using Microsoft.AspNetCore.Components.Routing
56
@using Microsoft.AspNetCore.Components.Web
6-
@using static Microsoft.AspNetCore.Components.Web.RenderMode
77
@using Microsoft.AspNetCore.Components.Web.Virtualization
8+
9+
@using Microsoft.FluentUI.AspNetCore.Components
10+
811
@using Microsoft.JSInterop
12+
13+
@using static Microsoft.AspNetCore.Components.Web.RenderMode
14+
915
@using AzureOpenAIProxy.PlaygroundApp
1016
@using AzureOpenAIProxy.PlaygroundApp.Components

src/AzureOpenAIProxy.PlaygroundApp/Program.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using AzureOpenAIProxy.PlaygroundApp.Clients;
22

3+
using Microsoft.FluentUI.AspNetCore.Components;
4+
35
using App = AzureOpenAIProxy.PlaygroundApp.Components.App;
46

57
var builder = WebApplication.CreateBuilder(args);
@@ -10,6 +12,8 @@
1012
builder.Services.AddRazorComponents()
1113
.AddInteractiveServerComponents();
1214

15+
builder.Services.AddFluentUIComponents();
16+
1317
builder.Services.AddScoped<IOpenAIApiClient, OpenAIApiClient>();
1418

1519
var app = builder.Build();

0 commit comments

Comments
 (0)