One project kind
new-app
Put the project in one class: Library, Nuru CLI, Blazor, or Aspire. Make the project. Add the project to the solution.
ganda repo new-app <name>
Select a node, or run the path that the host uses.
How you write it
You write the routine in C#. Each call adds one node. Build makes the intermediate representation.
public static RoutineDefinition Build()
{
return Routine.Named(RoutineId)
.Oracle<Kind>("classify", schema: "Kind.ClosedEnum", pack: Pack.None, budget: Budget.Small)
.Switch<Kind>(sw => sw
.When(Kind.Library)
.When(Kind.NuruCli)
.When(Kind.Blazor)
.When(Kind.Aspire))
.Compute("scaffold", Scaffold)
.Compute("sln-add", SlnAdd)
.Build();
}The file is source/timewarp-taratibu/routines/new-app/new-app.cs. Taratibu master 53de8c4.
Why this shape
The kind is a closed list. The words “something like a CLI” cannot select a surprise template. scaffold and sln-add are the same commands for each result. The switch forces the list. Then each result goes to the same next node.
What you get
- If you do not pass --kind, the oracle chooses the kind. If you pass --kind, classify does not call the model. In both cases scaffold is a compute node.
- This routine does not make the GitHub origin. new-repo does that. You can aim this routine at a new origin or at a solution that is already there.
- There is no gate. The run ends at sln-add.
Rules
- The kinds are Library, NuruCli, Blazor, and Aspire.
- The normal output folder is source/{kebab-name}.
- The library scaffold function leaves ProjectPath empty. Ganda runs dotnet new. Then Ganda runs dotnet sln add.
The drawing follows the D2 file in the repo. Node ids do not change. Ganda connects the commands. Ganda does not change the graph.