Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/ci-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
pages: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
Expand All @@ -37,6 +40,24 @@ jobs:
- run: dotnet test tests/Blazor.AI.BrowserModels.Tests -c Release --no-build --logger trx --results-directory artifacts/unit-results
- name: Pack preview package
run: dotnet pack src/Blazor.AI.BrowserModels -c Release --no-build -o artifacts/packages
- name: Verify package target frameworks
shell: bash
run: |
package=$(find artifacts/packages -maxdepth 1 -name '*.nupkg' ! -name '*.snupkg' -print -quit)
test -n "$package"
entries=$(unzip -Z1 "$package")
grep -Fxq 'lib/net10.0/Blazor.AI.BrowserModels.dll' <<< "$entries"
grep -Fxq 'lib/net10.0/Blazor.AI.BrowserModels.xml' <<< "$entries"
grep -Fxq 'lib/net11.0/Blazor.AI.BrowserModels.dll' <<< "$entries"
grep -Fxq 'lib/net11.0/Blazor.AI.BrowserModels.xml' <<< "$entries"
test "$(grep -Fxc 'staticwebassets/attachments.js' <<< "$entries")" -eq 1
test "$(grep -Fxc 'staticwebassets/browserModel.js' <<< "$entries")" -eq 1
nuspec=$(unzip -p "$package" Blazor.AI.BrowserModels.nuspec)
grep -Fq '<group targetFramework="net10.0">' <<< "$nuspec"
grep -Fq '<dependency id="Microsoft.AspNetCore.Components.Web" version="10.0.11"' <<< "$nuspec"
grep -Fq '<group targetFramework="net11.0">' <<< "$nuspec"
grep -Fq '<dependency id="Microsoft.AspNetCore.Components.Web" version="11.0.0-rc.1.26425.128"' <<< "$nuspec"
test "$(grep -Fc '<dependency id="Microsoft.Extensions.AI.Abstractions" version="10.9.0"' <<< "$nuspec")" -eq 2
- name: Upload preview package
uses: actions/upload-artifact@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Inference runs on the user's device. No API key, hosted model, database, or server-side inference service is required.

> [!NOTE]
> This is a preview package targeting .NET 11. Browser support also depends on the installed model, hardware, storage, browser policy, and the page being served from localhost or HTTPS. See Chrome's [Prompt API documentation](https://developer.chrome.com/docs/ai/prompt-api) for current requirements.
> This is a preview package targeting .NET 10 and .NET 11. Browser support also depends on the installed model, hardware, storage, browser policy, and the page being served from localhost or HTTPS. See Chrome's [Prompt API documentation](https://developer.chrome.com/docs/ai/prompt-api) for current requirements.

## Install

Expand Down Expand Up @@ -139,7 +139,7 @@ Open the displayed localhost URL in a compatible desktop Chrome installation and

## Build and test

The repository pins its preview .NET SDK in `global.json`. Node.js 22.12 or newer is needed only when changing the TypeScript sources.
The repository pins its preview .NET 11 SDK in `global.json`. Install both the .NET 10 and .NET 11 SDKs to build and run the complete unit-test matrix. Node.js 22.12 or newer is needed only when changing the TypeScript sources.

```powershell
npm ci
Expand Down
9 changes: 7 additions & 2 deletions src/Blazor.AI.BrowserModels/Blazor.AI.BrowserModels.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>net11.0</TargetFramework>
<TargetFrameworks>net10.0;net11.0</TargetFrameworks>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<PackageId>Blazor.AI.BrowserModels</PackageId>
Expand All @@ -19,8 +19,13 @@
<NoWarn>$(NoWarn);1591</NoWarn>
<ContinuousIntegrationBuild Condition="'$(CI)' == 'true'">true</ContinuousIntegrationBuild>
</PropertyGroup>
<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="10.0.11" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net11.0'">
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="11.0.0-rc.1.26425.128" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="10.9.0" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net11.0</TargetFramework>
<TargetFrameworks>net10.0;net11.0</TargetFrameworks>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsTestProject>true</IsTestProject>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../../src/Blazor.AI.BrowserModels/Blazor.AI.BrowserModels.csproj" />
<ProjectReference Include="../../src/Blazor.AI.BrowserModels.Sample/Blazor.AI.BrowserModels.Sample.csproj" />
<ProjectReference Include="../../src/Blazor.AI.BrowserModels.Sample/Blazor.AI.BrowserModels.Sample.csproj" Condition="'$(TargetFramework)' == 'net11.0'" />
<PackageReference Include="Microsoft.Agents.AI" Version="1.20.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" PrivateAssets="all" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<Compile Remove="SummaryTests.cs" />
</ItemGroup>
</Project>
Loading