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
22 changes: 20 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CI

on:
push:
branches: [ main, develop ]
branches: [ main, develop, "release/**" ]
pull_request:
branches: [ main, develop ]
branches: [ main, develop, "release/**" ]

jobs:
build-and-test:
Expand Down Expand Up @@ -134,6 +134,24 @@ jobs:

dotnet build -c Debug

# Every direct target must install and compile together; this catches missing
# dependencies and template compile errors that per-template tests can't see.
ALL=$(python3 - "$GITHUB_WORKSPACE" <<'PY'
import os, re, sys
root = sys.argv[1]
reg = open(os.path.join(root, "src/ShellUI.Templates/ComponentRegistry.cs")).read().split("GetComponentContent")[0]
names = [n for n, c in re.findall(r'\{ "([a-z0-9-]+)", (\w+)\.Metadata \}', reg)
if not re.search(r"IsAvailable\s*=\s*false", open(os.path.join(root, f"src/ShellUI.Templates/Templates/{c}.cs")).read())]
print(" ".join(names))
PY
)
cd "$TMPDIR/app"
dotnet new blazor -o AllApp --no-restore
cd AllApp
shellui init --tailwind standalone --yes
shellui add $ALL
dotnet build -c Debug

# Pure-NuGet install path — `dotnet add package ShellUI.Components` without
# the CLI. Uses a one-off NuGet.config that whitelists ONLY the local feed,
# so a missing local package can't silently fall back to nuget.org and pull
Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<Project>
<!-- Centralized ShellUI Version - Update this single file to version all components -->
<PropertyGroup>
<ShellUIVersion>0.3.0</ShellUIVersion>
<ShellUIVersionSuffix>rc.2</ShellUIVersionSuffix>
<ShellUIVersion>0.4.0</ShellUIVersion>
<ShellUIVersionSuffix>alpha.1</ShellUIVersionSuffix>
</PropertyGroup>

<!-- Common properties for all ShellUI projects -->
Expand Down
32 changes: 0 additions & 32 deletions SHELLUI-FIXES.md

This file was deleted.

27 changes: 26 additions & 1 deletion ShellUI.Tests/TemplateCompileTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public void EveryRazorTemplate_CodeBlockParses()
var failures = new List<string>();
foreach (var (name, metadata) in ComponentRegistry.Components)
{
if (!metadata.IsAvailable) continue;
if (!metadata.FilePath.EndsWith(".razor", System.StringComparison.OrdinalIgnoreCase)) continue;

var content = ComponentRegistry.GetComponentContent(name);
Expand All @@ -117,6 +116,32 @@ public void EveryRazorTemplate_CodeBlockParses()
string.Join("\n ", failures));
}

[Fact]
public void EveryRegistryEntry_HasContent()
{
var empty = ComponentRegistry.Components.Keys
.Where(name => string.IsNullOrWhiteSpace(ComponentRegistry.GetComponentContent(name)))
.ToList();
Assert.True(empty.Count == 0, "Registry entries with empty content:\n " + string.Join("\n ", empty));
}

[Fact]
public void EveryHiddenEntry_IsReachableFromAnInstallableTarget()
{
var reachable = new HashSet<string>();
var stack = new Stack<string>(ComponentRegistry.Components.Where(c => c.Value.IsAvailable).Select(c => c.Key));
while (stack.Count > 0)
{
var name = stack.Pop();
if (!reachable.Add(name)) continue;
foreach (var dep in ComponentRegistry.Components[name].Dependencies ?? new List<string>())
stack.Push(dep);
}
// sidebar-js: legacy, kept for projects that still load shellui-sidebar.js.
var orphans = ComponentRegistry.Components.Keys.Where(k => !reachable.Contains(k) && k != "sidebar-js").ToList();
Assert.True(orphans.Count == 0, "Hidden entries no installable target depends on:\n " + string.Join("\n ", orphans));
}

/// Strips Razor markup directives so the remaining text can be best-effort
/// parsed as C#. Not a real Razor parser — just enough to surface useful
/// diagnostics when ExtractCodeBlock fails.
Expand Down
31 changes: 31 additions & 0 deletions ShellUI.Tests/TemplateSyncTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,37 @@ public class TemplateSyncTests
[InlineData("chat-input", "ChatInput.razor")]
[InlineData("chat", "Chat.razor")]
[InlineData("command", "Command.razor")]
[InlineData("select", "Select.razor")]
[InlineData("select-trigger", "SelectTrigger.razor")]
[InlineData("select-content", "SelectContent.razor")]
[InlineData("select-item", "SelectItem.razor")]
[InlineData("context-menu", "ContextMenu.razor")]
[InlineData("context-menu-trigger", "ContextMenuTrigger.razor")]
[InlineData("context-menu-content", "ContextMenuContent.razor")]
[InlineData("context-menu-option", "ContextMenuOption.razor")]
[InlineData("navigation-menu", "NavigationMenu.razor")]
[InlineData("nav-list", "NavList.razor")]
[InlineData("nav-item", "NavItem.razor")]
[InlineData("nav-trigger", "NavTrigger.razor")]
[InlineData("nav-content", "NavContent.razor")]
[InlineData("carousel", "Carousel.razor")]
[InlineData("carousel-list", "CarouselList.razor")]
[InlineData("carousel-slide", "CarouselSlide.razor")]
[InlineData("dropdown", "Dropdown.razor")]
[InlineData("dropdown-trigger", "DropdownTrigger.razor")]
[InlineData("dropdown-content", "DropdownContent.razor")]
[InlineData("dropdown-item", "DropdownItem.razor")]
[InlineData("popover", "Popover.razor")]
[InlineData("popover-trigger", "PopoverTrigger.razor")]
[InlineData("popover-content", "PopoverContent.razor")]
[InlineData("hover-card", "HoverCard.razor")]
[InlineData("hover-card-trigger", "HoverCardTrigger.razor")]
[InlineData("hover-card-content", "HoverCardContent.razor")]
[InlineData("tabs", "Tabs.razor")]
[InlineData("accordion", "Accordion.razor")]
[InlineData("accordion-item", "AccordionItem.razor")]
[InlineData("accordion-trigger", "AccordionTrigger.razor")]
[InlineData("accordion-content", "AccordionContent.razor")]
public void TemplateCodeBlock_MatchesLiveLibrary(string templateName, string razorFileName)
{
if (AllowedDrift.ContainsKey(templateName)) return;
Expand Down
Loading
Loading