Quellcode durchsuchen

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.
Tobi Lutke vor 2 Monaten
Ursprung
Commit
b252219add
2 geänderte Dateien mit 15 neuen und 2 gelöschten Zeilen
  1. 12 0
      bin/qmd
  2. 3 2
      package.json

+ 12 - 0
bin/qmd

@@ -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

+ 3 - 2
package.json

@@ -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",