chore: Migrate from pnpm/turborepo to bun
Pre-flight checklist
- [x] I have read the Contributing Guidelines on pull requests.
- [x] Commit messages follow the conventional commits spec
- [ ] If this is a code change: I have written unit tests.
- [ ] If this changes code in a published package: I have run
bun changesetto create achangesetJSON document appropriate for this change. - [x] If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.
Motivation
Migrate build system from pnpm/turborepo to bun for improved performance and simplified tooling. Vitest retained as test runner per requirements. This PR has been rebased onto the latest master which includes the new monorepo structure with packages.
Changes
Package configuration:
-
packageManager:[email protected]→[email protected] - Added
bun: ">=1.0.0"to engines - Removed
pnpmengine requirement - Added
workspacesconfiguration (replacing pnpm-workspace.yaml) - Replaced
turbo runcommands withbun run --filter='*'in scripts - Removed
preinstallscript that enforced pnpm - Removed
turbofrom devDependencies
CI/CD workflows:
- Replaced
pnpm/action-setup@v4withoven-sh/setup-bun@v2 - Removed turbo cache configuration
- Removed
cache: pnpmfrom Node setup - All workflow commands now use
bun - Split E2E test into separate install and test steps
Husky hooks:
- Updated
commit-msgandpre-pushto usebun
Documentation:
- Updated README.md, TOOLING.md, pull_request_template.md
- Removed references to
pnpm -r compileand--ignore-workspaceflags - Updated installation and testing instructions to use bun
Removed:
-
turbo.json- Turborepo configuration -
pnpm-workspace.yaml- pnpm workspaces configuration -
pnpm-lock.yaml- Root lockfile -
e2e/pnpm-lock.yaml- E2E lockfile -
.turbofrom.gitignore -
USES_PNPMenvironment variable from typedoc workflow
Test Plan
CI will verify the migration works correctly when workflows run with bun. The lock file will be generated on first bun install in CI.
Related issues/PRs
- Fixes near/near-api-js#1696
Original prompt
This section details on the original issue you should resolve
<issue_title>Migrate from pnpm/turborepo to bun</issue_title> <issue_description>Migrate the project's build system from pnpm/turborepo to bun for improved performance and simplified tooling.
Acceptance criteria:
- Replace pnpm with bun as package manager
- Remove turborepo configuration
- Update CI/CD workflows</issue_description>
<agent_instructions>Keep vitest for the test runner. Just switch to bun for package installs and CI/CD workflows. Ideally we limit the amount of changes to
package.json's scripts.</agent_instructions>Comments on the Issue (you are @copilot in this section)
- Fixes near/near-api-js#1696
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
🦋 Changeset detected
Latest commit: 79c6441d02da03175b8d9995cd3bbc938f7c7fd9
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| near-api-js | Patch |
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
@copilot rebase the PR
@copilot rebase the PR
Rebased onto the latest master (345de7c3). The PR now includes the migration changes applied to the new monorepo structure with packages/. Commit: 950bb7a