Repository navigation
fix(cli): the interactive wizard no longer hangs on Windows when stdin is a pipe; adds automated tests for every wizard answer combination - #1881
Conversation
…kage manager stdin handling - Added comprehensive tests for the interactive `ig new` wizard covering various AI configurations and scenarios. - Implemented a new script `smoke-wizard.mjs` to automate the wizard interaction, allowing for coverage of all answer combinations. - Updated `PackageManager` to utilize a new `childStdin` method for better stdin handling based on terminal availability. - Introduced a new `.prettierrc` configuration for consistent code formatting across projects. - Enhanced smoke test scripts to support project creation through the interactive wizard, including detailed logging and result tracking. - Added a new helper file `wizard-matrix.ts` to manage wizard scenarios and expected prompts.
There was a problem hiding this comment.
🟡 Changes recommended
The smoke test can silently succeed without running any scenarios when scenario listing fails, and its post-install configuration may invoke the published CLI instead of the checkout.
2 open issues
What changed in this PR
Adds automated coverage for the interactive ig new wizard and fixes project-generation issues exposed by that coverage.
Changes:
- Adds template-driven wizard scenarios, acceptance tests, and pipe-driven smoke testing with selectable coverage.
- Prevents child processes from inheriting piped stdin and ensures Angular projects receive
.prettierrc. - Updates Blazor smoke checks and documents the new wizard-testing mode.
| File | Description |
|---|---|
spec/unit/Util-spec.ts |
Tests child stdin selection and Git integration. |
spec/unit/packageManager-spec.ts |
Updates expected package-install stdin handling. |
spec/helpers/wizard-matrix.ts |
Generates wizard scenarios, answers, prompt sequences, and coverage samples. |
spec/acceptance/wizard-spec.ts |
Checks wizard prompts, generated files, AI configuration, and Blazor arguments. |
scripts/smoke-wizard.mjs |
Drives the real wizard through piped keyboard input. |
scripts/smoke-test.sh |
Adds wizard mode and corrects Blazor scaffold/build checks. |
packages/igx-templates/igx-ts/projects/_base/files/__dot__prettierrc |
Uses the dotfile placeholder so Angular scaffolding copies Prettier configuration. |
packages/core/util/Util.ts |
Adds TTY-aware child stdin handling and applies it to Git. |
packages/core/packages/PackageManager.ts |
Uses TTY-aware stdin for package installation. |
.agents/skills/igniteui-cli-smoke-test/SKILL.md |
Documents wizard acceptance coverage, smoke mode, and result naming. |
Review effort: Balanced
…nhance wizard scenario handling
…gniteui-cli into dkalinov/wizard-tests
There was a problem hiding this comment.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Note
This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.
There was a problem hiding this comment.
Note
Copilot was unable to run its full agentic suite in this review.
Copilot review overview
5 open issues
The updated comment says stdout/stderr are ignored, but thestdioarray only sets stdin; Node… · New In--wizardmode, the wizard action is “Complete and Install packages”, so projects will… · New This test mutatesprocess.stdin.isTTYvia assignment. In some Node/stream implementationsisTTY… · New Check scenario-list status and reject empty project lists Run post-install configuration with the checkout CLI
Review effort: Lite
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Refactor childStdin test to properly handle isTTY property. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Ignoring stdout and stderr discards npm failure diagnostics and breaks existing unit-test argument assertions; only stdin should change, using [Util.childStdin()].
2 open issues
4 resolved since last review
This test mutatesprocess.stdin.isTTYvia assignment. In some Node/stream implementationsisTTY… The updated comment says stdout/stderr are ignored, but thestdioarray only sets stdin; Node… Check scenario-list status and reject empty project lists Run post-install configuration with the checkout CLI
Review effort: Balanced
…ov/wizard-tests Stack the wizard tests on #1854: drop the .prettierrc rename (ng new now writes it), pass childStdin to the Angular scaffold's npx/npm calls, stub the Angular CLI in wizard-spec, run the checkout's lib/cli.js from smoke-wizard.mjs, and update the packageManager-spec stdio expectations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remove stdout and stderr from execSync call to reduce console output. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The installPackages call supplies only one stdio entry instead of the expected three, causing all three updated specs to fail and leaving stdout/stderr suppression unspecified.
2 open issues
1 resolved since last review
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
Ignoring stderr discards npm’s failure diagnostics and bypasses stderr-based interruption handling, leaving verbose installation errors without their underlying cause.
No open issues 🎉
2 resolved since last review
Review effort: Balanced
…mments - installPackages passes [childStdin, "ignore", "pipe"] so Util.execSync can still detect ^C and npm's error text reaches the verbose log - test that the Angular scaffold's npx/npm calls get childStdin() - stub childStdin in the installPackages specs - share the new/wizard step check in smoke-test.sh (finish_scaffold) - document --wizard in the README and the Blazor/wizard artifact check in the smoke-test skill Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Blazor scaffold passes only when a .csproj exists, not just the folder - detect .slnx as well as .sln before choosing the build target - reject --wizard combined with -p, --templates, --all-projects or --isolate - drop duplicate local declaration in run_framework - simplify the isTTY save/restore in the childStdin spec Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>


