1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-23 18:53:36 +02:00

Revert Electron 25 => 19

This commit is contained in:
Laurent Cozic 2023-11-12 12:38:09 +00:00
parent b928e614cc
commit 82303d21a2
7 changed files with 587 additions and 384 deletions

View File

@ -242,12 +242,7 @@ if [[ $GIT_TAG_NAME = v* ]]; then
# It can be removed once we upgrade to electron-builder@23, however we # It can be removed once we upgrade to electron-builder@23, however we
# cannot currently do this due to this error: # cannot currently do this due to this error:
# https://github.com/laurent22/joplin/issues/8149 # https://github.com/laurent22/joplin/issues/8149
# PYTHON_PATH=$(which python) USE_HARD_LINKS=false yarn run dist
# electron-builder@24, however, still expects the python binary to be named
# "python" and seems to no longer respect the PYTHON_PATH environment variable.
# We work around this by aliasing python.
alias python=$(which python3)
USE_HARD_LINKS=false yarn run dist
else else
USE_HARD_LINKS=false yarn run dist USE_HARD_LINKS=false yarn run dist
fi fi
@ -260,15 +255,7 @@ else
if [ "$IS_MACOS" == "1" ]; then if [ "$IS_MACOS" == "1" ]; then
# See above why we need to specify Python # See above why we need to specify Python
alias python=$(which python3) PYTHON_PATH=$(which python) USE_HARD_LINKS=false yarn run dist --publish=never
# We also want to disable signing the app in this case, because
# it randomly fails and we don't even need it
# https://www.electron.build/code-signing#how-to-disable-code-signing-during-the-build-process-on-macos
export CSC_IDENTITY_AUTO_DISCOVERY=false
npm pkg set 'build.mac.identity'=null --json
USE_HARD_LINKS=false yarn run dist --publish=never
else else
USE_HARD_LINKS=false yarn run dist --publish=never USE_HARD_LINKS=false yarn run dist --publish=never
fi fi

View File

@ -1,13 +0,0 @@
diff --git a/templates/nsis/include/allowOnlyOneInstallerInstance.nsh b/templates/nsis/include/allowOnlyOneInstallerInstance.nsh
index a1fd1875d852ff69c087a3103eff827c20d37ca5..5222614ddad3276876857e7a9dde4017a6b9fc85 100644
--- a/templates/nsis/include/allowOnlyOneInstallerInstance.nsh
+++ b/templates/nsis/include/allowOnlyOneInstallerInstance.nsh
@@ -42,7 +42,7 @@
${nsProcess::FindProcess} "${_FILE}" ${_ERR}
!else
# find process owned by current user
- nsExec::Exec `cmd /c tasklist /FI "USERNAME eq %USERNAME%" /FI "IMAGENAME eq ${_FILE}" | %SYSTEMROOT%\System32\find.exe "${_FILE}"`
+ nsExec::Exec `cmd /c tasklist /FI "USERNAME eq %USERNAME%" /FI "PID ne $pid" /FI "IMAGENAME eq ${_FILE}" | %SYSTEMROOT%\System32\find.exe "${_FILE}"`
Pop ${_ERR}
!endif
!macroend

View File

@ -104,7 +104,6 @@
"react-native-camera@4.2.1": "patch:react-native-camera@npm%3A4.2.1#./.yarn/patches/react-native-camera-npm-4.2.1-24b2600a7e.patch", "react-native-camera@4.2.1": "patch:react-native-camera@npm%3A4.2.1#./.yarn/patches/react-native-camera-npm-4.2.1-24b2600a7e.patch",
"react-native-vosk@0.1.12": "patch:react-native-vosk@npm%3A0.1.12#./.yarn/patches/react-native-vosk-npm-0.1.12-76b1caaae8.patch", "react-native-vosk@0.1.12": "patch:react-native-vosk@npm%3A0.1.12#./.yarn/patches/react-native-vosk-npm-0.1.12-76b1caaae8.patch",
"eslint": "patch:eslint@8.49.0#./.yarn/patches/eslint-npm-8.39.0-d92bace04d.patch", "eslint": "patch:eslint@8.49.0#./.yarn/patches/eslint-npm-8.39.0-d92bace04d.patch",
"app-builder-lib@24.4.0": "patch:app-builder-lib@npm%3A24.4.0#./.yarn/patches/app-builder-lib-npm-24.4.0-05322ff057.patch",
"react-native@0.71.10": "patch:react-native@npm%3A0.71.10#./.yarn/patches/react-native-animation-fix/react-native-npm-0.71.10-f9c32562d8.patch" "react-native@0.71.10": "patch:react-native@npm%3A0.71.10#./.yarn/patches/react-native-animation-fix/react-native-npm-0.71.10-f9c32562d8.patch"
} }
} }

