From 8d89f5fc05cb6a7499aeb11b887ff3705e35e618 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 28 May 2026 06:03:25 +0000
Subject: [PATCH 1/4] Initial plan
From 48008031c20977cf80fe16c3caa15ff7db7c7e16 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 28 May 2026 06:09:10 +0000
Subject: [PATCH 2/4] Deprecate Bun hosting integration and add migration
guidance
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
---
README.md | 2 +-
.../Program.cs | 4 ++
.../BunAppExtensions.cs | 4 ++
...CommunityToolkit.Aspire.Hosting.Bun.csproj | 4 +-
.../README.md | 40 ++++++++++++++++++-
.../CommunityToolkit.Aspire.Hosting.Bun.cs | 2 +
.../AddBunAppTests.cs | 16 ++++++++
7 files changed, 67 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index ce0170510..c5f35f90d 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@ This repository contains the source code for the Aspire Community Toolkit, a col
| - **Learn More**: [`Hosting.Deno`][deno-integration-docs]
- Stable 📦: [![CommunityToolkit.Aspire.Hosting.Deno][deno-shields]][deno-nuget]
- Preview 📦: [![CommunityToolkit.Aspire.Hosting.Deno][deno-shields-preview]][deno-nuget-preview] | A hosting integration for the Deno apps. |
| - **Learn More**: [`Hosting.SqlDatabaseProjects`][sql-database-projects-integration-docs]
- Stable 📦: [![CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects][sql-database-projects-shields]][sql-database-projects-nuget]
- Preview 📦: [![CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects][sql-database-projects-shields-preview]][sql-database-projects-nuget-preview] | A hosting integration for the SQL Databases Projects. |
| - **Learn More**: [`Hosting.Rust`][rust-integration-docs]
- Stable 📦: [![CommunityToolkit.Aspire.Hosting.Rust][rust-shields]][rust-nuget]
- Preview 📦: [![CommunityToolkit.Aspire.Hosting.Rust][rust-shields-preview]][rust-nuget-preview] | A hosting integration for the Rust apps. |
-| - **Learn More**: [`Hosting.Bun`][bun-integration-docs]
- Stable 📦: [![CommunityToolkit.Aspire.Hosting.Bun][bun-shields]][bun-nuget]
- Preview 📦: [![CommunityToolkit.Aspire.Hosting.Bun][bun-shields-preview]][bun-nuget-preview] | A hosting integration for the Bun apps. |
+| - **Learn More**: [`Hosting.Bun`][bun-integration-docs]
- Stable 📦: [![CommunityToolkit.Aspire.Hosting.Bun][bun-shields]][bun-nuget]
- Preview 📦: [![CommunityToolkit.Aspire.Hosting.Bun][bun-shields-preview]][bun-nuget-preview] | **Deprecated**: use the core `Aspire.Hosting.JavaScript` `AddBunApp(...)` integration. |
| - **Learn More**: [`Hosting.Perl`][perl-integration-docs]
- Stable 📦: [![CommunityToolkit.Aspire.Hosting.Perl][perl-shields]][perl-nuget]
- Preview 📦: [![CommunityToolkit.Aspire.Hosting.Perl][perl-shields-preview]][perl-nuget-preview] | A hosting integration for Perl scripts and APIs. |
| - **Learn More**: [`Hosting.Python.Extensions`][python-ext-integration-docs]
- Stable 📦: [![CommunityToolkit.Aspire.Python.Extensions][python-ext-shields]][python-ext-nuget]
- Preview 📦: [![CommunityToolkit.Aspire.Hosting.Python.Extensions][python-ext-shields-preview]][python-ext-nuget-preview] | An integration that contains some additional extensions for running python applications |
| - **Learn More**: [`Hosting.KurrentDB`][kurrentdb-integration-docs]
- Stable 📦: [![CommunityToolkit.Aspire.Hosting.KurrentDB][kurrentdb-shields]][kurrentdb-nuget]
- Preview 📦: [![CommunityToolkit.Aspire.Hosting.KurrentDB][kurrentdb-shields-preview]][kurrentdb-nuget-preview] | An Aspire hosting integration leveraging the [KurrentDB](https://www.kurrent.io) container. |
diff --git a/examples/bun/CommunityToolkit.Aspire.Hosting.Bun.AppHost/Program.cs b/examples/bun/CommunityToolkit.Aspire.Hosting.Bun.AppHost/Program.cs
index 4003493f6..d8590ee2c 100644
--- a/examples/bun/CommunityToolkit.Aspire.Hosting.Bun.AppHost/Program.cs
+++ b/examples/bun/CommunityToolkit.Aspire.Hosting.Bun.AppHost/Program.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS0618
+
var builder = DistributedApplication.CreateBuilder(args);
var api = builder.AddBunApp("api")
@@ -6,3 +8,5 @@
.WithHttpHealthCheck("/");
builder.Build().Run();
+
+#pragma warning restore CS0618
diff --git a/src/CommunityToolkit.Aspire.Hosting.Bun/BunAppExtensions.cs b/src/CommunityToolkit.Aspire.Hosting.Bun/BunAppExtensions.cs
index e87b4c5c4..43d994dee 100644
--- a/src/CommunityToolkit.Aspire.Hosting.Bun/BunAppExtensions.cs
+++ b/src/CommunityToolkit.Aspire.Hosting.Bun/BunAppExtensions.cs
@@ -11,6 +11,8 @@ namespace Aspire.Hosting;
///
public static class BunAppExtensions
{
+ private const string BunDeprecationMessage = "CommunityToolkit.Aspire.Hosting.Bun is deprecated. Use Aspire.Hosting.JavaScript and builder.AddBunApp(...) instead. This package will be removed in a future release.";
+
///
/// Adds a Bun app to the builder.
///
@@ -21,6 +23,7 @@ public static class BunAppExtensions
/// Whether to watch for changes.
/// A reference to the .
[AspireExport]
+ [Obsolete(BunDeprecationMessage)]
public static IResourceBuilder AddBunApp(
this IDistributedApplicationBuilder builder,
[ResourceName] string name,
@@ -51,6 +54,7 @@ public static IResourceBuilder AddBunApp(
/// A reference to the .
/// This overload is not available in polyglot app hosts. Use instead.
[AspireExportIgnore(Reason = "Action> is not ATS-compatible. Use the overload without configureInstaller instead.")]
+ [Obsolete(BunDeprecationMessage)]
public static IResourceBuilder WithBunPackageInstallation(this IResourceBuilder resource, Action>? configureInstaller = null)
=> WithBunPackageInstallationCore(resource, configureInstaller);
diff --git a/src/CommunityToolkit.Aspire.Hosting.Bun/CommunityToolkit.Aspire.Hosting.Bun.csproj b/src/CommunityToolkit.Aspire.Hosting.Bun/CommunityToolkit.Aspire.Hosting.Bun.csproj
index 771dbd5b9..c2899924f 100644
--- a/src/CommunityToolkit.Aspire.Hosting.Bun/CommunityToolkit.Aspire.Hosting.Bun.csproj
+++ b/src/CommunityToolkit.Aspire.Hosting.Bun/CommunityToolkit.Aspire.Hosting.Bun.csproj
@@ -1,8 +1,8 @@
- hosting bun javascript
- An Aspire integration for hosting Bun apps.
+ hosting bun javascript deprecated
+ An Aspire integration for hosting Bun apps. DEPRECATED: Use Aspire.Hosting.JavaScript and builder.AddBunApp(...) instead. This package will be removed in a future release.
diff --git a/src/CommunityToolkit.Aspire.Hosting.Bun/README.md b/src/CommunityToolkit.Aspire.Hosting.Bun/README.md
index 951b227a2..c4e9d8fb9 100644
--- a/src/CommunityToolkit.Aspire.Hosting.Bun/README.md
+++ b/src/CommunityToolkit.Aspire.Hosting.Bun/README.md
@@ -1,5 +1,15 @@
# CommunityToolkit.Aspire.Hosting.Bun library
+> **⚠️ DEPRECATION NOTICE**
+> This package is deprecated. Bun support is now available in the core `Aspire.Hosting.JavaScript` package via `AddBunApp(...)`.
+>
+> **Migration Guide:**
+> - Install `Aspire.Hosting.JavaScript` and remove `CommunityToolkit.Aspire.Hosting.Bun`.
+> - Keep your existing `builder.AddBunApp(...)` calls, but use the core package implementation.
+> - If you're using TypeScript AppHost bindings, continue using `builder.addBunApp(...)` from the generated core bindings.
+>
+> This package will be removed in a future release. Please migrate to `Aspire.Hosting.JavaScript`.
+
Provides extension methods and resource definitions for an Aspire AppHost to configure a Bun project.
## Getting Started
@@ -17,9 +27,35 @@ dotnet add package CommunityToolkit.Aspire.Hosting.Bun
Then, in the _Program.cs_ file of `AppHost`, define a Bun resource, then call `AddBunApp`:
```csharp
-builder.AddBunApp("bun-server", "main.ts")
+builder.AddBunApp("bun-server", "../bun-server", "main.ts")
+ .WithHttpEndpoint(env: "PORT")
+ .WithExternalHttpEndpoints();
+```
+
+### Migration from Toolkit Bun to core Bun
+
+Toolkit API:
+
+```csharp
+builder.AddBunApp("api", "server.ts")
+ .WithHttpEndpoint(env: "PORT");
+```
+
+Core API (`Aspire.Hosting.JavaScript`):
+
+```csharp
+builder.AddBunApp("api", "./api", "server.ts")
.WithHttpEndpoint(env: "PORT")
- .WithEndpoint();
+ .WithExternalHttpEndpoints();
+```
+
+TypeScript AppHost (core bindings):
+
+```typescript
+await builder
+ .addBunApp("api", "./api", "server.ts")
+ .withHttpEndpoint({ env: "PORT" })
+ .withExternalHttpEndpoints();
```
## Additional Information
diff --git a/src/CommunityToolkit.Aspire.Hosting.Bun/api/CommunityToolkit.Aspire.Hosting.Bun.cs b/src/CommunityToolkit.Aspire.Hosting.Bun/api/CommunityToolkit.Aspire.Hosting.Bun.cs
index fb909edd5..a82273f2e 100644
--- a/src/CommunityToolkit.Aspire.Hosting.Bun/api/CommunityToolkit.Aspire.Hosting.Bun.cs
+++ b/src/CommunityToolkit.Aspire.Hosting.Bun/api/CommunityToolkit.Aspire.Hosting.Bun.cs
@@ -11,9 +11,11 @@ namespace Aspire.Hosting
public static partial class BunAppExtensions
{
[AspireExport("addBunApp", Description = "Adds a Bun app")]
+ [System.Obsolete("CommunityToolkit.Aspire.Hosting.Bun is deprecated. Use Aspire.Hosting.JavaScript and builder.AddBunApp(...) instead. This package will be removed in a future release.")]
public static ApplicationModel.IResourceBuilder AddBunApp(this IDistributedApplicationBuilder builder, string name, string? workingDirectory = null, string entryPoint = "index.ts", bool watch = false) { throw null; }
[AspireExportIgnore(Reason = "Action> is not ATS-compatible. Use the overload without configureInstaller instead.")]
+ [System.Obsolete("CommunityToolkit.Aspire.Hosting.Bun is deprecated. Use Aspire.Hosting.JavaScript and builder.AddBunApp(...) instead. This package will be removed in a future release.")]
public static ApplicationModel.IResourceBuilder WithBunPackageInstallation(this ApplicationModel.IResourceBuilder resource, System.Action>? configureInstaller = null) { throw null; }
}
}
diff --git a/tests/CommunityToolkit.Aspire.Hosting.Bun.Tests/AddBunAppTests.cs b/tests/CommunityToolkit.Aspire.Hosting.Bun.Tests/AddBunAppTests.cs
index b05a8aa52..ce952143e 100644
--- a/tests/CommunityToolkit.Aspire.Hosting.Bun.Tests/AddBunAppTests.cs
+++ b/tests/CommunityToolkit.Aspire.Hosting.Bun.Tests/AddBunAppTests.cs
@@ -3,6 +3,8 @@
namespace CommunityToolkit.Aspire.Hosting.Bun.Tests;
+#pragma warning disable CS0618
+
public class AddBunAppTests
{
[Fact]
@@ -159,4 +161,18 @@ public void BunAppWithPackageInstallationCreatesInstallerResource()
Assert.Equal("bun-bun-install", installerResource.Name);
Assert.Equal("bun", installerResource.Command);
}
+
+ [Fact]
+ public void BunExtensionsAreDeprecated()
+ {
+ var addBunAppMethod = typeof(BunAppExtensions).GetMethod(nameof(BunAppExtensions.AddBunApp), [typeof(IDistributedApplicationBuilder), typeof(string), typeof(string), typeof(string), typeof(bool)]);
+ var withPackageInstallationMethod = typeof(BunAppExtensions).GetMethod(nameof(BunAppExtensions.WithBunPackageInstallation), [typeof(IResourceBuilder), typeof(Action>)]);
+
+ Assert.NotNull(addBunAppMethod);
+ Assert.NotNull(withPackageInstallationMethod);
+ Assert.NotNull(addBunAppMethod.GetCustomAttributes(typeof(ObsoleteAttribute), inherit: false).SingleOrDefault());
+ Assert.NotNull(withPackageInstallationMethod.GetCustomAttributes(typeof(ObsoleteAttribute), inherit: false).SingleOrDefault());
+ }
}
+
+#pragma warning restore CS0618
From b9d3b4a9ff5a3a2b200b4c6bf8d12526f87297f6 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 28 May 2026 06:12:37 +0000
Subject: [PATCH 3/4] Refine Bun README migration examples
Co-authored-by: aaronpowell <434140+aaronpowell@users.noreply.github.com>
---
src/CommunityToolkit.Aspire.Hosting.Bun/README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/CommunityToolkit.Aspire.Hosting.Bun/README.md b/src/CommunityToolkit.Aspire.Hosting.Bun/README.md
index c4e9d8fb9..910837f0c 100644
--- a/src/CommunityToolkit.Aspire.Hosting.Bun/README.md
+++ b/src/CommunityToolkit.Aspire.Hosting.Bun/README.md
@@ -27,9 +27,9 @@ dotnet add package CommunityToolkit.Aspire.Hosting.Bun
Then, in the _Program.cs_ file of `AppHost`, define a Bun resource, then call `AddBunApp`:
```csharp
-builder.AddBunApp("bun-server", "../bun-server", "main.ts")
+builder.AddBunApp("bun-server", "main.ts")
.WithHttpEndpoint(env: "PORT")
- .WithExternalHttpEndpoints();
+ .WithEndpoint();
```
### Migration from Toolkit Bun to core Bun
From ad93ce5aac9ce28025c42b66a020ec2bb3c7e8a7 Mon Sep 17 00:00:00 2001
From: Aaron Powell
Date: Mon, 1 Jun 2026 08:17:44 -0700
Subject: [PATCH 4/4] Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
---
src/CommunityToolkit.Aspire.Hosting.Bun/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/CommunityToolkit.Aspire.Hosting.Bun/README.md b/src/CommunityToolkit.Aspire.Hosting.Bun/README.md
index 910837f0c..d4bb13a9d 100644
--- a/src/CommunityToolkit.Aspire.Hosting.Bun/README.md
+++ b/src/CommunityToolkit.Aspire.Hosting.Bun/README.md
@@ -5,7 +5,7 @@
>
> **Migration Guide:**
> - Install `Aspire.Hosting.JavaScript` and remove `CommunityToolkit.Aspire.Hosting.Bun`.
-> - Keep your existing `builder.AddBunApp(...)` calls, but use the core package implementation.
+> - Review existing `builder.AddBunApp(...)` calls carefully: if you pass arguments positionally, you may need to reorder them or convert them to named arguments when moving to the core package implementation.
> - If you're using TypeScript AppHost bindings, continue using `builder.addBunApp(...)` from the generated core bindings.
>
> This package will be removed in a future release. Please migrate to `Aspire.Hosting.JavaScript`.