From 881109b955830a00d5bc1c4dfe1e2175801e2450 Mon Sep 17 00:00:00 2001 From: Ray Date: Fri, 20 Feb 2026 10:45:29 -0500 Subject: [PATCH] fix: build dist/ during prepare so git installs work MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `qmd` shim expects `dist/qmd.js` but git installs (`npm install -g https://github.com/tobi/qmd`) don't run the build step, so `dist/` never exists. - Add `tsc` to `prepare` — npm runs this after installing deps (including devDeps) for git-based installs - Move `typescript` from peerDependencies to devDependencies so `tsc` is guaranteed available during `prepare` - `2>/dev/null || true` degrades gracefully when tsc is unavailable (registry installs already ship dist/) Fixes #182 --- package.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 3d8adb7..ed43c7b 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "CHANGELOG.md" ], "scripts": { - "prepare": "[ -d .git ] && ./scripts/install-hooks.sh || true", + "prepare": "[ -d dist ] || tsc -p tsconfig.build.json; [ -d dist ] || { echo 'dist/ missing — run: npm run build' >&2; exit 1; }; [ -d .git ] && ./scripts/install-hooks.sh || true", "build": "tsc -p tsconfig.build.json", "test": "vitest run --reporter=verbose test/", "qmd": "tsx src/qmd.ts", @@ -55,11 +55,9 @@ "devDependencies": { "@types/better-sqlite3": "^7.6.0", "tsx": "^4.0.0", + "typescript": "^5.9.3", "vitest": "^3.0.0" }, - "peerDependencies": { - "typescript": "^5.9.3" - }, "engines": { "node": ">=22.0.0" },