Skip to content

feat: migrate from npm to bun package manager#766

Merged
DBosley merged 5 commits intomainfrom
feat/npm-to-bun-conversion
Jan 12, 2026
Merged

feat: migrate from npm to bun package manager#766
DBosley merged 5 commits intomainfrom
feat/npm-to-bun-conversion

Conversation

@DBosley
Copy link
Copy Markdown
Contributor

@DBosley DBosley commented Dec 12, 2025

Summary

Migrates the entire repository from npm to bun for package management, improving install speed and consistency.

Core Changes

  • Replace npm install / npm ci with bun install / bun ci
  • Replace npm run with bun run / bunx
  • Replace npx with bunx
  • Update all Dockerfiles to use oven/bun:1.3.4-alpine
  • Add bunfig.toml with supply chain protection (24hr minimum release age)
  • Update CI workflows to use oven-sh/setup-bun@v2
  • Remove stale lockfiles (package-lock.json, cli/package-lock.json, cli/bun.lockb)

Bun Compatibility Fixes

  • Workspace handling: Bun is strict about missing workspace directories. Create dummy package.json files for unavailable workspaces (cli, sui/ts) in Dockerfiles.
  • Frozen lockfile: Use bun ci with dummy workspaces to maintain lockfile integrity and prevent dependency drift.
  • Jest compatibility: Run Jest with Node instead of Bun due to jest-environment-node compatibility issues.

CI Improvements

  • Free disk space before large Docker builds (removes Android SDK ~14GB)

Tilt Test Stability

  • Add init container with health checks for all services (eth-devnet, eth-devnet2, solana-devnet, wormchain, guardian)
  • Use curl-based JSON-RPC health checks instead of simple port probes
  • Configure test RPC endpoints for Kubernetes service DNS names
  • Set CI=true env var for proper test configuration
  • Add cache_from for Docker layer caching
  • Increase Job backoffLimit to 2 for retry resilience

Preserved

  • npm pack commands (required for packaging)
  • npm publish commands (required for registry publishing)
  • npm registry references
  • All dependency versions match main exactly (no version upgrades)

Related PRs

Test plan

  • CI workflows pass (sdk.yml, cli.yml, solana.yml, prettier.yml)
  • Docker builds succeed (Dockerfile.cli, sdk/Dockerfile, solana/Dockerfile)
  • Local bun install && bun run build && bun run test passes
  • Tilt devnet spins up and tests pass

@DBosley DBosley force-pushed the feat/npm-to-bun-conversion branch 4 times, most recently from 072aadd to c70d782 Compare December 12, 2025 02:38
Copy link
Copy Markdown
Contributor

@evan-gray evan-gray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just leaving comments for now as it seems like something is failing in CI

@DBosley DBosley force-pushed the feat/npm-to-bun-conversion branch 9 times, most recently from 83f4409 to ea0fac5 Compare December 16, 2025 17:29
@DBosley DBosley force-pushed the feat/npm-to-bun-conversion branch 2 times, most recently from 17aa623 to 831a1b4 Compare January 9, 2026 21:16
- Replace npm with bun across all Dockerfiles, Makefiles, CI workflows
- Add bunfig.toml with hoisted linker for npm-compatible node_modules
- Add trustedDependencies for native packages with JS fallbacks
- Update GitHub Actions to use oven-sh/setup-bun@v2
- Update documentation and test file comments
- Preserve npm pack and registry publish commands as requested
- Standardize test script naming (test:ci → test in solana)
- Update Anchor.toml to reference correct test script
@DBosley DBosley force-pushed the feat/npm-to-bun-conversion branch from 831a1b4 to b74397d Compare January 9, 2026 21:28
Remove Android SDK (~14GB) to prevent 'no space left on device' errors
when loading cli-local Docker image to local daemon.
dvgui
dvgui previously approved these changes Jan 9, 2026
dvgui
dvgui previously approved these changes Jan 9, 2026
@DBosley DBosley force-pushed the feat/npm-to-bun-conversion branch 2 times, most recently from dbcae88 to 578e422 Compare January 12, 2026 16:43
Instead of stripping workspaces from package.json (which requires
bun install and risks dependency drift), create dummy package.json
files for missing workspace directories. This allows using bun ci
with frozen lockfile, ensuring reproducible builds.
- Run Jest with Node instead of Bun (compatibility issues)
- Run jest from repo root directory
- Add init container with health checks for all services
- Use curl image for proper HTTP POST support in health checks
- Use container port 8545 for eth-devnet2 headless service
- Configure test RPC endpoints for Kubernetes service DNS names
- Set CI=true env var for proper test configuration
@DBosley DBosley force-pushed the feat/npm-to-bun-conversion branch 5 times, most recently from 4c576df to 1349092 Compare January 12, 2026 17:19
evan-gray
evan-gray previously approved these changes Jan 12, 2026
@DBosley DBosley merged commit 5f4667f into main Jan 12, 2026
21 of 22 checks passed
@DBosley DBosley deleted the feat/npm-to-bun-conversion branch January 12, 2026 18:06
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.

4 participants