Skip to content

Scaffolding for Syncfusion Blazor Toolkit included. - #3863

Merged
haileymck merged 83 commits into
dotnet:mainfrom
Indhumathy-Loganathan:main
Oct 29, 2026
Merged

haileymck merged 83 commits into
dotnet:mainfrom
Indhumathy-Loganathan:main

Conversation

@Indhumathy-Loganathan

@Indhumathy-Loganathan Indhumathy-Loganathan commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR adds a minimal Syncfusion Blazor Toolkit setup scaffolder for existing Blazor applications.

The scaffolder installs the Syncfusion.Blazor.Toolkit package (latest, including 2.0.0+), registers AddSyncfusionBlazorToolkit() in Program.cs, and adds @using Syncfusion.Blazor.Toolkit to the project’s _Imports.razor. It does not generate pages or sample UI, and does not inject a host stylesheet — styles ship with the 2.0.0+ assembly and are activated through DI.

It supports Blazor Web App and standalone Blazor WebAssembly layouts, discovers _Imports.razor under Components or at the project root, and detects multi-project Auto layouts (.Client sibling) so the summary can guide users to run the scaffolder on both server (services) and client (imports) projects.

Key Changes

1. Command registration & package metadata

  • AspNetCommandService.cs — Registered syncfusion-blazor-toolkit scaffolder (validate → add packages → code change → summarize); added ValidateSyncfusionBlazorToolkitStep and SummarizeSyncfusionBlazorToolkitStep.
  • AspnetStrings.cs — Command name, display name, description, example, and Syncfusion category; documents setup-only scope, 2.0.0+ no-stylesheet behavior, and Auto multi-project guidance.
  • PackageConstants.cs — Added SyncfusionBlazorToolkitPackage (UseLatestVersion = true).
  • NuGet.config — Added nuget.org source for package resolution.

2. Scaffold pipeline (extensions, helpers, steps)

  • SyncfusionBlazorToolkitScaffolderBuilderExtensions.cs (new) — Package install step; code-modification step; multi-project layout detection (SingleProject / AutoServer / AutoClient).
  • SyncfusionBlazorToolkitHelper.cs (new) — Resolves Program.cs-only code-mod config; idempotent on-disk EnsureServiceRegistration() and EnsureImportsUsing().
  • SyncfusionBlazorToolkitSettings.cs (new) — Settings + SyncfusionBlazorToolkitLayout enum.
  • ValidateSyncfusionBlazorToolkitStep.cs (new) — Project validation, _Imports.razor discovery, package/service state.
  • SummarizeSyncfusionBlazorToolkitStep.cs (new) — Outcome summary and multi-project guidance.

3. Code-modification configs

  • syncfusionBlazorToolkitChanges.json under Templates/net8.0|net9.0|net10.0|net11.0/CodeModificationConfigs/ — Program.cs only: insert AddSyncfusionBlazorToolkit() and using Syncfusion.Blazor.Toolkit (no stylesheet entries).

4. Tests

  • Unit: SyncfusionBlazorToolkitHelperTests, HelperDiagnosticTests, TfmConfigTests, SettingsTests, Validate*StepTests, Summarize*StepTests.
  • Integration: base + Net8/Net9/Net10/Net11 under Integration/Syncfusion/.

Usage

Create a Blazor app and apply the Syncfusion Toolkit scaffold:

dotnet new blazor -n MyBlazorApp
cd MyBlazorApp
dotnet scaffold aspnet blazor-syncfusion-toolkit --project ./MyBlazorApp.csproj

Output

image image image

Validation

  • Build the Scaffolding solution successfully.
  • Run dotnet scaffold aspnet syncfusion-blazor-toolkit --project <path> on Blazor Web App projects.
  • Run the same command on standalone Blazor WebAssembly projects.
  • Verify Syncfusion.Blazor.Toolkit package reference is added (latest / prerelease when requested).
  • Verify AddSyncfusionBlazorToolkit() is registered in Program.cs.
  • Verify a single @using Syncfusion.Blazor.Toolkit is added to _Imports.razor (Components or root).
  • Verify no external stylesheet <link> is injected (2.0.0+ behavior).
  • Verify no pages or sample UI are generated.
  • Verify multi-project Auto layout detection and summary guidance (server vs .Client).
  • Verify idempotent behavior when package/services/usings already exist.
  • Verify graceful handling when _Imports.razor is missing.
  • Verify applications build successfully after scaffolding.
  • Verify existing scaffolding scenarios are unaffected.
  • Verify coverage across .NET 8, .NET 9, .NET 10, and .NET 11 templates.

