open-design/scripts
Chris 9674f48f2f
fix(postinstall): auto-rebuild better-sqlite3 on Node.js ABI mismatch (#813)
* fix(postinstall): auto-rebuild better-sqlite3 on Node.js ABI mismatch

prebuild-install fetches a prebuilt binary for the Node.js version active
at install time. On systems where the Node ABI differs from Node 24 (e.g.
Arch Linux system Node, Node 22 LTS, Node 25), or after switching versions,
the addon fails to dlopen at daemon startup.

postinstall now tries to load the native addon after the workspace builds.
On failure it locates node-gyp from the pnpm virtual store (bundled with
better-sqlite3) and rebuilds from source — no external tooling beyond a
C++ compiler required. pnpm install becomes self-healing across Node versions.

Also adds a QUICKSTART troubleshooting entry for users with ignore-scripts=true
who need to run `node scripts/postinstall.mjs` manually.

* fix(postinstall): correct better-sqlite3 path and rebuild mechanism

Two bugs in the initial implementation caught in review:

- better-sqlite3 is declared by apps/daemon, not the workspace root.
  node_modules/better-sqlite3 at root does not exist in a normal pnpm
  install, so existsSync() was always false and the check never ran.
  Fix: resolve via createRequire from apps/daemon/package.json.

- better-sqlite3@12.9.0 depends only on bindings and prebuild-install,
  not node-gyp. The assumed sibling path in the pnpm store does not
  exist, so the rebuild branch was hitting the "not found" exit instead
  of rebuilding. Fix: use pnpm --filter @open-design/daemon rebuild
  better-sqlite3 so pnpm manages node-gyp through its own lifecycle.

Also expands the QUICKSTART troubleshooting entry with the manual
rebuild command, a verification step, and build tool prerequisites.

* fix(quickstart): scope better-sqlite3 verification to daemon package
2026-05-08 11:25:26 +08:00
..
bake-community-pets.ts feat(web): add pet companion with Codex hatch-pet integration (#296) 2026-05-02 23:45:39 +08:00
bake-html-ppt-examples.mjs feat(skills): integrate lewislulu/html-ppt-skill + 15 per-template Examples cards (#193) 2026-05-02 11:00:44 +08:00
guard.ts feat: agent-callable research command and /search (#615) 2026-05-08 10:33:44 +08:00
i18n-check.ts Add i18n structure checks (#608) 2026-05-06 11:55:59 +08:00
import-prompt-templates.mjs feat(prompt-templates): add dance storyboard and ancient-china MMO HUD templates (#187) 2026-05-01 17:30:02 +08:00
postinstall.mjs fix(postinstall): auto-rebuild better-sqlite3 on Node.js ABI mismatch (#813) 2026-05-08 11:25:26 +08:00
release-beta.ts Migrate beta release publishing to R2 (#805) 2026-05-07 19:13:52 +08:00
release-stable.ts release: Open Design 0.1.0 — first public release (#206) 2026-05-01 20:15:18 +08:00
scaffold-html-ppt-skills.mjs feat(skills): integrate lewislulu/html-ppt-skill + 15 per-template Examples cards (#193) 2026-05-02 11:00:44 +08:00
seed-test-projects.ts chore(scripts): seed daemon with pre-baked decks and web prototypes (#457) 2026-05-05 10:55:17 +08:00
sync-community-pets.ts feat(web): add pet companion with Codex hatch-pet integration (#296) 2026-05-02 23:45:39 +08:00
sync-design-systems.ts Add shared contracts and migrate project code to TypeScript (#118) 2026-04-30 13:01:15 +08:00
sync-hyperframes-skill.mjs feat(media): port generation workflow onto main (#12) 2026-04-30 22:44:00 +08:00
sync-litellm-models.ts fix: make max_tokens configurable (closes #29) (#78) 2026-05-02 13:52:54 +08:00
tsconfig.json chore: enforce test directory conventions (#496) 2026-05-05 15:34:22 +08:00
verify-media-models.mjs feat(media): port generation workflow onto main (#12) 2026-04-30 22:44:00 +08:00