Add polyglot exports for Aspire.Hosting.DevTunnels#14905
Merged
sebastienros merged 4 commits intorelease/13.2from Mar 4, 2026
Merged
Add polyglot exports for Aspire.Hosting.DevTunnels#14905sebastienros 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 -- 14905Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14905" |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds polyglot (TypeScript/Node.js) exports and a validation AppHost for Aspire.Hosting.DevTunnels, enabling generated SDK bindings to invoke DevTunnels capabilities via AspireExport.
Changes:
- Added
[AspireExport]attributes to DevTunnels extension methods (AddDevTunnel, WithReference overloads, WithAnonymousAccess, GetEndpoint overloads). - Added a TypeScript validation AppHost (tsconfig/package/apphost/run profile and
.aspiresettings). - Added generated TypeScript “.modules” runtime + SDK (transport/base + large generated
aspire.ts) and a codegen hash.
Reviewed changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Aspire.Hosting.DevTunnels/DevTunnelResourceBuilderExtensions.cs | Exposes DevTunnels APIs via AspireExport for polyglot hosts. |
| playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/tsconfig.json | TS compiler configuration for the validation host. |
| playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/package.json | Node/TS dependencies and scripts to run/build the host. |
| playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/apphost.ts | Minimal TypeScript AppHost entry point. |
| playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/apphost.run.json | Local run profile + Aspire endpoints via env vars. |
| playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/.modules/transport.ts | JSON-RPC transport layer used by generated SDK. |
| playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/.modules/base.ts | Core TS helper types (builders, lists/dicts, ref expressions). |
| playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/.modules/aspire.ts | Generated capability-based Aspire SDK incl. DevTunnels exports. |
| playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/.modules/.codegen-hash | Pins the generated module set to a generator hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/.aspire/settings.json | Configures Aspire polyglot tooling for this validation host. |
Files not reviewed (1)
- playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/package-lock.json: Language not supported
playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/.modules/base.ts
Show resolved
Hide resolved
...ground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/.modules/transport.ts
Show resolved
Hide resolved
...ground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/.modules/transport.ts
Show resolved
Hide resolved
76 tasks
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
🎬 CLI E2E Test RecordingsThe following terminal recordings are available for commit
📹 Recordings uploaded automatically from CI run #22648755644 |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
davidfowl
reviewed
Mar 3, 2026
| /// <param name="targetEndpoint">The endpoint to expose via the dev tunnel.</param> | ||
| /// <param name="allowAnonymous">Whether anonymous access is allowed.</param> | ||
| /// <returns>The resource builder.</returns> | ||
| [AspireExport("withReference2", MethodName = "withReference", Description = "Configures the dev tunnel to expose a target endpoint.")] |
Add [AspireExport] or [AspireExportIgnore] attributes to all 11 public extension methods in DevTunnelResourceBuilderExtensions.cs. Exported methods (6): - addDevTunnel: Create dev tunnel resource - withTunnelReference: Expose specific endpoint via tunnel - withTunnelReferenceAnonymous: Expose endpoint with access control - withTunnelReferenceAll: Expose all endpoints on a resource - withAnonymousAccess: Make tunnel anonymously accessible - getTunnelEndpoint: Get public tunnel endpoint for a given endpoint Ignored methods (5) with reasons: - WithReference(DevTunnelPortOptions): Not ATS-compatible - WithReference(EndpointReference, DevTunnelPortOptions): Not ATS-compatible - GetEndpoint<TResource>: Delegates to IResource overload - GetEndpoint(IResource, string): IResource not ATS-mapped - WithReference(targetResource, tunnelResource): Service discovery injection Update TypeScript validation apphost to exercise all exported methods and regenerate SDK. TypeScript compilation (tsc --noEmit) passes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
davidfowl
approved these changes
Mar 4, 2026
Copilot AI
pushed a commit
that referenced
this pull request
Mar 10, 2026
* Add polyglot exports for Aspire.Hosting.DevTunnels Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Refine AspireExport descriptions for polyglot-devtunnels Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Use generated methods in devtunnels apphost Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Complete AspireExport coverage for Aspire.Hosting.DevTunnels Add [AspireExport] or [AspireExportIgnore] attributes to all 11 public extension methods in DevTunnelResourceBuilderExtensions.cs. Exported methods (6): - addDevTunnel: Create dev tunnel resource - withTunnelReference: Expose specific endpoint via tunnel - withTunnelReferenceAnonymous: Expose endpoint with access control - withTunnelReferenceAll: Expose all endpoints on a resource - withAnonymousAccess: Make tunnel anonymously accessible - getTunnelEndpoint: Get public tunnel endpoint for a given endpoint Ignored methods (5) with reasons: - WithReference(DevTunnelPortOptions): Not ATS-compatible - WithReference(EndpointReference, DevTunnelPortOptions): Not ATS-compatible - GetEndpoint<TResource>: Delegates to IResource overload - GetEndpoint(IResource, string): IResource not ATS-mapped - WithReference(targetResource, tunnelResource): Service discovery injection Update TypeScript validation apphost to exercise all exported methods and regenerate SDK. TypeScript compilation (tsc --noEmit) passes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+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