Skip to content

Add tsx devDependency to ts-starter template#14818

Merged
davidfowl merged 1 commit intorelease/13.2from
davidfowl/fix-tsx-dep
Mar 1, 2026
Merged

Add tsx devDependency to ts-starter template#14818
davidfowl merged 1 commit intorelease/13.2from
davidfowl/fix-tsx-dep

Conversation

@davidfowl
Copy link
Copy Markdown
Contributor

Description

The TypeScript starter template (ts-starter) is missing tsx in its devDependencies. When aspire start runs, it executes npx tsx apphost.ts — since tsx is not installed locally, npx prompts for confirmation to install it. In a non-interactive context this prompt never gets answered, causing the CLI to hang indefinitely.

This adds tsx to devDependencies in the template's package.json and adds an E2E test (TypeScriptStarterTemplateTests) that creates and runs a project from the Express/React starter template to catch regressions like this.

Fixes #14815

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

Copilot AI review requested due to automatic review settings March 1, 2026 00:56
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 1, 2026

🚀 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/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14818

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14818"

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a hang in aspire start/aspire run for the TypeScript starter template by ensuring tsx is installed locally, and adds an end-to-end regression test that scaffolds and runs the Express/React TypeScript starter.

Changes:

  • Add tsx to devDependencies for the ts-starter template so npx tsx apphost.ts doesn’t prompt to install interactively.
  • Add a new E2E test that creates a TypeScript starter project via aspire new --language typescript and verifies aspire run starts successfully.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/Aspire.Cli.EndToEnd.Tests/TypeScriptStarterTemplateTests.cs Adds an E2E regression test that scaffolds and runs the TS Express/React starter template.
src/Aspire.Cli/Templating/Templates/ts-starter/package.json Adds tsx to template devDependencies to avoid npx interactive install prompts/hangs.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 1, 2026

🎬 CLI E2E Test Recordings

The following terminal recordings are available for commit 5e11144:

Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View Recording
AddPackageWhileAppHostRunningDetached ▶️ View Recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
AgentInitCommand_WithMalformedMcpJson_ShowsErrorAndExitsNonZero ▶️ View Recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View Recording
Banner_DisplayedOnFirstRun ▶️ View Recording
Banner_DisplayedWithExplicitFlag ▶️ View Recording
CreateAndDeployToDockerCompose ▶️ View Recording
CreateAndDeployToDockerComposeInteractive ▶️ View Recording
CreateAndPublishToKubernetes ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateAndRunTypeScriptStarterProject ▶️ View Recording
CreateEmptyAppHostProject ▶️ View Recording
CreateStartAndStopAspireProject ▶️ View Recording
CreateStartWaitAndStopAspireProject ▶️ View Recording
CreateTypeScriptAppHostWithViteApp ▶️ View Recording
DescribeCommandResolvesReplicaNames ▶️ View Recording
DescribeCommandShowsRunningResources ▶️ View Recording
DetachFormatJsonProducesValidJson ▶️ View Recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View Recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View Recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View Recording
LogsCommandShowsResourceLogs ▶️ View Recording
PsCommandListsRunningAppHost ▶️ View Recording
PsFormatJsonOutputsOnlyJsonToStdout ▶️ View Recording
SecretCrudOnDotNetAppHost ▶️ View Recording
SecretCrudOnTypeScriptAppHost ▶️ View Recording
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View Recording
StopAllAppHostsFromAppHostDirectory ▶️ View Recording
StopAllAppHostsFromUnrelatedDirectory ▶️ View Recording
StopNonInteractiveMultipleAppHostsShowsError ▶️ View Recording
StopNonInteractiveSingleAppHost ▶️ View Recording
StopWithNoRunningAppHostExitsSuccessfully ❌ Upload failed

📹 Recordings uploaded automatically from CI run #22533473193

Without tsx in devDependencies, npx tsx apphost.ts prompts to install it interactively during aspire start, causing the CLI to hang in non-interactive context.

Fixes #14815

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@davidfowl davidfowl merged commit 923619e into release/13.2 Mar 1, 2026
346 checks passed
@davidfowl davidfowl deleted the davidfowl/fix-tsx-dep branch March 1, 2026 07:06
@dotnet-policy-service dotnet-policy-service bot added this to the 13.2 milestone Mar 1, 2026
Copilot AI pushed a commit that referenced this pull request Mar 10, 2026
Without tsx in devDependencies, npx tsx apphost.ts prompts to install it interactively during aspire start, causing the CLI to hang in non-interactive context.

Fixes #14815

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

3 participants