Skip to content

Add dotnet global tool for converting ASP.NET Web Forms (.ascx) to Blazor (.razor)#328

Draft
Copilot wants to merge 6 commits intodevfrom
copilot/add-ascx-to-razor-tool
Draft

Add dotnet global tool for converting ASP.NET Web Forms (.ascx) to Blazor (.razor)#328
Copilot wants to merge 6 commits intodevfrom
copilot/add-ascx-to-razor-tool

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 1, 2026

Implements a CLI tool to automate conversion of Web Forms user controls to Blazor Razor components, addressing the need for migration tooling alongside the component library.

Implementation

New Project: src/BlazorWebFormsComponents.Cli/

  • Packaged as dotnet global tool: WebformsToBlazor.Cli
  • Command: webforms-to-blazor
  • Built on System.CommandLine for argument parsing

Conversions Performed

Web Forms Syntax Blazor Output
<%@ Control ... Inherits="X" %> @inherits X
<asp:Button> <Button>
runat="server" (removed)
<%: expr %>, <%= expr %>, <%# expr %> @(expr)
<% code %> @{ code }
Item.Property context.Property (in expressions only)

Usage

# Install
dotnet tool install --global WebformsToBlazor.Cli

# Convert single file
webforms-to-blazor -i MyControl.ascx

# Convert directory recursively
webforms-to-blazor -i ./Controls -r -f

Example

Input (ProductCard.ascx):

<%@ Control Language="C#" Inherits="MyApp.ProductCard" %>
<asp:Image ImageUrl='<%# Item.ImageUrl %>' runat="server" />
<asp:Button Text="Add to Cart" OnClick="Handler" runat="server" />

Output (ProductCard.razor):

@inherits MyApp.ProductCard

<Image ImageUrl='@(context.ImageUrl)' />
<Button Text="Add to Cart" OnClick="Handler" />

Future Extension Point

AiAssistant class provides hook for AI-powered enhancement via GitHub Copilot SDK/OpenAI (currently no-op).

Documentation

  • src/BlazorWebFormsComponents.Cli/README.md - Full usage guide
  • src/BlazorWebFormsComponents.Cli/EXAMPLES.md - Conversion examples
  • Root README.md - Tool overview and installation
Original prompt

This section details on the original issue you should resolve

<issue_title>Suggestion: dotnet global tool to convert ascx to razor</issue_title>
<issue_description>It would be a great companion tool to have to convert ascx files to razor components - fixing any obvious name changes along the way (thinking the @context vs Item problem here)</issue_description>

<agent_instructions>Let's start a companion project in the solution in this repository for a command-line tool that helps facilitate this conversion using both the BlazorWebFormsComponents and the GitHub Copilot SDK
</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@csharpfritz I love this idea, and it is a big rock to be addressed as a future project on its own. Perhaps as part of a larger collection of tools that augment the Blazor conversion of applications

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits February 1, 2026 03:11
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
Copilot AI changed the title [WIP] Add dotnet global tool to convert ascx to razor components Add dotnet global tool for converting ASP.NET Web Forms (.ascx) to Blazor (.razor) Feb 1, 2026
Copilot AI requested a review from csharpfritz February 1, 2026 03:22
@csharpfritz
Copy link
Copy Markdown
Collaborator

@copilot I want the name of the CLI app to be WebformsToBlazor. The name Fritz shouldn't appear in the app name

…r.Cli

Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 1, 2026

@copilot I want the name of the CLI app to be WebformsToBlazor. The name Fritz shouldn't appear in the app name

Done! Renamed the package from Fritz.WebFormsToBlazor.Cli to WebformsToBlazor.Cli. Updated in the project file and all documentation. (commit c2c9447)

csharpfritz added a commit to csharpfritz/BlazorWebFormsComponents that referenced this pull request Mar 31, 2026
…ture structure