Description
Adds automated tests for the interactive
ig newwizard (ig newwithout a name) and fixes two bugs they found.Stacked on #1854, which creates Angular projects with Angular's own
ng new; review and merge that first.Tests
spec/helpers/wizard-matrix.tsbuilds every answer combination the wizard offers from the registered templates: framework → project type → template (± authentication) → theme → each extra option. It also gives the answer to each prompt and the exact prompt sequence each combination should see, and samples combinations by coverage (eachvalue, everypairsof values, orall). New templates and options are picked up automatically.spec/acceptance/wizard-spec.tsruns the real wizard and templates for every combination (46 on this branch: Angular 10, Blazor 24, jQuery 2, React 5, Web Components 5) with answers scripted throughinquirerWrapperTesting.promptDelegates. Install, git,dotnetand the Angular CLI (feat: regenerate Angular base project and update dependencies #1854'sstubAngularCli()) are stubbed. A test fails on an unexpected prompt, an answer the prompt does not offer, or a different prompt order. It checks:ignite-ui-cli.jsonand template filesdotnet new igb-blazorarguments for Blazorscripts/smoke-wizard.mjsandscripts/smoke-test.sh --wizard each|pairs|alldrive the realigbinary over a pipe (arrow keys and Enter), then the smoke test installs and builds each project. Without a TTY the CLI skips the AI config prompts and Blazor's "Run the app now", so only the spec covers those.Fixes
ighangs on Windows when its stdin is a pipe.Util.gitInitpassedprocess.stdintogit, andPackageManager.installPackagespassedstdio: ["inherit"]tonpm. While the prompts were still reading that pipe, Git for Windows and npm blocked on startup. A newUtil.childStdin()passes stdin only when it is a TTY, so behavior in a terminal (including Ctrl+C during install) is unchanged. Thenpx @angular/cliandnpm installcalls feat: regenerate Angular base project and update dependencies #1854 adds in_base/scaffold.tsget the same treatment.installPackagesnow passes[childStdin, "ignore", "pipe"]: stdout is ignored explicitly (it was piped by default before), and stderr stays piped becauseUtil.execSynclooks for^Cin it to detect Ctrl+C, and npm's error text reaches the verbose log through it.scripts/smoke-test.shcould not pass for Blazor. It requiredignite-ui-cli.json, which dotnet-scaffolded projects don't have, and randotnet buildat the project root, which fails withMSB1003for Server hosting because there is no root.sln.The smoke-test skill (
.agents/skills/igniteui-cli-smoke-test/SKILL.md) and the README's smoke-test options table document the new--wizardmode and spec.Related Issue
None.
Type of Change
Affected Packages
igniteui-cli(packages/cli)@igniteui/cli-core(packages/core)@igniteui/angular-templates(packages/igx-templates): only the stdin change in feat: regenerate Angular base project and update dependencies #1854'sscaffold.ts@igniteui/angular-schematics(packages/ng-schematics)@igniteui/mcp-server(packages/igniteui-mcp)Checklist
npm run test)npm run build)npm run lint)What was run instead:
tsc. It reports three missing declarations (@types/resolve,@types/through2) in files this PR doesn't touch, from the localnode_modules..tsfiles, clean. Locally,npm run lintcrashes in ajv independently of this change.npm run jasmine: no new failures. The 25 failures in the Angular project scaffold, migration and AST transformer specs fail onmastertoo.Util-spec,packageManager-specandangular-scaffold-spec(with a new spec for the stdin change) pass.packageManager-spec'sinstallPackagesspecs can time out when Jasmine randomizes the order, because a shared staticinstallQueuekeeps promises from earlier specs. That was already the case before this change; the repo's runner uses a fixed order, where they pass.scripts/smoke-test.sh --wizard pairs):dotnet build.npm install.Additional Context
dkalinov/blazor-empty-project) adds anemptytemplate that passes--Empty. Whichever PR merges second needswizard-spec.tsto expect--Emptyfor that template:scripts/smoke-test.sh.ig newstep does; analytics can only be turned off through config, whichig newrefuses to run next to.fix(cli): the interactive wizard no longer hangs on Windows when stdin is a pipe; adds automated tests for every wizard answer combination.🤖 Generated with Claude Code