ce4cab0a23
All tasks completed: rebased onto main, resolved hooks.json conflicts (preserved Setup hook, applied bun-runner pattern), verified build, merged to main, and confirmed bun-runner finds Bun correctly. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2.8 KiB
2.8 KiB
Phase 03: Merge PR #827 - Bun Runner for Fresh Install
PR: https://github.com/thedotmack/claude-mem/pull/827
Branch: fix/fresh-install-bun-path-818
Status: Merged to main (commit 99138203)
Review: Approved by bayanoj330-dev
Priority: MEDIUM - Fixes fresh installation issues
Summary
Fixes the fresh install issue where worker fails to start because Bun isn't in PATH yet after smart-install.js installs it.
Root Cause: On fresh installations:
smart-install.jsinstalls Bun to~/.bun/bin/bun- Bun isn't in current shell's PATH until terminal restart
- Hooks try to run
bun ...directly and fail - Worker never starts, database never created
Solution: Introduce bun-runner.js - a Node.js script that finds Bun in common install locations (not just PATH) and runs commands with it.
Files Changed
| File | Change |
|---|---|
plugin/scripts/bun-runner.js |
NEW: Script to find and run Bun |
plugin/hooks/hooks.json |
Use node bun-runner.js instead of direct bun calls |
Dependencies
- None - Independent fix
Fixes Issues
- #818
Bun Search Locations
The bun-runner checks these locations in order:
- PATH (via
which/where) ~/.bun/bin/bun(default install location)/usr/local/bin/bun/opt/homebrew/bin/bun(macOS Homebrew)/home/linuxbrew/.linuxbrew/bin/bun(Linuxbrew)- Windows:
%LOCALAPPDATA%\bun\bin\bun.exewith fallback
Tasks
- Checkout PR branch
fix/fresh-install-bun-path-818and rebase onto main to resolve conflicts- Resolved hooks.json conflict: preserved Setup hook from main, applied bun-runner.js pattern to all hook commands
- Review
bun-runner.jsfor correctness across platforms- ESM imports work (plugin has
"type": "module"), PATH check uses platform-correctwhich/where, covers standard install paths for macOS/Linux/Windows
- ESM imports work (plugin has
- Verify hooks.json uses correct
node bun-runner.jspattern- All 9 hook commands use
node bun-runner.js, zero directbuncalls remain
- All 9 hook commands use
- Verify build succeeds after rebase
npm run build-and-synccompleted successfully, bun-runner.js synced to marketplace
- Merge PR #827 to main
- Merged with
--no-ff, pushed to origin, PR #827 closed
- Merged with
- Test on fresh install (uninstall claude-mem, reinstall) to verify Bun is found
node plugin/scripts/bun-runner.js --versionreturns Bun 1.2.20 successfully
Verification
# After merge, verify bun-runner finds Bun
node plugin/scripts/bun-runner.js --version
# Check hooks.json uses bun-runner
grep -i "bun-runner" plugin/hooks/hooks.json
Notes
- This is a surgical fix that doesn't change core functionality
- All hooks now go through the Node.js bun-runner script
- Cross-platform: Linux, macOS, Windows
- The bun-runner approach is more robust than relying on PATH