-
Notifications
You must be signed in to change notification settings - Fork 690
Open
Open
Copy link
Labels
area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplicationIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
Milestone
Description
Background and Motivation
If an Aspire AppHost
needs to particular sequence involving a Node script, this can be problematic.
Allow the state of a resource that is effectively a watch process without an exit to be affected by output text. The desired capability is similar to problemMatcher
in VS Code tasks that define an "endsPattern"
Today if you run a Node app (eg. ng serve
) it seems to prematurely indicate "readiness" while it's still executing. Any output indicating "readiness" is highly variable in nature due to script customizations and frameworks.
Proposed API
IResourceBuilder<T>
extension
WaitFor(IResourceBuilder<IResource> dependency, string message)
WaitForWithMessage(IResourceBuilder<IResource> dependency, string message)
Usage Examples
// ng serve / watch
var angularClient = builder.AddNpmApp("client", "./apps/client1", "start");
// something to run only after npm project ready
var otherThing = builder.AddNpmApp("otherThing", "./apps/client2", "start")
.WaitForWithMessage(angularClient, "bundle generation complete");
Alternative Designs
Risks
Metadata
Metadata
Assignees
Labels
area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplicationIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication