Fix staging Aspire CLI install command for polyglot apphost.ts support#1496
Fix staging Aspire CLI install command for polyglot apphost.ts support#1496
Conversation
Create TypeScript equivalents of C# AppHost.cs files using the Aspire polyglot apphost SDK for 14 samples. Each file uses the createBuilder pattern with camelCase method names and includes POLYGLOT GAP comments for features not yet available in the TypeScript SDK. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ap analysis Create apphost.ts files for 14 samples, converting C# AppHost.cs to TypeScript polyglot apphost SDK equivalents. Each file uses the Aspire polyglot SDK pattern (createBuilder/build/run) and documents all POLYGLOT GAP items where C# features are not available in the TypeScript SDK. Add comprehensive POLYGLOT_NOTES.md documenting per-sample gap analysis, cross-cutting issues, feature availability matrix, and recommendations. Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
|
Hey @copilot, while you did an okay job - I think you might need to adjust how you approached this problem slightly. When you create the TypeScript |
Address review feedback: each apphost.ts now includes setup comments listing which aspire add commands to run for integration packages. Previously commented-out code (marked as POLYGLOT GAP) is now active code that uses APIs available after running aspire add. Updated POLYGLOT_NOTES.md with per-sample setup instructions and revised feasibility matrix. Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
… fixes Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Updated in 781e1e0 and 8e2710f. Each Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
Related to dotnet/aspire#14069 |
…pphost.ts The stable Aspire CLI (13.1.2 from NuGet) does not include TypeScript polyglot apphost support. The native staging binary from aspire.dev is required to detect and run apphost.ts files. Updated POLYGLOT_NOTES.md to clearly document this, mark all feasibility ratings as expected rather than confirmed, add a validation checklist, and note the container runtime prerequisite. Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
…nfig Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com>
Move each sample's AppHost into isolated cs/ and ts/ subdirectories to enable independent testing of C# and TypeScript AppHosts. For .csproj-based samples (12): - C# AppHost project moved to cs/SampleName.AppHost/ - TypeScript apphost.ts extracted to ts/apphost.ts - Updated .csproj ProjectReferences (../ -> ../../) - Updated AppHost.cs relative paths where needed - Updated .slnx AppHost project paths For file-based samples (container-build, aspire-with-python): - apphost.cs + settings moved to cs/ - apphost.ts moved to ts/ - Updated relative paths (./ -> ../) For standalone-dashboard: - ConsoleApp.cs + settings moved to cs/ Each cs/ and ts/ folder gets its own .aspire/settings.json. Shared service projects remain at the sample root level. Build system globs (**/) automatically discover at new depth. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove bin/, obj/, and .binlog files left from build validation. Add 'Sample Directory Structure' section to README.md explaining the cs/ and ts/ subfolders and how to run each AppHost variant. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Run 'aspire add {integration}' for each ts/ AppHost to generate the
.modules/ TypeScript SDK (aspire.ts, base.ts, transport.ts) and
update .aspire/settings.json with package versions.
Integrations added per sample:
- aspire-shop: postgres, redis
- aspire-with-azure-functions: azure-appcontainers, azure-storage, azure-functions
- aspire-with-javascript: javascript
- aspire-with-node: javascript, redis
- aspire-with-python: javascript, python, redis
- database-containers: postgres, mysql, sqlserver
- database-migrations: sqlserver
- health-checks-ui: redis, docker
- orleans-voting: redis, orleans
- volume-mount: sqlserver, azure-storage
Samples using core APIs only (aspire restore):
- client-apps-integration, container-build, custom-resources, Metrics
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update the init.sql path to reference the canonical source location at ../DatabaseContainers.ApiService/data/sqlserver/init.sql instead of looking for init.sql next to the apphost.ts file. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Deleted all manually-written ts/ directories and recreated them
using 'aspire new aspire-empty --language TypeScript' for proper
scaffolding. Then ran 'aspire add {integration}' for each sample
to generate the .modules/ SDK with correct APIs.
Each apphost.ts is customized to match its C# counterpart with
equivalent resource definitions using the TypeScript SDK.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the repo to support running polyglot TypeScript apphost.ts AppHosts via the staging Aspire CLI, including docs updates and a folder restructure to separate C# vs TypeScript AppHosts.
Changes:
- Document correct staging Aspire CLI install command and add a polyglot AppHost docs link.
- Restructure multiple samples into
cs/andts/AppHost subfolders, updating slnx/csproj paths accordingly. - Add TypeScript AppHost scaffolding files (
apphost.ts,tsconfig.json,package.json, run profiles, and Aspire settings) across samples.
Reviewed changes
Copilot reviewed 97 out of 245 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents new cs/ + ts/ sample structure and how to run each AppHost. |
| samples/POLYGLOT_NOTES.md | Adds staging CLI install instructions, polyglot doc link, and detailed per-sample notes. |
| samples/database-containers/ts/.modules/.codegen-hash | Adds TS SDK codegen hash artifact for the sample. |
| samples/database-containers/ts/.aspire/settings.json | Adds staging channel + SDK version + packages for TS polyglot AppHost. |
| samples/database-containers/cs/DatabaseContainers.AppHost/DatabaseContainers.AppHost.csproj | Fixes relative paths after moving AppHost under cs/. |
| samples/database-containers/cs/DatabaseContainers.AppHost/AppHost.cs | Fixes bind mount paths after moving AppHost under cs/. |
| samples/database-containers/DatabaseContainers.slnx | Updates AppHost project path to cs/ directory. |
| samples/custom-resources/ts/tsconfig.json | Adds TS config for polyglot AppHost compilation. |
| samples/custom-resources/ts/package.json | Adds Node dependencies/scripts for TS AppHost. |
| samples/custom-resources/ts/apphost.ts | Adds TS AppHost entrypoint for the sample. |
| samples/custom-resources/ts/apphost.run.json | Adds run profile settings for TS AppHost. |
| samples/custom-resources/ts/.modules/transport.ts | Adds generated/embedded ATS transport implementation for TS SDK. |
| samples/custom-resources/ts/.modules/base.ts | Adds generated/embedded ATS base types for TS SDK. |
| samples/custom-resources/ts/.aspire/settings.json | Adds staging channel + SDK version for TS AppHost. |
| samples/custom-resources/CustomResources.slnx | Updates AppHost project path to cs/ directory. |
| samples/container-build/ts/tsconfig.json | Adds TS config for polyglot AppHost compilation. |
| samples/container-build/ts/package.json | Adds Node dependencies/scripts for TS AppHost. |
| samples/container-build/ts/apphost.ts | Adds TS AppHost entrypoint for the sample. |
| samples/container-build/ts/apphost.run.json | Adds run profile settings for TS AppHost. |
| samples/container-build/ts/.modules/transport.ts | Adds generated/embedded ATS transport implementation for TS SDK. |
| samples/container-build/ts/.modules/base.ts | Adds generated/embedded ATS base types for TS SDK. |
| samples/container-build/ts/.aspire/settings.json | Adds staging channel + SDK version for TS AppHost. |
| samples/container-build/cs/apphost.cs | Fixes relative paths after moving C# AppHost into cs/. |
| samples/container-build/cs/.aspire/settings.json | Adds C# AppHost path mapping for Aspire tooling under cs/. |
| samples/container-build/.aspire/settings.json | Removes root-level Aspire settings after folder restructure. |
| samples/client-apps-integration/ts/tsconfig.json | Adds TS config for polyglot AppHost compilation. |
| samples/client-apps-integration/ts/package.json | Adds Node dependencies/scripts for TS AppHost. |
| samples/client-apps-integration/ts/apphost.ts | Adds TS AppHost entrypoint for the sample. |
| samples/client-apps-integration/ts/apphost.run.json | Adds run profile settings for TS AppHost. |
| samples/client-apps-integration/ts/.modules/base.ts | Adds generated/embedded ATS base types for TS SDK. |
| samples/client-apps-integration/ts/.aspire/settings.json | Adds staging channel + SDK version for TS AppHost. |
| samples/client-apps-integration/cs/ClientAppsIntegration.AppHost/ClientAppsIntegration.AppHost.csproj | Fixes relative project references after moving AppHost under cs/. |
| samples/client-apps-integration/ClientAppsIntegration.slnx | Updates AppHost project path to cs/ directory. |
| samples/aspire-with-python/ts/tsconfig.json | Adds TS config for polyglot AppHost compilation. |
| samples/aspire-with-python/ts/package.json | Adds Node dependencies/scripts for TS AppHost. |
| samples/aspire-with-python/ts/apphost.ts | Adds TS AppHost entrypoint for the sample. |
| samples/aspire-with-python/ts/apphost.run.json | Adds run profile settings for TS AppHost. |
| samples/aspire-with-python/ts/.modules/base.ts | Adds generated/embedded ATS base types for TS SDK. |
| samples/aspire-with-python/ts/.modules/.codegen-hash | Adds TS SDK codegen hash artifact for the sample. |
| samples/aspire-with-python/ts/.aspire/settings.json | Adds staging channel + SDK version + packages for TS polyglot AppHost. |
| samples/aspire-with-python/cs/apphost.cs | Fixes relative paths after moving C# AppHost into cs/. |
| samples/aspire-with-python/cs/.aspire/settings.json | Adds C# AppHost path mapping for Aspire tooling under cs/. |
| samples/aspire-with-python/.aspire/settings.json | Removes root-level Aspire settings after folder restructure. |
| samples/aspire-with-node/ts/tsconfig.json | Adds TS config for polyglot AppHost compilation. |
| samples/aspire-with-node/ts/package.json | Adds Node dependencies/scripts for TS AppHost. |
| samples/aspire-with-node/ts/apphost.ts | Adds TS AppHost entrypoint for the sample. |
| samples/aspire-with-node/ts/apphost.run.json | Adds run profile settings for TS AppHost. |
| samples/aspire-with-node/ts/.modules/base.ts | Adds generated/embedded ATS base types for TS SDK. |
| samples/aspire-with-node/ts/.modules/.codegen-hash | Adds TS SDK codegen hash artifact for the sample. |
| samples/aspire-with-node/ts/.aspire/settings.json | Adds staging channel + SDK version + packages for TS polyglot AppHost. |
| samples/aspire-with-node/cs/AspireWithNode.AppHost/AspireWithNode.AppHost.csproj | Fixes relative project references after moving AppHost under cs/. |
| samples/aspire-with-node/cs/AspireWithNode.AppHost/AppHost.cs | Fixes relative paths after moving AppHost under cs/. |
| samples/aspire-with-node/AspireWithNode.slnx | Updates AppHost project path to cs/ directory. |
| samples/aspire-with-javascript/ts/tsconfig.json | Adds TS config for polyglot AppHost compilation. |
| samples/aspire-with-javascript/ts/package.json | Adds Node dependencies/scripts for TS AppHost. |
| samples/aspire-with-javascript/ts/apphost.ts | Adds TS AppHost entrypoint for the sample. |
| samples/aspire-with-javascript/ts/apphost.run.json | Adds run profile settings for TS AppHost. |
| samples/aspire-with-javascript/ts/.modules/base.ts | Adds generated/embedded ATS base types for TS SDK. |
| samples/aspire-with-javascript/ts/.modules/.codegen-hash | Adds TS SDK codegen hash artifact for the sample. |
| samples/aspire-with-javascript/ts/.aspire/settings.json | Adds staging channel + SDK version + packages for TS polyglot AppHost. |
| samples/aspire-with-javascript/cs/AspireJavaScript.AppHost/AspireJavaScript.AppHost.csproj | Fixes relative project references after moving AppHost under cs/. |
| samples/aspire-with-javascript/cs/AspireJavaScript.AppHost/AppHost.cs | Fixes relative paths after moving AppHost under cs/. |
| samples/aspire-with-javascript/AspireJavaScript.slnx | Updates AppHost project path to cs/ directory. |
| samples/aspire-with-azure-functions/ts/tsconfig.json | Adds TS config for polyglot AppHost compilation. |
| samples/aspire-with-azure-functions/ts/package.json | Adds Node dependencies/scripts for TS AppHost. |
| samples/aspire-with-azure-functions/ts/apphost.ts | Adds TS AppHost entrypoint for the sample. |
| samples/aspire-with-azure-functions/ts/apphost.run.json | Adds run profile settings for TS AppHost. |
| samples/aspire-with-azure-functions/ts/.modules/base.ts | Adds generated/embedded ATS base types for TS SDK. |
| samples/aspire-with-azure-functions/ts/.modules/.codegen-hash | Adds TS SDK codegen hash artifact for the sample. |
| samples/aspire-with-azure-functions/ts/.aspire/settings.json | Adds staging channel + SDK version + packages for TS polyglot AppHost. |
| samples/aspire-with-azure-functions/cs/ImageGallery.AppHost/ImageGallery.AppHost.csproj | Fixes relative project references after moving AppHost under cs/. |
| samples/aspire-with-azure-functions/ImageGallery.slnx | Updates AppHost project path to cs/ directory. |
| samples/aspire-shop/ts/tsconfig.json | Adds TS config for polyglot AppHost compilation. |
| samples/aspire-shop/ts/package.json | Adds Node dependencies/scripts for TS AppHost. |
| samples/aspire-shop/ts/apphost.ts | Adds TS AppHost entrypoint for the sample. |
| samples/aspire-shop/ts/apphost.run.json | Adds run profile settings for TS AppHost. |
| samples/aspire-shop/ts/.modules/transport.ts | Adds generated/embedded ATS transport implementation for TS SDK. |
| samples/aspire-shop/ts/.modules/base.ts | Adds generated/embedded ATS base types for TS SDK. |
| samples/aspire-shop/ts/.modules/.codegen-hash | Adds TS SDK codegen hash artifact for the sample. |
| samples/aspire-shop/ts/.aspire/settings.json | Adds staging channel + SDK version + packages for TS polyglot AppHost. |
| samples/aspire-shop/cs/AspireShop.AppHost/AspireShop.AppHost.csproj | Fixes relative project references after moving AppHost under cs/. |
| samples/aspire-shop/AspireShop.slnx | Updates AppHost project path to cs/ directory. |
| samples/Metrics/ts/tsconfig.json | Adds TS config for polyglot AppHost compilation. |
| samples/Metrics/ts/package.json | Adds Node dependencies/scripts for TS AppHost. |
| samples/Metrics/ts/apphost.ts | Adds TS AppHost entrypoint for the sample. |
| samples/Metrics/ts/apphost.run.json | Adds run profile settings for TS AppHost. |
| samples/Metrics/ts/.modules/transport.ts | Adds generated/embedded ATS transport implementation for TS SDK. |
| samples/Metrics/ts/.modules/base.ts | Adds generated/embedded ATS base types for TS SDK. |
| samples/Metrics/ts/.aspire/settings.json | Adds staging channel + SDK version for TS AppHost. |
| samples/Metrics/cs/MetricsApp.AppHost/MetricsApp.AppHost.csproj | Fixes relative project references after moving AppHost under cs/. |
| samples/Metrics/cs/MetricsApp.AppHost/AppHost.cs | Fixes bind mount paths after moving AppHost under cs/. |
| samples/Metrics/Metrics.slnx | Updates AppHost project path to cs/ directory. |
Files not reviewed (9)
- samples/Metrics/ts/package-lock.json: Language not supported
- samples/aspire-shop/ts/package-lock.json: Language not supported
- samples/aspire-with-azure-functions/ts/package-lock.json: Language not supported
- samples/aspire-with-javascript/ts/package-lock.json: Language not supported
- samples/aspire-with-node/ts/package-lock.json: Language not supported
- samples/aspire-with-python/ts/package-lock.json: Language not supported
- samples/client-apps-integration/ts/package-lock.json: Language not supported
- samples/container-build/ts/package-lock.json: Language not supported
- samples/custom-resources/ts/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| let ginapp; | ||
|
|
||
| if (builder.executionContext.isPublishMode) { | ||
| ginapp = builder.addDockerfile("ginapp", "../ginapp") | ||
| .withBuildArg("GO_VERSION", goVersion); | ||
| } else { | ||
| ginapp = builder.addDockerfile("ginapp", "../ginapp", { dockerfilePath: "Dockerfile.dev" }) | ||
| .withBuildArg("GO_VERSION", goVersion) | ||
| .withBindMount("../ginapp", "/app"); | ||
| } |
There was a problem hiding this comment.
With "strict": true in tsconfig.json, let ginapp; introduces an implicit any (noImplicitAny) and should fail tsc. Declare a type (or initialize in a way that infers a concrete type) so the file type-checks under strict mode.
| let ginapp; | |
| if (builder.executionContext.isPublishMode) { | |
| ginapp = builder.addDockerfile("ginapp", "../ginapp") | |
| .withBuildArg("GO_VERSION", goVersion); | |
| } else { | |
| ginapp = builder.addDockerfile("ginapp", "../ginapp", { dockerfilePath: "Dockerfile.dev" }) | |
| .withBuildArg("GO_VERSION", goVersion) | |
| .withBindMount("../ginapp", "/app"); | |
| } | |
| const ginapp = builder.executionContext.isPublishMode | |
| ? builder.addDockerfile("ginapp", "../ginapp") | |
| .withBuildArg("GO_VERSION", goVersion) | |
| : builder.addDockerfile("ginapp", "../ginapp", { dockerfilePath: "Dockerfile.dev" }) | |
| .withBuildArg("GO_VERSION", goVersion) | |
| .withBindMount("../ginapp", "/app"); |
- Add await on all resource creation assignments
- Import and use ContainerLifetime.Persistent enum instead of string
- Use withHttpHealthCheck({ path: '...' }) object parameter
- Use withServiceReference for project-to-project references
- Use builder.executionContext.get() pattern for conditional logic
- Match patterns from corrected aspire-shop/ts/apphost.ts
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Each sample's 'Running the app' section now explains that users should cd into cs/ or ts/ before running aspire run, matching the bifurcated AppHost directory structure. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… locks - Updated aspire-shop frontend UI components and styles - Fixed aspire-shop and aspire-with-javascript apphost.ts - Updated package-lock.json for Vue and NodeFrontend Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…sting - container-build: withDeveloperCertificateTrust() requires boolean arg (true) - orleans-voting: Use addCSharpAppWithOptions for withReplicas support, and withOrleansReference instead of withReference for OrleansService All 14 samples tested with aspire run in both cs/ and ts/ directories. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Remove unused Microsoft.Extensions.Hosting import from apphost.cs - Change goversion parameter to secret in apphost.ts Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… aspire module with TlsEnabled support
Bifurcate samples into
cs/andts/AppHost subdirectoriesSummary
Restructures all 14 AppHost samples to isolate the C# and TypeScript polyglot AppHosts into separate
cs/andts/subdirectories. This enables each AppHost to be tested and run independently viaaspire runfrom its respective language folder.What changed
cs/(C# AppHost) andts/(TypeScript AppHost) subdirectories. Shared service projects remain at the sample root.ts/directories were scaffolded usingaspire new aspire-empty --language TypeScript, thenaspire add {integration}was run for each required package. Eachapphost.tsis customized to match its C# counterpart.cs/with updatedProjectReferencepaths (../→../../) and updated bind mount / Dockerfile context paths..slnxfiles updated to reference the newcs/AppHost paths.cd cs/orcd ts/before runningaspire run. Root README updated with the same guidance.POLYGLOT_NOTES.md, stale.aspire/settings.jsonat root, and build artifacts.Sample directory structure
Running a sample
Testing
aspire runin bothcs/andts/— 28/28 pass ✅0 errors, 0 warnings)