update electron to v43
All checks were successful
Android Build / publish (push) Successful in 55s
Linux Build / publish (push) Successful in 1m6s

This commit is contained in:
olcxja 2026-07-09 22:38:33 +02:00
commit fb6c8b6ee9
5385 changed files with 513060 additions and 123058 deletions

View file

@ -1,10 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.filterCFBundleIdentifier = exports.AppInfo = exports.smarten = void 0;
exports.AppInfo = void 0;
exports.smarten = smarten;
exports.filterCFBundleIdentifier = filterCFBundleIdentifier;
const builder_util_1 = require("builder-util");
const filename_1 = require("builder-util/out/filename");
const semver_1 = require("semver");
const macroExpander_1 = require("./util/macroExpander");
const filename_1 = require("./util/filename");
// fpm bug - rpm build --description is not escaped, well... decided to replace quite to smart quote
// http://leancrew.com/all-this/2010/11/smart-quotes-in-javascript/
function smarten(s) {
@ -18,13 +20,14 @@ function smarten(s) {
s = s.replace(/"/g, "\u201d");
return s;
}
exports.smarten = smarten;
class AppInfo {
constructor(info, buildVersion, platformSpecificOptions = null) {
constructor(info, buildVersion, platformSpecificOptions = null, normalizeNfd = false) {
var _a;
this.info = info;
this.platformSpecificOptions = platformSpecificOptions;
this.description = smarten(this.info.metadata.description || "");
this.version = info.metadata.version;
this.type = info.metadata.type;
if (buildVersion == null) {
buildVersion = info.config.buildVersion;
}
@ -37,7 +40,7 @@ class AppInfo {
this.buildNumber = info.config.buildNumber || buildNumberEnvs;
if (buildVersion == null) {
buildVersion = this.version;
if (!builder_util_1.isEmptyOrSpaces(this.buildNumber)) {
if (!(0, builder_util_1.isEmptyOrSpaces)(this.buildNumber)) {
buildVersion += `.${this.buildNumber}`;
}
}
@ -49,24 +52,37 @@ class AppInfo {
this.shortVersionWindows = info.metadata.shortVersionWindows;
}
this.productName = info.config.productName || info.metadata.productName || info.metadata.name;
this.sanitizedProductName = filename_1.sanitizeFileName(this.productName);
this.productFilename = (platformSpecificOptions === null || platformSpecificOptions === void 0 ? void 0 : platformSpecificOptions.executableName) != null ? filename_1.sanitizeFileName(platformSpecificOptions.executableName) : this.sanitizedProductName;
this.sanitizedProductName = (0, filename_1.sanitizeFileName)(this.productName, normalizeNfd);
const executableName = (_a = platformSpecificOptions === null || platformSpecificOptions === void 0 ? void 0 : platformSpecificOptions.executableName) !== null && _a !== void 0 ? _a : info.config.executableName;
this.productFilename = executableName != null ? (0, filename_1.sanitizeFileName)(executableName, normalizeNfd) : this.sanitizedProductName;
}
get channel() {
const prereleaseInfo = semver_1.prerelease(this.version);
const prereleaseInfo = (0, semver_1.prerelease)(this.version);
if (prereleaseInfo != null && prereleaseInfo.length > 0) {
return prereleaseInfo[0];
}
return null;
}
getVersionInWeirdWindowsForm(isSetBuildNumber = true) {
const parsedVersion = new semver_1.SemVer(this.version);
const [major, maybe_minor, maybe_patch] = this.version.split(".").map(versionPart => parseInt(versionPart));
// The major component must be present. Here it can be either NaN or undefined, which
// both returns true from isNaN.
if (isNaN(major)) {
throw new Error(`Invalid major number in: ${this.version}`);
}
// Allow missing version parts. Minor and patch can be left out and default to zero
const minor = maybe_minor !== null && maybe_minor !== void 0 ? maybe_minor : 0;
const patch = maybe_patch !== null && maybe_patch !== void 0 ? maybe_patch : 0;
// ... but reject non-integer version parts. '1.a' is not going to fly
if (isNaN(minor) || isNaN(patch)) {
throw new Error(`Invalid minor or patch number in: ${this.version}`);
}
// https://github.com/electron-userland/electron-builder/issues/2635#issuecomment-371792272
let buildNumber = isSetBuildNumber ? this.buildNumber : null;
if (buildNumber == null || !/^\d+$/.test(buildNumber)) {
buildNumber = "0";
}
return `${parsedVersion.major}.${parsedVersion.minor}.${parsedVersion.patch}.${buildNumber}`;
return `${major}.${minor}.${patch}.${buildNumber}`;
}
get notNullDevMetadata() {
return this.info.devMetadata || {};
@ -86,7 +102,7 @@ class AppInfo {
const info = this.info;
return `${info.framework.defaultAppIdPrefix}${info.metadata.name.toLowerCase()}`;
};
if (appId != null && (appId === "your.id" || builder_util_1.isEmptyOrSpaces(appId))) {
if (appId != null && (appId === "your.id" || (0, builder_util_1.isEmptyOrSpaces)(appId))) {
const incorrectAppId = appId;
appId = generateDefaultAppId();
builder_util_1.log.warn(`do not use "${incorrectAppId}" as appId, "${appId}" will be used instead`);
@ -105,7 +121,7 @@ class AppInfo {
return name.startsWith("@") ? this.sanitizedProductName : name;
}
get sanitizedName() {
return filename_1.sanitizeFileName(this.name);
return (0, filename_1.sanitizeFileName)(this.name);
}
get updaterCacheDirName() {
return this.sanitizedName.toLowerCase() + "-updater";
@ -113,7 +129,7 @@ class AppInfo {
get copyright() {
const copyright = this.info.config.copyright;
if (copyright != null) {
return macroExpander_1.expandMacro(copyright, null, this);
return (0, macroExpander_1.expandMacro)(copyright, null, this);
}
return `Copyright © ${new Date().getFullYear()} ${this.companyName || this.productName}`;
}
@ -133,5 +149,4 @@ function filterCFBundleIdentifier(identifier) {
// Apple documentation: https://developer.apple.com/library/mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070
return identifier.replace(/ /g, "-").replace(/[^a-zA-Z0-9.-]/g, "");
}
exports.filterCFBundleIdentifier = filterCFBundleIdentifier;
//# sourceMappingURL=appInfo.js.map