Skip to content

feat: shellui migrate rewrites pages for template API changes - #78

Merged
Shewart merged 4 commits into
mainfrom
feat/migrate-command
Oct 27, 2026
Merged

Shewart merged 4 commits into
mainfrom
feat/migrate-command

Conversation

@Shewart

@Shewart Shewart commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #58.

shellui update replaces a component but leaves your pages on the old API, so the build breaks. shellui migrate fixes the known cases:

shellui migrate --dry-run      # show the changes
shellui migrate                # show them, then ask before writing
shellui migrate date-picker    # only some migrations
shellui migrate --yes          # write without asking (required in CI or a pipe)

It reads the project's own .razor and .cs files. It skips the installed components under ComponentsPath (update rewrites those) and bin, obj and node_modules. It shows each changed line, and nothing is written without a yes.

Migrations, taken from the release notes' upgrade sections:

Name Change
input Input.InputVariant.X → InputVariant.X
date-picker SelectedDate / SelectedDateChanged / @bind-SelectedDate → Value / ValueChanged / @bind-Value, on <DatePicker> tags only, so Calendar is untouched
time-picker the same for SelectedTime on <TimePicker>
pagination OnPageChange → CurrentPageChanged, except on a tag that binds CurrentPage (that would set it twice)
calendar reports SelectedDateChanged handlers that take a DateTime (now DateTime?). Not rewritten, since the handler body may need changes too.

Tag rewrites scan to the tag's closing > outside quotes, so attributes spread over several lines and > inside a quoted value are handled.

Checked end to end in a fresh dotnet new blazor app:

  1. Installed input, date-picker, time-picker, pagination and calendar with the local CLI, then wrote a page in the old API. It failed to build.
  2. migrate --dry-run showed the four rewrites and flagged the Calendar handler.
  3. Without --yes in a pipe, nothing was written (exit 1).
  4. --yes rewrote the page. After fixing the flagged handler, the app built with 0 errors and 0 warnings, and a second run said "Nothing to migrate".

On the demo app it found one real case, the deprecated Pagination.OnPageChange, which is migrated here.

Tests: 540 passing on net8.0 and net10.0, 0 warnings.

shellui update replaces a component but leaves the app's pages on the
old API, so the build breaks. migrate reads the project's .razor and
.cs files (not the installed components or build output), shows each
changed line and asks before writing; --dry-run only shows, --yes
writes without asking and is required outside an interactive terminal.

Migrations, from the release notes' upgrade sections:
- input: Input.InputVariant.X -> InputVariant.X
- date-picker / time-picker: SelectedDate / SelectedTime (with Changed
  and @bind-) -> Value, on those tags only, so Calendar is untouched
- pagination: OnPageChange -> CurrentPageChanged, unless the tag binds
  CurrentPage
- calendar: reports SelectedDateChanged handlers that take a DateTime
  instead of DateTime?; nothing is rewritten

Fixes #58
Each migration, tag scoping (Calendar left alone, > inside a quoted value), the bound-CurrentPage exception, skipping installed components and obj, the Calendar note and an up-to-date app.
Applied with shellui migrate pagination.
Copilot AI balanced review requested due to automatic review settings October 23, 2026 05: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 3374ff1 into main Oct 27, 2026
1 check passed
@Shewart
Shewart deleted the feat/migrate-command branch October 27, 2026 09:25
@Shewart Shewart mentioned this pull request Oct 30, 2026
Shewart added a commit that referenced this pull request Oct 30, 2026
Release notes and version references for 0.4.0, the 0.4 stable release.

It fixes a hang in `shellui add` on .NET 8 and 9 apps that this
release's smoke test found, and the 0.4.0 notes describe those fixes.

**In this release** (on main, plus #80)
- #76: PromptSuggestions, Reasoning, ToolCall, Field, JsonViewer
- #77: a real resizable panel group (`ResizablePanelGroup` / `Panel` /
`Handle`)
- #78: `shellui migrate`
- #74: .NET 8 support, `shellui add all`, `shellui doctor`,
`SonnerService.Clear`, destructive context menu items, safelist fix
- the whole 0.4 alpha line (alpha.1 to alpha.3), summed up for people
upgrading from 0.3.6
- #80: `add` no longer hangs on .NET 8/9, the CLI rolls forward to newer
runtimes, `doctor` stops calling a fresh `app.css` stale, `list` counts
fixed

Not in it: #79 (ShellCharts instead of ApexCharts) stays a draft for a
later release.

**This PR**
- `Directory.Build.props`: empty suffix, so both packages build as
`0.4.0`
- README, VERSIONING_STRATEGY, CLI_INSTALLATION, CLI_SYNTAX, FAQ,
QUICKSTART and the version fallbacks move to `0.4.0`. The latest stable
was still listed as 0.3.5, so 0.3.6 is now the previous stable. Installs
no longer need `--version`.
- `docs/RELEASE_NOTES.md`: the 0.4.0 section.
`scripts/extract-release-notes.sh 0.4.0` extracts it.

**Release checks.** Packed 0.4.0, with #80, installed from a local
folder into a private tool path, using a throwaway NuGet cache so
nothing local shadows the published packages.
- Release build: 0 warnings. 540 tests on net8.0 and net10.0 (542 with
#80).
- Every command in a fresh .NET 10 app: `init --yes`, `add all` (244
files), `list`, `remove`, `update`, `migrate --dry-run`, `theme apply`,
`theme update`, `doctor`. Builds 0/0.
- `init` and `add all` in fresh .NET 8 and .NET 9 apps build 0/0 and
`doctor` is clean. Before #80, `add all` hung on both.
- All 98 direct targets together, including the `dashboard-*` and
`auth-*` blocks, in `my-app` (.NET 10): 0/0, `doctor` clean.
- Upgrade from the published 0.4.0-alpha.3:
  - An app with a page using the old APIs builds on alpha.3.
- 0.4.0 `update` rewrites 55 components and replaces the targets file,
and the app builds 0/0.
- `migrate` rewrites the page (DatePicker, TimePicker, Pagination), it
builds 0/0, and `doctor` is clean.
- CLI templates in a browser:
- suggestion chips; Reasoning folds to "Thought for 2 seconds"; Field
shows the EditForm error; JSON tree folds
  - Resizable drags from 30/70 to 55/45
  - no console errors
- Packed `ShellUI.Components` in a .NET 8 app with `shellui-all.css`, in
light and dark mode:
- the new components render; the resizable drag and suggestion chips
work
  - Dialog focus trap: Tab stays inside, Escape closes and returns focus
- `shellui.js` loads through the package's JS initializer, with 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.

shellui migrate for template API changes

2 participants