@Indhumathy-Loganathan
Indhumathy-Loganathan marked this pull request as draft September 24, 2026 08:15
@danroth27

Copy link
Copy Markdown
Member

Thanks for the contribution! I’d like to clarify the intended scope of this scaffolder. Its purpose should be to minimally set up the free Syncfusion Blazor Toolkit in an existing Blazor app—for example, adding the package and the required service registration, imports, and stylesheet. It should not generate substantial sample content or an application-specific experience.

The Healthcare Tracker page, dashboard UI, and associated templates are well beyond that scope. Could you revise the PR to focus on Toolkit setup and remove the Healthcare Tracker sample? The command name and description should also reflect that setup purpose.

@Indhumathy-Loganathan

Copy link
Copy Markdown
Contributor Author

Thanks for the contribution! I’d like to clarify the intended scope of this scaffolder. Its purpose should be to minimally set up the free Syncfusion Blazor Toolkit in an existing Blazor app—for example, adding the package and the required service registration, imports, and stylesheet. It should not generate substantial sample content or an application-specific experience.

The Healthcare Tracker page, dashboard UI, and associated templates are well beyond that scope. Could you revise the PR to focus on Toolkit setup and remove the Healthcare Tracker sample? The command name and description should also reflect that setup purpose.

Hi @danroth27,

The PR has been updated to align with the intended scope of the scaffolder. The Healthcare Tracker sample, dashboard UI, and related templates have been removed. The scaffolder now focuses solely on the minimal setup required for integrating Syncfusion Blazor Toolkit into an existing Blazor application, including package installation, service registration and required imports.

Bold Create Agent and others added 5 commits October 14, 2026 11:25
…ve dead recipe code and stale comments

Co-authored-by: Indhumathy-Loganathan <[email protected]>
…lding/dotnet-scaffold/dotnet-scaffold.csproj

Co-authored-by: Indhumathy-Loganathan <[email protected]>
…0-s-practical-way-address-four-review

Address Syncfusion Blazor Toolkit scaffolder review: classification, hosting facts, summary, MSBuild, baselines
…s; drop explanatory comments in PackageConstants

Co-authored-by: Indhumathy-Loganathan <[email protected]>
…0-s-practical-way-address-four-review

Make relative-project-path test portable to macOS symlinked temp paths; drop explanatory comments in PackageConstants

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.

🟡 Changes recommended

Project classification rejects valid Blazor hosts, and package and hosting summaries can report incorrect outcomes.

4 open issues
What changed in this PR

Adds setup-only Syncfusion Blazor Toolkit scaffolding to the existing Blazor command pipeline, without generating pages or adding stylesheet links.

Changes:

  • Registers package, service, and imports setup for supported Blazor projects and referenced WebAssembly clients.
  • Adds project classification, hosting inspection, verification, and outcome summaries.
  • Adds focused tests and runnable .NET 10/11 baselines with fixture-scoped package feeds.
