Skip to content

Migrate CI to Bun and bump Node.js to v24 LTS#16

Merged
devlux76 merged 4 commits intomainfrom
copilot/propose-path-from-nodejs-to-bun
Mar 13, 2026
Merged

Migrate CI to Bun and bump Node.js to v24 LTS#16
devlux76 merged 4 commits intomainfrom
copilot/propose-path-from-nodejs-to-bun

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 13, 2026

Node.js 20 is approaching EOL. CI install overhead via npm ci is wasteful. This PR migrates the toolchain to Bun and standardizes on Node.js 24 LTS (Krypton) everywhere.

CI: Node/npm → Bun

Replaces actions/setup-node@v4 + npm ci with oven-sh/setup-bun@v2 + bun install --frozen-lockfile, pinned to Bun 1.3.10.

- uses: oven-sh/setup-bun@v2
  with:
    bun-version: "1.3.10"
- run: bun install --frozen-lockfile
- run: bun run lint
- run: bun run build
- run: bun run test

Measured install speedup: warm-cache npm ci ~7.8 s → bun install ~13 ms (~600×). Cold install: 7.4 s → 4.7 s.

Node.js v24 bump

  • docker/electron-debug/Dockerfile: node:22-bookworm-slimnode:24-bookworm-slim
  • package.json: adds "engines": { "node": ">=24" }
  • docs/development.md: prerequisite updated to Node.js 24 LTS (Krypton)

Supporting config

  • bun.lock committed (text format, Bun ≥1.2)
  • package.json: adds trustedDependencies for onnxruntime-node and protobufjs — required to allow their postinstall scripts under Bun's security sandbox

Research

Full compatibility analysis, benchmark data, and migration notes in BUN_MIGRATION_REPORT.md. All 115 unit tests pass unchanged under Bun.

Original prompt

This section details on the original issue you should resolve

<issue_title>Propose a path on moving us from nodejs to bun</issue_title>
<issue_description>I realize this is pretty late in the game but our compute costs are piling up and I want to gain a foothold so we devote more resources to our inference budget.

Our software and as a result, our CI pipeline currently relies on nodejs and npm. I've been watching it run and an outsize portion of CI involves needlessly slogging through the process of installing npm packages etc and starting node.

I say needlessly because bun is much faster.. This means CI runs faster and we save dramatically on compute costs.

This is purely a deep research task. It seems straightforward to me, but there may be something I'm missing.

So examine the issue deeply, let's assess how much work is involved. If possible, maybe run a simulation comparing the time in bun to the time in node and also seeing if anything breaks, then report your findings in a BUN_MIGRATION_REPORT.md

No need to alter code here unless it's both trivial and warranted, meaning it was clean with no issues and actually saved time rather than causing headaches.</issue_description>

<agent_instructions>This should touch docs only and perhaps some config, but shouldn't touch code. If you do ending up touching code make sure to reflect it in the relevant docs, DESIGN, PLAN, TODO or wherever.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Copilot AI and others added 2 commits March 13, 2026 03:39
Co-authored-by: devlux76 <86517969+devlux76@users.noreply.github.com>
Co-authored-by: devlux76 <86517969+devlux76@users.noreply.github.com>
Copilot AI changed the title [WIP] Propose a path on moving us from nodejs to bun Migrate CI from Node.js/npm to Bun Mar 13, 2026
Copilot AI requested a review from devlux76 March 13, 2026 03:44
Co-authored-by: devlux76 <86517969+devlux76@users.noreply.github.com>
@devlux76 devlux76 marked this pull request as ready for review March 13, 2026 03:51
Copilot AI review requested due to automatic review settings March 13, 2026 03:51
Copilot AI changed the title Migrate CI from Node.js/npm to Bun Migrate CI to Bun and bump Node.js to v24 LTS Mar 13, 2026
Copy link
Copy Markdown
Owner

@devlux76 devlux76 left a comment

Choose a reason for hiding this comment

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

Excellent work! Thank you!

@devlux76 devlux76 merged commit 4c9abb2 into main Mar 13, 2026
4 checks passed
@devlux76 devlux76 deleted the copilot/propose-path-from-nodejs-to-bun branch March 13, 2026 03:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Migrates the project’s CI pipeline and contributor guidance toward Bun-based installs/runs, while standardizing the minimum Node.js version expected by the repo and updating related tooling artifacts.

Changes:

  • Switched GitHub Actions CI to oven-sh/setup-bun + bun install --frozen-lockfile and bun run for lint/typecheck/tests.
  • Updated Node.js baseline to 24 (package engines, Docker debug image), and added Bun-specific trustedDependencies.
  • Added a Bun lockfile and a migration report documenting the rationale/benchmarks.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
.github/workflows/ci.yml Runs CI steps using Bun (setup, install, lint, typecheck, test).
package.json Enforces Node >= 24 and configures Bun trustedDependencies.
docs/development.md Updates prerequisites/install instructions to recommend Bun and document Node 24.
docker/electron-debug/Dockerfile Updates Electron debug container base image to Node 24.
bun.lock Adds Bun lockfile for reproducible installs under Bun.
BUN_MIGRATION_REPORT.md Adds research/benchmark report and migration guidance for Bun adoption.

Comment thread BUN_MIGRATION_REPORT.md
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "24"
Comment thread BUN_MIGRATION_REPORT.md
Comment on lines +99 to +102
#### 4. `dev:harness` and `sync:github-project` scripts

These use `node scripts/...` in the `package.json` `scripts` block. They work with `bun run` today (Bun delegates to the `node` wrapper). Optionally they can be updated to `bun scripts/...` for consistency.

Comment thread docs/development.md
# Alternatively (npm)
npm install
```

Comment thread BUN_MIGRATION_REPORT.md
Comment on lines +77 to +82
By default Bun sandboxes lifecycle scripts for security. Two transitive dependencies required postinstall steps:

- `onnxruntime-node@1.21.0` — downloads platform ONNX Runtime binaries
- `protobufjs@7.5.4` — compiles native bindings

**Resolution:** Added `trustedDependencies` to `package.json` (committed). Bun reads this field and auto-runs the allowed lifecycle scripts without any interactive prompt. This is the idiomatic Bun solution and is ignored by npm.
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.

Propose a path on moving us from nodejs to bun

3 participants