diff --git a/.gitignore b/.gitignore index c3704e7bf..9c9029dc5 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ localization/packages localization/*.lnk localization/*.zip buildDate.json +electron-builder.yml env-config/env-files*.zip src/renderer/index.html *.log* diff --git a/electron-builder.yml b/electron-builder.yml deleted file mode 100644 index 7663fbc16..000000000 --- a/electron-builder.yml +++ /dev/null @@ -1,45 +0,0 @@ -appId: com.electron.app -productName: apm-vite -directories: - buildResources: build -files: - - '!**/.vscode/*' - - '!src/*' - - '!electron.vite.config.{js,ts,mjs,cjs}' - - '!{.eslintcache,eslint.config.mjs,.prettierignore,.prettierrc.yaml,dev-app-update.yml,CHANGELOG.md,README.md}' - - '!{.env,.env.*,.npmrc,pnpm-lock.yaml}' - - '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}' -asarUnpack: - - resources/** - - node_modules/ffmpeg-static/** - - node_modules/ffprobe-static/** -win: - executableName: apm -nsis: - artifactName: ${name}-${version}-setup.${ext} - shortcutName: ${productName} - uninstallDisplayName: ${productName} - createDesktopShortcut: always -mac: - entitlementsInherit: env-config/entitlements.mac.plist - extendInfo: - - NSCameraUsageDescription: Application requests access to the device's camera. - - NSMicrophoneUsageDescription: Application requests access to the device's microphone. - - NSDocumentsFolderUsageDescription: Application requests access to the user's Documents folder. - - NSDownloadsFolderUsageDescription: Application requests access to the user's Downloads folder. - notarize: false -dmg: - artifactName: ${name}-${version}.${ext} -linux: - target: - - AppImage - - snap - - deb - maintainer: electronjs.org - category: Utility -appImage: - artifactName: ${name}-${version}.${ext} -npmRebuild: false -publish: - provider: generic - url: https://example.com/auto-updates diff --git a/env-config/genLogoAssets.cjs b/env-config/genLogoAssets.cjs index ddbd92d83..09a256e97 100644 --- a/env-config/genLogoAssets.cjs +++ b/env-config/genLogoAssets.cjs @@ -49,7 +49,33 @@ const cropped = (svg) => const TARGETS = [ // Full-bleed favicon frames: at 16px every spare pixel counts, so the mark's // own padding is cropped away rather than shrinking it further. - { out: null, sizes: [16, 32, 48, 64], pad: 1, bg: null, ico: true }, + { + sizes: [16, 32, 48, 64], + pad: 1, + bg: null, + ico: true, + // favicon.ico is read from three places: the web root, the Electron auth + // window, and the packaged resources. + icoOutputs: [ + 'src/renderer/public/favicon.ico', + 'src/renderer/favicon.ico', + 'resources/favicon.ico', + ], + }, + + // The Windows app/installer icon. Pre-generated and committed rather than + // left for electron-builder to derive from resources/icon.png at build + // time: that derivation shells out to a tool it downloads from GitHub on + // every build, which is one more thing that can go wrong (or differ) on a + // given build agent. Rendered directly from the vector source per size, + // same as the favicon, rather than downscaled from a raster. + { + sizes: [16, 24, 32, 48, 64, 128, 256], + pad: ART.size / VIEWBOX, + bg: null, + ico: true, + icoOutputs: ['resources/icon.ico'], + }, // iOS draws its own rounded-rect mask and never adds padding, and it // composites any alpha over black — so this one must be opaque. @@ -81,8 +107,9 @@ const TARGETS = [ bg: WHITE, }, - // electron-builder derives .icns/.ico from this; 1024 gives macOS a real - // retina source instead of upscaling 512. + // electron-builder derives macOS's .icns from this (and it's the mac build + // icon directly); 1024 gives it a real retina source instead of upscaling + // 512. Windows uses the pre-generated resources/icon.ico above instead. { out: 'resources/icon.png', sizes: [1024], @@ -97,14 +124,6 @@ const TARGETS = [ }, ]; -// favicon.ico is read from three places: the web root, the Electron auth -// window, and the packaged resources. -const ICO_OUTPUTS = [ - 'src/renderer/public/favicon.ico', - 'src/renderer/favicon.ico', - 'resources/favicon.ico', -]; - /** Pack PNG buffers into an ICO. PNG-compressed entries are read by every * browser and by Windows Vista and later. */ function buildIco(entries) { @@ -230,7 +249,7 @@ async function main() { if (target.ico) { const ico = buildIco(rendered); - for (const out of ICO_OUTPUTS) { + for (const out of target.icoOutputs) { fs.writeFileSync(path.join(root, out), ico); written.push([out, ico.length]); } diff --git a/package.json b/package.json index 956d99656..32b62f273 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "audio-project-manager", "version": "4.5.1", - "description": "An Electron application with React and TypeScript", + "description": "A flexible audio-text orality solution", "main": "./out/main/index.js", "homepage": "./out", "scripts": { @@ -166,7 +166,7 @@ "productName": "Audio Project Manager", "copyright": "Copyright © 2020-2026 ${author}", "win": { - "icon": "resources/icon.png" + "icon": "resources/icon.ico" }, "linux": { "icon": "debian/audio-project-manager.png", @@ -177,8 +177,8 @@ "Encoding": "UTF-8", "Name": "Audio Project Manager", "Name[fr]": "Audio Project Manager", - "Comment": "Flexible audio-text orality solution", - "Comment[fr]": "Solution flexible d'oralité audio-textuelle", + "Comment": "A flexible audio-text orality solution", + "Comment[fr]": "Une solution flexible d'oralité audio-textuelle", "Icon": "audio-project-manager", "Categories": "GTK;GNOME;Education;Utility;", "Keywords": "audio;obt;transcribe;ai", diff --git a/resources/icon.ico b/resources/icon.ico new file mode 100644 index 000000000..deb916d86 Binary files /dev/null and b/resources/icon.ico differ