File Description
test/​dotnet-scaffolding/​dotnet-scaffold.Tests/​Helpers/​ScaffolderBaselineRunner.cs Allows fixture-specific NuGet configuration.
test/​dotnet-scaffolding/​dotnet-scaffold.Tests/​Helpers/​ScaffoldCliHelper.cs Adds scoped Syncfusion package feeds.
test/​dotnet-scaffolding/​dotnet-scaffold.Tests/​AspNet/​ScaffoldSteps/​Syncfusion/​SyncfusionBlazorToolkitSettingsTests.cs Tests settings and change tracking.
test/​dotnet-scaffolding/​dotnet-scaffold.Tests/​AspNet/​ScaffoldSteps/​Syncfusion/​SummarizeSyncfusionBlazorToolkitStepTests.cs Tests summaries and hosting guidance.
test/​dotnet-scaffolding/​dotnet-scaffold.Tests/​AspNet/​Integration/​Syncfusion/​SyncfusionBlazorToolkitRunnableBaselineTests.cs Checks runnable default output.
test/​dotnet-scaffolding/​dotnet-scaffold.Tests/​AspNet/​Integration/​Syncfusion/​SyncfusionBlazorToolkitNet9IntegrationTests.cs Covers .NET 9 setup layouts.
test/​dotnet-scaffolding/​dotnet-scaffold.Tests/​AspNet/​Integration/​Syncfusion/​SyncfusionBlazorToolkitNet8IntegrationTests.cs Covers .NET 8 setup and reruns.
test/​dotnet-scaffolding/​dotnet-scaffold.Tests/​AspNet/​Integration/​Syncfusion/​SyncfusionBlazorToolkitNet11IntegrationTests.cs Covers .NET 11 setup layouts.
test/​dotnet-scaffolding/​dotnet-scaffold.Tests/​AspNet/​Integration/​Syncfusion/​SyncfusionBlazorToolkitNet10IntegrationTests.cs Covers .NET 10 setup layouts.
test/​dotnet-scaffolding/​dotnet-scaffold.Tests/​AspNet/​Integration/​Syncfusion/​SyncfusionBlazorToolkitIntegrationTestsBase.cs Provides shared CLI fixtures and assertions.
test/​dotnet-scaffolding/​dotnet-scaffold.Tests/​AspNet/​Helpers/​Syncfusion/​BlazorProjectClassifierTests.cs Tests classification and hosting inspection.
test/​dotnet-scaffolding/​dotnet-scaffold.Tests/​AspNet/​Helpers/​BlazorWebAssemblyClientProjectResolverTests.cs Tests imported client references.
test/​dotnet-scaffolding/​baselines/​README.md Documents Toolkit baseline coverage.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​wwwroot/​lib/​bootstrap/​dist/​css/​bootstrap-reboot.rtl.min.css Preserves baseline Bootstrap RTL styles.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​wwwroot/​lib/​bootstrap/​dist/​css/​bootstrap-reboot.min.css Preserves baseline Bootstrap styles.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​wwwroot/​app.css Preserves baseline application styles.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​Properties/​launchSettings.json Supplies baseline launch profiles.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​Program.cs Records expected Toolkit registration.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​Components/​Routes.razor Preserves baseline routing.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​Components/​Pages/​Weather.razor Preserves the template weather page.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​Components/​Pages/​NotFound.razor Preserves the template not-found page.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​Components/​Pages/​Home.razor Preserves the template home page.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​Components/​Pages/​Error.razor Preserves the template error page.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​Components/​Pages/​Counter.razor Preserves the interactive counter page.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​Components/​Layout/​ReconnectModal.razor.js Preserves baseline reconnection behavior.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​Components/​Layout/​ReconnectModal.razor.css Preserves reconnection styles.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​Components/​Layout/​ReconnectModal.razor Preserves reconnection markup.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​Components/​Layout/​NavMenu.razor.js Preserves navigation toggle behavior.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​Components/​Layout/​NavMenu.razor.css Preserves navigation styles.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​Components/​Layout/​NavMenu.razor Preserves navigation markup.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​Components/​Layout/​MainLayout.razor.css Preserves application layout styles.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​Components/​Layout/​MainLayout.razor Preserves application layout markup.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​Components/​App.razor Preserves the host without Toolkit stylesheet links.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​Components/​_Imports.razor Records the expected Toolkit import.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​BlazorWebApp.csproj Records the expected Toolkit package.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​appsettings.json Supplies baseline application configuration.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net11.0/​BlazorWebApp/​appsettings.Development.json Supplies baseline development logging.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​wwwroot/​lib/​bootstrap/​dist/​css/​bootstrap-reboot.rtl.min.css Preserves baseline Bootstrap RTL styles.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​wwwroot/​lib/​bootstrap/​dist/​css/​bootstrap-reboot.min.css Preserves baseline Bootstrap styles.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​wwwroot/​app.css Preserves baseline application styles.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​Properties/​launchSettings.json Supplies baseline launch profiles.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​Program.cs Records expected Toolkit registration.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​Components/​Routes.razor Preserves baseline routing.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​Components/​Pages/​Weather.razor Preserves the template weather page.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​Components/​Pages/​NotFound.razor Preserves the template not-found page.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​Components/​Pages/​Home.razor Preserves the template home page.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​Components/​Pages/​Error.razor Preserves the template error page.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​Components/​Pages/​Counter.razor Preserves the interactive counter page.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​Components/​Layout/​ReconnectModal.razor.js Preserves baseline reconnection behavior.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​Components/​Layout/​ReconnectModal.razor.css Preserves reconnection styles.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​Components/​Layout/​ReconnectModal.razor Preserves reconnection markup.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​Components/​Layout/​NavMenu.razor.css Preserves navigation styles.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​Components/​Layout/​NavMenu.razor Preserves navigation markup.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​Components/​Layout/​MainLayout.razor.css Preserves application layout styles.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​Components/​Layout/​MainLayout.razor Preserves application layout markup.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​Components/​App.razor Preserves the host without Toolkit stylesheet links.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​Components/​_Imports.razor Records the expected Toolkit import.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​BlazorWebApp.csproj Records the expected Toolkit package.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​appsettings.json Supplies baseline application configuration.
test/​dotnet-scaffolding/​baselines/​BlazorToolkit/​net10.0/​BlazorWebApp/​appsettings.Development.json Supplies baseline development logging.
src/​dotnet-scaffolding/​Microsoft.DotNet.Scaffolding.Roslyn/​Services/​MSBuildProjectService.cs Exposes evaluated items and metadata.
src/​dotnet-scaffolding/​dotnet-scaffold/​AspNet/​ScaffoldSteps/​Syncfusion/​VerifySyncfusionBlazorToolkitStep.cs Verifies post-setup project state.
src/​dotnet-scaffolding/​dotnet-scaffold/​AspNet/​ScaffoldSteps/​Syncfusion/​ValidateSyncfusionBlazorToolkitStep.cs Validates projects and resolves clients.
src/​dotnet-scaffolding/​dotnet-scaffold/​AspNet/​ScaffoldSteps/​Syncfusion/​SummarizeSyncfusionBlazorToolkitStep.cs Reports changes and hosting guidance.
src/​dotnet-scaffolding/​dotnet-scaffold/​AspNet/​ScaffoldSteps/​Syncfusion/​Settings/​SyncfusionBlazorToolkitSettings.cs Tracks project state and outcomes.
src/​dotnet-scaffolding/​dotnet-scaffold/​AspNet/​ScaffoldSteps/​Syncfusion/​ApplySyncfusionBlazorToolkitProgramCsStep.cs Applies Toolkit service registration.
src/​dotnet-scaffolding/​dotnet-scaffold/​AspNet/​ScaffoldSteps/​Syncfusion/​ApplySyncfusionBlazorToolkitImportsStep.cs Applies Toolkit Razor imports.
src/​dotnet-scaffolding/​dotnet-scaffold/​AspNet/​Helpers/​Syncfusion/​BlazorProjectClassifier.cs Classifies supported Blazor projects.
src/​dotnet-scaffolding/​dotnet-scaffold/​AspNet/​Helpers/​Syncfusion/​BlazorHostingInspector.cs Inspects hosting and render modes.
src/​dotnet-scaffolding/​dotnet-scaffold/​AspNet/​Extensions/​Syncfusion/​SyncfusionBlazorToolkitScaffolderBuilderExtensions.cs Configures server and client setup steps.
src/​dotnet-scaffolding/​dotnet-scaffold/​AspNet/​Common/​PackageConstants.cs Defines the Toolkit package.
src/​dotnet-scaffolding/​dotnet-scaffold/​AspNet/​Commands/​AspnetStrings.cs Adds command metadata and examples.
src/​dotnet-scaffolding/​dotnet-scaffold/​AspNet/​AspNetCommandService.cs Registers the Toolkit command pipeline.

