Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
11 changes: 7 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
<PropertyGroup>

<!-- .NET Framework Version used with the Demo and Unit Tests projects -->
<!-- Change this to switch between net8.0, net9.0, or net10.0 -->
<!--
<!-- Change this to switch between net8.0, net9.0, or net10.0 -->
<!--
NOTES: When updating the NetVersion above, also update the files
- _PublishDemoLocally.ps1
- .github\workflows\build-core-lib.yml
- examples\Tools\FluentUI.Demo.DocApiGen\Properties\launchSettings.json
- examples\Tools\FluentUI.Demo.DocApiGen.IntegrationTests\FluentUIComponentsIntegrationTests.cs
- tests\Integration\WebServer\StartServerFixture.cs
-->
<NetVersion>net9.0</NetVersion>
<NetVersion>net10.0</NetVersion>
Comment thread
vnbaaij marked this conversation as resolved.
Outdated

<!-- Target .NET versions for multi-targeting -->
<!-- Used with the published libraries: Core; McpServer -->
<!-- Debug: single target for faster builds; Release: full multi-targeting -->
<TargetNetVersions Condition="'$(Configuration)' == 'Release'">net9.0;net10.0</TargetNetVersions>
<TargetNetVersions Condition="'$(Configuration)' == 'Release'">net10.0</TargetNetVersions>
Comment thread
vnbaaij marked this conversation as resolved.
Outdated
Comment thread
vnbaaij marked this conversation as resolved.
Outdated
<TargetNetVersions Condition="'$(Configuration)' != 'Release'">$(NetVersion)</TargetNetVersions>

<!-- Versioning -->
Expand Down Expand Up @@ -53,3 +53,6 @@
</ItemGroup>

</Project>



129 changes: 96 additions & 33 deletions _PublishDemoLocally.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,53 @@

# Script to generate documentation and publish the FluentUI Demo locally

# .NET Framework Version - Change this to net8.0, net9.0, or net10.0 as needed
$NetVersion = "net10.0"
# Ask user for configuration
Write-Host "👉 Configuration setup..." -ForegroundColor Cyan
Write-Host ""

# Ask for .NET version
$dotnetVersionChoice = Read-Host "❓ Which .NET version do you want to use? (9 for net9.0, 10 for net10.0) [default: 10]"
if ($dotnetVersionChoice -eq "9") {
$NetVersion = "net9.0"
} elseif ($dotnetVersionChoice -eq "" -or $dotnetVersionChoice -eq "10") {
$NetVersion = "net10.0"
} else {
Write-Host "⛔ Invalid choice." -ForegroundColor Red
exit 1
}

# Show build number
$propsContent = Get-Content "./Directory.Build.props" -Raw

Comment thread
vnbaaij marked this conversation as resolved.
Outdated
$versionPrefix = $propsContent -match "<VersionPrefix>([0-9]+\.[0-9]+\.[0-9]+)</VersionPrefix>"
$pipelineVersion = $Matches[1]

$versionSuffix = $propsContent -match "<VersionSuffix>([0-9A-Za-z\.-]+)</VersionSuffix>"
if ($versionSuffix) {
$pipelineSuffix = $Matches[1]
}
if ($pipelineSuffix) {
$version = "$pipelineVersion-$pipelineSuffix"
} else {
$version = $pipelineVersion
}

Write-Host "👉 Starting local demo publish process..." -ForegroundColor Green
Write-Host "👉 Using .NET Framework: $NetVersion" -ForegroundColor Cyan
Write-Host ""
Write-Host "Configuration:" -ForegroundColor Green
Write-Host " .NET Version: $NetVersion" -ForegroundColor White
Write-Host " Package version: $version" -ForegroundColor White
Write-Host ""

