feat: Add --project-only flag with flat project structure#1877
Conversation
Co-authored-by: jeromelaban <5839577+jeromelaban@users.noreply.github.com>
|
|
|
@copilot Let's try to have the output project place the contents of "MyExtensionsApp.1" at the root of the generated content. |
Co-authored-by: jeromelaban <5839577+jeromelaban@users.noreply.github.com>
Done! Added a conditional source configuration that maps Changes in commit a638336:
With Instead of: |
|
@copilot Let's also ignore the |
Co-authored-by: jeromelaban <5839577+jeromelaban@users.noreply.github.com>
Done! Updated all Changes in commit d2fd856:
Behavior:
|
|
@copilot Let's make projectOnly and includeGlobalJson hidden parameters |
Co-authored-by: jeromelaban <5839577+jeromelaban@users.noreply.github.com>
Done! Both parameters are now hidden. Changes in commit 53e13c0:
Impact:
|
Co-authored-by: jeromelaban <5839577+jeromelaban@users.noreply.github.com>
|
@copilot This is not the right location for isHidden |
Co-authored-by: jeromelaban <5839577+jeromelaban@users.noreply.github.com>
Fixed! Moved Changes in commit 9aaee7e:
Correct structure:
This follows the standard .NET CLI template pattern for hidden parameters. |
Summary
This PR implements the
--project-onlyflag for the unoapp template as requested in issue #1871 and addresses all feedback including making parameters hidden in the correct location.Changes Made
Core Features
--project-onlyparameter (bool, default: false, hidden)includeGlobalJsonparameter (hidden)includeGlobalJsonEvaluatorcomputed symbolParameter Visibility
Both
projectOnlyandincludeGlobalJsonare hidden parameters:Correct Implementation:
isHiddensymbolInfoentries WITH"isHidden": trueWhy This Location?
template.jsondefines template logic and parametersdotnetcli.host.jsoncontrols CLI presentation and visibilityisHiddenis a CLI presentation concern, so it belongs indotnetcli.host.jsonImpact:
--project-only trueSmart Behavior
The flag intelligently adapts based on project requirements:
What Triggers requiresNugetPackages?
Features that need Directory.Build.props/Packages.props:
Output Examples
Simple Project (--project-only true)
With Tests (--project-only true, ignored)
Usage
Command Line (Hidden Parameters Still Work)
Programmatic (VSIX)
Implementation Details
Hidden Parameters (correct location):
dotnetcli.host.jsonundersymbolInfo"isHidden": truelongNameandshortNamefor CLI usageSmart Conditions:
All projectOnly conditions check
!requiresNugetPackages:Applied to:
(isVsix || (projectOnly && !requiresNugetPackages))Testing
Commits in This PR
9d2fdb6- Initial --project-only implementationa638336- Place project contents at rootd2fd856- Ignore projectOnly when NuGet packages required53e13c0- Make parameters hidden (wrong location: template.json)ef0a23a- Fix isHidden to use boolean (still wrong location)9aaee7e- Move isHidden to dotnetcli.host.json (correct location)Fixes https://github.com/unoplatform/uno.templates/issues/#1871
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.