Repository navigation
Add the config-driven AppHost language foundation - #1634
David Pine (IEvangelist) wants to merge 16 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new languageConfig override in aspire-version-placeholders-integration.mjs is not consistently applied to AppHostTabs Markdown rendering, which can yield incorrect output when the registry is customized.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a config-driven foundation for polyglot AppHost documentation by centralizing the AppHost language registry, using it to drive UI components (tabs/selectors/pivots), and gating documentation/fixtures/tests based on enabled languages.
Changes:
- Introduces
apphost-languages.jsonas the central AppHost language registry and wires new UI components (AppHostTabs, language selector/pivots, evidence). - Gates unpublished/disabled AppHost language project pages at build/load time and removes disabled page-action Markdown copies post-build.
- Adds runtime fixtures (source, terminal casts, dashboard screenshots) plus unit/e2e/contract tests to keep docs + UI synchronized with the registry.
File summaries
| File | Description |
|---|---|
| src/frontend/tests/unit/aspire-version-placeholders.vitest.test.ts | Adds coverage for removing disabled AppHost Markdown copies via language registry. |
| src/frontend/tests/unit/apphost-language-fixtures.vitest.test.ts | Verifies fixtures/casts/images exist and are sanitized for each registry language. |
| src/frontend/tests/unit/apphost-language-docs-loader.vitest.test.ts | Tests registry-driven docs loader gating behavior and store filtering. |
| src/frontend/tests/typecheck/component-props.contracts.ts | Adds prop contract coverage for new AppHost components. |
| src/frontend/tests/fixtures/apphost-languages/typescript/apphost.mts | Adds TypeScript AppHost runtime fixture. |
| src/frontend/tests/fixtures/apphost-languages/service.mjs | Adds shared Node HTTP executable used by language fixtures. |
| src/frontend/tests/fixtures/apphost-languages/scenario.json | Adds scenario metadata for recording/verification workflows. |
| src/frontend/tests/fixtures/apphost-languages/rust/apphost.rs | Adds Rust AppHost runtime fixture (external service fallback). |
| src/frontend/tests/fixtures/apphost-languages/python/apphost.py | Adds Python AppHost runtime fixture. |
| src/frontend/tests/fixtures/apphost-languages/java/AppHost.java | Adds Java AppHost runtime fixture. |
| src/frontend/tests/fixtures/apphost-languages/go/apphost.go | Adds Go AppHost runtime fixture. |
| src/frontend/tests/fixtures/apphost-languages/csharp/apphost.cs | Adds C# AppHost runtime fixture. |
| src/frontend/tests/e2e/pivot-selector.spec.ts | Expands e2e coverage for fallback/unknown language persistence and disabled pivots/media. |
| src/frontend/tests/e2e/integrations-gallery.spec.ts | Updates integrations gallery assertions to reflect registry-driven language links. |
| src/frontend/tests/e2e/homepage.spec.ts | Makes homepage model-story assertions registry-driven; updates expected AppHost filename casing. |
| src/frontend/tests/e2e/custom-components.spec.ts | Updates AppHost builder component tests to be registry-driven and adds keyboard-nav coverage. |
| src/frontend/src/styles/site.css | Adds styling for AppHostTabs limitations and experimental tab badges. |
| src/frontend/src/data/apphost-languages.json | Introduces the central AppHost language registry (enabled/experimental/aliases/etc.). |
| src/frontend/src/content/docs/integrations/overview.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/messaging/lavinmq/lavinmq-connect.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/frameworks/rust/rust-get-started.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/frameworks/powershell/powershell-get-started.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/frameworks/perl/perl-get-started.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/frameworks/nodejs-extensions.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/frameworks/java/java-get-started.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/frameworks/deno/deno-get-started.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/dotnet/blazor-hosting.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/dotnet/blazor-connect.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/devtools/sql-projects/sql-projects-get-started.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/devtools/k6/k6-get-started.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/devtools/flagd/flagd-host.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/devtools/flagd/flagd-connect.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/devtools/browser-logs.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/databases/mysql/mysql-extensions.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/databases/mongodb/mongodb-extensions.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/custom-integrations/secure-communication.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/custom-integrations/hosting-integrations.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/cloud/azure/user-assigned-identity.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/cloud/azure/role-assignments.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/cloud/azure/overview.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/cloud/azure/local-provisioning.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/cloud/azure/azure-log-analytics.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/cloud/azure/azure-front-door.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/cloud/azure/azure-default-credential.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/cloud/azure/azure-container-registry/azure-container-registry-get-started.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/cloud/azure/azure-ai-inference/azure-ai-inference-host.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/caching/redis-output/redis-output-host.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/caching/redis-extensions.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/integrations/caching/redis-distributed/redis-distributed-host.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/get-started/resource-mcp-servers.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/get-started/aspire-mcp-server.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/fundamentals/service-discovery.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/fundamentals/http-commands.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/fundamentals/health-checks.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/fundamentals/container-networking.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/deployment/pipelines.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/deployment/kubernetes-ingress.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/deployment/kubernetes-ingress-aks.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/deployment/kubernetes-gateway-aks.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/deployment/environments.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/deployment/deploy-with-aspire.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/deployment/custom-deployments.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/deployment/azure/azure-developer-cli.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/deployment/app-lifecycle.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/dashboard/enable-browser-telemetry/blazor-webassembly.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/community/contributor-guide.mdx | Updates authoring guidance to use AppHostTabs + registry-driven parity rules. |
| src/frontend/src/content/docs/architecture/resource-hierarchies.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/app-host/with-terminal.mdx | Converts AppHost snippets to AppHostTabs. |
| src/frontend/src/content/docs/app-host/rust-apphost.mdx | Adds Rust AppHost project-structure page (gated by registry). |
| src/frontend/src/content/docs/app-host/python-apphost.mdx | Adds Python AppHost project-structure page (gated by registry). |
| src/frontend/src/content/docs/app-host/java-apphost.mdx | Adds Java AppHost project-structure page (gated by registry). |
| src/frontend/src/content/docs/app-host/hot-reload-and-watch.mdx | Converts AppHost sections to AppHostTabs. |
| src/frontend/src/content/docs/app-host/go-apphost.mdx | Adds Go AppHost project-structure page (gated by registry). |
| src/frontend/src/content/docs/app-host/configuration.mdx | Switches pivot UI to new AppHost language selector/pivot components. |
| src/frontend/src/content.config.ts | Wraps docs loader with registry-gated loader (appHostLanguageDocsLoader). |
| src/frontend/src/components/SimpleAppHostCode.astro | Switches snippet rendering to AppHostTabs. |
| src/frontend/src/components/SampleDetail.astro | Gates sample AppHost pills/code by enabled languages; adds glyph/color support. |
| src/frontend/src/components/SampleCard.astro | Gates sample AppHost pills by enabled languages; adds glyph/color support. |
| src/frontend/src/components/PivotSelector.astro | Updates aspire-lang syncing via apphost-language-select event and registry order/badges. |
| src/frontend/src/components/IntegrationCard.astro | Makes integration language links registry-driven and adds polyglot icons. |
| src/frontend/src/components/AppHostTabs.astro | Adds new registry-driven AppHost tab component with limitation rendering. |
| src/frontend/src/components/AppHostLanguageSelector.astro | Adds registry-driven PivotSelector wrapper for AppHost language selection. |
| src/frontend/src/components/AppHostLanguagePivot.astro | Adds registry-gated Pivot wrapper to hide disabled languages. |
| src/frontend/src/components/AppHostLanguageEvidence.astro | Adds evidence component that embeds casts + dashboard screenshots by language. |
| src/frontend/scripts/record-apphost-language-scenario.sh | Adds Linux recording script to generate verified casts. |
| src/frontend/scripts/playwright-dashboard.config.json | Adds Playwright config for capturing dashboard screenshots. |
| src/frontend/scripts/capture-apphost-language-dashboard.ps1 | Adds PowerShell script to capture dashboard screenshots via playwright-cli. |
| src/frontend/scripts/capture-apphost-language-dashboard-wsl.ps1 | Adds WSL-based PowerShell script to capture dashboard screenshots. |
| src/frontend/public/casts/apphost-typescript.cast | Adds verified TypeScript cast recording. |
| src/frontend/public/casts/apphost-csharp.cast | Adds verified C# cast recording. |
| src/frontend/public/casts/apphost-python.cast | Adds verified Python cast recording. |
| src/frontend/public/casts/apphost-go.cast | Adds verified Go cast recording. |
| src/frontend/public/casts/apphost-java.cast | Adds verified Java cast recording. |
| src/frontend/public/casts/apphost-rust.cast | Adds verified Rust cast recording (external service fallback). |
| src/frontend/eslint.config.mjs | Disables type-checked linting for TypeScript AppHost fixture .mts files. |
| src/frontend/config/sidebar/docs.topics.ts | Makes AppHost project page sidebar entries registry-driven. |
| src/frontend/config/aspire-version-placeholders-integration.mjs | Adds registry-based Markdown copy filtering + AppHostTabs rendering. |
| src/frontend/config/apphost-language-docs-loader.mjs | Adds registry-gated docs loader wrapper for suppressing disabled project pages. |
| .github/agents/community-toolkit-integration-doc-writer.agent.md | Updates agent guidance to use AppHostTabs + registry parity approach. |
| .agents/skills/whatsnew/references/writing-guidelines.md | Updates What’s New writing guidance to use AppHostTabs parity model. |
| .agents/skills/whatsnew/references/whats-new-template.mdx | Updates template guidance to use AppHostTabs. |
| .agents/skills/whatsnew/references/05-polish.md | Updates polish checklist to require AppHostTabs parity/limitations. |
| .agents/skills/whatsnew/references/03-critique.md | Updates critique checklist to require AppHostTabs parity. |
| .agents/skills/whatsnew/references/02-research.md | Updates research guidance to use registry-backed AppHostTabs. |
Review details
Suppressed comments (2)
src/frontend/config/aspire-version-placeholders-integration.mjs:53
- replaceAspireVersionPlaceholdersInDirectory accepts a languageConfig override, but downstream processing uses a module-level default. Set the active config for this invocation before processing the Markdown copies so rendered AppHostTabs reflect the same registry used for gating pages.
src/frontend/config/aspire-version-placeholders-integration.mjs:104 - processMarkdownCopy renders AppHostTabs using the imported default appHostLanguageConfig, which ignores the languageConfig override passed into replaceAspireVersionPlaceholdersInDirectory. This can produce Markdown copies with the wrong set/order of language tabs when the registry is customized.
- Files reviewed: 105/237 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Frontend HTML artifact readyThe latest frontend build uploaded the This comment updates automatically when a new frontend build artifact is uploaded. |
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Document six-language onboarding, architecture, integration authoring, and gated project structures for TypeScript, C#, Python, Go, Java, and Rust. Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
bc1245f to
69e3c6b
Compare
) ## Summary The C# tab of the flagship [What is Aspire?](https://aspire.dev/get-started/what-is-aspire/) AppHost sample calls `builder.AddNpmApp("frontend", "../frontend")`. `AddNpmApp` was removed in Aspire 13 (this repo's own `whats-new/aspire-13.mdx` says: "`AddNpmApp()` - Use `AddJavaScriptApp()` instead … or `AddViteApp()` for Vite projects"), so a reader who copies the sample into a file-based AppHost referencing the current `Aspire.Hosting.JavaScript` gets a compile error. **Fix:** use `AddViteApp("frontend", "../frontend")`, which matches the sibling TypeScript tab (`addViteApp("frontend", "../frontend")`) and the current API: `JavaScriptHostingExtensions.AddViteApp(this IDistributedApplicationBuilder builder, string name, string appDirectory, string runScriptName = "dev")` in `src/data/pkgs/Aspire.Hosting.JavaScript.13.6.0.json`, generated from microsoft/aspire `sourceCommit` `f4c27f2d43ddc1cacd0dd083b30d1fea1cee7a62`. That API data contains no `AddNpmApp` member. **Regression check:** the new `tests/unit/get-started-apphost-apis.vitest.test.ts` reads every C# fence under `get-started/` that contains `DistributedApplication.CreateBuilder`. It asserts that each `builder.AddXxx(` call exists as a member in the generated `src/data/pkgs` API data. - Before the fix: it fails with exactly `["src/content/docs/get-started/what-is-aspire.mdx: AddNpmApp"]`. - After the fix: it passes. **How this was found:** I audited English docs C# samples against the in-repo generated package API data (5,004 member names, 202 packages). Across 1,675 `builder.AddXxx(` calls in AppHost fences (excluding `whats-new`, which is historical), the only call missing from upstream data was `AddNpmApp`. The other misses are tutorial-defined extensions such as `AddMailDev` and `AddMyResource`. `AddNpmApp` also appears in `app-host/certificate-configuration.mdx`, `architecture/resource-hierarchies.mdx` and `architecture/resource-model.mdx`. I deliberately left those files alone because open PRs #1636, #1634 and #1164 touch them, so the new test is scoped to `get-started/`. ### Rendered C# tab, desktop 1280×900, light theme (local dev server) | Before | After | | --- | --- | |  |  | ## Third-party links and affiliations None ## Validation - `npx vitest run tests/unit/get-started-apphost-apis.vitest.test.ts`: fails on `main` (the `AddNpmApp` entry above) and passes with the fix. - `npx vitest run`: 84 files, 1,120 passed, 1 skipped. - `npx eslint . --max-warnings 0`: clean. - `npx prettier --check` on the new test: clean. `what-is-aspire.mdx` already has Prettier warnings on `main`; this change doesn't touch them. - Playwright screenshots of the rendered C# tab before and after, taken from the local `astro dev` server. **🤖 Posted by AspireAgent (AI Agent)** Co-authored-by: davidfowl <[email protected]> Co-authored-by: Copilot <[email protected]>
## Summary The Japanese TypeScript AppHost docs still described the pre-13.4 `apphost.ts` layout, while the English pages use `apphost.mts` and `./.aspire/modules/aspire.mjs`. I found this with a type-check audit of the localized TypeScript AppHost samples, using the same twoslash compiler and `src/data/twoslash/aspire.d.ts` setup as the English audit. - **`ja/architecture/resource-hierarchies.mdx`**: the `EndpointReferenceExpression` TypeScript sample imported `./.modules/aspire.js` under the title `TypeScript — apphost.ts`. - Projects created by current Aspire CLIs generate the SDK in `.aspire/modules/aspire.mjs`, so readers who copy the sample get `Cannot find module './.modules/aspire.js'` (TS2307 in the audit). - The import and title now match the English sample: `./.aspire/modules/aspire.mjs`, `apphost.mts`. - **`ja/architecture/multi-language-architecture.mdx`**: the guest/host description, the Mermaid diagram and the code-generation steps called the guest `apphost.ts` and the SDK folder `.modules/`. They now match the English page: `apphost.mts`, `.aspire/modules/`. Legacy `apphost.ts` / `./.modules/aspire.js` references that remain are intentional. The Aspire 13.4 release notes and the "projects created before 13.4" asides describe that layout for migration. **Regression check:** new `tests/unit/typescript-apphost-sdk-imports.vitest.test.ts`. - It walks TypeScript fences in every locale and fails when a fence imports the generated SDK from any path other than `./.aspire/modules/aspire.mjs`, or when a current-layout fence is titled `apphost.ts`. - Release notes under `whats-new/` are skipped because they intentionally show the layout they migrate from. - A fixture test covers both rules. On `main` it fails: ``` - [] + [ + "ja/architecture/resource-hierarchies.mdx: line 437: ./.modules/aspire.js", + ] ``` After this change it passes. ### Localized audit counts - 14 locale folders, 73 localized pages, 144 TypeScript fences. - 74 fences are `twoslash` blocks, which the build already type-checks. 49 non-twoslash AppHost blocks were compiled (31 full samples and 18 fragments with a `createBuilder` preamble). - 26 diagnostics in 17 blocks on `main`; 25 after this change. The resource-hierarchies block now compiles cleanly. - The remaining diagnostics were left alone. They match the English pages, which have the same samples, and fall into these groups: - `createReferenceExpression`, a known SDK gap. - The tutorial-defined `addMy*` integrations. - Fragments that reference names defined elsewhere on the page. - Argument-shape gaps from the local `.d.ts` options heuristic. - Two release-note items. - `fundamentals/custom-resource-commands.mdx` calls `addNodeApp` with two arguments in both the English and Japanese pages, but the SDK requires `(name, appDirectory, scriptPath)`. I left it out because open PR #1634 rewrites that English page. No open issue or PR touches these Japanese files. ### Screenshots Captured with Playwright on `astro dev`: desktop 1280px, light theme, TypeScript tab. **`/ja/architecture/resource-hierarchies/`, TypeScript sample** | Before | After | | --- | --- | |  |  | **`/ja/architecture/multi-language-architecture/`, guest process diagram** | Before | After | | --- | --- | |  |  | ## Third-party links and affiliations None. ## Validation - `npx vitest run tests/unit/typescript-apphost-sdk-imports.vitest.test.ts`: fails on `main` (output above) and passes with this change. - `npx vitest run`: 85 files, 1122 passed, 1 skipped. - `npx eslint . --max-warnings 0`: clean. The new test is Prettier-formatted. - Localized twoslash audit rerun: the `resource-hierarchies` block no longer reports TS2307. - Rendered output checked in the screenshots above. **🤖 Posted by AspireAgent (AI Agent)** --------- Co-authored-by: davidfowl <[email protected]> Co-authored-by: Copilot <[email protected]>
Summary
This is stack 1/5 of the polyglot AppHost documentation work. It adds:
Python, Go, Java, and Rust remain disabled in this stage. The next PR adds integration parity.
Validation
git diff --check upstream/main...HEADNo local production build was run.