Fix TypeScript codegen options merge and add ExposeProperties to IResourceWithConnectionString resources#14953
Conversation
The RegisterOptionsInterface method used first-write-wins when the same method name appeared on multiple resource types. This caused parameter loss — e.g., WithDataVolumeOptions was missing isReadOnly because RedisInsightResource.WithDataVolume (name only) was registered before RedisResource.WithDataVolume (name + isReadOnly). Now merges all optional parameters across registrations by name, producing a union interface. Also regenerates base.ts (ReferenceExpression handle-mode constructor) across all polyglot playground apps. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds WithDataVolume methods on both TestRedisResource (name + isReadOnly) and TestDatabaseResource (name only) to reproduce the codegen bug where first-write-wins caused parameters to be lost. The test verifies that the generated WithDataVolumeOptions interface contains the union of all parameters. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14953Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14953" |
There was a problem hiding this comment.
Pull request overview
This PR improves Aspire’s TypeScript polyglot experience by fixing an options-interface generation bug (parameter loss when the same method name is exported from multiple resource types), exporting resource properties for IResourceWithConnectionString implementations, and regenerating TypeScript playground validation app hosts to exercise the new surface area.
Changes:
- Fix TypeScript codegen to merge (union) optional parameters for options interfaces registered under the same interface name.
- Add
[AspireExport(ExposeProperties = true)]to multipleIResourceWithConnectionStringresource types and remove export-ignore on selected connection-string expression properties. - Regenerate TypeScript playground validation app hosts and SDK artifacts to validate property
.get()access and updated typings.
Reviewed changes
Copilot reviewed 159 out of 160 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/TestTypes/TestExtensions.cs | Adds test extension overloads to reproduce options-interface merge scenario. |
| tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.ts | Snapshot update showing merged WithDataVolumeOptions and generated methods. |
| tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/AtsGeneratedAspire.verified.ts | Snapshot update showing merged options interface and generated overload usage. |
| tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/AtsTypeScriptCodeGeneratorTests.cs | Adds regression test asserting options-interface merging behavior. |
| src/Aspire.Hosting.Valkey/ValkeyResource.cs | Exposes properties for polyglot via AspireExport(ExposeProperties = true). |
| src/Aspire.Hosting.SqlServer/SqlServerServerResource.cs | Exposes properties for polyglot via AspireExport(ExposeProperties = true). |
| src/Aspire.Hosting.SqlServer/SqlServerDatabaseResource.cs | Exposes properties for polyglot via AspireExport(ExposeProperties = true). |
| src/Aspire.Hosting.Seq/SeqResource.cs | Exposes properties for polyglot via AspireExport(ExposeProperties = true). |
| src/Aspire.Hosting.RabbitMQ/RabbitMQServerResource.cs | Exposes properties for polyglot via AspireExport(ExposeProperties = true). |
| src/Aspire.Hosting.Qdrant/QdrantServerResource.cs | Exposes properties for polyglot via AspireExport(ExposeProperties = true). |
| src/Aspire.Hosting.PostgreSQL/PostgresServerResource.cs | Removes polyglot export-ignore on ConnectionStringExpression. |
| src/Aspire.Hosting.PostgreSQL/PostgresDatabaseResource.cs | Removes polyglot export-ignore on ConnectionStringExpression. |
| src/Aspire.Hosting.Oracle/OracleDatabaseServerResource.cs | Removes polyglot export-ignore on ConnectionStringExpression. |
| src/Aspire.Hosting.Oracle/OracleDatabaseResource.cs | Removes polyglot export-ignore on ConnectionStringExpression. |
| src/Aspire.Hosting.Nats/NatsServerResource.cs | Exposes properties for polyglot via AspireExport(ExposeProperties = true). |
| src/Aspire.Hosting.MySql/MySqlServerResource.cs | Exposes properties for polyglot via AspireExport(ExposeProperties = true). |
| src/Aspire.Hosting.MySql/MySqlDatabaseResource.cs | Exposes properties for polyglot via AspireExport(ExposeProperties = true). |
| src/Aspire.Hosting.MongoDB/MongoDBServerResource.cs | Exposes properties for polyglot via AspireExport(ExposeProperties = true). |
| src/Aspire.Hosting.MongoDB/MongoDBDatabaseResource.cs | Exposes properties for polyglot via AspireExport(ExposeProperties = true). |
| src/Aspire.Hosting.Milvus/MilvusServerResource.cs | Exposes properties for polyglot via AspireExport(ExposeProperties = true). |
| src/Aspire.Hosting.Milvus/MilvusDatabaseResource.cs | Exposes properties for polyglot via AspireExport(ExposeProperties = true). |
| src/Aspire.Hosting.Kafka/KafkaServerResource.cs | Exposes properties for polyglot via AspireExport(ExposeProperties = true). |
| src/Aspire.Hosting.Garnet/GarnetResource.cs | Exposes properties for polyglot via AspireExport(ExposeProperties = true). |
| src/Aspire.Hosting.CodeGeneration.TypeScript/AtsTypeScriptCodeGenerator.cs | Merges optional parameters for options interfaces sharing the same generated name. |
| playground/polyglot/TypeScript/Aspire.Hosting.Yarp/ValidationAppHost/.modules/transport.ts | Updates callback transport behavior in regenerated module assets. |
| playground/polyglot/TypeScript/Aspire.Hosting.Yarp/ValidationAppHost/.modules/base.ts | Updates ReferenceExpression implementation in regenerated module assets. |
| playground/polyglot/TypeScript/Aspire.Hosting.Yarp/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Valkey/ValidationAppHost/apphost.ts | Exercises newly exposed resource properties via .get(). |
| playground/polyglot/TypeScript/Aspire.Hosting.Valkey/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Valkey/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Valkey/ValidationAppHost/.modules/aspire.ts | Regenerated SDK showing exposed properties on ValkeyResource. |
| playground/polyglot/TypeScript/Aspire.Hosting.Valkey/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.SqlServer/ValidationAppHost/apphost.ts | Exercises newly exposed resource properties via .get(). |
| playground/polyglot/TypeScript/Aspire.Hosting.SqlServer/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.SqlServer/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.SqlServer/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Seq/ValidationAppHost/apphost.ts | Exercises newly exposed resource properties via .get(). |
| playground/polyglot/TypeScript/Aspire.Hosting.Seq/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Seq/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Seq/ValidationAppHost/.modules/aspire.ts | Regenerated SDK showing exposed properties on SeqResource. |
| playground/polyglot/TypeScript/Aspire.Hosting.Seq/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Redis/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Redis/ValidationAppHost/.modules/aspire.ts | Regenerated SDK shows updated WithDataVolumeOptions shape. |
| playground/polyglot/TypeScript/Aspire.Hosting.Redis/ValidationAppHost/.aspire/settings.json | Formatting/regen update. |
| playground/polyglot/TypeScript/Aspire.Hosting.RabbitMQ/ValidationAppHost/apphost.ts | Exercises newly exposed resource properties via .get(). |
| playground/polyglot/TypeScript/Aspire.Hosting.RabbitMQ/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.RabbitMQ/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.RabbitMQ/ValidationAppHost/.modules/aspire.ts | Regenerated SDK showing exposed properties on RabbitMQServerResource. |
| playground/polyglot/TypeScript/Aspire.Hosting.RabbitMQ/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Qdrant/ValidationAppHost/apphost.ts | Exercises newly exposed resource properties via .get(). |
| playground/polyglot/TypeScript/Aspire.Hosting.Qdrant/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Qdrant/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Qdrant/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.PostgreSQL/ValidationAppHost/apphost.ts | Exercises connectionStringExpression.get() on Postgres resources. |
| playground/polyglot/TypeScript/Aspire.Hosting.PostgreSQL/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.PostgreSQL/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.PostgreSQL/ValidationAppHost/.modules/aspire.ts | Regenerated SDK includes connection string expression accessors. |
| playground/polyglot/TypeScript/Aspire.Hosting.PostgreSQL/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Oracle/ValidationAppHost/apphost.ts | Exercises connectionStringExpression.get() on Oracle resources. |
| playground/polyglot/TypeScript/Aspire.Hosting.Oracle/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Oracle/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Oracle/ValidationAppHost/.modules/aspire.ts | Regenerated SDK includes connection string expression accessors. |
| playground/polyglot/TypeScript/Aspire.Hosting.Oracle/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.OpenAI/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.OpenAI/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.OpenAI/ValidationAppHost/.modules/aspire.ts | Regenerated SDK updates exported JSDoc descriptions. |
| playground/polyglot/TypeScript/Aspire.Hosting.OpenAI/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Nats/ValidationAppHost/apphost.ts | Exercises newly exposed resource properties via .get(). |
| playground/polyglot/TypeScript/Aspire.Hosting.Nats/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Nats/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Nats/ValidationAppHost/.modules/aspire.ts | Regenerated SDK showing exposed properties on NatsServerResource. |
| playground/polyglot/TypeScript/Aspire.Hosting.Nats/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.MySql/ValidationAppHost/apphost.ts | Exercises newly exposed resource properties via .get(). |
| playground/polyglot/TypeScript/Aspire.Hosting.MySql/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.MySql/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.MySql/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.MongoDB/ValidationAppHost/apphost.ts | Exercises newly exposed resource properties via .get(). |
| playground/polyglot/TypeScript/Aspire.Hosting.MongoDB/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.MongoDB/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.MongoDB/ValidationAppHost/.modules/aspire.ts | Regenerated SDK showing exposed properties on MongoDB resources. |
| playground/polyglot/TypeScript/Aspire.Hosting.MongoDB/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Milvus/ValidationAppHost/apphost.ts | Exercises newly exposed resource properties via .get(). |
| playground/polyglot/TypeScript/Aspire.Hosting.Milvus/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Milvus/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Milvus/ValidationAppHost/.modules/aspire.ts | Regenerated SDK showing exposed properties on Milvus resources. |
| playground/polyglot/TypeScript/Aspire.Hosting.Milvus/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Kafka/ValidationAppHost/apphost.ts | Exercises newly exposed resource properties via .get(). |
| playground/polyglot/TypeScript/Aspire.Hosting.Kafka/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Kafka/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Kafka/ValidationAppHost/.modules/aspire.ts | Regenerated SDK showing exposed properties on KafkaServerResource. |
| playground/polyglot/TypeScript/Aspire.Hosting.Kafka/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.GitHub.Models/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.GitHub.Models/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Garnet/ValidationAppHost/apphost.ts | Exercises newly exposed resource properties via .get(). |
| playground/polyglot/TypeScript/Aspire.Hosting.Garnet/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Garnet/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Garnet/ValidationAppHost/.modules/aspire.ts | Regenerated SDK showing exposed properties on GarnetResource. |
| playground/polyglot/TypeScript/Aspire.Hosting.Garnet/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.DevTunnels/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.WebPubSub/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.WebPubSub/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.WebPubSub/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.Storage/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.Storage/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.Storage/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.Sql/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.Sql/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.Sql/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.SignalR/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.SignalR/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.SignalR/ValidationAppHost/.modules/aspire.ts | Regenerated SDK; includes runAsEmulator doc output. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.SignalR/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.ServiceBus/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.ServiceBus/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.ServiceBus/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.Search/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.Search/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.Search/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.Redis/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.Redis/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.Redis/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.PostgreSQL/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.PostgreSQL/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.PostgreSQL/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.OperationalInsights/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.OperationalInsights/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.OperationalInsights/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.KeyVault/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.KeyVault/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.KeyVault/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.Functions/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.Functions/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.Functions/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.EventHubs/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.EventHubs/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.EventHubs/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.CosmosDB/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.CosmosDB/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.CosmosDB/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.ContainerRegistry/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.ContainerRegistry/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.ContainerRegistry/ValidationAppHost/.modules/aspire.ts | Regenerated SDK updates exported JSDoc descriptions. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.ContainerRegistry/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.CognitiveServices/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.CognitiveServices/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.CognitiveServices/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.ApplicationInsights/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.ApplicationInsights/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.ApplicationInsights/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.AppContainers/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.AppContainers/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.AppContainers/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.AppConfiguration/ValidationAppHost/.modules/transport.ts | Regenerated transport module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.AppConfiguration/ValidationAppHost/.modules/base.ts | Regenerated base module update. |
| playground/polyglot/TypeScript/Aspire.Hosting.Azure.AppConfiguration/ValidationAppHost/.modules/.codegen-hash | Updates regeneration hash. |
...ground/polyglot/TypeScript/Aspire.Hosting.Azure.SignalR/ValidationAppHost/.modules/aspire.ts
Show resolved
Hide resolved
...ground/polyglot/TypeScript/Aspire.Hosting.Azure.SignalR/ValidationAppHost/.modules/aspire.ts
Show resolved
Hide resolved
0210eac to
bb7cd41
Compare
🎬 CLI E2E Test RecordingsThe following terminal recordings are available for commit
📹 Recordings uploaded automatically from CI run #22693093999 |
…nd include ConnectionStringExpression - Add [AspireExport(ExposeProperties = true)] to 15 resource classes (Garnet, Valkey, Kafka, Milvus×2, MongoDB×2, MySql×2, Nats, Qdrant, RabbitMQ, Seq, SqlServer×2) - Remove [AspireExportIgnore] from ConnectionStringExpression on PostgreSQL and Oracle resources (4 files) to include connection strings in polyglot exports - Add [AspireExportIgnore] on Databases dictionaries (non-ATS types) for server resources - Regenerate TypeScript SDKs for all 14 affected integrations - Add connectionStringExpression.get() access in all validation apphost.ts files - All 14 apps pass TypeScript compilation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bb7cd41 to
cfc4f25
Compare
…ourceWithConnectionString resources (microsoft#14953) * Fix TypeScript codegen: merge options interface params across overloads The RegisterOptionsInterface method used first-write-wins when the same method name appeared on multiple resource types. This caused parameter loss — e.g., WithDataVolumeOptions was missing isReadOnly because RedisInsightResource.WithDataVolume (name only) was registered before RedisResource.WithDataVolume (name + isReadOnly). Now merges all optional parameters across registrations by name, producing a union interface. Also regenerates base.ts (ReferenceExpression handle-mode constructor) across all polyglot playground apps. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add test for options interface parameter merging across overloads Adds WithDataVolume methods on both TestRedisResource (name + isReadOnly) and TestDatabaseResource (name only) to reproduce the codegen bug where first-write-wins caused parameters to be lost. The test verifies that the generated WithDataVolumeOptions interface contains the union of all parameters. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add ExposeProperties to all IResourceWithConnectionString resources and include ConnectionStringExpression - Add [AspireExport(ExposeProperties = true)] to 15 resource classes (Garnet, Valkey, Kafka, Milvus×2, MongoDB×2, MySql×2, Nats, Qdrant, RabbitMQ, Seq, SqlServer×2) - Remove [AspireExportIgnore] from ConnectionStringExpression on PostgreSQL and Oracle resources (4 files) to include connection strings in polyglot exports - Add [AspireExportIgnore] on Databases dictionaries (non-ATS types) for server resources - Regenerate TypeScript SDKs for all 14 affected integrations - Add connectionStringExpression.get() access in all validation apphost.ts files - All 14 apps pass TypeScript compilation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ourceWithConnectionString resources (#14953) * Fix TypeScript codegen: merge options interface params across overloads The RegisterOptionsInterface method used first-write-wins when the same method name appeared on multiple resource types. This caused parameter loss — e.g., WithDataVolumeOptions was missing isReadOnly because RedisInsightResource.WithDataVolume (name only) was registered before RedisResource.WithDataVolume (name + isReadOnly). Now merges all optional parameters across registrations by name, producing a union interface. Also regenerates base.ts (ReferenceExpression handle-mode constructor) across all polyglot playground apps. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add test for options interface parameter merging across overloads Adds WithDataVolume methods on both TestRedisResource (name + isReadOnly) and TestDatabaseResource (name only) to reproduce the codegen bug where first-write-wins caused parameters to be lost. The test verifies that the generated WithDataVolumeOptions interface contains the union of all parameters. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add ExposeProperties to all IResourceWithConnectionString resources and include ConnectionStringExpression - Add [AspireExport(ExposeProperties = true)] to 15 resource classes (Garnet, Valkey, Kafka, Milvus×2, MongoDB×2, MySql×2, Nats, Qdrant, RabbitMQ, Seq, SqlServer×2) - Remove [AspireExportIgnore] from ConnectionStringExpression on PostgreSQL and Oracle resources (4 files) to include connection strings in polyglot exports - Add [AspireExportIgnore] on Databases dictionaries (non-ATS types) for server resources - Regenerate TypeScript SDKs for all 14 affected integrations - Add connectionStringExpression.get() access in all validation apphost.ts files - All 14 apps pass TypeScript compilation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Description
This PR improves TypeScript polyglot support by fixing a codegen bug, adding
[AspireExport(ExposeProperties = true)]to all resource classes implementingIResourceWithConnectionString, and regenerating all playground validation apps.Changes
Codegen fix —
RegisterOptionsInterfaceinAtsTypeScriptCodeGenerator.csused first-write-wins when the same options interface name was registered by multiple extension methods on different resource types. This caused parameter loss (e.g.,WithDataVolumeOptionsmissingisReadOnlywhenRedisInsightResource.withDataVolume(name)was registered beforeRedisResource.withDataVolume(name, isReadOnly)). Fixed by merging all optional parameters across registrations by name (union of params).ExposeProperties on IResourceWithConnectionString resources — Added
[AspireExport(ExposeProperties = true)]to 15 resource classes across 12 non-Azure hosting integrations (Garnet, Valkey, Kafka, Milvus×2, MongoDB×2, MySql×2, Nats, Qdrant, RabbitMQ, Seq, SqlServer×2). Removed pre-existing[AspireExportIgnore]fromConnectionStringExpressionon PostgreSQL and Oracle resources so connection strings are accessible from polyglot app hosts.Playground regeneration — Regenerated TypeScript SDKs for all 14 affected integrations. Updated all validation
apphost.tsfiles to exercise property.get()calls includingconnectionStringExpression,primaryEndpoint,host,port,databases, etc. All 14 apps passnpx tsc --noEmit.Test — Added
Generate_SameMethodNameOnDifferentTypes_MergesOptionsInterfacetest covering the codegen fix. All 60 codegen tests pass.Checklist