Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(core): add bun as supported package manager#4264

Open
Ch-Valentine wants to merge 7 commits intolerna:mainfrom
Ch-Valentine:feat/add-bun-support
Open

feat(core): add bun as supported package manager#4264
Ch-Valentine wants to merge 7 commits intolerna:mainfrom
Ch-Valentine:feat/add-bun-support

Conversation

@Ch-Valentine
Copy link

Description

Adds Bun as a supported package manager to Lerna, enabling users to leverage Bun's native performance for monorepo management.

Motivation and Context

Bun has gained significant adoption for its speed. This PR enables Lerna to work seamlessly with Bun workspaces alongside npm/yarn/pnpm.

Key Changes:

  • Automatic bun.lockb detection
  • bunx and bun run support
  • Lockfile updates during versioning
  • Full E2E test coverage
  • Comprehensive documentation

How Has This Been Tested?

  • Unit tests added and passing
  • 4 E2E test files created (init, version, run, publish)
  • Format, lint, TypeScript checks passing
  • Integration tests

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the CONTRIBUTING document
  • I have added tests to cover my changes
  • All new and existing tests passed

Add Bun as fourth supported package manager with lockfile detection,
bunx execution, version command support, E2E tests, and documentation.

Implementation verified against Nx v19.5+ Bun support.
Bun v1.2+ changed the default lockfile format from binary bun.lockb
to text-based bun.lock. This fix ensures backward compatibility by
detecting both formats.

Changes:
- Update init command to check for both bun.lockb and bun.lock
- Update version command to update whichever format exists
- Update fixture detection to recognize both formats
- Manual testing confirmed detection works with current Bun v1.3.6

This ensures Lerna works with both legacy Bun installations (bun.lockb)
and current versions (bun.lock).
@Ch-Valentine Ch-Valentine mentioned this pull request Jan 23, 2026
1 task
@Ch-Valentine
Copy link
Author

@JamesHenry Hey! Can you take a look on the PR and review it, please ?

@vcherevatyi-smartling
Copy link

@JamesHenry Hey, any updates regarding this PR ? We'd like to use the bun with the lerna in our company ?

Removed comments regarding version updates and cleanup in the publish-bun.spec.ts test file.
Removed comments about adding a script and Bun's environment variable behavior.
Refactor tests for bun.lockb updates during versioning.
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.

2 participants