fix(deps): bump better-sqlite3 to ^12.4.5, add runtime-aware bin wrapper

- Bump better-sqlite3 from ^11 to ^12.4.5 for Node 25 support (prebuilds
  + V8 API compat). Closes #257.
- Add bin/qmd shell wrapper that detects bun vs node install and execs
  with the matching runtime, preventing native module ABI mismatches
  when installed via bun. Closes #319.
This commit is contained in:
Tobi Lutke 2026-03-10 11:43:00 -04:00
parent c68904fe08
commit b252219add
No known key found for this signature in database
2 changed files with 15 additions and 2 deletions

12
bin/qmd Executable file
View File

@ -0,0 +1,12 @@
#!/bin/sh
# Detect the runtime used to install this package and use the matching one
# to avoid native module ABI mismatches (e.g., better-sqlite3 compiled for bun vs node)
DIR="$(cd "$(dirname "$0")/.." && pwd)"
# Check if we were installed with bun (look for bun.lock or bun-lockb)
if [ -f "$DIR/bun.lock" ] || [ -f "$DIR/bun.lockb" ] || [ -n "$BUN_INSTALL" ]; then
exec bun "$DIR/dist/cli/qmd.js" "$@"
else
exec node "$DIR/dist/cli/qmd.js" "$@"
fi

View File

@ -12,9 +12,10 @@
}
},
"bin": {
"qmd": "dist/cli/qmd.js"
"qmd": "bin/qmd"
},
"files": [
"bin/",
"dist/",
"LICENSE",
"CHANGELOG.md"
@ -45,7 +46,7 @@
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.25.1",
"better-sqlite3": "^11.0.0",
"better-sqlite3": "^12.4.5",
"fast-glob": "^3.3.0",
"node-llama-cpp": "^3.17.1",
"picomatch": "^4.0.0",