From 461d4d6df528966ae17d5b975e6f24ca1216bb3c Mon Sep 17 00:00:00 2001 From: staniel359 Date: Sun, 28 Apr 2024 14:49:53 +0300 Subject: [PATCH 01/14] Change Electron's deprecated BrowserView to WebContentsView --- electron/actions/aboutView/setBounds.js | 17 +++ electron/actions/aboutWindow/create.js | 47 ++++-- electron/actions/aboutWindow/show.js | 4 +- electron/actions/app/callAccountDelete.js | 2 +- electron/actions/app/callExit.js | 2 +- electron/actions/app/callLogout.js | 2 +- electron/actions/app/callNavigate.js | 2 +- electron/actions/app/initialize.js | 20 +-- electron/actions/app/openDeepLink.js | 2 +- electron/actions/app/setEvents.js | 7 +- electron/actions/app/setGlobalVariables.js | 6 +- electron/actions/app/updateTheme.js | 2 +- .../actions/{audio => audioFile}/create.js | 4 +- .../actions/{audio => audioFile}/delete.js | 4 +- .../actions/{audio => audioFile}/encrypt.js | 12 +- .../actions/{audio => audioFile}/getPath.js | 0 electron/actions/{audio => audioFile}/open.js | 4 +- electron/actions/{audio => audioFile}/save.js | 8 +- electron/actions/backgroundImage/change.js | 2 +- electron/actions/backgroundImage/create.js | 4 +- electron/actions/backgroundImage/delete.js | 6 +- electron/actions/backgroundImage/reset.js | 2 +- electron/actions/discord/connect.js | 2 +- electron/actions/discord/disconnect.js | 2 +- electron/actions/electronStore/addValue.js | 8 +- electron/actions/electronStore/deleteValue.js | 8 +- electron/actions/file/decrypt.js | 4 +- electron/actions/mainView/setBounds.js | 17 +++ electron/actions/mainWindow/create.js | 141 ++++++++---------- electron/actions/mainWindow/setScale.js | 2 +- .../actions/session/createHeadersHandler.js | 3 +- electron/actions/store/update.js | 4 +- electron/actions/tab/clear.js | 12 +- electron/actions/tab/create.js | 43 +++--- electron/actions/tab/delete.js | 6 +- electron/actions/tab/find.js | 4 +- electron/actions/tab/isReplaceActive.js | 4 +- electron/actions/tab/replaceActive.js | 8 +- electron/actions/tab/setActive.js | 17 ++- electron/actions/tab/setBounds.js | 2 +- electron/actions/tab/update.js | 2 +- electron/actions/tabs/clear.js | 4 +- electron/actions/tabs/get.js | 13 +- electron/actions/tabs/hideInactive.js | 27 ++++ electron/actions/tray/create.js | 8 +- electron/events/ipc/audio.js | 19 --- electron/events/ipc/audioFile.js | 12 ++ electron/handlers/app.js | 2 +- electron/handlers/ipc/audio.js | 39 ----- electron/handlers/ipc/audioFile.js | 39 +++++ .../savedTracks/BaseSavedTrackDeleteModal.vue | 2 +- .../BaseTrackOptionsPopup/SaveOption.vue | 2 +- 52 files changed, 342 insertions(+), 273 deletions(-) create mode 100644 electron/actions/aboutView/setBounds.js rename electron/actions/{audio => audioFile}/create.js (73%) rename electron/actions/{audio => audioFile}/delete.js (72%) rename electron/actions/{audio => audioFile}/encrypt.js (69%) rename electron/actions/{audio => audioFile}/getPath.js (100%) rename electron/actions/{audio => audioFile}/open.js (72%) rename electron/actions/{audio => audioFile}/save.js (88%) create mode 100644 electron/actions/mainView/setBounds.js create mode 100644 electron/actions/tabs/hideInactive.js delete mode 100644 electron/events/ipc/audio.js delete mode 100644 electron/handlers/ipc/audio.js diff --git a/electron/actions/aboutView/setBounds.js b/electron/actions/aboutView/setBounds.js new file mode 100644 index 000000000..bb0188acf --- /dev/null +++ b/electron/actions/aboutView/setBounds.js @@ -0,0 +1,17 @@ +export default function () { + const [ + width, + height + ] = aboutWindow.getSize() + + const boundsOptions = { + x: 0, + y: 0, + width, + height + } + + aboutView.setBounds( + boundsOptions + ) +} diff --git a/electron/actions/aboutWindow/create.js b/electron/actions/aboutWindow/create.js index fba6a2415..5bbb8639f 100644 --- a/electron/actions/aboutWindow/create.js +++ b/electron/actions/aboutWindow/create.js @@ -1,5 +1,6 @@ import { - BrowserWindow + BaseWindow, + WebContentsView } from 'electron' import { windowIcon @@ -7,6 +8,7 @@ import { import { baseUrl } from '#/helpers/urls' +import setAboutViewBounds from '#/actions/aboutView/setBounds' function handleClose ( event @@ -20,9 +22,11 @@ export default function () { const aboutWindowWidth = 500 const aboutWindowHeight = 275 - const options = { + const aboutWindowOptions = { width: aboutWindowWidth, height: aboutWindowHeight, + minWidth: aboutWindowWidth, + minHeight: aboutWindowHeight, icon: windowIcon, show: false, resizable: false, @@ -35,22 +39,37 @@ export default function () { } aboutWindow = - new BrowserWindow( - options + new BaseWindow( + aboutWindowOptions ) - aboutWindow.setMinimumSize( - aboutWindowWidth, - aboutWindowHeight - ) + aboutWindow.removeMenu() - aboutWindow.setMenu( - null - ) + const aboutViewOptions = { + webPreferences: { + contextIsolation: false, + nodeIntegration: true + } + } - aboutWindow.loadURL( - `${baseUrl}#/about` - ) + aboutView = + new WebContentsView( + aboutViewOptions + ) + + setAboutViewBounds() + + aboutWindow + .contentView + .addChildView( + aboutView + ) + + aboutView + .webContents + .loadURL( + `${baseUrl}#/about` + ) aboutWindow.on( 'close', diff --git a/electron/actions/aboutWindow/show.js b/electron/actions/aboutWindow/show.js index e023c1fe4..8393c23a3 100644 --- a/electron/actions/aboutWindow/show.js +++ b/electron/actions/aboutWindow/show.js @@ -1,7 +1,7 @@ -import setTitle from './setTitle' +import setAboutWindowTitle from './setTitle' export default function () { - setTitle() + setAboutWindowTitle() aboutWindow.show() } diff --git a/electron/actions/app/callAccountDelete.js b/electron/actions/app/callAccountDelete.js index add3463e4..a0fcf2ec8 100644 --- a/electron/actions/app/callAccountDelete.js +++ b/electron/actions/app/callAccountDelete.js @@ -1,5 +1,5 @@ export default function () { - mainWindow + mainView .webContents .send( 'account-delete' diff --git a/electron/actions/app/callExit.js b/electron/actions/app/callExit.js index e7a7b60d2..7dffe0d4f 100644 --- a/electron/actions/app/callExit.js +++ b/electron/actions/app/callExit.js @@ -1,5 +1,5 @@ export default function () { - mainWindow + mainView .webContents .send( 'exit' diff --git a/electron/actions/app/callLogout.js b/electron/actions/app/callLogout.js index 157c15828..03f831f4b 100644 --- a/electron/actions/app/callLogout.js +++ b/electron/actions/app/callLogout.js @@ -1,5 +1,5 @@ export default function () { - mainWindow + mainView .webContents .send( 'logout' diff --git a/electron/actions/app/callNavigate.js b/electron/actions/app/callNavigate.js index b5437202b..f1a8fa034 100644 --- a/electron/actions/app/callNavigate.js +++ b/electron/actions/app/callNavigate.js @@ -1,7 +1,7 @@ export default function ( data ) { - mainWindow + mainView .webContents .send( 'navigate', diff --git a/electron/actions/app/initialize.js b/electron/actions/app/initialize.js index ddd66bb8c..b9d0291d1 100644 --- a/electron/actions/app/initialize.js +++ b/electron/actions/app/initialize.js @@ -1,13 +1,13 @@ import { app } from 'electron' -import setProtocols from './setProtocols' +import setAppProtocols from './setProtocols' import setupI18n from '#/plugins/i18n' import setupDayjs from '#/plugins/dayjs' -import setFlags from './setFlags' -import setGlobalVariables from './setGlobalVariables' -import setEvents from './setEvents' -import setup from './setup' +import setAppFlags from './setFlags' +import setAppGlobalVariables from './setGlobalVariables' +import setAppEvents from './setEvents' +import setupApp from './setup' import { appName, createFolderIfNotExists @@ -30,18 +30,18 @@ export default function () { setupDayjs() - setFlags() + setAppFlags() - setGlobalVariables() + setAppGlobalVariables() - setProtocols() + setAppProtocols() - setEvents() + setAppEvents() app .whenReady() .then( - setup + setupApp ) app.setAppUserModelId( diff --git a/electron/actions/app/openDeepLink.js b/electron/actions/app/openDeepLink.js index 0cc38270f..a29a6c292 100644 --- a/electron/actions/app/openDeepLink.js +++ b/electron/actions/app/openDeepLink.js @@ -34,7 +34,7 @@ export default function ( )?.[1] if (deepLink) { - mainWindow + mainView .webContents .send( 'open-deep-link', diff --git a/electron/actions/app/setEvents.js b/electron/actions/app/setEvents.js index 0abdb617a..4d606d497 100644 --- a/electron/actions/app/setEvents.js +++ b/electron/actions/app/setEvents.js @@ -5,12 +5,11 @@ import setIpcTrayEvents from '#/events/ipc/tray' import setIpcTabEvents from '#/events/ipc/tab' import setIpcTabsEvents from '#/events/ipc/tabs' import setIpcStoreEvents from '#/events/ipc/store' -import setIpcAudioEvents from '#/events/ipc/audio' +import setIpcAudioFileEvents from '#/events/ipc/audioFile' import setIpcBackgroundImageEvents from '#/events/ipc/backgroundImage' import setIpcFileEvents from '#/events/ipc/file' import setIpcElectronStoreEvents from '#/events/ipc/electronStore' import setIpcDiscordEvents from '#/events/ipc/discord' -import setIpcAudioFileEvents from '#/events/ipc/audioFile' export default function () { setAppEvents() @@ -27,7 +26,7 @@ export default function () { setIpcStoreEvents() - setIpcAudioEvents() + setIpcAudioFileEvents() setIpcBackgroundImageEvents() @@ -36,6 +35,4 @@ export default function () { setIpcElectronStoreEvents() setIpcDiscordEvents() - - setIpcAudioFileEvents() } diff --git a/electron/actions/app/setGlobalVariables.js b/electron/actions/app/setGlobalVariables.js index aa900965d..3cfe25cb7 100644 --- a/electron/actions/app/setGlobalVariables.js +++ b/electron/actions/app/setGlobalVariables.js @@ -1,11 +1,13 @@ export default function () { global.mainWindow = null + global.mainView = null + global.aboutWindow = null - global.tray = null + global.aboutView = null - global.isMaximized = false + global.tray = null global.tabsPanelHeight = 50 diff --git a/electron/actions/app/updateTheme.js b/electron/actions/app/updateTheme.js index f6fcbe077..4af86c63e 100644 --- a/electron/actions/app/updateTheme.js +++ b/electron/actions/app/updateTheme.js @@ -17,7 +17,7 @@ export default function () { isDarkMode } - mainWindow + mainView .webContents .send( 'native-theme-updated', diff --git a/electron/actions/audio/create.js b/electron/actions/audioFile/create.js similarity index 73% rename from electron/actions/audio/create.js rename to electron/actions/audioFile/create.js index 358e82162..48c7344dd 100644 --- a/electron/actions/audio/create.js +++ b/electron/actions/audioFile/create.js @@ -1,4 +1,4 @@ -import getPath from './getPath' +import getAudioFilePath from './getPath' import { writeFileSync } from 'fs' @@ -8,7 +8,7 @@ export default function ( data ) { const filePath = - getPath( + getAudioFilePath( fileName ) diff --git a/electron/actions/audio/delete.js b/electron/actions/audioFile/delete.js similarity index 72% rename from electron/actions/audio/delete.js rename to electron/actions/audioFile/delete.js index 5bd842a95..2b6318a55 100644 --- a/electron/actions/audio/delete.js +++ b/electron/actions/audioFile/delete.js @@ -1,11 +1,11 @@ -import getPath from './getPath' +import getAudioFilePath from './getPath' import deleteFile from '#/actions/file/delete' export default function ( fileName ) { const filePath = - getPath( + getAudioFilePath( fileName ) diff --git a/electron/actions/audio/encrypt.js b/electron/actions/audioFile/encrypt.js similarity index 69% rename from electron/actions/audio/encrypt.js rename to electron/actions/audioFile/encrypt.js index 85ed9a862..2b3dbdde0 100644 --- a/electron/actions/audio/encrypt.js +++ b/electron/actions/audioFile/encrypt.js @@ -1,7 +1,7 @@ -import open from './open' +import openAudioFile from './open' import encryptFile from '#/actions/file/encrypt' -import create from './create' -import deleteAudio from './delete' +import createAudioFile from './create' +import deleteAudioFile from './delete' export default function ( { @@ -10,7 +10,7 @@ export default function ( } ) { const file = - open( + openAudioFile( tempFileName ) @@ -25,12 +25,12 @@ export default function ( encryptedFile } = encryptedFileData - create( + createAudioFile( fileName, encryptedFile ) - deleteAudio( + deleteAudioFile( tempFileName ) diff --git a/electron/actions/audio/getPath.js b/electron/actions/audioFile/getPath.js similarity index 100% rename from electron/actions/audio/getPath.js rename to electron/actions/audioFile/getPath.js diff --git a/electron/actions/audio/open.js b/electron/actions/audioFile/open.js similarity index 72% rename from electron/actions/audio/open.js rename to electron/actions/audioFile/open.js index 398a4a227..10098dd7d 100644 --- a/electron/actions/audio/open.js +++ b/electron/actions/audioFile/open.js @@ -1,11 +1,11 @@ -import getPath from './getPath' +import getAudioFilePath from './getPath' import readFile from '#/actions/file/read' export default function ( fileName ) { const filePath = - getPath( + getAudioFilePath( fileName ) diff --git a/electron/actions/audio/save.js b/electron/actions/audioFile/save.js similarity index 88% rename from electron/actions/audio/save.js rename to electron/actions/audioFile/save.js index 273304576..fcc1e2433 100644 --- a/electron/actions/audio/save.js +++ b/electron/actions/audioFile/save.js @@ -7,8 +7,8 @@ import { import { download } from 'electron-dl' -import encrypt from './encrypt' -import getPath from './getPath' +import encryptAudioFile from './encrypt' +import getAudioFilePath from './getPath' import { currentTime as formatCurrentTime } from '#/helpers/formatters' @@ -31,12 +31,12 @@ export default function ( function handleSuccess () { const filePath = - getPath( + getAudioFilePath( fileName ) const encryptedData = - encrypt( + encryptAudioFile( { tempFileName, fileName diff --git a/electron/actions/backgroundImage/change.js b/electron/actions/backgroundImage/change.js index 5eeed2c99..1da38b223 100644 --- a/electron/actions/backgroundImage/change.js +++ b/electron/actions/backgroundImage/change.js @@ -9,7 +9,7 @@ export default function ( imagePath } - mainWindow + mainView .webContents .send( 'change-background-image', diff --git a/electron/actions/backgroundImage/create.js b/electron/actions/backgroundImage/create.js index 536ad453c..32a4bb7a0 100644 --- a/electron/actions/backgroundImage/create.js +++ b/electron/actions/backgroundImage/create.js @@ -1,7 +1,7 @@ import { generateKey } from '#/helpers/utils' -import getPath from './getPath' +import getBackgroundImagePath from './getPath' import { writeFile } from 'fs' @@ -21,7 +21,7 @@ export default function ( const fileName = generateKey() const filePath = - getPath( + getBackgroundImagePath( fileName ) diff --git a/electron/actions/backgroundImage/delete.js b/electron/actions/backgroundImage/delete.js index 7974939a5..8b4364d70 100644 --- a/electron/actions/backgroundImage/delete.js +++ b/electron/actions/backgroundImage/delete.js @@ -1,4 +1,4 @@ -import getPath from './getPath' +import getBackgroundImagePath from './getPath' import deleteFile from '#/actions/file/delete' export default function ( @@ -10,7 +10,7 @@ export default function ( imageId.toString() const filePath = - getPath( + getBackgroundImagePath( fileName ) @@ -22,7 +22,7 @@ export default function ( imageId } - mainWindow + mainView .webContents .send( 'delete-background-image', diff --git a/electron/actions/backgroundImage/reset.js b/electron/actions/backgroundImage/reset.js index e44f01aa7..f9d439277 100644 --- a/electron/actions/backgroundImage/reset.js +++ b/electron/actions/backgroundImage/reset.js @@ -1,5 +1,5 @@ export default function () { - mainWindow + mainView .webContents .send( 'reset-background-image' diff --git a/electron/actions/discord/connect.js b/electron/actions/discord/connect.js index d37dfef81..9b522bf38 100644 --- a/electron/actions/discord/connect.js +++ b/electron/actions/discord/connect.js @@ -20,7 +20,7 @@ export default function () { } function handleSuccess () { - mainWindow + mainView .webContents .send( 'discord-connected' diff --git a/electron/actions/discord/disconnect.js b/electron/actions/discord/disconnect.js index 8b06c1e03..9a033ad93 100644 --- a/electron/actions/discord/disconnect.js +++ b/electron/actions/discord/disconnect.js @@ -1,6 +1,6 @@ export default function () { function handleSuccess () { - mainWindow + mainView .webContents .send( 'discord-disconnected' diff --git a/electron/actions/electronStore/addValue.js b/electron/actions/electronStore/addValue.js index 439f236f7..c72a85729 100644 --- a/electron/actions/electronStore/addValue.js +++ b/electron/actions/electronStore/addValue.js @@ -1,12 +1,12 @@ -import getKey from './getKey' -import setData from './setData' +import getElectronStoreKey from './getKey' +import setElectronStoreData from './setData' export default function ( key, value ) { const oldValue = - getKey( + getElectronStoreKey( key ) @@ -15,7 +15,7 @@ export default function ( value ] - return setData( + return setElectronStoreData( { [key]: newValue } diff --git a/electron/actions/electronStore/deleteValue.js b/electron/actions/electronStore/deleteValue.js index a609f720c..42525291c 100644 --- a/electron/actions/electronStore/deleteValue.js +++ b/electron/actions/electronStore/deleteValue.js @@ -1,12 +1,12 @@ -import getKey from './getKey' -import setData from './setData' +import getElectronStoreKey from './getKey' +import setElectronStoreData from './setData' export default function ( key, uuid ) { const oldValue = - getKey( + getElectronStoreKey( key ) @@ -24,7 +24,7 @@ export default function ( ) ] - return setData( + return setElectronStoreData( { [key]: newValue } diff --git a/electron/actions/file/decrypt.js b/electron/actions/file/decrypt.js index 5c3bc47d7..a214ecf53 100644 --- a/electron/actions/file/decrypt.js +++ b/electron/actions/file/decrypt.js @@ -1,5 +1,5 @@ import crypto from 'crypto' -import read from './read' +import readFile from './read' export default function ( { @@ -9,7 +9,7 @@ export default function ( } ) { const file = - read( + readFile( filePath ) diff --git a/electron/actions/mainView/setBounds.js b/electron/actions/mainView/setBounds.js new file mode 100644 index 000000000..718376e7f --- /dev/null +++ b/electron/actions/mainView/setBounds.js @@ -0,0 +1,17 @@ +export default function () { + const [ + width, + height + ] = mainWindow.getSize() + + const boundsOptions = { + x: 0, + y: 0, + width, + height + } + + mainView.setBounds( + boundsOptions + ) +} diff --git a/electron/actions/mainWindow/create.js b/electron/actions/mainWindow/create.js index 1530a3daf..247f34341 100644 --- a/electron/actions/mainWindow/create.js +++ b/electron/actions/mainWindow/create.js @@ -1,6 +1,7 @@ import { - BrowserWindow, - screen + BaseWindow, + screen, + WebContentsView } from 'electron' import { windowIcon @@ -14,16 +15,17 @@ import { baseUrl } from '#/helpers/urls' import getElectronStoreKey from '#/actions/electronStore/getKey' -import show from './show' -import hide from './hide' +import showMainWindow from './show' +import hideMainWindow from './hide' import checkForUpdates from '#/actions/app/checkForUpdates' -import setScale from './setScale' +import setMainWindowScale from './setScale' import callExit from '#/actions/app/callExit' import { handleNewWindow } from '#/handlers/app' import setTrayMenu from '#/actions/tray/setMenu' import setTabsBounds from '#/actions/tabs/setBounds' +import setMainViewBounds from '#/actions/mainView/setBounds' function handleReadyToShow () { const isMaximizeOnStart = @@ -35,7 +37,7 @@ function handleReadyToShow () { mainWindow.maximize() } - show() + showMainWindow() checkForUpdates() @@ -44,7 +46,7 @@ function handleReadyToShow () { 'layout.scale' ) - setScale( + setMainWindowScale( scale ) } @@ -53,6 +55,12 @@ function handleShow () { setTrayMenu() } +function handleResize () { + setMainViewBounds() + + setTabsBounds() +} + function handleHide () { setTrayMenu() } @@ -70,49 +78,19 @@ function handleClose ( if (isExitOnClose) { callExit() } else { - hide() - } -} - -function maximize () { - const { - width, - height - } = screen.getPrimaryDisplay().size - - mainWindow.setSize( - width, - height - ) -} - -function handleMaximizeChange () { - if (!isMaximized) { - isMaximized = true - - maximize() + hideMainWindow() } } -function handleUnmaximizeChange () { - isMaximized = false -} - -function handleEnterFullScreen () { - setTabsBounds() -} - -function handleLeaveFullScreen () { - setTabsBounds() -} - export default function () { const mainWindowWidth = 900 const mainWindowHeight = 600 - const options = { + const mainWindowOptions = { width: mainWindowWidth, height: mainWindowHeight, + minWidth: mainWindowWidth, + minHeight: mainWindowHeight, icon: windowIcon, show: false, webPreferences: { @@ -123,45 +101,68 @@ export default function () { } mainWindow = - new BrowserWindow( - options + new BaseWindow( + mainWindowOptions ) - mainWindow.loadURL( - baseUrl - ) + mainWindow.removeMenu() - mainWindow.setMinimumSize( - mainWindowWidth, - mainWindowHeight - ) + const mainViewOptions = { + webPreferences: { + contextIsolation: false, + devTools: isDevelopment, + nodeIntegration: true + } + } - mainWindow.setMenu( - null - ) + mainView = + new WebContentsView( + mainViewOptions + ) + + setMainViewBounds() + + mainWindow + .contentView + .addChildView( + mainView + ) + + mainView + .webContents + .loadURL( + baseUrl + ) + + handleReadyToShow() if (isShowDevTools) { const devToolsData = { mode: 'detach' } - mainWindow + mainView .webContents .openDevTools( devToolsData ) } - mainWindow.once( - 'ready-to-show', - handleReadyToShow - ) + // mainWindow.once( + // 'ready-to-show', + // handleReadyToShow + // ) mainWindow.on( 'show', handleShow ) + mainWindow.on( + 'resize', + handleResize + ) + mainWindow.on( 'hide', handleHide @@ -172,31 +173,9 @@ export default function () { handleClose ) - mainWindow + mainView .webContents .setWindowOpenHandler( handleNewWindow ) - - if (isLinux) { - mainWindow.on( - 'maximize', - handleMaximizeChange - ) - - mainWindow.on( - 'unmaximize', - handleUnmaximizeChange - ) - } - - mainWindow.on( - 'enter-full-screen', - handleEnterFullScreen - ) - - mainWindow.on( - 'leave-full-screen', - handleLeaveFullScreen - ) } diff --git a/electron/actions/mainWindow/setScale.js b/electron/actions/mainWindow/setScale.js index a2113690a..52051bd24 100644 --- a/electron/actions/mainWindow/setScale.js +++ b/electron/actions/mainWindow/setScale.js @@ -1,7 +1,7 @@ export default function ( value ) { - mainWindow + mainView .webContents .setZoomFactor( value diff --git a/electron/actions/session/createHeadersHandler.js b/electron/actions/session/createHeadersHandler.js index 229d51f4a..7d88b82f0 100644 --- a/electron/actions/session/createHeadersHandler.js +++ b/electron/actions/session/createHeadersHandler.js @@ -8,7 +8,8 @@ function handleBeforeSendHeaders ( ) { details .requestHeaders - .Referer = 'https://www.youtube.com' + .Referer = + 'https://www.youtube.com' const { requestHeaders diff --git a/electron/actions/store/update.js b/electron/actions/store/update.js index 9ee829549..29e109119 100644 --- a/electron/actions/store/update.js +++ b/electron/actions/store/update.js @@ -20,8 +20,8 @@ export default function ( } const views = [ - mainWindow, - aboutWindow, + mainView, + aboutView, ...getTabs() ] diff --git a/electron/actions/tab/clear.js b/electron/actions/tab/clear.js index 16be30bc0..f779e086a 100644 --- a/electron/actions/tab/clear.js +++ b/electron/actions/tab/clear.js @@ -1,17 +1,19 @@ -import find from './find' +import findTab from './find' export default function ( tabId ) { const tab = - find( + findTab( tabId ) if (tab) { - mainWindow.removeBrowserView( - tab - ) + mainWindow + .contentView + .removeChildView( + tab + ) tab .webContents diff --git a/electron/actions/tab/create.js b/electron/actions/tab/create.js index bec73801f..93f59875a 100644 --- a/electron/actions/tab/create.js +++ b/electron/actions/tab/create.js @@ -1,11 +1,11 @@ import { - BrowserView + WebContentsView } from 'electron' import getElectronStoreKey from '#/actions/electronStore/getKey' -import getActiveId from './getActiveId' -import setActive from './setActive' -import setBounds from './setBounds' -import setScale from './setScale' +import getActiveTabId from './getActiveId' +import setActiveTab from './setActive' +import setTabBounds from './setBounds' +import setTabScale from './setScale' import { baseUrl } from '#/helpers/urls' @@ -32,15 +32,18 @@ export default function ( } const tab = - new BrowserView( + new WebContentsView( options ) tab.uuid = uuid + tab.isTab = true - mainWindow.addBrowserView( - tab - ) + mainWindow + .contentView + .addChildView( + tab + ) const isSwitchToNewTab = getElectronStoreKey( @@ -48,25 +51,17 @@ export default function ( ) if (!isSwitchToNewTab) { - setActive( - getActiveId() + setActiveTab( + getActiveTabId() ) } - setBounds( + setTabBounds( tab ) - const autoResizeOptions = { - width: true, - height: true - } - - tab.setAutoResize( - autoResizeOptions - ) - - const url = `${baseUrl}#/${path}` + const url = + `${baseUrl}#/${path}` tab .webContents @@ -86,7 +81,7 @@ export default function ( ) } - mainWindow + mainView .webContents .send( 'add-tab', @@ -112,7 +107,7 @@ export default function ( 'layout.scale' ) - setScale( + setTabScale( tab, scale ) diff --git a/electron/actions/tab/delete.js b/electron/actions/tab/delete.js index 2274d5051..9300de1a1 100644 --- a/electron/actions/tab/delete.js +++ b/electron/actions/tab/delete.js @@ -1,13 +1,13 @@ -import clear from './clear' +import clearTab from './clear' export default function ( tabId ) { - clear( + clearTab( tabId ) - mainWindow + mainView .webContents .send( 'delete-tab', diff --git a/electron/actions/tab/find.js b/electron/actions/tab/find.js index 695b219d9..73585cce4 100644 --- a/electron/actions/tab/find.js +++ b/electron/actions/tab/find.js @@ -6,7 +6,9 @@ export default function ( function isMatchedTab ( tabData ) { - return tabData.uuid === tabId + return ( + tabData.uuid === tabId + ) } return getTabs().find( diff --git a/electron/actions/tab/isReplaceActive.js b/electron/actions/tab/isReplaceActive.js index 986b24dce..13cb0bce4 100644 --- a/electron/actions/tab/isReplaceActive.js +++ b/electron/actions/tab/isReplaceActive.js @@ -1,5 +1,5 @@ import getTabs from '#/actions/tabs/get' -import getActiveId from './getActiveId' +import getActiveTabId from './getActiveId' export default function ( tabId @@ -8,7 +8,7 @@ export default function ( getTabs().length > 1 const isActive = ( - tabId === getActiveId() + tabId === getActiveTabId() ) return ( diff --git a/electron/actions/tab/replaceActive.js b/electron/actions/tab/replaceActive.js index 802d3c108..ae8daa8e2 100644 --- a/electron/actions/tab/replaceActive.js +++ b/electron/actions/tab/replaceActive.js @@ -1,12 +1,12 @@ -import findIndex from './findIndex' +import findTabIndex from './findIndex' import getTabs from '#/actions/tabs/get' -import setActive from './setActive' +import setActiveTab from './setActive' export default function ( tabId ) { const tabIndex = - findIndex( + findTabIndex( tabId ) @@ -18,7 +18,7 @@ export default function ( newActiveTabIndex ].uuid - setActive( + setActiveTab( newActiveTabId ) } diff --git a/electron/actions/tab/setActive.js b/electron/actions/tab/setActive.js index 0c4317f69..4a0bbed1f 100644 --- a/electron/actions/tab/setActive.js +++ b/electron/actions/tab/setActive.js @@ -1,18 +1,25 @@ -import find from './find' +import findTab from './find' +import hideInactiveTabs from '../tabs/hideInactive' export default function ( tabId ) { const tab = - find( + findTab( tabId ) - mainWindow.setTopBrowserView( - tab + tab.setVisible( + true ) - mainWindow + hideInactiveTabs( + { + tabId + } + ) + + mainView .webContents .send( 'set-active-tab', diff --git a/electron/actions/tab/setBounds.js b/electron/actions/tab/setBounds.js index 34470e0b9..271d94e9d 100644 --- a/electron/actions/tab/setBounds.js +++ b/electron/actions/tab/setBounds.js @@ -16,7 +16,7 @@ export default function ( const [ width, height - ] = mainWindow.getContentSize() + ] = mainWindow.getSize() const heightScaled = ( height - topOffsetScaled diff --git a/electron/actions/tab/update.js b/electron/actions/tab/update.js index f1b61f596..d1222dcd5 100644 --- a/electron/actions/tab/update.js +++ b/electron/actions/tab/update.js @@ -1,7 +1,7 @@ export default function ( data ) { - mainWindow + mainView .webContents .send( 'update-tab', diff --git a/electron/actions/tabs/clear.js b/electron/actions/tabs/clear.js index 7d950a0d0..7cd0f37bd 100644 --- a/electron/actions/tabs/clear.js +++ b/electron/actions/tabs/clear.js @@ -1,4 +1,4 @@ -import get from './get' +import getTabs from './get' import clearTab from '#/actions/tab/clear' function getTabId ( @@ -9,7 +9,7 @@ function getTabId ( export default function () { const tabIds = - get().map( + getTabs().map( getTabId ) diff --git a/electron/actions/tabs/get.js b/electron/actions/tabs/get.js index aac3333fa..7e8c94ef7 100644 --- a/electron/actions/tabs/get.js +++ b/electron/actions/tabs/get.js @@ -1,3 +1,14 @@ export default function () { - return mainWindow.getBrowserViews() + function isTab ( + view + ) { + return view.isTab + } + + return mainWindow + .contentView + .children + .filter( + isTab + ) } diff --git a/electron/actions/tabs/hideInactive.js b/electron/actions/tabs/hideInactive.js new file mode 100644 index 000000000..bfe8f66d0 --- /dev/null +++ b/electron/actions/tabs/hideInactive.js @@ -0,0 +1,27 @@ +import getTabs from './get' + +export default function ( + { + tabId + } +) { + function isMatchedTab ( + tab + ) { + return tab.uuid !== tabId + } + + function hideTab ( + tab + ) { + tab.setVisible( + false + ) + } + + getTabs().filter( + isMatchedTab + ).forEach( + hideTab + ) +} diff --git a/electron/actions/tray/create.js b/electron/actions/tray/create.js index 18c61a2fa..d861ad3a3 100644 --- a/electron/actions/tray/create.js +++ b/electron/actions/tray/create.js @@ -4,8 +4,8 @@ import { import { trayIcon } from '#/helpers/icons' -import setMenu from './setMenu' -import setTooltip from './setTooltip' +import setTrayMenu from './setMenu' +import setTrayTooltip from './setTooltip' function handleClick () { mainWindow.show() @@ -16,9 +16,9 @@ export default function () { trayIcon ) - setMenu() + setTrayMenu() - setTooltip() + setTrayTooltip() tray.on( 'click', diff --git a/electron/events/ipc/audio.js b/electron/events/ipc/audio.js deleted file mode 100644 index 1324ea0c5..000000000 --- a/electron/events/ipc/audio.js +++ /dev/null @@ -1,19 +0,0 @@ -import { - ipcMain -} from 'electron' -import { - handleSaveAudio, - handleDeleteAudio -} from '#/handlers/ipc/audio' - -export default function () { - ipcMain.handle( - 'save-audio', - handleSaveAudio - ) - - ipcMain.handle( - 'delete-audio', - handleDeleteAudio - ) -} diff --git a/electron/events/ipc/audioFile.js b/electron/events/ipc/audioFile.js index 4da1ed703..8e29ff7bd 100644 --- a/electron/events/ipc/audioFile.js +++ b/electron/events/ipc/audioFile.js @@ -2,10 +2,22 @@ import { ipcMain } from 'electron' import { + handleSaveAudioFile, + handleDeleteAudioFile, handleReadAudioFileMetadata } from '#/handlers/ipc/audioFile' export default function () { + ipcMain.handle( + 'save-audio-file', + handleSaveAudioFile + ) + + ipcMain.handle( + 'delete-audio-file', + handleDeleteAudioFile + ) + ipcMain.handle( 'read-audio-file-metadata', handleReadAudioFileMetadata diff --git a/electron/handlers/app.js b/electron/handlers/app.js index 37242d408..971f69e7d 100644 --- a/electron/handlers/app.js +++ b/electron/handlers/app.js @@ -20,7 +20,7 @@ export function handleNewWindow ( url } - mainWindow + mainView .webContents .send( 'open-external-url', diff --git a/electron/handlers/ipc/audio.js b/electron/handlers/ipc/audio.js deleted file mode 100644 index abc81f721..000000000 --- a/electron/handlers/ipc/audio.js +++ /dev/null @@ -1,39 +0,0 @@ -import saveAudio from '#/actions/audio/save' -import deleteAudio from '#/actions/audio/delete' - -export function handleSaveAudio ( - _, - { - trackData - } -) { - const trackDataFormatted = - JSON.parse( - trackData - ) - - return saveAudio( - { - trackData: - trackDataFormatted - } - ) -} - -export function handleDeleteAudio ( - _, - data -) { - const dataFormatted = - JSON.parse( - data - ) - - const { - fileName - } = dataFormatted - - return deleteAudio( - fileName - ) -} diff --git a/electron/handlers/ipc/audioFile.js b/electron/handlers/ipc/audioFile.js index a3bc5a072..9a8031859 100644 --- a/electron/handlers/ipc/audioFile.js +++ b/electron/handlers/ipc/audioFile.js @@ -1,5 +1,44 @@ +import saveAudioFile from '#/actions/audioFile/save' +import deleteAudioFile from '#/actions/audioFile/delete' import readAudioFileMetadata from '#/actions/audioFile/readMetadata' +export function handleSaveAudioFile ( + _, + { + trackData + } +) { + const trackDataFormatted = + JSON.parse( + trackData + ) + + return saveAudioFile( + { + trackData: + trackDataFormatted + } + ) +} + +export function handleDeleteAudioFile ( + _, + data +) { + const dataFormatted = + JSON.parse( + data + ) + + const { + fileName + } = dataFormatted + + return deleteAudioFile( + fileName + ) +} + export function handleReadAudioFileMetadata ( _, { diff --git a/src/components/modals/savedTracks/BaseSavedTrackDeleteModal.vue b/src/components/modals/savedTracks/BaseSavedTrackDeleteModal.vue index dc00bc0ab..d2f453196 100644 --- a/src/components/modals/savedTracks/BaseSavedTrackDeleteModal.vue +++ b/src/components/modals/savedTracks/BaseSavedTrackDeleteModal.vue @@ -66,7 +66,7 @@ export default { ) await ipcRenderer.invoke( - 'delete-audio', + 'delete-audio-file', deleteDataFormatted ) diff --git a/src/components/popups/track/BaseTrackOptionsPopup/SaveOption.vue b/src/components/popups/track/BaseTrackOptionsPopup/SaveOption.vue index 847db940f..1fe2d5ce6 100644 --- a/src/components/popups/track/BaseTrackOptionsPopup/SaveOption.vue +++ b/src/components/popups/track/BaseTrackOptionsPopup/SaveOption.vue @@ -96,7 +96,7 @@ export default { ) ipcRenderer.invoke( - 'save-audio', + 'save-audio-file', { trackData: trackDataFormatted From 1db2664ceda67670694838bae1b2c21c7f1a9465 Mon Sep 17 00:00:00 2001 From: staniel359 Date: Sun, 28 Apr 2024 17:18:45 +0300 Subject: [PATCH 02/14] Add preloading views light/dark background logic --- electron/actions/aboutWindow/create.js | 6 +++++ electron/actions/app/setEvents.js | 3 +++ electron/actions/mainWindow/create.js | 10 +++++++ electron/actions/tab/create.js | 6 +++++ .../actions/view/changeBackgroundColor.js | 26 +++++++++++++++++++ electron/events/electronStore.js | 11 ++++++++ electron/handlers/electronStore.js | 17 ++++++++++++ electron/helpers/data.js | 12 --------- electron/helpers/utils.js | 21 ++++++++++++--- electron/plugins/electronStore.js | 3 ++- src/assets/styles/Global.sass | 1 + 11 files changed, 100 insertions(+), 16 deletions(-) create mode 100644 electron/actions/view/changeBackgroundColor.js create mode 100644 electron/events/electronStore.js create mode 100644 electron/handlers/electronStore.js delete mode 100644 electron/helpers/data.js diff --git a/electron/actions/aboutWindow/create.js b/electron/actions/aboutWindow/create.js index 5bbb8639f..60bc63291 100644 --- a/electron/actions/aboutWindow/create.js +++ b/electron/actions/aboutWindow/create.js @@ -9,6 +9,8 @@ import { baseUrl } from '#/helpers/urls' import setAboutViewBounds from '#/actions/aboutView/setBounds' +import changeViewBackgroundColor + from '#/actions/view/changeBackgroundColor' function handleClose ( event @@ -45,6 +47,10 @@ export default function () { aboutWindow.removeMenu() + changeViewBackgroundColor( + aboutWindow + ) + const aboutViewOptions = { webPreferences: { contextIsolation: false, diff --git a/electron/actions/app/setEvents.js b/electron/actions/app/setEvents.js index 4d606d497..f78eed080 100644 --- a/electron/actions/app/setEvents.js +++ b/electron/actions/app/setEvents.js @@ -1,4 +1,5 @@ import setAppEvents from '#/events/app' +import setElectronStoreEvents from '#/events/electronStore' import setNativeThemeEvents from '#/events/nativeTheme' import setIpcAppEvents from '#/events/ipc/app' import setIpcTrayEvents from '#/events/ipc/tray' @@ -14,6 +15,8 @@ import setIpcDiscordEvents from '#/events/ipc/discord' export default function () { setAppEvents() + setElectronStoreEvents() + setNativeThemeEvents() setIpcAppEvents() diff --git a/electron/actions/mainWindow/create.js b/electron/actions/mainWindow/create.js index 247f34341..1384c499f 100644 --- a/electron/actions/mainWindow/create.js +++ b/electron/actions/mainWindow/create.js @@ -26,6 +26,8 @@ import { import setTrayMenu from '#/actions/tray/setMenu' import setTabsBounds from '#/actions/tabs/setBounds' import setMainViewBounds from '#/actions/mainView/setBounds' +import changeViewBackgroundColor + from '#/actions/view/changeBackgroundColor' function handleReadyToShow () { const isMaximizeOnStart = @@ -107,6 +109,10 @@ export default function () { mainWindow.removeMenu() + changeViewBackgroundColor( + mainWindow + ) + const mainViewOptions = { webPreferences: { contextIsolation: false, @@ -120,6 +126,10 @@ export default function () { mainViewOptions ) + changeViewBackgroundColor( + mainWindow + ) + setMainViewBounds() mainWindow diff --git a/electron/actions/tab/create.js b/electron/actions/tab/create.js index 93f59875a..a634aacc5 100644 --- a/electron/actions/tab/create.js +++ b/electron/actions/tab/create.js @@ -15,6 +15,8 @@ import { import { handleNewWindow } from '#/handlers/app' +import changeViewBackgroundColor + from '#/actions/view/changeBackgroundColor' export default function ( data @@ -39,6 +41,10 @@ export default function ( tab.uuid = uuid tab.isTab = true + changeViewBackgroundColor( + tab + ) + mainWindow .contentView .addChildView( diff --git a/electron/actions/view/changeBackgroundColor.js b/electron/actions/view/changeBackgroundColor.js new file mode 100644 index 000000000..430e61525 --- /dev/null +++ b/electron/actions/view/changeBackgroundColor.js @@ -0,0 +1,26 @@ +import getElectronStoreKey from '#/actions/electronStore/getKey' +import { + colors +} from '#/helpers/utils' + +export default function ( + view +) { + const isDarkMode = + getElectronStoreKey( + 'layout.isDarkMode' + ) + + const { + black, + white + } = colors + + const backgroundColor = ( + isDarkMode ? black : white + ) + + view.setBackgroundColor( + backgroundColor + ) +} diff --git a/electron/events/electronStore.js b/electron/events/electronStore.js new file mode 100644 index 000000000..42d46146c --- /dev/null +++ b/electron/events/electronStore.js @@ -0,0 +1,11 @@ +import electronStore from '../plugins/electronStore' +import { + handleIsDarkModeChange +} from '../handlers/electronStore' + +export default function () { + electronStore.onDidChange( + 'layout.isDarkMode', + handleIsDarkModeChange + ) +} diff --git a/electron/handlers/electronStore.js b/electron/handlers/electronStore.js new file mode 100644 index 000000000..0ef2dad15 --- /dev/null +++ b/electron/handlers/electronStore.js @@ -0,0 +1,17 @@ +import getTabs from '../actions/tabs/get' +import changeViewBackgroundColor + from '../actions/view/changeBackgroundColor' + +export function handleIsDarkModeChange () { + const views = [ + mainWindow, + mainView, + aboutWindow, + aboutView, + ...getTabs(), + ] + + views.forEach( + changeViewBackgroundColor + ) +} diff --git a/electron/helpers/data.js b/electron/helpers/data.js deleted file mode 100644 index bc7c278b5..000000000 --- a/electron/helpers/data.js +++ /dev/null @@ -1,12 +0,0 @@ -export const harmfulSwitches = [ - 'remote-debugging-port', - 'inspect', - 'inspect-brk', - 'inspect-brk-node', - 'inspect-port', - 'inspect-publish-uid', - 'js-flags', - 'proxy-server', - 'proxy-bypass-list', - 'host-rules' -] diff --git a/electron/helpers/utils.js b/electron/helpers/utils.js index e9249f0ba..808824b73 100644 --- a/electron/helpers/utils.js +++ b/electron/helpers/utils.js @@ -6,14 +6,29 @@ import { existsSync, mkdirSync } from 'fs' -import { - harmfulSwitches -} from '#/helpers/data' export { v4 as generateKey } from 'uuid' +export const colors = { + white: '#ffffff', + black: '#202122' +} + +const harmfulSwitches = [ + 'remote-debugging-port', + 'inspect', + 'inspect-brk', + 'inspect-brk-node', + 'inspect-port', + 'inspect-publish-uid', + 'js-flags', + 'proxy-server', + 'proxy-bypass-list', + 'host-rules' +] + function isHarmfulSwitchesPresent () { for (harmfulSwitch of harmfulSwitches) { if ( diff --git a/electron/plugins/electronStore.js b/electron/plugins/electronStore.js index b79b9d30a..a5d9ddfbb 100644 --- a/electron/plugins/electronStore.js +++ b/electron/plugins/electronStore.js @@ -18,7 +18,8 @@ const options = { accessPropertiesByDotNotation: false, cwd: userDataPath, encryptionKey, - schema + schema, + watch: true } const electronStore = diff --git a/src/assets/styles/Global.sass b/src/assets/styles/Global.sass index 7575056c2..9cb42b839 100644 --- a/src/assets/styles/Global.sass +++ b/src/assets/styles/Global.sass @@ -15,6 +15,7 @@ body &::-webkit-scrollbar @extend .background-white &.inverted + @extend .background-black &::-webkit-scrollbar @extend .background-black From 1718935885a3f3565ea430ace385306b0eb8d9be Mon Sep 17 00:00:00 2001 From: Xyloflake Date: Mon, 29 Apr 2024 00:17:04 +0530 Subject: [PATCH 03/14] Fix Spotify connection guide wrong image lnks --- docs/guides/connections/spotify/README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/guides/connections/spotify/README.md b/docs/guides/connections/spotify/README.md index cd56fdfd7..bdcd3b876 100644 --- a/docs/guides/connections/spotify/README.md +++ b/docs/guides/connections/spotify/README.md @@ -20,16 +20,16 @@ This section describes how to generate them. 1. **Navigate to the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard)** 2. **Click on "Create App" button.** The button to be clicked is surrounded by a red box. - ![alt text](images/img_1.png) + ![alt text](images/img_01.png) You will now see this: - ![alt text](images/img_2.png) + ![alt text](images/img_02.png) 3. **Fill the details.** We use a random name for "App Name" field, a random description. Here, I'm using the name "muf" for the "App Name" and the description "Some desc" for the description. You should now end up with this - ![alt text](images/img_3.png) + ![alt text](images/img_03.png) 4. **This is a very important step.** In the Redirect URI field, paste the following: @@ -37,26 +37,26 @@ This section describes how to generate them. https://178-79-138-81.ip.linodeusercontent.com/code ``` - ![alt text](images/img_4.png) + ![alt text](images/img_04.png) You will finally end up with - ![alt text](images/img_5.png) + ![alt text](images/img_05.png) 5. **Check "I understand and agree with Spotify's Developer Terms of Service and Design Guidelines," then click "Save".** Congratulations! You have now created your Spotify App. ## Connecting your Spotify App to muffon 1. In muffon, go the sidebar and click on "Settings"\ - ![alt text](images/img_6.png) + ![alt text](images/img_06.png) 2. Click on "Connections", then on "Spotify" and finally on "Connect account" - ![alt text](images/img_7.png) + ![alt text](images/img_07.png) You will now see - ![alt text](images/img_9.png) + ![alt text](images/img_09.png) 3. Go to your spotify app in the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard) and navigate to settings. - ![alt text](images/img_8.png) + ![alt text](images/img_08.png) 4. Click on "View **ClientSecret**" ![alt text](images/img_10.png) 5. Copy both the ClientID and ClientSecret separately and paste them into the respective fields in muffon. From 5728670930a38600f3f3e53674a4fe94123e1c0e Mon Sep 17 00:00:00 2001 From: staniel359 Date: Sun, 28 Apr 2024 22:28:56 +0300 Subject: [PATCH 04/14] Improve OS checking in main process --- electron/helpers/utils.js | 57 +++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 14 deletions(-) diff --git a/electron/helpers/utils.js b/electron/helpers/utils.js index 808824b73..bcc28ea66 100644 --- a/electron/helpers/utils.js +++ b/electron/helpers/utils.js @@ -11,6 +11,20 @@ export { v4 as generateKey } from 'uuid' +const platforms = { + windows: [ + 'win32' + ], + macos: [ + 'darwin' + ], + linux: [ + 'linux', + 'freebsd', + 'openbsd' + ] +} + export const colors = { white: '#ffffff', black: '#202122' @@ -51,29 +65,44 @@ export const handleHarmfulSwitches = () => { 'Harmful switches detected' ) - process.exit() // Do not call app.exit(), ask @xyloflake why + // Do not call app.exit(), ask @xyloflake why + process.exit() } } +const { + env, + platform +} = process + export const isDevelopment = ( - process.env.NODE_ENV === 'development' + env.NODE_ENV === 'development' ) export const isShowDevTools = ( - process.env.DEV_TOOLS === 'true' -) - -export const isMac = ( - process.platform === 'darwin' -) - -export const isLinux = ( - process.platform === 'linux' + env.DEV_TOOLS === 'true' ) -export const isWindows = ( - process.platform === 'win32' -) +export const isMac = + platforms + .macos + .includes( + platform + ) + +export const isLinux = + platforms + .linux + .includes( + platform + ) + +export const isWindows = + platforms + .windows + .includes( + platform + ) export const isSingleInstance = app.requestSingleInstanceLock() From c84d115e52162066791c99d00515509b93794478 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 29 Apr 2024 17:02:43 +0200 Subject: [PATCH 05/14] add gen z translation (setup) --- README.md | 1 + src/helpers/data/locales.js | 4 + src/plugins/i18n.js | 14 +- src/plugins/i18n/locales/genz.json | 930 +++++++++++++++++++++++++++++ 4 files changed, 948 insertions(+), 1 deletion(-) create mode 100644 src/plugins/i18n/locales/genz.json diff --git a/README.md b/README.md index 03fae3c9b..ebf2ee99e 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ It retrieves audio, video and metadata from various Internet sources, such as: - Italiano ([@ZinRicky](https://github.com/ZinRicky), [@filipporomani](https://github.com/filipporomani)) - 日本語 ([@xyloflake](https://github.com/xyloflake)) - Русский ([@staniel359](https://github.com/staniel359)) +- Gen Z ([@xyloflake](https://github.com/xyloflake), [@gamersi](https://github.com/gamersi)) ### Technical stack diff --git a/src/helpers/data/locales.js b/src/helpers/data/locales.js index 055162d07..a292a6fb2 100644 --- a/src/helpers/data/locales.js +++ b/src/helpers/data/locales.js @@ -33,5 +33,9 @@ export default [ { id: 'ru', name: 'Русский' + }, + { + id: 'genz', + name: 'Gen Z' } ] diff --git a/src/plugins/i18n.js b/src/plugins/i18n.js index 7f6a029db..1370aff3f 100644 --- a/src/plugins/i18n.js +++ b/src/plugins/i18n.js @@ -9,6 +9,7 @@ import he from './i18n/locales/he.json' import it from './i18n/locales/it.json' import ja from './i18n/locales/ja.json' import ru from './i18n/locales/ru.json' +import genz from './i18n/locales/genz.json' import belarusianRussianPluralizationRule from './i18n/rules/pluralization/beRu.js' @@ -22,7 +23,8 @@ const localesData = { he, it, ja, - ru + ru, + genz } const pluralizationRules = { @@ -119,6 +121,16 @@ if (import.meta.hot) { ) } ) + + import.meta.hot.accept( + './i18n/locales/genz.json', + fileImport => { + i18n.global.setLocaleMessage( + 'genz', + fileImport.default + ) + } + ) } export default i18n diff --git a/src/plugins/i18n/locales/genz.json b/src/plugins/i18n/locales/genz.json new file mode 100644 index 000000000..e98f34746 --- /dev/null +++ b/src/plugins/i18n/locales/genz.json @@ -0,0 +1,930 @@ +{ + "navigation": { + "home": "Home page", + "artists": "Artists", + "artist": "Artist", + "albums": "Albums", + "albumGroups": "Album groups", + "tracks": "Tracks", + "tags": "Tags", + "tag": "Tag", + "similar": "Similar", + "images": "Images", + "lyrics": "Lyrics", + "videos": "Videos", + "videoChannels": "Video channels", + "videoMixes": "Video mixes", + "videoPlaylists": "Video playlists", + "related": "Related", + "top": "Top", + "topCollection": { + "artists": "Top artists", + "albums": "Top albums", + "tracks": "Top tracks", + "tags": "Top tags" + }, + "releases": "Releases", + "releasesCollection": { + "new": "New releases", + "upcoming": "Upcoming releases" + }, + "new": "New", + "upcoming": "Upcoming", + "radio": "Radio", + "multitag": "Multitag search", + "profiles": "Profiles", + "feed": "Feed", + "posts": "Posts", + "conversations": "Conversations", + "library": "Library", + "recommendations": "Recommendations", + "recommendationsCollection": { + "artists": "Recommended artists", + "tracks": "Recommended tracks" + }, + "savedTracks": "Saved tracks", + "playlists": "Playlists", + "favorites": "Favorites", + "bookmarks": "Bookmarks", + "bookmarksCollection": { + "artists": "Bookmarked artists", + "albums": "Bookmarked albums", + "tracks": "Bookmarked tracks", + "videos": "Bookmarked videos", + "videoChannels": "Bookmarked video channels", + "videoPlaylists": "Bookmarked video playlists" + }, + "communities": "Communities", + "history": "History", + "historyCollection": { + "activity": "Activity history", + "player": "Player history", + "browser": "Browser history" + }, + "activity": "Activity", + "player": "Player", + "browser": "Browser", + "settings": "Settings", + "model": { + "artists": "{modelName} artists", + "albums": "{modelName} albums", + "tracks": "{modelName} tracks", + "tags": "{modelName} tags", + "similar": "{modelName} similar", + "images": "{modelName} images", + "lyrics": "{modelName} lyrics", + "videos": "{modelName} videos", + "related": "{modelName} related", + "posts": "{modelName} posts", + "library": "{modelName} library", + "playlists": "{modelName} playlists", + "favorites": "{modelName} favorites", + "favoritesCollection": { + "artists": "{modelName} favorite artists", + "albums": "{modelName} favorite albums", + "tracks": "{modelName} favorite tracks", + "videos": "{modelName} favorite videos" + }, + "communities": "{modelName} communities", + "shows": "{modelName} shows" + }, + "search": "Search", + "queue": "Queue", + "whatsNew": "What's new", + "listenedRecently": "Listened recently", + "shows": "Shows", + "listeningNow": "Listening now", + "help": "Help" + }, + "errors": { + "badRequest": { + "header": "Bad request", + "content": "You sent some sus data." + }, + "forbidden": { + "header": "Not cool, bro", + "content": "Sorry fam, you ain't got the rights for that move." + }, + "notFound": { + "header": "Big oof", + "content": "Nah fam, ain't nothing here." + }, + "internalServer": { + "header": "Server acting sus", + "content": "Hit us up if you need help." + }, + "badGateway": { + "header": "Remote server trippin", + "content": "Give it a sec, then try again." + }, + "gatewayTimeout": { + "header": "Remote server ghosted you", + "content": "Give it a sec, then try again." + }, + "connection": { + "header": "Connection yeeted", + "content": "Give it a sec, then try again." + }, + "client": { + "header": "Your device acting sus", + "content": "Hit us up if you need help." + } + }, + "actions": { + "login": "Log in", + "logout": "Log out", + "signup": "Sign up", + "add": "Add", + "create": "Create", + "edit": "Edit", + "save": "Save", + "cancel": "Cancel", + "delete": "Delete", + "clear": "Clear", + "retry": "Retry", + "post": "Post", + "send": "Send", + "next": "Next", + "upload": "Upload", + "back": "Go back", + "sendCode": "Send code", + "share": "Share", + "search": "Search", + "filter": "Filter", + "confirm": "Confirm", + "import": "Import", + "close": "Close", + "openLink": "Open link", + "addFrom": { + "search": "From search", + "library": "From library" + }, + "importFrom": { + "drive": "From drive", + "account": "From account" + }, + "searchIn": { + "source": "Search in source", + "sources": "Search in sources" + }, + "searchFor": { + "video": "Search for video", + "lyrics": "Search for lyrics" + }, + "importFromAccount": { + "lastfm": "Import from Last.FM", + "spotify": "Import from Spotify" + }, + "selectModel": { + "folder": "Select folder" + }, + "createModel": { + "playlist": "Create playlist", + "community": "Create community", + "post": "Create post" + }, + "addModel": { + "comment": "Add comment" + }, + "addTo": { + "library": "Add to library", + "playlist": "Add to playlist", + "favorites": "Add to favorites", + "bookmarks": "Add to bookmarks", + "listened": "Add to listened", + "watched": "Add to watched", + "queue": "Add to queue", + "savedTracks": "Add to saved tracks" + }, + "show": { + "library": "Show in library", + "page": "Show page" + }, + "deleteFrom": { + "favorites": "Delete from favorites", + "bookmarks": "Delete from bookmarks", + "listened": "Delete from listened", + "watched": "Delete from watched" + }, + "externalLink": { + "open": "Open external link", + "original": "Original", + "streaming": "Streaming" + } + }, + "links": { + "playlists": "All playlists", + "communities": "All communities" + }, + "inputs": { + "search": "Search...", + "content": "Write something..." + }, + "modals": { + "delete": { + "header": { + "libraryModel": { + "artist": "Delete artist from library", + "album": "Delete album from library", + "track": "Delete track from library" + }, + "recommendationModel": { + "artist": "Delete artist from recommendations", + "track": "Delete track from recommendations" + }, + "playlist": "Delete playlist", + "playlistTrack": "Delete track from playlist", + "savedTrack": "Delete track from saved tracks", + "favorite": { + "artist": "Delete artist from favorites", + "album": "Delete album from favorites", + "track": "Delete track from favorites", + "video": "Delete video from favorites" + }, + "bookmark": { + "artist": "Delete artist from bookmarks", + "album": "Delete album from bookmarks", + "track": "Delete track from bookmarks", + "video": "Delete video from bookmarks", + "videoChannel": "Delete video channel from bookmarks", + "videoPlaylist": "Delete video playlist from bookmarks" + }, + "post": "Delete post", + "comment": "Delete comment", + "community": "Delete community", + "account": "Delete account", + "library": "Delete library", + "history": { + "activity": "Delete activity history", + "browser": "Delete browser history", + "player": "Delete player history" + } + }, + "going": { + "libraryModel": "You are going to delete {modelName} from your library.", + "recommendationModel": "You are going to delete {modelName} from your recommendations.", + "playlist": "You are going to delete {modelName} from your playlists.", + "playlistTrack": "You are going to delete {modelName} from {parentModelName} playlist.", + "savedTrack": "You are going to delete {modelName} from your saved tracks.", + "favorite": "You are going to delete {modelName} from your favorites.", + "bookmark": "You are going to delete {modelName} from your bookmarks.", + "post": "You are going to delete this post.", + "comment": "You are going to delete this comment.", + "community": "You are going to delete this community.", + "account": "You are going to delete your account.", + "library": "You are going to delete your library.", + "history": { + "activity": "You are going to delete your activity history.", + "browser": "You are going to delete your browser history.", + "player": "You are going to delete your player history." + } + }, + "also": { + "libraryModel": { + "artist": "This will also delete all this artist's albums and tracks.", + "album": "This will also delete all this album's tracks." + }, + "playlist": "This will also delete all this playlist's tracks.", + "community": "This will also delete all this community's posts.", + "account": [ + "This will also delete your following data:", + "- library\n- recommendations\n- playlists\n- favorites\n- bookmarks\n- listened\n- your page posts\n- subscriptions\n- history", + "This data will remain, but your nickname won't be displayed:", + "- created posts\n- created comments\n- conversations with you\n- created communities", + "And this data will remain unchanged:", + "- saved tracks\n- background images\n- settings" + ], + "library": [ + "This will delete your following data:", + "- artists\n- albums\n- tracks\n- recommendations" + ] + }, + "undo": "You can't undo this action!", + "sure": "Are you sure?" + } + }, + "forms": { + "fields": { + "email": "Email", + "password": "Password", + "passwordConfirmation": "Password confirmation", + "passwordResetCode": "Password reset code", + "nickname": "Nickname", + "title": "Title", + "description": "Description", + "gender": "Gender", + "birthdate": "Birth date", + "country": "Country", + "city": "City", + "status": "Status", + "clientId": "Client ID", + "clientSecret": "Client secret", + "genders": { + "male": "Male", + "female": "Female", + "other": "Other" + }, + "legal": { + "header": "I agree to the {privacyPolicy} and the {termsAndConditions}", + "privacyPolicy": "Privacy Policy", + "termsAndConditions": "Terms And Conditions" + }, + "remember": "Remember me", + "asCommunity": "As community" + }, + "extra": "Additional info", + "errors": { + "notFound": "Profile is not found", + "empty": { + "email": "Email is empty", + "password": "Password is empty", + "passwordConfirmation": "Password confirmation is empty", + "passwordResetCode": "Password reset code is empty", + "nickname": "Nickname is empty", + "title": "Title is empty", + "clientId": "Client ID is empty", + "clientSecret": "Client secret is empty", + "legal": "You must agree to the Privacy Policy and the Terms And Conditions" + }, + "invalid": { + "email": "Email is invalid" + }, + "taken": { + "email": "Email is taken", + "nickname": "Nickname is taken", + "title": "Title is taken" + }, + "tooShort": { + "password": "Password is too short" + }, + "tooLong": { + "nickname": "Nickname is too long" + }, + "confirmation": { + "passwordConfirmation": "Password and its confirmation don't match" + }, + "wrong": { + "password": "Wrong password", + "passwordResetCode": "Wrong password reset code" + } + }, + "confirm": { + "password": "Please confirm your password:" + } + }, + "notifications": { + "scrobbled": "Track {trackFullTitle} has been scrobbled", + "added": { + "queue": { + "track": "Track {trackFullTitle} has been added to queue", + "tracks": "{counter} has been added to queue | {counter} have been added to queue" + }, + "savedTracks": { + "track": "Track {trackFullTitle} has been added to saved tracks" + } + }, + "updated": { + "profile": "Profile has been updated", + "post": "Post has been updated", + "comment": "Comment has been updated", + "playlist": "Playlist {playlistTitle} has been updated", + "community": "Community {communityTitle} has been updated" + }, + "deleted": { + "libraryModel": { + "artist": "Artist {modelName} has been deleted from your library", + "album": "Album {modelName} has been deleted from your library", + "track": "Track {modelName} has been deleted from your library" + }, + "playlist": "Playlist {playlistTitle} has been deleted", + "community": "Community {communityTitle} has been deleted", + "account": "Your account has been deleted", + "library": "Your library has been deleted", + "history": { + "activity": "Activity history has been deleted", + "browser": "Browser history has been deleted", + "player": "Player history has been deleted" + } + }, + "copied": "Link is copied to clipboard", + "cleared": { + "cache": "Cache has been cleared", + "searchHistory": "Search history has been cleared" + } + }, + "counters": { + "nominative": { + "artists": "{count} artist | {count} artists", + "albums": "{count} album | {count} albums", + "tracks": "{count} track | {count} tracks", + "videos": "{count} video | {count} videos", + "files": "{count} file | {count} files", + "plays": "{count} play | {count} plays", + "followers": "{count} follower | {count} followers", + "following": "{count} following", + "members": "{count} member | {count} members", + "playlists": "{count} playlist | {count} playlists" + }, + "genitive": { + "artists": "{count} artist | {count} artists", + "albums": "{count} album | {count} albums", + "tracks": "{count} track | {count} tracks", + "files": "{count} file | {count} files", + "plays": "{count} play | {count} plays", + "playlists": "{count} playlist | {count} playlists" + }, + "accusative": { + "artists": "{count} artist | {count} artists", + "albums": "{count} album | {count} albums", + "tracks": "{count} track | {count} tracks", + "files": "{count} file | {count} files", + "playlists": "{count} playlist | {count} playlists" + } + }, + "select": { + "source": "Select source:", + "type": "Select type:", + "album": "Select album:", + "group": "Select album group:", + "artist": "Select artist:", + "track": "Select track:", + "country": "Select country:", + "video": "Select video:", + "lyrics": "Select lyrics:" + }, + "sources": { + "audio": "Audio", + "other": "Other", + "albumTypes": { + "album": "Album", + "group": "Album group", + "track": "Track" + }, + "albumsTypes": { + "album": "Albums", + "single": "Singles", + "ep": "EPs", + "singleEp": "Singles / EPs", + "compilation": "Compilations", + "video": "Videos", + "misc": "Miscellaneous", + "appearance": "Appearances", + "live": "Live" + }, + "videoTypes": { + "video": "Video", + "track": "Track" + } + }, + "player": { + "variants": "Variants ({count})", + "audio": { + "bitrate": "{value} kbit/s", + "equalizer": { + "decibel": "{value} dB", + "hertz": "{value} Hz", + "kilohertz": "{value} kHz" + } + } + }, + "settings": { + "tabs": { + "app": "App", + "profile": "Profile", + "connections": "Connections" + }, + "sections": { + "interface": "Interface", + "theme": "Theme", + "window": "Window", + "tabs": "Tabs", + "sidebar": "Sidebar", + "video": "Video", + "data": "Data", + "info": "Info", + "account": "Account", + "other": "Other" + }, + "options": { + "app": { + "interface": { + "language": "Language", + "timezone": "Time zone", + "infiniteScroll": "Infinite scroll", + "artistPopup": "Show artist info on link hover", + "innerCounters": "Show muffon listeners counters", + "cachePages": "Cache pages", + "scale": "Scale" + }, + "theme": { + "dark": "Dark mode", + "system": "System theme", + "background": "Background", + "transparency": "Transparency" + }, + "window": { + "maximize": "Maximize on start", + "exit": "Exit on close" + }, + "tabs": { + "newTabSwitch": "Switch to new tab", + "closeOnExit": "Close tabs on exit" + }, + "search": { + "source": "Source", + "scope": "Scope", + "resultsFullSize": "Show results in full size", + "history": { + "clear": "Clear search history" + } + }, + "player": { + "audioSources": "Audio sources (by priority)", + "bitrate": "Show audio bitrate", + "album": "Show album", + "equalizer": "Show equalizer", + "focusPlaying": "Focus on current track" + }, + "queue": { + "autoplay": "Autoplay", + "clear": "Clear on player close" + }, + "video": { + "autoplay": "Autoplay" + }, + "recommendations": { + "hideLibraryArtists": "Hide library artists", + "tracksCount": "with tracks count", + "hideListenedArtists": "Hide listened artists", + "hideLibraryTracks": "Hide library tracks", + "hideListenedTracks": "Hide listened tracks" + }, + "top": { + "country": "Default country" + }, + "lyrics": { + "annotations": "Show annotations" + }, + "history": { + "activity": { + "delete": "Delete activity history" + }, + "player": { + "delete": "Delete player history" + }, + "browser": { + "delete": "Delete browser history" + } + }, + "other": { + "clearCache": "Clear cache" + } + }, + "profile": { + "player": { + "playing": "Show current track on page" + }, + "data": { + "account": { + "delete": "Delete account" + }, + "library": { + "delete": "Delete library" + } + } + }, + "connections": { + "lastfm": { + "scrobbling": "Scrobbling", + "scrobbleNotifications": "Scrobble notifications", + "scrobblePercent": "Scrobble after" + }, + "spotify": { + "link": { + "description": "To connect your Spotify account please follow [a link=guide]this guide[/a]." + } + }, + "discord": { + "richPresence": { + "header": "Enable Rich Presence", + "client": "Before enabling make sure your Discord desktop client is running", + "buttons": { + "header": "Buttons", + "select": { + "first": "Select first:", + "second": "Select second:" + }, + "options": { + "downloadApp": "Download muffon", + "listenTrack": "Listen to the track", + "lastfmProfile": "My Last.FM page", + "spotifyProfile": "My Spotify page", + "muffonProfile": "My muffon page" + } + } + } + } + } + } + }, + "track": { + "source": "Via {source}" + }, + "recommended": { + "header": "Recommended to you", + "based": "Based on your:" + }, + "signup": { + "text": "Don't have an account?", + "link": "Sign up" + }, + "login": { + "text": "Already signed up?", + "link": "Log in" + }, + "passwordReset": { + "text": "Forgot password?", + "link": "Reset", + "code": { + "sent": "Password reset code has been sent to your email" + }, + "updated": { + "header": "Your password has been updated", + "content": "Now you may go back and login" + } + }, + "anonymous": { + "continue": "Continue anonymously", + "nickname": "Anonymous" + }, + "roles": { + "creator": "Creator" + }, + "relationships": { + "followed": "Following you", + "following": "You are following", + "follow": "Follow", + "unfollow": "Unfollow" + }, + "memberships": { + "joined": "You have joined", + "join": "Join", + "leave": "Leave" + }, + "message": { + "send": "Send message", + "sent": { + "header": "Message has been sent", + "content": "Go to conversation" + } + }, + "compatibility": { + "header": "Your compatibility level with {profileNickname}", + "common": "You have in common:" + }, + "recommendation": { + "similar": "Similar to {counter}:" + }, + "import": { + "lastfm": { + "historyVisible": "Before import make sure that your Last.FM listening history is visible." + }, + "active": "Importing {count} of {counter}...", + "success": { + "header": "{counter} has been imported | {counter} have been imported", + "content": "You may want to check the data before saving to library" + }, + "error": { + "files": "{counter} could not be imported. Please make sure that metadata format is valid:" + } + }, + "save": { + "active": "Saving {count} of {counter}...", + "success": { + "library": { + "artists": "{counter} has been added to library | {counter} have been added to library", + "albums": "{counter} has been added to library | {counter} have been added to library", + "tracks": "{counter} has been added to library | {counter} have been added to library" + }, + "playlist": { + "artists": "{counter} has been added to playlist | {counter} have been added to playlist", + "albums": "{counter} has been added to playlist | {counter} have been added to playlist", + "tracks": "{counter} has been added to playlist | {counter} have been added to playlist" + }, + "playlists": { + "playlists": "{counter} has been added to playlists | {counter} have been added to playlists" + }, + "favorites": { + "tracks": "{counter} has been added to favorites | {counter} have been added to favorites" + } + }, + "error": "{counter} could not be added:" + }, + "delete": { + "active": "Deleting {count} of {counter}..." + }, + "connections": { + "connect": "Connect account", + "confirm": { + "token": "Your browser will now open. Confirm connection there and click this button again.", + "code": "Your browser will now open. Confirm connection there, paste the received code and click this button again." + }, + "disconnect": "Disconnect account" + }, + "accounts": { + "premium": "Premium" + }, + "noCollection": { + "header": { + "artists": "No artists", + "albums": "No albums", + "groups": "No album groups", + "tracks": "No tracks", + "similar": "No similar", + "tags": "No tags", + "posts": "No posts", + "feed": "No posts", + "conversations": "No conversations", + "messages": "No messages", + "followers": "No followers", + "following": "No following", + "recommendations": "No recommendations", + "playlists": "No playlists", + "communities": "No communities", + "members": "No members", + "videos": "No videos", + "videoChannels": "No video channels", + "videoMixes": "No video mixes", + "videoPlaylists": "No video playlists", + "related": "No related", + "listeners": "No listeners", + "images": "No images", + "events": "No events", + "profiles": "No profiles", + "shows": "No shows" + }, + "content": "Looks like there is nothing here" + }, + "deleted": { + "artist": "Artist has been deleted", + "album": "Album has been deleted", + "track": "Track has been deleted", + "recommendation": "Recommendation has been deleted", + "playlist": "Playlist has been deleted", + "post": "Post has been deleted", + "comment": "Comment has been deleted", + "video": "Video has been deleted", + "videoChannel": "Video channel has been deleted", + "videoPlaylist": "Video playlist has been deleted" + }, + "messages": { + "welcome": "Welcome, {profileNickname}" + }, + "profile": { + "wasOnline": "Was online" + }, + "feed": { + "global": "Global feed" + }, + "about": { + "license": "{license} license", + "homepage": "Home page", + "contact": "Contact" + }, + "private": { + "playlist": "Private", + "profile": "Private" + }, + "donate": { + "header": "Donate", + "content": [ + "muffon is a non-profit project that has nor ads, neither any paid features or content.", + "But, of course, it cannot exist without funds, that are needed for its development and infrastructure.", + "A lot of time and effort were put into creating this project, and it would be good if all of the invested would pay off.", + "So I ask for your help in muffon support.", + "Would you like to make a donation?" + ], + "actions": { + "decline": "No, thanks", + "later": "Maybe later", + "accept": "Yeah, sure" + } + }, + "lists": { + "simple": "Simple list", + "table": "Table", + "extended": "Detailed list" + }, + "orders": { + "createdDesc": "Newest", + "createdAsc": "Oldest", + "updatedDesc": "Most recently updated", + "updatedAsc": "Least recently updated", + "artistsCountDesc": "Most artists", + "artistsCountAsc": "Least artists", + "albumsCountDesc": "Most albums", + "albumsCountAsc": "Least albums", + "tracksCountDesc": "Most tracks", + "tracksCountAsc": "Least tracks", + "followersCountDesc": "Most followers", + "followersCountAsc": "Least followers", + "joinedDesc": "Most recently joined", + "joinedAsc": "Least recently joined", + "membersCountDesc": "Most members", + "membersCountAsc": "Least members" + }, + "deletedModel": { + "profile": "Deleted profile" + }, + "events": { + "created": { + "profile": "Profile is created", + "bookmarkAlbum": "Album {modelName} is added to bookmarks", + "bookmarkArtist": "Artist {modelName} is added to bookmarks", + "bookmarkTrack": "Track {modelName} is added to bookmarks", + "bookmarkVideo": "Video {modelName} is added to bookmarks", + "bookmarkVideoChannel": "Video channel {modelName} is added to bookmarks", + "bookmarkVideoPlaylist": "Video playlist {modelName} is added to bookmarks", + "favoriteAlbum": "Album {modelName} is added to favorites", + "favoriteArtist": "Artist {modelName} is added to favorites", + "favoriteTrack": "Track {modelName} is added to favorites", + "favoriteVideo": "Video {modelName} is added to favorites", + "libraryAlbum": "Album {modelName} is added to library", + "libraryArtist": "Artist {modelName} is added to library", + "libraryTrack": "Track {modelName} is added to library", + "listenedAlbum": "Album {modelName} is added to listened", + "listenedArtist": "Artist {modelName} is added to listened", + "listenedTrack": "Track {modelName} is added to listened", + "watchedVideo": "Video {modelName} is added to watched", + "playlistTrack": "Track {modelName} is added to playlist {playlistTitle}", + "community": "Community {modelName} is created", + "relationship": "You followed {modelName}", + "post": "Post {modelName} is created", + "postComment": "Comment {modelName} is created", + "playlist": "Playlist {modelName} is created", + "conversation": "You started conversation with {modelName}", + "membership": "You joined community {modelName}" + }, + "updated": { + "profile": "Profile is updated", + "community": "Community {modelName} is updated", + "post": "Post {modelName} is updated", + "postComment": "Comment {modelName} is updated", + "playlist": "Playlist {modelName} is updated" + }, + "deleted": { + "bookmarkAlbum": "Album {modelName} is deleted from bookmarks", + "bookmarkArtist": "Artist {modelName} is deleted from bookmarks", + "bookmarkTrack": "Track {modelName} is deleted from bookmarks", + "bookmarkVideo": "Video {modelName} is deleted from bookmarks", + "bookmarkVideoChannel": "Video channel {modelName} is deleted from bookmarks", + "bookmarkVideoPlaylist": "Video playlist {modelName} is deleted from bookmarks", + "favoriteAlbum": "Album {modelName} is deleted from favorites", + "favoriteArtist": "Artist {modelName} is deleted from favorites", + "favoriteTrack": "Track {modelName} is deleted from favorites", + "favoriteVideo": "Video {modelName} is deleted from favorites", + "libraryAlbum": "Album {modelName} is deleted from library", + "libraryArtist": "Artist {modelName} is deleted from library", + "libraryTrack": "Track {modelName} is deleted from library", + "listenedAlbum": "Album {modelName} is deleted from listened", + "listenedArtist": "Artist {modelName} is deleted from listened", + "listenedTrack": "Track {modelName} is deleted from listened", + "watchedVideo": "Video {modelName} is deleted from watched", + "playlistTrack": "Track {modelName} is deleted from playlist {playlistTitle}", + "community": "Community {modelName} is deleted", + "recommendationArtist": "Artist {modelName} is deleted from recommendations", + "recommendationTrack": "Track {modelName} is deleted from recommendations", + "relationship": "You unfollowed {modelName}", + "post": "Post {modelName} is deleted", + "postComment": "Comment {modelName} is deleted", + "playlist": "Playlist {modelName} is deleted", + "membership": "You left community {modelName}" + } + }, + "created": { + "profile": "On muffon since", + "library": "In library since", + "community": "Was created" + }, + "filter": { + "include": { + "artists": "With artists", + "tags": "With tags" + }, + "exclude": { + "artists": "Without artists", + "tags": "Without tags" + } + }, + "keyboardShortcuts": { + "header": "Keyboard shortcuts", + "search": "Show search panel", + "audioBackward": "Seek audio backward", + "audioForward": "Seek audio forward", + "radioNextTrack": "Next radio track" + }, + "online": "Online", + "error": "Error", + "more": "More...", + "loading": "Loading..." +} From 95916f016fcb74f737da606980f8314627c41da6 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 29 Apr 2024 21:05:19 +0200 Subject: [PATCH 06/14] fixed genz translation --- electron/plugins/i18n.js | 4 +++- electron/plugins/i18n/locales/genz.json | 14 ++++++++++++++ src/helpers/formatters.js | 6 ++++++ src/plugins/i18nCountries.js | 5 ++++- 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 electron/plugins/i18n/locales/genz.json diff --git a/electron/plugins/i18n.js b/electron/plugins/i18n.js index 6a9d7e8d5..8430866c7 100644 --- a/electron/plugins/i18n.js +++ b/electron/plugins/i18n.js @@ -8,6 +8,7 @@ import he from './i18n/locales/he.json' import it from './i18n/locales/it.json' import ja from './i18n/locales/ja.json' import ru from './i18n/locales/ru.json' +import genz from './i18n/locales/genz.json' // i18n @@ -24,7 +25,8 @@ const localesData = { he, it, ja, - ru + ru, + genz } const options = { diff --git a/electron/plugins/i18n/locales/genz.json b/electron/plugins/i18n/locales/genz.json new file mode 100644 index 000000000..bab4de96e --- /dev/null +++ b/electron/plugins/i18n/locales/genz.json @@ -0,0 +1,14 @@ +{ + "show": "Spill the tea", + "hide": "Yeet it", + "about": "Abt", + "exit": "Dip", + "update": { + "message": "New update droppin', no cap", + "buttons": { + "download": "Cop that", + "close": "Cancel that" + } + } + } + \ No newline at end of file diff --git a/src/helpers/formatters.js b/src/helpers/formatters.js index 18eff0d6e..1910c7875 100644 --- a/src/helpers/formatters.js +++ b/src/helpers/formatters.js @@ -55,6 +55,12 @@ export function number ( language } = profileStore() + if (language === 'genz') { + return value.toLocaleString( + 'en' + ) + } + return value.toLocaleString( language ) diff --git a/src/plugins/i18nCountries.js b/src/plugins/i18nCountries.js index 5dab09b04..e342cc7a0 100644 --- a/src/plugins/i18nCountries.js +++ b/src/plugins/i18nCountries.js @@ -9,6 +9,8 @@ import he from 'i18n-iso-countries/langs/he.json' import it from 'i18n-iso-countries/langs/it.json' import ja from 'i18n-iso-countries/langs/ja.json' import ru from 'i18n-iso-countries/langs/ru.json' +import genz from 'i18n-iso-countries/langs/en.json' +genz.locale = 'genz' // i18n @@ -20,7 +22,8 @@ const locales = [ he, it, ja, - ru + ru, + genz ] function addLocale ( From b7b65bc3004a3b33e90a36925ed51ec4771c22c4 Mon Sep 17 00:00:00 2001 From: Xyloflake Date: Tue, 30 Apr 2024 15:47:05 +0530 Subject: [PATCH 07/14] fix lint error (#168) --- electron/actions/mainWindow/create.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/electron/actions/mainWindow/create.js b/electron/actions/mainWindow/create.js index 1384c499f..7c6955f54 100644 --- a/electron/actions/mainWindow/create.js +++ b/electron/actions/mainWindow/create.js @@ -1,6 +1,5 @@ import { BaseWindow, - screen, WebContentsView } from 'electron' import { @@ -8,7 +7,6 @@ import { } from '#/helpers/icons' import { isDevelopment, - isLinux, isShowDevTools } from '#/helpers/utils' import { From c8e592066a94709e31f5bd299b4fa5fde02033c3 Mon Sep 17 00:00:00 2001 From: Xyloflake Date: Tue, 30 Apr 2024 16:56:26 +0530 Subject: [PATCH 08/14] [feat.] add autoupdate (#169) --- electron/actions/app/checkForUpdates.js | 31 +++++++++++++++++-------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/electron/actions/app/checkForUpdates.js b/electron/actions/app/checkForUpdates.js index 6416e5bf3..e6157a0c3 100644 --- a/electron/actions/app/checkForUpdates.js +++ b/electron/actions/app/checkForUpdates.js @@ -4,6 +4,12 @@ import { shell, net } from 'electron' +import { + autoUpdater +} from 'electron-updater' +import { + isMac +} from '#/helpers/utils' import i18n from 'i18n' let latestRelease @@ -93,14 +99,19 @@ function handleError () { } export default function checkForUpdates () { - const releasesUrl = - 'https://api.github.com/repos/staniel359/muffon/releases/latest' - - net.fetch( - releasesUrl - ).then( - handleSuccess - ).catch( - handleError - ) + if (isMac) { + const releasesUrl = + 'https://api.github.com/repos/staniel359/muffon/releases/latest' + + net.fetch( + releasesUrl + ).then( + handleSuccess + ).catch( + handleError + ) + } else { + autoUpdater.checkForUpdatesAndNotify() + } + } From c0c9dfeae7b929da1709249c43845ad700661fe5 Mon Sep 17 00:00:00 2001 From: Xyloflake Date: Tue, 30 Apr 2024 17:53:08 +0530 Subject: [PATCH 09/14] add electron-updater dependency (#170) --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 0e55abb75..ee5627235 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "discord-rpc": "^4.0.1", "electron-dl": "^3.5.2", "electron-store": "^8.2.0", + "electron-updater": "^6.1.8", "i18n": "^0.15.1", "music-metadata": "^7.14.0", "uuid": "^9.0.1" From b0454af5766e07b055c32e86b81cfc93ed2495f9 Mon Sep 17 00:00:00 2001 From: staniel359 Date: Tue, 30 Apr 2024 23:18:54 +0300 Subject: [PATCH 10/14] Add electron-updater to lockfile --- pnpm-lock.yaml | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b38a6c410..b6e124c32 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,9 @@ importers: electron-store: specifier: ^8.2.0 version: 8.2.0 + electron-updater: + specifier: ^6.1.8 + version: 6.1.8 i18n: specifier: ^0.15.1 version: 0.15.1 @@ -1109,6 +1112,10 @@ packages: buffer@6.0.3: resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} + builder-util-runtime@9.2.3: + resolution: {integrity: sha512-FGhkqXdFFZ5dNC4C+yuQB9ak311rpGAw+/ASz8ZdxwODCv1GGMWgLDeofRkdi0F3VCHQEWy/aXcJQozx2nOPiw==} + engines: {node: '>=12.0.0'} + builder-util-runtime@9.2.4: resolution: {integrity: sha512-upp+biKpN/XZMLim7aguUyW8s0FUpDvOtK6sbanMFDAMBzpHDqdhgVYm6zc9HJ6nWo7u2Lxk60i2M6Jd3aiNrA==} engines: {node: '>=12.0.0'} @@ -1610,6 +1617,9 @@ packages: electron-to-chromium@1.4.750: resolution: {integrity: sha512-9ItEpeu15hW5m8jKdriL+BQrgwDTXEL9pn4SkillWFu73ZNNNQ2BKKLS+ZHv2vC9UkNhosAeyfxOf/5OSeTCPA==} + electron-updater@6.1.8: + resolution: {integrity: sha512-hhOTfaFAd6wRHAfUaBhnAOYc+ymSGCWJLtFkw4xJqOvtpHmIdNHnXDV9m1MHC+A6q08Abx4Ykgyz/R5DGKNAMQ==} + electron@30.0.1: resolution: {integrity: sha512-iwxkI/n2wBd29NH7TH0ZY8aWGzCoKpzJz+D10u7aGSJi1TV6d4MSM3rWyKvT/UkAHkTKOEgYfUyCa2vWQm8L0g==} engines: {node: '>= 12.20.55'} @@ -2927,6 +2937,9 @@ packages: lodash.escape@3.2.0: resolution: {integrity: sha512-n1PZMXgaaDWZDSvuNZ/8XOcYO2hOKDqZel5adtR30VKQAtoWs/5AOeFA0vPV8moiPzlqe7F4cP2tzpFewQyelQ==} + lodash.escaperegexp@4.1.2: + resolution: {integrity: sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==} + lodash.flatten@4.4.0: resolution: {integrity: sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==} @@ -2936,6 +2949,9 @@ packages: lodash.isarray@3.0.4: resolution: {integrity: sha512-JwObCrNJuT0Nnbuecmqr5DgtuBppuCvGD9lxjFpAzwnVtdGoDQ1zig+5W8k5/6Gcn0gZ3936HDAlGd28i7sOGQ==} + lodash.isequal@4.5.0: + resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==} + lodash.isobject@2.4.1: resolution: {integrity: sha512-sTebg2a1PoicYEZXD5PBdQcTlIJ6hUslrlWr7iV0O7n+i4596s2NQ9I5CaZ5FbXSfya/9WQsrYLANUJv9paYVA==} @@ -4187,6 +4203,9 @@ packages: resolution: {integrity: sha512-gLCeArryy2yNTRzTGKbZbloctj64jkZ57hj5zdraXue6aFgd6PmvVtEyiUU+hvU0v7q08oVv8r8ev0tRo6bvgw==} engines: {node: '>=0.10.0'} + tiny-typed-emitter@2.1.0: + resolution: {integrity: sha512-qVtvMxeXbVej0cQWKqVSSAHmKZEHAvxdF8HEUBFWts8h+xEo5m/lEiPakuyZ3BnCBjOD8i24kzNOiOLLgsSxhA==} + tmp-promise@3.0.3: resolution: {integrity: sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==} @@ -5763,6 +5782,13 @@ snapshots: base64-js: 1.5.1 ieee754: 1.2.1 + builder-util-runtime@9.2.3: + dependencies: + debug: 4.3.4 + sax: 1.3.0 + transitivePeerDependencies: + - supports-color + builder-util-runtime@9.2.4: dependencies: debug: 4.3.4 @@ -6416,6 +6442,19 @@ snapshots: electron-to-chromium@1.4.750: {} + electron-updater@6.1.8: + dependencies: + builder-util-runtime: 9.2.3 + fs-extra: 10.1.0 + js-yaml: 4.1.0 + lazy-val: 1.0.5 + lodash.escaperegexp: 4.1.2 + lodash.isequal: 4.5.0 + semver: 7.6.0 + tiny-typed-emitter: 2.1.0 + transitivePeerDependencies: + - supports-color + electron@30.0.1: dependencies: '@electron/get': 2.0.3 @@ -8120,12 +8159,16 @@ snapshots: dependencies: lodash._root: 3.0.1 + lodash.escaperegexp@4.1.2: {} + lodash.flatten@4.4.0: {} lodash.isarguments@3.1.0: {} lodash.isarray@3.0.4: {} + lodash.isequal@4.5.0: {} + lodash.isobject@2.4.1: dependencies: lodash._objecttypes: 2.4.1 @@ -9492,6 +9535,8 @@ snapshots: time-stamp@1.1.0: {} + tiny-typed-emitter@2.1.0: {} + tmp-promise@3.0.3: dependencies: tmp: 0.2.3 From 78688007a07a579fdeb8449dac2fb76d44ff7df8 Mon Sep 17 00:00:00 2001 From: staniel359 Date: Tue, 30 Apr 2024 23:21:47 +0300 Subject: [PATCH 11/14] Disable autoupdate for development --- electron/actions/app/checkForUpdates.js | 32 +++++++++++++++---------- electron/actions/mainWindow/create.js | 4 +++- electron/helpers/utils.js | 3 +++ 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/electron/actions/app/checkForUpdates.js b/electron/actions/app/checkForUpdates.js index e6157a0c3..6ad091352 100644 --- a/electron/actions/app/checkForUpdates.js +++ b/electron/actions/app/checkForUpdates.js @@ -8,7 +8,8 @@ import { autoUpdater } from 'electron-updater' import { - isMac + isMac, + releasesUrl } from '#/helpers/utils' import i18n from 'i18n' @@ -98,20 +99,25 @@ function handleError () { ) } +function checkWithoutUpdate () { + net.fetch( + releasesUrl + ).then( + handleSuccess + ).catch( + handleError + ) +} + +function checkWithUpdate () { + autoUpdater + .checkForUpdatesAndNotify() +} + export default function checkForUpdates () { if (isMac) { - const releasesUrl = - 'https://api.github.com/repos/staniel359/muffon/releases/latest' - - net.fetch( - releasesUrl - ).then( - handleSuccess - ).catch( - handleError - ) + checkWithoutUpdate() } else { - autoUpdater.checkForUpdatesAndNotify() + checkWithUpdate() } - } diff --git a/electron/actions/mainWindow/create.js b/electron/actions/mainWindow/create.js index 7c6955f54..affc5b70f 100644 --- a/electron/actions/mainWindow/create.js +++ b/electron/actions/mainWindow/create.js @@ -39,7 +39,9 @@ function handleReadyToShow () { showMainWindow() - checkForUpdates() + if (!isDevelopment) { + checkForUpdates() + } const scale = getElectronStoreKey( diff --git a/electron/helpers/utils.js b/electron/helpers/utils.js index bcc28ea66..899c5024e 100644 --- a/electron/helpers/utils.js +++ b/electron/helpers/utils.js @@ -109,6 +109,9 @@ export const isSingleInstance = export const deepLinksProtocol = `${appName}://` +export const releasesUrl = + 'https://api.github.com/repos/staniel359/muffon/releases/latest' + export function createFolderIfNotExists ( path ) { From 9145a214c46fe58c538624be1f66b0d3fc997315 Mon Sep 17 00:00:00 2001 From: staniel359 Date: Wed, 1 May 2024 01:25:45 +0300 Subject: [PATCH 12/14] Fix queue following track playing when disabled on media keys press bug --- .../BaseQueueDirectionButtonContainer.vue | 47 +++++------------- .../layout/observers/TheMediaKeysObserver.vue | 20 +++++--- .../PlayerPanel/AudioSection.vue | 13 +++-- .../BottomSection/SeekerPanelSection.vue | 12 ++--- .../AudioSection/CenterControlsSection.vue | 4 +- src/helpers/actions/queue/track/get.js | 23 ++++++--- src/stores/queue.js | 48 +++++++++++++++++++ 7 files changed, 103 insertions(+), 64 deletions(-) diff --git a/src/components/containers/BaseQueueDirectionButtonContainer.vue b/src/components/containers/BaseQueueDirectionButtonContainer.vue index f488cb9d3..f69868771 100644 --- a/src/components/containers/BaseQueueDirectionButtonContainer.vue +++ b/src/components/containers/BaseQueueDirectionButtonContainer.vue @@ -26,7 +26,7 @@ export default { BaseButton }, props: { - position: { + direction: { type: String, required: true }, @@ -39,48 +39,25 @@ export default { ...mapState( queueStore, { - isQueueGettingPrevious: 'isGettingPrevious', - isQueueGettingNext: 'isGettingNext', - queueTracksCount: 'tracksCount', - isQueueStart: 'isStart', - isQueueEnd: 'isEnd', - isQueueLoop: 'isLoop' + isQueueDirectionAvailable: + 'isDirectionAvailable', + isQueueGettingDirection: + 'isGettingDirection' } ), isDisabled () { - return ( - !this.queueTracksCount || - this.isEdge || - this.isGetting - ) - }, - isEdge () { - if (this.isQueueLoop) { - return false - } else { - switch (this.position) { - case 'previous': - return this.isQueueStart - case 'next': - return this.isQueueEnd - default: - return false - } - } + return !this.isQueueDirectionAvailable[ + this.direction + ] }, isGetting () { - switch (this.position) { - case 'previous': - return this.isQueueGettingPrevious - case 'next': - return this.isQueueGettingNext - default: - return false - } + return this.isQueueGettingDirection[ + this.direction + ] }, queueTrackArgs () { return { - position: this.position + direction: this.direction } } }, diff --git a/src/components/layout/observers/TheMediaKeysObserver.vue b/src/components/layout/observers/TheMediaKeysObserver.vue index be89e55c9..41c42aff2 100644 --- a/src/components/layout/observers/TheMediaKeysObserver.vue +++ b/src/components/layout/observers/TheMediaKeysObserver.vue @@ -33,6 +33,18 @@ export default { ] } }, + computed: { + queuePreviousTrackArgs () { + return { + direction: 'previous' + } + }, + queueNextTrackArgs () { + return { + direction: 'next' + } + } + }, mounted () { this.mediaActionsHandlers .forEach( @@ -42,16 +54,12 @@ export default { methods: { handlePressPrevious () { getQueueTrack( - { - position: 'previous' - } + this.queuePreviousTrackArgs ) }, handlePressNext () { getQueueTrack( - { - position: 'next' - } + this.queueNextTrackArgs ) }, handlePressStop () { diff --git a/src/components/layout/panels/ThePlayerVariantsPanel/PlayerPanel/AudioSection.vue b/src/components/layout/panels/ThePlayerVariantsPanel/PlayerPanel/AudioSection.vue index 91d8bf847..ef9cb81a0 100644 --- a/src/components/layout/panels/ThePlayerVariantsPanel/PlayerPanel/AudioSection.vue +++ b/src/components/layout/panels/ThePlayerVariantsPanel/PlayerPanel/AudioSection.vue @@ -68,8 +68,9 @@ export default { queueStore, { isQueueAutoplay: 'isAutoplay', - isQueueEnd: 'isEnd', - isQueueLoop: 'isLoop' + isQueueLoop: 'isLoop', + isQueueDirectionAvailable: + 'isDirectionAvailable' } ), ...mapState( @@ -80,15 +81,13 @@ export default { ), isGetQueueNextTrack () { return ( - this.isQueueAutoplay && ( - this.isQueueLoop || - !this.isQueueEnd - ) + this.isQueueAutoplay && + this.isQueueDirectionAvailable.next ) }, queueTrackArgs () { return { - position: 'next' + direction: 'next' } }, controlsDirection () { diff --git a/src/components/layout/panels/ThePlayerVariantsPanel/PlayerPanel/AudioSection/BottomSection/SeekerPanelSection.vue b/src/components/layout/panels/ThePlayerVariantsPanel/PlayerPanel/AudioSection/BottomSection/SeekerPanelSection.vue index 0662a16b4..8527e0bb6 100644 --- a/src/components/layout/panels/ThePlayerVariantsPanel/PlayerPanel/AudioSection/BottomSection/SeekerPanelSection.vue +++ b/src/components/layout/panels/ThePlayerVariantsPanel/PlayerPanel/AudioSection/BottomSection/SeekerPanelSection.vue @@ -25,8 +25,8 @@ export default { queueStore, { isQueueAutoplay: 'isAutoplay', - isQueueEnd: 'isEnd', - isQueueLoop: 'isLoop' + isQueueDirectionAvailable: + 'isDirectionAvailable' } ), ...mapState( @@ -43,15 +43,13 @@ export default { ), isGetQueueNextTrack () { return ( - this.isQueueAutoplay && ( - this.isQueueLoop || - !this.isQueueEnd - ) + this.isQueueAutoplay && + this.isQueueDirectionAvailable.next ) }, queueTrackArgs () { return { - position: 'next' + direction: 'next' } }, isGetRadioNextTrack () { diff --git a/src/components/layout/panels/ThePlayerVariantsPanel/PlayerPanel/AudioSection/CenterControlsSection.vue b/src/components/layout/panels/ThePlayerVariantsPanel/PlayerPanel/AudioSection/CenterControlsSection.vue index 91b212ef0..fe7b060e7 100644 --- a/src/components/layout/panels/ThePlayerVariantsPanel/PlayerPanel/AudioSection/CenterControlsSection.vue +++ b/src/components/layout/panels/ThePlayerVariantsPanel/PlayerPanel/AudioSection/CenterControlsSection.vue @@ -11,14 +11,14 @@ diff --git a/src/helpers/actions/queue/track/get.js b/src/helpers/actions/queue/track/get.js index cf369f272..d83e33c9e 100644 --- a/src/helpers/actions/queue/track/get.js +++ b/src/helpers/actions/queue/track/get.js @@ -10,12 +10,21 @@ import { export default function getQueueTrack ( { - position + direction } ) { + const storeData = queueStore() + + const isDirectionAvailable = + storeData.isDirectionAvailable[ + direction + ] + + if (!isDirectionAvailable) { return } + const followingTrackData = - queueStore()[ - `${position}Track` + storeData.directionFollowingTrack[ + direction ] const isAudioLocal = @@ -48,13 +57,13 @@ export default function getQueueTrack ( function setIsQueueGetting ( value ) { - switch (position) { + switch (direction) { case 'previous': - return queueStore().setIsGettingPrevious( + return storeData.setIsGettingPrevious( value ) case 'next': - return queueStore().setIsGettingNext( + return storeData.setIsGettingNext( value ) default: @@ -84,7 +93,7 @@ export default function getQueueTrack ( function retry () { const queueTrackArgs = { - position + direction } updateGlobalStore( diff --git a/src/stores/queue.js b/src/stores/queue.js index 85e99296c..eff75e1f8 100644 --- a/src/stores/queue.js +++ b/src/stores/queue.js @@ -77,6 +77,13 @@ const data = { this.tracksCount - 1 ) }, + directionFollowingTrack () { + return { + previous: + this.previousTrack, + next: this.nextTrack + } + }, previousTrack () { return this.tracksComputed[ this.previousTrackIndex @@ -104,6 +111,47 @@ const data = { this.currentTrackIndex + 1 ) } + }, + isDirectionAvailable ( + state + ) { + return { + previous: ( + state.tracksCount && + !this.isDirectionEdge.previous && + !this.isGettingDirection.previous + ), + next: ( + state.tracksCount && + !this.isDirectionEdge.next && + !this.isGettingDirection.next + ) + } + }, + isGettingDirection ( + state + ) { + return { + previous: + state.isGettingPrevious, + next: + state.isGettingNext + } + }, + isDirectionEdge ( + state + ) { + if (state.isLoop) { + return { + previous: false, + next: false + } + } else { + return { + previous: this.isStart, + next: this.isEnd + } + } } }, actions: { From 49b7e0f4a0aa986f24d83df4c2d0283be81fe50d Mon Sep 17 00:00:00 2001 From: staniel359 Date: Wed, 1 May 2024 12:06:11 +0300 Subject: [PATCH 13/14] Fix active tab set if tabs are cleared on exit bug --- electron/actions/tab/setActive.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/electron/actions/tab/setActive.js b/electron/actions/tab/setActive.js index 4a0bbed1f..7fde06623 100644 --- a/electron/actions/tab/setActive.js +++ b/electron/actions/tab/setActive.js @@ -9,6 +9,8 @@ export default function ( tabId ) + if (!tab) { return } + tab.setVisible( true ) From 5a27344894c6569c492d7829c15de20ed4cf1347 Mon Sep 17 00:00:00 2001 From: Xyloflake Date: Fri, 3 May 2024 12:47:10 +0530 Subject: [PATCH 14/14] Windows Installer Size and Speed Optimization (#171) --- .gitignore | 4 + electron-builder.json | 2 +- package.json | 5 + patches/app-builder-lib@24.13.3.patch | 318 ++++++++++++++++++++++++++ pnpm-lock.yaml | 11 +- 5 files changed, 336 insertions(+), 4 deletions(-) create mode 100644 patches/app-builder-lib@24.13.3.patch diff --git a/.gitignore b/.gitignore index cff4b3ed8..632b8ec83 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,7 @@ /semantic/gulpfile.js .env + +# yalc is used for developing and testing electron-builder but we don't need the files +.yalc +yalc.lock \ No newline at end of file diff --git a/electron-builder.json b/electron-builder.json index 88a31cc78..91617f729 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -29,7 +29,7 @@ ] }, "artifactName": "${productName}-${version}-${os}-${arch}.${ext}", - "compression": "store", + "compression": "ultra", "nsis": { "allowToChangeInstallationDirectory": true, "deleteAppDataOnUninstall": true, diff --git a/package.json b/package.json index ee5627235..bcc5e9775 100644 --- a/package.json +++ b/package.json @@ -65,5 +65,10 @@ "vue": "^3.4.25", "vue-i18n": "^9.13.1", "vue-router": "^4.3.2" + }, + "pnpm": { + "patchedDependencies": { + "app-builder-lib@24.13.3": "patches/app-builder-lib@24.13.3.patch" + } } } diff --git a/patches/app-builder-lib@24.13.3.patch b/patches/app-builder-lib@24.13.3.patch new file mode 100644 index 000000000..4c14428c3 --- /dev/null +++ b/patches/app-builder-lib@24.13.3.patch @@ -0,0 +1,318 @@ +diff --git a/out/core.d.ts b/out/core.d.ts +index dd4ad8e9dc48211f95b4bc4ef2576dfb75ec01d3..185339762cd4f2a2d1f8aef262f77b30894bc3f8 100644 +--- a/out/core.d.ts ++++ b/out/core.d.ts +@@ -45,7 +45,7 @@ export interface TargetSpecificOptions { + } + export declare const DEFAULT_TARGET = "default"; + export declare const DIR_TARGET = "dir"; +-export type CompressionLevel = "store" | "normal" | "maximum"; ++export type CompressionLevel = "store" | "normal" | "maximum" | "ultra"; + export interface BeforeBuildContext { + readonly appDir: string; + readonly electronVersion: string; +diff --git a/out/core.js.map b/out/core.js.map +index 52d83d399d60af028062014f1d1fdc9481b74afd..fcf794415cfc79ce92a63f6223e08bb197da9674 100644 +--- a/out/core.js.map ++++ b/out/core.js.map +@@ -1 +1 @@ +-{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;AAAA,+CAA6D;AAoB7D,MAAa,QAAQ;IAKnB,YACS,IAAY,EACZ,qBAA6B,EAC7B,QAAyB;QAFzB,SAAI,GAAJ,IAAI,CAAQ;QACZ,0BAAqB,GAArB,qBAAqB,CAAQ;QAC7B,aAAQ,GAAR,QAAQ,CAAiB;IAC/B,CAAC;IAEJ,QAAQ;QACN,OAAO,IAAI,CAAC,IAAI,CAAA;IAClB,CAAC;IAED,YAAY,CAAC,IAAoC,EAAE,GAAG,KAAkB;QACtE,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC;YAC1D,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;QACrC,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,GAAG,EAAE,CAAA;QAE5B,KAAK,MAAM,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,6BAAc,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;YAChG,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,I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AAO,CAAC,CAAA;AAkD1D,MAAsB,MAAM;IAI1B,YACW,IAAY,EACZ,mBAA4B,IAAI;QADhC,SAAI,GAAJ,IAAI,CAAQ;QACZ,qBAAgB,GAAhB,gBAAgB,CAAgB;IACxC,CAAC;IAEJ,KAAK,CAAC,YAAY;QAChB,SAAS;IACX,CAAC;IAID,WAAW;QACT,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IAC1B,CAAC;CACF;AAlBD,wBAkBC;AAWY,QAAA,cAAc,GAAG,SAAS,CAAA;AAC1B,QAAA,UAAU,GAAG,KAAK,CAAA","sourcesContent":["import { Arch, archFromString, ArchType } from \"builder-util\"\nimport { AllPublishOptions } from \"builder-util-runtime\"\n\n// https://github.com/YousefED/typescript-json-schema/issues/80\nexport type Publish = AllPublishOptions | Array | null\n\nexport type TargetConfigType = Array | string | TargetConfiguration | null\n\nexport interface TargetConfiguration {\n /**\n * The target name. e.g. `snap`.\n */\n readonly target: string\n\n /**\n * The arch or list of archs.\n */\n readonly arch?: Array | ArchType\n}\n\nexport class Platform {\n static MAC = new Platform(\"mac\", \"mac\", \"darwin\")\n static LINUX = new Platform(\"linux\", \"linux\", \"linux\")\n static WINDOWS = new Platform(\"windows\", \"win\", \"win32\")\n\n constructor(\n public name: string,\n public buildConfigurationKey: string,\n public nodeName: NodeJS.Platform\n ) {}\n\n toString() {\n return this.name\n }\n\n createTarget(type?: string | Array | null, ...archs: Array): Map>> {\n if (type == null && (archs == null || archs.length === 0)) {\n return new Map([[this, new Map()]])\n }\n\n const archToType = new Map()\n\n for (const arch of archs == null || archs.length === 0 ? [archFromString(process.arch)] : archs) {\n archToType.set(arch, type == null ? [] : Array.isArray(type) ? type : [type])\n }\n return new Map([[this, archToType]])\n }\n\n static current(): Platform {\n return Platform.fromString(process.platform)\n }\n\n static fromString(name: string): Platform {\n name = name.toLowerCase()\n switch (name) {\n case Platform.MAC.nodeName:\n case Platform.MAC.name:\n return Platform.MAC\n\n case Platform.WINDOWS.nodeName:\n case Platform.WINDOWS.name:\n case Platform.WINDOWS.buildConfigurationKey:\n return Platform.WINDOWS\n\n case Platform.LINUX.nodeName:\n return Platform.LINUX\n\n default:\n throw new Error(`Unknown platform: ${name}`)\n }\n }\n}\n\nexport abstract class Target {\n abstract readonly outDir: string\n abstract readonly options: TargetSpecificOptions | null | undefined\n\n protected constructor(\n readonly name: string,\n readonly isAsyncSupported: boolean = true\n ) {}\n\n async checkOptions(): Promise {\n // ignore\n }\n\n abstract build(appOutDir: string, arch: Arch): Promise\n\n finishBuild(): Promise {\n return Promise.resolve()\n }\n}\n\nexport interface TargetSpecificOptions {\n /**\n The [artifact file name template](/configuration/configuration#artifact-file-name-template).\n */\n readonly artifactName?: string | null\n\n publish?: Publish\n}\n\nexport const DEFAULT_TARGET = \"default\"\nexport const DIR_TARGET = \"dir\"\n\nexport type CompressionLevel = \"store\" | \"normal\" | \"maximum\"\n\nexport interface BeforeBuildContext {\n readonly appDir: string\n readonly electronVersion: string\n readonly platform: Platform\n readonly arch: string\n}\n\nexport interface SourceRepositoryInfo {\n type?: string\n domain?: string\n user: string\n project: string\n}\n"]} +\ No newline at end of file ++{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;AAAA,+CAA6D;AAoB7D,MAAa,QAAQ;IAKnB,YACS,IAAY,EACZ,qBAA6B,EAC7B,QAAyB;QAFzB,SAAI,GAAJ,IAAI,CAAQ;QACZ,0BAAqB,GAArB,qBAAqB,CAAQ;QAC7B,aAAQ,GAAR,QAAQ,CAAiB;IAC/B,CAAC;IAEJ,QAAQ;QACN,OAAO,IAAI,CAAC,IAAI,CAAA;IAClB,CAAC;IAED,YAAY,CAAC,IAAoC,EAAE,GAAG,KAAkB;QACtE,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC;YAC1D,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,IA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AAC,KAAK,CAAA;YAEvB;gBACE,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,EAAE,CAAC,CAAA;QAChD,CAAC;IACH,CAAC;;AAlDH,4BAmDC;AAlDQ,YAAG,GAAG,IAAI,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAA;AAC1C,cAAK,GAAG,IAAI,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;AAC/C,gBAAO,GAAG,IAAI,QAAQ,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,CAAA;AAkD1D,MAAsB,MAAM;IAI1B,YACW,IAAY,EACZ,mBAA4B,IAAI;QADhC,SAAI,GAAJ,IAAI,CAAQ;QACZ,qBAAgB,GAAhB,gBAAgB,CAAgB;IACxC,CAAC;IAEJ,KAAK,CAAC,YAAY;QAChB,SAAS;IACX,CAAC;IAID,WAAW;QACT,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IAC1B,CAAC;CACF;AAlBD,wBAkBC;AAWY,QAAA,cAAc,GAAG,SAAS,CAAA;AAC1B,QAAA,UAAU,GAAG,KAAK,CAAA","sourcesContent":["import { Arch, archFromString, ArchType } from \"builder-util\"\nimport { AllPublishOptions } from \"builder-util-runtime\"\n\n// https://github.com/YousefED/typescript-json-schema/issues/80\nexport type Publish = AllPublishOptions | Array | null\n\nexport type TargetConfigType = Array | string | TargetConfiguration | null\n\nexport interface TargetConfiguration {\n /**\n * The target name. e.g. `snap`.\n */\n readonly target: string\n\n /**\n * The arch or list of archs.\n */\n readonly arch?: Array | ArchType\n}\n\nexport class Platform {\n static MAC = new Platform(\"mac\", \"mac\", \"darwin\")\n static LINUX = new Platform(\"linux\", \"linux\", \"linux\")\n static WINDOWS = new Platform(\"windows\", \"win\", \"win32\")\n\n constructor(\n public name: string,\n public buildConfigurationKey: string,\n public nodeName: NodeJS.Platform\n ) {}\n\n toString() {\n return this.name\n }\n\n createTarget(type?: string | Array | null, ...archs: Array): Map>> {\n if (type == null && (archs == null || archs.length === 0)) {\n return new Map([[this, new Map()]])\n }\n\n const archToType = new Map()\n\n for (const arch of archs == null || archs.length === 0 ? [archFromString(process.arch)] : archs) {\n archToType.set(arch, type == null ? [] : Array.isArray(type) ? type : [type])\n }\n return new Map([[this, archToType]])\n }\n\n static current(): Platform {\n return Platform.fromString(process.platform)\n }\n\n static fromString(name: string): Platform {\n name = name.toLowerCase()\n switch (name) {\n case Platform.MAC.nodeName:\n case Platform.MAC.name:\n return Platform.MAC\n\n case Platform.WINDOWS.nodeName:\n case Platform.WINDOWS.name:\n case Platform.WINDOWS.buildConfigurationKey:\n return Platform.WINDOWS\n\n case Platform.LINUX.nodeName:\n return Platform.LINUX\n\n default:\n throw new Error(`Unknown platform: ${name}`)\n }\n }\n}\n\nexport abstract class Target {\n abstract readonly outDir: string\n abstract readonly options: TargetSpecificOptions | null | undefined\n\n protected constructor(\n readonly name: string,\n readonly isAsyncSupported: boolean = true\n ) {}\n\n async checkOptions(): Promise {\n // ignore\n }\n\n abstract build(appOutDir: string, arch: Arch): Promise\n\n finishBuild(): Promise {\n return Promise.resolve()\n }\n}\n\nexport interface TargetSpecificOptions {\n /**\n The [artifact file name template](/configuration/configuration#artifact-file-name-template).\n */\n readonly artifactName?: string | null\n\n publish?: Publish\n}\n\nexport const DEFAULT_TARGET = \"default\"\nexport const DIR_TARGET = \"dir\"\n\nexport type CompressionLevel = \"store\" | \"normal\" | \"maximum\" | \"ultra\"\n\nexport interface BeforeBuildContext {\n readonly appDir: string\n readonly electronVersion: string\n readonly platform: Platform\n readonly arch: string\n}\n\nexport interface SourceRepositoryInfo {\n type?: string\n domain?: string\n user: string\n project: string\n}\n"]} +\ No newline at end of file +diff --git a/out/platformPackager.js b/out/platformPackager.js +index 30ee49ad93e095fc7477c30ef04ec189d77d54be..0233a44033ce2a0c2db6b075a72aa22471b90a5e 100644 +--- a/out/platformPackager.js ++++ b/out/platformPackager.js +@@ -50,6 +50,9 @@ class PlatformPackager { + if (compression === null) { + return "normal"; + } ++ if (compression == "ultra" && process.platform !== "win32") { ++ return "maximum"; ++ } + return compression || this.config.compression || "normal"; + } + get debugLogger() { +diff --git a/out/platformPackager.js.map b/out/platformPackager.js.map +index b6d699213481f88fbbb0a8d9d770ab0749a1a17d..d09b57a3ee2a3e25a60c4ed82b1dc68422581a9b 100644 +--- a/out/platformPackager.js.map ++++ b/out/platformPackager.js.map +@@ -1 +1 @@ +-{"version":3,"file":"platformPackager.js","sourceRoot":"","sources":["../src/platformPackager.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAC1C,+CAA8J;AAC9J,gDAAkF;AAClF,4CAAiE;AACjE,sDAA2D;AAC3D,0CAAqC;AACrC,uCAA+B;AAE/B,6BAA4B;AAC5B,6BAAmC;AACnC,uCAAmC;AACnC,4DAA2D;AAC3D,8CAA8C;AAC9C,gDAA8C;AAC9C,+CAA8I;AAC9I,uDAA4E;AAC5E,2CAAwD;AACxD,mCAagB;AAChB,kDAA2D;AAC3D,wDAA+I;AAC/I,wDAAmE;AAEnE,MAAsB,gBAAgB;IACpC,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAA;IAC1B,CAAC;IAED,IAAI,iBAAiB;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAA;IACpC,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAA;IAC7B,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAA;IACzB,CAAC;IAID,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAA;IACjC,CAAC;IAMD,YACW,IAAc,EACd,QAAkB;QADlB,SAAI,GAAJ,IAAI,CAAU;QACd,aAAQ,GAAR,QAAQ,CAAU;QANZ,kBAAa,GAAG,IAAI,eAAI,CAAgB,GAAG,EAAE,CAAC,IAAA,0BAAgB,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CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACrD,CAAC","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { Arch, asArray, AsyncTaskManager, debug, DebugLogger, deepAssign, getArchSuffix, InvalidConfigurationError, isEmptyOrSpaces, log } from \"builder-util\"\nimport { defaultArchFromString, getArtifactArchName } from \"builder-util/out/arch\"\nimport { FileTransformer, statOrNull } from \"builder-util/out/fs\"\nimport { orIfFileNotExist } from \"builder-util/out/promise\"\nimport { readdir } from \"fs/promises\"\nimport { Lazy } from \"lazy-val\"\nimport { Minimatch } from \"minimatch\"\nimport * as path from \"path\"\nimport { pathToFileURL } from \"url\"\nimport { AppInfo } from \"./appInfo\"\nimport { checkFileInArchive } from \"./asar/asarFileChecker\"\nimport { AsarPackager } from \"./asar/asarUtil\"\nimport { computeData } from \"./asar/integrity\"\nimport { copyFiles, FileMatcher, getFileMatchers, GetFileMatchersOptions, getMainFileMatchers, getNodeModuleFileMatcher } from \"./fileMatcher\"\nimport { createTransformer, isElectronCompileUsed } from \"./fileTransformer\"\nimport { Framework, isElectronBased } from \"./Framework\"\nimport {\n AfterPackContext,\n AsarOptions,\n CompressionLevel,\n Configuration,\n ElectronPlatformName,\n FileAssociation,\n Packager,\n PackagerOptions,\n Platform,\n PlatformSpecificBuildOptions,\n Target,\n TargetSpecificOptions,\n} from \"./index\"\nimport { executeAppBuilderAsJson } from \"./util/appBuilder\"\nimport { computeFileSets, computeNodeModuleFileSets, copyAppFiles, ELECTRON_COMPILE_SHIM_FILENAME, transformFiles } from \"./util/appFileCopier\"\nimport { expandMacro as doExpandMacro } from \"./util/macroExpander\"\n\nexport abstract class PlatformPackager {\n get packagerOptions(): PackagerOptions {\n return this.info.options\n }\n\n get buildResourcesDir(): string {\n return this.info.buildResourcesDir\n }\n\n get projectDir(): string {\n return this.info.projectDir\n }\n\n get config(): Configuration {\n return this.info.config\n }\n\n readonly platformSpecificBuildOptions: DC\n\n get resourceList(): Promise> {\n return this._resourceList.value\n }\n\n private readonly _resourceList = new Lazy>(() => orIfFileNotExist(readdir(this.info.buildResourcesDir), []))\n\n readonly appInfo: AppInfo\n\n protected constructor(\n readonly info: Packager,\n readonly platform: Platform\n ) {\n this.platformSpecificBuildOptions = PlatformPackager.normalizePlatformSpecificBuildOptions((this.config as any)[platform.buildConfigurationKey])\n this.appInfo = this.prepareAppInfo(info.appInfo)\n }\n\n get compression(): CompressionLevel {\n const compression = this.platformSpecificBuildOptions.compression\n // explicitly set to null - request to use default value instead of parent (in the config)\n if (compression === null) {\n return \"normal\"\n }\n return compression || this.config.compression || \"normal\"\n }\n\n get debugLogger(): DebugLogger {\n return this.info.debugLogger\n }\n\n abstract get defaultTarget(): Array\n\n // eslint-disable-next-line\n protected prepareAppInfo(appInfo: AppInfo) {\n return new AppInfo(this.info, null, this.platformSpecificBuildOptions)\n }\n\n private static normalizePlatformSpecificBuildOptions(options: any | null | undefined): any {\n return options == null ? Object.create(null) : options\n }\n\n abstract createTargets(targets: Array, mapper: (name: string, factory: (outDir: string) => Target) => void): void\n\n protected getCscPassword(): string {\n const password = this.doGetCscPassword()\n if (isEmptyOrSpaces(password)) {\n log.info({ reason: \"CSC_KEY_PASSWORD is not defined\" }, \"empty password will be used for code signing\")\n return \"\"\n } else {\n return password.trim()\n }\n }\n\n protected getCscLink(extraEnvName?: string | null): string | null | undefined {\n // allow to specify as empty string\n const envValue = chooseNotNull(extraEnvName == null ? null : process.env[extraEnvName], process.env.CSC_LINK)\n return chooseNotNull(chooseNotNull(this.info.config.cscLink, this.platformSpecificBuildOptions.cscLink), envValue)\n }\n\n protected doGetCscPassword(): string | null | undefined {\n // allow to specify as empty string\n return chooseNotNull(chooseNotNull(this.info.config.cscKeyPassword, this.platformSpecificBuildOptions.cscKeyPassword), process.env.CSC_KEY_PASSWORD)\n }\n\n protected computeAppOutDir(outDir: string, arch: Arch): string {\n return (\n this.packagerOptions.prepackaged ||\n path.join(\n outDir,\n `${this.platform.buildConfigurationKey}${getArchSuffix(arch, this.platformSpecificBuildOptions.defaultArch)}${this.platform === Platform.MAC ? \"\" : \"-unpacked\"}`\n )\n )\n }\n\n dispatchArtifactCreated(file: string, target: Target | null, arch: Arch | null, safeArtifactName?: string | null): Promise {\n return this.info.callArtifactBuildCompleted({\n file,\n safeArtifactName,\n target,\n arch,\n packager: this,\n })\n }\n\n async pack(outDir: string, arch: Arch, targets: Array, taskManager: AsyncTaskManager): Promise {\n const appOutDir = this.computeAppOutDir(outDir, arch)\n await this.doPack(outDir, appOutDir, this.platform.nodeName as ElectronPlatformName, arch, this.platformSpecificBuildOptions, targets)\n this.packageInDistributableFormat(appOutDir, arch, targets, taskManager)\n }\n\n protected packageInDistributableFormat(appOutDir: string, arch: Arch, targets: Array, taskManager: AsyncTaskManager): void {\n if (targets.find(it => !it.isAsyncSupported) == null) {\n PlatformPackager.buildAsyncTargets(targets, taskManager, appOutDir, arch)\n return\n }\n\n taskManager.add(async () => {\n // BluebirdPromise.map doesn't invoke target.build immediately, but for RemoteTarget it is very critical to call build() before finishBuild()\n const subTaskManager = new AsyncTaskManager(this.info.cancellationToken)\n PlatformPackager.buildAsyncTargets(targets, subTaskManager, appOutDir, arch)\n await subTaskManager.awaitTasks()\n\n for (const target of targets) {\n if (!target.isAsyncSupported) {\n await target.build(appOutDir, arch)\n }\n }\n })\n }\n\n private static buildAsyncTargets(targets: Array, taskManager: AsyncTaskManager, appOutDir: string, arch: Arch) {\n for (const target of targets) {\n if (target.isAsyncSupported) {\n taskManager.addTask(target.build(appOutDir, arch))\n }\n }\n }\n\n private getExtraFileMatchers(isResources: boolean, appOutDir: string, options: GetFileMatchersOptions): Array | null {\n const base = isResources\n ? this.getResourcesDir(appOutDir)\n : this.platform === Platform.MAC\n ? path.join(appOutDir, `${this.appInfo.productFilename}.app`, \"Contents\")\n : appOutDir\n return getFileMatchers(this.config, isResources ? \"extraResources\" : \"extraFiles\", base, options)\n }\n\n createGetFileMatchersOptions(outDir: string, arch: Arch, customBuildOptions: PlatformSpecificBuildOptions): GetFileMatchersOptions {\n return {\n macroExpander: it => this.expandMacro(it, arch == null ? null : Arch[arch], { \"/*\": \"{,/**/*}\" }),\n customBuildOptions,\n globalOutDir: outDir,\n defaultSrc: this.projectDir,\n }\n }\n\n protected async doPack(\n outDir: string,\n appOutDir: string,\n platformName: ElectronPlatformName,\n arch: Arch,\n platformSpecificBuildOptions: DC,\n targets: Array,\n sign = true,\n disableAsarIntegrity = false\n ) {\n if (this.packagerOptions.prepackaged != null) {\n return\n }\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n // Due to node-gyp rewriting GYP_MSVS_VERSION when reused across the same session, we must reset the env var: https://github.com/electron-userland/electron-builder/issues/7256\n delete process.env.GYP_MSVS_VERSION\n\n const beforePack = await resolveFunction(this.appInfo.type, this.config.beforePack, \"beforePack\")\n if (beforePack != null) {\n await beforePack({\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n })\n }\n\n await this.info.installAppDependencies(this.platform, arch)\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const framework = this.info.framework\n log.info(\n {\n platform: platformName,\n arch: Arch[arch],\n [`${framework.name}`]: framework.version,\n appOutDir: log.filePath(appOutDir),\n },\n `packaging`\n )\n\n await framework.prepareApplicationStageDirectory({\n packager: this,\n appOutDir,\n platformName,\n arch: Arch[arch],\n version: framework.version,\n })\n\n const excludePatterns: Array = []\n\n const computeParsedPatterns = (patterns: Array | null) => {\n if (patterns != null) {\n for (const pattern of patterns) {\n pattern.computeParsedPatterns(excludePatterns, this.info.projectDir)\n }\n }\n }\n\n const getFileMatchersOptions = this.createGetFileMatchersOptions(outDir, arch, platformSpecificBuildOptions)\n const macroExpander = getFileMatchersOptions.macroExpander\n const extraResourceMatchers = this.getExtraFileMatchers(true, appOutDir, getFileMatchersOptions)\n computeParsedPatterns(extraResourceMatchers)\n const extraFileMatchers = this.getExtraFileMatchers(false, appOutDir, getFileMatchersOptions)\n computeParsedPatterns(extraFileMatchers)\n\n const packContext: AfterPackContext = {\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n }\n\n const asarOptions = await this.computeAsarOptions(platformSpecificBuildOptions)\n const resourcesPath =\n this.platform === Platform.MAC\n ? path.join(appOutDir, framework.distMacOsAppName, \"Contents\", \"Resources\")\n : isElectronBased(framework)\n ? path.join(appOutDir, \"resources\")\n : appOutDir\n const taskManager = new AsyncTaskManager(this.info.cancellationToken)\n this.copyAppFiles(taskManager, asarOptions, resourcesPath, path.join(resourcesPath, \"app\"), packContext, platformSpecificBuildOptions, excludePatterns, macroExpander)\n await taskManager.awaitTasks()\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n if (framework.beforeCopyExtraFiles != null) {\n const resourcesRelativePath = this.platform === Platform.MAC ? \"Resources\" : isElectronBased(framework) ? \"resources\" : \"\"\n\n await framework.beforeCopyExtraFiles({\n packager: this,\n appOutDir,\n asarIntegrity: asarOptions == null || disableAsarIntegrity ? null : await computeData({ resourcesPath, resourcesRelativePath }),\n platformName,\n })\n }\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const transformerForExtraFiles = this.createTransformerForExtraFiles(packContext)\n await copyFiles(extraResourceMatchers, transformerForExtraFiles)\n await copyFiles(extraFileMatchers, transformerForExtraFiles)\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n await this.info.afterPack(packContext)\n\n if (framework.afterPack != null) {\n await framework.afterPack(packContext)\n }\n\n const isAsar = asarOptions != null\n await this.sanityCheckPackage(appOutDir, isAsar, framework)\n if (sign) {\n await this.doSignAfterPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets)\n }\n }\n\n protected async doSignAfterPack(outDir: string, appOutDir: string, platformName: ElectronPlatformName, arch: Arch, platformSpecificBuildOptions: DC, targets: Array) {\n const asarOptions = await this.computeAsarOptions(platformSpecificBuildOptions)\n const isAsar = asarOptions != null\n const packContext = {\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n }\n const didSign = await this.signApp(packContext, isAsar)\n const afterSign = await resolveFunction(this.appInfo.type, this.config.afterSign, \"afterSign\")\n if (afterSign != null) {\n if (didSign) {\n await Promise.resolve(afterSign(packContext))\n } else {\n log.warn(null, `skipping \"afterSign\" hook as no signing occurred, perhaps you intended \"afterPack\"?`)\n }\n }\n }\n\n // eslint-disable-next-line\n protected createTransformerForExtraFiles(packContext: AfterPackContext): FileTransformer | null {\n return null\n }\n\n private copyAppFiles(\n taskManager: AsyncTaskManager,\n asarOptions: AsarOptions | null,\n resourcePath: string,\n defaultDestination: string,\n packContext: AfterPackContext,\n platformSpecificBuildOptions: DC,\n excludePatterns: Array,\n macroExpander: (it: string) => string\n ) {\n const appDir = this.info.appDir\n const config = this.config\n const isElectronCompile = asarOptions != null && isElectronCompileUsed(this.info)\n\n const mainMatchers = getMainFileMatchers(appDir, defaultDestination, macroExpander, platformSpecificBuildOptions, this, packContext.outDir, isElectronCompile)\n if (excludePatterns.length > 0) {\n for (const matcher of mainMatchers) {\n matcher.excludePatterns = excludePatterns\n }\n }\n\n const framework = this.info.framework\n const transformer = createTransformer(\n appDir,\n config,\n isElectronCompile\n ? {\n originalMain: this.info.metadata.main,\n main: ELECTRON_COMPILE_SHIM_FILENAME,\n ...config.extraMetadata,\n }\n : config.extraMetadata,\n framework.createTransformer == null ? null : framework.createTransformer()\n )\n\n const _computeFileSets = (matchers: Array) => {\n return computeFileSets(matchers, this.info.isPrepackedAppAsar ? null : transformer, this, isElectronCompile).then(async result => {\n if (!this.info.isPrepackedAppAsar && !this.info.areNodeModulesHandledExternally) {\n const moduleFileMatcher = getNodeModuleFileMatcher(appDir, defaultDestination, macroExpander, platformSpecificBuildOptions, this.info)\n result = result.concat(await computeNodeModuleFileSets(this, moduleFileMatcher))\n }\n return result.filter(it => it.files.length > 0)\n })\n }\n\n if (this.info.isPrepackedAppAsar) {\n taskManager.addTask(BluebirdPromise.each(_computeFileSets([new FileMatcher(appDir, resourcePath, macroExpander)]), it => copyAppFiles(it, this.info, transformer)))\n } else if (asarOptions == null) {\n // for ASAR all asar unpacked files will be extra transformed (e.g. sign of EXE and DLL) later,\n // for prepackaged asar extra transformation not supported yet,\n // so, extra transform if asar is disabled\n const transformerForExtraFiles = this.createTransformerForExtraFiles(packContext)\n const combinedTransformer: FileTransformer = file => {\n if (transformerForExtraFiles != null) {\n const result = transformerForExtraFiles(file)\n if (result != null) {\n return result\n }\n }\n return transformer(file)\n }\n\n taskManager.addTask(BluebirdPromise.each(_computeFileSets(mainMatchers), it => copyAppFiles(it, this.info, combinedTransformer)))\n } else {\n const unpackPattern = getFileMatchers(config, \"asarUnpack\", defaultDestination, {\n macroExpander,\n customBuildOptions: platformSpecificBuildOptions,\n globalOutDir: packContext.outDir,\n defaultSrc: appDir,\n })\n const fileMatcher = unpackPattern == null ? null : unpackPattern[0]\n taskManager.addTask(\n _computeFileSets(mainMatchers).then(async fileSets => {\n for (const fileSet of fileSets) {\n await transformFiles(transformer, fileSet)\n }\n\n await new AsarPackager(appDir, resourcePath, asarOptions, fileMatcher == null ? null : fileMatcher.createFilter()).pack(fileSets, this)\n })\n )\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected signApp(packContext: AfterPackContext, isAsar: boolean): Promise {\n return Promise.resolve(false)\n }\n\n getIconPath(): Promise {\n return Promise.resolve(null)\n }\n\n private async computeAsarOptions(customBuildOptions: DC): Promise {\n if (!isElectronBased(this.info.framework)) {\n return null\n }\n\n function errorMessage(name: string) {\n return `${name} is deprecated is deprecated and not supported — please use asarUnpack`\n }\n\n const buildMetadata = this.config as any\n if (buildMetadata[\"asar-unpack\"] != null) {\n throw new Error(errorMessage(\"asar-unpack\"))\n }\n if (buildMetadata[\"asar-unpack-dir\"] != null) {\n throw new Error(errorMessage(\"asar-unpack-dir\"))\n }\n\n const platformSpecific = customBuildOptions.asar\n const result = platformSpecific == null ? this.config.asar : platformSpecific\n if (result === false) {\n const appAsarStat = await statOrNull(path.join(this.info.appDir, \"app.asar\"))\n //noinspection ES6MissingAwait\n if (appAsarStat == null || !appAsarStat.isFile()) {\n log.warn(\n {\n solution: \"enable asar and use asarUnpack to unpack files that must be externally available\",\n },\n \"asar usage is disabled — this is strongly not recommended\"\n )\n }\n return null\n }\n\n if (result == null || result === true) {\n return {}\n }\n\n for (const name of [\"unpackDir\", \"unpack\"]) {\n if ((result as any)[name] != null) {\n throw new Error(errorMessage(`asar.${name}`))\n }\n }\n return deepAssign({}, result)\n }\n\n public getElectronSrcDir(dist: string): string {\n return path.resolve(this.projectDir, dist)\n }\n\n public getElectronDestinationDir(appOutDir: string): string {\n return appOutDir\n }\n\n getResourcesDir(appOutDir: string): string {\n if (this.platform === Platform.MAC) {\n return this.getMacOsResourcesDir(appOutDir)\n } else if (isElectronBased(this.info.framework)) {\n return path.join(appOutDir, \"resources\")\n } else {\n return appOutDir\n }\n }\n\n public getMacOsResourcesDir(appOutDir: string): string {\n return path.join(appOutDir, `${this.appInfo.productFilename}.app`, \"Contents\", \"Resources\")\n }\n\n private async checkFileInPackage(resourcesDir: string, file: string, messagePrefix: string, isAsar: boolean) {\n const relativeFile = path.relative(this.info.appDir, path.resolve(this.info.appDir, file))\n if (isAsar) {\n await checkFileInArchive(path.join(resourcesDir, \"app.asar\"), relativeFile, messagePrefix)\n return\n }\n\n const pathParsed = path.parse(file)\n // Even when packaging to asar is disabled, it does not imply that the main file can not be inside an .asar archive.\n // This may occur when the packaging is done manually before processing with electron-builder.\n if (pathParsed.dir.includes(\".asar\")) {\n // The path needs to be split to the part with an asar archive which acts like a directory and the part with\n // the path to main file itself. (e.g. path/arch.asar/dir/index.js -> path/arch.asar, dir/index.js)\n // noinspection TypeScriptValidateJSTypes\n const pathSplit: Array = pathParsed.dir.split(path.sep)\n let partWithAsarIndex = 0\n pathSplit.some((pathPart: string, index: number) => {\n partWithAsarIndex = index\n return pathPart.endsWith(\".asar\")\n })\n const asarPath = path.join(...pathSplit.slice(0, partWithAsarIndex + 1))\n let mainPath = pathSplit.length > partWithAsarIndex + 1 ? path.join.apply(pathSplit.slice(partWithAsarIndex + 1)) : \"\"\n mainPath += path.join(mainPath, pathParsed.base)\n await checkFileInArchive(path.join(resourcesDir, \"app\", asarPath), mainPath, messagePrefix)\n } else {\n const fullPath = path.join(resourcesDir, \"app\", relativeFile)\n const outStat = await statOrNull(fullPath)\n if (outStat == null) {\n throw new Error(`${messagePrefix} \"${fullPath}\" does not exist. Seems like a wrong configuration.`)\n } else {\n //noinspection ES6MissingAwait\n if (!outStat.isFile()) {\n throw new Error(`${messagePrefix} \"${fullPath}\" is not a file. Seems like a wrong configuration.`)\n }\n }\n }\n }\n\n private async sanityCheckPackage(appOutDir: string, isAsar: boolean, framework: Framework): Promise {\n const outStat = await statOrNull(appOutDir)\n if (outStat == null) {\n throw new Error(`Output directory \"${appOutDir}\" does not exist. Seems like a wrong configuration.`)\n } else {\n //noinspection ES6MissingAwait\n if (!outStat.isDirectory()) {\n throw new Error(`Output directory \"${appOutDir}\" is not a directory. Seems like a wrong configuration.`)\n }\n }\n\n const resourcesDir = this.getResourcesDir(appOutDir)\n const mainFile = (framework.getMainFile == null ? null : framework.getMainFile(this.platform)) || this.info.metadata.main || \"index.js\"\n await this.checkFileInPackage(resourcesDir, mainFile, \"Application entry file\", isAsar)\n await this.checkFileInPackage(resourcesDir, \"package.json\", \"Application\", isAsar)\n }\n\n // tslint:disable-next-line:no-invalid-template-strings\n computeSafeArtifactName(\n suggestedName: string | null,\n ext: string,\n arch?: Arch | null,\n skipDefaultArch = true,\n defaultArch?: string,\n safePattern = \"${name}-${version}-${arch}.${ext}\"\n ): string | null {\n return computeSafeArtifactNameIfNeeded(suggestedName, () =>\n this.computeArtifactName(safePattern, ext, skipDefaultArch && arch === defaultArchFromString(defaultArch) ? null : arch)\n )\n }\n\n expandArtifactNamePattern(\n targetSpecificOptions: TargetSpecificOptions | null | undefined,\n ext: string,\n arch?: Arch | null,\n defaultPattern?: string,\n skipDefaultArch = true,\n defaultArch?: string\n ): string {\n const { pattern, isUserForced } = this.artifactPatternConfig(targetSpecificOptions, defaultPattern)\n return this.computeArtifactName(pattern, ext, !isUserForced && skipDefaultArch && arch === defaultArchFromString(defaultArch) ? null : arch)\n }\n\n artifactPatternConfig(targetSpecificOptions: TargetSpecificOptions | null | undefined, defaultPattern: string | undefined) {\n const userSpecifiedPattern = targetSpecificOptions?.artifactName || this.platformSpecificBuildOptions.artifactName || this.config.artifactName\n return {\n isUserForced: !!userSpecifiedPattern,\n pattern: userSpecifiedPattern || defaultPattern || \"${productName}-${version}-${arch}.${ext}\",\n }\n }\n\n expandArtifactBeautyNamePattern(targetSpecificOptions: TargetSpecificOptions | null | undefined, ext: string, arch?: Arch | null): string {\n // tslint:disable-next-line:no-invalid-template-strings\n return this.expandArtifactNamePattern(targetSpecificOptions, ext, arch, \"${productName} ${version} ${arch}.${ext}\", true)\n }\n\n private computeArtifactName(pattern: any, ext: string, arch: Arch | null | undefined): string {\n const archName = arch == null ? null : getArtifactArchName(arch, ext)\n return this.expandMacro(pattern, archName, {\n ext,\n })\n }\n\n expandMacro(pattern: string, arch?: string | null, extra: any = {}, isProductNameSanitized = true): string {\n return doExpandMacro(pattern, arch, this.appInfo, { os: this.platform.buildConfigurationKey, ...extra }, isProductNameSanitized)\n }\n\n generateName2(ext: string | null, classifier: string | null | undefined, deployment: boolean): string {\n const dotExt = ext == null ? \"\" : `.${ext}`\n const separator = ext === \"deb\" ? \"_\" : \"-\"\n return `${deployment ? this.appInfo.name : this.appInfo.productFilename}${separator}${this.appInfo.version}${classifier == null ? \"\" : `${separator}${classifier}`}${dotExt}`\n }\n\n getTempFile(suffix: string): Promise {\n return this.info.tempDirManager.getTempFile({ suffix })\n }\n\n get fileAssociations(): Array {\n return asArray(this.config.fileAssociations).concat(asArray(this.platformSpecificBuildOptions.fileAssociations))\n }\n\n async getResource(custom: string | null | undefined, ...names: Array): Promise {\n const resourcesDir = this.info.buildResourcesDir\n if (custom === undefined) {\n const resourceList = await this.resourceList\n for (const name of names) {\n if (resourceList.includes(name)) {\n return path.join(resourcesDir, name)\n }\n }\n } else if (custom != null && !isEmptyOrSpaces(custom)) {\n const resourceList = await this.resourceList\n if (resourceList.includes(custom)) {\n return path.join(resourcesDir, custom)\n }\n\n let p = path.resolve(resourcesDir, custom)\n if ((await statOrNull(p)) == null) {\n p = path.resolve(this.projectDir, custom)\n if ((await statOrNull(p)) == null) {\n throw new InvalidConfigurationError(\n `cannot find specified resource \"${custom}\", nor relative to \"${resourcesDir}\", neither relative to project dir (\"${this.projectDir}\")`\n )\n }\n }\n return p\n }\n return null\n }\n\n get forceCodeSigning(): boolean {\n const forceCodeSigningPlatform = this.platformSpecificBuildOptions.forceCodeSigning\n return (forceCodeSigningPlatform == null ? this.config.forceCodeSigning : forceCodeSigningPlatform) || false\n }\n\n protected async getOrConvertIcon(format: IconFormat): Promise {\n const result = await this.resolveIcon(asArray(this.platformSpecificBuildOptions.icon || this.config.icon), [], format)\n if (result.length === 0) {\n const framework = this.info.framework\n if (framework.getDefaultIcon != null) {\n return framework.getDefaultIcon(this.platform)\n }\n\n log.warn({ reason: \"application icon is not set\" }, `default ${capitalizeFirstLetter(framework.name)} icon is used`)\n return this.getDefaultFrameworkIcon()\n } else {\n return result[0].file\n }\n }\n\n getDefaultFrameworkIcon(): string | null {\n const framework = this.info.framework\n return framework.getDefaultIcon == null ? null : framework.getDefaultIcon(this.platform)\n }\n\n // convert if need, validate size (it is a reason why tool is called even if file has target extension (already specified as foo.icns for example))\n async resolveIcon(sources: Array, fallbackSources: Array, outputFormat: IconFormat): Promise> {\n const output = this.expandMacro(this.config.directories!.output!)\n const args = [\n \"icon\",\n \"--format\",\n outputFormat,\n \"--root\",\n this.buildResourcesDir,\n \"--root\",\n this.projectDir,\n \"--out\",\n path.resolve(this.projectDir, output, `.icon-${outputFormat}`),\n ]\n for (const source of sources) {\n args.push(\"--input\", source)\n }\n for (const source of fallbackSources) {\n args.push(\"--fallback-input\", source)\n }\n\n const result: IconConvertResult = await executeAppBuilderAsJson(args)\n const errorMessage = result.error\n if (errorMessage != null) {\n throw new InvalidConfigurationError(errorMessage, result.errorCode)\n }\n\n if (result.isFallback) {\n log.warn({ reason: \"application icon is not set\" }, `default ${capitalizeFirstLetter(this.info.framework.name)} icon is used`)\n }\n\n return result.icons || []\n }\n}\n\nexport interface IconInfo {\n file: string\n size: number\n}\n\ninterface IconConvertResult {\n icons?: Array\n\n error?: string\n errorCode?: string\n isFallback?: boolean\n}\n\nexport type IconFormat = \"icns\" | \"ico\" | \"set\"\n\nexport function isSafeGithubName(name: string) {\n return /^[0-9A-Za-z._-]+$/.test(name)\n}\n\nexport function computeSafeArtifactNameIfNeeded(suggestedName: string | null, safeNameProducer: () => string): string | null {\n // GitHub only allows the listed characters in file names.\n if (suggestedName != null) {\n if (isSafeGithubName(suggestedName)) {\n return null\n }\n\n // prefer to use suggested name - so, if space is the only problem, just replace only space to dash\n suggestedName = suggestedName.replace(/ /g, \"-\")\n if (isSafeGithubName(suggestedName)) {\n return suggestedName\n }\n }\n\n return safeNameProducer()\n}\n\n// remove leading dot\nexport function normalizeExt(ext: string) {\n return ext.startsWith(\".\") ? ext.substring(1) : ext\n}\n\nasync function resolveModule(type: string | undefined, name: string): Promise {\n const extension = path.extname(name).toLowerCase()\n const isModuleType = type === \"module\"\n try {\n if (extension === \".mjs\" || (extension === \".js\" && isModuleType)) {\n const fileUrl = pathToFileURL(name).href\n return await eval(\"import('\" + fileUrl + \"')\")\n }\n } catch (error) {\n log.debug({ moduleName: name }, \"Unable to dynamically import hook, falling back to `require`\")\n }\n return require(name)\n}\n\nexport async function resolveFunction(type: string | undefined, executor: T | string, name: string): Promise {\n if (executor == null || typeof executor !== \"string\") {\n return executor\n }\n\n let p = executor as string\n if (p.startsWith(\".\")) {\n p = path.resolve(p)\n }\n\n try {\n p = require.resolve(p)\n } catch (e: any) {\n debug(e)\n p = path.resolve(p)\n }\n\n const m: any = await resolveModule(type, p)\n const namedExport = m[name]\n if (namedExport == null) {\n return m.default || m\n } else {\n return namedExport\n }\n}\n\nexport function chooseNotNull(v1: string | null | undefined, v2: string | null | undefined): string | null | undefined {\n return v1 == null ? v2 : v1\n}\n\nfunction capitalizeFirstLetter(text: string) {\n return text.charAt(0).toUpperCase() + text.slice(1)\n}\n"]} +\ No newline at end of file ++{"version":3,"file":"platformPackager.js","sourceRoot":"","sources":["../src/platformPackager.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAC1C,+CAA8J;AAC9J,gDAAkF;AAClF,4CAAiE;AACjE,sDAA2D;AAC3D,0CAAqC;AACrC,uCAA+B;AAE/B,6BAA4B;AAC5B,6BAAmC;AACnC,uCAAmC;AACnC,4DAA2D;AAC3D,8CAA8C;AAC9C,gDAA8C;AAC9C,+CAA8I;AAC9I,uDAA4E;AAC5E,2CAAwD;AACxD,mCAagB;AAChB,kDAA2D;AAC3D,wDAA+I;AAC/I,wDAAmE;AAEnE,MAAsB,gBAAgB;IACpC,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAA;IAC1B,CAAC;IAED,IAAI,iBAAiB;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAA;IACpC,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAA;IAC7B,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAA;IACzB,CAAC;IAID,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAA;IACjC,CAAC;IAMD,YACW,IAAc,EACd,QAAkB;QADlB,SAAI,GAAJ,IAAI,CAAU;QACd,aAAQ,GAAR,QAAQ,CAAU;QANZ,kBAAa,GAAG,IAAI,eAAI,CAAgB,GAAG,EAAE,CAAC,IAAA,0BAAgB,EAAC,IAAA,kBAAO,EAAC,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C,EAAE,CAAA;AAC7B,CAAC;AAFD,sCAEC;AAED,SAAS,qBAAqB,CAAC,IAAY;IACzC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACrD,CAAC","sourcesContent":["import BluebirdPromise from \"bluebird-lst\"\nimport { Arch, asArray, AsyncTaskManager, debug, DebugLogger, deepAssign, getArchSuffix, InvalidConfigurationError, isEmptyOrSpaces, log } from \"builder-util\"\nimport { defaultArchFromString, getArtifactArchName } from \"builder-util/out/arch\"\nimport { FileTransformer, statOrNull } from \"builder-util/out/fs\"\nimport { orIfFileNotExist } from \"builder-util/out/promise\"\nimport { readdir } from \"fs/promises\"\nimport { Lazy } from \"lazy-val\"\nimport { Minimatch } from \"minimatch\"\nimport * as path from \"path\"\nimport { pathToFileURL } from \"url\"\nimport { AppInfo } from \"./appInfo\"\nimport { checkFileInArchive } from \"./asar/asarFileChecker\"\nimport { AsarPackager } from \"./asar/asarUtil\"\nimport { computeData } from \"./asar/integrity\"\nimport { copyFiles, FileMatcher, getFileMatchers, GetFileMatchersOptions, getMainFileMatchers, getNodeModuleFileMatcher } from \"./fileMatcher\"\nimport { createTransformer, isElectronCompileUsed } from \"./fileTransformer\"\nimport { Framework, isElectronBased } from \"./Framework\"\nimport {\n AfterPackContext,\n AsarOptions,\n CompressionLevel,\n Configuration,\n ElectronPlatformName,\n FileAssociation,\n Packager,\n PackagerOptions,\n Platform,\n PlatformSpecificBuildOptions,\n Target,\n TargetSpecificOptions,\n} from \"./index\"\nimport { executeAppBuilderAsJson } from \"./util/appBuilder\"\nimport { computeFileSets, computeNodeModuleFileSets, copyAppFiles, ELECTRON_COMPILE_SHIM_FILENAME, transformFiles } from \"./util/appFileCopier\"\nimport { expandMacro as doExpandMacro } from \"./util/macroExpander\"\n\nexport abstract class PlatformPackager {\n get packagerOptions(): PackagerOptions {\n return this.info.options\n }\n\n get buildResourcesDir(): string {\n return this.info.buildResourcesDir\n }\n\n get projectDir(): string {\n return this.info.projectDir\n }\n\n get config(): Configuration {\n return this.info.config\n }\n\n readonly platformSpecificBuildOptions: DC\n\n get resourceList(): Promise> {\n return this._resourceList.value\n }\n\n private readonly _resourceList = new Lazy>(() => orIfFileNotExist(readdir(this.info.buildResourcesDir), []))\n\n readonly appInfo: AppInfo\n\n protected constructor(\n readonly info: Packager,\n readonly platform: Platform\n ) {\n this.platformSpecificBuildOptions = PlatformPackager.normalizePlatformSpecificBuildOptions((this.config as any)[platform.buildConfigurationKey])\n this.appInfo = this.prepareAppInfo(info.appInfo)\n }\n\n get compression(): CompressionLevel {\n const compression = this.platformSpecificBuildOptions.compression\n // explicitly set to null - request to use default value instead of parent (in the config)\n if (compression === null) {\n return \"normal\"\n }\n if (compression == \"ultra\" && process.platform !== \"win32\") {\n return \"maximum\"\n }\n return compression || this.config.compression || \"normal\"\n }\n\n get debugLogger(): DebugLogger {\n return this.info.debugLogger\n }\n\n abstract get defaultTarget(): Array\n\n // eslint-disable-next-line\n protected prepareAppInfo(appInfo: AppInfo) {\n return new AppInfo(this.info, null, this.platformSpecificBuildOptions)\n }\n\n private static normalizePlatformSpecificBuildOptions(options: any | null | undefined): any {\n return options == null ? Object.create(null) : options\n }\n\n abstract createTargets(targets: Array, mapper: (name: string, factory: (outDir: string) => Target) => void): void\n\n protected getCscPassword(): string {\n const password = this.doGetCscPassword()\n if (isEmptyOrSpaces(password)) {\n log.info({ reason: \"CSC_KEY_PASSWORD is not defined\" }, \"empty password will be used for code signing\")\n return \"\"\n } else {\n return password.trim()\n }\n }\n\n protected getCscLink(extraEnvName?: string | null): string | null | undefined {\n // allow to specify as empty string\n const envValue = chooseNotNull(extraEnvName == null ? null : process.env[extraEnvName], process.env.CSC_LINK)\n return chooseNotNull(chooseNotNull(this.info.config.cscLink, this.platformSpecificBuildOptions.cscLink), envValue)\n }\n\n protected doGetCscPassword(): string | null | undefined {\n // allow to specify as empty string\n return chooseNotNull(chooseNotNull(this.info.config.cscKeyPassword, this.platformSpecificBuildOptions.cscKeyPassword), process.env.CSC_KEY_PASSWORD)\n }\n\n protected computeAppOutDir(outDir: string, arch: Arch): string {\n return (\n this.packagerOptions.prepackaged ||\n path.join(\n outDir,\n `${this.platform.buildConfigurationKey}${getArchSuffix(arch, this.platformSpecificBuildOptions.defaultArch)}${this.platform === Platform.MAC ? \"\" : \"-unpacked\"}`\n )\n )\n }\n\n dispatchArtifactCreated(file: string, target: Target | null, arch: Arch | null, safeArtifactName?: string | null): Promise {\n return this.info.callArtifactBuildCompleted({\n file,\n safeArtifactName,\n target,\n arch,\n packager: this,\n })\n }\n\n async pack(outDir: string, arch: Arch, targets: Array, taskManager: AsyncTaskManager): Promise {\n const appOutDir = this.computeAppOutDir(outDir, arch)\n await this.doPack(outDir, appOutDir, this.platform.nodeName as ElectronPlatformName, arch, this.platformSpecificBuildOptions, targets)\n this.packageInDistributableFormat(appOutDir, arch, targets, taskManager)\n }\n\n protected packageInDistributableFormat(appOutDir: string, arch: Arch, targets: Array, taskManager: AsyncTaskManager): void {\n if (targets.find(it => !it.isAsyncSupported) == null) {\n PlatformPackager.buildAsyncTargets(targets, taskManager, appOutDir, arch)\n return\n }\n\n taskManager.add(async () => {\n // BluebirdPromise.map doesn't invoke target.build immediately, but for RemoteTarget it is very critical to call build() before finishBuild()\n const subTaskManager = new AsyncTaskManager(this.info.cancellationToken)\n PlatformPackager.buildAsyncTargets(targets, subTaskManager, appOutDir, arch)\n await subTaskManager.awaitTasks()\n\n for (const target of targets) {\n if (!target.isAsyncSupported) {\n await target.build(appOutDir, arch)\n }\n }\n })\n }\n\n private static buildAsyncTargets(targets: Array, taskManager: AsyncTaskManager, appOutDir: string, arch: Arch) {\n for (const target of targets) {\n if (target.isAsyncSupported) {\n taskManager.addTask(target.build(appOutDir, arch))\n }\n }\n }\n\n private getExtraFileMatchers(isResources: boolean, appOutDir: string, options: GetFileMatchersOptions): Array | null {\n const base = isResources\n ? this.getResourcesDir(appOutDir)\n : this.platform === Platform.MAC\n ? path.join(appOutDir, `${this.appInfo.productFilename}.app`, \"Contents\")\n : appOutDir\n return getFileMatchers(this.config, isResources ? \"extraResources\" : \"extraFiles\", base, options)\n }\n\n createGetFileMatchersOptions(outDir: string, arch: Arch, customBuildOptions: PlatformSpecificBuildOptions): GetFileMatchersOptions {\n return {\n macroExpander: it => this.expandMacro(it, arch == null ? null : Arch[arch], { \"/*\": \"{,/**/*}\" }),\n customBuildOptions,\n globalOutDir: outDir,\n defaultSrc: this.projectDir,\n }\n }\n\n protected async doPack(\n outDir: string,\n appOutDir: string,\n platformName: ElectronPlatformName,\n arch: Arch,\n platformSpecificBuildOptions: DC,\n targets: Array,\n sign = true,\n disableAsarIntegrity = false\n ) {\n if (this.packagerOptions.prepackaged != null) {\n return\n }\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n // Due to node-gyp rewriting GYP_MSVS_VERSION when reused across the same session, we must reset the env var: https://github.com/electron-userland/electron-builder/issues/7256\n delete process.env.GYP_MSVS_VERSION\n\n const beforePack = await resolveFunction(this.appInfo.type, this.config.beforePack, \"beforePack\")\n if (beforePack != null) {\n await beforePack({\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n })\n }\n\n await this.info.installAppDependencies(this.platform, arch)\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const framework = this.info.framework\n log.info(\n {\n platform: platformName,\n arch: Arch[arch],\n [`${framework.name}`]: framework.version,\n appOutDir: log.filePath(appOutDir),\n },\n `packaging`\n )\n\n await framework.prepareApplicationStageDirectory({\n packager: this,\n appOutDir,\n platformName,\n arch: Arch[arch],\n version: framework.version,\n })\n\n const excludePatterns: Array = []\n\n const computeParsedPatterns = (patterns: Array | null) => {\n if (patterns != null) {\n for (const pattern of patterns) {\n pattern.computeParsedPatterns(excludePatterns, this.info.projectDir)\n }\n }\n }\n\n const getFileMatchersOptions = this.createGetFileMatchersOptions(outDir, arch, platformSpecificBuildOptions)\n const macroExpander = getFileMatchersOptions.macroExpander\n const extraResourceMatchers = this.getExtraFileMatchers(true, appOutDir, getFileMatchersOptions)\n computeParsedPatterns(extraResourceMatchers)\n const extraFileMatchers = this.getExtraFileMatchers(false, appOutDir, getFileMatchersOptions)\n computeParsedPatterns(extraFileMatchers)\n\n const packContext: AfterPackContext = {\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n }\n\n const asarOptions = await this.computeAsarOptions(platformSpecificBuildOptions)\n const resourcesPath =\n this.platform === Platform.MAC\n ? path.join(appOutDir, framework.distMacOsAppName, \"Contents\", \"Resources\")\n : isElectronBased(framework)\n ? path.join(appOutDir, \"resources\")\n : appOutDir\n const taskManager = new AsyncTaskManager(this.info.cancellationToken)\n this.copyAppFiles(taskManager, asarOptions, resourcesPath, path.join(resourcesPath, \"app\"), packContext, platformSpecificBuildOptions, excludePatterns, macroExpander)\n await taskManager.awaitTasks()\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n if (framework.beforeCopyExtraFiles != null) {\n const resourcesRelativePath = this.platform === Platform.MAC ? \"Resources\" : isElectronBased(framework) ? \"resources\" : \"\"\n\n await framework.beforeCopyExtraFiles({\n packager: this,\n appOutDir,\n asarIntegrity: asarOptions == null || disableAsarIntegrity ? null : await computeData({ resourcesPath, resourcesRelativePath }),\n platformName,\n })\n }\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const transformerForExtraFiles = this.createTransformerForExtraFiles(packContext)\n await copyFiles(extraResourceMatchers, transformerForExtraFiles)\n await copyFiles(extraFileMatchers, transformerForExtraFiles)\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n await this.info.afterPack(packContext)\n\n if (framework.afterPack != null) {\n await framework.afterPack(packContext)\n }\n\n const isAsar = asarOptions != null\n await this.sanityCheckPackage(appOutDir, isAsar, framework)\n if (sign) {\n await this.doSignAfterPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets)\n }\n }\n\n protected async doSignAfterPack(outDir: string, appOutDir: string, platformName: ElectronPlatformName, arch: Arch, platformSpecificBuildOptions: DC, targets: Array) {\n const asarOptions = await this.computeAsarOptions(platformSpecificBuildOptions)\n const isAsar = asarOptions != null\n const packContext = {\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n }\n const didSign = await this.signApp(packContext, isAsar)\n const afterSign = await resolveFunction(this.appInfo.type, this.config.afterSign, \"afterSign\")\n if (afterSign != null) {\n if (didSign) {\n await Promise.resolve(afterSign(packContext))\n } else {\n log.warn(null, `skipping \"afterSign\" hook as no signing occurred, perhaps you intended \"afterPack\"?`)\n }\n }\n }\n\n // eslint-disable-next-line\n protected createTransformerForExtraFiles(packContext: AfterPackContext): FileTransformer | null {\n return null\n }\n\n private copyAppFiles(\n taskManager: AsyncTaskManager,\n asarOptions: AsarOptions | null,\n resourcePath: string,\n defaultDestination: string,\n packContext: AfterPackContext,\n platformSpecificBuildOptions: DC,\n excludePatterns: Array,\n macroExpander: (it: string) => string\n ) {\n const appDir = this.info.appDir\n const config = this.config\n const isElectronCompile = asarOptions != null && isElectronCompileUsed(this.info)\n\n const mainMatchers = getMainFileMatchers(appDir, defaultDestination, macroExpander, platformSpecificBuildOptions, this, packContext.outDir, isElectronCompile)\n if (excludePatterns.length > 0) {\n for (const matcher of mainMatchers) {\n matcher.excludePatterns = excludePatterns\n }\n }\n\n const framework = this.info.framework\n const transformer = createTransformer(\n appDir,\n config,\n isElectronCompile\n ? {\n originalMain: this.info.metadata.main,\n main: ELECTRON_COMPILE_SHIM_FILENAME,\n ...config.extraMetadata,\n }\n : config.extraMetadata,\n framework.createTransformer == null ? null : framework.createTransformer()\n )\n\n const _computeFileSets = (matchers: Array) => {\n return computeFileSets(matchers, this.info.isPrepackedAppAsar ? null : transformer, this, isElectronCompile).then(async result => {\n if (!this.info.isPrepackedAppAsar && !this.info.areNodeModulesHandledExternally) {\n const moduleFileMatcher = getNodeModuleFileMatcher(appDir, defaultDestination, macroExpander, platformSpecificBuildOptions, this.info)\n result = result.concat(await computeNodeModuleFileSets(this, moduleFileMatcher))\n }\n return result.filter(it => it.files.length > 0)\n })\n }\n\n if (this.info.isPrepackedAppAsar) {\n taskManager.addTask(BluebirdPromise.each(_computeFileSets([new FileMatcher(appDir, resourcePath, macroExpander)]), it => copyAppFiles(it, this.info, transformer)))\n } else if (asarOptions == null) {\n // for ASAR all asar unpacked files will be extra transformed (e.g. sign of EXE and DLL) later,\n // for prepackaged asar extra transformation not supported yet,\n // so, extra transform if asar is disabled\n const transformerForExtraFiles = this.createTransformerForExtraFiles(packContext)\n const combinedTransformer: FileTransformer = file => {\n if (transformerForExtraFiles != null) {\n const result = transformerForExtraFiles(file)\n if (result != null) {\n return result\n }\n }\n return transformer(file)\n }\n\n taskManager.addTask(BluebirdPromise.each(_computeFileSets(mainMatchers), it => copyAppFiles(it, this.info, combinedTransformer)))\n } else {\n const unpackPattern = getFileMatchers(config, \"asarUnpack\", defaultDestination, {\n macroExpander,\n customBuildOptions: platformSpecificBuildOptions,\n globalOutDir: packContext.outDir,\n defaultSrc: appDir,\n })\n const fileMatcher = unpackPattern == null ? null : unpackPattern[0]\n taskManager.addTask(\n _computeFileSets(mainMatchers).then(async fileSets => {\n for (const fileSet of fileSets) {\n await transformFiles(transformer, fileSet)\n }\n\n await new AsarPackager(appDir, resourcePath, asarOptions, fileMatcher == null ? null : fileMatcher.createFilter()).pack(fileSets, this)\n })\n )\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected signApp(packContext: AfterPackContext, isAsar: boolean): Promise {\n return Promise.resolve(false)\n }\n\n getIconPath(): Promise {\n return Promise.resolve(null)\n }\n\n private async computeAsarOptions(customBuildOptions: DC): Promise {\n if (!isElectronBased(this.info.framework)) {\n return null\n }\n\n function errorMessage(name: string) {\n return `${name} is deprecated is deprecated and not supported — please use asarUnpack`\n }\n\n const buildMetadata = this.config as any\n if (buildMetadata[\"asar-unpack\"] != null) {\n throw new Error(errorMessage(\"asar-unpack\"))\n }\n if (buildMetadata[\"asar-unpack-dir\"] != null) {\n throw new Error(errorMessage(\"asar-unpack-dir\"))\n }\n\n const platformSpecific = customBuildOptions.asar\n const result = platformSpecific == null ? this.config.asar : platformSpecific\n if (result === false) {\n const appAsarStat = await statOrNull(path.join(this.info.appDir, \"app.asar\"))\n //noinspection ES6MissingAwait\n if (appAsarStat == null || !appAsarStat.isFile()) {\n log.warn(\n {\n solution: \"enable asar and use asarUnpack to unpack files that must be externally available\",\n },\n \"asar usage is disabled — this is strongly not recommended\"\n )\n }\n return null\n }\n\n if (result == null || result === true) {\n return {}\n }\n\n for (const name of [\"unpackDir\", \"unpack\"]) {\n if ((result as any)[name] != null) {\n throw new Error(errorMessage(`asar.${name}`))\n }\n }\n return deepAssign({}, result)\n }\n\n public getElectronSrcDir(dist: string): string {\n return path.resolve(this.projectDir, dist)\n }\n\n public getElectronDestinationDir(appOutDir: string): string {\n return appOutDir\n }\n\n getResourcesDir(appOutDir: string): string {\n if (this.platform === Platform.MAC) {\n return this.getMacOsResourcesDir(appOutDir)\n } else if (isElectronBased(this.info.framework)) {\n return path.join(appOutDir, \"resources\")\n } else {\n return appOutDir\n }\n }\n\n public getMacOsResourcesDir(appOutDir: string): string {\n return path.join(appOutDir, `${this.appInfo.productFilename}.app`, \"Contents\", \"Resources\")\n }\n\n private async checkFileInPackage(resourcesDir: string, file: string, messagePrefix: string, isAsar: boolean) {\n const relativeFile = path.relative(this.info.appDir, path.resolve(this.info.appDir, file))\n if (isAsar) {\n await checkFileInArchive(path.join(resourcesDir, \"app.asar\"), relativeFile, messagePrefix)\n return\n }\n\n const pathParsed = path.parse(file)\n // Even when packaging to asar is disabled, it does not imply that the main file can not be inside an .asar archive.\n // This may occur when the packaging is done manually before processing with electron-builder.\n if (pathParsed.dir.includes(\".asar\")) {\n // The path needs to be split to the part with an asar archive which acts like a directory and the part with\n // the path to main file itself. (e.g. path/arch.asar/dir/index.js -> path/arch.asar, dir/index.js)\n // noinspection TypeScriptValidateJSTypes\n const pathSplit: Array = pathParsed.dir.split(path.sep)\n let partWithAsarIndex = 0\n pathSplit.some((pathPart: string, index: number) => {\n partWithAsarIndex = index\n return pathPart.endsWith(\".asar\")\n })\n const asarPath = path.join(...pathSplit.slice(0, partWithAsarIndex + 1))\n let mainPath = pathSplit.length > partWithAsarIndex + 1 ? path.join.apply(pathSplit.slice(partWithAsarIndex + 1)) : \"\"\n mainPath += path.join(mainPath, pathParsed.base)\n await checkFileInArchive(path.join(resourcesDir, \"app\", asarPath), mainPath, messagePrefix)\n } else {\n const fullPath = path.join(resourcesDir, \"app\", relativeFile)\n const outStat = await statOrNull(fullPath)\n if (outStat == null) {\n throw new Error(`${messagePrefix} \"${fullPath}\" does not exist. Seems like a wrong configuration.`)\n } else {\n //noinspection ES6MissingAwait\n if (!outStat.isFile()) {\n throw new Error(`${messagePrefix} \"${fullPath}\" is not a file. Seems like a wrong configuration.`)\n }\n }\n }\n }\n\n private async sanityCheckPackage(appOutDir: string, isAsar: boolean, framework: Framework): Promise {\n const outStat = await statOrNull(appOutDir)\n if (outStat == null) {\n throw new Error(`Output directory \"${appOutDir}\" does not exist. Seems like a wrong configuration.`)\n } else {\n //noinspection ES6MissingAwait\n if (!outStat.isDirectory()) {\n throw new Error(`Output directory \"${appOutDir}\" is not a directory. Seems like a wrong configuration.`)\n }\n }\n\n const resourcesDir = this.getResourcesDir(appOutDir)\n const mainFile = (framework.getMainFile == null ? null : framework.getMainFile(this.platform)) || this.info.metadata.main || \"index.js\"\n await this.checkFileInPackage(resourcesDir, mainFile, \"Application entry file\", isAsar)\n await this.checkFileInPackage(resourcesDir, \"package.json\", \"Application\", isAsar)\n }\n\n // tslint:disable-next-line:no-invalid-template-strings\n computeSafeArtifactName(\n suggestedName: string | null,\n ext: string,\n arch?: Arch | null,\n skipDefaultArch = true,\n defaultArch?: string,\n safePattern = \"${name}-${version}-${arch}.${ext}\"\n ): string | null {\n return computeSafeArtifactNameIfNeeded(suggestedName, () =>\n this.computeArtifactName(safePattern, ext, skipDefaultArch && arch === defaultArchFromString(defaultArch) ? null : arch)\n )\n }\n\n expandArtifactNamePattern(\n targetSpecificOptions: TargetSpecificOptions | null | undefined,\n ext: string,\n arch?: Arch | null,\n defaultPattern?: string,\n skipDefaultArch = true,\n defaultArch?: string\n ): string {\n const { pattern, isUserForced } = this.artifactPatternConfig(targetSpecificOptions, defaultPattern)\n return this.computeArtifactName(pattern, ext, !isUserForced && skipDefaultArch && arch === defaultArchFromString(defaultArch) ? null : arch)\n }\n\n artifactPatternConfig(targetSpecificOptions: TargetSpecificOptions | null | undefined, defaultPattern: string | undefined) {\n const userSpecifiedPattern = targetSpecificOptions?.artifactName || this.platformSpecificBuildOptions.artifactName || this.config.artifactName\n return {\n isUserForced: !!userSpecifiedPattern,\n pattern: userSpecifiedPattern || defaultPattern || \"${productName}-${version}-${arch}.${ext}\",\n }\n }\n\n expandArtifactBeautyNamePattern(targetSpecificOptions: TargetSpecificOptions | null | undefined, ext: string, arch?: Arch | null): string {\n // tslint:disable-next-line:no-invalid-template-strings\n return this.expandArtifactNamePattern(targetSpecificOptions, ext, arch, \"${productName} ${version} ${arch}.${ext}\", true)\n }\n\n private computeArtifactName(pattern: any, ext: string, arch: Arch | null | undefined): string {\n const archName = arch == null ? null : getArtifactArchName(arch, ext)\n return this.expandMacro(pattern, archName, {\n ext,\n })\n }\n\n expandMacro(pattern: string, arch?: string | null, extra: any = {}, isProductNameSanitized = true): string {\n return doExpandMacro(pattern, arch, this.appInfo, { os: this.platform.buildConfigurationKey, ...extra }, isProductNameSanitized)\n }\n\n generateName2(ext: string | null, classifier: string | null | undefined, deployment: boolean): string {\n const dotExt = ext == null ? \"\" : `.${ext}`\n const separator = ext === \"deb\" ? \"_\" : \"-\"\n return `${deployment ? this.appInfo.name : this.appInfo.productFilename}${separator}${this.appInfo.version}${classifier == null ? \"\" : `${separator}${classifier}`}${dotExt}`\n }\n\n getTempFile(suffix: string): Promise {\n return this.info.tempDirManager.getTempFile({ suffix })\n }\n\n get fileAssociations(): Array {\n return asArray(this.config.fileAssociations).concat(asArray(this.platformSpecificBuildOptions.fileAssociations))\n }\n\n async getResource(custom: string | null | undefined, ...names: Array): Promise {\n const resourcesDir = this.info.buildResourcesDir\n if (custom === undefined) {\n const resourceList = await this.resourceList\n for (const name of names) {\n if (resourceList.includes(name)) {\n return path.join(resourcesDir, name)\n }\n }\n } else if (custom != null && !isEmptyOrSpaces(custom)) {\n const resourceList = await this.resourceList\n if (resourceList.includes(custom)) {\n return path.join(resourcesDir, custom)\n }\n\n let p = path.resolve(resourcesDir, custom)\n if ((await statOrNull(p)) == null) {\n p = path.resolve(this.projectDir, custom)\n if ((await statOrNull(p)) == null) {\n throw new InvalidConfigurationError(\n `cannot find specified resource \"${custom}\", nor relative to \"${resourcesDir}\", neither relative to project dir (\"${this.projectDir}\")`\n )\n }\n }\n return p\n }\n return null\n }\n\n get forceCodeSigning(): boolean {\n const forceCodeSigningPlatform = this.platformSpecificBuildOptions.forceCodeSigning\n return (forceCodeSigningPlatform == null ? this.config.forceCodeSigning : forceCodeSigningPlatform) || false\n }\n\n protected async getOrConvertIcon(format: IconFormat): Promise {\n const result = await this.resolveIcon(asArray(this.platformSpecificBuildOptions.icon || this.config.icon), [], format)\n if (result.length === 0) {\n const framework = this.info.framework\n if (framework.getDefaultIcon != null) {\n return framework.getDefaultIcon(this.platform)\n }\n\n log.warn({ reason: \"application icon is not set\" }, `default ${capitalizeFirstLetter(framework.name)} icon is used`)\n return this.getDefaultFrameworkIcon()\n } else {\n return result[0].file\n }\n }\n\n getDefaultFrameworkIcon(): string | null {\n const framework = this.info.framework\n return framework.getDefaultIcon == null ? null : framework.getDefaultIcon(this.platform)\n }\n\n // convert if need, validate size (it is a reason why tool is called even if file has target extension (already specified as foo.icns for example))\n async resolveIcon(sources: Array, fallbackSources: Array, outputFormat: IconFormat): Promise> {\n const output = this.expandMacro(this.config.directories!.output!)\n const args = [\n \"icon\",\n \"--format\",\n outputFormat,\n \"--root\",\n this.buildResourcesDir,\n \"--root\",\n this.projectDir,\n \"--out\",\n path.resolve(this.projectDir, output, `.icon-${outputFormat}`),\n ]\n for (const source of sources) {\n args.push(\"--input\", source)\n }\n for (const source of fallbackSources) {\n args.push(\"--fallback-input\", source)\n }\n\n const result: IconConvertResult = await executeAppBuilderAsJson(args)\n const errorMessage = result.error\n if (errorMessage != null) {\n throw new InvalidConfigurationError(errorMessage, result.errorCode)\n }\n\n if (result.isFallback) {\n log.warn({ reason: \"application icon is not set\" }, `default ${capitalizeFirstLetter(this.info.framework.name)} icon is used`)\n }\n\n return result.icons || []\n }\n}\n\nexport interface IconInfo {\n file: string\n size: number\n}\n\ninterface IconConvertResult {\n icons?: Array\n\n error?: string\n errorCode?: string\n isFallback?: boolean\n}\n\nexport type IconFormat = \"icns\" | \"ico\" | \"set\"\n\nexport function isSafeGithubName(name: string) {\n return /^[0-9A-Za-z._-]+$/.test(name)\n}\n\nexport function computeSafeArtifactNameIfNeeded(suggestedName: string | null, safeNameProducer: () => string): string | null {\n // GitHub only allows the listed characters in file names.\n if (suggestedName != null) {\n if (isSafeGithubName(suggestedName)) {\n return null\n }\n\n // prefer to use suggested name - so, if space is the only problem, just replace only space to dash\n suggestedName = suggestedName.replace(/ /g, \"-\")\n if (isSafeGithubName(suggestedName)) {\n return suggestedName\n }\n }\n\n return safeNameProducer()\n}\n\n// remove leading dot\nexport function normalizeExt(ext: string) {\n return ext.startsWith(\".\") ? ext.substring(1) : ext\n}\n\nasync function resolveModule(type: string | undefined, name: string): Promise {\n const extension = path.extname(name).toLowerCase()\n const isModuleType = type === \"module\"\n try {\n if (extension === \".mjs\" || (extension === \".js\" && isModuleType)) {\n const fileUrl = pathToFileURL(name).href\n return await eval(\"import('\" + fileUrl + \"')\")\n }\n } catch (error) {\n log.debug({ moduleName: name }, \"Unable to dynamically import hook, falling back to `require`\")\n }\n return require(name)\n}\n\nexport async function resolveFunction(type: string | undefined, executor: T | string, name: string): Promise {\n if (executor == null || typeof executor !== \"string\") {\n return executor\n }\n\n let p = executor as string\n if (p.startsWith(\".\")) {\n p = path.resolve(p)\n }\n\n try {\n p = require.resolve(p)\n } catch (e: any) {\n debug(e)\n p = path.resolve(p)\n }\n\n const m: any = await resolveModule(type, p)\n const namedExport = m[name]\n if (namedExport == null) {\n return m.default || m\n } else {\n return namedExport\n }\n}\n\nexport function chooseNotNull(v1: string | null | undefined, v2: string | null | undefined): string | null | undefined {\n return v1 == null ? v2 : v1\n}\n\nfunction capitalizeFirstLetter(text: string) {\n return text.charAt(0).toUpperCase() + text.slice(1)\n}\n"]} +\ No newline at end of file +diff --git a/out/targets/archive.js b/out/targets/archive.js +index 45b252d238c0bef236d317665ad7f7e5d474b06b..2152d89844e5c2554a4a59343ca17f1f734ca69f 100644 +--- a/out/targets/archive.js ++++ b/out/targets/archive.js +@@ -53,6 +53,10 @@ exports.tar = tar; + function compute7zCompressArgs(format, options = {}) { + let storeOnly = options.compression === "store"; + const args = debug7zArgs("a"); ++ if (options.compression == "ultra") { ++ args.push('-r', '-mx9'); ++ return args; ++ } + let isLevelSet = false; + if (process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL != null) { + storeOnly = false; +diff --git a/out/targets/archive.js.map b/out/targets/archive.js.map +index 315136cfe09f72b11ea476ee23c7abcb5a664547..9a09f84a46545475bc010ac5c33fd7c77f3a6e28 100644 +--- a/out/targets/archive.js.map ++++ b/out/targets/archive.js.map +@@ -1 +1 @@ +-{"version":3,"file":"archive.js","sourceRoot":"","sources":["../../src/targets/archive.ts"],"names":[],"mappings":";;;AAAA,+CAAiD;AACjD,4CAAwE;AACxE,uCAA+B;AAC/B,6BAA4B;AAC5B,6BAAwD;AAGxD,mCAA2C;AAC3C,+CAAyC;AAEzC,gBAAgB;AACT,KAAK,UAAU,GAAG,CAAC,WAAmC,EAAE,MAAc,EAAE,OAAe,EAAE,YAAoB,EAAE,QAAiB,EAAE,cAAsB;IAC7J,MAAM,OAAO,GAAG,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I,KAAK,CAAC,2BAA2B,YAAY,iBAAiB,CAAC,CAAA;QAC3E,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,CAAA;QACT,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AA1CD,0BA0CC;AAED,SAAS,WAAW,CAAC,OAAkB;IACrC,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IAC7B,IAAI,sBAAO,CAAC,OAAO,EAAE,CAAC;QACpB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAClB,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import { debug7z, exec, log } from \"builder-util\"\nimport { exists, unlinkIfExists, statOrNull } from \"builder-util/out/fs\"\nimport { move } from \"fs-extra\"\nimport * as path from \"path\"\nimport { create, CreateOptions, FileOptions } from \"tar\"\nimport { TmpDir } from \"temp-file\"\nimport { CompressionLevel } from \"../core\"\nimport { getLinuxToolsPath } from \"./tools\"\nimport { getPath7za } from \"builder-util\"\n\n/** @internal */\nexport async function tar(compression: CompressionLevel | any, format: string, outFile: string, dirToArchive: string, isMacApp: boolean, tempDirManager: TmpDir): Promise {\n const tarFile = await tempDirManager.getTempFile({ suffix: \".tar\" })\n const tarArgs: CreateOptions & FileOptions = {\n file: tarFile,\n portable: true,\n cwd: dirToArchive,\n prefix: path.basename(outFile, `.${format}`),\n }\n let tarDirectory = \".\"\n if (isMacApp) {\n delete tarArgs.prefix\n tarArgs.cwd = path.dirname(dirToArchive)\n tarDirectory = path.basename(dirToArchive)\n }\n\n await Promise.all([\n create(tarArgs, [tarDirectory]),\n // remove file before - 7z doesn't overwrite file, but update\n unlinkIfExists(outFile),\n ])\n\n if (format === \"tar.lz\") {\n // noinspection SpellCheckingInspection\n let lzipPath = \"lzip\"\n if (process.platform === \"darwin\") {\n lzipPath = path.join(await getLinuxToolsPath(), \"bin\", lzipPath)\n }\n await exec(lzipPath, [compression === \"store\" ? \"-1\" : \"-9\", \"--keep\" /* keep (don't delete) input files */, tarFile])\n // bloody lzip creates file in the same dir where input file with postfix `.lz`, option --output doesn't work\n await move(`${tarFile}.lz`, outFile)\n return\n }\n\n const args = compute7zCompressArgs(format === \"tar.xz\" ? \"xz\" : format === \"tar.bz2\" ? \"bzip2\" : \"gzip\", {\n isRegularFile: true,\n method: \"DEFAULT\",\n compression,\n })\n args.push(outFile, tarFile)\n await exec(\n await getPath7za(),\n args,\n {\n cwd: path.dirname(dirToArchive),\n },\n debug7z.enabled\n )\n}\n\nexport interface ArchiveOptions {\n compression?: CompressionLevel | null\n\n /**\n * @default false\n */\n withoutDir?: boolean\n\n /**\n * @default true\n */\n solid?: boolean\n\n /**\n * @default true\n */\n isArchiveHeaderCompressed?: boolean\n\n dictSize?: number\n excluded?: Array | null\n\n // DEFAULT allows to disable custom logic and do not pass method switch at all\n method?: \"Copy\" | \"LZMA\" | \"Deflate\" | \"DEFAULT\"\n\n isRegularFile?: boolean\n}\n\nexport function compute7zCompressArgs(format: string, options: ArchiveOptions = {}) {\n let storeOnly = options.compression === \"store\"\n const args = debug7zArgs(\"a\")\n\n let isLevelSet = false\n if (process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL != null) {\n storeOnly = false\n args.push(`-mx=${process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL}`)\n isLevelSet = true\n }\n\n const isZip = format === \"zip\"\n if (!storeOnly) {\n if (isZip && options.compression === \"maximum\") {\n // http://superuser.com/a/742034\n args.push(\"-mfb=258\", \"-mpass=15\")\n }\n\n if (!isLevelSet) {\n // https://github.com/electron-userland/electron-builder/pull/3032\n args.push(\"-mx=\" + (!isZip || options.compression === \"maximum\" ? \"9\" : \"7\"))\n }\n }\n\n if (options.dictSize != null) {\n args.push(`-md=${options.dictSize}m`)\n }\n\n // https://sevenzip.osdn.jp/chm/cmdline/switches/method.htm#7Z\n // https://stackoverflow.com/questions/27136783/7zip-produces-different-output-from-identical-input\n // tc and ta are off by default, but to be sure, we explicitly set it to off\n // disable \"Stores NTFS timestamps for files: Modification time, Creation time, Last access time.\" to produce the same archive for the same data\n if (!options.isRegularFile) {\n args.push(\"-mtc=off\")\n }\n\n if (format === \"7z\" || format.endsWith(\".7z\")) {\n if (options.solid === false) {\n args.push(\"-ms=off\")\n }\n\n if (options.isArchiveHeaderCompressed === false) {\n args.push(\"-mhc=off\")\n }\n\n // https://www.7-zip.org/7z.html\n // Filters: BCJ, BCJ2, ARM, ARMT, IA64, PPC, SPARC, ...\n if (process.env.ELECTRON_BUILDER_7Z_FILTER) {\n args.push(`-mf=${process.env.ELECTRON_BUILDER_7Z_FILTER}`)\n }\n\n // args valid only for 7z\n // -mtm=off disable \"Stores last Modified timestamps for files.\"\n args.push(\"-mtm=off\", \"-mta=off\")\n }\n\n if (options.method != null) {\n if (options.method !== \"DEFAULT\") {\n args.push(`-mm=${options.method}`)\n }\n } else if (isZip || storeOnly) {\n args.push(`-mm=${storeOnly ? \"Copy\" : \"Deflate\"}`)\n }\n\n if (isZip) {\n // -mcu switch: 7-Zip uses UTF-8, if there are non-ASCII symbols.\n // because default mode: 7-Zip uses UTF-8, if the local code page doesn't contain required symbols.\n // but archive should be the same regardless where produced\n args.push(\"-mcu\")\n }\n return args\n}\n\nexport function computeZipCompressArgs(options: ArchiveOptions = {}) {\n let storeOnly = options.compression === \"store\"\n // do not deref symlinks\n const args = [\"-q\", \"-r\", \"-y\"]\n if (debug7z.enabled) {\n args.push(\"-v\")\n }\n\n if (process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL != null) {\n storeOnly = false\n args.push(`-${process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL}`)\n } else if (!storeOnly) {\n // https://github.com/electron-userland/electron-builder/pull/3032\n args.push(\"-\" + (options.compression === \"maximum\" ? \"9\" : \"7\"))\n }\n\n if (options.dictSize != null) {\n log.warn({ distSize: options.dictSize }, `ignoring unsupported option`)\n }\n\n // do not save extra file attributes (Extended Attributes on OS/2, uid/gid and file times on Unix)\n if (!options.isRegularFile) {\n args.push(\"-X\")\n }\n\n if (options.method != null) {\n if (options.method !== \"DEFAULT\") {\n log.warn({ method: options.method }, `ignoring unsupported option`)\n }\n } else {\n args.push(\"-Z\", storeOnly ? \"store\" : \"deflate\")\n }\n return args\n}\n\n// 7z is very fast, so, use ultra compression\n/** @internal */\nexport async function archive(format: string, outFile: string, dirToArchive: string, options: ArchiveOptions = {}): Promise {\n const outFileStat = await statOrNull(outFile)\n const dirStat = await statOrNull(dirToArchive)\n if (outFileStat && dirStat && outFileStat.mtime > dirStat.mtime) {\n log.info({ reason: \"Archive file is up to date\", outFile }, `skipped archiving`)\n return outFile\n }\n let use7z = true\n if (process.platform === \"darwin\" && format === \"zip\" && dirToArchive.normalize(\"NFC\") !== dirToArchive) {\n log.warn({ reason: \"7z doesn't support NFD-normalized filenames\" }, `using zip`)\n use7z = false\n }\n const args = use7z ? compute7zCompressArgs(format, options) : computeZipCompressArgs(options)\n // remove file before - 7z and zip doesn't overwrite file, but update\n await unlinkIfExists(outFile)\n\n args.push(outFile, options.withoutDir ? \".\" : path.basename(dirToArchive))\n if (options.excluded != null) {\n for (const mask of options.excluded) {\n args.push(use7z ? `-xr!${mask}` : `-x${mask}`)\n }\n }\n\n try {\n const binary = use7z ? await getPath7za() : \"zip\"\n await exec(\n binary,\n args,\n {\n cwd: options.withoutDir ? dirToArchive : path.dirname(dirToArchive),\n },\n debug7z.enabled\n )\n } catch (e: any) {\n if (e.code === \"ENOENT\" && !(await exists(dirToArchive))) {\n throw new Error(`Cannot create archive: \"${dirToArchive}\" doesn't exist`)\n } else {\n throw e\n }\n }\n\n return outFile\n}\n\nfunction debug7zArgs(command: \"a\" | \"x\"): Array {\n const args = [command, \"-bd\"]\n if (debug7z.enabled) {\n args.push(\"-bb\")\n }\n return args\n}\n"]} +\ No newline at end of file ++{"version":3,"file":"archive.js","sourceRoot":"","sources":["../../src/targets/archive.ts"],"names":[],"mappings":";;;AAAA,+CAAiD;AACjD,4CAAwE;AACxE,uC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AI,EACR,MAAM,EACN,IAAI,EACJ;YACE,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;SACpE,EACD,sBAAO,CAAC,OAAO,CAChB,CAAA;IACH,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,IAAA,WAAM,EAAC,YAAY,CAAC,CAAC,EAAE,CAAC;YACzD,MAAM,IAAI,KAAK,CAAC,2BAA2B,YAAY,iBAAiB,CAAC,CAAA;QAC3E,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,CAAA;QACT,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AA1CD,0BA0CC;AAED,SAAS,WAAW,CAAC,OAAkB;IACrC,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IAC7B,IAAI,sBAAO,CAAC,OAAO,EAAE,CAAC;QACpB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAClB,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import { debug7z, exec, log } from \"builder-util\"\nimport { exists, unlinkIfExists, statOrNull } from \"builder-util/out/fs\"\nimport { move } from \"fs-extra\"\nimport * as path from \"path\"\nimport { create, CreateOptions, FileOptions } from \"tar\"\nimport { TmpDir } from \"temp-file\"\nimport { CompressionLevel } from \"../core\"\nimport { getLinuxToolsPath } from \"./tools\"\nimport { getPath7za } from \"builder-util\"\n\n/** @internal */\nexport async function tar(compression: CompressionLevel | any, format: string, outFile: string, dirToArchive: string, isMacApp: boolean, tempDirManager: TmpDir): Promise {\n const tarFile = await tempDirManager.getTempFile({ suffix: \".tar\" })\n const tarArgs: CreateOptions & FileOptions = {\n file: tarFile,\n portable: true,\n cwd: dirToArchive,\n prefix: path.basename(outFile, `.${format}`),\n }\n let tarDirectory = \".\"\n if (isMacApp) {\n delete tarArgs.prefix\n tarArgs.cwd = path.dirname(dirToArchive)\n tarDirectory = path.basename(dirToArchive)\n }\n\n await Promise.all([\n create(tarArgs, [tarDirectory]),\n // remove file before - 7z doesn't overwrite file, but update\n unlinkIfExists(outFile),\n ])\n\n if (format === \"tar.lz\") {\n // noinspection SpellCheckingInspection\n let lzipPath = \"lzip\"\n if (process.platform === \"darwin\") {\n lzipPath = path.join(await getLinuxToolsPath(), \"bin\", lzipPath)\n }\n await exec(lzipPath, [compression === \"store\" ? \"-1\" : \"-9\", \"--keep\" /* keep (don't delete) input files */, tarFile])\n // bloody lzip creates file in the same dir where input file with postfix `.lz`, option --output doesn't work\n await move(`${tarFile}.lz`, outFile)\n return\n }\n\n const args = compute7zCompressArgs(format === \"tar.xz\" ? \"xz\" : format === \"tar.bz2\" ? \"bzip2\" : \"gzip\", {\n isRegularFile: true,\n method: \"DEFAULT\",\n compression,\n })\n args.push(outFile, tarFile)\n await exec(\n await getPath7za(),\n args,\n {\n cwd: path.dirname(dirToArchive),\n },\n debug7z.enabled\n )\n}\n\nexport interface ArchiveOptions {\n compression?: CompressionLevel | null\n\n /**\n * @default false\n */\n withoutDir?: boolean\n\n /**\n * @default true\n */\n solid?: boolean\n\n /**\n * @default true\n */\n isArchiveHeaderCompressed?: boolean\n\n dictSize?: number\n excluded?: Array | null\n\n // DEFAULT allows to disable custom logic and do not pass method switch at all\n method?: \"Copy\" | \"LZMA\" | \"Deflate\" | \"DEFAULT\"\n\n isRegularFile?: boolean\n}\n\nexport function compute7zCompressArgs(format: string, options: ArchiveOptions = {}) {\n let storeOnly = options.compression === \"store\"\n const args = debug7zArgs(\"a\")\n if (options.compression == \"ultra\") {\n args.push('-r', '-mx9')\n return args\n }\n let isLevelSet = false\n if (process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL != null) {\n storeOnly = false\n args.push(`-mx=${process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL}`)\n isLevelSet = true\n }\n\n const isZip = format === \"zip\"\n if (!storeOnly) {\n if (isZip && options.compression === \"maximum\") {\n // http://superuser.com/a/742034\n args.push(\"-mfb=258\", \"-mpass=15\")\n }\n\n if (!isLevelSet) {\n // https://github.com/electron-userland/electron-builder/pull/3032\n args.push(\"-mx=\" + (!isZip || options.compression === \"maximum\" ? \"9\" : \"7\"))\n }\n }\n\n if (options.dictSize != null) {\n args.push(`-md=${options.dictSize}m`)\n }\n\n // https://sevenzip.osdn.jp/chm/cmdline/switches/method.htm#7Z\n // https://stackoverflow.com/questions/27136783/7zip-produces-different-output-from-identical-input\n // tc and ta are off by default, but to be sure, we explicitly set it to off\n // disable \"Stores NTFS timestamps for files: Modification time, Creation time, Last access time.\" to produce the same archive for the same data\n if (!options.isRegularFile) {\n args.push(\"-mtc=off\")\n }\n\n if (format === \"7z\" || format.endsWith(\".7z\")) {\n if (options.solid === false) {\n args.push(\"-ms=off\")\n }\n\n if (options.isArchiveHeaderCompressed === false) {\n args.push(\"-mhc=off\")\n }\n\n // https://www.7-zip.org/7z.html\n // Filters: BCJ, BCJ2, ARM, ARMT, IA64, PPC, SPARC, ...\n if (process.env.ELECTRON_BUILDER_7Z_FILTER) {\n args.push(`-mf=${process.env.ELECTRON_BUILDER_7Z_FILTER}`)\n }\n\n // args valid only for 7z\n // -mtm=off disable \"Stores last Modified timestamps for files.\"\n args.push(\"-mtm=off\", \"-mta=off\")\n }\n\n if (options.method != null) {\n if (options.method !== \"DEFAULT\") {\n args.push(`-mm=${options.method}`)\n }\n } else if (isZip || storeOnly) {\n args.push(`-mm=${storeOnly ? \"Copy\" : \"Deflate\"}`)\n }\n\n if (isZip) {\n // -mcu switch: 7-Zip uses UTF-8, if there are non-ASCII symbols.\n // because default mode: 7-Zip uses UTF-8, if the local code page doesn't contain required symbols.\n // but archive should be the same regardless where produced\n args.push(\"-mcu\")\n }\n return args\n}\n\nexport function computeZipCompressArgs(options: ArchiveOptions = {}) {\n let storeOnly = options.compression === \"store\"\n // do not deref symlinks\n const args = [\"-q\", \"-r\", \"-y\"]\n if (debug7z.enabled) {\n args.push(\"-v\")\n }\n\n if (process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL != null) {\n storeOnly = false\n args.push(`-${process.env.ELECTRON_BUILDER_COMPRESSION_LEVEL}`)\n } else if (!storeOnly) {\n // https://github.com/electron-userland/electron-builder/pull/3032\n args.push(\"-\" + (options.compression === \"maximum\" ? \"9\" : \"7\"))\n }\n\n if (options.dictSize != null) {\n log.warn({ distSize: options.dictSize }, `ignoring unsupported option`)\n }\n\n // do not save extra file attributes (Extended Attributes on OS/2, uid/gid and file times on Unix)\n if (!options.isRegularFile) {\n args.push(\"-X\")\n }\n\n if (options.method != null) {\n if (options.method !== \"DEFAULT\") {\n log.warn({ method: options.method }, `ignoring unsupported option`)\n }\n } else {\n args.push(\"-Z\", storeOnly ? \"store\" : \"deflate\")\n }\n return args\n}\n\n// 7z is very fast, so, use ultra compression\n/** @internal */\nexport async function archive(format: string, outFile: string, dirToArchive: string, options: ArchiveOptions = {}): Promise {\n const outFileStat = await statOrNull(outFile)\n const dirStat = await statOrNull(dirToArchive)\n if (outFileStat && dirStat && outFileStat.mtime > dirStat.mtime) {\n log.info({ reason: \"Archive file is up to date\", outFile }, `skipped archiving`)\n return outFile\n }\n let use7z = true\n if (process.platform === \"darwin\" && format === \"zip\" && dirToArchive.normalize(\"NFC\") !== dirToArchive) {\n log.warn({ reason: \"7z doesn't support NFD-normalized filenames\" }, `using zip`)\n use7z = false\n }\n const args = use7z ? compute7zCompressArgs(format, options) : computeZipCompressArgs(options)\n // remove file before - 7z and zip doesn't overwrite file, but update\n await unlinkIfExists(outFile)\n\n args.push(outFile, options.withoutDir ? \".\" : path.basename(dirToArchive))\n if (options.excluded != null) {\n for (const mask of options.excluded) {\n args.push(use7z ? `-xr!${mask}` : `-x${mask}`)\n }\n }\n\n try {\n const binary = use7z ? await getPath7za() : \"zip\"\n await exec(\n binary,\n args,\n {\n cwd: options.withoutDir ? dirToArchive : path.dirname(dirToArchive),\n },\n debug7z.enabled\n )\n } catch (e: any) {\n if (e.code === \"ENOENT\" && !(await exists(dirToArchive))) {\n throw new Error(`Cannot create archive: \"${dirToArchive}\" doesn't exist`)\n } else {\n throw e\n }\n }\n\n return outFile\n}\n\nfunction debug7zArgs(command: \"a\" | \"x\"): Array {\n const args = [command, \"-bd\"]\n if (debug7z.enabled) {\n args.push(\"-bb\")\n }\n return args\n}\n"]} +\ No newline at end of file +diff --git a/out/targets/differentialUpdateInfoBuilder.js b/out/targets/differentialUpdateInfoBuilder.js +index 0a88df9dc1f4441ebf1e711e42e00562d1268a86..23b7fa5d1be022223f6d61ee47361229d0964db1 100644 +--- a/out/targets/differentialUpdateInfoBuilder.js ++++ b/out/targets/differentialUpdateInfoBuilder.js +@@ -52,8 +52,6 @@ function configureDifferentialAwareArchiveOptions(archiveOptions) { + archiveOptions.dictSize = 1; + // solid compression leads to a lot of changed blocks + archiveOptions.solid = false; +- // do not allow to change compression level to avoid different packages +- archiveOptions.compression = "normal"; + return archiveOptions; + } + exports.configureDifferentialAwareArchiveOptions = configureDifferentialAwareArchiveOptions; +diff --git a/out/targets/differentialUpdateInfoBuilder.js.map b/out/targets/differentialUpdateInfoBuilder.js.map +index 34dca44dc58f988e28f430a5f992845947e1103f..c4b436742a2a736b3a45d08f732e227c317ce2df 100644 +--- a/out/targets/differentialUpdateInfoBuilder.js.map ++++ b/out/targets/differentialUpdateInfoBuilder.js.map +@@ -1 +1 @@ +-{"version":3,"file":"differentialUpdateInfoBuilder.js","sourceRoot":"","sources":["../../src/targets/differentialUpdateInfoBuilder.ts"],"names":[],"mappings":";;;AAAA,+CAAkC;AAElC,6BAA4B;AAG5B,mDAA4D;AAG/C,QAAA,qBAAqB,GAAG,WAAW,CAAA;AAEhD,SAAgB,mCAAmC,CAAC,YAAoB,EAAE,YAAiD;IACzH,IAAI,YAAY,IAAI,IAAI,EAAE,CAAC;QACzB,OAAO,IAAI,CAAA;IACb,CAA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M,YAAY,GAAG,GAAG,IAAI,GAAG,6BAAqB,EAAE,CAAA;IACtD,kBAAG,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,kBAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,EAAE,oBAAoB,CAAC,CAAA;IAC5E,MAAM,UAAU,GAAG,MAAM,IAAA,oCAAuB,EAAqB,CAAC,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC,CAAA;IAC7H,MAAM,QAAQ,CAAC,IAAI,CAAC,0BAA0B,CAAC;QAC7C,IAAI,EAAE,YAAY;QAClB,gBAAgB,EAAE,gBAAgB,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,gBAAgB,GAAG,6BAAqB,EAAE;QACjG,MAAM;QACN,IAAI,EAAE,IAAI;QACV,QAAQ;QACR,UAAU;KACX,CAAC,CAAA;IACF,OAAO,UAAU,CAAA;AACnB,CAAC;AAbD,wCAaC","sourcesContent":["import { log } from \"builder-util\"\nimport { BlockMapDataHolder, PackageFileInfo } from \"builder-util-runtime\"\nimport * as path from \"path\"\nimport { Target } from \"../core\"\nimport { PlatformPackager } from \"../platformPackager\"\nimport { executeAppBuilderAsJson } from \"../util/appBuilder\"\nimport { ArchiveOptions } from \"./archive\"\n\nexport const BLOCK_MAP_FILE_SUFFIX = \".blockmap\"\n\nexport function createNsisWebDifferentialUpdateInfo(artifactPath: string, packageFiles: { [arch: string]: PackageFileInfo }) {\n if (packageFiles == null) {\n return null\n }\n\n const keys = Object.keys(packageFiles)\n if (keys.length <= 0) {\n return null\n }\n\n const packages: { [arch: string]: PackageFileInfo } = {}\n for (const arch of keys) {\n const packageFileInfo = packageFiles[arch]\n const file = path.basename(packageFileInfo.path)\n packages[arch] = {\n ...packageFileInfo,\n path: file,\n // https://github.com/electron-userland/electron-builder/issues/2583\n file,\n } as any\n }\n return { packages }\n}\n\nexport function configureDifferentialAwareArchiveOptions(archiveOptions: ArchiveOptions): ArchiveOptions {\n /*\n * dict size 64 MB: Full: 33,744.88 KB, To download: 17,630.3 KB (52%)\n * dict size 16 MB: Full: 33,936.84 KB, To download: 16,175.9 KB (48%)\n * dict size 8 MB: Full: 34,187.59 KB, To download: 8,229.9 KB (24%)\n * dict size 4 MB: Full: 34,628.73 KB, To download: 3,782.97 KB (11%)\n\n as we can see, if file changed in one place, all block is invalidated (and update size approximately equals to dict size)\n\n 1 MB is used:\n\n 1MB:\n\n 2018/01/11 11:54:41:0045 File has 59 changed blocks\n 2018/01/11 11:54:41:0050 Full: 71,588.59 KB, To download: 1,243.39 KB (2%)\n\n 4MB:\n\n 2018/01/11 11:31:43:0440 Full: 70,303.55 KB, To download: 4,843.27 KB (7%)\n 2018/01/11 11:31:43:0435 File has 234 changed blocks\n\n */\n archiveOptions.dictSize = 1\n // solid compression leads to a lot of changed blocks\n archiveOptions.solid = false\n // do not allow to change compression level to avoid different packages\n archiveOptions.compression = \"normal\"\n return archiveOptions\n}\n\nexport async function appendBlockmap(file: string): Promise {\n log.info({ file: log.filePath(file) }, \"building embedded block map\")\n return await executeAppBuilderAsJson([\"blockmap\", \"--input\", file, \"--compression\", \"deflate\"])\n}\n\nexport async function createBlockmap(file: string, target: Target, packager: PlatformPackager, safeArtifactName: string | null): Promise {\n const blockMapFile = `${file}${BLOCK_MAP_FILE_SUFFIX}`\n log.info({ blockMapFile: log.filePath(blockMapFile) }, \"building block map\")\n const updateInfo = await executeAppBuilderAsJson([\"blockmap\", \"--input\", file, \"--output\", blockMapFile])\n await packager.info.callArtifactBuildCompleted({\n file: blockMapFile,\n safeArtifactName: safeArtifactName == null ? null : `${safeArtifactName}${BLOCK_MAP_FILE_SUFFIX}`,\n target,\n arch: null,\n packager,\n updateInfo,\n })\n return updateInfo\n}\n"]} +\ No newline at end of file ++{"version":3,"file":"differentialUpdateInfoBuilder.js","sourceRoot":"","sources":["../../src/targets/differentialUpdateInfoBuilder.ts"],"names":[],"mappings":";;;AAAA,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Ae,EAAE,SAAS,CAAC,CAAC,CAAA;AACrH,CAAC;AAHD,wCAGC;AAEM,KAAK,UAAU,cAAc,CAAC,IAAY,EAAE,MAAc,EAAE,QAA+B,EAAE,gBAA+B;IACjI,MAAM,YAAY,GAAG,GAAG,IAAI,GAAG,6BAAqB,EAAE,CAAA;IACtD,kBAAG,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,kBAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,EAAE,oBAAoB,CAAC,CAAA;IAC5E,MAAM,UAAU,GAAG,MAAM,IAAA,oCAAuB,EAAqB,CAAC,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC,CAAA;IAC7H,MAAM,QAAQ,CAAC,IAAI,CAAC,0BAA0B,CAAC;QAC7C,IAAI,EAAE,YAAY;QAClB,gBAAgB,EAAE,gBAAgB,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,gBAAgB,GAAG,6BAAqB,EAAE;QACjG,MAAM;QACN,IAAI,EAAE,IAAI;QACV,QAAQ;QACR,UAAU;KACX,CAAC,CAAA;IACF,OAAO,UAAU,CAAA;AACnB,CAAC;AAbD,wCAaC","sourcesContent":["import { log } from \"builder-util\"\nimport { BlockMapDataHolder, PackageFileInfo } from \"builder-util-runtime\"\nimport * as path from \"path\"\nimport { Target } from \"../core\"\nimport { PlatformPackager } from \"../platformPackager\"\nimport { executeAppBuilderAsJson } from \"../util/appBuilder\"\nimport { ArchiveOptions } from \"./archive\"\n\nexport const BLOCK_MAP_FILE_SUFFIX = \".blockmap\"\n\nexport function createNsisWebDifferentialUpdateInfo(artifactPath: string, packageFiles: { [arch: string]: PackageFileInfo }) {\n if (packageFiles == null) {\n return null\n }\n\n const keys = Object.keys(packageFiles)\n if (keys.length <= 0) {\n return null\n }\n\n const packages: { [arch: string]: PackageFileInfo } = {}\n for (const arch of keys) {\n const packageFileInfo = packageFiles[arch]\n const file = path.basename(packageFileInfo.path)\n packages[arch] = {\n ...packageFileInfo,\n path: file,\n // https://github.com/electron-userland/electron-builder/issues/2583\n file,\n } as any\n }\n return { packages }\n}\n\nexport function configureDifferentialAwareArchiveOptions(archiveOptions: ArchiveOptions): ArchiveOptions {\n /*\n * dict size 64 MB: Full: 33,744.88 KB, To download: 17,630.3 KB (52%)\n * dict size 16 MB: Full: 33,936.84 KB, To download: 16,175.9 KB (48%)\n * dict size 8 MB: Full: 34,187.59 KB, To download: 8,229.9 KB (24%)\n * dict size 4 MB: Full: 34,628.73 KB, To download: 3,782.97 KB (11%)\n\n as we can see, if file changed in one place, all block is invalidated (and update size approximately equals to dict size)\n\n 1 MB is used:\n\n 1MB:\n\n 2018/01/11 11:54:41:0045 File has 59 changed blocks\n 2018/01/11 11:54:41:0050 Full: 71,588.59 KB, To download: 1,243.39 KB (2%)\n\n 4MB:\n\n 2018/01/11 11:31:43:0440 Full: 70,303.55 KB, To download: 4,843.27 KB (7%)\n 2018/01/11 11:31:43:0435 File has 234 changed blocks\n\n */\n archiveOptions.dictSize = 1\n // solid compression leads to a lot of changed blocks\n archiveOptions.solid = false\n return archiveOptions\n}\n\nexport async function appendBlockmap(file: string): Promise {\n log.info({ file: log.filePath(file) }, \"building embedded block map\")\n return await executeAppBuilderAsJson([\"blockmap\", \"--input\", file, \"--compression\", \"deflate\"])\n}\n\nexport async function createBlockmap(file: string, target: Target, packager: PlatformPackager, safeArtifactName: string | null): Promise {\n const blockMapFile = `${file}${BLOCK_MAP_FILE_SUFFIX}`\n log.info({ blockMapFile: log.filePath(blockMapFile) }, \"building block map\")\n const updateInfo = await executeAppBuilderAsJson([\"blockmap\", \"--input\", file, \"--output\", blockMapFile])\n await packager.info.callArtifactBuildCompleted({\n file: blockMapFile,\n safeArtifactName: safeArtifactName == null ? null : `${safeArtifactName}${BLOCK_MAP_FILE_SUFFIX}`,\n target,\n arch: null,\n packager,\n updateInfo,\n })\n return updateInfo\n}\n"]} +\ No newline at end of file +diff --git a/out/util/rebuild/rebuild.d.ts b/out/util/rebuild/rebuild.d.ts +new file mode 100644 +index 0000000000000000000000000000000000000000..872c780c33b617a8f415c9dfee6d0f9e2244ec68 +--- /dev/null ++++ b/out/util/rebuild/rebuild.d.ts +@@ -0,0 +1,2 @@ ++import { RebuildOptions } from "@electron/rebuild"; ++export declare const rebuild: (options: RebuildOptions) => Promise; +diff --git a/out/util/rebuild/rebuild.js b/out/util/rebuild/rebuild.js +new file mode 100644 +index 0000000000000000000000000000000000000000..e7565700f2edc17f1be32645c7e58954eb48e60a +--- /dev/null ++++ b/out/util/rebuild/rebuild.js +@@ -0,0 +1,60 @@ ++"use strict"; ++Object.defineProperty(exports, "__esModule", { value: true }); ++exports.rebuild = void 0; ++const cp = require("child_process"); ++const path = require("path"); ++const builder_util_1 = require("builder-util"); ++const rebuild = async (options) => { ++ var _a, _b; ++ const { arch } = options; ++ builder_util_1.log.info({ arch }, `installing native dependencies`); ++ const child = cp.fork(path.resolve(__dirname, "remote-rebuild.js"), [JSON.stringify(options)], { ++ stdio: ["pipe", "pipe", "pipe", "ipc"], ++ }); ++ let pendingError; ++ (_a = child.stdout) === null || _a === void 0 ? void 0 : _a.on("data", chunk => { ++ builder_util_1.log.info(chunk.toString()); ++ }); ++ (_b = child.stderr) === null || _b === void 0 ? void 0 : _b.on("data", chunk => { ++ builder_util_1.log.error(chunk.toString()); ++ }); ++ child.on("message", (message) => { ++ var _a; ++ const { moduleName, msg } = message; ++ switch (msg) { ++ case "module-found": { ++ builder_util_1.log.info({ moduleName, arch }, "preparing"); ++ break; ++ } ++ case "module-done": { ++ builder_util_1.log.info({ moduleName, arch }, "finished"); ++ break; ++ } ++ case "module-skip": { ++ (_a = builder_util_1.log.debug) === null || _a === void 0 ? void 0 : _a.call(builder_util_1.log, { moduleName, arch }, "skipped. set ENV=electron-rebuild to determine why"); ++ break; ++ } ++ case "rebuild-error": { ++ pendingError = new Error(message.err.message); ++ pendingError.stack = message.err.stack; ++ break; ++ } ++ case "rebuild-done": { ++ builder_util_1.log.info("completed installing native dependencies"); ++ break; ++ } ++ } ++ }); ++ await new Promise((resolve, reject) => { ++ child.on("exit", code => { ++ if (code === 0 && !pendingError) { ++ resolve(); ++ } ++ else { ++ reject(pendingError || new Error(`Rebuilder failed with exit code: ${code}`)); ++ } ++ }); ++ }); ++}; ++exports.rebuild = rebuild; ++//# sourceMappingURL=rebuild.js.map +\ No newline at end of file +diff --git a/out/util/rebuild/rebuild.js.map b/out/util/rebuild/rebuild.js.map +new file mode 100644 +index 0000000000000000000000000000000000000000..c84269d170786291e062017e665d1777f7151aa9 +--- /dev/null ++++ b/out/util/rebuild/rebuild.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"rebuild.js","sourceRoot":"","sources":["../../../src/util/rebuild/rebuild.ts"],"names":[],"mappings":";;;AAAA,oCAAmC;AACnC,6BAA4B;AAE5B,+CAAkC;AAE3B,MAAM,OAAO,GAAG,KAAK,EAAE,OAAuB,EAAiB,EAAE;;IACtE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAA;IACxB,kBAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,gCAAgC,CAAC,CAAA;IAEpD,MAAM,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,mBAAmB,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE;QAC7F,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC;KACvC,CAAC,CAAA;IAEF,IAAI,YAAmB,CAAA;IAEvB,MAAA,KAAK,CAAC,MAAM,0CAAE,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;QAC/B,kBAAG,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC5B,CAAC,CAAC,CAAA;IACF,MAAA,KAAK,CAAC,MAAM,0CAAE,EAAE,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I,IAAI,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;gBAChC,OAAO,EAAE,CAAA;YACX,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,YAAY,IAAI,IAAI,KAAK,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAC,CAAA;YAC/E,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AArDY,QAAA,OAAO,WAqDnB","sourcesContent":["import * as cp from \"child_process\"\nimport * as path from \"path\"\nimport { RebuildOptions } from \"@electron/rebuild\"\nimport { log } from \"builder-util\"\n\nexport const rebuild = async (options: RebuildOptions): Promise => {\n const { arch } = options\n log.info({ arch }, `installing native dependencies`)\n\n const child = cp.fork(path.resolve(__dirname, \"remote-rebuild.js\"), [JSON.stringify(options)], {\n stdio: [\"pipe\", \"pipe\", \"pipe\", \"ipc\"],\n })\n\n let pendingError: Error\n\n child.stdout?.on(\"data\", chunk => {\n log.info(chunk.toString())\n })\n child.stderr?.on(\"data\", chunk => {\n log.error(chunk.toString())\n })\n\n child.on(\"message\", (message: { msg: string; moduleName: string; err: { message: string; stack: string } }) => {\n const { moduleName, msg } = message\n switch (msg) {\n case \"module-found\": {\n log.info({ moduleName, arch }, \"preparing\")\n break\n }\n case \"module-done\": {\n log.info({ moduleName, arch }, \"finished\")\n break\n }\n case \"module-skip\": {\n log.debug?.({ moduleName, arch }, \"skipped. set ENV=electron-rebuild to determine why\")\n break\n }\n case \"rebuild-error\": {\n pendingError = new Error(message.err.message)\n pendingError.stack = message.err.stack\n break\n }\n case \"rebuild-done\": {\n log.info(\"completed installing native dependencies\")\n break\n }\n }\n })\n\n await new Promise((resolve, reject) => {\n child.on(\"exit\", code => {\n if (code === 0 && !pendingError) {\n resolve()\n } else {\n reject(pendingError || new Error(`Rebuilder failed with exit code: ${code}`))\n }\n })\n })\n}\n"]} +\ No newline at end of file +diff --git a/out/util/rebuild/remote-rebuild.d.ts b/out/util/rebuild/remote-rebuild.d.ts +new file mode 100644 +index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e +--- /dev/null ++++ b/out/util/rebuild/remote-rebuild.d.ts +@@ -0,0 +1 @@ ++export {}; +diff --git a/out/util/rebuild/remote-rebuild.js b/out/util/rebuild/remote-rebuild.js +new file mode 100644 +index 0000000000000000000000000000000000000000..84b589900b39ade68ce0eded1b5b3ef57c0979f6 +--- /dev/null ++++ b/out/util/rebuild/remote-rebuild.js +@@ -0,0 +1,30 @@ ++"use strict"; ++Object.defineProperty(exports, "__esModule", { value: true }); ++const rebuild_1 = require("@electron/rebuild"); ++if (!process.send) { ++ console.error("The remote rebuilder expects to be spawned with an IPC channel"); ++ process.exit(1); ++} ++const options = JSON.parse(process.argv[2]); ++const rebuilder = (0, rebuild_1.rebuild)(options); ++rebuilder.lifecycle.on("module-found", (moduleName) => { var _a; return (_a = process.send) === null || _a === void 0 ? void 0 : _a.call(process, { msg: "module-found", moduleName }); }); ++rebuilder.lifecycle.on("module-done", (moduleName) => { var _a; return (_a = process.send) === null || _a === void 0 ? void 0 : _a.call(process, { msg: "module-done", moduleName }); }); ++rebuilder.lifecycle.on("module-skip", (moduleName) => { var _a; return (_a = process.send) === null || _a === void 0 ? void 0 : _a.call(process, { msg: "module-skip", moduleName }); }); ++rebuilder ++ .then(() => { ++ var _a; ++ (_a = process.send) === null || _a === void 0 ? void 0 : _a.call(process, { msg: "rebuild-done" }); ++ return process.exit(0); ++}) ++ .catch(err => { ++ var _a; ++ (_a = process.send) === null || _a === void 0 ? void 0 : _a.call(process, { ++ msg: "rebuild-error", ++ err: { ++ message: err.message, ++ stack: err.stack, ++ }, ++ }); ++ process.exit(0); ++}); ++//# sourceMappingURL=remote-rebuild.js.map +\ No newline at end of file +diff --git a/out/util/rebuild/remote-rebuild.js.map b/out/util/rebuild/remote-rebuild.js.map +new file mode 100644 +index 0000000000000000000000000000000000000000..a64f955ccb03fd45e130651154ab8e6cfd424e62 +--- /dev/null ++++ b/out/util/rebuild/remote-rebuild.js.map +@@ -0,0 +1 @@ ++{"version":3,"file":"remote-rebuild.js","sourceRoot":"","sources":["../../../src/util/rebuild/remote-rebuild.ts"],"names":[],"mappings":";;AAAA,+CAA2D;AAE3D,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IAClB,OAAO,CAAC,KAAK,CAAC,gEAAgE,CAAC,CAAA;IAC/E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC;AAED,MAAM,OAAO,GAAmB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;AAE3D,MAAM,SAAS,GAAG,IAAA,iBAAO,EAAC,OAAO,CAAC,CAAA;AAElC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,cAAc,EAAE,CAAC,UAAkB,EAAE,EAAE,WAAC,OAAA,MAAA,OAAO,CAAC,IAAI,wDAAG,EAAE,GAAG,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC,CAAA,EAAA,CAAC,CAAA;AACnH,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC,UAAkB,EAAE,EAAE,WAAC,OAAA,MAAA,OAAO,CAAC,IAAI,wDAAG,EAAE,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC,CAAA,EAAA,CAAC,CAAA;AACjH,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC,UAAkB,EAAE,EAAE,WAAC,OAAA,MAAA,OAAO,CAAC,IAAI,wDAAG,EAAE,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC,CAAA,EAAA,CAAC,CAAA;AAEjH,SAAS;KACN,IAAI,CAAC,GAAG,EAAE;;IACT,MAAA,OAAO,CAAC,IAAI,wDAAG,EAAE,GAAG,EAAE,cAAc,EAAE,CAAC,CAAA;IACvC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACxB,CAAC,CAAC;KACD,KAAK,CAAC,GAAG,CAAC,EAAE;;IACX,MAAA,OAAO,CAAC,IAAI,wDAAG;QACb,GAAG,EAAE,eAAe;QACpB,GAAG,EAAE;YACH,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,KAAK,EAAE,GAAG,CAAC,KAAK;SACjB;KACF,CAAC,CAAA;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA","sourcesContent":["import { rebuild, RebuildOptions } from \"@electron/rebuild\"\n\nif (!process.send) {\n console.error(\"The remote rebuilder expects to be spawned with an IPC channel\")\n process.exit(1)\n}\n\nconst options: RebuildOptions = JSON.parse(process.argv[2])\n\nconst rebuilder = rebuild(options)\n\nrebuilder.lifecycle.on(\"module-found\", (moduleName: string) => process.send?.({ msg: \"module-found\", moduleName }))\nrebuilder.lifecycle.on(\"module-done\", (moduleName: string) => process.send?.({ msg: \"module-done\", moduleName }))\nrebuilder.lifecycle.on(\"module-skip\", (moduleName: string) => process.send?.({ msg: \"module-skip\", moduleName }))\n\nrebuilder\n .then(() => {\n process.send?.({ msg: \"rebuild-done\" })\n return process.exit(0)\n })\n .catch(err => {\n process.send?.({\n msg: \"rebuild-error\",\n err: {\n message: err.message,\n stack: err.stack,\n },\n })\n process.exit(0)\n })\n"]} +\ No newline at end of file +diff --git a/package.json b/package.json +index 3b1fd90208d6d46d3518370f36563806913645c7..0e034f81fb84a52de0d4d9e03c357797d95e383d 100644 +--- a/package.json ++++ b/package.json +@@ -54,9 +54,12 @@ + "@types/fs-extra": "9.0.13", + "async-exit-hook": "^2.0.1", + "bluebird-lst": "^1.0.9", ++ "builder-util": "workspace:*", ++ "builder-util-runtime": "workspace:*", + "chromium-pickle-js": "^0.2.0", + "debug": "^4.3.4", + "ejs": "^3.1.8", ++ "electron-publish": "workspace:*", + "form-data": "^4.0.0", + "fs-extra": "^10.1.0", + "hosted-git-info": "^4.1.0", +@@ -69,10 +72,7 @@ + "sanitize-filename": "^1.6.3", + "semver": "^7.3.8", + "tar": "^6.1.12", +- "temp-file": "^3.4.0", +- "builder-util": "24.13.1", +- "electron-publish": "24.13.1", +- "builder-util-runtime": "9.2.4" ++ "temp-file": "^3.4.0" + }, + "///": "babel in devDependencies for proton tests", + "devDependencies": { +@@ -102,12 +102,12 @@ + "@types/js-yaml": "4.0.3", + "@types/semver": "7.3.8", + "@types/tar": "^6.1.3", +- "dmg-builder": "24.13.3", +- "electron-builder-squirrel-windows": "24.13.3" ++ "dmg-builder": "workspace:*", ++ "electron-builder-squirrel-windows": "workspace:*" + }, + "peerDependencies": { +- "dmg-builder": "24.13.3", +- "electron-builder-squirrel-windows": "24.13.3" ++ "dmg-builder": "workspace:*", ++ "electron-builder-squirrel-windows": "workspace:*" + }, + "//": "electron-builder-squirrel-windows and dmg-builder added as dev dep for tests (as otherwise `require` doesn't work using Yarn 2)", + "typings": "./out/index.d.ts" +diff --git a/scheme.json b/scheme.json +index 98c0bfe76c6fbdba493e7f6d483654edc4e6c59a..803aedd49bb69526b95fbf2a9fc7d4e1d9723394 100644 +--- a/scheme.json ++++ b/scheme.json +@@ -1702,6 +1702,7 @@ + "anyOf": [ + { + "enum": [ ++ "ultra", + "maximum", + "normal", + "store" +@@ -2360,6 +2361,7 @@ + "anyOf": [ + { + "enum": [ ++ "ultra", + "maximum", + "normal", + "store" +@@ -3007,6 +3009,7 @@ + "anyOf": [ + { + "enum": [ ++ "ultra", + "maximum", + "normal", + "store" +@@ -6453,6 +6456,7 @@ + "anyOf": [ + { + "enum": [ ++ "ultra", + "maximum", + "normal", + "store" +@@ -7076,7 +7080,8 @@ + "anyOf": [ + { + "enum": [ +- "maximum", ++ "ultra", ++ "maximum", + "normal", + "store" + ], diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b6e124c32..71b80ee1e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,11 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +patchedDependencies: + app-builder-lib@24.13.3: + hash: bubyqrpqlq2lr5n5cxwtzf7azu + path: patches/app-builder-lib@24.13.3.patch + importers: .: @@ -5385,7 +5390,7 @@ snapshots: app-builder-bin@4.0.0: {} - app-builder-lib@24.13.3(dmg-builder@24.13.3(electron-builder-squirrel-windows@25.0.0-alpha.6(dmg-builder@24.13.3)))(electron-builder-squirrel-windows@25.0.0-alpha.6(dmg-builder@24.13.3)): + app-builder-lib@24.13.3(patch_hash=bubyqrpqlq2lr5n5cxwtzf7azu)(dmg-builder@24.13.3(electron-builder-squirrel-windows@25.0.0-alpha.6(dmg-builder@24.13.3)))(electron-builder-squirrel-windows@25.0.0-alpha.6(dmg-builder@24.13.3)): dependencies: '@develar/schema-utils': 2.6.5 '@electron/notarize': 2.2.1 @@ -6312,7 +6317,7 @@ snapshots: dmg-builder@24.13.3(electron-builder-squirrel-windows@25.0.0-alpha.6(dmg-builder@24.13.3)): dependencies: - app-builder-lib: 24.13.3(dmg-builder@24.13.3(electron-builder-squirrel-windows@25.0.0-alpha.6(dmg-builder@24.13.3)))(electron-builder-squirrel-windows@25.0.0-alpha.6(dmg-builder@24.13.3)) + app-builder-lib: 24.13.3(patch_hash=bubyqrpqlq2lr5n5cxwtzf7azu)(dmg-builder@24.13.3(electron-builder-squirrel-windows@25.0.0-alpha.6(dmg-builder@24.13.3)))(electron-builder-squirrel-windows@25.0.0-alpha.6(dmg-builder@24.13.3)) builder-util: 24.13.1 builder-util-runtime: 9.2.4 fs-extra: 10.1.0 @@ -6390,7 +6395,7 @@ snapshots: electron-builder@24.13.3(electron-builder-squirrel-windows@25.0.0-alpha.6(dmg-builder@24.13.3)): dependencies: - app-builder-lib: 24.13.3(dmg-builder@24.13.3(electron-builder-squirrel-windows@25.0.0-alpha.6(dmg-builder@24.13.3)))(electron-builder-squirrel-windows@25.0.0-alpha.6(dmg-builder@24.13.3)) + app-builder-lib: 24.13.3(patch_hash=bubyqrpqlq2lr5n5cxwtzf7azu)(dmg-builder@24.13.3(electron-builder-squirrel-windows@25.0.0-alpha.6(dmg-builder@24.13.3)))(electron-builder-squirrel-windows@25.0.0-alpha.6(dmg-builder@24.13.3)) builder-util: 24.13.1 builder-util-runtime: 9.2.4 chalk: 4.1.2