fix(nx/forge): app icons missing

This commit is contained in:
Elian Doran 2025-04-26 09:56:23 +03:00
parent 82e98e5f59
commit b34d82336c
No known key found for this signature in database
14 changed files with 7 additions and 7 deletions

View File

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 112 KiB

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

Before

Width:  |  Height:  |  Size: 635 B

After

Width:  |  Height:  |  Size: 635 B

View File

Before

Width:  |  Height:  |  Size: 626 B

After

Width:  |  Height:  |  Size: 626 B

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -1,17 +1,18 @@
const path = require("path"); const path = require("path");
const fs = require("fs-extra"); const fs = require("fs-extra");
const ELECTRON_FORGE_DIR = "apps/desktop/electron-forge"; const ELECTRON_FORGE_DIR = __dirname;
const EXECUTABLE_NAME = "trilium"; // keep in sync with server's package.json -> packagerConfig.executableName const EXECUTABLE_NAME = "trilium"; // keep in sync with server's package.json -> packagerConfig.executableName
const PRODUCT_NAME = "TriliumNext Notes"; const PRODUCT_NAME = "TriliumNext Notes";
const BIN_PATH = path.normalize("./scripts/electron-forge"); const BIN_PATH = path.normalize("./scripts/electron-forge");
const APP_ICON_PATH = path.join(ELECTRON_FORGE_DIR, "app-icon");
const extraResourcesForPlatform = getExtraResourcesForPlatform(); const extraResourcesForPlatform = getExtraResourcesForPlatform();
const baseLinuxMakerConfigOptions = { const baseLinuxMakerConfigOptions = {
name: EXECUTABLE_NAME, name: EXECUTABLE_NAME,
productName: PRODUCT_NAME, productName: PRODUCT_NAME,
icon: "./assets/app-icon/png/128x128.png", icon: path.join(APP_ICON_PATH, "png/128x128.png"),
desktopTemplate: path.resolve(path.join(BIN_PATH, "desktop.ejs")), desktopTemplate: path.resolve(path.join(BIN_PATH, "desktop.ejs")),
categories: ["Office", "Utility"] categories: ["Office", "Utility"]
}; };
@ -27,10 +28,9 @@ module.exports = {
name: PRODUCT_NAME, name: PRODUCT_NAME,
overwrite: true, overwrite: true,
asar: true, asar: true,
icon: "./assets/app-icon/icon", icon: path.join(APP_ICON_PATH, "icon"),
osxSign: {}, osxSign: {},
osxNotarize: { osxNotarize: {
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_ID_PASSWORD, appleIdPassword: process.env.APPLE_ID_PASSWORD,
teamId: process.env.APPLE_TEAM_ID teamId: process.env.APPLE_TEAM_ID
}, },
@ -154,7 +154,7 @@ module.exports = {
{ {
name: "@electron-forge/maker-dmg", name: "@electron-forge/maker-dmg",
config: { config: {
icon: "./assets/app-icon/icon.icns" icon: path.join(APP_ICON_PATH, "icon.icns")
} }
}, },
{ {
@ -162,7 +162,7 @@ module.exports = {
config: { config: {
options: { options: {
iconUrl: "https://raw.githubusercontent.com/TriliumNext/Notes/develop/images/app-icons/icon.ico", iconUrl: "https://raw.githubusercontent.com/TriliumNext/Notes/develop/images/app-icons/icon.ico",
icon: "./assets/app-icon/icon.ico" icon: path.join(APP_ICON_PATH, "icon.ico")
} }
} }
} }
@ -215,7 +215,7 @@ function getExtraResourcesForPlatform() {
resources.push(...getScriptRessources()) resources.push(...getScriptRessources())
break; break;
case "linux": case "linux":
resources.push(...getScriptRessources(), "assets/app-icon/png/256x256.png"); resources.push(...getScriptRessources(), path.join(APP_ICON_PATH, "png/256x256.png"));
break; break;
default: default:
break; break;