feat(cli): add Bun support for publishing packages#1789
feat(cli): add Bun support for publishing packages#1789shtse8 wants to merge 5 commits intochangesets:mainfrom
Conversation
- Add Bun detection in getPublishTool using package-manager-detector - Use `bun publish` command when Bun is detected as the package manager - Add tests for npm-utils including registry configuration and PM detection Bun automatically resolves workspace:* references during publish, so no additional changes are needed for workspace protocol handling.
🦋 Changeset detectedLatest commit: 2555ffb The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1789 +/- ##
==========================================
+ Coverage 81.10% 83.13% +2.03%
==========================================
Files 54 54
Lines 2265 2271 +6
Branches 683 683
==========================================
+ Hits 1837 1888 +51
+ Misses 423 378 -45
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add comprehensive tests for the publish function that cover: - Bun detection and bun publish command - pnpm detection with version check and --no-git-checks flag - npm detection and fallback behavior - yarn detection (falls back to npm for publishing) - Success and failure scenarios
|
More support is always better, but it'll sting if this gets in before #674 😛 |
Haha yeah, I’ve been reading through #674 as well – that one’s a beast with a ton of history 😅 Totally agree it’d be great to have a more general, “all package managers” solution land. This PR is meant to be a small, incremental win for Bun users in the meantime, but I’d be very happy to align it with whatever direction #674 (or any successor work) takes. If there’s anything I can tweak here to make that easier, I’m all ears. |
Summary
getPublishToolusingpackage-manager-detectorbun publishcommand when Bun is detected as the package managerDetails
When a project uses Bun as its package manager (detected via
bun.lockborpackageManagerfield in package.json), changesets will now usebun publishinstead ofnpm publish.Bun automatically resolves
workspace:*,workspace:^, andworkspace:~references to actual version numbers during publish, so no additional changes are needed for workspace protocol handling.Test plan
getCorrectRegistryfunctionRelated issues
Closes #1080 (Bun support request)