Files
openchamber/packages/electron/scripts/after-pack.cjs
T
Bohdan Triapitsyn 56f2b972f0 chore(deps): drop better-sqlite3 and its desktop packaging support
The SQLite write into OpenCode's database was the only consumer of
better-sqlite3 in the repository. Everything that existed to ship its native
binary went with it:

- the dependency in @openchamber/web and @openchamber/electron
- the afterPack hook staging better_sqlite3.node into app.asar.unpacked
- a dedicated @electron/rebuild pass (onlyModules) and its binary assertion,
  so desktop packaging now runs one native rebuild instead of two
- the bundler external entry and the AppImage required-native-module check

Desktop packaging, the AppImage verification tests, and the extension bundle
were re-validated after a clean reinstall, so no stale module could satisfy a
missed import.
2026-08-03 23:38:01 +03:00

18 lines
689 B
JavaScript

const fs = require('node:fs');
const path = require('node:path');
module.exports = (context) => {
const resourcesPath = context.electronPlatformName === 'darwin'
? path.join(context.appOutDir, `${context.packager.appInfo.productFilename}.app`, 'Contents', 'Resources')
: path.join(context.appOutDir, 'resources');
if (context.electronPlatformName !== 'darwin') return;
const sourceAssetsPath = path.join(__dirname, '..', 'resources', 'icons', 'Assets.car');
if (!fs.existsSync(sourceAssetsPath)) {
throw new Error(`Missing compiled app icon asset catalog at ${sourceAssetsPath}`);
}
fs.copyFileSync(sourceAssetsPath, path.join(resourcesPath, 'Assets.car'));
};