From 1a7457695585ebaf1f3eb94303d16419be97e439 Mon Sep 17 00:00:00 2001 From: Johan LEROY Date: Fri, 17 Jul 2026 21:46:22 +0200 Subject: [PATCH] =?UTF-8?q?feat(desktop):=20logo=20de=20fen=C3=AAtre,=20ho?= =?UTF-8?q?mepage=20vitrine,=20licence=20MIT=20;=20attache=20release=20ide?= =?UTF-8?q?mpotente?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fenêtre principale : icône explicite (resolveIconPath partagé dans paths.ts, réutilisé par le tray) pour afficher le logo Arboretum en fenêtre/barre des tâches au lieu de l'icône Electron générique. - package.json desktop : homepage -> https://git-arboretum.com (la vitrine, plus le dépôt Gitea) et champ license: MIT. Copyright daté avec le nom dans electron-builder.yml. Licence MIT + author aussi au package.json racine. - desktop-release.yml : attache des assets idempotente (supprime l'asset de même nom avant ré-upload) pour que le dernier build gagne sur un re-run. --- .gitea/workflows/desktop-release.yml | 7 +++++++ package.json | 2 ++ packages/desktop/electron-builder.yml | 2 +- packages/desktop/package.json | 3 ++- packages/desktop/src/main/main.ts | 3 +++ packages/desktop/src/main/paths.ts | 9 +++++++++ packages/desktop/src/main/tray.ts | 12 +++--------- 7 files changed, 27 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/desktop-release.yml b/.gitea/workflows/desktop-release.yml index 82048bc..afe5fad 100644 --- a/.gitea/workflows/desktop-release.yml +++ b/.gitea/workflows/desktop-release.yml @@ -74,6 +74,13 @@ jobs: for f in packages/desktop/release/*.AppImage packages/desktop/release/*.deb packages/desktop/release/latest-linux.yml; do [ -f "$f" ] || continue name=$(basename "$f") + # Re-run idempotent : supprimer un asset existant du même nom avant de ré-uploader, pour + # que le dernier build gagne (l'API Gitea refuse sinon un asset déjà présent). + existing=$(curl -fsSL -H "$auth" "${api}/releases/${rid}/assets" | node -e "const a=JSON.parse(require('fs').readFileSync(0,'utf8'));const m=Array.isArray(a)?a.find(x=>x.name===process.argv[1]):null;process.stdout.write(m?String(m.id):'')" "$name" || true) + if [ -n "$existing" ]; then + echo "replacing existing $name (asset $existing)" + curl -fsSL -X DELETE -H "$auth" "${api}/releases/${rid}/assets/${existing}" || true + fi echo "attaching $name" curl -fsSL -X POST -H "$auth" -F "attachment=@${f}" "${api}/releases/${rid}/assets?name=${name}" done diff --git a/package.json b/package.json index d4267b9..ed0ad45 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,8 @@ "name": "arboretum-monorepo", "private": true, "version": "0.0.0", + "license": "MIT", + "author": "Johan LEROY ", "type": "module", "workspaces": [ "packages/shared", diff --git a/packages/desktop/electron-builder.yml b/packages/desktop/electron-builder.yml index 734951d..9ebdc86 100644 --- a/packages/desktop/electron-builder.yml +++ b/packages/desktop/electron-builder.yml @@ -1,6 +1,6 @@ appId: fr.lidge.arboretum productName: Arboretum -copyright: Copyright Johan Leroy +copyright: Copyright © 2026 Johan Leroy directories: output: release diff --git a/packages/desktop/package.json b/packages/desktop/package.json index 3f3c663..448a195 100644 --- a/packages/desktop/package.json +++ b/packages/desktop/package.json @@ -3,7 +3,8 @@ "private": true, "version": "0.1.0", "description": "Arboretum desktop app: Electron shell that runs the daemon and shows its web UI", - "homepage": "https://git.lidge.fr/johanleroy/arboretum", + "homepage": "https://git-arboretum.com", + "license": "MIT", "author": { "name": "Johan LEROY", "email": "contact@johanleroy.fr" diff --git a/packages/desktop/src/main/main.ts b/packages/desktop/src/main/main.ts index 559dec6..9ceeb59 100644 --- a/packages/desktop/src/main/main.ts +++ b/packages/desktop/src/main/main.ts @@ -5,6 +5,7 @@ import { seedSessionCookie } from './auth'; import { loadWindowState, saveWindowState } from './window-state'; import { createTray } from './tray'; import { initUpdater } from './updater'; +import { resolveIconPath } from './paths'; const PARTITION = 'persist:arboretum'; const PORT = 7317; @@ -53,6 +54,8 @@ function createWindow(url: string): void { width: state.width, height: state.height, backgroundColor: '#09090b', + // Logo de la fenêtre / barre des tâches (sinon icône Electron générique sous Linux/Windows). + icon: resolveIconPath(), webPreferences: { partition: PARTITION, contextIsolation: true, diff --git a/packages/desktop/src/main/paths.ts b/packages/desktop/src/main/paths.ts index ff245bd..5c7b84c 100644 --- a/packages/desktop/src/main/paths.ts +++ b/packages/desktop/src/main/paths.ts @@ -14,6 +14,15 @@ export function resolveServerEntry(): string { return join(__dirname, '..', '..', 'server', 'dist', 'index.js'); } +/** Logo de l'app (fenêtre, tray, barre des tâches) : le mark Arboretum embarqué. */ +export function resolveIconPath(): string { + // packagé : extraResources copie resources/icon.png à la racine de resources/. + // dev : depuis dist/main.js -> ../resources/icon.png. + return app.isPackaged + ? join(process.resourcesPath, 'icon.png') + : join(__dirname, '..', 'resources', 'icon.png'); +} + /** Binaire Node qui exécute le daemon (>= 22.16 : node:sqlite + ABI node-pty maîtrisé). */ export function resolveNodeBin(): string { if (app.isPackaged) { diff --git a/packages/desktop/src/main/tray.ts b/packages/desktop/src/main/tray.ts index 9e0988c..93c4782 100644 --- a/packages/desktop/src/main/tray.ts +++ b/packages/desktop/src/main/tray.ts @@ -1,16 +1,10 @@ -import { app, Menu, Tray, nativeImage } from 'electron'; -import { join } from 'node:path'; +import { Menu, Tray, nativeImage } from 'electron'; import { isAutoStartEnabled, setAutoStart } from './autostart'; - -function iconPath(): string { - return app.isPackaged - ? join(process.resourcesPath, 'icon.png') - : join(__dirname, '..', 'resources', 'icon.png'); -} +import { resolveIconPath } from './paths'; /** Icône de barre système : ouvrir la fenêtre, basculer le lancement au login, quitter. */ export function createTray(opts: { show: () => void; quit: () => void }): Tray { - const image = nativeImage.createFromPath(iconPath()); + const image = nativeImage.createFromPath(resolveIconPath()); const tray = new Tray(image.isEmpty() ? nativeImage.createEmpty() : image.resize({ width: 18, height: 18 })); tray.setToolTip('Arboretum');