Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"node-llama-cpp": "^3.14.5",
"picomatch": "^4.0.0",
"sqlite-vec": "^0.1.7-alpha.2",
"tsx": "^4.0.0",
"yaml": "^2.8.2",
"zod": "^4.2.1"
},
Expand All @@ -54,7 +55,6 @@
},
"devDependencies": {
"@types/better-sqlite3": "^7.6.0",
"tsx": "^4.0.0",
"vitest": "^3.0.0"
},
"peerDependencies": {
Expand Down
11 changes: 10 additions & 1 deletion qmd
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,13 @@ while [[ -L "$SOURCE" ]]; do
done
SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"

exec "$NODE" --import tsx "$SCRIPT_DIR/src/qmd.ts" "$@"
# Resolve tsx from qmd's own node_modules to avoid ESM bare-specifier
# resolution issues (Node resolves from CWD, not from the script location)
TSX_LOADER="$SCRIPT_DIR/node_modules/tsx/dist/esm/index.mjs"
if [[ ! -f "$TSX_LOADER" ]]; then
echo "Error: tsx not found at $TSX_LOADER" >&2
echo "Run: cd $SCRIPT_DIR && npm install" >&2
exit 1
fi

exec "$NODE" --import "$TSX_LOADER" "$SCRIPT_DIR/src/qmd.ts" "$@"