From bb5a7ae54e7b6ee0cf4502fa5e24e51346e734b8 Mon Sep 17 00:00:00 2001 From: jessikitty Date: Mon, 27 Apr 2026 16:27:37 +1000 Subject: [PATCH] v1.3.0 - Fix manifest: use correct CategoryTypeName for UIExtension features --- Build-Plugin.ps1 | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/Build-Plugin.ps1 b/Build-Plugin.ps1 index 7641938..76a98e6 100644 --- a/Build-Plugin.ps1 +++ b/Build-Plugin.ps1 @@ -81,7 +81,6 @@ Write-Host "Build successful: $pluginDll" -ForegroundColor Green # --- Generate Manifest --- Write-Host "`nGenerating manifest..." -ForegroundColor Yellow -# Copy all needed DLLs to build output for ManifestGenerator type resolution foreach ($dll in $requiredDlls) { Copy-Item (Join-Path $DiscoBinPath $dll) $buildOutput -Force -ErrorAction SilentlyContinue } @@ -91,8 +90,6 @@ foreach ($dep in $extraDlls) { if (Test-Path $depPath) { Copy-Item $depPath $buildOutput -Force -ErrorAction SilentlyContinue } } -# Try the real ManifestGenerator first - it uses reflection to find [PluginFeature] attributes -# and generates the correct manifest format including UIExtension features $useManifestGen = $false $manifestGenExe = Join-Path $DiscoBinPath "Disco.Services.Plugins.ManifestGenerator.exe" if (-not (Test-Path $manifestGenExe)) { @@ -112,9 +109,11 @@ if (Test-Path $manifestGenExe) { if (-not $useManifestGen) { $version = [System.Reflection.AssemblyName]::GetAssemblyName($pluginDll).Version - # Manual manifest - do NOT include Features array as the format must match - # exactly what ManifestGenerator produces. Without it, features won't auto-register - # but the web handler comparison dashboard still works fully. + + # CategoryTypeName must match what ManifestGenerator produces: + # For UIExtensionFeature, the generic type definition FullName is UIExtensionFeature`1 + $uiExtCategoryTypeName = "Disco.Services.Plugins.Features.UIExtension.UIExtensionFeature``1" + $manifest = [ordered]@{ Id = $PluginName Name = "AD Compare" @@ -125,11 +124,25 @@ if (-not $useManifestGen) { TypeName = "Disco.Plugins.ADCompare.ADComparePlugin" ConfigurationHandlerTypeName = "Disco.Plugins.ADCompare.ConfigurationHandler.ADCompareConfigurationHandler" WebHandlerTypeName = "Disco.Plugins.ADCompare.WebHandler.ADCompareWebHandler" + Features = @( + [ordered]@{ + Id = "ADCompareDeviceUI" + Name = "Device Page - AD Compare" + TypeName = "Disco.Plugins.ADCompare.Features.DeviceUIExtension" + PrimaryFeature = $false + CategoryTypeName = $uiExtCategoryTypeName + }, + [ordered]@{ + Id = "ADCompareUserUI" + Name = "User Page - AD Compare" + TypeName = "Disco.Plugins.ADCompare.Features.UserUIExtension" + PrimaryFeature = $false + CategoryTypeName = $uiExtCategoryTypeName + } + ) } $manifest | ConvertTo-Json -Depth 5 | Set-Content (Join-Path $buildOutput "manifest.json") -Encoding UTF8 - Write-Host "Manual manifest.json created (without UIExtension features)" -ForegroundColor Yellow - Write-Host " Note: For full UIExtension support on device/user pages," -ForegroundColor Yellow - Write-Host " install Disco.Services.Plugins.ManifestGenerator.exe" -ForegroundColor Yellow + Write-Host "Manual manifest.json created with UIExtension features" -ForegroundColor Green } # --- Package ---