Skip to content
This repository was archived by the owner on Nov 16, 2026. It is now read-only.
This repository was archived by the owner on Nov 16, 2026. It is now read-only.

Move the build and tests off Bun onto pnpm and Node.js #125

Closed

Description

@sentry-junior

@sentry/api is published for Node (and browser) consumers, but the repo builds and tests it with Bun. Its consumers (toolkit's CLI and MCP) use pnpm and Node. Bun-only tooling means we don't test the package on the runtime people actually run it on, and contributors need a second toolchain.

Raised in review of #122, which stays on Bun so the client move isn't blocked. This issue covers the switch.

Where Bun is used today (on main)

  • Package manager: "packageManager": "[email protected]", bun.lock, @types/bun.
  • Build: build.mjs shells out to bun build for 6 entries (index, valibot, zod, browser, operations, source-analysis).
  • Tests: bun test, with 18 files importing bun:test on main (48 once feat(client): Move the shared API client from toolkit into @sentry/api #122 lands, since it ports toolkit's client tests). test/package.test.ts uses Bun.file and Bun.build. Only test:node (node --test test/node-cancellation.mjs) runs on Node.
  • CI: .github/workflows/build.yml uses oven-sh/setup-bun and runs bun run build, bun run typecheck, bun test, bun run test:node.
  • Docs and generated headers: scripts/generate-*.mjs write "Re-run bun run build" into generated files.

Scope

  • Switch to pnpm (packageManager, pnpm-lock.yaml, drop bun.lock and @types/bun). Use the same pnpm major as toolkit.
  • Replace bun build with a Node bundler (esbuild or tsdown, whichever matches the current output best). Keep the dist/ layout, the externals, and the tree-shaking step (scripts/make-tree-shakeable.mjs) as they are.
  • Move the tests to a Node runner (vitest, like toolkit, or node:test). Replace Bun.file/Bun.build in package.test.ts with Node or bundler APIs. Fold test:node into the main suite.
  • CI: actions/setup-node and pnpm, testing on the package's minimum supported Node (see Align SDK Node support with first-party consumer requirements sentry#131201) and the current LTS.
  • Check that the Release workflow (Craft) still packs and publishes the same artifact.
  • Update AGENTS.md, README.md, and the generated-file headers.

Done when

  • No bun in package.json, CI, or scripts, and bun.lock is gone.
  • pnpm build, pnpm typecheck, and pnpm test pass on Node in CI.
  • npm pack output matches the Bun build's: same entry points and exports, with no new node: imports in the browser entry, checked by the existing browser and package tests.

Related: getsentry/sentry#131201 (Node support floor).

via @BYK.

--

View Session in Sentry

Activity

  1. added a commit that references this issue on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions