update electron to v43

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,16 +1,21 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.configureBuildCommand = exports.build = exports.createTargets = exports.coerceTypes = exports.normalizeOptions = exports.createYargs = void 0;
const builder_util_1 = require("builder-util");
const chalk = require("chalk");
exports.createYargs = createYargs;
exports.normalizeOptions = normalizeOptions;
exports.coerceTypes = coerceTypes;
exports.createTargets = createTargets;
exports.build = build;
exports.configureBuildCommand = configureBuildCommand;
const app_builder_lib_1 = require("app-builder-lib");
const builder_util_1 = require("builder-util");
const builder_util_runtime_1 = require("builder-util-runtime");
const chalk = require("chalk");
const yargs = require("yargs");
function createYargs() {
return yargs.parserConfiguration({
"camel-case-expansion": false,
});
}
exports.createYargs = createYargs;
/** @private */
function normalizeOptions(args) {
if (args.targets != null) {
@ -35,7 +40,7 @@ function normalizeOptions(args) {
if (args.universal) {
result.push(builder_util_1.Arch.universal);
}
return result.length === 0 && currentIfNotSpecified ? [builder_util_1.archFromString(process.arch)] : result;
return result.length === 0 && currentIfNotSpecified ? [(0, builder_util_1.archFromString)(process.arch)] : result;
}
let archToType = targets.get(platform);
if (archToType == null) {
@ -52,11 +57,11 @@ function normalizeOptions(args) {
for (const type of types) {
const suffixPos = type.lastIndexOf(":");
if (suffixPos > 0) {
builder_util_1.addValue(archToType, builder_util_1.archFromString(type.substring(suffixPos + 1)), type.substring(0, suffixPos));
(0, builder_util_1.addValue)(archToType, (0, builder_util_1.archFromString)(type.substring(suffixPos + 1)), type.substring(0, suffixPos));
}
else {
for (const arch of commonArch(true)) {
builder_util_1.addValue(archToType, arch, type);
(0, builder_util_1.addValue)(archToType, arch, type);
}
}
}
@ -105,7 +110,7 @@ function normalizeOptions(args) {
const newConfig = {};
for (const configItem of config) {
if (typeof configItem === "object") {
builder_util_1.deepAssign(newConfig, configItem);
(0, builder_util_runtime_1.deepAssign)(newConfig, configItem);
}
else if (typeof configItem === "string") {
newConfig.extends = configItem;
@ -137,7 +142,6 @@ function normalizeOptions(args) {
delete r.project;
return result;
}
exports.normalizeOptions = normalizeOptions;
function coerceValue(host, key) {
const value = host[key];
if (value === "true") {
@ -163,11 +167,10 @@ function coerceTypes(host) {
}
return host;
}
exports.coerceTypes = coerceTypes;
function createTargets(platforms, type, arch) {
const targets = new Map();
for (const platform of platforms) {
const archs = arch === "all" ? (platform === app_builder_lib_1.Platform.MAC ? [builder_util_1.Arch.x64, builder_util_1.Arch.arm64, builder_util_1.Arch.universal] : [builder_util_1.Arch.x64, builder_util_1.Arch.ia32]) : [builder_util_1.archFromString(arch == null ? process.arch : arch)];
const archs = arch === "all" ? (platform === app_builder_lib_1.Platform.MAC ? [builder_util_1.Arch.x64, builder_util_1.Arch.arm64, builder_util_1.Arch.universal] : [builder_util_1.Arch.x64, builder_util_1.Arch.ia32]) : [(0, builder_util_1.archFromString)(arch == null ? process.arch : arch)];
const archToType = new Map();
targets.set(platform, archToType);
for (const arch of archs) {
@ -176,12 +179,10 @@ function createTargets(platforms, type, arch) {
}
return targets;
}
exports.createTargets = createTargets;
function build(rawOptions) {
const buildOptions = normalizeOptions(rawOptions || {});
return app_builder_lib_1.build(buildOptions, new app_builder_lib_1.Packager(buildOptions));
return (0, app_builder_lib_1.build)(buildOptions, new app_builder_lib_1.Packager(buildOptions));
}
exports.build = build;
/**
* @private
*/
@ -192,19 +193,19 @@ function configureBuildCommand(yargs) {
.option("mac", {
group: buildGroup,
alias: ["m", "o", "macos"],
description: `Build for macOS, accepts target list (see ${chalk.underline("https://goo.gl/5uHuzj")}).`,
description: `Build for macOS, accepts target list (see ${chalk.underline("https://www.electron.build/mac")}).`,
type: "array",
})
.option("linux", {
group: buildGroup,
alias: "l",
description: `Build for Linux, accepts target list (see ${chalk.underline("https://goo.gl/4vwQad")})`,
description: `Build for Linux, accepts target list (see ${chalk.underline("https://www.electron.build/linux")})`,
type: "array",
})
.option("win", {
group: buildGroup,
alias: ["w", "windows"],
description: `Build for Windows, accepts target list (see ${chalk.underline("https://goo.gl/jYsTEJ")})`,
description: `Build for Windows, accepts target list (see ${chalk.underline("https://www.electron.build/win")})`,
type: "array",
})
.option("x64", {
@ -240,7 +241,7 @@ function configureBuildCommand(yargs) {
.option("publish", {
group: publishGroup,
alias: "p",
description: `Publish artifacts, see ${chalk.underline("https://goo.gl/tSFycD")}`,
description: `Publish artifacts, see ${chalk.underline("https://www.electron.build/publish")}`,
choices: ["onTag", "onTagOrDraft", "always", "never", undefined],
})
.option("prepackaged", {
@ -256,7 +257,8 @@ function configureBuildCommand(yargs) {
.option("config", {
alias: ["c"],
group: buildGroup,
description: "The path to an electron-builder config. Defaults to `electron-builder.yml` (or `json`, or `json5`), see " + chalk.underline("https://goo.gl/YFRJOM"),
description: "The path to an electron-builder config. Defaults to `electron-builder.yml` (or `json`, or `json5`, or `js`, or `ts`), see " +
chalk.underline("https://www.electron.build/configuration"),
})
.group(["help", "version"], "Other:")
.example("electron-builder -mwl", "build for macOS, Windows and Linux")
@ -265,5 +267,4 @@ function configureBuildCommand(yargs) {
.example("electron-builder -c.extraMetadata.foo=bar", "set package.json property `foo` to `bar`")
.example("electron-builder --config.nsis.unicode=false", "configure unicode options for NSIS");
}
exports.configureBuildCommand = configureBuildCommand;
//# sourceMappingURL=builder.js.map