Skip to content

Commit 1fe92f5

Browse files
TomProkopCopilot
andcommitted
Refactor workspace command: extract project types into ProjectCliCommand, add ConfigCliCommand stub
- Update README example to use workspace explain - Clarify component parameter wording in CopilotInstructionsManager - Extract project type documentation from WorkspaceCliCommand into new ProjectCliCommand - Add ConfigCliCommand stub for future config validation feature - Minor whitespace cleanup in ComponentParameterListCliCommand Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 47175d2 commit 1fe92f5

6 files changed

Lines changed: 90 additions & 26 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ dotnet restore
113113
dotnet build
114114
```
115115

116-
**Run the CLI directly (for example, to test the data transform server):**
116+
**Run the CLI directly:**
117117
```sh
118-
dotnet run --project src/TALXIS.CLI -- data transform server start
118+
dotnet run --project src/TALXIS.CLI -- workspace explain
119119
```
120120

121121
---

src/TALXIS.CLI.MCP/CopilotInstructionsManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class CopilotInstructionsManager
4747
- Avoid speculation about functionality not confirmed by txc-mcp
4848
4949
6. **Default Values to use unless specified**
50-
- You must always pass `SolutionRootPath=Declarations` when calling the tool for creating components
50+
- You must always pass `SolutionRootPath=Declarations` component parameter when calling the tool for creating components
5151
5252
## Project Structure and Naming Conventions
5353

src/TALXIS.CLI.Workspace/ComponentParameterListCliCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ public int Run()
2626
return 0;
2727
}
2828
Console.WriteLine($"Parameters for template '{ShortName}':");
29-
29+
3030
// Always show the mandatory output parameter first
3131
Console.WriteLine("--output (Project folder path) (text) <required>");
3232
Console.WriteLine(" Specifies the target project folder path where the component will be created.");
3333
Console.WriteLine(" Required for both creating new projects (solution, plugin, PCF, etc.) and adding components to existing projects.");
3434
Console.WriteLine(" Format: \"src\\Solutions.DataModel\"");
35-
35+
3636
foreach (var p in parameters)
3737
{
3838
Console.Write($"--{p.Name}");
@@ -42,7 +42,7 @@ public int Run()
4242
if (!string.IsNullOrEmpty(p.DefaultValue?.ToString()))
4343
Console.Write($" [default: {p.DefaultValue}]");
4444
// Check if parameter is required
45-
if (p.Precedence.IsRequired ||
45+
if (p.Precedence.IsRequired ||
4646
p.Precedence.PrecedenceDefinition == Microsoft.TemplateEngine.Abstractions.PrecedenceDefinition.Required)
4747
Console.Write(" <required>");
4848
if (p.Choices != null && p.Choices.Count > 0)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using DotMake.CommandLine;
2+
3+
namespace TALXIS.CLI.Workspace;
4+
5+
[CliCommand(
6+
Description = "Configure and troubleshoot this tool"
7+
)]
8+
public class ConfigCliCommand
9+
{
10+
public void Run(CliContext context)
11+
{
12+
context.ShowHelp();
13+
}
14+
15+
[CliCommand(
16+
Description = "Run checks to determine if this local machine is correctly set up, validate connections and settings",
17+
Name = "validate")]
18+
public class ConfigValidateCliCommand
19+
{
20+
public void Run(CliContext context)
21+
{
22+
Console.WriteLine(
23+
@"Hello"
24+
);
25+
}
26+
}
27+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using DotMake.CommandLine;
2+
3+
namespace TALXIS.CLI.Workspace;
4+
5+
[CliCommand(
6+
Description = "Work with MSBuild projects in your workspace (solutions, plugins, libraries, controls...)",
7+
Alias = "p"
8+
)]
9+
public class ProjectCliCommand
10+
{
11+
public void Run(CliContext context)
12+
{
13+
context.ShowHelp();
14+
}
15+
16+
[CliCommand(
17+
Description = "Provides a summary of MSBuild/.NET project types which can be created in the workspace, how componets should be segmented between them, their structure and references. Use this tool whenever the user asks about projects in the workspace.",
18+
Name = "explain")]
19+
public class ProjectExplainCliCommand
20+
{
21+
public void Run(CliContext context)
22+
{
23+
Console.WriteLine(
24+
@"Use of projects in this repository
25+
26+
Project Types Supported:
27+
• Dataverse Solution (.cdsproj or .csproj): Used for defining Dataverse components and metadata. Build artifact is solution ZIP file.
28+
• Dataverse Package (.csproj): Bundles multiple solutions and custom logic for deployment; references other projects to form a unit of deployment. Build artifact is package ZIP file which contains all solutions, import config, data and deployment automation/migration code.
29+
• Dataverse Plugin (.csproj): Contains custom business logic, event handlers, and automation for Dataverse. Build artifact is a plugin DLL file.
30+
• Power Apps Component Framework control (.csproj): Implements custom controls for Power Apps. Build artifact is a PCF control bundle JS.
31+
• Power Apps Script Library (.csproj): Provides reusable scripts for Power Platform solutions. Build artifact is a script bundle JS file.
32+
• Power Platform Connector (.csproj): Defines custom connectors for Power Platform integrations.
33+
• Code App (.csproj): Builds fully custom frontend SPA hosted in Power Apps.
34+
• Other .NET-based projects (.csproj, .xproj): Any additional supporting libraries or tools.
35+
36+
To find information how repository should be organized, consult 'workspace explain' command/tool.
37+
38+
Development and Build:
39+
• All projects are added to the single solution file (.sln) which is placed in the root directory
40+
• MSBuild (dotnet build) is used to build all project types
41+
• Solution projects can have ProjectReferences to plugin, script, PCF, and Code App project types. When the solution is built, it pulls outputs of the referenced projects and places them into the solution artifact (the build output of the solution project).
42+
• Multiple solutions can be added as ProjectReferences to the package project. When the package is built, it composes ImportConfig.xml with the list of solutions and the order in which they are imported to Dataverse upon deployment.
43+
• Package project type can contain C# migration and deployment automation/infra code. Dataverse packages can also contain configuration and test data which needs to be deployed with the code/definitions.
44+
"
45+
);
46+
}
47+
}
48+
}

src/TALXIS.CLI.Workspace/WorkspaceCliCommand.cs

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
namespace TALXIS.CLI.Workspace;
44

55
[CliCommand(
6-
Description = "Develop solutions in your local workspace",
6+
Description = "Implement software in your local computer workspace (Git repository)",
77
Alias = "ws",
88
Children = new[]
99
{
10-
typeof(ComponentCliCommand)
10+
typeof(ComponentCliCommand),
11+
typeof(ProjectCliCommand)
1112
})]
1213
public class WorkspaceCliCommand
1314
{
@@ -16,6 +17,7 @@ public void Run(CliContext context)
1617
context.ShowHelp();
1718
}
1819

20+
1921
[CliCommand(
2022
Description = "Provides a summary of repository structure, build system, project types, components, and how they are organized for development and deployment. Use this tool whenever the user asks about organizing or understanding the workspace. This includes details about the monorepo layout, use of .NET project and solution files, supported project types (such as Dataverse solutions, plugins, packages, Power Apps components, and custom code apps), and how projects are managed and built using MSBuild. The summary also explains how solution and package projects reference and compose other components for deployment, offering flexibility in organizing code for various scenarios.",
2123
Name = "explain")]
@@ -24,22 +26,16 @@ public class WorkspaceExplainCliCommand
2426
public void Run(CliContext context)
2527
{
2628
Console.WriteLine(
27-
@"Repository Structure Overview
29+
@"Repository Structure Overview
2830
2931
This repository is organized as a monorepo based on the .NET project system. It uses a Visual Studio solution file (.sln) to track all projects, and each project is defined by its own project file (.csproj, .cdsproj, or other .(x)proj formats). All projects are built using MSBuild.
3032
33+
Rules for repository root unless user explicitly instructs to do it differently:
34+
3135
• The root contains essential files such as README.md, .gitignore, and the .sln solution file
3236
• The src/ directory holds all source code, organized into folders for different project types
3337
34-
Project Types Supported:
35-
• Dataverse Solution (.cdsproj or .csproj): Used for defining Dataverse components and metadata. Build artifact is solution ZIP file.
36-
• Dataverse Package (.csproj): Bundles multiple solutions and custom logic for deployment; references other projects to form a unit of deployment. Build artifact is package ZIP file which contains all solutions, import config, data and deployment automation/migration code.
37-
• Dataverse Plugin (.csproj): Contains custom business logic, event handlers, and automation for Dataverse. Build artifact is a plugin DLL file.
38-
• Power Apps Component Framework control (.csproj): Implements custom controls for Power Apps. Build artifact is a PCF control bundle JS.
39-
• Power Apps Script Library (.csproj): Provides reusable scripts for Power Platform solutions. Build artifact is a script bundle JS file.
40-
• Power Platform Connector (.csproj): Defines custom connectors for Power Platform integrations.
41-
• Code App (.csproj): Builds fully custom frontend SPA hosted in Power Apps.
42-
• Other .NET-based projects (.csproj, .xproj): Any additional supporting libraries or tools.
38+
You can find supported project types with 'workspace project explain' command/tool.
4339
4440
Repository Initialization Sequence:
4541
The Visual Studio solution file (.sln) and src folder MUST be initialized before creating any solutions or projects.**
@@ -50,14 +46,7 @@ The Visual Studio solution file (.sln) and src folder MUST be initialized before
5046
3. **Create Visual Studio solution file: dotnet new sln --name [ProjectName]**
5147
4. Create src/ directory: mkdir src
5248
53-
Development and Build:
54-
• All projects are added to the single solution file (.sln) which is placed in the root directory
55-
• MSBuild (dotnet build) is used to build all project types
56-
• Solution projects can have ProjectReferences to plugin, script, PCF, and Code App project types. When the solution is built, it pulls outputs of the referenced projects and places them into the solution artifact (the build output of the solution project).
57-
• Multiple solutions can be added as ProjectReferences to the package project. When the package is built, it composes ImportConfig.xml with the list of solutions and the order in which they are imported to Dataverse upon deployment.
58-
• Package project type can contain C# migration and deployment automation/infra code. Dataverse packages can also contain configuration and test data which needs to be deployed with the code/definitions.
59-
60-
This structure is flexible and does not enforce a specific layering or project type arrangement. Developers are free to organize solutions, plugins, packages, and other projects as needed for their scenario. The .NET project system and solution file provide a unified way to manage, build, and deploy all components in the repository."
49+
This structure is flexible and does not enforce a specific segmentation, layering or project arrangement. Developers are free to organize solutions, plugins, packages, and other projects as needed for their scenario. The .NET project system and Visual Studio solution file provide a unified way to manage, build, and deploy all components in the repository."
6150
);
6251
}
6352
}

0 commit comments

Comments
 (0)