feat: add Blazor project scaffolding options and templates#1719
Open
dkalinovInfra wants to merge 3 commits into
Open
feat: add Blazor project scaffolding options and templates#1719dkalinovInfra wants to merge 3 commits into
dkalinovInfra wants to merge 3 commits into
Conversation
- Introduced new options for Blazor projects: `hosting` and `variant` in the `new` command. - Implemented `EmptyIgbProject` template for scaffolding Blazor Web Apps. - Updated `IgbBlazorProjectLibrary` to support multiple themes: bootstrap, material, fluent, and indigo. - Enhanced `DotnetTemplateManager` to handle Blazor project creation via `dotnet new igb-blazor`. - Modified `BasePromptSession` to utilize the new scaffolding method for Blazor projects. - Added unit tests for the new scaffolding functionality and ensured proper integration with existing commands.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class Blazor project scaffolding support to the Ignite UI CLI by introducing a scaffold()-based generation path (delegating project creation to dotnet new via a new DotnetTemplateManager) and wiring this through both ig new and the Step-By-Step wizard, along with new Blazor templates/options and updated tests.
Changes:
- Introduces
ProjectTemplate.scaffold(options)+ScaffoldOptionsand aDotnetTemplateManagerwrapper to generate Blazor projects viadotnet new igb-blazor. - Adds a new visible “Blazor Web App” (igb) project template and exposes Blazor in CLI help + wizard flows, including Blazor-specific options (hosting/variant) and next-steps output.
- Expands unit/acceptance/template tests to cover the new scaffold path, Blazor metadata, help output, and
dotnetallow-listing.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/unit/Util-spec.ts | Adds a compile-time test ensuring dotnet is allowed by Util.spawnSync typing. |
| spec/unit/PromptSession-spec.ts | Adds wizard tests for scaffold path + dotnet next-steps behavior. |
| spec/unit/new-spec.ts | Adds ig new tests verifying scaffold invocation, extraConfig handling, and next-steps output. |
| spec/unit/DotnetTemplateManager-spec.ts | Adds unit coverage for SDK detection, template install, and scaffold argument/error handling. |
| spec/templates/blazor-spec.ts | Ensures Blazor framework visibility, theme list, and empty scaffold template registration. |
| spec/acceptance/help-spec.ts | Updates help output expectations to include Blazor and new flags. |
| packages/core/util/Util.ts | Allows dotnet as a permitted binary for spawnSync and updates doc comment. |
| packages/core/util/index.ts | Re-exports DotnetTemplateManager from the util barrel. |
| packages/core/util/DotnetTemplateManager.ts | Implements dotnet-based scaffolding (SDK check, template install, dotnet new). |
| packages/core/types/ProjectTemplate.ts | Adds ScaffoldOptions and optional ProjectTemplate.scaffold() API. |
| packages/core/templates/BaseTemplateManager.ts | Updates framework-name filtering comment (hidden frameworks behavior). |
| packages/core/prompt/BasePromptSession.ts | Adds scaffold-based project generation path + Blazor “Complete & Run” handling. |
| packages/cli/templates/blazor/index.ts | Un-hides the Blazor framework in template metadata. |
| packages/cli/templates/blazor/igb/projects/empty/index.ts | Adds “Blazor Web App” template that scaffolds via DotnetTemplateManager. |
| packages/cli/templates/blazor/igb/index.ts | Updates Blazor igb theme list to bootstrap/material/fluent/indigo. |
| packages/cli/lib/commands/types.ts | Adds hosting and variant args for the new command typing. |
| packages/cli/lib/commands/new.ts | Adds --hosting/--variant options and routes scaffold templates through scaffold() + dotnet next-steps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds first-class Blazor project scaffolding to the CLI. The Blazor framework is now visible in both the
ig newcommand and the Step-By-Step wizard, and projects are generated via the publishedIgniteUI.Blazor.TemplatesNuGet template package using thedotnetCLI rather than the Handlebars template pipeline.Key changes:
scaffold()strategy onProjectTemplate— when a project template implements the optionalscaffold(options: ScaffoldOptions)method, the host calls it instead of thegenerateConfig → processTemplates → installPackagespipeline. This lets a project delegate generation to an external tool while still participating in AI/agent configuration and git init.DotnetTemplateManager(new, in@igniteui/cli-core) — a thin wrapper around thedotnetCLI that verifies the .NET SDK (8+) is present, installs theIgniteUI.Blazor.Templatespackage if missing, and runsdotnet new igb-blazorwith the chosen hosting model, theme, and variant. All failures are reported and returned asfalse(no throwing).blazor/igb/projects/empty) — exposes extra configuration for the Hosting model (Server/Wasm/Auto) and theme Variant (light/dark), and forwards everything toDotnetTemplateManager.scaffold().ig newoptions — added--hosting(Server|Wasm|Auto) and--variant(light|dark) flags for Blazor projects, name-validation warning for non-identifier project names, and Blazor-specific "Next Steps" output.BasePromptSession) — runs extra-configuration prompts and thescaffold()path for scaffold-based templates, handles git init (since the scaffold service never touches git), and printsdotnet runnext-steps / optional run prompt for projects with no cli-config.igbthemes changed from["default"]to["bootstrap", "material", "fluent", "indigo"]; Blazor framework un-hidden;Util.spawnSyncnow allowsdotnetas a known binary;customizeTemplateTaskacceptsBaseTemplate.Related Issue
Closes #
Type of Change
Affected Packages
igniteui-cli(packages/cli)@igniteui/cli-core(packages/core)@igniteui/angular-templates(packages/igx-templates)@igniteui/angular-schematics(packages/ng-schematics)@igniteui/mcp-server(packages/igniteui-mcp)Checklist
npm run test)npm run build)npm run lint)Additional Context
New/updated test coverage:
spec/unit/DotnetTemplateManager-spec.ts— SDK detection, template install, and scaffold argument/error handling.spec/unit/PromptSession-spec.ts— wizard scaffold path and next-steps behavior.spec/unit/new-spec.ts—ig newBlazor options and scaffold invocation.spec/templates/blazor-spec.ts,spec/unit/Util-spec.ts,spec/acceptance/help-spec.ts— template metadata,spawnSyncbinary allow-list, and updated help output.Example usage:
ig new MyApp --framework blazor --type igb --hosting Server --theme bootstrap --variant dark cd MyApp dotnet run --project MyApp