View File

@ -4,7 +4,7 @@ import shim from '@joplin/lib/shim';
import { isCallbackUrl } from '@joplin/lib/callbackUrlUtils'; import { isCallbackUrl } from '@joplin/lib/callbackUrlUtils';
import { BrowserWindow, Tray, screen } from 'electron'; import { BrowserWindow, Tray, screen } from 'electron';
import bridge from './bridge'; // import bridge from './bridge';
const url = require('url'); const url = require('url');
const path = require('path'); const path = require('path');
const { dirname } = require('@joplin/lib/path-utils'); const { dirname } = require('@joplin/lib/path-utils');
@ -197,13 +197,13 @@ export default class ElectronAppWrapper {
} }
// will-frame-navigate is fired by clicking on a link within the BrowserWindow. // will-frame-navigate is fired by clicking on a link within the BrowserWindow.
this.win_.webContents.on('will-frame-navigate', event => { // this.win_.webContents.on('will-frame-navigate', event => {
// If the link changes the URL of the browser window, // // If the link changes the URL of the browser window,
if (event.isMainFrame) { // if (event.isMainFrame) {
event.preventDefault(); // event.preventDefault();
void bridge().openExternal(event.url); // void bridge().openExternal(event.url);
} // }
}); // });
this.win_.on('close', (event: any) => { this.win_.on('close', (event: any) => {
// If it's on macOS, the app is completely closed only if the user chooses to close the app (willQuitApp_ will be true) // If it's on macOS, the app is completely closed only if the user chooses to close the app (willQuitApp_ will be true)

View File

@ -115,7 +115,6 @@
}, },
"homepage": "https://github.com/laurent22/joplin#readme", "homepage": "https://github.com/laurent22/joplin#readme",
"devDependencies": { "devDependencies": {
"@electron/rebuild": "3.3.0",
"@joplin/tools": "~2.13", "@joplin/tools": "~2.13",
"@playwright/test": "1.38.1", "@playwright/test": "1.38.1",
"@testing-library/react-hooks": "8.0.1", "@testing-library/react-hooks": "8.0.1",
@ -124,8 +123,9 @@
"@types/react": "18.2.31", "@types/react": "18.2.31",
"@types/react-redux": "7.1.28", "@types/react-redux": "7.1.28",
"@types/styled-components": "5.1.29", "@types/styled-components": "5.1.29",
"electron": "26.5.0", "electron": "19.1.4",
"electron-builder": "24.6.4", "electron-builder": "22.11.7",
"electron-rebuild": "3.2.9",
"glob": "10.3.10", "glob": "10.3.10",
"gulp": "4.0.2", "gulp": "4.0.2",
"jest": "29.7.0", "jest": "29.7.0",

View File

@ -25,7 +25,7 @@ async function main() {
// wrong one. However it means it will have to be manually upgraded for each // wrong one. However it means it will have to be manually upgraded for each
// new Electron release. Some ABI map there: // new Electron release. Some ABI map there:
// https://github.com/electron/node-abi/tree/master/test // https://github.com/electron/node-abi/tree/master/test
const forceAbiArgs = '--force-abi 116'; const forceAbiArgs = '--force-abi 89';
if (isWindows()) { if (isWindows()) {
// Cannot run this in parallel, or the 64-bit version might end up // Cannot run this in parallel, or the 64-bit version might end up

916
yarn.lock

File diff suppressed because it is too large Load Diff