Skip to content

Commit e837288

Browse files
sebastienrosCopilot
andcommitted
Update TypeScript AppHost GA docs
Document TypeScript AppHost GA support boundaries, CLI restore/add behavior, and the generated .aspire/.modules SDK path across current docs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e0dacc9 commit e837288

8 files changed

Lines changed: 57 additions & 15 deletions

File tree

src/frontend/config/twoslash.config.mjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,13 @@ export function readAspireTypes() {
8585
*/
8686
export function getTwoslashExtraFiles() {
8787
const { source } = readAspireTypes();
88-
return source ? { '.aspire/modules/aspire.mts': source } : {};
88+
return source
89+
? {
90+
'.aspire/modules/aspire.mts': source,
91+
// Keep historical snippets compiling if they import the old generated path.
92+
'.modules/aspire.ts': source,
93+
}
94+
: {};
8995
}
9096

9197
/**

src/frontend/src/content/docs/app-host/typescript-apphost.mdx

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ The `aspire.config.json` file is the central configuration for your AppHost. It
7575
| `packages` | Hosting integration packages and their versions. Added automatically by `aspire add`. |
7676
| `profiles` | Launch profiles with dashboard URLs and environment variables |
7777

78-
### Adding integrations
78+
### Add and restore integrations
7979

80-
When you run `aspire add`, the CLI adds the package to the `packages` section and regenerates the TypeScript SDK:
80+
Use `aspire add` from the AppHost root to add hosting integrations. The CLI adds the package to the `packages` section, restores AppHost dependencies, and regenerates the TypeScript SDK in `.aspire/modules/`:
8181

8282
```bash title="Add an integration"
8383
aspire add redis
8484
```
8585

86-
This updates `aspire.config.json`:
86+
This updates `aspire.config.json` so the package is restored the next time the AppHost runs:
8787

8888
```json title="aspire.config.json" ins={4}
8989
{
@@ -94,6 +94,12 @@ This updates `aspire.config.json`:
9494
}
9595
```
9696

97+
Run `aspire restore` when you want to regenerate `.aspire/modules/` without starting the AppHost, such as after switching branches, updating package versions, or preparing a CI job:
98+
99+
```bash title="Restore a TypeScript AppHost"
100+
aspire restore
101+
```
102+
97103
### Project references for local development
98104

99105
You can reference a local hosting integration project by using a `.csproj` path instead of a version:
@@ -333,6 +339,18 @@ The `aspire doctor` command checks that the required JavaScript toolchain execut
333339
aspire doctor
334340
```
335341

342+
## Known unsupported scenarios
343+
344+
The following boundaries apply to the TypeScript AppHost root:
345+
346+
| Scenario | Support boundary |
347+
|---|---|
348+
| Node.js versions outside the scaffolded `engines.node` range | Not part of the supported TypeScript AppHost baseline. Use Node.js 20.19+, 22.13+, or 24.x and later. |
349+
| Yarn Classic (v1) | Not supported. Upgrade to Yarn 4 or later, or switch to npm, pnpm, or Bun. |
350+
| Package managers other than npm, pnpm, Yarn 4+, or Bun | Not supported for the AppHost root. Orchestrated apps can still use their own package manager. |
351+
| Editing generated `.aspire/modules/` files | Not supported. Change `aspire.config.json` or use `aspire add`, then regenerate with `aspire restore`. |
352+
| Adding hosting packages with package-manager commands | Not supported for TypeScript AppHost integration restore. Use `aspire add` so `aspire.config.json` and `.aspire/modules/` stay in sync. |
353+
336354
## TypeScript validation before startup
337355

338356
Before starting a TypeScript AppHost, the Aspire CLI runs `tsc --noEmit` to check for type errors to prevent the dashboard and resources from starting in a partially broken state. If your AppHost has TypeScript compile errors, `aspire run` and `aspire publish` stop before the AppHost launches and display the diagnostic output:

src/frontend/src/content/docs/get-started/add-aspire-existing-app.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ Before you begin, make sure you have:
3535
</TabItem>
3636
<TabItem id='typescript' label='TypeScript'>
3737

38-
- [Node.js 22.x or 24.x LTS](https://nodejs.org/)
39-
- npm, yarn, or pnpm
38+
- [Node.js 20.19+, 22.13+, or 24.x and later](https://nodejs.org/)
39+
- A [supported AppHost-root package manager](/app-host/typescript-apphost/#package-managers): npm, pnpm, Yarn 4+, or Bun
4040

4141
</TabItem>
4242
</Tabs>
@@ -107,7 +107,7 @@ Both styles use the same `Aspire.AppHost.Sdk` and the same hosting APIs.
107107
Use a TypeScript AppHost when your repo already centers on a Node.js workspace or when you prefer path-based orchestration in TypeScript.
108108

109109
- Lives in `apphost.mts`; for existing JavaScript and TypeScript apps, `aspire init` creates it under `aspire-apphost/`
110-
- Runs under popular package managers including npm, pnpm, yarn, and Bun
110+
- Runs under supported package managers including npm, pnpm, Yarn 4+, and Bun
111111
- Fits naturally into existing package-manager and monorepo workflows
112112

113113
</TabItem>
@@ -329,7 +329,7 @@ After setup, a typical workspace layout looks like this:
329329
</FileTree>
330330

331331
:::note[The .aspire folder is generated]
332-
Let the Aspire CLI manage `aspire-apphost/.aspire/` rather than editing generated SDK files manually.
332+
Let the Aspire CLI manage `aspire-apphost/.aspire/` rather than editing generated SDK files manually. Run `aspire restore` to regenerate the TypeScript SDK after switching branches or changing AppHost packages.
333333
:::
334334

335335
</TabItem>

src/frontend/src/content/docs/get-started/faq.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ Learn more: [What is the AppHost?](/get-started/app-host/), [Deployment overview
6464

6565
**No.** .NET is an especially strong experience in Aspire, but the app model is broader than one framework or runtime. Aspire is designed to coordinate services across multiple stacks, and the TypeScript AppHost makes it a natural fit for existing JavaScript and TypeScript applications as well.
6666

67-
Learn more: [TypeScript AppHost support](/whats-new/aspire-13-2/#-typescript-apphost-support-preview)
67+
Learn more: [TypeScript AppHost project structure](/app-host/typescript-apphost/)
6868

6969
## Can I write the AppHost in TypeScript?
7070

7171
**Yes.** A TypeScript AppHost (`apphost.mts`) is a first-class option for existing JavaScript and TypeScript applications. That experience uses commands such as `aspire init --language typescript` and AppHost APIs such as `addNodeApp`, `addViteApp`, and `addJavaScriptApp`.
7272

73-
Learn more: [`aspire init`](/reference/cli/commands/aspire-init/), [TypeScript AppHost support](/whats-new/aspire-13-2/#-typescript-apphost-support-preview)
73+
Learn more: [`aspire init`](/reference/cli/commands/aspire-init/), [TypeScript AppHost project structure](/app-host/typescript-apphost/)
7474

7575
## Is Aspire only for brand-new projects?
7676

src/frontend/src/content/docs/ja/get-started/faq.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ Aspire は、実システムで頻出する多くの構成要素に対する統
6363

6464
**いいえ。** .NET は Aspire で特に強力な体験を提供しますが、アプリ モデルは 1 つのフレームワークやランタイムに限定されません。Aspire は複数スタックにまたがるサービス調整を目的に設計されており、TypeScript の AppHost によって既存の JavaScript / TypeScript アプリにも自然に適合します。
6565

66-
詳しくはこちら: [TypeScript AppHost サポート](/ja/whats-new/aspire-13-2/#-typescript-apphost-のサポート-プレビュー)
66+
詳しくはこちら: [TypeScript AppHost サポート](/ja/app-host/typescript-apphost/)
6767

6868
## AppHost を TypeScript で書けますか?
6969

7070
**はい。** TypeScript の AppHost (`apphost.mts`) は、既存の JavaScript / TypeScript アプリケーション向けの第一級オプションです。この体験では、`aspire init --language typescript` のようなコマンドや、`addNodeApp``addViteApp``addJavaScriptApp` のような AppHost API を利用します。
7171

72-
詳しくはこちら: [`aspire init`](/ja/reference/cli/commands/aspire-init/)[TypeScript AppHost サポート](/ja/whats-new/aspire-13-2/#-typescript-apphost-のサポート-プレビュー)
72+
詳しくはこちら: [`aspire init`](/ja/reference/cli/commands/aspire-init/)[TypeScript AppHost サポート](/ja/app-host/typescript-apphost/)
7373

7474
## Aspire は新規プロジェクト専用ですか?
7575

src/frontend/src/content/docs/reference/cli/commands/aspire-add.mdx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ aspire add [<integration>] [options]
2222

2323
## Description
2424

25-
The `aspire add` command searches for an integration package and adds it to the Aspire AppHost.
25+
The `aspire add` command searches for an integration package and adds it to the Aspire AppHost. The persisted change depends on the AppHost style:
26+
27+
- Project-based C# AppHosts receive a package reference.
28+
- File-based C# AppHosts receive a `#:package` directive.
29+
- TypeScript AppHosts receive an entry in the `packages` section of `aspire.config.json`, then the generated `.aspire/modules/` TypeScript SDK is regenerated.
2630

2731
<Include relativePath="reference/cli/includes/project-search-logic-description.md" />
2832

@@ -75,3 +79,9 @@ The following options are available:
7579
```bash title="Aspire CLI"
7680
aspire add kafka --version 13.3.0
7781
```
82+
83+
- Add the **redis** integration to a TypeScript AppHost and regenerate `.aspire/modules/`:
84+
85+
```bash title="Aspire CLI"
86+
aspire add redis --apphost './apphost.mts'
87+
```

src/frontend/src/content/docs/reference/cli/commands/aspire-restore.mdx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ aspire restore [options]
1717

1818
## Description
1919

20-
The `aspire restore` command restores the AppHost project and generates the SDK code that Aspire uses for resources, integrations, and tooling. Use it when you want to make restore an explicit step in automation or validate that the AppHost can restore cleanly without starting it.
20+
The `aspire restore` command restores the AppHost and generates the SDK code that Aspire uses for resources, integrations, and tooling. Use it when you want to make restore an explicit step in automation or validate that the AppHost can restore cleanly without starting it.
21+
22+
For TypeScript AppHosts, restore reads the `packages` section in `aspire.config.json`, restores those hosting integration packages, and regenerates the `.aspire/modules/` TypeScript SDK imported by `apphost.mts`. This is useful after running `aspire add`, switching branches, updating pinned package versions, or restoring dependencies in CI before `aspire run`, `aspire publish`, or deployment workflows.
2123

2224
<Include relativePath="reference/cli/includes/project-search-logic-description.md" />
2325

@@ -55,6 +57,12 @@ The following options are available:
5557
aspire restore --apphost './src/MyApp.AppHost/MyApp.AppHost.csproj'
5658
```
5759

60+
- Restore a specific TypeScript AppHost and regenerate `.aspire/modules/`:
61+
62+
```bash title="Aspire CLI"
63+
aspire restore --apphost './apphost.mts'
64+
```
65+
5866
## See also
5967

6068
- [aspire run](../aspire-run/)

src/frontend/src/content/docs/reference/cli/includes/option-project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ title: Option AppHost
44

55
**`--apphost <apphost>`**
66

7-
The path to the Aspire AppHost project file.
7+
The path to the Aspire AppHost file or project file, such as `apphost.ts`, `apphost.cs`, or an AppHost `.csproj`.

0 commit comments

Comments
 (0)