You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These are hard rules for migration work in this repository:
312
+
313
+
1.**Use the toolkit entry point**: Start project migrations with `migration-toolkit/scripts/bwfc-migrate.ps1` or the `webforms-to-blazor migrate` CLI it forwards to. Do not invent ad hoc regex converters or one-off migration scripts.
314
+
2.**Always target Blazor static SSR**: Generated apps target .NET 10 static server-side rendering. Do not switch the whole app to interactive Blazor Server; only opt into interactive render modes deliberately and per page.
315
+
3.**Trust the shims**: `WebFormsPageBase` preserves `Page.Request`, `Page.Response`, `Page.Session`, `Page.Server`, `Page.Cache`, `Page.ClientScript`, `IsPostBack`, and `ViewState`. Keep migrated code-behind compiling against those shims instead of rewriting to native ASP.NET Core services during Layer 1 or Layer 2 work.
316
+
4.**Preserve BWFC data controls**: Never replace `ListView`, `FormView`, `GridView`, `DataList`, or `Repeater` with manual HTML tables or divs. Fix the generated BWFC markup, templates, item types, or child components instead.
317
+
5.**Register transforms twice**: Every new CLI transform must be registered in both `src/BlazorWebFormsComponents.Cli/Program.cs` DI and `tests/BlazorWebFormsComponents.Cli.Tests/TestHelpers.cs` so the runtime pipeline and isolated test pipeline stay aligned.
318
+
6.**Respect quarantine boundaries**: `PageQuarantineDetector` should quarantine non-essential `Account/`, `Admin/`, `Checkout/`, mobile, payment, or compile-surface blocker pages, but benchmark-critical home, about, contact, product, catalog, and cart flows stay on the runnable path whenever possible.
319
+
320
+
### Migration Benchmark Progression
321
+
322
+
The `samples/` folder contains benchmark apps ordered by increasing complexity. Each app exercises more of the CLI and BWFC component surface:
323
+
324
+
| Sample | Complexity | Key Challenges | Status |
325
+
|--------|-----------|----------------|--------|
326
+
|**WingtipToys**| ★★☆ | E-commerce: products, cart, checkout, identity, EF data binding |**Current focus** — active benchmark runs |
327
+
|**ContosoUniversity**| ★★☆ | University CRUD: master-detail, search, EF migrations | Acceptance tests exist |
328
+
|**DepartmentPortal**| ★★★ | Multi-page portal: advanced data binding, nested controls, complex layouts | Future target — most sophisticated |
329
+
330
+
Always complete the current benchmark focus before moving to the next. Improvements to the CLI and toolkit should be validated against the current focus app first, then regression-tested against simpler samples.
331
+
291
332
## Migration Shims
292
333
293
334
The library provides compile-compatibility shims on `WebFormsPageBase` so migrated code-behind compiles unchanged:
@@ -314,6 +355,81 @@ When adding new components:
314
355
4. Add sample page in `/samples/AfterBlazorServerSide/Pages/ControlSamples/`
315
356
5. Document in `/docs/` folder (see Documentation Requirements below)
316
357
358
+
## Migration CLI & Toolkit
359
+
360
+
### Primary Entry Points
361
+
362
+
-`src/BlazorWebFormsComponents.Cli/Program.cs` defines the `webforms-to-blazor` CLI entry point and command surface (`migrate`, `convert`, `prescan`, `scan`, `assets extract`, `edmx convert`).
363
+
-`migration-toolkit/scripts/bwfc-migrate.ps1` is the supported migration-toolkit wrapper. It resolves the CLI project and forwards to `migrate` or `prescan` instead of maintaining a separate regex pipeline.
364
+
- The migration-toolkit skill set currently includes `bwfc-migration`, `bwfc-identity-migration`, `bwfc-data-migration`, `migration-standards`, and `l3-performance-optimization`.
365
+
366
+
### Pipeline Overview
367
+
368
+
`MigrationPipeline` orchestrates the full migration sequence:
369
+
370
+
1.`ProjectScaffolder` generates the .NET 10 Blazor static SSR scaffold unless `--skip-scaffold` is used.
371
+
2.`WebConfigTransformer` converts `Web.config` settings into `appsettings.json`.
6.`PageQuarantineDetector` performs a late compile-surface pass and writes `migration-artifacts/quarantine-manifest.json` when pages must be stubbed.
376
+
7. Static assets, source files, App_Start artifacts, NuGet assets, EDMX output, and redirect annotations are copied or generated.
377
+
378
+
The CLI currently has **24 core markup transforms plus directive/infrastructure markup passes** and **27 code-behind transforms** wired through `Program.cs`.
379
+
380
+
### Transform Registration Pattern
381
+
382
+
When adding a transform:
383
+
384
+
1. Create the transform class in `src/BlazorWebFormsComponents.Cli/Transforms/`.
385
+
2. Register it in `BuildServiceProvider()` in `src/BlazorWebFormsComponents.Cli/Program.cs`.
386
+
3. Add it to `CreateDefaultPipeline()` in `tests/BlazorWebFormsComponents.Cli.Tests/TestHelpers.cs`.
387
+
4. Add or update focused transform tests and pipeline coverage.
-`RuntimeDetector` aggregates runtime signal detectors for Entity Framework, session, identity, and `Global.asax` usage.
403
+
-`ProjectScaffolder` generates the project file, `_Imports.razor`, `Components/App.razor`, `Components/Routes.razor`, `Components/Layout/MainLayout.razor`, and launch settings.
404
+
-`ProgramCsEmitter` generates `Program.cs` for .NET 10 static SSR, including `AddRazorComponents()`, `AddBlazorWebFormsComponents()`, `UseStaticFiles()`, and `UseAntiforgery()`.
405
+
-`DatabaseProviderDetector` and `WebConfigTransformer` carry forward database provider and connection-string wiring.
406
+
407
+
### Quarantine System
408
+
409
+
-`PageQuarantineDetector` creates build-safe placeholder pages for compile-surface blockers and emits a manifest under `migration-artifacts/quarantine-manifest.json`.
410
+
- Essential benchmark pages (home, about, contact, product, catalog, shopping cart, add-to-cart flows) are exempt from incidental quarantine signals.
411
+
- Quarantined pages keep stub `.razor` and `.razor.cs` files plus the transformed original code-behind as an artifact for later Layer 2 or Layer 3 repair.
412
+
413
+
### Acceptance Test Suites
414
+
415
+
Use these suites as the migration quality gate for benchmark apps:
416
+
417
+
```bash
418
+
# WingtipToys migrated app
419
+
# Set WINGTIPTOYS_BASE_URL first if the app is not on https://localhost:5001
@@ -544,7 +683,9 @@ When making changes, ensure all related files are updated:
544
683
|**Existing component modified**| Unit tests in `src/BlazorWebFormsComponents.Test/ComponentName/`, sample page if behavior changed, `docs/Category/ComponentName.md` if API changed |
545
684
|**New migration shim added**| Shim class in `src/BlazorWebFormsComponents/`, register in `ServiceCollectionExtensions.cs` via `AddBlazorWebFormsComponents()`, update `docs/Migration/` guide, update `copilot-instructions.md` Migration Shims section |
546
685
|**Base class changed** (`BaseWebFormsComponent`, `BaseStyledComponent`, `DataBoundComponent`) | Check all components inheriting from it — changes cascade to every component. Run full test suite. |
547
-
|**CLI transform added**| Transform in `src/BlazorWebFormsComponents.Cli/`, test in `tests/BlazorWebFormsComponents.Cli.Tests/`, update `docs/cli/transforms.md`, update `docs/cli/index.md` transform count |
686
+
|**CLI transform added**| Transform in `src/BlazorWebFormsComponents.Cli/Transforms/`, register it in `src/BlazorWebFormsComponents.Cli/Program.cs` and `tests/BlazorWebFormsComponents.Cli.Tests/TestHelpers.cs`, add or update transform tests, update `docs/cli/transforms.md`, update `docs/cli/index.md` transform count |
687
+
|**CLI scaffolding/runtime changed**| Files in `src/BlazorWebFormsComponents.Cli/Scaffolding/` or `Pipeline/`, matching tests in `tests/BlazorWebFormsComponents.Cli.Tests/`, `migration-toolkit/README.md` or methodology docs if operator workflow changes, and `.github/copilot-instructions.md` if migration guidance changes |
688
+
|**Migration toolkit wrapper or skill changed**| Matching files in `migration-toolkit/scripts/` or `migration-toolkit/skills/`, relevant `docs/Migration/` or `docs/cli/` pages, and `.github/copilot-instructions.md` when the recommended migration workflow changes |
548
689
|**Analyzer rule added**| Rule in `src/BlazorWebFormsComponents.Analyzers/`, test in `src/BlazorWebFormsComponents.Analyzers.Test/`, update `docs/Analyzers/`|
Copy file name to clipboardExpand all lines: .github/skills/wingtip-migration-test/SKILL.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,6 +128,7 @@ Focus on:
128
128
129
129
- Keeping the generated project shape in `samples\AfterWingtipToys\`
130
130
- Preserving Web Forms semantics through BWFC shims where available
131
+
-**NEVER replace generated BWFC data controls (`ListView`, `FormView`, `GridView`, `DataList`, `Repeater`) with manual HTML. Fix the generated markup to work with the BWFC component instead.**
131
132
- Fixing build errors iteratively until the app runs cleanly enough for acceptance validation
132
133
- Treating the migration toolkit as the thing under test; manual fixes should be documented as toolkit gaps
0 commit comments