|
| 1 | +/* |
| 2 | + * Copyright (C) 2026 Fluxer Contributors |
| 3 | + * |
| 4 | + * This file is part of Fluxer. |
| 5 | + * |
| 6 | + * Fluxer is free software: you can redistribute it and/or modify |
| 7 | + * it under the terms of the GNU Affero General Public License as published by |
| 8 | + * the Free Software Foundation, either version 3 of the License, or |
| 9 | + * (at your option) any later version. |
| 10 | + * |
| 11 | + * Fluxer is distributed in the hope that it will be useful, |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | + * GNU Affero General Public License for more details. |
| 15 | + * |
| 16 | + * You should have received a copy of the GNU Affero General Public License |
| 17 | + * along with Fluxer. If not, see <https://www.gnu.org/licenses/>. |
| 18 | + */ |
| 19 | + |
| 20 | +/** @type {import('electron-builder').Configuration} */ |
| 21 | +const config = (() => { |
| 22 | + const channel = process.env.BUILD_CHANNEL === 'canary' ? 'canary' : 'stable'; |
| 23 | + const isCanary = channel === 'canary'; |
| 24 | + |
| 25 | + const appId = isCanary ? 'app.fluxer.canary' : 'app.fluxer'; |
| 26 | + const productName = isCanary ? 'Fluxer Canary' : 'Fluxer'; |
| 27 | + const iconsDir = isCanary ? 'electron-build-resources/icons-canary' : 'electron-build-resources/icons-stable'; |
| 28 | + |
| 29 | + const macEntitlements = isCanary |
| 30 | + ? 'electron-build-resources/entitlements.mac.canary.plist' |
| 31 | + : 'electron-build-resources/entitlements.mac.stable.plist'; |
| 32 | + |
| 33 | + const macProfile = isCanary |
| 34 | + ? 'electron-build-resources/profiles/Fluxer_Canary.provisionprofile' |
| 35 | + : 'electron-build-resources/profiles/Fluxer.provisionprofile'; |
| 36 | + |
| 37 | + const winIconUrl = isCanary |
| 38 | + ? 'https://fluxerstatic.com/web/icons/desktop/canary/icon.ico' |
| 39 | + : 'https://fluxerstatic.com/web/icons/desktop/stable/icon.ico'; |
| 40 | + |
| 41 | + const linuxExecutableName = isCanary ? 'fluxercanary' : 'fluxer'; |
| 42 | + const linuxSynopsis = productName; |
| 43 | + const linuxDescription = productName; |
| 44 | + |
| 45 | + return { |
| 46 | + appId, |
| 47 | + productName, |
| 48 | + copyright: 'Copyright (C) 2026 Fluxer Contributors', |
| 49 | + |
| 50 | + artifactName: `fluxer-${channel}-\${version}-\${arch}.\${ext}`, |
| 51 | + |
| 52 | + directories: { |
| 53 | + output: 'dist-electron', |
| 54 | + buildResources: 'electron-build-resources', |
| 55 | + }, |
| 56 | + |
| 57 | + files: [ |
| 58 | + 'src-electron/dist/**/*', |
| 59 | + '!**/*.map', |
| 60 | + '!**/*.md', |
| 61 | + '!**/README*', |
| 62 | + '!**/readme*', |
| 63 | + '!**/CHANGELOG*', |
| 64 | + '!**/LICENSE*', |
| 65 | + '!**/.github/**', |
| 66 | + '!**/docs/**', |
| 67 | + '!**/doc/**', |
| 68 | + '!**/example/**', |
| 69 | + '!**/examples/**', |
| 70 | + '!**/test/**', |
| 71 | + '!**/tests/**', |
| 72 | + '!**/__tests__/**', |
| 73 | + '!**/*.ts', |
| 74 | + '!**/tsconfig*.json', |
| 75 | + ], |
| 76 | + |
| 77 | + extraMetadata: { |
| 78 | + main: 'src-electron/dist/main/index.js', |
| 79 | + type: 'module', |
| 80 | + }, |
| 81 | + |
| 82 | + asar: true, |
| 83 | + compression: 'normal', |
| 84 | + |
| 85 | + asarUnpack: [ |
| 86 | + '**/*.node', |
| 87 | + '**/node_modules/uiohook-napi/**', |
| 88 | + '**/node_modules/input-monitoring-check/**', |
| 89 | + '**/src-electron/dist/preload/**', |
| 90 | + ], |
| 91 | + |
| 92 | + extraResources: [ |
| 93 | + {from: `${iconsDir}/512x512.png`, to: '512x512.png'}, |
| 94 | + {from: `${iconsDir}/badges`, to: 'badges'}, |
| 95 | + {from: `${iconsDir}/_compiled/Assets.car`, to: 'Assets.car'}, |
| 96 | + ], |
| 97 | + |
| 98 | + mac: { |
| 99 | + category: 'public.app-category.social-networking', |
| 100 | + icon: `${iconsDir}/_compiled/AppIcon.icns`, |
| 101 | + hardenedRuntime: true, |
| 102 | + gatekeeperAssess: false, |
| 103 | + entitlements: macEntitlements, |
| 104 | + entitlementsInherit: 'electron-build-resources/entitlements.mac.inherit.plist', |
| 105 | + provisioningProfile: macProfile, |
| 106 | + extendInfo: { |
| 107 | + CFBundleIconName: 'AppIcon', |
| 108 | + NSMicrophoneUsageDescription: 'Fluxer needs access to your microphone for voice chat.', |
| 109 | + NSCameraUsageDescription: 'Fluxer needs access to your camera for video chat.', |
| 110 | + NSInputMonitoringUsageDescription: 'Fluxer needs Input Monitoring access for global shortcuts and hotkeys.', |
| 111 | + }, |
| 112 | + notarize: true, |
| 113 | + target: [ |
| 114 | + {target: 'dmg', arch: ['x64', 'arm64']}, |
| 115 | + {target: 'zip', arch: ['x64', 'arm64']}, |
| 116 | + ], |
| 117 | + }, |
| 118 | + |
| 119 | + dmg: { |
| 120 | + sign: false, |
| 121 | + icon: `${iconsDir}/_compiled/AppIcon.icns`, |
| 122 | + format: 'UDZO', |
| 123 | + contents: [ |
| 124 | + {x: 130, y: 220}, |
| 125 | + {x: 410, y: 220, type: 'link', path: '/Applications'}, |
| 126 | + ], |
| 127 | + }, |
| 128 | + |
| 129 | + win: { |
| 130 | + icon: `${iconsDir}/icon.ico`, |
| 131 | + target: [{target: 'squirrel'}], |
| 132 | + }, |
| 133 | + |
| 134 | + squirrelWindows: { |
| 135 | + iconUrl: winIconUrl, |
| 136 | + }, |
| 137 | + |
| 138 | + linux: { |
| 139 | + icon: iconsDir, |
| 140 | + category: 'Network', |
| 141 | + maintainer: 'Fluxer Contributors', |
| 142 | + synopsis: linuxSynopsis, |
| 143 | + description: linuxDescription, |
| 144 | + executableName: linuxExecutableName, |
| 145 | + target: ['dir', 'AppImage', 'deb', 'rpm', 'tar.gz'], |
| 146 | + mimeTypes: ['x-scheme-handler/fluxer'], |
| 147 | + }, |
| 148 | + |
| 149 | + protocols: [{name: 'Fluxer', schemes: ['fluxer']}], |
| 150 | + }; |
| 151 | +})(); |
| 152 | + |
| 153 | +module.exports = config; |
0 commit comments