dotnet / aspire

Tools, templates, and packages to accelerate building observable, production-ready apps
https://learn.microsoft.com/dotnet/aspire
MIT License
3.81k stars 451 forks source link

Make referencing Node/Npm projects consistent with python and dotnet #5020

Closed maddymontaquila closed 1 month ago

maddymontaquila commented 3 months ago

Background and Motivation

When adding a Python or Dotnet project, the API is builder.AddProject / builder.AddPythonProject - Npm/Node should probably be consistent and not AddNodeApp etc. Also I'm sure there is a reason they are two separate APIs, but... feels like we should have builder.AddJSProject("node") or something and abstract that

Proposed API

no

Usage Examples

builder.AddNodeProject("pls");

aaronpowell commented 3 months ago

I find the naming a little confusing because the NodeAppResource and PythonProjectResource are of type ExecutableResource not ProjectResource, which means that from a manifest perspective they are treated differently (resulting in a different hosting model).

I would argue that it should be AddPythonApp to align with the current Node style and thus have a point of difference that they will be handled differently in the manifest for hosting.

maddymontaquila commented 2 months ago

after talking with @DamianEdwards I agree with you @aaronpowell !!! It should be "AddNodeApp" and "AddPythonApp" and we should reserve "Add<>Project" for things with a .csproj file!

DamianEdwards commented 2 months ago

We should add the new method (AddPythonApp) and obsolete the existing one in 8.2 and, remove the old one in 9.0