Repository navigation
docs: replace removed AddNpmApp in AppHost samples with AddJavaScriptApp - #2015
Merged
Merged
Conversation
AddNpmApp was removed in Aspire 13. Update the certificate configuration, resource model and resource hierarchy samples (English and Japanese), the Japanese what-is-aspire sample and the ThreeTierAspire component, and add a regression test that rejects removed AppHost APIs outside What's new. Co-authored-by: Copilot <[email protected]>
Contributor
Frontend HTML artifact readyThe latest frontend build uploaded the This comment updates automatically when a new frontend build artifact is uploaded. |
David Fowler (davidfowl)
marked this pull request as ready for review
November 1, 2026 09:53
David Fowler (davidfowl)
requested a review
from David Pine (IEvangelist)
as a code owner
November 1, 2026 09:53
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the documentation API updates and accompanying regression test.
No open issues 🎉
What changed in this PR
Updates current AppHost examples on aspire.dev to use AddJavaScriptApp instead of the removed AddNpmApp API, while preserving historical references in What's new pages.
Changes:
- Replaces 16 obsolete API calls across English and Japanese documentation and the three-tier example component.
- Adds the required application directory to both resource-hierarchy examples.
- Adds a regression test that scans documentation and components for removed API calls, excluding What's new pages.
| File | Description |
|---|---|
src/frontend/tests/unit/removed-apphost-apis.vitest.test.ts |
Adds the removed-API regression scan. |
src/frontend/src/content/docs/ja/get-started/what-is-aspire.mdx |
Updates the Japanese introductory example. |
src/frontend/src/content/docs/ja/architecture/resource-model.mdx |
Updates two Japanese resource-model examples. |
src/frontend/src/content/docs/ja/architecture/resource-hierarchies.mdx |
Updates the API and supplies the application directory. |
src/frontend/src/content/docs/ja/app-host/certificate-configuration.mdx |
Updates four Japanese certificate examples. |
src/frontend/src/content/docs/architecture/resource-model.mdx |
Updates two resource-model examples. |
src/frontend/src/content/docs/architecture/resource-hierarchies.mdx |
Updates the API and supplies the application directory. |
src/frontend/src/content/docs/app-host/certificate-configuration.mdx |
Updates four certificate examples. |
src/frontend/src/components/ThreeTierAspire.astro |
Updates the embedded frontend-service example. |
Review effort: Balanced
David Pine (IEvangelist)
enabled auto-merge (squash)
November 1, 2026 14:48
David Pine (IEvangelist)
approved these changes
Nov 1, 2026
David Pine (IEvangelist)
pushed a commit
that referenced
this pull request
Nov 3, 2026
…2004) ## Summary This PR started as a fix for the Japanese [What is Aspire?](https://aspire.dev/ja/get-started/what-is-aspire/) C# AppHost sample, which called `AddNpmApp`. That API was removed in Aspire 13. #2015 has since replaced the line on `main` with `AddJavaScriptApp("frontend", "../frontend")`. After the rebase, this PR keeps `main`'s line and is **test-only**. **Change:** extend the regression test that #1998 added, `tests/unit/get-started-apphost-apis.vitest.test.ts`. - It now scans `get-started/` in every locale, not just English. - It asserts that at least one localized `get-started` directory was included, so the coverage can't silently drop. - It normalizes path separators so the reported paths are stable on Windows. Without this change, a localized sample that calls an API missing from the published `src/data/pkgs` data, like `AddNpmApp`, isn't caught. Maintainers can close this PR if they don't want the extra guard. ## Third-party links and affiliations None. ## Validation - `npx vitest run tests/unit/get-started-apphost-apis.vitest.test.ts` passes on the rebased head. - Negative check: temporarily restoring `AddNpmApp` in `ja/get-started/what-is-aspire.mdx` makes the test fail with that entry. I then reverted the probe. No screenshots, because this PR has no rendered changes. **🤖 Posted by AspireAgent (AI Agent)** --------- Co-authored-by: davidfowl <[email protected]> Co-authored-by: Copilot <[email protected]>
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.
Summary
AddNpmAppwas removed in Aspire 13 and replaced byAddJavaScriptApp(see the Aspire 13 What's new). Several current, non-history AppHost samples still call it, so copying them gives a compile error ('IDistributedApplicationBuilder' does not contain a definition for 'AddNpmApp').This PR updates those samples to
AddJavaScriptApp(name, appDirectory), which matches the currentAspire.Hosting.JavaScriptsignature:app-host/certificate-configuration.mdx(4 samples), plus thejacopyarchitecture/resource-model.mdx(2 samples), plus thejacopyarchitecture/resource-hierarchies.mdx, plus thejacopy. The old callAddNpmApp("web")also omitted the required app directory, so it now readsAddJavaScriptApp("web", "../web").ja/get-started/what-is-aspire.mdxcomponents/ThreeTierAspire.astro(not currently imported anywhere; updated so the regression test can stay strict)What's new pages are left alone because they describe
AddNpmAppas history.Regression test:
tests/unit/removed-apphost-apis.vitest.test.tsscanssrc/content/docsandsrc/components(excludingwhats-new) for calls to removed AppHost APIs.Before / after (
/architecture/resource-model/)Before (live aspire.dev):
After (local dev server):
Third-party links and affiliations
None
Validation
npx vitest run tests/unit/removed-apphost-apis.vitest.test.ts: fails onmainwith 16 offenders and passes with this change.prettier --checkandeslint --max-warnings 0pass on the changed files.astro devand captured it with Playwright (above).🤖 Posted by AspireAgent (AI Agent)