# Ask for doing quick of full publish
$publishChoice = Read-Host "❓ Do you want to do a quick publish (skip API documentation generation, MCP Server build)? (y/n) [default: y]"
Comment thread
vnbaaij marked this conversation as resolved.
Outdated
if ($publishChoice -eq "n") {
$fullBuild = $true
} elseif ($publishChoice -eq "" -or $publishChoice -eq "y") {
$fullBuild = $false
} else {
Write-Host "⛔ Invalid choice." -ForegroundColor Red
exit 1
}

# Clean previous build artifacts
Write-Host "👉 Cleaning previous build artifacts (bin and obj)..." -ForegroundColor Yellow
Expand All @@ -35,53 +77,69 @@ $RootDir = $PSScriptRoot

# Update the Directory.Build.props file with the correct .NET version
Write-Host "👉 Updating Directory.Build.props with .NET version: $NetVersion..." -ForegroundColor Yellow
(Get-Content "./Directory.Build.props") -replace '<NetVersion>net[0-9]+\.[0-9]+</NetVersion>', "<NetVersion>$NetVersion</NetVersion>" | Set-Content "./Directory.Build.props"
(Get-Content "./Directory.Build.props") -replace "<TargetNetVersions Condition=`"'\$\(Configuration\)' == 'Release'`">.*</TargetNetVersions>", "<TargetNetVersions Condition=`"'`$(Configuration)' == 'Release'`">$NetVersion</TargetNetVersions>" | Set-Content "./Directory.Build.props"

$propsMatch = $propsContent -match "<NetVersion>net[0-9]+\.[0-9]+</NetVersion>"
if ($propsMatch -ne "<NetVersion>$NetVersion</NetVersion>") {
$propsVersion = $Matches[1]
$propsContent -replace '<NetVersion>net[0-9]+\.[0-9]+</NetVersion>', "<NetVersion>$NetVersion</NetVersion>" | Set-Content "./Directory.Build.props"
Write-Host "- Replaced NetVersion: $propsVersion -> $NetVersion..."

Comment thread
vnbaaij marked this conversation as resolved.
Outdated
# Build the core project
Write-Host "👉 Building Core project..." -ForegroundColor Yellow
dotnet build "./src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj" -c Release -o "./src/Core/bin/Publish" -f $NetVersion
}

# Generate API documentation file
Write-Host "👉 Generating API documentation..." -ForegroundColor Yellow
dotnet run --project ".\examples\Tools\FluentUI.Demo.DocApiGen\FluentUI.Demo.DocApiGen.csproj" --xml "$RootDir/src/Core/bin/Publish/Microsoft.FluentUI.AspNetCore.Components.xml" --dll "$RootDir/src/Core/bin/Publish/Microsoft.FluentUI.AspNetCore.Components.dll" --output "$RootDir/examples/Demo/FluentUI.Demo.Client/wwwroot/api-comments.json" --format json

# Build the MCP Server project
Write-Host "👉 Building MCP Server project..." -ForegroundColor Yellow
dotnet build "./src/Tools/McpServer/Microsoft.FluentUI.AspNetCore.McpServer.csproj" -c Release -o "./src/Tools/McpServer/bin/Publish" -f $NetVersion
$propsMatch = $propsContent -match "<TargetNetVersions Condition=`"'\$\(Configuration\)' == 'Release'`">.*</TargetNetVersions>"
if ($propsMatch -ne "<TargetNetVersions Condition=`"'`$(Configuration)' == 'Release'`">$NetVersion</TargetNetVersions>") {
$propsVersion = $Matches[1]
$propsContent -replace "<TargetNetVersions Condition=`"'\$\(Configuration\)' == 'Release'`">.*</TargetNetVersions>", "<TargetNetVersions Condition=`"'`$(Configuration)' == 'Release'`">$NetVersion</TargetNetVersions>" | Set-Content "./Directory.Build.props"
Write-Host "- Replaced TargetNetVersions for Release: $propsVersion -> $NetVersion..."
}


