fix: harden better-sqlite3 Electron ABI compatibility and install workflow#3
Merged
fix: harden better-sqlite3 Electron ABI compatibility and install workflow#3
Conversation
There was a problem hiding this comment.
Pull request overview
Release prep for 0.0.18 focused on improving Electron native-module install/rebuild reliability, aligning contributor toolchains, and making provider icon URLs stable across the UI.
Changes:
- Add a
postinstallhook andSKIP_ELECTRON_REBUILDescape hatch for rebuilding Electron native deps (better-sqlite3,node-pty). - Improve Electron version detection by reading the installed
node_modules/electron/package.json. - Stabilize provider icon URL resolution, update UI usage, and extend tests/docs/logging accordingly.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/model-catalog.test.ts | Adds coverage for getProviderIconUrl and theme-specific Stave icon behavior. |
| src/lib/providers/model-catalog.ts | Introduces asset-backed icon URL constants and routes icon selection through getProviderIconUrl. |
| src/components/layout/StaveAppMenuButton.tsx | Switches Stave menu logo to use getProviderIconUrl. |
| scripts/rebuild-electron-deps.mjs | Resolves Electron version from installed package; adds SKIP_ELECTRON_REBUILD skip path. |
| package.json | Bumps version, adds Node engines constraint, and adds postinstall rebuild hook. |
| electron/main/ipc/persistence.ts | Logs persistence upsert failures to main-process console for visibility. |
| README.md | Documents toolchain prerequisites, postinstall behavior, run flow, and troubleshooting. |
| CHANGELOG.md | Adds 0.0.18 entry summarizing the release highlights. |
| .nvmrc | Pins Node to 22 (LTS per PR description). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…kflow Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
49fc65f to
99c6793
Compare
Triggers when a PR titled `chore: release x.y.z` is merged into main
(the pattern the stave-release skill produces). On merge it:
- reads the version bumped in package.json
- builds the macOS DMG via electron-builder
- creates a GitHub release tagged v{version} with auto-generated notes
- attaches the DMG as a release asset
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
better-sqlite3 upstream changed getter C++ source from direct info.This() calls to a PROPERTY_HOLDER(info) macro. Update patch from/to strings to match the new source shape so the HolderV2() fix applies correctly on all current versions. Absorbs fix/better-sqlite3-patch-property-holder (PR #1). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2 tasks
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
heath-s
approved these changes
Mar 25, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
postinstallhook sobun installautomatically recompilesbetter-sqlite3andnode-ptyagainst the Electron ABI — eliminates the most commonNODE_MODULE_VERSIONmismatch for new contributors.nvmrc(Node 22) andengines: { node: ">=20" }so the host toolchain is consistent across machinesresolveElectronVersionto read the actual installed version fromnode_modules/electron/package.jsoninstead of stripping the semver range prefix, ensuring compiled ABI always matches what is on diskSKIP_ELECTRON_REBUILD=1escape hatch for CI or pure web-build environmentsbetter-sqlite3load failures in the Electron main-process log viaconsole.errorin the sync IPC persistence handler (was silently returning{ ok: false })bun run run:desktop:built, and a troubleshooting tablestave-patch-releaseskill tostave-release, remove hardcoded repo paths, removepublicremote references, update workflow to PR-based releaseTest plan
bun run typecheckpassesbun testpassesbun installon a machine with a different Node version triggers rebuild automaticallySKIP_ELECTRON_REBUILD=1 bun installskips the rebuild without errorbun run run:desktop:builtlaunches the app and persistence works (no ABI crash)🤖 Generated with Claude Code