Add WithBun() support for Vite apps#13733
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13733Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 13733" |
There was a problem hiding this comment.
Pull request overview
This PR adds native Bun package manager support for JavaScript/Vite applications in Aspire, enabling developers to use bun install and bun run commands similar to existing npm, Yarn, and pnpm support.
Key Changes:
- Introduces a new
WithBun()extension method for JavaScript app resources that configures Bun as the package manager - Implements Bun-specific behavior: no command separator (
--) when passing script flags, support for bothbun.lockandbun.lockbfiles, and Docker base image override tooven/bun:1 - Adds comprehensive test coverage for Bun installation arguments and command-line behavior
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/Aspire.Hosting.JavaScript/JavaScriptHostingExtensions.cs | Implements WithBun() extension method with Bun-specific configuration including lockfile handling, Docker image override, and install command setup |
| tests/Aspire.Hosting.JavaScript.Tests/PackageInstallationTests.cs | Adds test verifying Bun uses --frozen-lockfile flag in publish mode |
| tests/Aspire.Hosting.JavaScript.Tests/AddViteAppWithPnpmTests.cs | Adds test confirming Bun correctly omits command separator when passing script arguments |
|
@dotnet-policy-service agree |
✅ End-to-End Verification CompleteTested PR locally using dogfood CLI. All scenarios work correctly: Test Results:
Console Logs Evidence:webfrontend-installer: webfrontend: The |
IEvangelist
left a comment
There was a problem hiding this comment.
Looks good to me, we'll
- thank you 🙏
Description
This PR adds native
bunsupport for Vite/JavaScript resources via a newWithBun()extension method, enablingbun installandbun run <script>flows similar to existingWithNpm(),WithYarn(), andWithPnpm()support.Changes
WithBun()forJavaScriptAppResource-based resources.bun run <script> ...).--command separator (bun forwards script flags without it).bun.lock/bun.lockbwhen present)./root/.bun/install/cache).oven/bun:1when not already specified (assuming usinglatestisn't recommended here? Unsure.)Fixes #13686
Checklist
<remarks />and<code />elements on your triple slash comments?