electron-builder 27.0.0-alpha.7 → 27.0.0-alpha.9
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.map +1 -1
- package/dist/builder.js +19 -1
- package/dist/builder.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 +1 -1
- 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/migrate-schema-programmatic.d.ts.map +1 -1
- package/dist/cli/migrate-schema-programmatic.js +326 -44
- package/dist/cli/migrate-schema-programmatic.js.map +1 -1
- package/dist/cli/migrate-schema.d.ts +14 -4
- package/dist/cli/migrate-schema.d.ts.map +1 -1
- package/dist/cli/migrate-schema.js +330 -77
- package/dist/cli/migrate-schema.js.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.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;AAEjH,OAAO,EAAE,IAAI,
|
|
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,CAiI/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,6 +1,6 @@
|
|
|
1
1
|
import { build as _build, DIR_TARGET, Packager, Platform } from "app-builder-lib";
|
|
2
2
|
import { addTargetsForPlatform } from "app-builder-lib/internal";
|
|
3
|
-
import { Arch, archFromString } from "builder-util";
|
|
3
|
+
import { Arch, archFromString, log } from "builder-util";
|
|
4
4
|
import { deepAssign } from "builder-util-runtime";
|
|
5
5
|
import chalk from "chalk";
|
|
6
6
|
import { hideBin } from "yargs/helpers";
|
|
@@ -151,8 +151,26 @@ export function coerceTypes(host) {
|
|
|
151
151
|
}
|
|
152
152
|
return host;
|
|
153
153
|
}
|
|
154
|
+
/** Emitted once per process — createTargets is called per invocation, not per platform. */
|
|
155
|
+
let archAllWarningEmitted = false;
|
|
156
|
+
/**
|
|
157
|
+
* `arch: "all"` dropped ia32 in v27. The build stays green and simply produces no 32-bit artifact
|
|
158
|
+
* (plus an unexpected arm64 one), so the only evidence is a missing file in dist — nothing ties that
|
|
159
|
+
* back to the upgrade.
|
|
160
|
+
*/
|
|
161
|
+
function warnAboutArchAllExpansion(platforms) {
|
|
162
|
+
if (archAllWarningEmitted || !platforms.some(platform => platform !== Platform.MAC)) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
archAllWarningEmitted = true;
|
|
166
|
+
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. ' +
|
|
167
|
+
"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");
|
|
168
|
+
}
|
|
154
169
|
export function createTargets(platforms, type, arch) {
|
|
155
170
|
const targets = new Map();
|
|
171
|
+
if (arch === "all") {
|
|
172
|
+
warnAboutArchAllExpansion(platforms);
|
|
173
|
+
}
|
|
156
174
|
for (const platform of platforms) {
|
|
157
175
|
const archs =
|
|
158
176
|
// BREAKING: since Electron 44 removed Windows ia32 and Linux armv7l builds (and linux-ia32 zips ended at Electron 19),
|
package/dist/builder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|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b,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,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 } 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 // 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 // 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
|
+
{"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,CA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;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 // 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"]}
|
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,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,EAAE,8BAA8B,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtF,OAAO,EAAE,6BAA6B,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAClF,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,sCAAsC;AACtC,KAAK,WAAW,EAAE;KACf,OAAO,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,qBAAqB,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;KACpE,OAAO,CAAC,kBAAkB,EAAE,kBAAkB,EAAE,8BAA8B,EAAE,IAAI,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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,EAAE,MAAM,uBAAuB,CAAA;AACtF,OAAO,EAAE,6BAA6B,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAClF,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,sCAAsC;AACtC,KAAK,WAAW,EAAE;KACf,OAAO,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,qBAAqB,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;KACpE,OAAO,CAAC,kBAAkB,EAAE,kBAAkB,EAAE,8BAA8B,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;KACrG,OAAO,CAAC,kBAAkB,EAAE,yBAAyB,EAAE,8BAA8B,CAAC,gDAAgD,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;KACnK,OAAO,CAAC,SAAS,EAAE,6BAA6B,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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"]}
|
|
@@ -19,7 +19,7 @@ export async function createSelfSignedCert(publisher) {
|
|
|
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,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EAAE,iGAAiG,CAAC,CAAA;QACxI,MAAM,KAAK,CAAC,gBAAgB,EAAE,CAAC,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,uBAAuB,EAAE,WAAW,EAAE,IAAI,GAAG,GAAG,EAAE,oBAAoB,EAAE,YAAY,CAAC,CAAC,CAAA;IACpK,CAAC;YAAS,CAAC;QACT,MAAM,MAAM,CAAC,OAAO,EAAE,CAAA;IACxB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,CAAS;IACnC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACzC,OAAO,CAAC,CAAA;IACV,CAAC;IAED,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAA;AACtC,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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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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-schema-programmatic.d.ts","sourceRoot":"","sources":["../../src/cli/migrate-schema-programmatic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"migrate-schema-programmatic.d.ts","sourceRoot":"","sources":["../../src/cli/migrate-schema-programmatic.ts"],"names":[],"mappings":"AAgBA,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"}
|