Skip to content

feat: migrate to bun toolchain - #1

Merged
pftg merged 9 commits into
mainfrom
feat/migrate-to-bun
Apr 14, 2026
Merged

feat: migrate to bun toolchain#1
pftg merged 9 commits into
mainfrom
feat/migrate-to-bun

Conversation

@pftg

@pftg pftg commented Apr 14, 2026

Copy link
Copy Markdown
Member

Summary

  • Replace npm with bun as package manager
  • Replace jest/ts-jest with bun test runner
  • Replace @vercel/ncc with bun build --target=node for bundling
  • Drop node-fetch in favor of native fetch (Node 20+)
  • Upgrade all CI workflows to ubuntu-24.04
  • SHA-pin all third-party GitHub Actions
  • Dockerfile: switch from Debian Buster (EOL) to Bookworm, pin bun version
  • Restore codecov with lcov coverage reporter
  • Add integration test job (uses: ./) to validate bundle in GH Actions runtime

Test plan

  • test job: bun test passes on ubuntu/macos/windows
  • test-action job: action installs Hugo latest + 0.139.0, extended + standard, on all 3 platforms
  • Codecov receives coverage data
  • Bundle output (bun build --target=node) runs correctly under node24 runtime

🤖 Generated with Claude Code

pftg and others added 9 commits April 14, 2026 10:46
Node.js 20 actions are deprecated and will be forced to run on
Node.js 24 starting June 2, 2026. Node.js 20 will be removed
from runners on September 16, 2026.

Changes:
- action.yml: using: 'node20' → 'node24'
- lib/index.js: rebuilt with @vercel/ncc for Node 24

See: https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
Upgrade TypeScript 4→5, Jest 26→29, ESLint 7→9 (flat config),
Prettier 2→3, Husky 5→9, lint-staged 10→16, and other dev deps.
Replace archived github/hub with gh CLI in release workflow.
Update all CI workflows from ubuntu-22.04/20.04 to ubuntu-24.04.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace npm with bun as package manager, jest with bun test runner,
and @vercel/ncc with bun build --target=node for bundling.
Drop node-fetch in favor of native fetch (Node 20+).
Remove jest, ts-jest, @types/jest, nock, @vercel/ncc, eslint-plugin-jest.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix fetch mock leak: use beforeEach/afterEach for globalThis.fetch
  save/restore instead of inline restore that breaks on test failure
- Fix INPUT_EXTENDED env leak between tests in afterEach cleanup
- Skip integration tests locally with test.skipIf(!RUNNER_TEMP)
- Pin oven-sh/setup-bun to SHA (supply chain hardening)
- Remove package-lock.json, add to .gitignore (bun.lock is authoritative)
- Restore test coverage with bun test --coverage
- Fix npx -> bunx in lint-staged config
- Add bun installation to Dockerfile (curl + unzip)
- Update Makefile targets from npm to bun
- Add guard for empty latestVersion in get-latest-version.ts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Dockerfile: switch from Debian Buster (EOL) to Bookworm
- Dockerfile: pin bun version, download from GitHub releases
  instead of piping curl-to-bash from bun.sh
- Dockerfile: use apt git instead of compiling git 2.28 from source
- SHA-pin actions/checkout@v4 in test workflow
- Restore codecov upload with lcov coverage reporter
- tsconfig: add noEmit to prevent stray tsc output in lib/
- Add explicit bun:test imports to all test files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Test the action with `uses: ./` across ubuntu/macos/windows
with both latest and pinned Hugo versions, extended and standard.
Validates that bun build output works in the GitHub Actions node24 runtime.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Hugo v0.103.0+ changed release asset naming:
- macOS → darwin, ARM64 → universal
- Windows → windows, 64bit → amd64
- Linux → linux, 64bit → amd64

Add "type": "module" to package.json to eliminate node24
MODULE_TYPELESS_PACKAGE_JSON warning when loading ESM bundle.

Update test fixtures and constants to use Hugo 0.139.0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Hugo v0.153.0+ switched macOS releases from .tar.gz to .pkg format.
Use pkgutil --expand-full to extract the binary on macOS.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Hugo < 0.153.0 uses .tar.gz on macOS, >= 0.153.0 uses .pkg.
Detect format based on version number. Use pkgutil extraction
only when URL ends with .pkg, fall back to tar for older versions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@pftg
pftg changed the base branch from feat/upgrade-dependencies to main April 14, 2026 18:19
@pftg
pftg merged commit 15d62bb into main Apr 14, 2026
24 of 25 checks passed
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.

1 participant