Skip to content

fix: build dist/ during prepare so git installs work#197

Open
ramonclaudio wants to merge 1 commit intotobi:mainfrom
ramonclaudio:fix/prepare-build-on-install
Open

fix: build dist/ during prepare so git installs work#197
ramonclaudio wants to merge 1 commit intotobi:mainfrom
ramonclaudio:fix/prepare-build-on-install

Conversation

@ramonclaudio
Copy link

@ramonclaudio ramonclaudio commented Feb 16, 2026

Fixes #182

npm install -g https://github.com/tobi/qmd (and bun install -g) fails because git installs skip the build step, so dist/qmd.js doesn't exist when the shim runs.

Only touches package.json:

  • added a prepare script (tsc -p tsconfig.build.json) so dist/ gets built on git installs
  • moved typescript from peerDependencies to devDependencies so tsc is actually there
  • 2>/dev/null || true so registry installs that already ship dist/ don't break

no shim changes, no new runtime deps.

tested a fresh clone with both npm install and bun install. dist/ gets created, ./qmd --version and ./qmd status both work.

note: bun registry installs have a separate issue with bun pm trust — see #198.

patches if you want the fix now:

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 tobi#182
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tsx should be a runtime dependency, not devDependency (breaks npm install -g)

1 participant

Comments