if ($fullBuild) {
# Build the core project
#Write-Host "👉 Building Core project..." -ForegroundColor Yellow
#dotnet build "./src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj" -c Release -o "./src/Core/bin/Publish" -f $NetVersion

# Generate MCP documentation file
Write-Host "👉 Generating MCP documentation..." -ForegroundColor Yellow
# dotnet run --project ".\examples\Tools\FluentUI.Demo.DocApiGen\FluentUI.Demo.DocApiGen.csproj" --xml "$RootDir/src/Tools/McpServer/bin/Publish/Microsoft.FluentUI.AspNetCore.McpServer.xml" --dll "$RootDir/src/Tools/McpServer/bin/Publish/Microsoft.FluentUI.AspNetCore.McpServer.dll" --output "$RootDir/examples/Demo/FluentUI.Demo.Client/wwwroot/mcp-documentation.json" --format json --mode mcp
Write-Host " Skipped."
# Generate API documentation file
Write-Host "👉 Generating API documentation..." -ForegroundColor Yellow
dotnet run --project ".\examples\Tools\FluentUI.Demo.DocApiGen\FluentUI.Demo.DocApiGen.csproj" --xml "$RootDir/src/Core/bin/Publish/Microsoft.FluentUI.AspNetCore.Components.xml" --dll "$RootDir/src/Core/bin/Publish/Microsoft.FluentUI.AspNetCore.Components.dll" --output "$RootDir/examples/Demo/FluentUI.Demo.Client/wwwroot/api-comments.json" --format json

Comment thread
vnbaaij marked this conversation as resolved.
# Build the MCP Server project
Write-Host "👉 Building MCP Server project..." -ForegroundColor Yellow
dotnet build "./src/Tools/McpServer/Microsoft.FluentUI.AspNetCore.McpServer.csproj" -c Release -o "./src/Tools/McpServer/bin/Publish" -f $NetVersion

# Generate MCP documentation file
Write-Host "👉 Generating MCP documentation..." -ForegroundColor Yellow
# dotnet run --project ".\examples\Tools\FluentUI.Demo.DocApiGen\FluentUI.Demo.DocApiGen.csproj" --xml "$RootDir/src/Tools/McpServer/bin/Publish/Microsoft.FluentUI.AspNetCore.McpServer.xml" --dll "$RootDir/src/Tools/McpServer/bin/Publish/Microsoft.FluentUI.AspNetCore.McpServer.dll" --output "$RootDir/examples/Demo/FluentUI.Demo.Client/wwwroot/mcp-documentation.json" --format json --mode mcp
Write-Host " Skipped."
}

# Publish the demo
Write-Host "👉 Publishing demo..." -ForegroundColor Yellow
dotnet publish "./examples/Demo/FluentUI.Demo/FluentUI.Demo.csproj" -c Release -o "./examples/Demo/FluentUI.Demo/bin/Publish" -f $NetVersion

# Verify that the bundle CSS file has the expected size
Write-Host "👉 Verifying bundle CSS file size..." -ForegroundColor Yellow
$bundleFilePath = "./examples/Demo/FluentUI.Demo/bin/Publish/wwwroot/_content/Microsoft.FluentUI.AspNetCore.Components/Microsoft.FluentUI.AspNetCore.Components.bundle.scp.css.br"
# Verify that the bundle JS file has the expected size
Write-Host ""
Write-Host "👉 Verifying bundle JS file size..." -ForegroundColor Yellow
$bundleFilePath = "./examples/Demo/FluentUI.Demo/bin/Publish/wwwroot/_content/Microsoft.FluentUI.AspNetCore.Components/Microsoft.FluentUI.AspNetCore.Components.lib.module.js.br"
Comment thread
vnbaaij marked this conversation as resolved.

