Skip to content

Make init smarter as far as detecting projects, placing files, and showing warnings for incompatible directories#530

Open
zateutsch wants to merge 9 commits into
mainfrom
zt/476-smart-init
Open

Make init smarter as far as detecting projects, placing files, and showing warnings for incompatible directories#530
zateutsch wants to merge 9 commits into
mainfrom
zt/476-smart-init

Conversation

@zateutsch
Copy link
Copy Markdown
Contributor

@zateutsch zateutsch commented May 11, 2026

Smart init cases:
Directory passed

  1. Valid project detected at passed directory => init with no prompting
  2. No valid project detected => show warning and prompt confirmation with y/n

No directory passed

  1. Valid project detected at root => no search executed, init at that location with no prompting
  2. No project detected at root, other projects found => surface list of init location options, provide current directory as option in all cases. If current directory is invalid - show warning. Only 10 projects will be surfaced as a hard maximum, if search stops at 10, warning will be shown to pass directory manually if not surfaced in list
  3. No projects found anywhere => warn and prompt confirmation at root

--use-defaults

  1. Project at root valid => init there, no warning
  2. Project at root invalid => init there, warning

Copilot AI review requested due to automatic review settings May 11, 2026 20:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes winapp init smarter by adding breadth-first project detection/selection when no base directory is provided and updates schema/npm wrappers + docs accordingly.

Changes:

  • Added ProjectDetectionService (+ models + interface) and wired it into init to detect compatible projects and prompt for selection.
  • Updated generated npm command wrappers/docs and CLI schema version.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/winapp-npm/src/winapp-commands.ts Regenerated npm wrappers; adds init.searchAll and new run surface (notably appArgs, executable).
src/winapp-CLI/WinApp.Cli/Services/ProjectDetectionService.cs New BFS-based project detection service with ignore lists and marker checks.
src/winapp-CLI/WinApp.Cli/Services/IProjectDetectionService.cs New interface for project detection service.
src/winapp-CLI/WinApp.Cli/Services/DetectedProjectType.cs New enum of detectable project types ordered by specificity.
src/winapp-CLI/WinApp.Cli/Services/DetectedProject.cs New record model for detected projects and display labels.
src/winapp-CLI/WinApp.Cli/Helpers/HostBuilderExtensions.cs Registers IProjectDetectionService in DI.
src/winapp-CLI/WinApp.Cli/Commands/InitCommand.cs Implements detect/select flow, integrates --search-all, and adjusts config-dir defaulting when selecting nested project.
src/winapp-CLI/WinApp.Cli.Tests/ProjectDetectionServiceTests.cs Adds unit tests for detection rules, BFS behavior, ignore lists, and display paths.
src/winapp-CLI/WinApp.Cli.Tests/InitCommandTests.cs Updates existing tests for new prompts and adds tests for init selection behavior.
docs/usage.md Documents --search-all and the new automatic project detection flow.
docs/npm-usage.md Updates npm API docs for init.searchAll and run options (including appArgs, executable).
docs/fragments/skills/winapp-cli/setup.md Updates setup skill fragment with search-related notes/examples.
docs/cli-schema.json Bumps schema and adds init --search-all (and includes run passthrough arg schema).
.github/plugin/skills/winapp-cli/setup/SKILL.md Updates GitHub Skills content to mention project search and --search-all.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/winapp-npm/src/winapp-commands.ts
Comment thread src/winapp-CLI/WinApp.Cli/Services/ProjectDetectionService.cs
Comment thread src/winapp-CLI/WinApp.Cli/Services/ProjectDetectionService.cs
Comment thread src/winapp-CLI/WinApp.Cli/Commands/InitCommand.cs Outdated
Comment thread docs/fragments/skills/winapp-cli/setup.md Outdated
Comment thread .github/plugin/skills/winapp-cli/setup/SKILL.md Outdated
Comment thread docs/usage.md Outdated
Comment thread docs/npm-usage.md
Comment thread docs/npm-usage.md
Comment thread src/winapp-CLI/WinApp.Cli/Services/ProjectDetectionService.cs
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 11, 2026

Build Metrics Report

Binary Sizes

Artifact Baseline Current Delta
CLI (ARM64) 30.87 MB 30.92 MB 📈 +46.5 KB (+0.15%)
CLI (x64) 31.23 MB 31.27 MB 📈 +44.5 KB (+0.14%)
MSIX (ARM64) 13.03 MB 13.03 MB 📉 -0.3 KB (-0.00%)
MSIX (x64) 13.83 MB 13.85 MB 📈 +26.8 KB (+0.19%)
NPM Package 27.09 MB 27.13 MB 📈 +42.7 KB (+0.15%)
NuGet Package 27.17 MB 27.21 MB 📈 +40.4 KB (+0.15%)
VS Code Extension 19.91 MB 19.93 MB 📈 +27.2 KB (+0.13%)

Test Results

1024 passed, 1 skipped out of 1025 tests in 454.0s (+31 tests, +3.7s vs. baseline)

Test Coverage

23.8% line coverage, 40% branch coverage · ✅ +0.2% vs. baseline

CLI Startup Time

39ms median (x64, winapp --version) · ✅ no change vs. baseline


Updated 2026-05-12 17:25:30 UTC · commit 639a7c7 · workflow run

zateutsch and others added 5 commits May 12, 2026 12:42
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>
@zateutsch zateutsch requested a review from nmetulev May 12, 2026 17:13
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.

2 participants