near-api-js icon indicating copy to clipboard operation
near-api-js copied to clipboard

chore: Migrate from pnpm/turborepo to bun

Open Copilot opened this issue 4 months ago • 3 comments

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 changeset to create a changeset JSON 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 pnpm engine requirement
  • Added workspaces configuration (replacing pnpm-workspace.yaml)
  • Replaced turbo run commands with bun run --filter='*' in scripts
  • Removed preinstall script that enforced pnpm
  • Removed turbo from devDependencies

CI/CD workflows:

  • Replaced pnpm/action-setup@v4 with oven-sh/setup-bun@v2
  • Removed turbo cache configuration
  • Removed cache: pnpm from Node setup
  • All workflow commands now use bun
  • Split E2E test into separate install and test steps

Husky hooks:

  • Updated commit-msg and pre-push to use bun

Documentation:

  • Updated README.md, TOOLING.md, pull_request_template.md
  • Removed references to pnpm -r compile and --ignore-workspace flags
  • 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
  • .turbo from .gitignore
  • USES_PNPM environment 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.

Copilot avatar Dec 01 '25 17:12 Copilot

🦋 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

changeset-bot[bot] avatar Dec 01 '25 17:12 changeset-bot[bot]

@copilot rebase the PR

r-near avatar Dec 02 '25 19:12 r-near

@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

Copilot avatar Dec 02 '25 19:12 Copilot