Commit Graph

13 Commits

Author SHA1 Message Date
Tobias Lütke ab38e99fa9 fix(build): spawn tsc without a Windows cmd.exe shell (#681) (#858)
cmd.exe splits unquoted process.execPath at spaces in Program Files, so
prepare could report success with no dist/. spawnSync the binary directly.
2026-08-12 22:43:54 -04:00
Samuel Václav 446c2a653a fix: make prepare script cross-platform so npm install works on Windows
The prepare script used POSIX sh syntax, which fails under npm's
default cmd.exe script shell on Windows and aborts npm install in git
checkouts. Port the hook installer to a Node script.

Fixes #778

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-13 00:00:22 +00:00
dan mackinlay 76d0a111ba fix(cli): stamp the build's commit instead of guessing at runtime (#787)
`showVersion()` ran `git -C <scriptDir> rev-parse --short HEAD`. `git -C`
walks *up*, so any install nested inside another repository reported that
repository's HEAD as qmd's — a global npm install under a git-managed prefix
(Homebrew's /opt/homebrew is itself a checkout) claimed Homebrew's commit.
Identical tarballs reported different "commits" depending only on where they
were installed, so version strings in bug reports stopped being evidence:
build.

A published tarball has no git history of its own, so runtime discovery can
only ever find someone else's. scripts/build.mjs now stamps the commit it
built from into dist/cli/build-info.json — it already post-processes
dist/cli/qmd.js for the shebang, so the seam existed — and the runtime
prefers that stamp. Builds from a modified tree are marked `-dirty`, which
answers "did my install actually take?" directly.

Source checkouts have no stamp, so the git lookup stays as a fallback, with
the guard that was missing: trust the hash only when `git rev-parse
--show-toplevel` is this package's root. Anything else reports no commit
rather than a wrong one. The lookup now uses execFileSync + cwd instead of
interpolating the path into a shell string, so an install path containing a
space no longer silently drops the commit, and `--version` from a build runs
no subprocess at all.

Verified in the issue's own layout — a package copied into an unrelated repo
(HEAD 96b9fc1) with qmd built at e428df7:

  git -C <copy>/dist/cli rev-parse --short HEAD  ->  96b9fc1   (what shipped)
  <copy>/dist/cli/qmd.js --version, unstamped    ->  qmd 2.6.3 (no false hash)
  <copy>/dist/cli/qmd.js --version, stamped      ->  qmd 2.6.3 (e428df7-dirty)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-12 23:55:10 +00:00
Ryan Malia a9f34573b3 fix: bump plugin version on every release so installed plugins receive updates
The Claude Code plugin cache is keyed on the version in
.claude-plugin/marketplace.json, stuck at 0.1.0 since February — so
installed plugins never received skill updates. release.sh now stamps
the plugin version in lockstep with package.json on every release
(with a guard that fails the release if the stamp doesn't land),
plus a one-time catch-up bump 0.1.0 -> 2.6.3 so existing installs pick
up the current skill on their next 'claude plugin update'.

Fixes #789
2026-08-12 23:53:25 +00:00
Tobi Lutke c5f4217a6f fix(cli): exit naturally so node-llama-cpp's beforeExit fires
The libggml-metal static destructor asserts on a non-empty residency-set
collection during __cxa_finalize_ranges, dumping a multi-kB GGML backtrace
after successful output (ggml-org/llama.cpp#22593, one-line fix open as
PR #22595). The assertion only trips when process.exit() skips Node's
beforeExit hook — which is exactly the hook node-llama-cpp registers to
auto-dispose its native handles.

Primary fix: finishSuccessfulCliCommand now sets process.exitCode = 0
and returns instead of calling process.exit(0). The event loop drains,
beforeExit fires, native Metal resources tear down in order, and the
process exits cleanly even without the workaround env var.

Defense-in-depth retained: bin/qmd and scripts/test-all.mjs still export
GGML_METAL_NO_RESIDENCY=1 on darwin for error paths and tests that
terminate via process.exit(). Opt back in with QMD_METAL_KEEP_RESIDENCY=1.

Also: correct upstream issue refs (was #17869 → now #22593/#22595).
Add scripts/repro-metal-rsets-crash.mjs minimal reproduction.
2026-05-28 17:23:31 -07:00
Tobi Lütke e3a9c5d02b Make release script portable 2026-05-19 23:08:30 +00:00
Tobi Lutke 632c34d120 chore: strengthen package test task 2026-05-19 14:27:38 -04:00
Tobi Lütke 3f055e705d Fix AST grammar packaging for Bun installs 2026-05-09 18:13:58 +00:00
Jörg Thalheim 8c4b4b335d sync stale bun.lock, guard against future lockfile drift
bun.lock still resolved better-sqlite3 to 11.x after package.json was
bumped to ^12.4.5 in v2.0.0. This breaks sandboxed builds (e.g. Nix
with bun2nix) where network access is unavailable to resolve the
mismatch.

CI and the publish workflow now use --frozen-lockfile so drift is caught
immediately. The release script also validates lockfile consistency
before tagging.

Closes #386
2026-03-13 13:34:17 +01:00
Tobi Lutke 1781e7bf61 fix: pre-push hook writes to stderr, no interactive prompts
Git hooks can't rely on tty access. Remove all interactive
prompting — just validate and exit non-zero on failure.
2026-02-16 11:53:52 -04:00
Tobi Lutke 63f3b68559 feat: show models in status, improve pre-push hook
- Move model info from --help to `qmd status` with live HuggingFace
  links derived from actual configured URIs
- Pre-push hook: handle non-interactive shells gracefully, resolve
  annotated tags correctly for CI checks
2026-02-16 09:08:28 -04:00
Tobi Lutke 09803a75b7 feat: compile to JS for npm, release system, full changelog
- Add tsc build step (tsconfig.build.json) so npm package ships
  compiled JS instead of raw TypeScript requiring tsx at runtime
- Update qmd wrapper and daemon spawn to use dist/qmd.js in
  production while keeping tsx for development
- Add self-installing pre-push hook validating v* tag pushes:
  package.json version match, changelog entry, CI status
- Add release.sh script that renames [Unreleased] to versioned
  entry, bumps package.json, commits, and tags
- Add extract-changelog.sh for cumulative GitHub release notes
- Update publish workflow with build step and GitHub release creation
- Flesh out CHANGELOG.md with full history from 0.1.0 through 1.0.0
  in Keep-a-Changelog format with PR/contributor attributions
- Add release standards and changelog guidelines to CLAUDE.md
2026-02-16 08:42:32 -04:00
Tobi Lutke 2279389415 chore: set up npm publishing as @tobi/qmd v0.9.0
- Scope package to @tobi/qmd, version 0.9.0
- Add files whitelist, publishConfig, repo metadata
- Add CI workflow (bun tests on ubuntu + macos, bun latest + 1.1.0)
- Add publish workflow (triggers on v* tags, publishes to npm)
- Add release script for version bumping + changelog generation
- Add LICENSE (MIT) and initial CHANGELOG.md
- Update install instructions to use @tobi/qmd
2026-02-15 14:31:23 -04:00