feat: add native macOS dynamic app icon (#1402)

* feat: add native macOS dynamic app icon

Adds Icon Composer source and compiled Assets.car for macOS
Packages the dynamic icon asset into the Electron app
Adds a script to regenerate macOS icon assets

* fix: harden macOS icon asset scripts
This commit is contained in:
Bohdan Triapitsyn
2026-05-24 21:23:46 +03:00
committed by GitHub
parent 0c8301d579
commit 3f3b835ee9
7 changed files with 182 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
const fs = require('node:fs');
const path = require('node:path');
module.exports = (context) => {
if (context.electronPlatformName !== 'darwin') return;
const appName = context.packager.appInfo.productFilename;
const appBundlePath = path.join(context.appOutDir, `${appName}.app`);
const resourcesPath = path.join(appBundlePath, 'Contents', 'Resources');
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'));
};