Skip to content

fix: Razor class library support in init and docs; ci: NuGet Trusted Publishing - #71

Merged
Shewart merged 2 commits into
mainfrom
docs/rcl-guide-and-trusted-publishing
Oct 20, 2026
Merged

Shewart merged 2 commits into
mainfrom
docs/rcl-guide-and-trusted-publishing

Conversation

@Shewart

@Shewart Shewart commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Two changes for the next release, one commit each.

Razor class libraries (07a581b, fixes #53)

A library shared by several apps (a Blazor Web App and a MAUI Blazor Hybrid app) has no host page of its own, so init printed "skipped host bootstrap" and left each app's setup to guesswork.

  • init recognises a Razor class library (Microsoft.NET.Sdk.Razor with no Program.cs) and prints what each app needs, with the library's real _content/<name> path (honouring PackageId, AssemblyName and StaticWebAssetBasePath)
  • init now adds its @using to a root _Imports.razor too. Libraries keep it there, so before this the import was silently skipped
  • New guide docs/razor-class-library.md: linking app.css and shellui.js (before the Blazor script) from a Web App and a MAUI Hybrid app, the theme script, @source for markup that lives in an app, and prerender: false for apps that restore state from browser storage. Linked from the README and FAQ

Checked with a real library and a Blazor Web App host set up exactly as the guide says:

  • the library's app.css and shellui.js load from _content/MyApp.UI (200), and shared components are styled
  • markup that lives only in the host is styled through @source
  • the theme toggle switches to dark, and a reload stays dark with no flash
  • the console is clean

Tests cover the detection, the asset path, the printed steps, and that the guide's theme script matches the one init writes.

Trusted Publishing (aad785e, refs #59)

release.yml pushed with a long-lived NUGET_API_KEY secret. The job now runs in the release environment with id-token: write, and NuGet/login@v1 exchanges the OIDC token for a key that expires after an hour, as ShellDocs and ShellUI Native already do. NUGET_API_KEY no longer appears in any workflow.

docs/RELEASING.md (linked from VERSIONING_STRATEGY and CONTRIBUTING) has the one-time setup and the release checklist:

  1. GitHub environment release
  2. Repository secret NUGET_USER (the nuget.org profile name)
  3. nuget.org Trusted Publishing policy: owner shellui-dev, repo shellui, workflow release.yml, environment release
  4. After the first successful publish: delete the NUGET_API_KEY secret and revoke the key on nuget.org

Note: release/v0.3 has its own release.yml, and a tag runs the workflow from the tagged commit. The same change goes there before step 4, or the next 0.3.x tag can't publish. #59 stays open until that's done.

Checked

  • Release build has 0 warnings, and all 484 tests pass

Shewatipa Tseisi added 2 commits October 20, 2026 21:24
A library shared by several apps (a Blazor Web App and a MAUI Blazor
Hybrid app) has no host page, so init printed "skipped host bootstrap"
and left each app's setup undocumented. init now recognises a Razor
class library (Microsoft.NET.Sdk.Razor with no Program.cs) and prints
the steps each app needs, with the library's _content path. It also adds
its @using to a root _Imports.razor, where libraries keep it.

docs/razor-class-library.md covers linking app.css and shellui.js, the
theme script, @source for markup that lives in an app, and
prerender: false for apps that restore state from browser storage.

Fixes #53
release.yml pushed with a long-lived NUGET_API_KEY secret. The job now
runs in the release environment with id-token: write, and NuGet/login
exchanges the OIDC token for a key that expires after an hour, as
ShellDocs and ShellUI Native already do. docs/RELEASING.md has the
one-time GitHub and nuget.org setup and the release checklist.

Refs #59
Copilot AI balanced review requested due to automatic review settings October 20, 2026 20:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@Shewart
Shewart merged commit 52a132b into main Oct 20, 2026
1 check passed
@Shewart
Shewart deleted the docs/rcl-guide-and-trusted-publishing branch October 20, 2026 20:33
Shewart added a commit that referenced this pull request Oct 20, 2026
Release notes and version references for 0.4.0-alpha.3. The first
release published with NuGet Trusted Publishing (#71).

**In this release** (already on main)
- #69: a component's `Class` overrides its own conflicting classes
(`Shell.Cn` merges like tailwind-merge)
- #64: Dialog, AlertDialog, Sheet and Drawer keep keyboard focus inside
and return it on close
- #70: `add` never downgrades a NuGet package the project already
references
- #71: `init` supports Razor class libraries, plus a guide; release
workflow on Trusted Publishing
- #63, #65, #66, #68: CLI templates reconciled with the package
(RadioGroup, ScrollArea, DatePicker, TimePicker, Pagination, Toast,
Skeleton, Sheet/Drawer and more)

**Breaking for CLI template users** (after `shellui update`, all in the
notes with upgrade steps): `Input.InputVariant` becomes `InputVariant`
(new `input-variants` template); Stepper parts read `ActiveStep` instead
of taking `CurrentStep`; `ScrollArea` drops its `scrollbar-*` classes.
`update` installs the new templates automatically.

**This PR**
- `Directory.Build.props` suffix `alpha.3`; README, VERSIONING_STRATEGY,
CLI_INSTALLATION, CLI_SYNTAX, FAQ, QUICKSTART and the version fallbacks
move to `0.4.0-alpha.3`
- `docs/RELEASE_NOTES.md`: the 0.4.0-alpha.3 section;
`scripts/extract-release-notes.sh 0.4.0-alpha.3` extracts it

**Release checks**
- Release build has 0 warnings, and all 484 tests pass
- An app set up with the released 0.4.0-alpha.2 CLI, updated with the
packed alpha.3 CLI: 36 components updated, `input-variants`,
`textarea-variants` and `stepper-models` installed, builds 0/0
- CLI templates in a browser: RadioGroup selects (disabled items
ignored), ScrollArea scrolls, Pagination `@bind-CurrentPage`, Stepper
Next, DatePicker puts 1 October 2026 under Thursday, TimePicker
`Step="15"` lists 00/15/30/45, `Class="px-8 bg-destructive"` replaces
the button's own `px-4 bg-primary`, `InputVariant.Error` applies
- Focus trap with real key presses (templates and package): Tab cycles
inside the dialog and wraps, Shift+Tab goes back, Escape closes and
returns focus to the trigger
- All 93 direct targets together in `my-app` build 0/0 on net8.0, net9.0
and net10.0 (244 registry entries)
- The packed `ShellUI.Components` in a browser: the class override,
TimePicker, dark mode with `color-scheme`, Popover Escape, Command
`Action`, the dialog focus trap; no console errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: using ShellUI from a Razor class library shared by several hosts

2 participants