chore(dependencies): update electron-builder to 26.0.15 (#5651)

* chore(dependencies): update electron-builder and related dependencies to version 26.0.15

* chore(electron-builder): update portable build configuration and clean up artifact build script

- Set buildUniversalInstaller to false for portable builds in electron-builder configuration.
- Removed obsolete condition for deleting portable files in artifact build completion script.
This commit is contained in:
beyondkmp 2025-05-04 18:34:43 +08:00 committed by GitHub
parent 0d0aae8863
commit 5ceb2af056
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 33 additions and 186 deletions

View File

@ -1,92 +0,0 @@
diff --git a/out/electron/ElectronFramework.js b/out/electron/ElectronFramework.js
index 5a4b4546870ee9e770d5a50d79790d39baabd268..3f0ac05dfd6bbaeaf5f834341a823718bd10f55c 100644
--- a/out/electron/ElectronFramework.js
+++ b/out/electron/ElectronFramework.js
@@ -55,26 +55,27 @@ async function removeUnusedLanguagesIfNeeded(options) {
if (!wantedLanguages.length) {
return;
}
- const { dir, langFileExt } = getLocalesConfig(options);
+ const { dirs, langFileExt } = getLocalesConfig(options);
// noinspection SpellCheckingInspection
- await (0, tiny_async_pool_1.default)(builder_util_1.MAX_FILE_REQUESTS, await (0, fs_extra_1.readdir)(dir), async (file) => {
- if (!file.endsWith(langFileExt)) {
+ const deletedFiles = async (dir) => {
+ await (0, tiny_async_pool_1.default)(builder_util_1.MAX_FILE_REQUESTS, await (0, fs_extra_1.readdir)(dir), async (file) => {
+ if (!file.endsWith(langFileExt)) {
+ return;
+ }
+ const language = file.substring(0, file.length - langFileExt.length);
+ if (!wantedLanguages.includes(language)) {
+ return fs.rm(path.join(dir, file), { recursive: true, force: true });
+ }
return;
- }
- const language = file.substring(0, file.length - langFileExt.length);
- if (!wantedLanguages.includes(language)) {
- return fs.rm(path.join(dir, file), { recursive: true, force: true });
- }
- return;
- });
+ });
+ };
+ await Promise.all(dirs.map(deletedFiles));
function getLocalesConfig(options) {
const { appOutDir, packager } = options;
if (packager.platform === index_1.Platform.MAC) {
- return { dir: packager.getResourcesDir(appOutDir), langFileExt: ".lproj" };
- }
- else {
- return { dir: path.join(packager.getResourcesDir(appOutDir), "..", "locales"), langFileExt: ".pak" };
+ return { dirs: [packager.getResourcesDir(appOutDir), packager.getMacOsElectronFrameworkResourcesDir(appOutDir)], langFileExt: ".lproj" };
}
+ return { dirs: [path.join(packager.getResourcesDir(appOutDir), "..", "locales")], langFileExt: ".pak" };
}
}
class ElectronFramework {
diff --git a/out/node-module-collector/index.d.ts b/out/node-module-collector/index.d.ts
index 8e808be0fa0d5971b9f9605c8eb88f71630e34b7..1b97dccd8a150a67c4312d2ba4757960e624045b 100644
--- a/out/node-module-collector/index.d.ts
+++ b/out/node-module-collector/index.d.ts
@@ -2,6 +2,6 @@ import { NpmNodeModulesCollector } from "./npmNodeModulesCollector";
import { PnpmNodeModulesCollector } from "./pnpmNodeModulesCollector";
import { detect, PM, getPackageManagerVersion } from "./packageManager";
import { NodeModuleInfo } from "./types";
-export declare function getCollectorByPackageManager(rootDir: string): Promise<NpmNodeModulesCollector | PnpmNodeModulesCollector>;
+export declare function getCollectorByPackageManager(rootDir: string): Promise<PnpmNodeModulesCollector | NpmNodeModulesCollector>;
export declare function getNodeModules(rootDir: string): Promise<NodeModuleInfo[]>;
export { detect, getPackageManagerVersion, PM };
diff --git a/out/platformPackager.d.ts b/out/platformPackager.d.ts
index 2df1ba2725c54c7b0e8fed67ab52e94f0cdb17bc..c7ff756564cfd216d2c7d8f72f367527010c06f9 100644
--- a/out/platformPackager.d.ts
+++ b/out/platformPackager.d.ts
@@ -67,6 +67,7 @@ export declare abstract class PlatformPackager<DC extends PlatformSpecificBuildO
getElectronSrcDir(dist: string): string;
getElectronDestinationDir(appOutDir: string): string;
getResourcesDir(appOutDir: string): string;
+ getMacOsElectronFrameworkResourcesDir(appOutDir: string): string;
getMacOsResourcesDir(appOutDir: string): string;
private checkFileInPackage;
private sanityCheckPackage;
diff --git a/out/platformPackager.js b/out/platformPackager.js
index 6f799ce0d1cdb5f0b18a9c8187b2db84b3567aa9..879248e6c6786d3473e1a80e3930d3a8d0190aab 100644
--- a/out/platformPackager.js
+++ b/out/platformPackager.js
@@ -465,12 +465,13 @@ class PlatformPackager {
if (this.platform === index_1.Platform.MAC) {
return this.getMacOsResourcesDir(appOutDir);
}
- else if ((0, Framework_1.isElectronBased)(this.info.framework)) {
+ if ((0, Framework_1.isElectronBased)(this.info.framework)) {
return path.join(appOutDir, "resources");
}
- else {
- return appOutDir;
- }
+ return appOutDir;
+ }
+ getMacOsElectronFrameworkResourcesDir(appOutDir) {
+ return path.join(appOutDir, `${this.appInfo.productFilename}.app`, "Contents", "Frameworks", "Electron Framework.framework", "Resources");
}
getMacOsResourcesDir(appOutDir) {
return path.join(appOutDir, `${this.appInfo.productFilename}.app`, "Contents", "Resources");

View File

@ -56,6 +56,7 @@ nsis:
buildUniversalInstaller: false
portable:
artifactName: ${productName}-${version}-${arch}-portable.${ext}
buildUniversalInstaller: false
mac:
entitlementsInherit: build/entitlements.mac.plist
notarize: false

View File

@ -155,7 +155,7 @@
"dexie-react-hooks": "^1.1.7",
"dotenv-cli": "^7.4.2",
"electron": "31.7.6",
"electron-builder": "26.0.13",
"electron-builder": "26.0.15",
"electron-devtools-installer": "^3.2.0",
"electron-icon-builder": "^2.0.1",
"electron-vite": "^2.3.0",

View File

@ -8,11 +8,6 @@ exports.default = function (buildResult) {
}
let oldFilePath = buildResult.file
if (oldFilePath.includes('-portable') && !oldFilePath.includes('-x64') && !oldFilePath.includes('-arm64')) {
console.log('[artifact build completed] delete portable file:', oldFilePath)
fs.unlinkSync(oldFilePath)
return
}
const newfilePath = oldFilePath.replace(/ /g, '-')
fs.renameSync(oldFilePath, newfilePath)
buildResult.file = newfilePath

119
yarn.lock
View File

@ -743,20 +743,7 @@ __metadata:
languageName: node
linkType: hard
"@electron/asar@npm:3.2.18":
version: 3.2.18
resolution: "@electron/asar@npm:3.2.18"
dependencies:
commander: "npm:^5.0.0"
glob: "npm:^7.1.6"
minimatch: "npm:^3.0.4"
bin:
asar: bin/asar.js
checksum: 10c0/c124cb6d35740eb8efbcd9c2da3971833f63bbfd0cae66747b2d1ccedc88fc1fc667e2f6ce4362f9211d853af269b907b2d2eb9a04ed34565576f6c7f93281b2
languageName: node
linkType: hard
"@electron/asar@npm:^3.2.7":
"@electron/asar@npm:3.4.1, @electron/asar@npm:^3.3.1":
version: 3.4.1
resolution: "@electron/asar@npm:3.4.1"
dependencies:
@ -832,9 +819,9 @@ __metadata:
languageName: node
linkType: hard
"@electron/osx-sign@npm:1.3.1":
version: 1.3.1
resolution: "@electron/osx-sign@npm:1.3.1"
"@electron/osx-sign@npm:1.3.3":
version: 1.3.3
resolution: "@electron/osx-sign@npm:1.3.3"
dependencies:
compare-version: "npm:^0.1.2"
debug: "npm:^4.3.4"
@ -845,7 +832,7 @@ __metadata:
bin:
electron-osx-flat: bin/electron-osx-flat.js
electron-osx-sign: bin/electron-osx-sign.js
checksum: 10c0/207be0df4ad4d76b0041de97d12b8d8793f3a5ddaff28e73c34a9b1939c83b3224191c7aae3c95d62eeb4a9146204c1db24577f43f91f6fab26783784856e49b
checksum: 10c0/f8156be879b1850465da8135398b9e58aa6db9f3310cd625c471e1080008b628846c3345a171e17509bcd3c1883cbc90f49a914e7486b1f41702cf2499c657d0
languageName: node
linkType: hard
@ -874,18 +861,18 @@ __metadata:
languageName: node
linkType: hard
"@electron/universal@npm:2.0.1":
version: 2.0.1
resolution: "@electron/universal@npm:2.0.1"
"@electron/universal@npm:2.0.3":
version: 2.0.3
resolution: "@electron/universal@npm:2.0.3"
dependencies:
"@electron/asar": "npm:^3.2.7"
"@electron/asar": "npm:^3.3.1"
"@malept/cross-spawn-promise": "npm:^2.0.0"
debug: "npm:^4.3.1"
dir-compare: "npm:^4.2.0"
fs-extra: "npm:^11.1.1"
minimatch: "npm:^9.0.3"
plist: "npm:^3.1.0"
checksum: 10c0/d3cd87184ee561e4fa4bddbd8a2f9f8db4b3f7c92fe108bcd3e06eef2dd6bdfc378eaf0758b85e8066b3f88f9dd9775d83b3ac9281b491017747786c5cce50a4
checksum: 10c0/346b23298d4f175dc50d9b91277d8e4c30017215e1a78c985ce917cd793fc0600084d62a84f485229d781ddfeb5829b6c1125c0bda131ddb9146522d305e92aa
languageName: node
linkType: hard
@ -4386,7 +4373,7 @@ __metadata:
docx: "npm:^9.0.2"
dotenv-cli: "npm:^7.4.2"
electron: "npm:31.7.6"
electron-builder: "npm:26.0.13"
electron-builder: "npm:26.0.15"
electron-devtools-installer: "npm:^3.2.0"
electron-icon-builder: "npm:^2.0.1"
electron-log: "npm:^5.1.5"
@ -4741,17 +4728,17 @@ __metadata:
languageName: node
linkType: hard
"app-builder-lib@npm:26.0.13":
version: 26.0.13
resolution: "app-builder-lib@npm:26.0.13"
"app-builder-lib@npm:26.0.15":
version: 26.0.15
resolution: "app-builder-lib@npm:26.0.15"
dependencies:
"@develar/schema-utils": "npm:~2.6.5"
"@electron/asar": "npm:3.2.18"
"@electron/asar": "npm:3.4.1"
"@electron/fuses": "npm:^1.8.0"
"@electron/notarize": "npm:2.5.0"
"@electron/osx-sign": "npm:1.3.1"
"@electron/osx-sign": "npm:1.3.3"
"@electron/rebuild": "npm:3.7.2"
"@electron/universal": "npm:2.0.1"
"@electron/universal": "npm:2.0.3"
"@malept/flatpak-bundler": "npm:^0.4.0"
"@types/fs-extra": "npm:9.0.13"
async-exit-hook: "npm:^2.0.1"
@ -4779,53 +4766,9 @@ __metadata:
temp-file: "npm:^3.4.0"
tiny-async-pool: "npm:1.3.0"
peerDependencies:
dmg-builder: 26.0.13
electron-builder-squirrel-windows: 26.0.13
checksum: 10c0/de0d2ed597dd31df3074aa5b4c466f4bc3957ca65f429255780f8a15726203ff5c7802c98dd377cb9196b4449cb46780141292b446d824e2f04675bf5278d929
languageName: node
linkType: hard
"app-builder-lib@patch:app-builder-lib@npm%3A26.0.13#~/.yarn/patches/app-builder-lib-npm-26.0.13-a064c9e1d0.patch":
version: 26.0.13
resolution: "app-builder-lib@patch:app-builder-lib@npm%3A26.0.13#~/.yarn/patches/app-builder-lib-npm-26.0.13-a064c9e1d0.patch::version=26.0.13&hash=ba34e0"
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.2"
"@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.13"
builder-util-runtime: "npm:9.3.2"
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.13"
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"
plist: "npm:3.1.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.13
electron-builder-squirrel-windows: 26.0.13
checksum: 10c0/4a84db5f93398e0004a5b7138ca62ddb36d5c7281703fc42471d77601ecd17c3e6d77678ae799098d3a9457af1a852e1949cc942db4dd8eaf899d5bfc2151339
dmg-builder: 26.0.15
electron-builder-squirrel-windows: 26.0.15
checksum: 10c0/d617864aca3c61633a9a5fda8d991ea90bcbe502702a4a1d64545ae6cfaa1f4122415db02b11e0dc76a527b169ea6e5619551903456e24a7053b3f4eb04cb79f
languageName: node
linkType: hard
@ -6760,11 +6703,11 @@ __metadata:
languageName: node
linkType: hard
"dmg-builder@npm:26.0.13":
version: 26.0.13
resolution: "dmg-builder@npm:26.0.13"
"dmg-builder@npm:26.0.15":
version: 26.0.15
resolution: "dmg-builder@npm:26.0.15"
dependencies:
app-builder-lib: "npm:26.0.13"
app-builder-lib: "npm:26.0.15"
builder-util: "npm:26.0.13"
builder-util-runtime: "npm:9.3.2"
dmg-license: "npm:^1.0.11"
@ -6774,7 +6717,7 @@ __metadata:
dependenciesMeta:
dmg-license:
optional: true
checksum: 10c0/c18259a83ceb2326be0d595f3473ac7eacb060f5d7dd07205ca85203005d85962f16c7270c990e06445948fba4478adf96f454755451c2ad01f0f50a52b23c45
checksum: 10c0/fe9ea305abf05e16d96f7f7435db14f0264f82d4f49a09a64645425a3d2a69ed9cc346f36278b958fb1197fea72f5afc9661a22307d2c0ab5192843dc31f794c
languageName: node
linkType: hard
@ -6974,15 +6917,15 @@ __metadata:
languageName: node
linkType: hard
"electron-builder@npm:26.0.13":
version: 26.0.13
resolution: "electron-builder@npm:26.0.13"
"electron-builder@npm:26.0.15":
version: 26.0.15
resolution: "electron-builder@npm:26.0.15"
dependencies:
app-builder-lib: "npm:26.0.13"
app-builder-lib: "npm:26.0.15"
builder-util: "npm:26.0.13"
builder-util-runtime: "npm:9.3.2"
chalk: "npm:^4.1.2"
dmg-builder: "npm:26.0.13"
dmg-builder: "npm:26.0.15"
fs-extra: "npm:^10.1.0"
is-ci: "npm:^3.0.0"
lazy-val: "npm:^1.0.5"
@ -6991,7 +6934,7 @@ __metadata:
bin:
electron-builder: cli.js
install-app-deps: install-app-deps.js
checksum: 10c0/b238d969f24ccdfe37d2f90484b4f7c25597e3b31b278d664551f08ee421683cd418524ca945d05e0c269e4b3dbe61171b9773fb401f09130889b1f8183c2844
checksum: 10c0/bb21e4b547c8dfa590017930340ab9b7e2b017c5ba9286e5d0ccbe6481f4b13bbf905429124a1350a2282ee35dd52e9ba9d9d1d730fc1957c9e7789d0eb39374
languageName: node
linkType: hard