Skip to content

Commit da98f07

Browse files
beyondkmpbeyondkmp
andauthored
feat: upgrade electron to 35.2.2 (#5151)
* upgrade electron to 35.2.0 * update electron to 32.3.3 * udpate electron-vite to 3.0.0 * upgrade to 35.2.2 * patch electron-userland/electron-builder#9046 * add minimumSystemVersion config * update electron vite --------- Co-authored-by: beyondkmp <[email protected]>
1 parent e4fd309 commit da98f07

File tree

4 files changed

+407
-189
lines changed

4 files changed

+407
-189
lines changed
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
diff --git a/out/macPackager.js b/out/macPackager.js
2+
index 852f6c4d16f86a7bb8a78bf1ed5a14647a279aa1..60e7f5f16a844541eb1909b215fcda1811e924b8 100644
3+
--- a/out/macPackager.js
4+
+++ b/out/macPackager.js
5+
@@ -423,7 +423,7 @@ class MacPackager extends platformPackager_1.PlatformPackager {
6+
}
7+
appPlist.CFBundleName = appInfo.productName;
8+
appPlist.CFBundleDisplayName = appInfo.productName;
9+
- const minimumSystemVersion = this.platformSpecificBuildOptions.minimumSystemVersion;
10+
+ const minimumSystemVersion = this.platformSpecificBuildOptions.LSMinimumSystemVersion;
11+
if (minimumSystemVersion != null) {
12+
appPlist.LSMinimumSystemVersion = minimumSystemVersion;
13+
}
14+
diff --git a/out/publish/updateInfoBuilder.js b/out/publish/updateInfoBuilder.js
15+
index 7924c5b47d01f8dfccccb8f46658015fa66da1f7..1a1588923c3939ae1297b87931ba83f0ebc052d8 100644
16+
--- a/out/publish/updateInfoBuilder.js
17+
+++ b/out/publish/updateInfoBuilder.js
18+
@@ -133,6 +133,7 @@ async function createUpdateInfo(version, event, releaseInfo) {
19+
const customUpdateInfo = event.updateInfo;
20+
const url = path.basename(event.file);
21+
const sha512 = (customUpdateInfo == null ? null : customUpdateInfo.sha512) || (await (0, hash_1.hashFile)(event.file));
22+
+ const minimumSystemVersion = customUpdateInfo == null ? null : customUpdateInfo.minimumSystemVersion;
23+
const files = [{ url, sha512 }];
24+
const result = {
25+
// @ts-ignore
26+
@@ -143,9 +144,13 @@ async function createUpdateInfo(version, event, releaseInfo) {
27+
path: url /* backward compatibility, electron-updater 1.x - electron-updater 2.15.0 */,
28+
// @ts-ignore
29+
sha512 /* backward compatibility, electron-updater 1.x - electron-updater 2.15.0 */,
30+
+ minimumSystemVersion,
31+
...releaseInfo,
32+
};
33+
if (customUpdateInfo != null) {
34+
+ if (customUpdateInfo.minimumSystemVersion) {
35+
+ delete customUpdateInfo.minimumSystemVersion;
36+
+ }
37+
// file info or nsis web installer packages info
38+
Object.assign("sha512" in customUpdateInfo ? files[0] : result, customUpdateInfo);
39+
}
40+
diff --git a/out/targets/ArchiveTarget.js b/out/targets/ArchiveTarget.js
41+
index e1f52a5fa86fff6643b2e57eaf2af318d541f865..47cc347f154a24b365e70ae5e1f6d309f3582ed0 100644
42+
--- a/out/targets/ArchiveTarget.js
43+
+++ b/out/targets/ArchiveTarget.js
44+
@@ -69,6 +69,9 @@ class ArchiveTarget extends core_1.Target {
45+
}
46+
}
47+
}
48+
+ if (updateInfo != null && this.packager.platformSpecificBuildOptions.minimumSystemVersion) {
49+
+ updateInfo.minimumSystemVersion = this.packager.platformSpecificBuildOptions.minimumSystemVersion;
50+
+ }
51+
await packager.info.emitArtifactBuildCompleted({
52+
updateInfo,
53+
file: artifactPath,
54+
diff --git a/out/targets/nsis/NsisTarget.js b/out/targets/nsis/NsisTarget.js
55+
index e8bd7bb46c8a54b3f55cf3a853ef924195271e01..f956e9f3fe9eb903c78aef3502553b01de4b89b1 100644
56+
--- a/out/targets/nsis/NsisTarget.js
57+
+++ b/out/targets/nsis/NsisTarget.js
58+
@@ -305,6 +305,9 @@ class NsisTarget extends core_1.Target {
59+
if (updateInfo != null && isPerMachine && (oneClick || options.packElevateHelper)) {
60+
updateInfo.isAdminRightsRequired = true;
61+
}
62+
+ if (updateInfo != null && this.packager.platformSpecificBuildOptions.minimumSystemVersion) {
63+
+ updateInfo.minimumSystemVersion = this.packager.platformSpecificBuildOptions.minimumSystemVersion;
64+
+ }
65+
await packager.info.emitArtifactBuildCompleted({
66+
file: installerPath,
67+
updateInfo,
68+
diff --git a/scheme.json b/scheme.json
69+
index 433e2efc9cef156ff5444f0c4520362ed2ef9ea7..a89c7a9b0b608fef67902c49106a43ebd0fa8b61 100644
70+
--- a/scheme.json
71+
+++ b/scheme.json
72+
@@ -1975,6 +1975,13 @@
73+
],
74+
"description": "The mime types in addition to specified in the file associations. Use it if you don't want to register a new mime type, but reuse existing."
75+
},
76+
+ "minimumSystemVersion": {
77+
+ "description": "The minimum os kernel version required to install the application.",
78+
+ "type": [
79+
+ "null",
80+
+ "string"
81+
+ ]
82+
+ },
83+
"packageCategory": {
84+
"description": "backward compatibility + to allow specify fpm-only category for all possible fpm targets in one place",
85+
"type": [
86+
@@ -2327,6 +2334,13 @@
87+
"MacConfiguration": {
88+
"additionalProperties": false,
89+
"properties": {
90+
+ "LSMinimumSystemVersion": {
91+
+ "description": "The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.",
92+
+ "type": [
93+
+ "null",
94+
+ "string"
95+
+ ]
96+
+ },
97+
"additionalArguments": {
98+
"anyOf": [
99+
{
100+
@@ -2737,7 +2751,7 @@
101+
"type": "boolean"
102+
},
103+
"minimumSystemVersion": {
104+
- "description": "The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.",
105+
+ "description": "The minimum os kernel version required to install the application.",
106+
"type": [
107+
"null",
108+
"string"
109+
@@ -2959,6 +2973,13 @@
110+
"MasConfiguration": {
111+
"additionalProperties": false,
112+
"properties": {
113+
+ "LSMinimumSystemVersion": {
114+
+ "description": "The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.",
115+
+ "type": [
116+
+ "null",
117+
+ "string"
118+
+ ]
119+
+ },
120+
"additionalArguments": {
121+
"anyOf": [
122+
{
123+
@@ -3369,7 +3390,7 @@
124+
"type": "boolean"
125+
},
126+
"minimumSystemVersion": {
127+
- "description": "The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.",
128+
+ "description": "The minimum os kernel version required to install the application.",
129+
"type": [
130+
"null",
131+
"string"
132+
@@ -6507,6 +6528,13 @@
133+
"string"
134+
]
135+
},
136+
+ "minimumSystemVersion": {
137+
+ "description": "The minimum os kernel version required to install the application.",
138+
+ "type": [
139+
+ "null",
140+
+ "string"
141+
+ ]
142+
+ },
143+
"protocols": {
144+
"anyOf": [
145+
{
146+
@@ -7376,6 +7404,13 @@
147+
],
148+
"description": "MAS (Mac Application Store) development options (`mas-dev` target)."
149+
},
150+
+ "minimumSystemVersion": {
151+
+ "description": "The minimum os kernel version required to install the application.",
152+
+ "type": [
153+
+ "null",
154+
+ "string"
155+
+ ]
156+
+ },
157+
"msi": {
158+
"anyOf": [
159+
{

electron-builder.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ mac:
6161
entitlementsInherit: build/entitlements.mac.plist
6262
notarize: false
6363
artifactName: ${productName}-${version}-${arch}.${ext}
64+
minimumSystemVersion: '20.1.0' # 最低支持 macOS 11.0
6465
extendInfo:
6566
- NSCameraUsageDescription: Application requests access to the device's camera.
6667
- NSMicrophoneUsageDescription: Application requests access to the device's microphone.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,11 @@
155155
"dexie": "^4.0.8",
156156
"dexie-react-hooks": "^1.1.7",
157157
"dotenv-cli": "^7.4.2",
158-
"electron": "31.7.6",
158+
"electron": "35.2.2",
159159
"electron-builder": "26.0.15",
160160
"electron-devtools-installer": "^3.2.0",
161161
"electron-icon-builder": "^2.0.1",
162-
"electron-vite": "^2.3.0",
162+
"electron-vite": "^3.1.0",
163163
"emittery": "^1.0.3",
164164
"emoji-picker-element": "^1.22.1",
165165
"eslint": "^9.22.0",
@@ -220,7 +220,8 @@
220220
"pkce-challenge@npm:^4.1.0": "patch:pkce-challenge@npm%3A4.1.0#~/.yarn/patches/pkce-challenge-npm-4.1.0-fbc51695a3.patch",
221221
"app-builder-lib@npm:26.0.13": "patch:app-builder-lib@npm%3A26.0.13#~/.yarn/patches/app-builder-lib-npm-26.0.13-a064c9e1d0.patch",
222222
"shiki": "3.2.2",
223-
"openai@npm:^4.87.3": "patch:openai@npm%3A4.96.0#~/.yarn/patches/openai-npm-4.96.0-0665b05cb9.patch"
223+
"openai@npm:^4.87.3": "patch:openai@npm%3A4.96.0#~/.yarn/patches/openai-npm-4.96.0-0665b05cb9.patch",
224+
"app-builder-lib@npm:26.0.15": "patch:app-builder-lib@npm%3A26.0.15#~/.yarn/patches/app-builder-lib-npm-26.0.15-360e5b0476.patch"
224225
},
225226
"packageManager": "[email protected]",
226227
"lint-staged": {

0 commit comments

Comments
 (0)