if (Test-Path $bundleFilePath) {
$fileSize = (Get-Item $bundleFilePath).Length
$fileSizeKB = [math]::Round($fileSize / 1024, 2)

if ($fileSize -gt 1024) {
Write-Host "☑️ Bundle CSS file verified: $fileSizeKB KB" -ForegroundColor Green
Write-Host "☑️ Bundle JS file verified: $fileSizeKB KB" -ForegroundColor Green
} else {
Write-Host "⛔ Bundle CSS file is too small: $fileSizeKB KB (expected > 1KB)" -ForegroundColor Red
Write-Host "⛔ This may indicate a build issue with the CSS bundle generation." -ForegroundColor Red
Write-Host "⛔ Install .NET 9.0.205 SDK and a `global.json` file with `{ ""sdk"": { ""version"": ""9.0.205"" } }`." -ForegroundColor Red
Write-Host "⛔ Bundle JS file is too small: $fileSizeKB KB (expected > 1KB)" -ForegroundColor Red
Write-Host "⛔ This may indicate a build issue with the JS bundle generation." -ForegroundColor Red
Write-Host "⛔ Install .NET 9.0.205 SDK, remove the references to 'net10' and add a `global.json` file with `{ ""sdk"": { ""version"": ""9.0.205"" } }`." -ForegroundColor Red
Comment thread
vnbaaij marked this conversation as resolved.
exit 1
}
} else {
Write-Host "⛔ Bundle CSS file not found: $bundleFilePath" -ForegroundColor Red
Write-Host "⛔ This may indicate a build issue with the CSS bundle generation." -ForegroundColor Red
Write-Host "⛔ Bundle JS file not found: $bundleFilePath" -ForegroundColor Red
Write-Host "⛔ This may indicate a build issue with the JS bundle generation." -ForegroundColor Red
exit 1
}