Review effort: Balanced

Bold Create Agent and others added 5 commits October 22, 2026 07:01
…ly hosting detection, central package version

Co-authored-by: Indhumathy-Loganathan <[email protected]>
…-4-review

Address review: RCL-hosted Blazor detection, --prerelease, startup-only hosting, and central package versions
…re test does not apply

Co-authored-by: Indhumathy-Loganathan <[email protected]>
…-4-review

Rename Toolkit integration fixture base so generic NuGet.config fixture test does not apply

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.

🔵 Needs a closer look

One or more issues must be addressed before approval.

No open issues 🎉

4 resolved since last review

Review effort: Balanced

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.

🟡 Changes recommended

Unresolved detection bugs can classify noncompiled Razor samples as Blazor apps, enabling unintended project modifications, and misreport global page render modes from comments or unrelated components.

2 open issues

Review effort: Balanced

…comments); exclude None Razor files from Blazor classification

Co-authored-by: Indhumathy-Loganathan <[email protected]>
Indhumathy-Loganathan and others added 3 commits October 29, 2026 12:57
…-4-review

Toolkit scaffolding: address review (active Routes render mode, exclude None Razor files) and fixture base rename
…am ScaffolderBaselineRunner

Co-authored-by: Indhumathy-Loganathan <[email protected]>
Bold Create Agent and others added 2 commits October 29, 2026 08:15
…itionalPackageSources

Co-authored-by: Indhumathy-Loganathan <[email protected]>
…-4-review

Fix Toolkit baseline test compile error after upstream merge (additionalPackageSources)
@haileymck
haileymck merged commit fb0f1ad into dotnet:main Oct 29, 2026
16 checks passed
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.

4 participants