Repository navigation
feat: Enhance interactive wizard for project creation and improve pac… - #1881
Open
dkalinovInfra wants to merge 1 commit into
Open
dkalinovInfra wants to merge 1 commit into
dkalinovInfra wants to merge 1 commit into
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.
Contributor
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
| record "$fw" "wizard" "$id" "PASS" "$((SECONDS - start))" | ||
| echo " ✓ wizard $id" | ||
| [ "$fw" = "blazor" ] && return 0 | ||
| run_cli "$OUT/$dir" "$LOGS/$dir-config.log" config set disableAnalytics true |
| echo "=== $fw ($type) ===" | ||
|
|
||
| if [ -n "$WIZARD" ]; then | ||
| for id in $(node "$ROOT/scripts/smoke-wizard.mjs" list "$fw" "$WIZARD"); do |
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 automated tests for the interactive
ig newwizard (ig newwithout a name) and fixes three bugs they found.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 (47 on this branch: Angular 10, Blazor 24, jQuery 2, React 6, Web Components 5) with answers scripted throughinquirerWrapperTesting.promptDelegates. Install, git anddotnetare 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.ig newhad no.prettierrc.Util.processTemplatesglobs withoutdot: true, so a template file named.prettierrcis never copied. Renamed to__dot__prettierrc, the convention the other dotfiles use; the schematics path already maps__dot__to..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) documents 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)@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-specandpackageManager-specpass.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, and Angular projects get their .prettierrc; adds automated tests for every wizard answer combination.🤖 Generated with Claude Code