-
Notifications
You must be signed in to change notification settings - Fork 770
Add WithBun() support for Vite apps #13733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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?