Add polyglot exports for Aspire.Hosting.Nats#14902
Merged
sebastienros merged 4 commits intorelease/13.2from Mar 4, 2026
Merged
Add polyglot exports for Aspire.Hosting.Nats#14902sebastienros merged 4 commits intorelease/13.2from
sebastienros merged 4 commits intorelease/13.2from
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14902Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14902" |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds polyglot (TypeScript) export support for Aspire.Hosting.Nats, enabling TypeScript app hosts to use NATS server resources via the ATS (Aspire Type System) capability API.
Changes:
- Annotates existing C#
AddNats,WithJetStream,WithDataVolume, andWithDataBindMountoverloads with[AspireExport]/[AspireExportIgnore]attributes, and adds a dedicatedAddNatsForPolyglotmethod. - Adds a TypeScript
ValidationAppHostplayground project with a generated SDK (aspire.ts,base.ts,transport.ts) for validating the NATS polyglot exports. - Adds project scaffolding files (
package.json,tsconfig.json,apphost.ts,apphost.run.json,settings.json,.codegen-hash).
Reviewed changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/Aspire.Hosting.Nats/NatsBuilderExtensions.cs |
Adds [AspireExportIgnore] to existing AddNats overloads, adds AddNatsForPolyglot, and annotates WithJetStream/WithDataVolume/WithDataBindMount with [AspireExport] |
.modules/aspire.ts |
Generated TypeScript SDK exposing NATS and core Aspire capabilities via JSON-RPC |
.modules/base.ts |
Base types (ReferenceExpression, ResourceBuilderBase, AspireList, AspireDict) |
.modules/transport.ts |
ATS transport layer: RPC, handle system, callbacks, cancellation |
apphost.ts |
Minimal TypeScript app host entry point |
package.json |
Node.js package manifest for the validation app host |
tsconfig.json |
TypeScript compiler configuration |
apphost.run.json |
Launch profiles for the validation app host |
.aspire/settings.json |
Aspire polyglot settings linking the TS host to the NATS package |
.modules/.codegen-hash |
Hash tracking generated code state |
Files not reviewed (1)
- playground/polyglot/TypeScript/Aspire.Hosting.Nats/ValidationAppHost/package-lock.json: Language not supported
76 tasks
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Exercise addNats, withJetStream, withDataVolume, withDataBindMount - Test withReference and withServiceReference on consumer container - Add .modules/**/*.d.ts to tsconfig include Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
davidfowl
approved these changes
Mar 4, 2026
Contributor
🎬 CLI E2E Test RecordingsThe following terminal recordings are available for commit
📹 Recordings uploaded automatically from CI run #22648903591 |
Copilot AI
pushed a commit
that referenced
this pull request
Mar 10, 2026
* Add polyglot exports for Aspire.Hosting.Nats Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Refine AspireExport descriptions for polyglot-nats Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update src/Aspire.Hosting.Nats/NatsBuilderExtensions.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update Nats TypeScript validation apphost to exercise all exports - Exercise addNats, withJetStream, withDataVolume, withDataBindMount - Test withReference and withServiceReference on consumer container - Add .modules/**/*.d.ts to tsconfig include Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #14069