diff --git a/Directory.Build.props b/Directory.Build.props index 645d1b0..2edf716 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,7 +2,7 @@ - 0.3.1 + 0.3.2 diff --git a/README.md b/README.md index aeee7aa..8922eaf 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ | Channel | Version | Notes | |---|---|---| -| Latest stable (recommended) | `0.3.1` | Tailwind CSS `4.3.2` | +| Latest stable (recommended) | `0.3.2` | Tailwind CSS `4.3.2` | | Previous stable | `0.2.1` | Superseded by `0.3.0` | The CLI needs the .NET 10 SDK and works in Blazor projects on .NET 8, 9 and 10. The `ShellUI.Components` NuGet package targets .NET 10 only; on .NET 8 or 9, use the CLI. diff --git a/ShellUI.Tests/PackageRenderTests.cs b/ShellUI.Tests/PackageRenderTests.cs new file mode 100644 index 0000000..260d626 --- /dev/null +++ b/ShellUI.Tests/PackageRenderTests.cs @@ -0,0 +1,77 @@ +using Bunit; +using Microsoft.AspNetCore.Components; +using Microsoft.Extensions.DependencyInjection; +using ShellUI.Components; +using ShellUI.Components.Services; + +namespace ShellUI.Tests; + +public class PackageRenderTests +{ + public sealed class Row + { + public string Name { get; set; } = ""; + } + + // Other render failures come from a missing parent or required parameter; these two are always bugs. + private static readonly string[] BindingErrors = + { + "does not have a property matching the name", + "declares more than one parameter matching the name", + }; + + [Fact] + public void EveryPackageComponent_RendersWithoutParameterBindingErrors() + { + var types = typeof(Shell).Assembly.GetExportedTypes() + .Where(t => typeof(IComponent).IsAssignableFrom(t) && !t.IsAbstract && t.Namespace == "ShellUI.Components") + .ToList(); + Assert.NotEmpty(types); + + var offenders = new List(); + foreach (var type in types) + { + var closed = type.IsGenericTypeDefinition ? Close(type) : type; + if (closed is null) + { + offenders.Add($"{type.Name}: could not choose type arguments"); + continue; + } + + using var ctx = new BunitContext(); + ctx.JSInterop.Mode = JSRuntimeMode.Loose; + ctx.Services.AddShellUISonner(); + ctx.Services.AddScoped(); + + try + { + ctx.Render(p => p.Add(c => c.Type, closed)); + } + catch (Exception ex) + { + var message = Flatten(ex); + if (BindingErrors.Any(message.Contains)) offenders.Add($"{type.Name}: {message}"); + } + } + + Assert.True(offenders.Count == 0, "Package components that fail parameter binding:\n " + string.Join("\n ", offenders)); + } + + private static Type? Close(Type definition) + { + foreach (var candidate in new[] { typeof(Row), typeof(string), typeof(int) }) + { + try + { + return definition.MakeGenericType(definition.GetGenericArguments().Select(_ => candidate).ToArray()); + } + catch (ArgumentException) { } + } + return null; + } + + private static string Flatten(Exception ex) => + ex is AggregateException agg + ? string.Join(" | ", agg.Flatten().InnerExceptions.Select(Flatten)) + : ex.InnerException is null ? ex.Message : ex.Message + " | " + Flatten(ex.InnerException); +} diff --git a/ShellUI.Tests/ShellUI.Tests.csproj b/ShellUI.Tests/ShellUI.Tests.csproj index c32e66e..f7fee2a 100644 --- a/ShellUI.Tests/ShellUI.Tests.csproj +++ b/ShellUI.Tests/ShellUI.Tests.csproj @@ -8,6 +8,7 @@ + @@ -24,6 +25,7 @@ + diff --git a/VERSIONING_STRATEGY.md b/VERSIONING_STRATEGY.md index b8f09ad..9d51a5e 100644 --- a/VERSIONING_STRATEGY.md +++ b/VERSIONING_STRATEGY.md @@ -6,7 +6,7 @@ ShellUI uses one centralized version for the source templates, CLI tool, and pac | Scope | Value | |---|---| -| Version | `0.3.1` | +| Version | `0.3.2` | | Target framework | .NET 10 | | Tailwind version | `4.3.2` | @@ -18,15 +18,15 @@ The root `Directory.Build.props` supplies the version: ```xml - 0.3.1 + 0.3.2 ``` `Directory.Build.props` composes the package and assembly metadata: -- `Version` is `0.3.1`; with a suffix such as `rc.1` it becomes `0.3.1-rc.1`. -- `AssemblyVersion` and `FileVersion` use the numeric base `0.3.1`. +- `Version` is `0.3.2`; with a suffix such as `rc.1` it becomes `0.3.2-rc.1`. +- `AssemblyVersion` and `FileVersion` use the numeric base `0.3.2`. - `InformationalVersion` includes the prerelease suffix. - Component metadata reads the centralized properties when running from the repository. `VersionHelper` uses assembly metadata as a fallback when its repository search does not find the solution file. @@ -57,7 +57,7 @@ The CLI writes the computed version into `shellui.json` for each installed entry "InstalledComponents": [ { "Name": "button", - "Version": "0.3.1", + "Version": "0.3.2", "InstalledAt": "2026-01-01T00:00:00Z", "IsCustomized": false } diff --git a/docs/CLI_INSTALLATION.md b/docs/CLI_INSTALLATION.md index c7b5493..d23929f 100644 --- a/docs/CLI_INSTALLATION.md +++ b/docs/CLI_INSTALLATION.md @@ -4,7 +4,7 @@ | Context | Version | |---|---| -| Latest stable (recommended) | `0.3.1`, needs the .NET 10 runtime | +| Latest stable (recommended) | `0.3.2`, needs the .NET 10 runtime | | Previous stable | `0.2.1` | | Tailwind | `4.3.2` | @@ -43,7 +43,7 @@ The manifest is `.config/dotnet-tools.json` and uses the installed package versi "isRoot": true, "tools": { "shellui.cli": { - "version": "0.3.1", + "version": "0.3.2", "commands": ["shellui"] } } diff --git a/docs/CLI_SYNTAX.md b/docs/CLI_SYNTAX.md index 28af722..7d375c6 100644 --- a/docs/CLI_SYNTAX.md +++ b/docs/CLI_SYNTAX.md @@ -1,6 +1,6 @@ # ShellUI CLI Syntax -This reference covers CLI `0.3.1`: it runs on .NET 10, sets up Blazor projects on .NET 8, 9 and 10, uses Tailwind CSS `4.3.2`, and has and 76 direct component targets. Older versions, such as `0.2.1`, lack some of these commands. +This reference covers CLI `0.3.2`: it runs on .NET 10, sets up Blazor projects on .NET 8, 9 and 10, uses Tailwind CSS `4.3.2`, and has and 76 direct component targets. Older versions, such as `0.2.1`, lack some of these commands. ## Command prefix @@ -205,7 +205,7 @@ Representative fields look like this: "InstalledComponents": [ { "Name": "button", - "Version": "0.3.1", + "Version": "0.3.2", "InstalledAt": "2026-01-01T00:00:00Z", "IsCustomized": false } diff --git a/docs/FAQ.md b/docs/FAQ.md index 48b15bf..874ba7a 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -6,7 +6,7 @@ Answers for the current ShellUI source and the currently published packages. ### Which version should I use? -Use `0.3.1`. It uses Tailwind CSS `4.3.2` and has 76 direct component targets: +Use `0.3.2`. It uses Tailwind CSS `4.3.2` and has 76 direct component targets: ```bash dotnet tool install -g ShellUI.CLI @@ -145,7 +145,7 @@ A representative Tailwind and component record is: "InstalledComponents": [ { "Name": "button", - "Version": "0.3.1", + "Version": "0.3.2", "InstalledAt": "2026-01-01T00:00:00Z", "IsCustomized": false } diff --git a/docs/QUICKSTART.md b/docs/QUICKSTART.md index 9cdd53f..06824f6 100644 --- a/docs/QUICKSTART.md +++ b/docs/QUICKSTART.md @@ -1,6 +1,6 @@ # ShellUI Quick Start -This quick start uses ShellUI `0.3.1`: Tailwind CSS `4.3.2` and 76 direct component targets. The CLI needs the .NET 10 SDK and works in Blazor projects on .NET 8, 9 and 10. +This quick start uses ShellUI `0.3.2`: Tailwind CSS `4.3.2` and 76 direct component targets. The CLI needs the .NET 10 SDK and works in Blazor projects on .NET 8, 9 and 10. ## Prerequisites diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index 6af608d..7ab8084 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -1,5 +1,25 @@ # ShellUI Release Notes +# ShellUI v0.3.2 + +> A patch release with component fixes for both the `ShellUI.Components` NuGet package and the CLI templates. + +## 🐛 Fixes + +- `MultiSeriesChart` threw on every render in the NuGet package. It now renders, inside the same card as `Chart`. +- NuGet package: `ThemeToggle` flipped its icon but did not change the theme, dialogs, sheets and drawers did not lock page scrolling, and close-on-scroll dropdowns stayed open. The package's `shellui.js` now loads automatically through a Blazor JS initializer, with no `