fix(setup): bare root npm install produces a buildable tree on Node 24#240
Merged
Conversation
…Node 24
Three related install/setup fixes so `npm install` at the repo root "just
works" on a fresh clone — the trigger was `npm run build` failing to resolve
"@fontsource/inter/latin-400.css".
1. Client deps on root install. The client's fonts (@fontsource/*) and build
toolchain live in client/package.json, which a plain root `npm install`
never installed. Add a root `postinstall` hook (scripts/postinstall.js) that
installs them. It is a guarded no-op when client/ is absent, so the
multi-stage Dockerfiles (root server-deps stage, mcp `file:..` link) and the
published tarball still install cleanly; it uses shell:true so npm's Windows
.cmd shim resolves. Skipped under --ignore-scripts.
2. better-sqlite3 ^11 -> ^12. 11.x ships no prebuilt binary for Node 24, so on
Node 24 it falls back to a source build that needs the MSVC C++ toolchain
and fails; the optional dep is then skipped. 12.x has Node 24 prebuilds and
installs with no compiler. Bump engines to node >=20 (better-sqlite3 12's
floor; the node:sqlite fallback already needs 22+). The app still runs on
the node:sqlite fallback when the native driver is absent.
3. Two Windows-only path-semantics test failures (green on macOS/Linux, so
never seen there; identical behavior on POSIX after the fix):
- scripts/import-history.js classifyJsonl split on path.sep ("\\" on
Windows) turned a POSIX "/a/b/subagents/x.jsonl" path into one segment
that never equals "subagents", misclassifying subagents as sessions. Split
on both separators instead.
- server/routes/hooks.js livenessReap used the platform-sensitive
path.isAbsolute; the tests mock the probe to run this reaper on Windows,
where "D:\..." reads as absolute and wrongly reaps a forwarded remote
session. Use path.posix.isAbsolute to match the documented intent.
Docs: sync the Node floor (18 -> 20) and the client-install note across
README (+VN/CN/KO), INSTALL, SETUP, ARCHITECTURE, server/client READMEs,
docs/*, the landing page, and the wiki (badges + cache bump).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
The root `postinstall` hook added in this PR (`node scripts/postinstall.js`) fires during `npm ci` in the `server-deps` stage, but that stage copied only the root manifest. npm aborted with `Cannot find module '/app/scripts/postinstall.js'` (MODULE_NOT_FOUND) before installing anything, failing the "🐳 Docker → GHCR" job. Copy `scripts/postinstall.js` before `npm ci` so npm can load it; the script already self-skips when `client/` is absent (as it is in this stage). Copy just the one file, not the whole `scripts/` dir, to keep the deps-cache layer from busting on unrelated script edits. Not using `--ignore-scripts`: that would also skip better-sqlite3's prebuild fetch and silently drop the native SQLite driver. Verified: full `docker build` succeeds (BUILD_EXIT=0); postinstall runs and logs the no-op skip; better-sqlite3's prebuild-install still runs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ping it to Waiting Claude Code fires SessionStart with source ∈ startup|resume|clear|compact. The handler stamped `awaiting_input_since = session_start` on every source, but `compact` fires MID-TURN when auto-compaction kicks in while Claude is actively working — the session is not sitting at a prompt. So a genuinely-active session was mislabeled Waiting the moment a compaction (or the dashboard first seeing that event on startup) landed. Guard the awaiting-stamp and the waiting→working promotion behind `source !== 'compact'`. For a compact SessionStart the pre-compaction state is now preserved verbatim: - mid-turn (working, no flag) → stays Active - idle at the prompt (flag from prior Stop) → stays Waiting, reason not clobbered startup/resume/clear are unchanged — they still land the session in Waiting. Adds two regression tests (working-through-compact stays Active; idle-through- compact preserves the Waiting flag and its reason). Syncs the session lifecycle state machines and the awaiting_* column docs. All 668 server tests pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Propagates the "mid-turn compaction keeps the session Active (not Waiting)" behavior from the hooks.js fix across every doc that models it: - Session state machine (mermaid) — add `active --> active: SessionStart compact (state preserved)` and scope the init transition to startup/resume/clear, in README.md + VN/CN/KO, wiki/index.html. (server/README.md + docs/DATABASE.md were done in the fix commit.) - Hook Events table — the SessionStart row in README.md + VN/CN/KO and wiki/index.html now notes the `compact` exception. The wiki row is i18n-keyed, so the zh/vi/ko entries in wiki/i18n-content.js are updated in lock-step (key + value); jsdom verify confirms all three still resolve. - docs/HOOKS.md SessionStart section: document the four `source` values and the compact carve-out for the awaiting flag. - ARCHITECTURE.md routes/hooks.js row: awaiting overlay is stamped on startup/resume/clear only. Wiki caches bumped (CACHE_NAME wiki-v42→v43, i18n-content.js?v=32→33). Verified: doc-coverage(compact) HITs every mapped doc; no stray Node 18 / better-sqlite3 11 remain in the maintained surface (MCP stays 18.18 by design); header audit clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Minor bump for this change-set: the Node 18→20 engine drop and better-sqlite3 11→12 upgrade are compatibility-affecting for downstream/local installs, plus the Docker-build and compact→Active hook fixes. Landing this version on master (via this PR) is what cuts the v1.4.0 GitHub Release and rebuilds the macOS DMGs and Windows EXEs — the CI release job publishes vX.Y.Z from the root package.json version when no release exists for it yet. Bumps root package.json + package-lock.json and desktop/package.json + desktop/package-lock.json (the desktop app version labels the DMG/EXE artifacts). client, mcp, and vscode-extension version independently and are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…stalls-client # Conflicts: # wiki/sw.js
The test file merged from master (#238) shipped without the mandated `@author` header line. Add it so the repo-wide header audit (.claude/skills/file-headers/scripts/check-headers.sh) exits 0 again. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A fresh clone +
npm run buildfailed to resolve@fontsource/inter/latin-400.css. This PR makes a barenpm installat the repo root produce a fully buildable/runnable tree, and fixes the Node 24 / Windows gaps that surfaced along the way.Changes
1. Client deps install on a root
npm installThe client's fonts (
@fontsource/*) and build toolchain live inclient/package.json, which a plain rootnpm installnever installed. A rootpostinstallhook (scripts/postinstall.js) now installs them.client/is absent, so the multi-stage Dockerfiles (rootserver-depsstage, the MCP image'sfile:..link) and the published tarball still install cleanly.shell: trueso npm's Windows.cmdshim resolves (Node ≥18.20 / CVE-2024-27980).--ignore-scripts(documented fallback:cd client && npm install).2.
better-sqlite3^11→^1211.xships no prebuilt binary for Node 24, so on Node 24 it falls back to a source build requiring the MSVC C++ toolchain and fails (the optional dep is then silently skipped).12.xhas Node 24 prebuilds and installs with no compiler.engines.nodebumped to>=20(better-sqlite3 12's floor; thenode:sqlitefallback already needs 22+). The app still runs on thenode:sqlitefallback when the native driver is absent.3. Two Windows-only path-semantics test failures
Both are green on macOS/Linux and behave identically there after the fix — they only fail when the suite runs on Windows:
scripts/import-history.jsclassifyJsonlsplit onpath.sep(\on Windows), turning a POSIX"/a/b/subagents/x.jsonl"path into one segment that never equals"subagents"→ subagents misclassified as sessions. Now splits on both separators.server/routes/hooks.jslivenessReapused the platform-sensitivepath.isAbsolute; the tests mock the probe to run the reaper on Windows, where"D:\..."reads as absolute and wrongly reaps a forwarded remote session. Now usespath.posix.isAbsolute, matching the documented intent.Docs
Synced the Node floor (18 → 20) and the client-install note across README (+VN/CN/KO), INSTALL, SETUP, ARCHITECTURE, server/client READMEs,
docs/*, the landing page, and the wiki (badges + service-worker cache bump).Verification
npm run test:server— 665 pass / 0 fail / 1 skipped (666 total)npm run build— succeedsclient/node_modules, ran onlynpm installfrom root, thennpm run build→ greenbetter-sqlite312.11.1 loads via prebuild on Node 24 with no compiler🤖 Generated with Claude Code