Bring CLI project from copilot/add-ascx-to-razor-tool branch.
Create Pipeline/, Transforms/, Scaffolding/, Config/, Analysis/, Io/ dirs.
Copy all 21 L1 test cases (29 input + 29 expected files).
Add architecture doc from phase3 branch.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
csharpfritz added a commit that referenced this pull request Apr 7, 2026
* feat: seed global tool project from PR #328 + architecture structure

Bring CLI project from copilot/add-ascx-to-razor-tool branch.
Create Pipeline/, Transforms/, Scaffolding/, Config/, Analysis/, Io/ dirs.
Copy all 21 L1 test cases (29 input + 29 expected files).
Add architecture doc from phase3 branch.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add xUnit test project for CLI global tool (tests/BlazorWebFormsComponents.Cli.Tests)

Create the test infrastructure for the webforms-to-blazor C# global tool:

- BlazorWebFormsComponents.Cli.Tests.csproj: net10.0, xunit 2.x, references CLI project,
  excludes TestData/**/*.cs from compilation (they're test inputs, not source)
- L1TransformTests.cs: Parameterized [Theory] tests that discover all 21 TC* test cases
  from TestData, verify markup (.aspx.razor) and code-behind (.aspx.cs.razor.cs) pairs.
  Pipeline calls are stubbed with TODO comments until Bishop builds MigrationPipeline.
- TestHelpers.cs: NormalizeContent() ported from Run-L1Tests.ps1 (CRLFLF, trim trailing
  whitespace per line, remove trailing blank lines), GetTestDataRoot(), DiscoverTestCases()
- CliTests.cs: System.CommandLine tests verifying migrate and convert subcommands accept
  correct options (--input, --output, --dry-run, --verbose, --overwrite, --use-ai) and
  that analyze command is NOT publicly exposed
- 7 TransformUnit test stubs with 2-4 focused tests each:
  AspPrefix, Expression, PageDirective, AttributeStrip, FormWrapper,
  ContentWrapper, UrlReference
- Usings.cs: global using Xunit
- Added test project + CLI project to BlazorMeetsWebForms.sln

Build: PASS (0 errors, 0 warnings)
Tests: 72/72 PASS (21 markup, 8 code-behind, 3 data integrity, 13 CLI parsing,
       27 transform unit stubs)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update rogue history with CLI test project learnings

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat(cli): Pipeline infrastructure + 16 markup transforms (TC01-TC12 passing)

Replace single-command AscxToRazorConverter with full pipeline architecture:
- MigrationPipeline orchestrates IMarkupTransform + ICodeBehindTransform chains
- MigrationContext, FileMetadata, TransformResult, MigrationReport data types
- SourceScanner discovers .aspx/.ascx/.master files and pairs with code-behind
- DI wiring via Microsoft.Extensions.DependencyInjection

16 markup transforms ported from bwfc-migrate.ps1 (matching regex patterns):
  Directives: Page, Master, Control, Import, Register
  Markup: ContentWrapper, FormWrapper, Expression, AjaxToolkitPrefix, AspPrefix,
          AttributeStrip, EventWiring, UrlReference, TemplatePlaceholder,
          AttributeNormalize, DataSourceId

CLI now has two subcommands (per architecture doc):
  webforms-to-blazor migrate --input <path> --output <path> [options]
  webforms-to-blazor convert --input <file> --output <path> [options]

PackageId changed from WebformsToBlazor.Cli to Fritz.WebFormsToBlazor.
AscxToRazorConverter.cs deleted (replaced by pipeline + transforms).

All 12 test cases (TC01-TC12) produce exact expected output.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: update Bishop history with global tool pipeline learnings

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat(cli): Port code-behind transforms TC13-TC21 to C#

Implement 11 ICodeBehindTransform classes in Transforms/CodeBehind/:
- TodoHeaderTransform: migration guidance header injection
- UsingStripTransform: strip System.Web.*, Microsoft.AspNet.*, Owin usings
- BaseClassStripTransform: remove Web Forms base class inheritance
- ResponseRedirectTransform: Response.Redirect  NavigationManager.NavigateTo
- SessionDetectTransform: detect Session[key] with guidance block
- ViewStateDetectTransform: detect ViewState[key] with field suggestions
- IsPostBackTransform: unwrap simple guards, TODO complex ones
- PageLifecycleTransform: Page_Load/Init/PreRender → Blazor lifecycle
- EventHandlerSignatureTransform: strip sender/EventArgs params
- DataBindTransform: cross-file DataSource/DataBind handling
- UrlCleanupTransform: .aspx URL literals  clean routes

Wire into MigrationPipeline with TransformCodeBehind() method.
Register all transforms in Program.cs DI container.
Activate real pipeline in L1TransformTests (replaced placeholder stubs).
Fix TC20/TC21 expected markup: EventWiringTransform adds @ prefix.

All 72 tests pass (21 markup + 8 code-behind + 43 unit/infra).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs(ai-team): Global tool port orchestration and decision merge

Session: 2026-03-31T02-11-39Z-global-tool-port
Requested by: Scribe

Changes:
- Logged Bishop Phase 1 (pipeline + 16 markup transforms TC01-TC12)
- Logged Rogue QA (L1 test harness + xUnit test project)
- Logged Bishop Phase 2 (11 code-behind transforms TC13-TC21)
- Merged 4 inbox decisions: bishop-phase2-transforms, colossus-l1-integration-tests, colossus-playwright-phase2, cyclops-session-shim
- Deleted inbox files after merge
- Identified 7 existing duplicate headings in decisions.md (pre-existing, not caused by this merge)

Test Status: 72/72 passing, 100% accuracy on new transforms

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat(cli): add scaffolding, config transforms, and full pipeline wiring

Add ProjectScaffolder, GlobalUsingsGenerator, ShimGenerator for project
scaffold generation (.csproj, Program.cs, _Imports.razor, App.razor,
Routes.razor, launchSettings.json, GlobalUsings.cs, shims).

Add WebConfigTransformer to parse web.config and generate appsettings.json
with appSettings key/values, connectionStrings, and standard Blazor sections.

Add DatabaseProviderDetector with 3-pass provider detection: explicit
providerName, connection string pattern matching, EntityClient inner provider.

Add OutputWriter with dry-run support, UTF-8 no BOM, directory creation,
and file tracking for reports.

Enhance MigrationReport with JSON serialization, console summary output,
and report file writing for --report flag.

Wire full pipeline in MigrationPipeline.ExecuteAsync:
1. Scaffold project (if not --skip-scaffold)
2. Transform config (web.config -> appsettings.json)
3. For each source file: markup + code-behind transforms -> write output
4. Generate report

Update Program.cs DI to register all new services. Add backward-compatible
2-param constructor on MigrationPipeline for existing tests.

All ported from bwfc-migrate.ps1: New-ProjectScaffold, New-AppRazorScaffold,
Convert-WebConfigToAppSettings, Find-DatabaseProvider.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: update Bishop history with Phase 4 learnings

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add scaffolding, config transform, and pipeline integration tests (54 new)

New test files:
- ScaffoldingTests.cs: 24 tests for ProjectScaffolder, GlobalUsingsGenerator,
  and ShimGenerator output verification (csproj, Program.cs, _Imports.razor,
  App.razor, identity detection, shim conditional generation)
- ConfigTransformTests.cs: 14 tests for WebConfigTransformer (JSON structure,
  appSettings/connectionStrings preservation, empty/invalid XML edge cases,
  built-in connection string filtering)
- PipelineIntegrationTests.cs: 16 E2E tests using full MigrationPipeline with
  all dependencies wired (scaffold + config + transforms, dry-run, code-behind,
  identity shims, source scanner, database provider detection, report serialization)

Updated TestHelpers.cs with CreateTempProjectDir() and CleanupTempDir() helpers.

All 126 tests pass (72 existing + 54 new), 0 failures, 0 skipped.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update Rogue history with scaffolding/pipeline test learnings

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* refactor: remove --use-ai flag  Copilot orchestrates L2 transforms

The CLI tool is a pure L1 deterministic engine. Copilot calls the tool
via skill-chaining and applies L2 contextual transforms using the
migration report output. This eliminates AI dependencies, API keys,
and network calls from the compiled binary.

Removed:
- --use-ai option from migrate and convert commands
- AiAssistant.cs service
- UseAi property from MigrationOptions
- AI Integration Hook section replaced with Copilot Orchestration Model

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat: add Server.MapPath, ResolveUrl, and CacheShim to WebFormsPageBase

- ServerShim: MapPath(), HtmlEncode/Decode, UrlEncode/Decode
- CacheShim: dictionary-style Cache["key"] backed by IMemoryCache
- ResolveUrl/ResolveClientUrl: ~/path -> /path with .aspx stripping
- Exposed as Page.Server, Page.Cache, Page.ResolveUrl() properties
- Full test coverage for both shims

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat: rewrite bwfc-migration skill for CLI-driven orchestration

The migration skill now orchestrates L1 via the webforms-to-blazor CLI
tool instead of the PowerShell script. L2 transforms are organized by
TODO category matching the tool's structured output. Updated
CODE-TRANSFORMS.md to reference CLI tool.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: register IWebHostEnvironment, CacheShim, ServerShim in test DI

Adding Server/Cache shims to WebFormsPageBase introduced two new
[Inject] properties that all bUnit tests rendering page-derived
components must resolve. Updated BlazorWebFormsTestContext and 8
individual test files to register mock IWebHostEnvironment,
AddMemoryCache(), and the new shim services.

2,753 tests passing, 0 failures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: add ServerShim, CacheShim, RequestShim utility feature docs

Three new MkDocs documentation pages covering the latest migration
shims: Server.MapPath/ResolveUrl, Cache["key"] backed by IMemoryCache,
and Request.QueryString/Cookies/Url with graceful degradation.
Updated mkdocs.yml navigation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat: add 5 migration sample pages with Playwright acceptance tests

- ServerMapPath.razor: MapPath, HtmlEncode, UrlEncode, ResolveUrl demos
- CacheDemo.razor: Cache["key"] set/get, typed access, removal, expiration
- RequestDemo.razor: QueryString, Url, Cookies with SSR guard
- ResponseRedirectDemo.razor: Redirect, tilde/aspx stripping, ResolveUrl
- IsPostBackDemo.razor: IsPostBack status, guard pattern, HttpContext check
- 5 Playwright test files with data-audit-control targeting
- Updated ComponentCatalog.cs with all 5 new entries

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat: expand UrlReferenceTransform to cover 5 additional URL attributes

Add src, BackImageUrl, PostBackUrl, DataNavigateUrlFormatString, and
HelpPageUrl to the tilde-to-root URL replacement list. Update tests to
actually invoke the transform and add coverage for every new attribute.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat: add LoginViewTransform (Phase 2B, Gap G2)

Convert asp:LoginView to Blazor AuthorizeView:
- <asp:LoginView>  <AuthorizeView>
- <AnonymousTemplate>  <NotAuthorized>
- <LoggedInTemplate>  <Authorized>
- <RoleGroups>  TODO(bwfc-identity) comment
- Strips runat and ID attributes
- Order 510 per architecture spec

Includes 9 unit tests and TC22 L1 test case.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat: add SelectMethodTransform (Phase 2D, Gap G3)

Detects SelectMethod, InsertMethod, UpdateMethod, and DeleteMethod
attributes on data-bound controls. Preserves attributes as-is and
appends a TODO comment for delegate conversion to code-behind.

- Order 520: runs after Expression/LoginView, before AjaxToolkitPrefix
- Registered in Program.cs markup transform pipeline
- 10 unit tests covering all method types, multi-attribute, and no-op

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat(cli): DataSource hybrid scaffolding  Items binding + compilable properties

DataSourceIdTransform now replaces DataSourceID attributes with Items
binding (Items="@xdata") instead of silently removing them, and injects
compilable data property scaffolding so migrated files compile immediately.

- DataSourceID="X"  Items="@xdata" on bound controls
- Data source declarations get ID-specific TODO comments naming the
  service interface to implement (e.g. ISqlDS1DataService)
- When no code-behind exists, appends @code block with typed property
- When code-behind exists, injects property before closing brace
- Updated TC12 expected output to match new behavior
- Added 15 unit tests in DataSourceIdTransformTests (186 total)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat(cli): auto-wire SessionShim and CacheShim via [Inject] in SessionDetectTransform

SessionDetectTransform now injects [Inject] private SessionShim Session { get; set; }
when Session["key"] patterns are detected, and [Inject] private CacheShim Cache
when Cache["key"] patterns are detected. This makes Session/Cache calls compile
against the shim's indexer without manual wiring.

- Added CacheAccessRegex and CacheKeyRegex for Cache[] detection
- Added ClassOpenRegex for injecting properties after class declaration
- Idempotent: skips duplicate [Inject] or guidance blocks on re-runs
- Updated guidance comment to note auto-wiring
- Updated ShimGenerator to document available shims
- Updated TC14 expected output for new inject behavior
- Added 15 new unit tests for injection, idempotency, and edge cases

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat(cli): extract else-branch from IsPostBack guards into HandlePostBack()

- Enhanced IsPostBackTransform to handle if (!IsPostBack) { } else { } pattern
- Else body extracted into private void HandlePostBack() method
- HandlePostBack includes TODO comment for wiring to Blazor event handlers
- else-if patterns produce TODO with non-matching guard replacement
- Single-line else statements also extracted correctly
- Added 7 unit tests covering all scenarios (simple, else, else-if, single-line)
- Existing TC16 regression test continues to pass
- Build and all 208 tests pass

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* test: add unit tests for 9 untested CLI transforms

Add dedicated unit tests for AjaxToolkitPrefixTransform,
AttributeNormalizeTransform, EventWiringTransform,
TemplatePlaceholderTransform, BaseClassStripTransform,
DataBindTransform, TodoHeaderTransform, UsingStripTransform,
and ViewStateDetectTransform. 105 new tests covering happy paths,
no-ops, edge cases, and variant handling. Total: 313 (was 208).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add 6 new L1 test cases (TC24-TC29) and register 3 missing transforms in test pipeline

New test cases:
- TC24-LoginView: LoginViewTransform (AuthorizeView conversion with templates and RoleGroups)
- TC25-SelectMethod: SelectMethodTransform (SelectMethod/InsertMethod/UpdateMethod/DeleteMethod)
- TC26-GetRouteUrl: GetRouteUrlTransform (Page.GetRouteUrl  GetRouteUrl)
- TC27-IsPostBackElse: IsPostBack else-branch extraction into HandlePostBack()
- TC28-AjaxToolkit: AjaxToolkitPrefixTransform (known/unknown controls, ToolkitScriptManager removal)
- TC29-Combined: Multi-transform integration (8+ markup + 7+ code-behind transforms)

Pipeline fixes:
- Added LoginViewTransform and SelectMethodTransform to test markup pipeline
- Added GetRouteUrlTransform to test code-behind pipeline
- Updated count assertions: 28 markup TCs (was 22), 11 code-behind TCs (was 8)

All 322 tests pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add TC28-TC32 migration showcase test cases

Create 5 comprehensive end-to-end migration showcase files that exercise
multiple CLI transforms together, serving as both documentation and
acceptance test inputs:

- TC28-MasterPageLayout: Realistic master page with nav, LoginView,
  ContentPlaceHolder, CSS links, expressions, and URL conversion
- TC29-AuthenticatedPage: Auth-gated UI with LoginView templates
  (Anonymous, LoggedIn, RoleGroups), HyperLinks, and event handlers
- TC30-DataDrivenPage: Full data pipeline with SqlDataSource, GridView
  DataSourceID binding, Repeater with SelectMethod, data expressions
- TC31-ComplexCodeBehind: Code-behind showcasing IsPostBack with else
  branch, Session/ViewState detection, Response.Redirect, Page.GetRouteUrl,
  lifecycle conversion, and event handler signature transforms
- TC32-AjaxToolkitPage: AJAX Toolkit controls (TabContainer, Accordion,
  ModalPopupExtender, ConfirmButtonExtender) plus unknown control TODO

Each sample includes realistic content (university site, product catalog,
admin dashboard, customer management) and input+expected pairs in both
migration-toolkit/tests/ and CLI TestData/ directories. Updated test
count assertions from 2833 markup and 1112 code-behind cases.

All 328 CLI tests pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs(squad): Phase 5 completion  orchestration logs, session log, decision merge, agent history

Session: 2026-04-02T17-11-01Z-global-tool-port-phase5
Requested by: Jeffrey T. Fritz

Changes:
- Orchestration logs for Beast (docs), Rogue (unit tests), Colossus (L1 tests), Jubilee (samples)
- Session log: Phase 5 completion summary (docs + test backfill + acceptance tests + migration showcases)
- Merged 3 decisions from inbox: TODO convention standardization, ManualItem report schema, ConfigurationManagerShim
- Deleted inbox files after merging (cyclops-config-shim.md, cyclops-report-schema.md, cyclops-todo-convention.md)
- Appended team updates to beast, rogue, colossus, jubilee agent history.md files
- Total metrics: 31 transforms, 328 tests (0 failures), 4 doc files, 11 new L1 test cases, 5 migration showcases

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat(cli): MasterPageTransform, GetRouteUrlTransform, ManualItem, docs/cli, TC12-TC23 test data

- Add MasterPageTransform: converts .master files to Blazor LayoutComponentBase .razor
- Add GetRouteUrlTransform: rewrites GetRouteUrl() calls to NavigationManager.GetUriWithQueryParameters()
- Add ManualItem: structured model for pipeline manual-review items in MigrationReport
- Update MigrationPipeline: wire new transforms, expose TransformCodeBehind for tests
- Update MigrationReport: ManualItem integration, JSON serialization, console summary improvements
- Update Program.cs: register GetRouteUrlTransform, MasterPageTransform, ManualItem in DI
- Update ProjectScaffolder: align scaffold output with full pipeline integration
- Update PageLifecycleTransform, ResponseRedirectTransform, TodoHeaderTransform, AjaxToolkitPrefixTransform: bug fixes and accuracy improvements
- Update test data TC12-TC21: sync expected files with updated transform output
- Add TC23 (MasterPage) test case: input .master + expected .razor for both L1 script and CLI tests
- Add GetRouteUrlTransformTests, MasterPageTransformTests: unit coverage for new transforms
- Update PipelineIntegrationTests: activate real assertions for TC13-TC23
- Add docs/cli/: index, transforms, report, and TODO-conventions reference pages
- Add dev-docs/cli-gap-analysis.md: gap tracking between PS script and C# CLI
- Update mkdocs.yml, README.md: add CLI docs navigation and feature summary

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs(squad): session log, orchestration logs, agent history 2026-04-03T15-25-00Z

Session: 2026-04-03T15-25-00Z-commit-and-writeup
Requested by: Jeffrey T. Fritz

Changes:
- Added orchestration-log/2026-04-03T15-25-00Z-bishop.md (41-file commit: MasterPageTransform, GetRouteUrlTransform, ManualItem, TC12-TC23, docs/cli)
- Added orchestration-log/2026-04-03T15-25-00Z-beast.md (CLI capability writeup delivered in chat)
- Added log/2026-04-03T15-25-00Z-commit-and-writeup.md (session record)
- Decisions inbox was empty  no merge needed
- Appended MasterPageTransform+GetRouteUrlTransform+ManualItem+TC12-TC23 learnings to bishop/history.md
- Appended CLI capability writeup learnings to beast/history.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat(analyzers): enhance BWFC022/023 with pattern-specific guidance, add BWFC024 ScriptManager analyzer

BWFC022 (PageClientScriptUsageAnalyzer):
- Method-specific diagnostic messages for RegisterStartupScript, RegisterClientScriptInclude,
  RegisterClientScriptBlock, and GetPostBackEventReference
- Fallback guidance for generic Page.ClientScript access
- Updated tests verify exact messages for each pattern

BWFC023 (IPostBackEventHandlerUsageAnalyzer):
- Enhanced message with specific migration steps: remove interface,
  replace RaisePostBackEvent with EventCallback<T>, use @OnClick handlers

BWFC024 (ScriptManagerUsageAnalyzer)  NEW:
- Detects ScriptManager.GetCurrent(), SetFocus(), RegisterStartupScript(),
  RegisterClientScriptBlock(), RegisterAsyncPostBackControl() static calls
- Method-specific guidance for each pattern
- 10 new tests (positive + negative cases)

All 172 analyzer tests pass. Phase 1 of ClientScript Migration Strategy.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: update Cyclops history and decisions for ClientScript analyzer work

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore(squad): merge ClientScript Phase 1 + Shim session decisions and logs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat: ClientScript Phase 1  analyzers, CLI transform, docs, tests, demos

- Enhanced BWFC022/023 analyzers with method-specific guidance
- Created BWFC024 ScriptManagerUsageAnalyzer
- Added ClientScriptTransform (Order 850) with 6 patterns
- Created ClientScript migration guide (34KB)
- Added 3 analyzer reference pages
- Added ClientScript demo page with 5 interactive sections
- 44 new tests (25 analyzer + 19 CLI transform)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* feat: ClientScriptShim zero-rewrite runtime + Strangler Fig migration docs

- Created ClientScriptShim with queue-and-flush semantics
- Registered in DI alongside SessionShim, CacheShim, ServerShim
- Added ClientScript property to BaseWebFormsComponent with auto-flush
- 29 unit tests for the shim
- Created Strangler Fig Pattern migration guide with Mermaid diagram
- Updated Strategies.md and ClientScriptMigrationGuide.md with strangler fig framing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore: remove Squad CI/CD workflow files

These are Squad orchestration workflows that should not be in the project repo.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* refactor: switch ClientScriptTransform to shim-preserving mode

The CLI transform now preserves ClientScript API calls instead of rewriting
them to IJSRuntime skeletons, because the ClientScriptShim handles them at
runtime.

Changes:
- Strip Page./this. prefix from RegisterStartupScript, RegisterClientScriptInclude,
  RegisterClientScriptBlock calls (shim-compatible)
- Convert ScriptManager.RegisterStartupScript to ClientScript.RegisterStartupScript
  (drop control param)
- RegisterClientScriptBlock now preserved (shim supports it)
- Remove IJSRuntime [Inject] injection; add ClientScriptShim dependency comment
- GetPostBackEventReference and ScriptManager.GetCurrent still emit TODO markers
- Update 20 unit test assertions and TC33 expected output

All 349 CLI tests pass (same count, zero regressions).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: integration test failures  shim URL fallback + assertion updates

- RequestShim: always use NavigationManager for Url and QueryString
  (HttpContext in Blazor Server interactive mode shows /_blazor URL)
- ResponseShim: use forceLoad: true for Redirect (matches Web Forms
  HTTP redirect semantics, reliable for Playwright detection)
- IsPostBackTests: fix assertion to match page text '1 time(s)'

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: increase redirect test timeout for CI full-page navigation

forceLoad: true triggers full HTTP + prerender + SignalR re-establish cycle
which needs >10s in CI. Bumped to 30s with WaitUntil.Load and added
explicit button-ready wait.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

Suggestion: dotnet global tool to convert ascx to razor

2 participants