# Create deployment archive
Write-Host "👉 Creating deployment archive..." -ForegroundColor Yellow
if (Test-Path "./examples/Demo/FluentUI.Demo/bin/Publish") {
Expand All @@ -92,15 +150,20 @@ if (Test-Path "./examples/Demo/FluentUI.Demo/bin/Publish") {
exit 1
}

Write-Host ""
Write-Host "✅ Demo publish process completed successfully!" -ForegroundColor Green
Write-Host ""

Write-Host ""
Write-Host "----------------------------------------------------"
Write-Host "👉 You can deploy to Azure using a command like:" -ForegroundColor Green
Write-Host "▶️ az webapp deploy --resource-group FluentUI --name fluentui-blazor-v5 --src-path ./examples/Demo/FluentUI.Demo/bin/FluentUI-Blazor.zip --type zip" -ForegroundColor Green
Write-Host "----------------------------------------------------"

# Ask user if they want to run the website
Write-Host ""
$runWebsite = Read-Host "Do you want to run the website now? (Y/n)"
$runWebsite = Read-Host "Do you want to run the local website now? (y/n) [default: y]"
if ($runWebsite -eq "" -or $runWebsite -eq "Y" -or $runWebsite -eq "y") {
Write-Host "👉 Starting the website..." -ForegroundColor Green
Start-Process -FilePath "./examples/Demo/FluentUI.Demo/bin/Publish/FluentUI.Demo.exe" -WorkingDirectory "./examples/Demo/FluentUI.Demo/bin/Publish"
}

Write-Host "👉 You can deploy to Azure using a command like:" -ForegroundColor Green
Write-Host "▶️ az webapp deploy --resource-group FluentUI --name fluentui-blazor-v5 --src-path ./examples/Demo/FluentUI.Demo/bin/FluentUI-Blazor.zip --type zip" -ForegroundColor Green
2 changes: 1 addition & 1 deletion eng/pipelines/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ variables:
# dev branch: 1.2.4-Preview-23282-1' (PackageSuffix is always ignored in Dev branch)
# main branch: 1.2.4-RC.1' (PackageSuffix is ignored, if empty, in Main branch)
FileVersion: '5.0.0' # Set the next final version here.
PackageSuffix: ''
PackageSuffix: 'RC.2'
Comment thread
vnbaaij marked this conversation as resolved.
Outdated
8 changes: 4 additions & 4 deletions examples/Demo/FluentUI.Demo/Components/App.razor
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href="/" />
<link rel="stylesheet" href="app.css" />
<link rel="stylesheet" href="FluentUI.Demo.styles.css" />
<link rel="stylesheet" href="@Assets["FluentUI.Demo.styles.css"]" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<HeadOutlet @rendermode="@DemoRenderMode" />

<style>
/* Set the default dark mode styles,
/* Set the default dark mode styles,
used before the Fluent UI theme switcher is initialized
This is to avoid a flash of white when in dark mode.
Update as needed to match your dark theme.
Expand All @@ -37,7 +37,7 @@
<body use-reboot="@reboot">
<Routes @rendermode="@DemoRenderMode" />
<script src="_framework/blazor.web.js"></script>

<!-- Include highlight.js -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.10.0/styles/vs.min.css" title="highlight-light" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.10.0/styles/vs2015.min.css" title="highlight-dark" disabled="disabled" />
Expand All @@ -50,7 +50,7 @@
document.body.addEventListener('themeChanged', function (e) {
const linkLight = document.querySelector('link[title="highlight-light"]');
const linkDark = document.querySelector('link[title="highlight-dark"]');

if (linkLight && linkDark) {
linkLight.disabled = e.detail.isDark;
linkDark.disabled = !e.detail.isDark;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>$(NetVersion)</TargetFramework>
<TargetFrameworks>$(NetVersion)</TargetFrameworks>
Comment thread
vnbaaij marked this conversation as resolved.
Outdated
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
2 changes: 1 addition & 1 deletion src/Core.Scripts/src/BuildConstants.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// This file is generated by a tool. Do not change!
export const BUILD_MODE = 'Debug';
Comment thread
vnbaaij marked this conversation as resolved.
export const BUILD_MODE = 'Release';
19 changes: 19 additions & 0 deletions src/Core/Microsoft.FluentUI.AspNetCore.Components.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,25 @@

</Target>

<!-- Temporary fix for problem with .esproj files when using latest SDKs. Will be fully fixed in later SDK -->
<Target Name="FixEsprojOriginalItemSpec"
Comment thread
vnbaaij marked this conversation as resolved.
AfterTargets="ResolveReferencedProjectsStaticWebAssets"
Condition="'@(StaticWebAsset)' != ''">
<ItemGroup>
<_EsprojAssetsToFix Include="@(StaticWebAsset)"
Condition="$([System.String]::new('%(StaticWebAsset.OriginalItemSpec)').EndsWith('.esproj'))" />
Comment thread
vnbaaij marked this conversation as resolved.
Outdated
</ItemGroup>
<ItemGroup Condition="'@(_EsprojAssetsToFix)' != ''">
<StaticWebAsset Remove="@(_EsprojAssetsToFix)" />
<StaticWebAsset Include="@(_EsprojAssetsToFix)">
<OriginalItemSpec>%(Identity)</OriginalItemSpec>
</StaticWebAsset>
</ItemGroup>
<ItemGroup>
<_EsprojAssetsToFix Remove="@(_EsprojAssetsToFix)" />
</ItemGroup>
</Target>

<!-- Resources Localization -->
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.ResxSourceGenerator">
Expand Down
4 changes: 2 additions & 2 deletions src/Tools/McpServer/.mcp/server.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"registryType": "nuget",
"registryBaseUrl": "https://api.nuget.org",
"identifier": "Microsoft.FluentUI.AspNetCore.McpServer",
"version": "0.0.1",
"version": "5.0.0-RC.2",
Comment thread
vnbaaij marked this conversation as resolved.
Outdated
"runtimeHint": "dnx",
"transport": {
"type": "stdio"
Expand All @@ -26,5 +26,5 @@
"source": "github"
},
"title": "Fluent UI Blazor MCP Server",
"version": "0.0.1"
"version": "5.0.0-RC.2"
Comment thread
vnbaaij marked this conversation as resolved.
Outdated
}
Loading