electron-builder 27.0.0-alpha.1 → 27.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assert-node-version.js +39 -0
- package/cli.js +5 -1
- package/dist/builder.d.ts +1 -1
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +43 -24
- package/dist/builder.js.map +1 -1
- package/dist/cli/clear-cache.d.ts.map +1 -1
- package/dist/cli/clear-cache.js +4 -2
- package/dist/cli/clear-cache.js.map +1 -1
- package/dist/cli/cli-util.d.ts.map +1 -1
- package/dist/cli/cli-util.js +3 -1
- package/dist/cli/cli-util.js.map +1 -1
- package/dist/cli/cli.js +7 -0
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/create-self-signed-cert.js +3 -3
- package/dist/cli/create-self-signed-cert.js.map +1 -1
- package/dist/cli/create-update-key.d.ts +2 -0
- package/dist/cli/create-update-key.d.ts.map +1 -0
- package/dist/cli/create-update-key.js +34 -0
- package/dist/cli/create-update-key.js.map +1 -0
- package/dist/cli/install-app-deps.js +2 -6
- package/dist/cli/install-app-deps.js.map +1 -1
- package/dist/cli/migrate-schema-programmatic.d.ts +26 -0
- package/dist/cli/migrate-schema-programmatic.d.ts.map +1 -0
- package/dist/cli/migrate-schema-programmatic.js +1581 -0
- package/dist/cli/migrate-schema-programmatic.js.map +1 -0
- package/dist/cli/migrate-schema.d.ts +27 -0
- package/dist/cli/migrate-schema.d.ts.map +1 -1
- package/dist/cli/migrate-schema.js +729 -49
- package/dist/cli/migrate-schema.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/indexInternal.d.ts +1 -0
- package/dist/indexInternal.js +1 -1
- package/dist/publish.d.ts +1 -1
- package/dist/publish.d.ts.map +1 -1
- package/dist/publish.js +27 -17
- package/dist/publish.js.map +1 -1
- package/install-app-deps.js +5 -1
- package/package.json +7 -6
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Runs before anything else is loaded, so an unsupported Node version produces a named error instead
|
|
2
|
+
// of whatever the ESM/require(esm) machinery happens to throw first (typically ERR_REQUIRE_ESM or a
|
|
3
|
+
// syntax error deep in a dependency, neither of which mentions electron-builder or the required
|
|
4
|
+
// version). Deliberately dependency-free and kept in plain ES2015 so it parses on old runtimes.
|
|
5
|
+
//
|
|
6
|
+
// This file must never be imported by electron-updater: that runs inside Electron's bundled Node,
|
|
7
|
+
// which is frequently below this floor, and where the module graph has already been resolved.
|
|
8
|
+
|
|
9
|
+
const MINIMUM = "22.12.0"
|
|
10
|
+
|
|
11
|
+
function parse(version) {
|
|
12
|
+
return version
|
|
13
|
+
.replace(/^v/, "")
|
|
14
|
+
.split("-")[0]
|
|
15
|
+
.split(".")
|
|
16
|
+
.map(part => Number.parseInt(part, 10) || 0)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function assertNodeVersion(actual = process.versions.node) {
|
|
20
|
+
const current = parse(actual)
|
|
21
|
+
const required = parse(MINIMUM)
|
|
22
|
+
for (let i = 0; i < required.length; i++) {
|
|
23
|
+
if (current[i] > required[i]) {
|
|
24
|
+
return
|
|
25
|
+
}
|
|
26
|
+
if (current[i] < required[i]) {
|
|
27
|
+
throw new Error(
|
|
28
|
+
`electron-builder requires Node.js >= ${MINIMUM}, but this process is running Node.js ${actual}.\n\n` +
|
|
29
|
+
`v27 ships as native ES modules. Node ${MINIMUM} is the first release where require(esm) is\n` +
|
|
30
|
+
`stable without a flag, which is what lets both CJS and ESM projects consume these packages.\n\n` +
|
|
31
|
+
`Upgrade the Node.js version used by your shell, your CI job, and any Docker image that runs\n` +
|
|
32
|
+
`electron-builder, then try again.\n` +
|
|
33
|
+
`https://www.electron.build/docs/migration/v27-breaking-changes#nodejs-22120-required`
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default assertNodeVersion
|
package/cli.js
CHANGED
package/dist/builder.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PackagerOptions, Platform } from "app-builder-lib";
|
|
2
2
|
import { Arch } from "builder-util";
|
|
3
|
-
import { PublishOptions } from "electron-publish";
|
|
3
|
+
import type { PublishOptions } from "electron-publish";
|
|
4
4
|
import * as yargs from "yargs";
|
|
5
5
|
export declare function createYargs(): yargs.Argv<unknown>;
|
|
6
6
|
export interface BuildOptions extends PackagerOptions, PublishOptions {
|
package/dist/builder.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwD,eAAe,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwD,eAAe,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAEjH,OAAO,EAAE,IAAI,EAAuB,MAAM,cAAc,CAAA;AAGxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEtD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,wBAAgB,WAAW,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAQjD;AAED,MAAM,WAAW,YAAa,SAAQ,eAAe,EAAE,cAAc;CAAG;AAExE,MAAM,WAAW,UAAW,SAAQ,eAAe,EAAE,cAAc;IACjE,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB,GAAG,CAAC,EAAE,OAAO,CAAA;CACd;AAED,eAAe;AACf,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,YAAY,CA6I/D;AAiBD,eAAe;AACf,wBAAgB,WAAW,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,CAK1C;AAsBD,wBAAgB,aAAa,CAAC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAkB7I;AAED,wBAAgB,KAAK,CAAC,UAAU,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAGrE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAiFnE"}
|
package/dist/builder.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { build as _build, DIR_TARGET, Packager, Platform } from "app-builder-lib";
|
|
2
|
-
import {
|
|
2
|
+
import { addTargetsForPlatform } from "app-builder-lib/internal";
|
|
3
|
+
import { Arch, archFromString, log } from "builder-util";
|
|
3
4
|
import { deepAssign } from "builder-util-runtime";
|
|
4
5
|
import chalk from "chalk";
|
|
5
6
|
import { hideBin } from "yargs/helpers";
|
|
@@ -39,29 +40,12 @@ export function normalizeOptions(args) {
|
|
|
39
40
|
}
|
|
40
41
|
return result.length === 0 && currentIfNotSpecified ? [archFromString(process.arch)] : result;
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
-
if (archToType == null) {
|
|
44
|
-
archToType = new Map();
|
|
45
|
-
targets.set(platform, archToType);
|
|
46
|
-
}
|
|
47
|
-
if (types.length === 0) {
|
|
43
|
+
addTargetsForPlatform(targets, platform, types, commonArch, archToType => {
|
|
48
44
|
const defaultTargetValue = args.dir ? [DIR_TARGET] : [];
|
|
49
45
|
for (const arch of commonArch(args.dir === true)) {
|
|
50
46
|
archToType.set(arch, defaultTargetValue);
|
|
51
47
|
}
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
for (const type of types) {
|
|
55
|
-
const suffixPos = type.lastIndexOf(":");
|
|
56
|
-
if (suffixPos > 0) {
|
|
57
|
-
addValue(archToType, archFromString(type.substring(suffixPos + 1)), type.substring(0, suffixPos));
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
for (const arch of commonArch(true)) {
|
|
61
|
-
addValue(archToType, arch, type);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
48
|
+
});
|
|
65
49
|
}
|
|
66
50
|
if (args.mac != null) {
|
|
67
51
|
processTargets(Platform.MAC, args.mac);
|
|
@@ -121,9 +105,23 @@ export function normalizeOptions(args) {
|
|
|
121
105
|
if (config.extraMetadata != null) {
|
|
122
106
|
coerceTypes(config.extraMetadata);
|
|
123
107
|
}
|
|
124
|
-
//
|
|
108
|
+
// mac.sign / mac.universal are nested option bags holding booleans and the signing identity
|
|
109
|
+
// (e.g. sign.identity, sign.hardenedRuntime, universal.mergeASARs). coerceValue recurses into the
|
|
110
|
+
// objects (so `-c.mac.sign.identity=null` disables code signing) and also handles `-c.mac.sign=null`.
|
|
125
111
|
if (config.mac != null) {
|
|
126
|
-
coerceValue(config.mac, "
|
|
112
|
+
coerceValue(config.mac, "sign");
|
|
113
|
+
coerceValue(config.mac, "universal");
|
|
114
|
+
}
|
|
115
|
+
// `-c.updateManifest=false` is the signing opt-out and arrives as the string "false"; ajv does not write a
|
|
116
|
+
// coerced value back out of an `anyOf` branch, so without this the opt-out is silently ignored and the build
|
|
117
|
+
// fails demanding a signing key. coerceValue recurses into objects, so `-c.updateManifest.signingKeyFile=...`
|
|
118
|
+
// still works. (`mas` / `masDev` are omitted on purpose - PlatformPackager never reads updateManifest there.)
|
|
119
|
+
coerceValue(config, "updateManifest");
|
|
120
|
+
for (const platform of ["mac", "win", "linux"]) {
|
|
121
|
+
const platformConfig = config[platform];
|
|
122
|
+
if (platformConfig != null && typeof platformConfig === "object") {
|
|
123
|
+
coerceValue(platformConfig, "updateManifest");
|
|
124
|
+
}
|
|
127
125
|
}
|
|
128
126
|
// fix Boolean type by coerceTypes
|
|
129
127
|
if (config.nsis != null) {
|
|
@@ -164,10 +162,31 @@ export function coerceTypes(host) {
|
|
|
164
162
|
}
|
|
165
163
|
return host;
|
|
166
164
|
}
|
|
165
|
+
/** Emitted once per process — createTargets is called per invocation, not per platform. */
|
|
166
|
+
let archAllWarningEmitted = false;
|
|
167
|
+
/**
|
|
168
|
+
* `arch: "all"` dropped ia32 in v27. The build stays green and simply produces no 32-bit artifact
|
|
169
|
+
* (plus an unexpected arm64 one), so the only evidence is a missing file in dist — nothing ties that
|
|
170
|
+
* back to the upgrade.
|
|
171
|
+
*/
|
|
172
|
+
function warnAboutArchAllExpansion(platforms) {
|
|
173
|
+
if (archAllWarningEmitted || !platforms.some(platform => platform !== Platform.MAC)) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
archAllWarningEmitted = true;
|
|
177
|
+
log.warn({ expandsTo: "x64, arm64", previously: "x64, ia32", solution: "request ia32 explicitly (--ia32 / Arch.ia32) with electronVersion <= 43.x if you still ship 32-bit builds" }, 'arch "all" no longer includes ia32. Electron 44 removed Windows ia32 builds and Linux ia32 zips ended at Electron 19, so the old expansion produced broken builds on current Electron. ' +
|
|
178
|
+
"See https://www.electron.build/docs/migration/v27-breaking-changes#arch-all-now-expands-to-x64-and-arm64-32-bit-fails-fast-on-electron-44");
|
|
179
|
+
}
|
|
167
180
|
export function createTargets(platforms, type, arch) {
|
|
168
181
|
const targets = new Map();
|
|
182
|
+
if (arch === "all") {
|
|
183
|
+
warnAboutArchAllExpansion(platforms);
|
|
184
|
+
}
|
|
169
185
|
for (const platform of platforms) {
|
|
170
|
-
const archs =
|
|
186
|
+
const archs =
|
|
187
|
+
// BREAKING: since Electron 44 removed Windows ia32 and Linux armv7l builds (and linux-ia32 zips ended at Electron 19),
|
|
188
|
+
// "all" expands to x64 + arm64 on non-mac platforms instead of x64 + ia32. Request ia32 explicitly to build it (Electron <= 43 only).
|
|
189
|
+
arch === "all" ? (platform === Platform.MAC ? [Arch.x64, Arch.arm64, Arch.universal] : [Arch.x64, Arch.arm64]) : [archFromString(arch == null ? process.arch : arch)];
|
|
171
190
|
const archToType = new Map();
|
|
172
191
|
targets.set(platform, archToType);
|
|
173
192
|
for (const arch of archs) {
|
|
@@ -260,7 +279,7 @@ export function configureBuildCommand(yargs) {
|
|
|
260
279
|
.group(["help", "version"], "Other:")
|
|
261
280
|
.example("electron-builder -mwl", "build for macOS, Windows and Linux")
|
|
262
281
|
.example("electron-builder --linux deb tar.xz", "build deb and tar.xz for Linux")
|
|
263
|
-
.example("electron-builder --win --
|
|
282
|
+
.example("electron-builder --win --arm64", "build for Windows arm64")
|
|
264
283
|
.example("electron-builder -c.extraMetadata.foo=bar", "set package.json property `foo` to `bar`")
|
|
265
284
|
.example("electron-builder --config.nsis.unicode=false", "configure unicode options for NSIS");
|
|
266
285
|
}
|
package/dist/builder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,MAAM,EAAiB,UAAU,EAAE,QAAQ,EAAmB,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACjH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,MAAM,UAAU,WAAW;IACzB,gFAAgF;IAChF,sDAAsD;IACtD,MAAM,OAAO,GAAI,KAAa,CAAC,OAAO,IAAI,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,KAAK,EAAE;QACb,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,qCAAqC;QAClD,IAAI,EAAE,SAAS;KAChB,CAAC;SACD,MAAM,CAAC,SAAS,EAAE;QACjB,KAAK,EAAE,YAAY;QACnB,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,0BAA0B,KAAK,CAAC,SAAS,CAAC,oCAAoC,CAAC,EAAE;QAC9F,OAAO,EAAE,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAgB,CAAC;KACxE,CAAC;SACD,MAAM,CAAC,aAAa,EAAE;QACrB,KAAK,EAAE,CAAC,IAAI,CAAC;QACb,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,iEAAiE;KAC/E,CAAC;SACD,MAAM,CAAC,YAAY,EAAE;QACpB,KAAK,EAAE,CAAC,SAAS,CAAC;QAClB,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,uEAAuE;KACrF,CAAC;SACD,MAAM,CAAC,QAAQ,EAAE;QAChB,KAAK,EAAE,CAAC,GAAG,CAAC;QACZ,KAAK,EAAE,UAAU;QACjB,WAAW,EACT,4HAA4H;YAC5H,KAAK,CAAC,SAAS,CAAC,0CAA0C,CAAC;KAC9D,CAAC;SACD,KAAK,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,QAAQ,CAAC;SACpC,OAAO,CAAC,uBAAuB,EAAE,oCAAoC,CAAC;SACtE,OAAO,CAAC,qCAAqC,EAAE,gCAAgC,CAAC;SAChF,OAAO,CAAC,+BAA+B,EAAE,wBAAwB,CAAC;SAClE,OAAO,CAAC,2CAA2C,EAAE,0CAA0C,CAAC;SAChG,OAAO,CAAC,8CAA8C,EAAE,oCAAoC,CAAC,CAAA;AAClG,CAAC","sourcesContent":["import { build as _build, Configuration, DIR_TARGET, Packager, PackagerOptions, Platform } from \"app-builder-lib\"\nimport { addValue, Arch, archFromString } from \"builder-util\"\nimport { deepAssign } from \"builder-util-runtime\"\nimport chalk from \"chalk\"\nimport { PublishOptions } from \"electron-publish\"\nimport { hideBin } from \"yargs/helpers\"\nimport * as yargs from \"yargs\"\n\nexport function createYargs(): yargs.Argv<unknown> {\n // In ESM, yargs.default is the factory function; call it to create an instance.\n // In CJS, yargs.default is already an Argv singleton.\n const factory = (yargs as any).default ?? yargs\n const instance = typeof factory?.parserConfiguration === \"function\" ? factory : factory(hideBin(process.argv))\n return (instance as unknown as yargs.Argv<unknown>).parserConfiguration({\n \"camel-case-expansion\": false,\n })\n}\n\nexport interface BuildOptions extends PackagerOptions, PublishOptions {}\n\nexport interface CliOptions extends PackagerOptions, PublishOptions {\n x64?: boolean\n ia32?: boolean\n armv7l?: boolean\n arm64?: boolean\n universal?: boolean\n\n dir?: boolean\n}\n\n/** @private */\nexport function normalizeOptions(args: CliOptions): BuildOptions {\n if (args.targets != null) {\n return args\n }\n\n const targets = new Map<Platform, Map<Arch, Array<string>>>()\n\n function processTargets(platform: Platform, types: Array<string>) {\n function commonArch(currentIfNotSpecified: boolean): Array<Arch> {\n const result = Array<Arch>()\n if (args.x64) {\n result.push(Arch.x64)\n }\n if (args.armv7l) {\n result.push(Arch.armv7l)\n }\n if (args.arm64) {\n result.push(Arch.arm64)\n }\n if (args.ia32) {\n result.push(Arch.ia32)\n }\n if (args.universal) {\n result.push(Arch.universal)\n }\n\n return result.length === 0 && currentIfNotSpecified ? [archFromString(process.arch)] : result\n }\n\n let archToType = targets.get(platform)\n if (archToType == null) {\n archToType = new Map<Arch, Array<string>>()\n targets.set(platform, archToType)\n }\n\n if (types.length === 0) {\n const defaultTargetValue = args.dir ? [DIR_TARGET] : []\n for (const arch of commonArch(args.dir === true)) {\n archToType.set(arch, defaultTargetValue)\n }\n return\n }\n\n for (const type of types) {\n const suffixPos = type.lastIndexOf(\":\")\n if (suffixPos > 0) {\n addValue(archToType, archFromString(type.substring(suffixPos + 1)), type.substring(0, suffixPos))\n } else {\n for (const arch of commonArch(true)) {\n addValue(archToType, arch, type)\n }\n }\n }\n }\n\n if (args.mac != null) {\n processTargets(Platform.MAC, args.mac)\n }\n\n if (args.linux != null) {\n processTargets(Platform.LINUX, args.linux)\n }\n\n if (args.win != null) {\n processTargets(Platform.WINDOWS, args.win)\n }\n\n if (targets.size === 0) {\n processTargets(Platform.current(), [])\n }\n\n const result: any = { ...args }\n result.targets = targets\n\n delete result.dir\n delete result.mac\n delete result.linux\n delete result.win\n\n const r = result\n delete r.m\n delete r.o\n delete r.l\n delete r.w\n delete r.windows\n delete r.macos\n delete r.$0\n delete r._\n delete r.version\n delete r.help\n delete r.c\n delete r.p\n delete r.pd\n\n delete result.ia32\n delete result.x64\n delete result.armv7l\n delete result.arm64\n delete result.universal\n\n let config = result.config\n\n // config is array when combining dot-notation values with a config file value\n // https://github.com/electron-userland/electron-builder/issues/2016\n if (Array.isArray(config)) {\n const newConfig: Configuration = {}\n for (const configItem of config) {\n if (typeof configItem === \"object\") {\n deepAssign(newConfig, configItem)\n } else if (typeof configItem === \"string\") {\n newConfig.extends = configItem\n }\n }\n\n config = newConfig\n result.config = newConfig\n }\n\n // AJV cannot coerce \"null\" string to null if string is also allowed (because null string is a valid value)\n if (config != null && typeof config !== \"string\") {\n if (config.extraMetadata != null) {\n coerceTypes(config.extraMetadata)\n }\n\n // ability to disable code sign using -c.mac.identity=null\n if (config.mac != null) {\n coerceValue(config.mac, \"identity\")\n }\n\n // fix Boolean type by coerceTypes\n if (config.nsis != null) {\n coerceTypes(config.nsis)\n }\n if (config.nsisWeb != null) {\n coerceTypes(config.nsisWeb)\n }\n }\n\n if (\"project\" in r && !(\"projectDir\" in result)) {\n result.projectDir = r.project\n }\n delete r.project\n\n return result as BuildOptions\n}\n\nfunction coerceValue(host: any, key: string): void {\n const value = host[key]\n if (value === \"true\") {\n host[key] = true\n } else if (value === \"false\") {\n host[key] = false\n } else if (value === \"null\") {\n host[key] = null\n } else if (key === \"version\" && typeof value === \"number\") {\n host[key] = value.toString()\n } else if (value != null && typeof value === \"object\") {\n coerceTypes(value)\n }\n}\n\n/** @private */\nexport function coerceTypes(host: any): any {\n for (const key of Object.getOwnPropertyNames(host)) {\n coerceValue(host, key)\n }\n return host\n}\n\nexport function createTargets(platforms: Array<Platform>, type?: string | null, arch?: string | null): Map<Platform, Map<Arch, Array<string>>> {\n const targets = new Map<Platform, Map<Arch, Array<string>>>()\n for (const platform of platforms) {\n const archs =\n arch === \"all\" ? (platform === Platform.MAC ? [Arch.x64, Arch.arm64, Arch.universal] : [Arch.x64, Arch.ia32]) : [archFromString(arch == null ? process.arch : arch)]\n const archToType = new Map<Arch, Array<string>>()\n targets.set(platform, archToType)\n\n for (const arch of archs) {\n archToType.set(arch, type == null ? [] : [type])\n }\n }\n return targets\n}\n\nexport function build(rawOptions?: CliOptions): Promise<Array<string>> {\n const buildOptions = normalizeOptions(rawOptions || {})\n return _build(buildOptions, new Packager(buildOptions))\n}\n\n/**\n * @private\n */\nexport function configureBuildCommand(yargs: yargs.Argv): yargs.Argv {\n const publishGroup = \"Publishing:\"\n const buildGroup = \"Building:\"\n return yargs\n .option(\"mac\", {\n group: buildGroup,\n alias: [\"m\", \"o\", \"macos\"],\n description: `Build for macOS, accepts target list (see ${chalk.underline(\"https://www.electron.build/mac\")}).`,\n type: \"array\",\n })\n .option(\"linux\", {\n group: buildGroup,\n alias: \"l\",\n description: `Build for Linux, accepts target list (see ${chalk.underline(\"https://www.electron.build/linux\")})`,\n type: \"array\",\n })\n .option(\"win\", {\n group: buildGroup,\n alias: [\"w\", \"windows\"],\n description: `Build for Windows, accepts target list (see ${chalk.underline(\"https://www.electron.build/win\")})`,\n type: \"array\",\n })\n .option(\"x64\", {\n group: buildGroup,\n description: \"Build for x64\",\n type: \"boolean\",\n })\n .option(\"ia32\", {\n group: buildGroup,\n description: \"Build for ia32\",\n type: \"boolean\",\n })\n .option(\"armv7l\", {\n group: buildGroup,\n description: \"Build for armv7l\",\n type: \"boolean\",\n })\n .option(\"arm64\", {\n group: buildGroup,\n description: \"Build for arm64\",\n type: \"boolean\",\n })\n .option(\"universal\", {\n group: buildGroup,\n description: \"Build for universal\",\n type: \"boolean\",\n })\n .option(\"dir\", {\n group: buildGroup,\n description: \"Build unpacked dir. Useful to test.\",\n type: \"boolean\",\n })\n .option(\"publish\", {\n group: publishGroup,\n alias: \"p\",\n description: `Publish artifacts, see ${chalk.underline(\"https://www.electron.build/publish\")}`,\n choices: [\"onTag\", \"onTagOrDraft\", \"always\", \"never\", undefined as any],\n })\n .option(\"prepackaged\", {\n alias: [\"pd\"],\n group: buildGroup,\n description: \"The path to prepackaged app (to pack in a distributable format)\",\n })\n .option(\"projectDir\", {\n alias: [\"project\"],\n group: buildGroup,\n description: \"The path to project directory. Defaults to current working directory.\",\n })\n .option(\"config\", {\n alias: [\"c\"],\n group: buildGroup,\n description:\n \"The path to an electron-builder config. Defaults to `electron-builder.yml` (or `json`, or `json5`, or `js`, or `ts`), see \" +\n chalk.underline(\"https://www.electron.build/configuration\"),\n })\n .group([\"help\", \"version\"], \"Other:\")\n .example(\"electron-builder -mwl\", \"build for macOS, Windows and Linux\")\n .example(\"electron-builder --linux deb tar.xz\", \"build deb and tar.xz for Linux\")\n .example(\"electron-builder --win --ia32\", \"build for Windows ia32\")\n .example(\"electron-builder -c.extraMetadata.foo=bar\", \"set package.json property `foo` to `bar`\")\n .example(\"electron-builder --config.nsis.unicode=false\", \"configure unicode options for NSIS\")\n}\n"]}
|
|
1
|
+
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,MAAM,EAAiB,UAAU,EAAE,QAAQ,EAAmB,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACjH,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,MAA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,GAAG,CAAC;QACZ,KAAK,EAAE,UAAU;QACjB,WAAW,EACT,4HAA4H;YAC5H,KAAK,CAAC,SAAS,CAAC,0CAA0C,CAAC;KAC9D,CAAC;SACD,KAAK,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,QAAQ,CAAC;SACpC,OAAO,CAAC,uBAAuB,EAAE,oCAAoC,CAAC;SACtE,OAAO,CAAC,qCAAqC,EAAE,gCAAgC,CAAC;SAChF,OAAO,CAAC,gCAAgC,EAAE,yBAAyB,CAAC;SACpE,OAAO,CAAC,2CAA2C,EAAE,0CAA0C,CAAC;SAChG,OAAO,CAAC,8CAA8C,EAAE,oCAAoC,CAAC,CAAA;AAClG,CAAC","sourcesContent":["import { build as _build, Configuration, DIR_TARGET, Packager, PackagerOptions, Platform } from \"app-builder-lib\"\nimport { addTargetsForPlatform } from \"app-builder-lib/internal\"\nimport { Arch, archFromString, log } from \"builder-util\"\nimport { deepAssign } from \"builder-util-runtime\"\nimport chalk from \"chalk\"\nimport type { PublishOptions } from \"electron-publish\"\nimport { hideBin } from \"yargs/helpers\"\nimport * as yargs from \"yargs\"\n\nexport function createYargs(): yargs.Argv<unknown> {\n // In ESM, yargs.default is the factory function; call it to create an instance.\n // In CJS, yargs.default is already an Argv singleton.\n const factory = (yargs as any).default ?? yargs\n const instance = typeof factory?.parserConfiguration === \"function\" ? factory : factory(hideBin(process.argv))\n return (instance as unknown as yargs.Argv<unknown>).parserConfiguration({\n \"camel-case-expansion\": false,\n })\n}\n\nexport interface BuildOptions extends PackagerOptions, PublishOptions {}\n\nexport interface CliOptions extends PackagerOptions, PublishOptions {\n x64?: boolean\n ia32?: boolean\n armv7l?: boolean\n arm64?: boolean\n universal?: boolean\n\n dir?: boolean\n}\n\n/** @private */\nexport function normalizeOptions(args: CliOptions): BuildOptions {\n if (args.targets != null) {\n return args\n }\n\n const targets = new Map<Platform, Map<Arch, Array<string>>>()\n\n function processTargets(platform: Platform, types: Array<string>) {\n function commonArch(currentIfNotSpecified: boolean): Array<Arch> {\n const result = Array<Arch>()\n if (args.x64) {\n result.push(Arch.x64)\n }\n if (args.armv7l) {\n result.push(Arch.armv7l)\n }\n if (args.arm64) {\n result.push(Arch.arm64)\n }\n if (args.ia32) {\n result.push(Arch.ia32)\n }\n if (args.universal) {\n result.push(Arch.universal)\n }\n\n return result.length === 0 && currentIfNotSpecified ? [archFromString(process.arch)] : result\n }\n\n addTargetsForPlatform(targets, platform, types, commonArch, archToType => {\n const defaultTargetValue = args.dir ? [DIR_TARGET] : []\n for (const arch of commonArch(args.dir === true)) {\n archToType.set(arch, defaultTargetValue)\n }\n })\n }\n\n if (args.mac != null) {\n processTargets(Platform.MAC, args.mac)\n }\n\n if (args.linux != null) {\n processTargets(Platform.LINUX, args.linux)\n }\n\n if (args.win != null) {\n processTargets(Platform.WINDOWS, args.win)\n }\n\n if (targets.size === 0) {\n processTargets(Platform.current(), [])\n }\n\n const result: any = { ...args }\n result.targets = targets\n\n delete result.dir\n delete result.mac\n delete result.linux\n delete result.win\n\n const r = result\n delete r.m\n delete r.o\n delete r.l\n delete r.w\n delete r.windows\n delete r.macos\n delete r.$0\n delete r._\n delete r.version\n delete r.help\n delete r.c\n delete r.p\n delete r.pd\n\n delete result.ia32\n delete result.x64\n delete result.armv7l\n delete result.arm64\n delete result.universal\n\n let config = result.config\n\n // config is array when combining dot-notation values with a config file value\n // https://github.com/electron-userland/electron-builder/issues/2016\n if (Array.isArray(config)) {\n const newConfig: Configuration = {}\n for (const configItem of config) {\n if (typeof configItem === \"object\") {\n deepAssign(newConfig, configItem)\n } else if (typeof configItem === \"string\") {\n newConfig.extends = configItem\n }\n }\n\n config = newConfig\n result.config = newConfig\n }\n\n // AJV cannot coerce \"null\" string to null if string is also allowed (because null string is a valid value)\n if (config != null && typeof config !== \"string\") {\n if (config.extraMetadata != null) {\n coerceTypes(config.extraMetadata)\n }\n\n // mac.sign / mac.universal are nested option bags holding booleans and the signing identity\n // (e.g. sign.identity, sign.hardenedRuntime, universal.mergeASARs). coerceValue recurses into the\n // objects (so `-c.mac.sign.identity=null` disables code signing) and also handles `-c.mac.sign=null`.\n if (config.mac != null) {\n coerceValue(config.mac, \"sign\")\n coerceValue(config.mac, \"universal\")\n }\n\n // `-c.updateManifest=false` is the signing opt-out and arrives as the string \"false\"; ajv does not write a\n // coerced value back out of an `anyOf` branch, so without this the opt-out is silently ignored and the build\n // fails demanding a signing key. coerceValue recurses into objects, so `-c.updateManifest.signingKeyFile=...`\n // still works. (`mas` / `masDev` are omitted on purpose - PlatformPackager never reads updateManifest there.)\n coerceValue(config, \"updateManifest\")\n for (const platform of [\"mac\", \"win\", \"linux\"]) {\n const platformConfig = config[platform]\n if (platformConfig != null && typeof platformConfig === \"object\") {\n coerceValue(platformConfig, \"updateManifest\")\n }\n }\n\n // fix Boolean type by coerceTypes\n if (config.nsis != null) {\n coerceTypes(config.nsis)\n }\n if (config.nsisWeb != null) {\n coerceTypes(config.nsisWeb)\n }\n }\n\n if (\"project\" in r && !(\"projectDir\" in result)) {\n result.projectDir = r.project\n }\n delete r.project\n\n return result as BuildOptions\n}\n\nfunction coerceValue(host: any, key: string): void {\n const value = host[key]\n if (value === \"true\") {\n host[key] = true\n } else if (value === \"false\") {\n host[key] = false\n } else if (value === \"null\") {\n host[key] = null\n } else if (key === \"version\" && typeof value === \"number\") {\n host[key] = value.toString()\n } else if (value != null && typeof value === \"object\") {\n coerceTypes(value)\n }\n}\n\n/** @private */\nexport function coerceTypes(host: any): any {\n for (const key of Object.getOwnPropertyNames(host)) {\n coerceValue(host, key)\n }\n return host\n}\n\n/** Emitted once per process — createTargets is called per invocation, not per platform. */\nlet archAllWarningEmitted = false\n\n/**\n * `arch: \"all\"` dropped ia32 in v27. The build stays green and simply produces no 32-bit artifact\n * (plus an unexpected arm64 one), so the only evidence is a missing file in dist — nothing ties that\n * back to the upgrade.\n */\nfunction warnAboutArchAllExpansion(platforms: Array<Platform>): void {\n if (archAllWarningEmitted || !platforms.some(platform => platform !== Platform.MAC)) {\n return\n }\n archAllWarningEmitted = true\n log.warn(\n { expandsTo: \"x64, arm64\", previously: \"x64, ia32\", solution: \"request ia32 explicitly (--ia32 / Arch.ia32) with electronVersion <= 43.x if you still ship 32-bit builds\" },\n 'arch \"all\" no longer includes ia32. Electron 44 removed Windows ia32 builds and Linux ia32 zips ended at Electron 19, so the old expansion produced broken builds on current Electron. ' +\n \"See https://www.electron.build/docs/migration/v27-breaking-changes#arch-all-now-expands-to-x64-and-arm64-32-bit-fails-fast-on-electron-44\"\n )\n}\n\nexport function createTargets(platforms: Array<Platform>, type?: string | null, arch?: string | null): Map<Platform, Map<Arch, Array<string>>> {\n const targets = new Map<Platform, Map<Arch, Array<string>>>()\n if (arch === \"all\") {\n warnAboutArchAllExpansion(platforms)\n }\n for (const platform of platforms) {\n const archs =\n // BREAKING: since Electron 44 removed Windows ia32 and Linux armv7l builds (and linux-ia32 zips ended at Electron 19),\n // \"all\" expands to x64 + arm64 on non-mac platforms instead of x64 + ia32. Request ia32 explicitly to build it (Electron <= 43 only).\n arch === \"all\" ? (platform === Platform.MAC ? [Arch.x64, Arch.arm64, Arch.universal] : [Arch.x64, Arch.arm64]) : [archFromString(arch == null ? process.arch : arch)]\n const archToType = new Map<Arch, Array<string>>()\n targets.set(platform, archToType)\n\n for (const arch of archs) {\n archToType.set(arch, type == null ? [] : [type])\n }\n }\n return targets\n}\n\nexport function build(rawOptions?: CliOptions): Promise<Array<string>> {\n const buildOptions = normalizeOptions(rawOptions || {})\n return _build(buildOptions, new Packager(buildOptions))\n}\n\n/**\n * @private\n */\nexport function configureBuildCommand(yargs: yargs.Argv): yargs.Argv {\n const publishGroup = \"Publishing:\"\n const buildGroup = \"Building:\"\n return yargs\n .option(\"mac\", {\n group: buildGroup,\n alias: [\"m\", \"o\", \"macos\"],\n description: `Build for macOS, accepts target list (see ${chalk.underline(\"https://www.electron.build/mac\")}).`,\n type: \"array\",\n })\n .option(\"linux\", {\n group: buildGroup,\n alias: \"l\",\n description: `Build for Linux, accepts target list (see ${chalk.underline(\"https://www.electron.build/linux\")})`,\n type: \"array\",\n })\n .option(\"win\", {\n group: buildGroup,\n alias: [\"w\", \"windows\"],\n description: `Build for Windows, accepts target list (see ${chalk.underline(\"https://www.electron.build/win\")})`,\n type: \"array\",\n })\n .option(\"x64\", {\n group: buildGroup,\n description: \"Build for x64\",\n type: \"boolean\",\n })\n .option(\"ia32\", {\n group: buildGroup,\n description: \"Build for ia32\",\n type: \"boolean\",\n })\n .option(\"armv7l\", {\n group: buildGroup,\n description: \"Build for armv7l\",\n type: \"boolean\",\n })\n .option(\"arm64\", {\n group: buildGroup,\n description: \"Build for arm64\",\n type: \"boolean\",\n })\n .option(\"universal\", {\n group: buildGroup,\n description: \"Build for universal\",\n type: \"boolean\",\n })\n .option(\"dir\", {\n group: buildGroup,\n description: \"Build unpacked dir. Useful to test.\",\n type: \"boolean\",\n })\n .option(\"publish\", {\n group: publishGroup,\n alias: \"p\",\n description: `Publish artifacts, see ${chalk.underline(\"https://www.electron.build/publish\")}`,\n choices: [\"onTag\", \"onTagOrDraft\", \"always\", \"never\", undefined as any],\n })\n .option(\"prepackaged\", {\n alias: [\"pd\"],\n group: buildGroup,\n description: \"The path to prepackaged app (to pack in a distributable format)\",\n })\n .option(\"projectDir\", {\n alias: [\"project\"],\n group: buildGroup,\n description: \"The path to project directory. Defaults to current working directory.\",\n })\n .option(\"config\", {\n alias: [\"c\"],\n group: buildGroup,\n description:\n \"The path to an electron-builder config. Defaults to `electron-builder.yml` (or `json`, or `json5`, or `js`, or `ts`), see \" +\n chalk.underline(\"https://www.electron.build/configuration\"),\n })\n .group([\"help\", \"version\"], \"Other:\")\n .example(\"electron-builder -mwl\", \"build for macOS, Windows and Linux\")\n .example(\"electron-builder --linux deb tar.xz\", \"build deb and tar.xz for Linux\")\n .example(\"electron-builder --win --arm64\", \"build for Windows arm64\")\n .example(\"electron-builder -c.extraMetadata.foo=bar\", \"set package.json property `foo` to `bar`\")\n .example(\"electron-builder --config.nsis.unicode=false\", \"configure unicode options for NSIS\")\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clear-cache.d.ts","sourceRoot":"","sources":["../../src/cli/clear-cache.ts"],"names":[],"mappings":"AAMA,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"clear-cache.d.ts","sourceRoot":"","sources":["../../src/cli/clear-cache.ts"],"names":[],"mappings":"AAMA,wBAAsB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAsChD"}
|
package/dist/cli/clear-cache.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getCacheDirectoryInternal } from "app-builder-lib/internal";
|
|
2
2
|
import { log } from "builder-util";
|
|
3
3
|
import { access, constants, rm } from "fs/promises";
|
|
4
4
|
import { createInterface } from "node:readline/promises";
|
|
5
5
|
import * as path from "path";
|
|
6
6
|
export async function clearCache() {
|
|
7
|
-
|
|
7
|
+
// Clear the real default cache (ignore the ELECTRON_BUILDER_CACHE override, and don't avoid the
|
|
8
|
+
// Windows system path) so `clear-cache` targets the same dir builds actually populate.
|
|
9
|
+
const cacheDir = await getCacheDirectoryInternal({ isAvoidSystemOnWindows: false, allowEnvVarOverride: false });
|
|
8
10
|
if (cacheDir === path.parse(cacheDir).root) {
|
|
9
11
|
log.error({ cacheDir }, "cache directory resolves to a filesystem root — aborting");
|
|
10
12
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clear-cache.js","sourceRoot":"","sources":["../../src/cli/clear-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"clear-cache.js","sourceRoot":"","sources":["../../src/cli/clear-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAClC,OAA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,CAAC;QACH,MAAM,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,kBAAkB,QAAQ,UAAU,CAAC,CAAA;IAClE,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,KAAK,EAAE,CAAA;IACZ,CAAC;IACD,IAAI,MAAO,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,GAAG,IAAI,MAAO,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE,CAAC;QACnF,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QACzB,OAAM;IACR,CAAC;IAED,GAAG,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,EAAE,gBAAgB,CAAC,CAAA;IACxC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IACvC,GAAG,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,EAAE,eAAe,CAAC,CAAA;AACzC,CAAC","sourcesContent":["import { getCacheDirectoryInternal } from \"app-builder-lib/internal\"\nimport { log } from \"builder-util\"\nimport { access, constants, rm } from \"fs/promises\"\nimport { createInterface } from \"node:readline/promises\"\nimport * as path from \"path\"\n\nexport async function clearCache(): Promise<void> {\n // Clear the real default cache (ignore the ELECTRON_BUILDER_CACHE override, and don't avoid the\n // Windows system path) so `clear-cache` targets the same dir builds actually populate.\n const cacheDir = await getCacheDirectoryInternal({ isAvoidSystemOnWindows: false, allowEnvVarOverride: false })\n\n if (cacheDir === path.parse(cacheDir).root) {\n log.error({ cacheDir }, \"cache directory resolves to a filesystem root — aborting\")\n return\n }\n\n try {\n await access(cacheDir, constants.F_OK | constants.W_OK)\n } catch (err: any) {\n if (err.code === \"ENOENT\") {\n log.info({ cacheDir }, \"cache directory does not exist, nothing to clear\")\n } else if (err.code === \"EACCES\" || err.code === \"EPERM\") {\n log.error({ cacheDir }, \"cache directory is not writable\")\n } else {\n throw err\n }\n return\n }\n\n const rl = createInterface({ input: process.stdin, output: process.stdout })\n let answer: string\n try {\n answer = await rl.question(`Clear cache at ${cacheDir}? [y/N] `)\n } finally {\n rl.close()\n }\n if (answer!.trim().toLowerCase() !== \"y\" && answer!.trim().toLowerCase() !== \"yes\") {\n log.info(null, \"aborted\")\n return\n }\n\n log.info({ cacheDir }, \"clearing cache\")\n await rm(cacheDir, { recursive: true })\n log.info({ cacheDir }, \"cache cleared\")\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-util.d.ts","sourceRoot":"","sources":["../../src/cli/cli-util.ts"],"names":[],"mappings":"AAQA,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"cli-util.d.ts","sourceRoot":"","sources":["../../src/cli/cli-util.ts"],"names":[],"mappings":"AAQA,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAcrD;AAED,wBAAgB,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,IAC5C,MAAM,GAAG,kBAelB"}
|
package/dist/cli/cli-util.js
CHANGED
|
@@ -12,7 +12,9 @@ export async function checkIsOutdated() {
|
|
|
12
12
|
if (pkg.version === "0.0.0-semantic-release") {
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
// simple-update-notifier is CJS with `export { fn as default }`; under nodenext a dynamic import
|
|
16
|
+
// types `.default` as the namespace wrapper rather than the function, so assert the real shape.
|
|
17
|
+
const { default: UpdateNotifier } = (await import("simple-update-notifier"));
|
|
16
18
|
await UpdateNotifier({ pkg });
|
|
17
19
|
}
|
|
18
20
|
export function wrap(task) {
|
package/dist/cli/cli-util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-util.js","sourceRoot":"","sources":["../../src/cli/cli-util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BA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CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;gBACjE,GAAG,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;YAC9E,CAAC;QACH,CAAC,CAAC,CAAA;IACN,CAAC,CAAA;AACH,CAAC","sourcesContent":["import { loadEnv } from \"app-builder-lib/internal\"\nimport { ExecError, InvalidConfigurationError, log } from \"builder-util\"\nimport { isCI } from \"ci-info\"\n\nimport * as path from \"path\"\nimport _fsExtra from \"fs-extra\"\nconst { readJson } = _fsExtra\n\nexport async function checkIsOutdated(): Promise<void> {\n if (isCI || process.env.NO_UPDATE_NOTIFIER != null) {\n return\n }\n const pkg = await readJson(path.join(import.meta.dirname, \"..\", \"..\", \"package.json\"))\n if (pkg.version === \"0.0.0-semantic-release\") {\n return\n }\n // simple-update-notifier is CJS with `export { fn as default }`; under nodenext a dynamic import\n // types `.default` as the namespace wrapper rather than the function, so assert the real shape.\n const { default: UpdateNotifier } = (await import(\"simple-update-notifier\")) as unknown as {\n default: (args: { pkg: { name: string; version: string } }) => Promise<void>\n }\n await UpdateNotifier({ pkg })\n}\n\nexport function wrap(task: (args: any) => Promise<any>) {\n return (args: any) => {\n checkIsOutdated().catch((e: any) => log.warn({ error: e }, \"cannot check updates\"))\n return loadEnv(path.join(process.cwd(), \"electron-builder.env\"))\n .then(() => task(args))\n .catch(error => {\n process.exitCode = 1\n // https://github.com/electron-userland/electron-builder/issues/2940\n process.on(\"exit\", () => (process.exitCode = 1))\n if (error instanceof InvalidConfigurationError) {\n log.error(null, error.message)\n } else if (!(error instanceof ExecError) || !error.alreadyLogged) {\n log.error({ failedTask: task.name, stackTrace: error.stack }, error.message)\n }\n })\n }\n}\n"]}
|
package/dist/cli/cli.js
CHANGED
|
@@ -6,6 +6,7 @@ import { configurePublishCommand, publish } from "../publish.js";
|
|
|
6
6
|
import { clearCache } from "./clear-cache.js";
|
|
7
7
|
import { wrap } from "./cli-util.js";
|
|
8
8
|
import { createSelfSignedCert } from "./create-self-signed-cert.js";
|
|
9
|
+
import { createUpdateKey } from "./create-update-key.js";
|
|
9
10
|
import { configureInstallAppDepsCommand, installAppDeps } from "./install-app-deps.js";
|
|
10
11
|
import { configureMigrateSchemaCommand, migrateSchema } from "./migrate-schema.js";
|
|
11
12
|
import { start } from "./start.js";
|
|
@@ -25,6 +26,12 @@ void createYargs()
|
|
|
25
26
|
.demandOption("publisher"), wrap(argv => createSelfSignedCert(argv.publisher)))
|
|
26
27
|
.command("start", "Run application in a development mode using electron-webpack", yargs => yargs, wrap(() => start()))
|
|
27
28
|
.command("clear-cache", "Clear the electron-builder default cache directory", yargs => yargs, wrap(() => clearCache()))
|
|
29
|
+
.command("create-update-key", "Generate an Ed25519 keypair for signing auto-update manifests", yargs => yargs.option("out", {
|
|
30
|
+
alias: ["o"],
|
|
31
|
+
type: "string",
|
|
32
|
+
requiresArg: true,
|
|
33
|
+
description: "Path to write the private key PEM (default: ./update-private-key.pem)",
|
|
34
|
+
}), wrap(argv => createUpdateKey(argv.out)))
|
|
28
35
|
.command("migrate-schema", "Migrate build config from v26 to v27 format", configureMigrateSchemaCommand, wrap(migrateSchema))
|
|
29
36
|
.help()
|
|
30
37
|
.epilog(`See ${chalk.underline("https://electron.build")} for more documentation.`)
|
package/dist/cli/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AACzE,OAAO,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAChE,OAAO,EAAE,U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,OAAO,CACN,aAAa,EACb,oDAAoD,EACpD,KAAK,CAAC,EAAE,CAAC,KAAK,EACd,IAAI,CAAC,GAAG,EAAE,CAAC,UAAU,EAAE,CAAC,CACzB;KACA,OAAO,CAAC,gBAAgB,EAAE,6CAA6C,EAAE,6BAA6B,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;KAC5H,IAAI,EAAE;KACN,MAAM,CAAC,OAAO,KAAK,CAAC,SAAS,CAAC,wBAAwB,CAAC,0BAA0B,CAAC;KAClF,MAAM,EAAE;KACR,iBAAiB,EAAE,CAAC,IAAI,CAAA;AAE3B,KAAK,UAAU,oBAAoB,CAAC,IAAS;IAC3C,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;IAChC,6CAA6C;IAC7C,OAAO,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC,UAAU,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAA;AACzH,CAAC","sourcesContent":["#! /usr/bin/env node\n\nimport { getElectronVersion, nodeGypRebuild } from \"app-builder-lib/internal\"\nimport chalk from \"chalk\"\nimport { build, configureBuildCommand, createYargs } from \"../builder.js\"\nimport { configurePublishCommand, publish } from \"../publish.js\"\nimport { clearCache } from \"./clear-cache.js\"\nimport { wrap } from \"./cli-util.js\"\nimport { createSelfSignedCert } from \"./create-self-signed-cert.js\"\nimport { configureInstallAppDepsCommand, installAppDeps } from \"./install-app-deps.js\"\nimport { configureMigrateSchemaCommand, migrateSchema } from \"./migrate-schema.js\"\nimport { start } from \"./start.js\"\n\n// tslint:disable:no-unused-expression\nvoid createYargs()\n .command([\"build\", \"*\"], \"Build\", configureBuildCommand, wrap(build))\n .command(\"install-app-deps\", \"Install app deps\", configureInstallAppDepsCommand, wrap(installAppDeps))\n .command(\"node-gyp-rebuild\", \"Rebuild own native code\", configureInstallAppDepsCommand /* yes, args the same as for install app deps */, wrap(rebuildAppNativeCode))\n .command(\"publish\", \"Publish a list of artifacts\", configurePublishCommand, wrap(publish))\n .command(\n \"create-self-signed-cert\",\n \"Create self-signed code signing cert for Windows apps\",\n yargs =>\n yargs\n .option(\"publisher\", {\n alias: [\"p\"],\n type: \"string\",\n requiresArg: true,\n description: \"The publisher name\",\n })\n .demandOption(\"publisher\"),\n wrap(argv => createSelfSignedCert(argv.publisher))\n )\n .command(\n \"start\",\n \"Run application in a development mode using electron-webpack\",\n yargs => yargs,\n wrap(() => start())\n )\n .command(\n \"clear-cache\",\n \"Clear the electron-builder default cache directory\",\n yargs => yargs,\n wrap(() => clearCache())\n )\n .command(\"migrate-schema\", \"Migrate build config from v26 to v27 format\", configureMigrateSchemaCommand, wrap(migrateSchema))\n .help()\n .epilog(`See ${chalk.underline(\"https://electron.build\")} for more documentation.`)\n .strict()\n .recommendCommands().argv\n\nasync function rebuildAppNativeCode(args: any) {\n const projectDir = process.cwd()\n // this script must be used only for electron\n return nodeGypRebuild(args.platform, args.arch, { version: await getElectronVersion(projectDir), useCustomDist: true })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AACzE,OAAO,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,8BAA8B,EAAE,cAAc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,KAAK,CAAC,EAAE,CACN,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE;IAClB,KAAK,EAAE,CAAC,GAAG,CAAC;IACZ,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE,uEAAuE;CACrF,CAAC,EACJ,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CACxC;KACA,OAAO,CAAC,gBAAgB,EAAE,6CAA6C,EAAE,6BAA6B,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;KAC5H,IAAI,EAAE;KACN,MAAM,CAAC,OAAO,KAAK,CAAC,SAAS,CAAC,wBAAwB,CAAC,0BAA0B,CAAC;KAClF,MAAM,EAAE;KACR,iBAAiB,EAAE,CAAC,IAAI,CAAA;AAE3B,KAAK,UAAU,oBAAoB,CAAC,IAAS;IAC3C,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;IAChC,6CAA6C;IAC7C,OAAO,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC,UAAU,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAA;AACzH,CAAC","sourcesContent":["#! /usr/bin/env node\n\nimport { getElectronVersion, nodeGypRebuild } from \"app-builder-lib/internal\"\nimport chalk from \"chalk\"\nimport { build, configureBuildCommand, createYargs } from \"../builder.js\"\nimport { configurePublishCommand, publish } from \"../publish.js\"\nimport { clearCache } from \"./clear-cache.js\"\nimport { wrap } from \"./cli-util.js\"\nimport { createSelfSignedCert } from \"./create-self-signed-cert.js\"\nimport { createUpdateKey } from \"./create-update-key.js\"\nimport { configureInstallAppDepsCommand, installAppDeps } from \"./install-app-deps.js\"\nimport { configureMigrateSchemaCommand, migrateSchema } from \"./migrate-schema.js\"\nimport { start } from \"./start.js\"\n\n// tslint:disable:no-unused-expression\nvoid createYargs()\n .command([\"build\", \"*\"], \"Build\", configureBuildCommand, wrap(build))\n .command(\"install-app-deps\", \"Install app deps\", configureInstallAppDepsCommand, wrap(installAppDeps))\n .command(\"node-gyp-rebuild\", \"Rebuild own native code\", configureInstallAppDepsCommand /* yes, args the same as for install app deps */, wrap(rebuildAppNativeCode))\n .command(\"publish\", \"Publish a list of artifacts\", configurePublishCommand, wrap(publish))\n .command(\n \"create-self-signed-cert\",\n \"Create self-signed code signing cert for Windows apps\",\n yargs =>\n yargs\n .option(\"publisher\", {\n alias: [\"p\"],\n type: \"string\",\n requiresArg: true,\n description: \"The publisher name\",\n })\n .demandOption(\"publisher\"),\n wrap(argv => createSelfSignedCert(argv.publisher))\n )\n .command(\n \"start\",\n \"Run application in a development mode using electron-webpack\",\n yargs => yargs,\n wrap(() => start())\n )\n .command(\n \"clear-cache\",\n \"Clear the electron-builder default cache directory\",\n yargs => yargs,\n wrap(() => clearCache())\n )\n .command(\n \"create-update-key\",\n \"Generate an Ed25519 keypair for signing auto-update manifests\",\n yargs =>\n yargs.option(\"out\", {\n alias: [\"o\"],\n type: \"string\",\n requiresArg: true,\n description: \"Path to write the private key PEM (default: ./update-private-key.pem)\",\n }),\n wrap(argv => createUpdateKey(argv.out))\n )\n .command(\"migrate-schema\", \"Migrate build config from v26 to v27 format\", configureMigrateSchemaCommand, wrap(migrateSchema))\n .help()\n .epilog(`See ${chalk.underline(\"https://electron.build\")} for more documentation.`)\n .strict()\n .recommendCommands().argv\n\nasync function rebuildAppNativeCode(args: any) {\n const projectDir = process.cwd()\n // this script must be used only for electron\n return nodeGypRebuild(args.platform, args.arch, { version: await getElectronVersion(projectDir), useCustomDist: true })\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getWindowsKitsBundle } from "app-builder-lib/internal";
|
|
2
|
-
import {
|
|
2
|
+
import { exec, log, spawn, TmpDir, unlinkIfExists } from "builder-util";
|
|
3
3
|
import { sanitizeFileName } from "builder-util/internal";
|
|
4
4
|
import chalk from "chalk";
|
|
5
5
|
import { mkdir } from "fs/promises";
|
|
@@ -14,12 +14,12 @@ export async function createSelfSignedCert(publisher) {
|
|
|
14
14
|
log.info(chalk.bold('When asked to enter a password ("Create Private Key Password"), please select "None".'));
|
|
15
15
|
try {
|
|
16
16
|
await mkdir(path.dirname(tempPrefix), { recursive: true });
|
|
17
|
-
const vendorPath = (await getWindowsKitsBundle({ winCodeSign:
|
|
17
|
+
const vendorPath = (await getWindowsKitsBundle({ winCodeSign: "latest" })).kit;
|
|
18
18
|
await exec(path.join(vendorPath, "makecert.exe"), ["-r", "-h", "0", "-n", `CN=${quoteString(publisher)}`, "-eku", "1.3.6.1.5.5.7.3.3", "-pe", "-sv", pvk, cer]);
|
|
19
19
|
const pfx = path.join(targetDir, `${sanitizeFileName(publisher)}.pfx`);
|
|
20
20
|
await unlinkIfExists(pfx);
|
|
21
21
|
await exec(path.join(vendorPath, "pvk2pfx.exe"), ["-pvk", pvk, "-spc", cer, "-pfx", pfx]);
|
|
22
|
-
log.info({ file: pfx }, `created. Please see https://electron.build/code-signing how to use it to sign.`);
|
|
22
|
+
log.info({ file: pfx }, `created. Please see https://electron.build/docs/features/code-signing how to use it to sign.`);
|
|
23
23
|
const certLocation = "Cert:\\LocalMachine\\TrustedPeople";
|
|
24
24
|
log.info({ file: pfx, certLocation }, `importing. Operation will be succeed only if runned from root. Otherwise import file manually.`);
|
|
25
25
|
await spawn("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", "Import-PfxCertificate", "-FilePath", `"${pfx}"`, "-CertStoreLocation", certLocation]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-self-signed-cert.js","sourceRoot":"","sources":["../../src/cli/create-self-signed-cert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"create-self-signed-cert.js","sourceRoot":"","sources":["../../src/cli/create-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CAAC","sourcesContent":["import { getWindowsKitsBundle } from \"app-builder-lib/internal\"\nimport { exec, log, spawn, TmpDir, unlinkIfExists } from \"builder-util\"\nimport { sanitizeFileName } from \"builder-util/internal\"\nimport chalk from \"chalk\"\nimport { mkdir } from \"fs/promises\"\nimport * as path from \"path\"\n\n/** @internal */\nexport async function createSelfSignedCert(publisher: string) {\n const tmpDir = new TmpDir(\"create-self-signed-cert\")\n const targetDir = process.cwd()\n const tempPrefix = path.join(await tmpDir.getTempDir({ prefix: \"self-signed-cert-creator\" }), sanitizeFileName(publisher))\n const cer = `${tempPrefix}.cer`\n const pvk = `${tempPrefix}.pvk`\n\n log.info(chalk.bold('When asked to enter a password (\"Create Private Key Password\"), please select \"None\".'))\n\n try {\n await mkdir(path.dirname(tempPrefix), { recursive: true })\n const vendorPath = (await getWindowsKitsBundle({ winCodeSign: \"latest\" })).kit\n await exec(path.join(vendorPath, \"makecert.exe\"), [\"-r\", \"-h\", \"0\", \"-n\", `CN=${quoteString(publisher)}`, \"-eku\", \"1.3.6.1.5.5.7.3.3\", \"-pe\", \"-sv\", pvk, cer])\n\n const pfx = path.join(targetDir, `${sanitizeFileName(publisher)}.pfx`)\n await unlinkIfExists(pfx)\n await exec(path.join(vendorPath, \"pvk2pfx.exe\"), [\"-pvk\", pvk, \"-spc\", cer, \"-pfx\", pfx])\n log.info({ file: pfx }, `created. Please see https://electron.build/docs/features/code-signing how to use it to sign.`)\n\n const certLocation = \"Cert:\\\\LocalMachine\\\\TrustedPeople\"\n log.info({ file: pfx, certLocation }, `importing. Operation will be succeed only if runned from root. Otherwise import file manually.`)\n await spawn(\"powershell.exe\", [\"-NoProfile\", \"-NonInteractive\", \"-Command\", \"Import-PfxCertificate\", \"-FilePath\", `\"${pfx}\"`, \"-CertStoreLocation\", certLocation])\n } finally {\n await tmpDir.cleanup()\n }\n}\n\nexport function quoteString(s: string): string {\n if (!s.includes(\",\") && !s.includes('\"')) {\n return s\n }\n\n return `\"${s.replace(/\"/g, '\\\\\"')}\"`\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-update-key.d.ts","sourceRoot":"","sources":["../../src/cli/create-update-key.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { generateUpdateSigningKeypair, InvalidConfigurationError, log } from "builder-util";
|
|
2
|
+
import { computeUpdateManifestKeyId } from "builder-util-runtime";
|
|
3
|
+
import chalk from "chalk";
|
|
4
|
+
import { writeFile } from "fs/promises";
|
|
5
|
+
import * as path from "path";
|
|
6
|
+
/**
|
|
7
|
+
* Generates an Ed25519 keypair for signing auto-update manifests (A1).
|
|
8
|
+
* Writes the private key to a new 0600 file and prints the public key to embed in build config.
|
|
9
|
+
* Refuses to overwrite an existing file: a plain overwrite would silently replace a key that may already be
|
|
10
|
+
* in use and would keep the old file's (possibly wider) permissions.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export async function createUpdateKey(outFile) {
|
|
14
|
+
const { publicKeyPem, privateKeyPem } = generateUpdateSigningKeypair();
|
|
15
|
+
const privateKeyPath = path.resolve(outFile || "update-private-key.pem");
|
|
16
|
+
try {
|
|
17
|
+
// "wx" creates the file exclusively, so the 0600 mode is always applied to a fresh file
|
|
18
|
+
await writeFile(privateKeyPath, privateKeyPem + "\n", { mode: 0o600, flag: "wx" });
|
|
19
|
+
}
|
|
20
|
+
catch (e) {
|
|
21
|
+
if (e?.code === "EEXIST") {
|
|
22
|
+
throw new InvalidConfigurationError(`Refusing to overwrite existing key file ${privateKeyPath}; delete it or pass a different --out path`);
|
|
23
|
+
}
|
|
24
|
+
throw e;
|
|
25
|
+
}
|
|
26
|
+
log.info({ file: privateKeyPath }, "Ed25519 private key written (keep this secret — store it in a CI secret)");
|
|
27
|
+
log.info(null, `Provide it at publish time via the ${chalk.bold("ELECTRON_BUILDER_UPDATE_SIGN_KEY")} (PEM literal) or ${chalk.bold("ELECTRON_BUILDER_UPDATE_SIGN_KEY_FILE")} (path) environment variable.`);
|
|
28
|
+
log.info(null, "The matching public key is embedded into app-update.yml automatically; you do not need to configure it manually.\n");
|
|
29
|
+
const keyId = computeUpdateManifestKeyId(publicKeyPem);
|
|
30
|
+
process.stdout.write(`${chalk.bold("Public key")} (for reference — auto-embedded into app-update.yml):\n${publicKeyPem}\n`);
|
|
31
|
+
process.stdout.write(`${chalk.bold("Key id")} (appears as \`keyId\` in the \`signatures\` list of each signed latest*.yml):\n${keyId}\n`);
|
|
32
|
+
return { privateKeyPath, publicKeyPem, keyId };
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=create-update-key.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-update-key.js","sourceRoot":"","sources":["../../src/cli/create-update-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,yBAAyB,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAC3F,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,OAAgB;IACpD,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,4BAA4B,EAAE,CAAA;IAEtE,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,wBAAwB,CAAC,CAAA;IACxE,IAAI,CAAC;QACH,wFAAwF;QACxF,MAAM,SAAS,CAAC,cAAc,EAAE,aAAa,GAAG,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;IACpF,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,IAAI,CAAC,EAAE,IAAI,KAAK,QAAQ,EAAE,CAAC;YACzB,MAAM,IAAI,yBAAyB,CAAC,2CAA2C,cAAc,4CAA4C,CAAC,CAAA;QAC5I,CAAC;QACD,MAAM,CAAC,CAAA;IACT,CAAC;IAED,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,0EAA0E,CAAC,CAAA;IAC9G,GAAG,CAAC,IAAI,CACN,IAAI,EACJ,sCAAsC,KAAK,CAAC,IAAI,CAAC,kCAAkC,CAAC,qBAAqB,KAAK,CAAC,IAAI,CAAC,uCAAuC,CAAC,+BAA+B,CAC5L,CAAA;IACD,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,oHAAoH,CAAC,CAAA;IAEpI,MAAM,KAAK,GAAG,0BAA0B,CAAC,YAAY,CAAC,CAAA;IACtD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,0DAA0D,YAAY,IAAI,CAAC,CAAA;IAC3H,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,mFAAmF,KAAK,IAAI,CAAC,CAAA;IACzI,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,KAAK,EAAE,CAAA;AAChD,CAAC","sourcesContent":["import { generateUpdateSigningKeypair, InvalidConfigurationError, log } from \"builder-util\"\nimport { computeUpdateManifestKeyId } from \"builder-util-runtime\"\nimport chalk from \"chalk\"\nimport { writeFile } from \"fs/promises\"\nimport * as path from \"path\"\n\n/**\n * Generates an Ed25519 keypair for signing auto-update manifests (A1).\n * Writes the private key to a new 0600 file and prints the public key to embed in build config.\n * Refuses to overwrite an existing file: a plain overwrite would silently replace a key that may already be\n * in use and would keep the old file's (possibly wider) permissions.\n * @internal\n */\nexport async function createUpdateKey(outFile?: string): Promise<{ privateKeyPath: string; publicKeyPem: string; keyId: string }> {\n const { publicKeyPem, privateKeyPem } = generateUpdateSigningKeypair()\n\n const privateKeyPath = path.resolve(outFile || \"update-private-key.pem\")\n try {\n // \"wx\" creates the file exclusively, so the 0600 mode is always applied to a fresh file\n await writeFile(privateKeyPath, privateKeyPem + \"\\n\", { mode: 0o600, flag: \"wx\" })\n } catch (e: any) {\n if (e?.code === \"EEXIST\") {\n throw new InvalidConfigurationError(`Refusing to overwrite existing key file ${privateKeyPath}; delete it or pass a different --out path`)\n }\n throw e\n }\n\n log.info({ file: privateKeyPath }, \"Ed25519 private key written (keep this secret — store it in a CI secret)\")\n log.info(\n null,\n `Provide it at publish time via the ${chalk.bold(\"ELECTRON_BUILDER_UPDATE_SIGN_KEY\")} (PEM literal) or ${chalk.bold(\"ELECTRON_BUILDER_UPDATE_SIGN_KEY_FILE\")} (path) environment variable.`\n )\n log.info(null, \"The matching public key is embedded into app-update.yml automatically; you do not need to configure it manually.\\n\")\n\n const keyId = computeUpdateManifestKeyId(publicKeyPem)\n process.stdout.write(`${chalk.bold(\"Public key\")} (for reference — auto-embedded into app-update.yml):\\n${publicKeyPem}\\n`)\n process.stdout.write(`${chalk.bold(\"Key id\")} (appears as \\`keyId\\` in the \\`signatures\\` list of each signed latest*.yml):\\n${keyId}\\n`)\n return { privateKeyPath, publicKeyPem, keyId }\n}\n"]}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
|
-
import { computeDefaultAppDirectory, determinePackageManagerEnv, getConfig, getElectronVersion, installOrRebuild,
|
|
2
|
+
import { computeDefaultAppDirectory, createProjectMetadataLazy, determinePackageManagerEnv, getConfig, getElectronVersion, installOrRebuild, PACKAGE_VERSION, } from "app-builder-lib/internal";
|
|
3
3
|
import { getArchCliNames, log, printErrorAndExit } from "builder-util";
|
|
4
|
-
import { Lazy } from "lazy-val";
|
|
5
|
-
import * as path from "path";
|
|
6
4
|
import { fileURLToPath } from "node:url";
|
|
7
5
|
import { hideBin } from "yargs/helpers";
|
|
8
6
|
import * as yargs from "yargs";
|
|
9
|
-
import _fsExtra from "fs-extra";
|
|
10
|
-
const { readJson } = _fsExtra;
|
|
11
7
|
/** @internal */
|
|
12
8
|
export function configureInstallAppDepsCommand(yargs) {
|
|
13
9
|
// https://github.com/yargs/yargs/issues/760
|
|
@@ -39,7 +35,7 @@ export async function installAppDeps(args) {
|
|
|
39
35
|
}
|
|
40
36
|
}
|
|
41
37
|
const projectDir = process.cwd();
|
|
42
|
-
const packageMetadata =
|
|
38
|
+
const packageMetadata = createProjectMetadataLazy(projectDir);
|
|
43
39
|
const config = await getConfig(projectDir, null, null, packageMetadata);
|
|
44
40
|
const [appDir, version] = await Promise.all([computeDefaultAppDirectory(projectDir, config.directories?.app), getElectronVersion(projectDir, config)]);
|
|
45
41
|
const packageManagerEnv = determinePackageManagerEnv({ projectDir, appDir, workspaceRoot: undefined });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-app-deps.js","sourceRoot":"","sources":["../../src/cli/install-app-deps.ts"],"names":[],"mappings":";AAEA,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,SAAS,EACT,kBAAkB,EAClB,gBAAgB,EAChB,
|
|
1
|
+
{"version":3,"file":"install-app-deps.js","sourceRoot":"","sources":["../../src/cli/install-app-deps.ts"],"names":[],"mappings":";AAEA,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC1B,SAAS,EACT,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,GAChB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,gBAAgB;AAChB,MAAM,UAAU,8BAA8B,CAAC,KAAiB;IAC9D,4CAA4C;IAC5C,qCAAqC;IACrC,OAAO,KAAK;SACT,mBAAmB,CAAC;QACnB,sBA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CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,CAAA;IAEtG,sGAAsG;IACtG,MAAM,gBAAgB,CACpB,MAAM,EACN;QACE,MAAM;QACN,UAAU;QACV,aAAa,EAAE,MAAM,CAAC,MAAM,iBAAiB,CAAC,KAAK,CAAC,CAAC,aAAa;KACnE,EACD;QACE,aAAa,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE;QAC/C,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,IAAI,EAAE,IAAI,CAAC,IAAI;KAChB,EACD,MAAM,KAAK,UAAU,EACrB,EAAE,CACH,CAAA;AACH,CAAC;AAED,SAAS,IAAI;IACX,MAAM,OAAO,GAAI,KAAa,CAAC,OAAO,IAAI,KAAK,CAAA;IAC/C,MAAM,QAAQ,GAAG,OAAO,OAAO,EAAE,mBAAmB,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;IAC9G,OAAO,cAAc,CAAC,8BAA8B,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAA;AACtE,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACvD,GAAG,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAA;IACvE,IAAI,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAA;AACjC,CAAC","sourcesContent":["#! /usr/bin/env node\n\nimport {\n computeDefaultAppDirectory,\n createProjectMetadataLazy,\n determinePackageManagerEnv,\n getConfig,\n getElectronVersion,\n installOrRebuild,\n PACKAGE_VERSION,\n} from \"app-builder-lib/internal\"\nimport { getArchCliNames, log, printErrorAndExit } from \"builder-util\"\n\nimport { fileURLToPath } from \"node:url\"\nimport { hideBin } from \"yargs/helpers\"\nimport * as yargs from \"yargs\"\n\n/** @internal */\nexport function configureInstallAppDepsCommand(yargs: yargs.Argv): yargs.Argv {\n // https://github.com/yargs/yargs/issues/760\n // demandOption is required to be set\n return yargs\n .parserConfiguration({\n \"camel-case-expansion\": false,\n })\n .option(\"platform\", {\n choices: [\"linux\", \"darwin\", \"win32\"],\n default: process.platform,\n description: \"The target platform\",\n })\n .option(\"arch\", {\n choices: getArchCliNames().concat(\"all\"),\n default: process.arch === \"arm\" ? \"armv7l\" : process.arch,\n description: \"The target arch\",\n })\n}\n\n/** @internal */\nexport async function installAppDeps(args: any) {\n try {\n log.info({ version: PACKAGE_VERSION }, \"electron-builder\")\n } catch (e: any) {\n // error in dev mode without babel\n if (!(e instanceof ReferenceError)) {\n throw e\n }\n }\n\n const projectDir = process.cwd()\n const packageMetadata = createProjectMetadataLazy(projectDir)\n const config = await getConfig(projectDir, null, null, packageMetadata)\n const [appDir, version] = await Promise.all<string>([computeDefaultAppDirectory(projectDir, config.directories?.app), getElectronVersion(projectDir, config)])\n\n const packageManagerEnv = determinePackageManagerEnv({ projectDir, appDir, workspaceRoot: undefined })\n\n // if two package.json — force full install (user wants to install/update app deps in addition to dev)\n await installOrRebuild(\n config,\n {\n appDir,\n projectDir,\n workspaceRoot: await (await packageManagerEnv.value).workspaceRoot,\n },\n {\n frameworkInfo: { version, useCustomDist: true },\n platform: args.platform,\n arch: args.arch,\n },\n appDir !== projectDir,\n {}\n )\n}\n\nfunction main() {\n const factory = (yargs as any).default ?? yargs\n const instance = typeof factory?.parserConfiguration === \"function\" ? factory : factory(hideBin(process.argv))\n return installAppDeps(configureInstallAppDepsCommand(instance).argv)\n}\n\nif (process.argv[1] === fileURLToPath(import.meta.url)) {\n log.warn(\"please use as subcommand: electron-builder install-app-deps\")\n main().catch(printErrorAndExit)\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { MigrationChange } from "./migrate-schema.js";
|
|
2
|
+
export declare function loadTypeScript(): any | null;
|
|
3
|
+
export type ProgrammaticMigrationStatus = "migrated" | "no-op" | "unsupported";
|
|
4
|
+
export interface ProgrammaticMigrationResult {
|
|
5
|
+
/** Rewritten source. Equal to the input when nothing changed or the config is unsupported. */
|
|
6
|
+
readonly code: string;
|
|
7
|
+
readonly changes: MigrationChange[];
|
|
8
|
+
readonly warnings: string[];
|
|
9
|
+
/** Informational notices that are not config changes — they never affect `status` or trigger a file write. */
|
|
10
|
+
readonly advisories: string[];
|
|
11
|
+
readonly status: ProgrammaticMigrationStatus;
|
|
12
|
+
/** Set when status === "unsupported": why the config could not be auto-migrated. */
|
|
13
|
+
readonly unsupportedReason?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Migrates a programmatic JS/TS electron-builder config (the same v26→v27 transforms as
|
|
17
|
+
* {@link migrateConfig}) by surgically rewriting the source text. The TypeScript parser is used only
|
|
18
|
+
* to locate node ranges; everything outside an edited range is preserved byte-for-byte, so comments,
|
|
19
|
+
* imports, functions, and formatting are untouched.
|
|
20
|
+
*
|
|
21
|
+
* Pure: source string in, result out. No file I/O. Returns status "unsupported" (with the source
|
|
22
|
+
* unchanged) when typescript is not installed or the config cannot be statically reduced to a single
|
|
23
|
+
* object literal (function that builds the object dynamically, spreads, computed keys, …).
|
|
24
|
+
*/
|
|
25
|
+
export declare function migrateProgrammaticSource(sourceText: string, fileName: string): ProgrammaticMigrationResult;
|
|
26
|
+
//# sourceMappingURL=migrate-schema-programmatic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-schema-programmatic.d.ts","sourceRoot":"","sources":["../../src/cli/migrate-schema-programmatic.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAQ1D,wBAAgB,cAAc,IAAI,GAAG,GAAG,IAAI,CAU3C;AAED,MAAM,MAAM,2BAA2B,GAAG,UAAU,GAAG,OAAO,GAAG,aAAa,CAAA;AAE9E,MAAM,WAAW,2BAA2B;IAC1C,8FAA8F;IAC9F,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,eAAe,EAAE,CAAA;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;IAC3B,8GAA8G;IAC9G,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,CAAA;IAC7B,QAAQ,CAAC,MAAM,EAAE,2BAA2B,CAAA;IAC5C,oFAAoF;IACpF,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CACpC;AAQD;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,2BAA2B,CAoB3G"}
|