Skip to content

Add TypeScript AppHost example for Squad integration - #1434

Merged
aaronpowell merged 2 commits into
CommunityToolkit:mainfrom
tamirdresher:feat/squad-typescript-apphost
Jul 8, 2026
Merged

Add TypeScript AppHost example for Squad integration#1434
aaronpowell merged 2 commits into
CommunityToolkit:mainfrom
tamirdresher:feat/squad-typescript-apphost

Conversation

@tamirdresher

@tamirdresher tamirdresher commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a TypeScript AppHost example for the Squad hosting integration, following the same pattern as existing integrations (Bun, Deno).

What's included

  • TypeScript AppHost example (examples/squad/CommunityToolkit.Aspire.Hosting.Squad.AppHost.TypeScript/)
    • apphost.mts — TypeScript translation of the C# Squad AppHost (two squads: research + dev)
    • aspire.config.json — Aspire SDK config with local package reference
    • tsconfig.json, eslint.config.mjs, package.json, package-lock.json — Standard TS AppHost boilerplate
  • TypeScript AppHost test (tests/CommunityToolkit.Aspire.Hosting.Squad.Tests/TypeScriptAppHostTests.cs)
    • Uses the shared TypeScriptAppHostTest.Run() helper

Pattern followed

Follows the Bun TypeScript AppHost example pattern exactly:

  • Same directory structure under examples/
  • Same aspire.config.json format with local package reference
  • Same test pattern using TypeScriptAppHostTest

Related

Copilot AI review requested due to automatic review settings June 26, 2026 22:27
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.sh | bash -s -- 1434

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/CommunityToolkit/Aspire/main/eng/scripts/dogfood-pr.ps1) } 1434"

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@tamirdresher

Copy link
Copy Markdown
Contributor Author

@bradygaster TypeScript AppHost example for Squad — shows both research-squad and dev-squad resources running with properties, commands, and lifecycle. Based on #1394.

@jmezach

jmezach commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

@tamirdresher This PR appears to be also adding the whole hosting integration for Squad, which is already on main. Did you forget to rebase your branch perhaps?

Adds a TypeScript-based AppHost example (apphost.mts) demonstrating the
Squad hosting integration alongside the existing C# AppHost example, plus
an end-to-end validation test that runs the example and waits for the
research-squad and dev-squad resources to come up.

Also hardens eng/testing/validate-typescript-apphost.ps1 against a
transient Windows corepack activation crash (STATUS_DLL_INIT_FAILED,
0xC0000142) by wrapping corepack invocations in a small retry helper
(3 attempts, 3s backoff) that rethrows the original error on final failure.

Rebuilt on top of latest upstream/main: the original Squad hosting
integration (PR CommunityToolkit#1394) is already squash-merged upstream, so this branch
now carries only the genuine net-new delta (TS example + test + CI fix).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@tamirdresher
tamirdresher force-pushed the feat/squad-typescript-apphost branch from 51d77d2 to ab2f508 Compare July 6, 2026 07:53
The test waited for the `research-squad` and `dev-squad` resources to reach
status `up` (running), but Squad resources are logical dashboard/resource-graph
entries by design: they transition Configured -> Spawning -> Active -> Finished
and never run a server process, so they never reach a running/up/healthy state.
`aspire wait --status up` therefore always timed out at 180s (exit 17), failing
CI on both Ubuntu and Windows.

Pass an empty waitForResources list so the test validates the meaningful path:
the TypeScript AppHost restores, compiles (tsc --noEmit), starts, and reports its
resources via `aspire describe`.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@tamirdresher

Copy link
Copy Markdown
Contributor Author

Good catch! Thanks. I've rebased onto latest main, so the Squad hosting integration no longer shows in the diff. The PR is now scoped to just the TypeScript AppHost example, its validation script tweak, and one test. Should be clean now, thanks for flagging it!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • examples/squad/CommunityToolkit.Aspire.Hosting.Squad.AppHost.TypeScript/package-lock.json: Generated file

Comment thread eng/testing/validate-typescript-apphost.ps1
@aaronpowell
aaronpowell merged commit 4edc402 into CommunityToolkit:main Jul 8, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants