Skip to content

Commit

Permalink
chore: fix electron-updater version check
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Feb 2, 2025
1 parent e63fc9e commit acc77bf
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 1 deletion.
36 changes: 36 additions & 0 deletions .yarn/patches/app-builder-lib-npm-26.0.1-df3cd7e47a.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
diff --git a/out/util/packageMetadata.js b/out/util/packageMetadata.js
index 3d006f7aae80f03aa7f0d8229cd7fdf8c15d9d9e..bf4c60bd48408e6cb320c4ee91a16acdbdaa23c4 100644
--- a/out/util/packageMetadata.js
+++ b/out/util/packageMetadata.js
@@ -80,11 +80,26 @@ function checkDependencies(dependencies, errors) {
if (dependencies == null) {
return;
}
- const updaterVersion = dependencies["electron-updater"];
- const requiredElectronUpdaterVersion = "4.0.0";
- if (updaterVersion != null && !versionSatisfies(updaterVersion, `>=${requiredElectronUpdaterVersion}`)) {
- errors.push(`At least electron-updater ${requiredElectronUpdaterVersion} is recommended by current electron-builder version. Please set electron-updater version to "^${requiredElectronUpdaterVersion}"`);
- }
+
+ let updaterVersion = dependencies["electron-updater"]
+ if (updaterVersion != null) {
+ // Pick the version of a yarn berry patch syntax
+ // "patch:electron-updater@npm%3A6.4.1#~/.yarn/patches/electron-updater-npm-6.4.1-ef33e6cc39.patch"
+ if (updaterVersion.startsWith('patch:')) {
+ const match = updaterVersion.match(/@npm%3A(.+?)#/)
+ if (match) {
+ updaterVersion = match[1]
+ }
+ }
+
+ const requiredElectronUpdaterVersion = "4.0.0"
+ if (!versionSatisfies(updaterVersion, `>=${requiredElectronUpdaterVersion}`)) {
+ errors.push(
+ `At least electron-updater ${requiredElectronUpdaterVersion} is recommended by current electron-builder version. Please set electron-updater version to "^${requiredElectronUpdaterVersion}"`
+ )
+ }
+ }
+
const swVersion = dependencies["electron-builder-squirrel-windows"];
if (swVersion != null && !versionSatisfies(swVersion, ">=20.32.0")) {
errors.push(`At least electron-builder-squirrel-windows 20.32.0 is required by current electron-builder version. Please set electron-builder-squirrel-windows to "^20.32.0"`);
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,8 @@
"engines": {
"node": "^20.14"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]",
"resolutions": {
"app-builder-lib@npm:26.0.1": "patch:app-builder-lib@npm%3A26.0.1#~/.yarn/patches/app-builder-lib-npm-26.0.1-df3cd7e47a.patch"
}
}
43 changes: 43 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3336,6 +3336,49 @@ __metadata:
languageName: node
linkType: hard

"app-builder-lib@patch:app-builder-lib@npm%3A26.0.1#~/.yarn/patches/app-builder-lib-npm-26.0.1-df3cd7e47a.patch":
version: 26.0.1
resolution: "app-builder-lib@patch:app-builder-lib@npm%3A26.0.1#~/.yarn/patches/app-builder-lib-npm-26.0.1-df3cd7e47a.patch::version=26.0.1&hash=5d3e23"
dependencies:
"@develar/schema-utils": "npm:~2.6.5"
"@electron/asar": "npm:3.2.18"
"@electron/fuses": "npm:^1.8.0"
"@electron/notarize": "npm:2.5.0"
"@electron/osx-sign": "npm:1.3.1"
"@electron/rebuild": "npm:3.7.0"
"@electron/universal": "npm:2.0.1"
"@malept/flatpak-bundler": "npm:^0.4.0"
"@types/fs-extra": "npm:9.0.13"
async-exit-hook: "npm:^2.0.1"
builder-util: "npm:26.0.1"
builder-util-runtime: "npm:9.3.1"
chromium-pickle-js: "npm:^0.2.0"
config-file-ts: "npm:0.2.8-rc1"
debug: "npm:^4.3.4"
dotenv: "npm:^16.4.5"
dotenv-expand: "npm:^11.0.6"
ejs: "npm:^3.1.8"
electron-publish: "npm:26.0.1"
fs-extra: "npm:^10.1.0"
hosted-git-info: "npm:^4.1.0"
is-ci: "npm:^3.0.0"
isbinaryfile: "npm:^5.0.0"
js-yaml: "npm:^4.1.0"
json5: "npm:^2.2.3"
lazy-val: "npm:^1.0.5"
minimatch: "npm:^10.0.0"
resedit: "npm:^1.7.0"
semver: "npm:^7.3.8"
tar: "npm:^6.1.12"
temp-file: "npm:^3.4.0"
tiny-async-pool: "npm:1.3.0"
peerDependencies:
dmg-builder: 26.0.1
electron-builder-squirrel-windows: 26.0.1
checksum: 10c0/acc9ccf684b6bfdb84896bd2b2a5a47996bf0c4f5226de36cc8e37de77eabd7828bc15acbd61f3c65b7260e4fd80d695b102db8cb4e46456392089d4b380de8a
languageName: node
linkType: hard

"aproba@npm:^1.0.3 || ^2.0.0":
version: 2.0.0
resolution: "aproba@npm:2.0.0"
Expand Down

0 comments on commit acc77bf

Please sign in to comment.