app-builder-lib 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/dist/asar/asarUtil.js +21 -11
- package/dist/asar/asarUtil.js.map +1 -1
- package/dist/codeSign/mac/macCodeSign.d.ts.map +1 -1
- package/dist/codeSign/mac/macCodeSign.js +6 -4
- package/dist/codeSign/mac/macCodeSign.js.map +1 -1
- package/dist/codeSign/signResult.d.ts +26 -0
- package/dist/codeSign/signResult.d.ts.map +1 -0
- package/dist/codeSign/signResult.js +12 -0
- package/dist/codeSign/signResult.js.map +1 -0
- package/dist/codeSign/win/signManager.d.ts +2 -1
- package/dist/codeSign/win/signManager.d.ts.map +1 -1
- package/dist/codeSign/win/signManager.js.map +1 -1
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts +2 -1
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -1
- package/dist/codeSign/win/signtoolBaseSignManager.js +3 -3
- package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -1
- package/dist/codeSign/win/windowsCodeSign.d.ts +2 -1
- package/dist/codeSign/win/windowsCodeSign.d.ts.map +1 -1
- package/dist/codeSign/win/windowsCodeSign.js +16 -7
- package/dist/codeSign/win/windowsCodeSign.js.map +1 -1
- package/dist/codeSign/win/windowsSignAzureManager.d.ts +2 -1
- package/dist/codeSign/win/windowsSignAzureManager.d.ts.map +1 -1
- package/dist/codeSign/win/windowsSignAzureManager.js +2 -2
- package/dist/codeSign/win/windowsSignAzureManager.js.map +1 -1
- package/dist/configuration.d.ts +45 -4
- package/dist/configuration.d.ts.map +1 -1
- package/dist/configuration.js.map +1 -1
- package/dist/core.d.ts +5 -0
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js.map +1 -1
- package/dist/electron/ElectronFramework.d.ts +2 -1
- package/dist/electron/ElectronFramework.d.ts.map +1 -1
- package/dist/electron/ElectronFramework.js +14 -7
- package/dist/electron/ElectronFramework.js.map +1 -1
- package/dist/electron/mac/electronMac.js +2 -6
- package/dist/electron/mac/electronMac.js.map +1 -1
- package/dist/fileMatcher.d.ts.map +1 -1
- package/dist/fileMatcher.js +1 -0
- package/dist/fileMatcher.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/dist/indexInternal.d.ts +9 -2
- package/dist/indexInternal.d.ts.map +1 -1
- package/dist/indexInternal.js +8 -2
- package/dist/indexInternal.js.map +1 -1
- package/dist/linuxPackager.d.ts.map +1 -1
- package/dist/linuxPackager.js +19 -1
- package/dist/linuxPackager.js.map +1 -1
- package/dist/macPackager.d.ts +16 -8
- package/dist/macPackager.d.ts.map +1 -1
- package/dist/macPackager.js +78 -30
- package/dist/macPackager.js.map +1 -1
- package/dist/node-module-collector/index.d.ts.map +1 -1
- package/dist/node-module-collector/index.js +47 -16
- package/dist/node-module-collector/index.js.map +1 -1
- package/dist/node-module-collector/moduleManager.d.ts.map +1 -1
- package/dist/node-module-collector/moduleManager.js +16 -8
- package/dist/node-module-collector/moduleManager.js.map +1 -1
- package/dist/node-module-collector/nodeModulesCollector.d.ts +7 -2
- package/dist/node-module-collector/nodeModulesCollector.d.ts.map +1 -1
- package/dist/node-module-collector/nodeModulesCollector.js +13 -17
- package/dist/node-module-collector/nodeModulesCollector.js.map +1 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts +44 -4
- package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts.map +1 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.js +130 -34
- package/dist/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.d.ts +31 -2
- package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
- package/dist/options/SquirrelWindowsOptions.d.ts +0 -5
- package/dist/options/SquirrelWindowsOptions.d.ts.map +1 -1
- package/dist/options/SquirrelWindowsOptions.js.map +1 -1
- package/dist/options/linuxOptions.d.ts +8 -2
- package/dist/options/linuxOptions.d.ts.map +1 -1
- package/dist/options/linuxOptions.js.map +1 -1
- package/dist/options/macOptions.d.ts +12 -7
- package/dist/options/macOptions.d.ts.map +1 -1
- package/dist/options/macOptions.js.map +1 -1
- package/dist/options/pkgOptions.d.ts +1 -1
- package/dist/options/pkgOptions.js.map +1 -1
- package/dist/options/winOptions.d.ts +3 -3
- package/dist/options/winOptions.js.map +1 -1
- package/dist/packager.d.ts +2 -0
- package/dist/packager.d.ts.map +1 -1
- package/dist/packager.js +52 -2
- package/dist/packager.js.map +1 -1
- package/dist/packagerApi.d.ts +1 -1
- package/dist/packagerApi.d.ts.map +1 -1
- package/dist/packagerApi.js.map +1 -1
- package/dist/platformPackager.d.ts +15 -2
- package/dist/platformPackager.d.ts.map +1 -1
- package/dist/platformPackager.js +31 -5
- package/dist/platformPackager.js.map +1 -1
- package/dist/publish/PublishManager.d.ts.map +1 -1
- package/dist/publish/PublishManager.js +126 -7
- package/dist/publish/PublishManager.js.map +1 -1
- package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
- package/dist/publish/updateInfoBuilder.js +61 -6
- package/dist/publish/updateInfoBuilder.js.map +1 -1
- package/dist/targets/ArchiveTarget.js +1 -1
- package/dist/targets/ArchiveTarget.js.map +1 -1
- package/dist/targets/archive.d.ts +12 -0
- package/dist/targets/archive.d.ts.map +1 -1
- package/dist/targets/archive.js +44 -1
- package/dist/targets/archive.js.map +1 -1
- package/dist/targets/differentialUpdateInfoBuilder.d.ts +2 -1
- package/dist/targets/differentialUpdateInfoBuilder.d.ts.map +1 -1
- package/dist/targets/differentialUpdateInfoBuilder.js +2 -2
- package/dist/targets/differentialUpdateInfoBuilder.js.map +1 -1
- package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -1
- package/dist/targets/linux/FlatpakTarget.js +5 -1
- package/dist/targets/linux/FlatpakTarget.js.map +1 -1
- package/dist/targets/linux/FpmTarget.d.ts +7 -0
- package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
- package/dist/targets/linux/FpmTarget.js +45 -4
- package/dist/targets/linux/FpmTarget.js.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.d.ts +1 -0
- package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.js +17 -1
- package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
- package/dist/targets/linux/snap/core24.js +3 -3
- package/dist/targets/linux/snap/core24.js.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.js +1 -1
- package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
- package/dist/targets/mac/MacTargetHelper.d.ts +75 -7
- package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
- package/dist/targets/mac/MacTargetHelper.js +296 -38
- package/dist/targets/mac/MacTargetHelper.js.map +1 -1
- package/dist/targets/mac/pkg.d.ts +16 -0
- package/dist/targets/mac/pkg.d.ts.map +1 -1
- package/dist/targets/mac/pkg.js +27 -1
- package/dist/targets/mac/pkg.js.map +1 -1
- package/dist/targets/win/MsiTarget.d.ts.map +1 -1
- package/dist/targets/win/MsiTarget.js +6 -3
- package/dist/targets/win/MsiTarget.js.map +1 -1
- package/dist/targets/win/nsis/Defines.d.ts +2 -0
- package/dist/targets/win/nsis/Defines.d.ts.map +1 -1
- package/dist/targets/win/nsis/Defines.js.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.d.ts +18 -0
- package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.js +79 -19
- package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
- package/dist/targets/win/nsis/WebInstallerTarget.d.ts.map +1 -1
- package/dist/targets/win/nsis/WebInstallerTarget.js +19 -12
- package/dist/targets/win/nsis/WebInstallerTarget.js.map +1 -1
- package/dist/targets/win/nsis/nsisOptions.d.ts +29 -4
- package/dist/targets/win/nsis/nsisOptions.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisOptions.js.map +1 -1
- package/dist/toolsets/7zip.d.ts +32 -0
- package/dist/toolsets/7zip.d.ts.map +1 -1
- package/dist/toolsets/7zip.js +39 -13
- package/dist/toolsets/7zip.js.map +1 -1
- package/dist/toolsets/linuxToolsMac.d.ts.map +1 -1
- package/dist/toolsets/linuxToolsMac.js +15 -5
- package/dist/toolsets/linuxToolsMac.js.map +1 -1
- package/dist/toolsets/wine.d.ts.map +1 -1
- package/dist/toolsets/wine.js +17 -12
- package/dist/toolsets/wine.js.map +1 -1
- package/dist/util/NodeModuleCopyHelper.js +12 -4
- package/dist/util/NodeModuleCopyHelper.js.map +1 -1
- package/dist/util/appFileCopier.d.ts +5 -0
- package/dist/util/appFileCopier.d.ts.map +1 -1
- package/dist/util/appFileCopier.js +39 -1
- package/dist/util/appFileCopier.js.map +1 -1
- package/dist/util/config/config.d.ts.map +1 -1
- package/dist/util/config/config.js +4 -0
- package/dist/util/config/config.js.map +1 -1
- package/dist/util/config/legacyConfigGuard.d.ts +7 -0
- package/dist/util/config/legacyConfigGuard.d.ts.map +1 -0
- package/dist/util/config/legacyConfigGuard.js +187 -0
- package/dist/util/config/legacyConfigGuard.js.map +1 -0
- package/dist/util/config/legacyOptions.d.ts +73 -0
- package/dist/util/config/legacyOptions.d.ts.map +1 -0
- package/dist/util/config/legacyOptions.js +369 -0
- package/dist/util/config/legacyOptions.js.map +1 -0
- package/dist/util/config/schemaValidator.d.ts.map +1 -1
- package/dist/util/config/schemaValidator.js +16 -0
- package/dist/util/config/schemaValidator.js.map +1 -1
- package/dist/util/electronGet.d.ts +11 -4
- package/dist/util/electronGet.d.ts.map +1 -1
- package/dist/util/electronGet.js +63 -3
- package/dist/util/electronGet.js.map +1 -1
- package/dist/util/flags.d.ts +5 -0
- package/dist/util/flags.d.ts.map +1 -1
- package/dist/util/flags.js +124 -1
- package/dist/util/flags.js.map +1 -1
- package/dist/util/installOrRebuild.d.ts +6 -0
- package/dist/util/installOrRebuild.d.ts.map +1 -1
- package/dist/util/installOrRebuild.js +47 -0
- package/dist/util/installOrRebuild.js.map +1 -1
- package/dist/util/packageMetadata.js +11 -0
- package/dist/util/packageMetadata.js.map +1 -1
- package/dist/util/repositoryInfo.js +6 -3
- package/dist/util/repositoryInfo.js.map +1 -1
- package/dist/util/resolve.js +1 -1
- package/dist/util/resolve.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/winPackager.d.ts +4 -3
- package/dist/winPackager.d.ts.map +1 -1
- package/dist/winPackager.js +22 -16
- package/dist/winPackager.js.map +1 -1
- package/package.json +12 -12
- package/scheme.json +396 -49
- package/templates/entitlements.mac.adhoc.plist +15 -0
- package/templates/entitlements.mac.plist +9 -6
- package/templates/nsis/common.nsh +2 -2
- package/templates/nsis/include/allowOnlyOneInstallerInstance.nsh +68 -4
- package/templates/nsis/include/extractAppPackage.nsh +1 -1
- package/templates/nsis/include/installUtil.nsh +2 -2
- package/templates/nsis/include/installer.nsh +2 -31
- package/templates/nsis/include/webPackage.nsh +33 -23
- package/templates/nsis/installer.nsi +1 -1
- package/templates/nsis/multiUserUi.nsh +1 -1
package/dist/linuxPackager.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Arch } from "builder-util";
|
|
1
|
+
import { Arch, log } from "builder-util";
|
|
2
2
|
import { sanitizeFileName } from "builder-util/internal";
|
|
3
3
|
import { DIR_TARGET, Platform } from "./core.js";
|
|
4
4
|
import { PlatformPackager } from "./platformPackager.js";
|
|
@@ -8,11 +8,29 @@ import FpmTarget from "./targets/linux/FpmTarget.js";
|
|
|
8
8
|
import { LinuxTargetHelper } from "./targets/linux/LinuxTargetHelper.js";
|
|
9
9
|
import SnapTarget from "./targets/linux/snap/SnapTarget.js";
|
|
10
10
|
import { createCommonTarget } from "./targets/targetFactory.js";
|
|
11
|
+
/** Desktop Entry field codes — the DE substitutes these in `Exec`, they are not literal arguments. */
|
|
12
|
+
const DESKTOP_FIELD_CODE = /^%[a-zA-Z]$/;
|
|
13
|
+
/**
|
|
14
|
+
* v26 passed a field code through to the .desktop `Exec` key unquoted and skipped appending `%U`.
|
|
15
|
+
* v27 routes executableArgs through the generated `<executableName>-launcher` script, where they are
|
|
16
|
+
* single-quoted — so `%F` reaches the app as the literal string "%F" instead of the file list, and
|
|
17
|
+
* a file-handling app silently stops receiving the files it was opened with.
|
|
18
|
+
*/
|
|
19
|
+
function warnAboutDesktopFieldCodes(executableArgs) {
|
|
20
|
+
const fieldCodes = (executableArgs ?? []).filter(arg => DESKTOP_FIELD_CODE.test(arg));
|
|
21
|
+
if (fieldCodes.length === 0) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
log.warn({ fieldCodes: fieldCodes.join(", "), solution: "remove the field code from executableArgs and set linux.desktop.entry.Exec if you need a custom Exec line" }, "linux.executableArgs contains desktop-entry field codes, which are no longer expanded. " +
|
|
25
|
+
"In v27 executableArgs are injected into the generated *-launcher script and quoted, so these reach your app as literal arguments. " +
|
|
26
|
+
"See https://www.electron.build/docs/migration/v27-breaking-changes#linux-launcher-entrypoint");
|
|
27
|
+
}
|
|
11
28
|
export class LinuxPackager extends PlatformPackager {
|
|
12
29
|
constructor(info) {
|
|
13
30
|
super(info, Platform.LINUX);
|
|
14
31
|
const executableName = this.platformSpecificBuildOptions.executableName ?? info.config.executableName;
|
|
15
32
|
this.executableName = executableName == null ? this.appInfo.sanitizedName.toLowerCase() : sanitizeFileName(executableName);
|
|
33
|
+
warnAboutDesktopFieldCodes(this.platformSpecificBuildOptions.executableArgs);
|
|
16
34
|
}
|
|
17
35
|
get defaultTarget() {
|
|
18
36
|
return ["snap", "appimage"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linuxPackager.js","sourceRoot":"","sources":["../src/linuxPackager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAA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YAEJ,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE;gBACpB,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;oBACzB,OAAO,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;gBAC/C,CAAC;gBAED,OAAO,IAAI,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,MAAM,CAAC,CAAA;YACzD,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF;AAED,MAAM,UAAU,oBAAoB,CAAC,IAAU;IAC7C,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,IAAI,CAAC,GAAG;YACX,OAAO,QAAQ,CAAA;QACjB,KAAK,IAAI,CAAC,IAAI;YACZ,OAAO,MAAM,CAAA;QACf,KAAK,IAAI,CAAC,MAAM;YACd,OAAO,KAAK,CAAA;QACd,KAAK,IAAI,CAAC,KAAK;YACb,OAAO,aAAa,CAAA;QAEtB;YACE,MAAM,IAAI,KAAK,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAA;IAC/C,CAAC;AACH,CAAC","sourcesContent":["import { Arch, log } from \"builder-util\"\nimport { sanitizeFileName } from \"builder-util/internal\"\nimport { Nullish } from \"builder-util-runtime\"\nimport { DIR_TARGET, Platform, Target } from \"./core.js\"\nimport { LinuxConfiguration } from \"./options/linuxOptions.js\"\nimport { Packager } from \"./packager.js\"\nimport { PlatformPackager } from \"./platformPackager.js\"\nimport AppImageTarget from \"./targets/linux/appimage/AppImageTarget.js\"\nimport FlatpakTarget from \"./targets/linux/FlatpakTarget.js\"\nimport FpmTarget from \"./targets/linux/FpmTarget.js\"\nimport { LinuxTargetHelper } from \"./targets/linux/LinuxTargetHelper.js\"\nimport SnapTarget from \"./targets/linux/snap/SnapTarget.js\"\nimport { createCommonTarget } from \"./targets/targetFactory.js\"\n\n/** Desktop Entry field codes — the DE substitutes these in `Exec`, they are not literal arguments. */\nconst DESKTOP_FIELD_CODE = /^%[a-zA-Z]$/\n\n/**\n * v26 passed a field code through to the .desktop `Exec` key unquoted and skipped appending `%U`.\n * v27 routes executableArgs through the generated `<executableName>-launcher` script, where they are\n * single-quoted — so `%F` reaches the app as the literal string \"%F\" instead of the file list, and\n * a file-handling app silently stops receiving the files it was opened with.\n */\nfunction warnAboutDesktopFieldCodes(executableArgs: Array<string> | Nullish): void {\n const fieldCodes = (executableArgs ?? []).filter(arg => DESKTOP_FIELD_CODE.test(arg))\n if (fieldCodes.length === 0) {\n return\n }\n log.warn(\n { fieldCodes: fieldCodes.join(\", \"), solution: \"remove the field code from executableArgs and set linux.desktop.entry.Exec if you need a custom Exec line\" },\n \"linux.executableArgs contains desktop-entry field codes, which are no longer expanded. \" +\n \"In v27 executableArgs are injected into the generated *-launcher script and quoted, so these reach your app as literal arguments. \" +\n \"See https://www.electron.build/docs/migration/v27-breaking-changes#linux-launcher-entrypoint\"\n )\n}\n\nexport class LinuxPackager extends PlatformPackager<LinuxConfiguration> {\n readonly executableName: string\n\n constructor(info: Packager) {\n super(info, Platform.LINUX)\n\n const executableName = this.platformSpecificBuildOptions.executableName ?? info.config.executableName\n this.executableName = executableName == null ? this.appInfo.sanitizedName.toLowerCase() : sanitizeFileName(executableName)\n\n warnAboutDesktopFieldCodes(this.platformSpecificBuildOptions.executableArgs)\n }\n\n get defaultTarget(): Array<string> {\n return [\"snap\", \"appimage\"]\n }\n\n createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void {\n let helper: LinuxTargetHelper | null\n const getHelper = () => {\n if (helper == null) {\n helper = new LinuxTargetHelper(this)\n }\n return helper\n }\n\n for (const name of targets) {\n if (name === DIR_TARGET) {\n continue\n }\n\n const targetClass: typeof AppImageTarget | typeof SnapTarget | typeof FlatpakTarget | typeof FpmTarget | null = (() => {\n switch (name) {\n case \"appimage\":\n return AppImageTarget\n case \"snap\":\n return SnapTarget\n case \"flatpak\":\n return FlatpakTarget\n case \"deb\":\n case \"rpm\":\n case \"sh\":\n case \"freebsd\":\n case \"pacman\":\n case \"apk\":\n case \"p5p\":\n return FpmTarget\n default:\n return null\n }\n })()\n\n mapper(name, outDir => {\n if (targetClass === null) {\n return createCommonTarget(name, outDir, this)\n }\n\n return new targetClass(name, this, getHelper(), outDir)\n })\n }\n }\n}\n\nexport function toAppImageOrSnapArch(arch: Arch): string {\n switch (arch) {\n case Arch.x64:\n return \"x86_64\"\n case Arch.ia32:\n return \"i386\"\n case Arch.armv7l:\n return \"arm\"\n case Arch.arm64:\n return \"arm_aarch64\"\n\n default:\n throw new Error(`Unsupported arch ${arch}`)\n }\n}\n"]}
|
package/dist/macPackager.d.ts
CHANGED
|
@@ -3,17 +3,18 @@ import { Arch, AsyncTaskManager } from "builder-util";
|
|
|
3
3
|
import { MemoLazy, Nullish } from "builder-util-runtime";
|
|
4
4
|
import { AppInfo } from "./appInfo.js";
|
|
5
5
|
import { CodeSigningInfo, CreateKeychainOptions, Identity } from "./codeSign/mac/macCodeSign.js";
|
|
6
|
+
import { SigningResult } from "./codeSign/signResult.js";
|
|
6
7
|
import { Target } from "./core.js";
|
|
7
8
|
import { AfterPackContext, ElectronPlatformName } from "./index.js";
|
|
8
|
-
import { MacTargetHelper, PlatformType } from "./targets/mac/MacTargetHelper.js";
|
|
9
|
+
import { MacTargetHelper, MasPlatformType, PlatformType } from "./targets/mac/MacTargetHelper.js";
|
|
9
10
|
import { MacConfiguration, MasConfiguration } from "./options/macOptions.js";
|
|
10
11
|
import { Packager } from "./packager.js";
|
|
11
12
|
import { DoPackOptions, PlatformPackager } from "./platformPackager.js";
|
|
12
13
|
export type CustomMacSignOptions = SignOptions;
|
|
13
14
|
export type CustomMacSign = (configuration: CustomMacSignOptions, packager: MacPackager) => Promise<void>;
|
|
14
|
-
interface PlatformConfig {
|
|
15
|
+
interface PlatformConfig<C extends MacConfiguration | MasConfiguration = MacConfiguration | MasConfiguration> {
|
|
15
16
|
type: PlatformType;
|
|
16
|
-
config:
|
|
17
|
+
config: C;
|
|
17
18
|
platformName: ElectronPlatformName;
|
|
18
19
|
}
|
|
19
20
|
export declare class MacPackager extends PlatformPackager<MacConfiguration | MasConfiguration> {
|
|
@@ -23,8 +24,10 @@ export declare class MacPackager extends PlatformPackager<MacConfiguration | Mas
|
|
|
23
24
|
constructor(info: Packager);
|
|
24
25
|
get defaultTarget(): Array<string>;
|
|
25
26
|
/**
|
|
26
|
-
* Get the merged configuration for a specific platform type
|
|
27
|
+
* Get the merged configuration for a specific platform type. Calls statically known to be a MAS
|
|
28
|
+
* flavor (`mas` / `mas-dev`) get a `MasConfiguration` back, so no cast is needed downstream.
|
|
27
29
|
*/
|
|
30
|
+
getPlatformConfig(platformType: MasPlatformType): PlatformConfig<MasConfiguration>;
|
|
28
31
|
getPlatformConfig(platformType: PlatformType): PlatformConfig;
|
|
29
32
|
expandArch(pattern: string, arch?: Arch | null): string[];
|
|
30
33
|
protected prepareAppInfo(appInfo: AppInfo): AppInfo;
|
|
@@ -43,17 +46,22 @@ export declare class MacPackager extends PlatformPackager<MacConfiguration | Mas
|
|
|
43
46
|
pack(outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): Promise<void>;
|
|
44
47
|
private packMasTargets;
|
|
45
48
|
private packMacTargets;
|
|
46
|
-
private signMas;
|
|
47
49
|
/**
|
|
48
|
-
*
|
|
50
|
+
* Creates the signed MAS installer .pkg for an already codesigned app. Kept separate from `sign()`
|
|
51
|
+
* so that the `afterSign` hook can run between codesigning and installer creation (see `packMasTargets`).
|
|
49
52
|
*/
|
|
50
|
-
|
|
53
|
+
protected createMasInstaller(appPath: string, outDir: string, arch: Arch, targetPlatform: MasPlatformType): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Main signing method with platform awareness. Protected so tests can stub signing
|
|
56
|
+
* (`isSignAllowed()` short-circuits it on non-mac hosts). Failures are thrown, never returned.
|
|
57
|
+
*/
|
|
58
|
+
protected sign(appPath: string, arch: Arch, targetPlatform: PlatformType): Promise<SigningResult>;
|
|
51
59
|
protected doSign(opts: SignOptions, signConfig: MacConfiguration["sign"], identity: Identity | null): Promise<void>;
|
|
52
60
|
doFlat(appPath: string, outFile: string, identity: Identity, keychain: string | Nullish): Promise<any>;
|
|
53
61
|
getElectronSrcDir(dist: string): string;
|
|
54
62
|
getElectronDestinationDir(appOutDir: string): string;
|
|
55
63
|
applyCommonInfo(appPlist: any, contentsPath: string, cascadedOptions: MacConfiguration | MasConfiguration): Promise<void>;
|
|
56
|
-
protected signApp(packContext: AfterPackContext, isAsar: boolean, platformType?: PlatformType): Promise<
|
|
64
|
+
protected signApp(packContext: AfterPackContext, isAsar: boolean, platformType?: PlatformType): Promise<SigningResult>;
|
|
57
65
|
}
|
|
58
66
|
export {};
|
|
59
67
|
//# sourceMappingURL=macPackager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"macPackager.d.ts","sourceRoot":"","sources":["../src/macPackager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAGrD,OAAO,EACL,IAAI,EACJ,gBAAgB,EAYjB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAKxD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,OAAO,EAAE,eAAe,EAAkB,qBAAqB,EAAE,QAAQ,EAAuC,MAAM,+BAA+B,CAAA;AACrJ,OAAO,EAAwB,MAAM,EAAE,MAAM,WAAW,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"macPackager.d.ts","sourceRoot":"","sources":["../src/macPackager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAGrD,OAAO,EACL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AU,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAuB5G,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC;IAY5G,iBAAiB,CAAC,IAAI,EAAE,MAAM;IAI9B,yBAAyB,CAAC,SAAS,EAAE,MAAM;IAK5C,eAAe,CAAC,QAAQ,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;cA2E/G,OAAO,CAAC,WAAW,EAAE,gBAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC;CAgC7H"}
|
package/dist/macPackager.js
CHANGED
|
@@ -9,6 +9,7 @@ import * as path from "path";
|
|
|
9
9
|
import { AppInfo } from "./appInfo.js";
|
|
10
10
|
import { assertSafeHelperName } from "./electron/mac/electronMacUtils.js";
|
|
11
11
|
import { createKeychain, isSignAllowed, removeKeychain, sign } from "./codeSign/mac/macCodeSign.js";
|
|
12
|
+
import { combineSignResults, isSignResultSigned } from "./codeSign/signResult.js";
|
|
12
13
|
import { DIR_TARGET, Platform } from "./core.js";
|
|
13
14
|
import { MacTargetHelper } from "./targets/mac/MacTargetHelper.js";
|
|
14
15
|
import { chooseNotNull, PlatformPackager } from "./platformPackager.js";
|
|
@@ -58,9 +59,6 @@ export class MacPackager extends PlatformPackager {
|
|
|
58
59
|
get defaultTarget() {
|
|
59
60
|
return this.info.framework.macOsDefaultTargets;
|
|
60
61
|
}
|
|
61
|
-
/**
|
|
62
|
-
* Get the merged configuration for a specific platform type
|
|
63
|
-
*/
|
|
64
62
|
getPlatformConfig(platformType) {
|
|
65
63
|
let config;
|
|
66
64
|
let platformName;
|
|
@@ -219,7 +217,7 @@ export class MacPackager extends PlatformPackager {
|
|
|
219
217
|
}
|
|
220
218
|
await this.doAddElectronFuses(packContext);
|
|
221
219
|
// Mirror the base-class guard: skip signing when the caller explicitly set sign:false
|
|
222
|
-
// (e.g. packMasTargets passes sign:false so that
|
|
220
|
+
// (e.g. packMasTargets passes sign:false so that its own sign() call is the sole signing step).
|
|
223
221
|
if (config.options?.sign ?? true) {
|
|
224
222
|
await this.doSignAfterPack(outDir, appOutDir, platformName, platformType, arch, platformSpecificBuildOptions, targets);
|
|
225
223
|
}
|
|
@@ -290,7 +288,36 @@ export class MacPackager extends PlatformPackager {
|
|
|
290
288
|
});
|
|
291
289
|
MacTargetHelper.assertSafePathForCommandUsage(this.appInfo.productFilename, "product filename");
|
|
292
290
|
}
|
|
293
|
-
await this.
|
|
291
|
+
const signResult = await this.sign(appPath, arch, platformType);
|
|
292
|
+
const signed = isSignResultSigned(signResult);
|
|
293
|
+
// The MAS flow packs with sign:false and signs here, bypassing doSignAfterPack — the only other
|
|
294
|
+
// emitAfterSign site. Mirror its contract: fire afterSign after codesigning succeeded, but before
|
|
295
|
+
// the .pkg installer is built, and warn when signing was skipped (#9997).
|
|
296
|
+
const packContext = {
|
|
297
|
+
appOutDir: path.dirname(appPath),
|
|
298
|
+
outDir: resolvedOutDir,
|
|
299
|
+
arch,
|
|
300
|
+
targets: [target],
|
|
301
|
+
packager: this,
|
|
302
|
+
electronPlatformName: platformConfig.platformName,
|
|
303
|
+
};
|
|
304
|
+
if (signed) {
|
|
305
|
+
await this.info.emitAfterSign(packContext);
|
|
306
|
+
}
|
|
307
|
+
else if (this.info.filterPackagerEventListeners("afterSign", "user").length) {
|
|
308
|
+
log.warn(null, `skipping "afterSign" hook as no signing occurred, perhaps you intended "afterPack"?`);
|
|
309
|
+
}
|
|
310
|
+
// test-only early exit (see PackagerOptions.afterPackTestHook); a no-op unless the option is set
|
|
311
|
+
if (await this.info.shouldSkipTargetsAfterPack(packContext)) {
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
// A development-signed build (mas-dev, or an explicit sign.type "development" — see
|
|
315
|
+
// MacTargetHelper.shouldCreateMasInstaller) produces no installer
|
|
316
|
+
const masSignConfig = platformConfig.config.sign;
|
|
317
|
+
const masSignOpts = isElectronSignOptions(masSignConfig) ? masSignConfig : undefined;
|
|
318
|
+
if (signed && MacTargetHelper.shouldCreateMasInstaller(platformType, masSignOpts?.type)) {
|
|
319
|
+
await this.createMasInstaller(appPath, targetOutDir, arch, platformType);
|
|
320
|
+
}
|
|
294
321
|
}
|
|
295
322
|
}
|
|
296
323
|
async packMacTargets(outDir, arch, targets, prepackaged, taskManager) {
|
|
@@ -307,18 +334,38 @@ export class MacPackager extends PlatformPackager {
|
|
|
307
334
|
targets,
|
|
308
335
|
});
|
|
309
336
|
}
|
|
337
|
+
// test-only early exit (see PackagerOptions.afterPackTestHook); a no-op unless the option is set
|
|
338
|
+
if (await this.info.shouldSkipTargetsAfterPack({
|
|
339
|
+
appOutDir: path.dirname(appPath),
|
|
340
|
+
outDir,
|
|
341
|
+
arch,
|
|
342
|
+
targets,
|
|
343
|
+
packager: this,
|
|
344
|
+
electronPlatformName: this.platform.nodeName,
|
|
345
|
+
})) {
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
310
348
|
this.packageInDistributableFormat(appPath, arch, targets, taskManager);
|
|
311
349
|
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
350
|
+
/**
|
|
351
|
+
* Creates the signed MAS installer .pkg for an already codesigned app. Kept separate from `sign()`
|
|
352
|
+
* so that the `afterSign` hook can run between codesigning and installer creation (see `packMasTargets`).
|
|
353
|
+
*/
|
|
354
|
+
async createMasInstaller(appPath, outDir, arch, targetPlatform) {
|
|
355
|
+
const config = this.getPlatformConfig(targetPlatform).config;
|
|
356
|
+
const signConfig = config.sign;
|
|
357
|
+
const signOpts = isElectronSignOptions(signConfig) ? signConfig : undefined;
|
|
358
|
+
const keychainFile = (await this.codeSigningInfo.value).keychainFile;
|
|
359
|
+
await this.helper.createMasInstaller(appPath, outDir, config, keychainFile, targetPlatform, arch, signOpts?.identity);
|
|
315
360
|
}
|
|
316
361
|
/**
|
|
317
|
-
* Main signing method with platform awareness
|
|
362
|
+
* Main signing method with platform awareness. Protected so tests can stub signing
|
|
363
|
+
* (`isSignAllowed()` short-circuits it on non-mac hosts). Failures are thrown, never returned.
|
|
318
364
|
*/
|
|
319
|
-
async sign(appPath,
|
|
365
|
+
async sign(appPath, arch, targetPlatform) {
|
|
320
366
|
if (!isSignAllowed()) {
|
|
321
|
-
|
|
367
|
+
// non-mac host, or the pull-request CI guard — signing cannot happen in this environment
|
|
368
|
+
return "skipped:unsupported";
|
|
322
369
|
}
|
|
323
370
|
// getPlatformConfig cascades mac → mas → masDev, so `sign` (and `sign.identity`) is already merged for this flavor.
|
|
324
371
|
const config = this.getPlatformConfig(targetPlatform).config.sign;
|
|
@@ -338,22 +385,23 @@ export class MacPackager extends PlatformPackager {
|
|
|
338
385
|
const isMas = MacTargetHelper.isMasTarget(targetPlatform);
|
|
339
386
|
const identity = await this.helper.findSigningIdentity(targetPlatform, qualifier, keychainFile, hasCustomSign, signOpts);
|
|
340
387
|
if (!identity) {
|
|
341
|
-
return
|
|
388
|
+
return "skipped:no-certificate";
|
|
342
389
|
}
|
|
343
390
|
if (!isMacOsHighSierra()) {
|
|
344
391
|
throw new InvalidConfigurationError("macOS High Sierra 10.13.6 is required to sign");
|
|
345
392
|
}
|
|
346
393
|
const signOptions = await this.helper.buildSignOptions(appPath, identity, signOpts, keychainFile, arch, targetPlatform);
|
|
347
394
|
await this.doSign(signOptions, config, identity);
|
|
348
|
-
//
|
|
349
|
-
|
|
350
|
-
|
|
395
|
+
// now that everything is signed, flag binaries that still carry a foreign (or missing) signature and would
|
|
396
|
+
// fail library validation at launch — the case the old blanket entitlements default used to mask
|
|
397
|
+
if (!hasCustomSign) {
|
|
398
|
+
await this.helper.warnAboutForeignSignedBinaries(appPath, identity, targetPlatform, signOpts);
|
|
351
399
|
}
|
|
352
400
|
// Handle notarization for non-MAS builds
|
|
353
401
|
if (!isMas) {
|
|
354
402
|
await this.helper.notarizeIfProvided(appPath);
|
|
355
403
|
}
|
|
356
|
-
return
|
|
404
|
+
return hasCustomSign ? "signed:custom" : "signed";
|
|
357
405
|
}
|
|
358
406
|
//noinspection JSMethodCanBeStatic
|
|
359
407
|
async doSign(opts, signConfig, identity) {
|
|
@@ -455,27 +503,27 @@ export class MacPackager extends PlatformPackager {
|
|
|
455
503
|
const readDirectoryAndSign = async (sourceDirectory, directories, shouldSign) => {
|
|
456
504
|
const normalizedSourceDirectory = path.resolve(sourceDirectory);
|
|
457
505
|
MacTargetHelper.assertSafePathForCommandUsage(normalizedSourceDirectory, "application output directory");
|
|
458
|
-
await Promise.all(directories
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
}
|
|
464
|
-
const signTarget = path.resolve(normalizedSourceDirectory, entryName);
|
|
465
|
-
const safeSignTarget = sanitizeDirPath(signTarget, normalizedSourceDirectory);
|
|
466
|
-
await this.sign(safeSignTarget, null, packContext.arch, targetPlatform);
|
|
506
|
+
return await Promise.all(directories
|
|
507
|
+
.filter(file => shouldSign(file))
|
|
508
|
+
.map(async (file) => {
|
|
509
|
+
const entryName = path.basename(file);
|
|
510
|
+
if (file !== entryName) {
|
|
511
|
+
throw new InvalidConfigurationError(`Invalid entry name in source directory: ${file}`);
|
|
467
512
|
}
|
|
513
|
+
const signTarget = path.resolve(normalizedSourceDirectory, entryName);
|
|
514
|
+
const safeSignTarget = sanitizeDirPath(signTarget, normalizedSourceDirectory);
|
|
515
|
+
return await this.sign(safeSignTarget, packContext.arch, targetPlatform);
|
|
468
516
|
}));
|
|
469
|
-
return true;
|
|
470
517
|
};
|
|
471
518
|
const appFileName = `${this.appInfo.productFilename}.app`;
|
|
472
|
-
|
|
519
|
+
// the combined result gates the `afterSign` hook — a signed result wins (see PlatformPackager.doSignAfterPack)
|
|
520
|
+
const results = await readDirectoryAndSign(packContext.appOutDir, await readdir(packContext.appOutDir), file => file === appFileName);
|
|
473
521
|
if (!isAsar) {
|
|
474
|
-
return
|
|
522
|
+
return combineSignResults(results);
|
|
475
523
|
}
|
|
476
524
|
const outResourcesDir = path.join(packContext.appOutDir, "resources", "app.asar.unpacked");
|
|
477
|
-
await readDirectoryAndSign(outResourcesDir, await orIfFileNotExist(readdir(outResourcesDir), []), file => file.endsWith(".app"));
|
|
478
|
-
return
|
|
525
|
+
results.push(...(await readDirectoryAndSign(outResourcesDir, await orIfFileNotExist(readdir(outResourcesDir), []), file => file.endsWith(".app"))));
|
|
526
|
+
return combineSignResults(results);
|
|
479
527
|
}
|
|
480
528
|
}
|
|
481
529
|
//# sourceMappingURL=macPackager.js.map
|
package/dist/macPackager.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"macPackager.js","sourceRoot":"","sources":["../src/macPackager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAG3C,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC/C,OAAO,EACL,IAAI,EAEJ,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,MAAM,EACN,aAAa,EACb,yBAAyB,EACzB,GAAG,EACH,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,GAAG,GACJ,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAW,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,OAAO,EA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MAAM,oBAAoB,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,WAAW,CAAC,CAAA;QACrH,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,IAAI,CAAA;QACb,CAAC;QAED,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAA;QAC1F,MAAM,oBAAoB,CAAC,eAAe,EAAE,MAAM,gBAAgB,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAA;QAEhI,OAAO,IAAI,CAAA;IACb,CAAC;CACF","sourcesContent":["import { createRequire } from \"node:module\"\nimport type { SignOptions } from \"@electron/osx-sign\"\n\nconst _require = createRequire(import.meta.url)\nimport {\n Arch,\n AsyncTaskManager,\n copyFile,\n deepAssign,\n exec,\n exists,\n getArchSuffix,\n InvalidConfigurationError,\n log,\n orIfFileNotExist,\n sanitizeDirPath,\n unlinkIfExists,\n use,\n} from \"builder-util\"\nimport { MemoLazy, Nullish } from \"builder-util-runtime\"\nimport * as fs from \"fs/promises\"\nimport { mkdir, readdir } from \"fs/promises\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { AppInfo } from \"./appInfo.js\"\nimport { assertSafeHelperName } from \"./electron/mac/electronMacUtils.js\"\nimport { CodeSigningInfo, createKeychain, CreateKeychainOptions, Identity, isSignAllowed, removeKeychain, sign } from \"./codeSign/mac/macCodeSign.js\"\nimport { DIR_TARGET, Platform, Target } from \"./core.js\"\nimport { AfterPackContext, ElectronPlatformName } from \"./index.js\"\nimport { MacTargetHelper, PlatformType } from \"./targets/mac/MacTargetHelper.js\"\nimport { ElectronSignOptions, MacConfiguration, MasConfiguration } from \"./options/macOptions.js\"\nimport { Packager } from \"./packager.js\"\nimport { chooseNotNull, DoPackOptions, PlatformPackager } from \"./platformPackager.js\"\nimport { ArchiveTarget } from \"./targets/ArchiveTarget.js\"\nimport { PkgTarget, prepareProductBuildArgs } from \"./targets/mac/pkg.js\"\nimport { createCommonTarget, NoOpTarget } from \"./targets/targetFactory.js\"\nimport { isMacOsHighSierra } from \"./util/mac/macosVersion.js\"\nimport { buildSingleArchFilesPattern, collectIdenticalSingleArchMachOFiles, collectSingleArchPackageNames } from \"./util/archCompatibility.js\"\nimport { expandMacro as doExpandMacro } from \"./util/macroExpander.js\"\nimport { resolveFunction } from \"./util/resolve.js\"\nimport { makeUniversalApp } from \"@electron/universal\"\n\nexport type CustomMacSignOptions = SignOptions\nexport type CustomMacSign = (configuration: CustomMacSignOptions, packager: MacPackager) => Promise<void>\n\nfunction isElectronSignOptions(sign: MacConfiguration[\"sign\"]): sign is ElectronSignOptions {\n return typeof sign === \"object\" && sign !== null\n}\n\ninterface PlatformConfig {\n type: PlatformType\n config: MacConfiguration | MasConfiguration\n platformName: ElectronPlatformName\n}\n\nexport class MacPackager extends PlatformPackager<MacConfiguration | MasConfiguration> {\n readonly codeSigningInfo = new MemoLazy<CreateKeychainOptions | null, CodeSigningInfo>(\n () => {\n const cscLink = this.getCscLink()\n if (cscLink == null || process.platform !== \"darwin\") {\n return null\n }\n\n const selected = {\n tmpDir: this.tempDirManager,\n cscLink,\n cscKeyPassword: this.getCscPassword(),\n cscILink: chooseNotNull(this.platformSpecificBuildOptions.cscInstallerLink, process.env.CSC_INSTALLER_LINK),\n cscIKeyPassword: chooseNotNull(this.platformSpecificBuildOptions.cscInstallerKeyPassword, process.env.CSC_INSTALLER_KEY_PASSWORD),\n currentDir: this.projectDir,\n }\n\n return selected\n },\n async selected => {\n if (selected) {\n return createKeychain(selected).then(result => {\n const keychainFile = result.keychainFile\n if (keychainFile != null) {\n this.info.disposeOnBuildFinish(() => removeKeychain(keychainFile))\n }\n return result\n })\n }\n\n return Promise.resolve({ keychainFile: process.env.CSC_KEYCHAIN || null })\n }\n )\n\n private _iconPath = new Lazy(() => this.getOrConvertIcon(\"icns\"))\n\n readonly helper = new MacTargetHelper(this)\n\n constructor(info: Packager) {\n super(info, Platform.MAC)\n }\n\n get defaultTarget(): Array<string> {\n return this.info.framework.macOsDefaultTargets\n }\n\n /**\n * Get the merged configuration for a specific platform type\n */\n getPlatformConfig(platformType: PlatformType): PlatformConfig {\n let config: MacConfiguration | MasConfiguration\n let platformName: ElectronPlatformName\n\n switch (platformType) {\n case \"mas\":\n config = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas)\n platformName = \"mas\"\n break\n\n case \"mas-dev\":\n // `mas-dev` cascades mac → mas → masDev. The development/distribution distinction is no longer\n // carried as a config field; it is derived from `platformType` wherever signing happens.\n config = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas, this.config.masDev)\n platformName = \"mas\"\n break\n\n case \"mac\":\n default:\n config = this.platformSpecificBuildOptions\n platformName = this.platform.nodeName as ElectronPlatformName\n break\n }\n\n return { type: platformType, config, platformName }\n }\n\n expandArch(pattern: string, arch?: Arch | null): string[] {\n if (arch === Arch.universal) {\n // Universal build has `app-x64.asar.unpacked` & `app-arm64.asar.unpacked`\n return [doExpandMacro(pattern, Arch[Arch.arm64], this.appInfo, {}, false), doExpandMacro(pattern, Arch[Arch.x64], this.appInfo, {}, false)]\n }\n // Every other build keeps the name as `app.asar.unpacked`\n return [doExpandMacro(pattern, null, this.appInfo, {}, false)]\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected prepareAppInfo(appInfo: AppInfo): AppInfo {\n const macAppInfo = new AppInfo(this.info, this.platformSpecificBuildOptions.bundleVersion, this.platformSpecificBuildOptions)\n // Electron discovers its helper apps via `${CFBundleName} Helper.app`. We use the product name\n // verbatim for `CFBundleName` and for the on-disk helper/app bundle names, so a name that\n // filename sanitization would change must be rejected (otherwise the two would diverge and break\n // helper discovery). Fail fast during setup.\n assertSafeHelperName(macAppInfo.productName, \"productName\")\n const executableName = this.platformSpecificBuildOptions.executableName ?? this.info.config.executableName\n if (executableName != null) {\n assertSafeHelperName(executableName, \"executableName\")\n }\n return macAppInfo\n }\n\n async getIconPath(): Promise<string | null> {\n return this._iconPath.value\n }\n\n createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void {\n for (const name of targets) {\n switch (name) {\n case DIR_TARGET:\n break\n\n case \"dmg\": {\n mapper(name, outDir => {\n const { DmgTarget } = _require(\"dmg-builder\")\n return new DmgTarget(this, outDir)\n })\n break\n }\n\n case \"zip\":\n // https://github.com/electron-userland/electron-builder/issues/2313\n mapper(name, outDir => new ArchiveTarget(name, outDir, this, true))\n break\n\n case \"pkg\":\n mapper(name, outDir => new PkgTarget(this, outDir))\n break\n\n default:\n mapper(name, outDir => (MacTargetHelper.isMasTarget(name) ? new NoOpTarget(name) : createCommonTarget(name, outDir, this)))\n break\n }\n }\n }\n\n protected async doPack(config: DoPackOptions<MacConfiguration>): Promise<any> {\n if (config.arch === Arch.universal) {\n return this.doUniversalPack(config)\n }\n return await super.doPack(config)\n }\n\n /**\n * Handle universal build packing\n */\n private async doUniversalPack(config: DoPackOptions<MacConfiguration>): Promise<void> {\n const { outDir, appOutDir, platformName, platformType, arch, platformSpecificBuildOptions, targets } = config\n\n const outDirName = (arch: Arch) => `${appOutDir}-${Arch[arch]}-temp`\n const options = {\n ...config,\n options: {\n sign: false,\n disableAsarIntegrity: true,\n disableFuses: true,\n // Keep both slices symmetric: don't drop platform-mismatched modules per-arch (that asymmetry breaks\n // the universal merge). Single-arch binaries are reconciled below via `computeSingleArchFiles`.\n disableArchFilter: true,\n },\n }\n\n const x64Arch = Arch.x64\n const x64AppOutDir = outDirName(x64Arch)\n await super.doPack({ ...options, appOutDir: x64AppOutDir, arch: x64Arch })\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const arm64Arch = Arch.arm64\n const arm64AppOutPath = outDirName(arm64Arch)\n await super.doPack({ ...options, appOutDir: arm64AppOutPath, arch: arm64Arch })\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const framework = this.info.framework\n log.info(\n {\n platform: platformName,\n arch: Arch[arch],\n [`${framework.name}`]: framework.version,\n appOutDir: log.filePath(appOutDir),\n },\n `packaging`\n )\n const appFile = `${this.appInfo.productFilename}.app`\n\n // Make sure the Assets.car file is the same for both architectures\n const safeX64AppOutDir = sanitizeDirPath(x64AppOutDir)\n const safeArm64AppOutPath = sanitizeDirPath(arm64AppOutPath)\n const safeAppOutDir = sanitizeDirPath(appOutDir)\n\n const sourceCatalogPath = path.join(safeX64AppOutDir, appFile, \"Contents/Resources/Assets.car\")\n if (await exists(sourceCatalogPath)) {\n const targetCatalogPath = path.join(safeArm64AppOutPath, appFile, \"Contents/Resources/Assets.car\")\n await fs.copyFile(sourceCatalogPath, targetCatalogPath)\n }\n\n const universalOpts = platformSpecificBuildOptions.universal\n\n // Single-arch binaries that can't be merged into a universal Mach-O. Two sources:\n // 1. `cpu`/`os`-declared platform packages (e.g. `@esbuild/darwin-arm64`), which the collection filter\n // confines to their native slice — mark the whole package so unique non-binary siblings don't trip the merge.\n // 2. Host binaries identical in both slices inside packages that declare no `cpu`/`os` (e.g. esbuild's\n // install script overwriting `esbuild/bin/esbuild` with the platform binary) — mark the file.\n // Both are reported to `@electron/universal` via `singleArchFiles`; otherwise it aborts on the arch mismatch.\n const singleArchFiles = await this.computeSingleArchFiles(\n path.join(safeX64AppOutDir, appFile),\n path.join(safeArm64AppOutPath, appFile),\n universalOpts?.singleArchFiles ?? undefined\n )\n\n await makeUniversalApp({\n mergeASARs: true, // preserve electron-builder v2 default; user can override via mac.universal.mergeASARs\n ...universalOpts,\n singleArchFiles,\n x64AppPath: path.join(safeX64AppOutDir, appFile),\n arm64AppPath: path.join(safeArm64AppOutPath, appFile),\n outAppPath: path.join(safeAppOutDir, appFile),\n force: true,\n })\n await fs.rm(x64AppOutDir, { recursive: true, force: true })\n await fs.rm(arm64AppOutPath, { recursive: true, force: true })\n\n // Give users a final opportunity to perform things on the combined universal package before signing\n const packContext: AfterPackContext = {\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n }\n await this.info.emitAfterPack(packContext)\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n await this.doAddElectronFuses(packContext)\n\n // Mirror the base-class guard: skip signing when the caller explicitly set sign:false\n // (e.g. packMasTargets passes sign:false so that signMas() is the sole signing step).\n if (config.options?.sign ?? true) {\n await this.doSignAfterPack(outDir, appOutDir, platformName, platformType, arch, platformSpecificBuildOptions, targets)\n }\n }\n\n /**\n * Builds the `singleArchFiles` glob passed to `@electron/universal` by scanning both packed slices for\n * single-architecture binaries that can't be lipo-merged. Merges any user-provided `mac.universal.singleArchFiles`.\n */\n private async computeSingleArchFiles(x64AppPath: string, arm64AppPath: string, userPattern: string | undefined): Promise<string | undefined> {\n const unpacked = (appPath: string) => path.join(appPath, \"Contents\", \"Resources\", \"app.asar.unpacked\")\n const x64Unpacked = unpacked(x64AppPath)\n const arm64Unpacked = unpacked(arm64AppPath)\n\n // (1) `cpu`/`os`-declared platform packages confined to one slice — mark the whole package.\n const packageNames = new Set<string>()\n await collectSingleArchPackageNames(path.join(x64Unpacked, \"node_modules\"), packageNames)\n await collectSingleArchPackageNames(path.join(arm64Unpacked, \"node_modules\"), packageNames)\n\n // (2) undeclared host binaries identical in both slices (e.g. `esbuild/bin/esbuild`) — mark the file.\n const machOFiles = await collectIdenticalSingleArchMachOFiles(x64Unpacked, arm64Unpacked)\n\n const patterns = [...Array.from(packageNames).map(name => `**/${name}/**`), ...machOFiles]\n if (patterns.length === 0) {\n return userPattern\n }\n\n log.warn(\n { packages: Array.from(packageNames).sort().join(\", \") || \"(none)\", files: machOFiles.sort().join(\", \") || \"(none)\" },\n \"Universal build contains single-architecture binaries; they are copied as-is per slice (not lipo-merged), so each is only usable on architectures whose platform package was installed on this build host. \" +\n \"If these are build-only tools (e.g. esbuild), move them to `devDependencies` or exclude them via `files` to omit them entirely. \" +\n \"If they are needed at runtime, install every target architecture's variant so the universal app works on both Intel and Apple Silicon (pnpm/yarn: `supportedArchitectures`; npm: `--cpu`/`--os`).\"\n )\n return buildSingleArchFilesPattern(patterns, userPattern)\n }\n\n async pack(outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): Promise<void> {\n const masTargets = targets.filter(it => MacTargetHelper.isMasTarget(it.name))\n const nonMasTargets = targets.filter(it => !MacTargetHelper.isMasTarget(it.name))\n const prepackaged = this.packagerOptions.prepackaged\n const hasMas = masTargets.length > 0\n\n // mas always first\n await this.packMasTargets(outDir, arch, masTargets, prepackaged)\n\n // Mirror master's condition: skip the non-MAS darwin pack only when there are exclusively MAS\n // targets (hasMas=true, targets.length=1). DIR_TARGET passes targets=[] to pack() because\n // MacPackager.createTargets() doesn't call mapper() for it, so hasMas=false and doPack still runs.\n if (!hasMas || targets.length > 1) {\n await this.packMacTargets(outDir, arch, nonMasTargets, prepackaged, taskManager)\n }\n }\n\n private async packMasTargets(outDir: string, arch: Arch, targets: Array<Target>, prepackaged: string | null | undefined): Promise<void> {\n const resolvedOutDir = path.resolve(outDir)\n MacTargetHelper.assertSafePathForCommandUsage(resolvedOutDir, \"output directory\")\n\n for (const target of targets) {\n const platformType = MacTargetHelper.getPlatformTypeFromTarget(target.name)\n const platformConfig = this.getPlatformConfig(platformType)\n const targetOutDir = path.resolve(resolvedOutDir, `${target.name}${getArchSuffix(arch, this.platformSpecificBuildOptions.defaultArch)}`)\n MacTargetHelper.assertSafePathForCommandUsage(targetOutDir, \"target output directory\")\n\n const relativeTargetOutDir = path.relative(resolvedOutDir, targetOutDir)\n if (relativeTargetOutDir.startsWith(\"..\") || path.isAbsolute(relativeTargetOutDir)) {\n throw new InvalidConfigurationError(`Invalid target output directory: ${targetOutDir}`)\n }\n\n let appPath: string = path.join(targetOutDir, `${this.appInfo.productFilename}.app`)\n if (prepackaged != null) {\n appPath = prepackaged\n } else {\n await this.doPack({\n outDir: resolvedOutDir,\n appOutDir: targetOutDir,\n platformName: platformConfig.platformName,\n platformType: platformConfig.type,\n arch,\n platformSpecificBuildOptions: platformConfig.config,\n targets: [target],\n options: { sign: false },\n })\n MacTargetHelper.assertSafePathForCommandUsage(this.appInfo.productFilename, \"product filename\")\n }\n await this.signMas(appPath, targetOutDir, arch, platformType)\n }\n }\n\n private async packMacTargets(outDir: string, arch: Arch, targets: Array<Target>, prepackaged: string | null | undefined, taskManager: AsyncTaskManager): Promise<void> {\n const appPath = prepackaged == null ? path.join(this.computeAppOutDir(outDir, arch), `${path.basename(this.appInfo.productFilename)}.app`) : prepackaged\n\n if (prepackaged == null) {\n const platformConfig = this.getPlatformConfig(\"mac\")\n await this.doPack({\n outDir,\n appOutDir: path.dirname(appPath),\n platformName: platformConfig.platformName,\n platformType: platformConfig.type,\n arch,\n platformSpecificBuildOptions: platformConfig.config,\n targets,\n })\n }\n\n this.packageInDistributableFormat(appPath, arch, targets, taskManager)\n }\n\n private async signMas(appPath: string, outDir: string, arch: Arch, targetPlatform: PlatformType): Promise<boolean> {\n const signed = await this.sign(appPath, outDir, arch, targetPlatform)\n return signed\n }\n\n /**\n * Main signing method with platform awareness\n */\n private async sign(appPath: string, outDir: string | null, arch: Arch, targetPlatform: PlatformType): Promise<boolean> {\n if (!isSignAllowed()) {\n return false\n }\n\n // getPlatformConfig cascades mac → mas → masDev, so `sign` (and `sign.identity`) is already merged for this flavor.\n const config = this.getPlatformConfig(targetPlatform).config.sign\n\n // sign: null → user explicitly disabled signing\n if (config === null) {\n return this.helper.handleNullIdentity()\n }\n\n const signOpts = isElectronSignOptions(config) ? config : undefined\n // sign.identity: null → explicit skip; undefined → auto-discover\n const qualifier = signOpts?.identity\n if (qualifier === null) {\n return this.helper.handleNullIdentity()\n }\n\n const keychainFile = (await this.codeSigningInfo.value).keychainFile\n // `config` is a custom fn/string module path when it's non-null and not an options object\n const hasCustomSign = config != null && !signOpts\n const isMas = MacTargetHelper.isMasTarget(targetPlatform)\n\n const identity = await this.helper.findSigningIdentity(targetPlatform, qualifier, keychainFile, hasCustomSign, signOpts)\n\n if (!identity) {\n return false\n }\n\n if (!isMacOsHighSierra()) {\n throw new InvalidConfigurationError(\"macOS High Sierra 10.13.6 is required to sign\")\n }\n\n const signOptions = await this.helper.buildSignOptions(appPath, identity, signOpts, keychainFile, arch, targetPlatform)\n await this.doSign(signOptions, config, identity)\n\n // Handle MAS installer creation (skipped for development-signed builds)\n if (outDir && MacTargetHelper.shouldCreateMasInstaller(targetPlatform, signOpts?.type)) {\n await this.helper.createMasInstaller(appPath, outDir, this.getPlatformConfig(targetPlatform).config as MasConfiguration, keychainFile, targetPlatform, arch, qualifier)\n }\n\n // Handle notarization for non-MAS builds\n if (!isMas) {\n await this.helper.notarizeIfProvided(appPath)\n }\n\n return true\n }\n\n //noinspection JSMethodCanBeStatic\n protected async doSign(opts: SignOptions, signConfig: MacConfiguration[\"sign\"], identity: Identity | null): Promise<void> {\n // Resolve a custom signer only when signConfig is a function or string module path.\n // ElectronSignOptions objects and undefined use @electron/osx-sign directly.\n const customSign =\n signConfig == null || isElectronSignOptions(signConfig) ? null : await resolveFunction(this.appInfo.type, signConfig, \"sign\", await this.info.getWorkspaceRoot())\n\n const { app, platform, type, provisioningProfile } = opts\n log.info(\n {\n file: log.filePath(app),\n platform,\n type,\n identityName: identity?.name || \"none\",\n identityHash: identity?.hash || \"none\",\n provisioningProfile: provisioningProfile || \"none\",\n },\n customSign ? \"executing custom sign\" : \"signing\"\n )\n\n return customSign ? Promise.resolve(customSign(opts, this)) : sign({ ...opts, identity: identity ? identity.name : undefined })\n }\n\n //noinspection JSMethodCanBeStatic\n public async doFlat(appPath: string, outFile: string, identity: Identity, keychain: string | Nullish): Promise<any> {\n const safeAppPath = sanitizeDirPath(appPath)\n const safeOutFile = sanitizeDirPath(outFile)\n // productbuild doesn't created directory for out file\n await mkdir(path.dirname(safeOutFile), { recursive: true })\n\n const args = prepareProductBuildArgs(identity, keychain)\n args.push(\"--component\", safeAppPath, \"/Applications\")\n args.push(safeOutFile)\n return await exec(\"productbuild\", args)\n }\n\n public getElectronSrcDir(dist: string) {\n return path.resolve(this.projectDir, dist, this.info.framework.distMacOsAppName)\n }\n\n public getElectronDestinationDir(appOutDir: string) {\n return path.join(appOutDir, this.info.framework.distMacOsAppName)\n }\n\n // todo fileAssociations\n async applyCommonInfo(appPlist: any, contentsPath: string, cascadedOptions: MacConfiguration | MasConfiguration): Promise<void> {\n const appInfo = this.appInfo\n const appFilename = appInfo.productFilename\n\n // https://github.com/electron-userland/electron-builder/issues/1278\n appPlist.CFBundleExecutable = appFilename.endsWith(\" Helper\") ? appFilename.substring(0, appFilename.length - \" Helper\".length) : appFilename\n\n const resourcesPath = path.join(contentsPath, \"Resources\")\n\n // Support both legacy `.icns` and modern `.icon` (Icon Composer) inputs via `mac.icon`.\n // Prefer `.icon` if provided; still accept `.icns`.\n const configuredIcon = this.platformSpecificBuildOptions.icon\n const isIconComposer = typeof configuredIcon === \"string\" && configuredIcon.toLowerCase().endsWith(\".icon\")\n\n // Set the app name. The product name is used verbatim (it is validated in `prepareAppInfo` to\n // require no filename sanitization), so `CFBundleName` matches the on-disk helper bundle names\n // that Electron resolves as `${CFBundleName} Helper.app`.\n appPlist.CFBundleName = appInfo.productName\n appPlist.CFBundleDisplayName = appInfo.productName\n\n // Bundle legacy `icns` format - this should also run when `.icon` is provided\n const setIcnsFile = async (iconPath: string) => {\n const oldIcon = appPlist.CFBundleIconFile\n if (oldIcon != null) {\n await unlinkIfExists(path.join(resourcesPath, oldIcon))\n }\n const iconFileName = \"icon.icns\"\n appPlist.CFBundleIconFile = iconFileName\n await copyFile(iconPath, path.join(resourcesPath, iconFileName))\n }\n\n const icnsFilePath = await this.getIconPath()\n if (icnsFilePath != null) {\n await setIcnsFile(icnsFilePath)\n }\n\n // Bundle new `icon` format\n if (isIconComposer && configuredIcon) {\n const iconComposerPath = await this.getResource(configuredIcon)\n if (iconComposerPath) {\n const { assetCatalog } = await this.generateAssetCatalogData(iconComposerPath)\n\n // Create and setup the asset catalog\n appPlist.CFBundleIconName = \"Icon\"\n await fs.writeFile(path.join(resourcesPath, \"Assets.car\"), assetCatalog)\n }\n }\n\n const minimumSystemVersion = this.platformSpecificBuildOptions.minimumSystemVersion\n if (minimumSystemVersion != null) {\n appPlist.LSMinimumSystemVersion = minimumSystemVersion\n }\n\n // const activeOpts = this.getPlatformConfig(distType).config\n appPlist.CFBundleShortVersionString = cascadedOptions.bundleShortVersion || appInfo.version\n appPlist.CFBundleVersion = cascadedOptions.bundleVersion || appInfo.buildVersion\n\n use(this.platformSpecificBuildOptions.category || (this.config as any).category, it => (appPlist.LSApplicationCategoryType = it))\n appPlist.NSHumanReadableCopyright = appInfo.copyright\n\n if (this.platformSpecificBuildOptions.darkModeSupport) {\n appPlist.NSRequiresAquaSystemAppearance = false\n }\n\n const extendInfo = this.platformSpecificBuildOptions.extendInfo\n if (extendInfo != null) {\n deepAssign(appPlist, extendInfo)\n }\n for (const [k, v] of Object.entries(appPlist)) {\n if (v === null || v === undefined) {\n delete appPlist[k]\n }\n }\n }\n\n protected async signApp(packContext: AfterPackContext, isAsar: boolean, platformType?: PlatformType): Promise<boolean> {\n const targetPlatform: PlatformType = platformType ?? (packContext.electronPlatformName === \"mas\" ? \"mas\" : \"mac\")\n const readDirectoryAndSign = async (sourceDirectory: string, directories: string[], shouldSign: (file: string) => boolean): Promise<boolean> => {\n const normalizedSourceDirectory = path.resolve(sourceDirectory)\n MacTargetHelper.assertSafePathForCommandUsage(normalizedSourceDirectory, \"application output directory\")\n await Promise.all(\n directories.map(async (file: string) => {\n if (shouldSign(file)) {\n const entryName = path.basename(file)\n if (file !== entryName) {\n throw new InvalidConfigurationError(`Invalid entry name in source directory: ${file}`)\n }\n const signTarget = path.resolve(normalizedSourceDirectory, entryName)\n const safeSignTarget = sanitizeDirPath(signTarget, normalizedSourceDirectory)\n await this.sign(safeSignTarget, null, packContext.arch, targetPlatform)\n }\n })\n )\n return true\n }\n\n const appFileName = `${this.appInfo.productFilename}.app`\n await readDirectoryAndSign(packContext.appOutDir, await readdir(packContext.appOutDir), file => file === appFileName)\n if (!isAsar) {\n return true\n }\n\n const outResourcesDir = path.join(packContext.appOutDir, \"resources\", \"app.asar.unpacked\")\n await readDirectoryAndSign(outResourcesDir, await orIfFileNotExist(readdir(outResourcesDir), []), file => file.endsWith(\".app\"))\n\n return true\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"macPackager.js","sourceRoot":"","sources":["../src/macPackager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAG3C,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC/C,OAAO,EACL,IAAI,EAEJ,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,MAAM,EACN,aAAa,EACb,yBAAyB,EACzB,GAAG,EACH,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,GAAG,GACJ,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAW,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAA;AACzE,OAAO,EAAmB,cAAc,EAAmC,aAAa,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AACrJ,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAiB,MAAM,0BAA0B,CAAA;AAChG,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAU,MAAM,WAAW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,UAAU,EAAE,yBAAyB,CAAC,CAAA;gBAC7E,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,IAAI,EAAE,cAAc,CAAC,CAAA;YAC1E,CAAC,CAAC,CACL,CAAA;QACH,CAAC,CAAA;QAED,MAAM,WAAW,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,MAAM,CAAA;QACzD,+GAA+G;QAC/G,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,WAAW,CAAC,CAAA;QACrI,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAA;QACpC,CAAC;QAED,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAA;QAC1F,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,oBAAoB,CAAC,eAAe,EAAE,MAAM,gBAAgB,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;QAEnJ,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAA;IACpC,CAAC;CACF","sourcesContent":["import { createRequire } from \"node:module\"\nimport type { SignOptions } from \"@electron/osx-sign\"\n\nconst _require = createRequire(import.meta.url)\nimport {\n Arch,\n AsyncTaskManager,\n copyFile,\n deepAssign,\n exec,\n exists,\n getArchSuffix,\n InvalidConfigurationError,\n log,\n orIfFileNotExist,\n sanitizeDirPath,\n unlinkIfExists,\n use,\n} from \"builder-util\"\nimport { MemoLazy, Nullish } from \"builder-util-runtime\"\nimport * as fs from \"fs/promises\"\nimport { mkdir, readdir } from \"fs/promises\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { AppInfo } from \"./appInfo.js\"\nimport { assertSafeHelperName } from \"./electron/mac/electronMacUtils.js\"\nimport { CodeSigningInfo, createKeychain, CreateKeychainOptions, Identity, isSignAllowed, removeKeychain, sign } from \"./codeSign/mac/macCodeSign.js\"\nimport { combineSignResults, isSignResultSigned, SigningResult } from \"./codeSign/signResult.js\"\nimport { DIR_TARGET, Platform, Target } from \"./core.js\"\nimport { AfterPackContext, ElectronPlatformName } from \"./index.js\"\nimport { MacTargetHelper, MasPlatformType, PlatformType } from \"./targets/mac/MacTargetHelper.js\"\nimport { ElectronSignOptions, MacConfiguration, MasConfiguration } from \"./options/macOptions.js\"\nimport { Packager } from \"./packager.js\"\nimport { chooseNotNull, DoPackOptions, PlatformPackager } from \"./platformPackager.js\"\nimport { ArchiveTarget } from \"./targets/ArchiveTarget.js\"\nimport { PkgTarget, prepareProductBuildArgs } from \"./targets/mac/pkg.js\"\nimport { createCommonTarget, NoOpTarget } from \"./targets/targetFactory.js\"\nimport { isMacOsHighSierra } from \"./util/mac/macosVersion.js\"\nimport { buildSingleArchFilesPattern, collectIdenticalSingleArchMachOFiles, collectSingleArchPackageNames } from \"./util/archCompatibility.js\"\nimport { expandMacro as doExpandMacro } from \"./util/macroExpander.js\"\nimport { resolveFunction } from \"./util/resolve.js\"\nimport { makeUniversalApp } from \"@electron/universal\"\n\nexport type CustomMacSignOptions = SignOptions\nexport type CustomMacSign = (configuration: CustomMacSignOptions, packager: MacPackager) => Promise<void>\n\nfunction isElectronSignOptions(sign: MacConfiguration[\"sign\"]): sign is ElectronSignOptions {\n return typeof sign === \"object\" && sign !== null\n}\n\ninterface PlatformConfig<C extends MacConfiguration | MasConfiguration = MacConfiguration | MasConfiguration> {\n type: PlatformType\n config: C\n platformName: ElectronPlatformName\n}\n\nexport class MacPackager extends PlatformPackager<MacConfiguration | MasConfiguration> {\n readonly codeSigningInfo = new MemoLazy<CreateKeychainOptions | null, CodeSigningInfo>(\n () => {\n const cscLink = this.getCscLink()\n if (cscLink == null || process.platform !== \"darwin\") {\n return null\n }\n\n const selected = {\n tmpDir: this.tempDirManager,\n cscLink,\n cscKeyPassword: this.getCscPassword(),\n cscILink: chooseNotNull(this.platformSpecificBuildOptions.cscInstallerLink, process.env.CSC_INSTALLER_LINK),\n cscIKeyPassword: chooseNotNull(this.platformSpecificBuildOptions.cscInstallerKeyPassword, process.env.CSC_INSTALLER_KEY_PASSWORD),\n currentDir: this.projectDir,\n }\n\n return selected\n },\n async selected => {\n if (selected) {\n return createKeychain(selected).then(result => {\n const keychainFile = result.keychainFile\n if (keychainFile != null) {\n this.info.disposeOnBuildFinish(() => removeKeychain(keychainFile))\n }\n return result\n })\n }\n\n return Promise.resolve({ keychainFile: process.env.CSC_KEYCHAIN || null })\n }\n )\n\n private _iconPath = new Lazy(() => this.getOrConvertIcon(\"icns\"))\n\n readonly helper = new MacTargetHelper(this)\n\n constructor(info: Packager) {\n super(info, Platform.MAC)\n }\n\n get defaultTarget(): Array<string> {\n return this.info.framework.macOsDefaultTargets\n }\n\n /**\n * Get the merged configuration for a specific platform type. Calls statically known to be a MAS\n * flavor (`mas` / `mas-dev`) get a `MasConfiguration` back, so no cast is needed downstream.\n */\n getPlatformConfig(platformType: MasPlatformType): PlatformConfig<MasConfiguration>\n getPlatformConfig(platformType: PlatformType): PlatformConfig\n getPlatformConfig(platformType: PlatformType): PlatformConfig {\n let config: MacConfiguration | MasConfiguration\n let platformName: ElectronPlatformName\n\n switch (platformType) {\n case \"mas\":\n config = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas)\n platformName = \"mas\"\n break\n\n case \"mas-dev\":\n // `mas-dev` cascades mac → mas → masDev. The development/distribution distinction is no longer\n // carried as a config field; it is derived from `platformType` wherever signing happens.\n config = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas, this.config.masDev)\n platformName = \"mas\"\n break\n\n case \"mac\":\n default:\n config = this.platformSpecificBuildOptions\n platformName = this.platform.nodeName as ElectronPlatformName\n break\n }\n\n return { type: platformType, config, platformName }\n }\n\n expandArch(pattern: string, arch?: Arch | null): string[] {\n if (arch === Arch.universal) {\n // Universal build has `app-x64.asar.unpacked` & `app-arm64.asar.unpacked`\n return [doExpandMacro(pattern, Arch[Arch.arm64], this.appInfo, {}, false), doExpandMacro(pattern, Arch[Arch.x64], this.appInfo, {}, false)]\n }\n // Every other build keeps the name as `app.asar.unpacked`\n return [doExpandMacro(pattern, null, this.appInfo, {}, false)]\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected prepareAppInfo(appInfo: AppInfo): AppInfo {\n const macAppInfo = new AppInfo(this.info, this.platformSpecificBuildOptions.bundleVersion, this.platformSpecificBuildOptions)\n // Electron discovers its helper apps via `${CFBundleName} Helper.app`. We use the product name\n // verbatim for `CFBundleName` and for the on-disk helper/app bundle names, so a name that\n // filename sanitization would change must be rejected (otherwise the two would diverge and break\n // helper discovery). Fail fast during setup.\n assertSafeHelperName(macAppInfo.productName, \"productName\")\n const executableName = this.platformSpecificBuildOptions.executableName ?? this.info.config.executableName\n if (executableName != null) {\n assertSafeHelperName(executableName, \"executableName\")\n }\n return macAppInfo\n }\n\n async getIconPath(): Promise<string | null> {\n return this._iconPath.value\n }\n\n createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void {\n for (const name of targets) {\n switch (name) {\n case DIR_TARGET:\n break\n\n case \"dmg\": {\n mapper(name, outDir => {\n const { DmgTarget } = _require(\"dmg-builder\")\n return new DmgTarget(this, outDir)\n })\n break\n }\n\n case \"zip\":\n // https://github.com/electron-userland/electron-builder/issues/2313\n mapper(name, outDir => new ArchiveTarget(name, outDir, this, true))\n break\n\n case \"pkg\":\n mapper(name, outDir => new PkgTarget(this, outDir))\n break\n\n default:\n mapper(name, outDir => (MacTargetHelper.isMasTarget(name) ? new NoOpTarget(name) : createCommonTarget(name, outDir, this)))\n break\n }\n }\n }\n\n protected async doPack(config: DoPackOptions<MacConfiguration>): Promise<any> {\n if (config.arch === Arch.universal) {\n return this.doUniversalPack(config)\n }\n return await super.doPack(config)\n }\n\n /**\n * Handle universal build packing\n */\n private async doUniversalPack(config: DoPackOptions<MacConfiguration>): Promise<void> {\n const { outDir, appOutDir, platformName, platformType, arch, platformSpecificBuildOptions, targets } = config\n\n const outDirName = (arch: Arch) => `${appOutDir}-${Arch[arch]}-temp`\n const options = {\n ...config,\n options: {\n sign: false,\n disableAsarIntegrity: true,\n disableFuses: true,\n // Keep both slices symmetric: don't drop platform-mismatched modules per-arch (that asymmetry breaks\n // the universal merge). Single-arch binaries are reconciled below via `computeSingleArchFiles`.\n disableArchFilter: true,\n },\n }\n\n const x64Arch = Arch.x64\n const x64AppOutDir = outDirName(x64Arch)\n await super.doPack({ ...options, appOutDir: x64AppOutDir, arch: x64Arch })\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const arm64Arch = Arch.arm64\n const arm64AppOutPath = outDirName(arm64Arch)\n await super.doPack({ ...options, appOutDir: arm64AppOutPath, arch: arm64Arch })\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const framework = this.info.framework\n log.info(\n {\n platform: platformName,\n arch: Arch[arch],\n [`${framework.name}`]: framework.version,\n appOutDir: log.filePath(appOutDir),\n },\n `packaging`\n )\n const appFile = `${this.appInfo.productFilename}.app`\n\n // Make sure the Assets.car file is the same for both architectures\n const safeX64AppOutDir = sanitizeDirPath(x64AppOutDir)\n const safeArm64AppOutPath = sanitizeDirPath(arm64AppOutPath)\n const safeAppOutDir = sanitizeDirPath(appOutDir)\n\n const sourceCatalogPath = path.join(safeX64AppOutDir, appFile, \"Contents/Resources/Assets.car\")\n if (await exists(sourceCatalogPath)) {\n const targetCatalogPath = path.join(safeArm64AppOutPath, appFile, \"Contents/Resources/Assets.car\")\n await fs.copyFile(sourceCatalogPath, targetCatalogPath)\n }\n\n const universalOpts = platformSpecificBuildOptions.universal\n\n // Single-arch binaries that can't be merged into a universal Mach-O. Two sources:\n // 1. `cpu`/`os`-declared platform packages (e.g. `@esbuild/darwin-arm64`), which the collection filter\n // confines to their native slice — mark the whole package so unique non-binary siblings don't trip the merge.\n // 2. Host binaries identical in both slices inside packages that declare no `cpu`/`os` (e.g. esbuild's\n // install script overwriting `esbuild/bin/esbuild` with the platform binary) — mark the file.\n // Both are reported to `@electron/universal` via `singleArchFiles`; otherwise it aborts on the arch mismatch.\n const singleArchFiles = await this.computeSingleArchFiles(\n path.join(safeX64AppOutDir, appFile),\n path.join(safeArm64AppOutPath, appFile),\n universalOpts?.singleArchFiles ?? undefined\n )\n\n await makeUniversalApp({\n mergeASARs: true, // preserve electron-builder v2 default; user can override via mac.universal.mergeASARs\n ...universalOpts,\n singleArchFiles,\n x64AppPath: path.join(safeX64AppOutDir, appFile),\n arm64AppPath: path.join(safeArm64AppOutPath, appFile),\n outAppPath: path.join(safeAppOutDir, appFile),\n force: true,\n })\n await fs.rm(x64AppOutDir, { recursive: true, force: true })\n await fs.rm(arm64AppOutPath, { recursive: true, force: true })\n\n // Give users a final opportunity to perform things on the combined universal package before signing\n const packContext: AfterPackContext = {\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n }\n await this.info.emitAfterPack(packContext)\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n await this.doAddElectronFuses(packContext)\n\n // Mirror the base-class guard: skip signing when the caller explicitly set sign:false\n // (e.g. packMasTargets passes sign:false so that its own sign() call is the sole signing step).\n if (config.options?.sign ?? true) {\n await this.doSignAfterPack(outDir, appOutDir, platformName, platformType, arch, platformSpecificBuildOptions, targets)\n }\n }\n\n /**\n * Builds the `singleArchFiles` glob passed to `@electron/universal` by scanning both packed slices for\n * single-architecture binaries that can't be lipo-merged. Merges any user-provided `mac.universal.singleArchFiles`.\n */\n private async computeSingleArchFiles(x64AppPath: string, arm64AppPath: string, userPattern: string | undefined): Promise<string | undefined> {\n const unpacked = (appPath: string) => path.join(appPath, \"Contents\", \"Resources\", \"app.asar.unpacked\")\n const x64Unpacked = unpacked(x64AppPath)\n const arm64Unpacked = unpacked(arm64AppPath)\n\n // (1) `cpu`/`os`-declared platform packages confined to one slice — mark the whole package.\n const packageNames = new Set<string>()\n await collectSingleArchPackageNames(path.join(x64Unpacked, \"node_modules\"), packageNames)\n await collectSingleArchPackageNames(path.join(arm64Unpacked, \"node_modules\"), packageNames)\n\n // (2) undeclared host binaries identical in both slices (e.g. `esbuild/bin/esbuild`) — mark the file.\n const machOFiles = await collectIdenticalSingleArchMachOFiles(x64Unpacked, arm64Unpacked)\n\n const patterns = [...Array.from(packageNames).map(name => `**/${name}/**`), ...machOFiles]\n if (patterns.length === 0) {\n return userPattern\n }\n\n log.warn(\n { packages: Array.from(packageNames).sort().join(\", \") || \"(none)\", files: machOFiles.sort().join(\", \") || \"(none)\" },\n \"Universal build contains single-architecture binaries; they are copied as-is per slice (not lipo-merged), so each is only usable on architectures whose platform package was installed on this build host. \" +\n \"If these are build-only tools (e.g. esbuild), move them to `devDependencies` or exclude them via `files` to omit them entirely. \" +\n \"If they are needed at runtime, install every target architecture's variant so the universal app works on both Intel and Apple Silicon (pnpm/yarn: `supportedArchitectures`; npm: `--cpu`/`--os`).\"\n )\n return buildSingleArchFilesPattern(patterns, userPattern)\n }\n\n async pack(outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): Promise<void> {\n const masTargets = targets.filter(it => MacTargetHelper.isMasTarget(it.name))\n const nonMasTargets = targets.filter(it => !MacTargetHelper.isMasTarget(it.name))\n const prepackaged = this.packagerOptions.prepackaged\n const hasMas = masTargets.length > 0\n\n // mas always first\n await this.packMasTargets(outDir, arch, masTargets, prepackaged)\n\n // Mirror master's condition: skip the non-MAS darwin pack only when there are exclusively MAS\n // targets (hasMas=true, targets.length=1). DIR_TARGET passes targets=[] to pack() because\n // MacPackager.createTargets() doesn't call mapper() for it, so hasMas=false and doPack still runs.\n if (!hasMas || targets.length > 1) {\n await this.packMacTargets(outDir, arch, nonMasTargets, prepackaged, taskManager)\n }\n }\n\n private async packMasTargets(outDir: string, arch: Arch, targets: Array<Target>, prepackaged: string | null | undefined): Promise<void> {\n const resolvedOutDir = path.resolve(outDir)\n MacTargetHelper.assertSafePathForCommandUsage(resolvedOutDir, \"output directory\")\n\n for (const target of targets) {\n const platformType = MacTargetHelper.getPlatformTypeFromTarget(target.name)\n const platformConfig = this.getPlatformConfig(platformType)\n const targetOutDir = path.resolve(resolvedOutDir, `${target.name}${getArchSuffix(arch, this.platformSpecificBuildOptions.defaultArch)}`)\n MacTargetHelper.assertSafePathForCommandUsage(targetOutDir, \"target output directory\")\n\n const relativeTargetOutDir = path.relative(resolvedOutDir, targetOutDir)\n if (relativeTargetOutDir.startsWith(\"..\") || path.isAbsolute(relativeTargetOutDir)) {\n throw new InvalidConfigurationError(`Invalid target output directory: ${targetOutDir}`)\n }\n\n let appPath: string = path.join(targetOutDir, `${this.appInfo.productFilename}.app`)\n if (prepackaged != null) {\n appPath = prepackaged\n } else {\n await this.doPack({\n outDir: resolvedOutDir,\n appOutDir: targetOutDir,\n platformName: platformConfig.platformName,\n platformType: platformConfig.type,\n arch,\n platformSpecificBuildOptions: platformConfig.config,\n targets: [target],\n options: { sign: false },\n })\n MacTargetHelper.assertSafePathForCommandUsage(this.appInfo.productFilename, \"product filename\")\n }\n const signResult = await this.sign(appPath, arch, platformType)\n const signed = isSignResultSigned(signResult)\n\n // The MAS flow packs with sign:false and signs here, bypassing doSignAfterPack — the only other\n // emitAfterSign site. Mirror its contract: fire afterSign after codesigning succeeded, but before\n // the .pkg installer is built, and warn when signing was skipped (#9997).\n const packContext: AfterPackContext = {\n appOutDir: path.dirname(appPath),\n outDir: resolvedOutDir,\n arch,\n targets: [target],\n packager: this,\n electronPlatformName: platformConfig.platformName,\n }\n if (signed) {\n await this.info.emitAfterSign(packContext)\n } else if (this.info.filterPackagerEventListeners(\"afterSign\", \"user\").length) {\n log.warn(null, `skipping \"afterSign\" hook as no signing occurred, perhaps you intended \"afterPack\"?`)\n }\n\n // test-only early exit (see PackagerOptions.afterPackTestHook); a no-op unless the option is set\n if (await this.info.shouldSkipTargetsAfterPack(packContext)) {\n continue\n }\n\n // A development-signed build (mas-dev, or an explicit sign.type \"development\" — see\n // MacTargetHelper.shouldCreateMasInstaller) produces no installer\n const masSignConfig = platformConfig.config.sign\n const masSignOpts = isElectronSignOptions(masSignConfig) ? masSignConfig : undefined\n if (signed && MacTargetHelper.shouldCreateMasInstaller(platformType, masSignOpts?.type)) {\n await this.createMasInstaller(appPath, targetOutDir, arch, platformType)\n }\n }\n }\n\n private async packMacTargets(outDir: string, arch: Arch, targets: Array<Target>, prepackaged: string | null | undefined, taskManager: AsyncTaskManager): Promise<void> {\n const appPath = prepackaged == null ? path.join(this.computeAppOutDir(outDir, arch), `${path.basename(this.appInfo.productFilename)}.app`) : prepackaged\n\n if (prepackaged == null) {\n const platformConfig = this.getPlatformConfig(\"mac\")\n await this.doPack({\n outDir,\n appOutDir: path.dirname(appPath),\n platformName: platformConfig.platformName,\n platformType: platformConfig.type,\n arch,\n platformSpecificBuildOptions: platformConfig.config,\n targets,\n })\n }\n\n // test-only early exit (see PackagerOptions.afterPackTestHook); a no-op unless the option is set\n if (\n await this.info.shouldSkipTargetsAfterPack({\n appOutDir: path.dirname(appPath),\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: this.platform.nodeName as ElectronPlatformName,\n })\n ) {\n return\n }\n\n this.packageInDistributableFormat(appPath, arch, targets, taskManager)\n }\n\n /**\n * Creates the signed MAS installer .pkg for an already codesigned app. Kept separate from `sign()`\n * so that the `afterSign` hook can run between codesigning and installer creation (see `packMasTargets`).\n */\n protected async createMasInstaller(appPath: string, outDir: string, arch: Arch, targetPlatform: MasPlatformType): Promise<void> {\n const config = this.getPlatformConfig(targetPlatform).config\n const signConfig = config.sign\n const signOpts = isElectronSignOptions(signConfig) ? signConfig : undefined\n const keychainFile = (await this.codeSigningInfo.value).keychainFile\n await this.helper.createMasInstaller(appPath, outDir, config, keychainFile, targetPlatform, arch, signOpts?.identity)\n }\n\n /**\n * Main signing method with platform awareness. Protected so tests can stub signing\n * (`isSignAllowed()` short-circuits it on non-mac hosts). Failures are thrown, never returned.\n */\n protected async sign(appPath: string, arch: Arch, targetPlatform: PlatformType): Promise<SigningResult> {\n if (!isSignAllowed()) {\n // non-mac host, or the pull-request CI guard — signing cannot happen in this environment\n return \"skipped:unsupported\"\n }\n\n // getPlatformConfig cascades mac → mas → masDev, so `sign` (and `sign.identity`) is already merged for this flavor.\n const config = this.getPlatformConfig(targetPlatform).config.sign\n\n // sign: null → user explicitly disabled signing\n if (config === null) {\n return this.helper.handleNullIdentity()\n }\n\n const signOpts = isElectronSignOptions(config) ? config : undefined\n // sign.identity: null → explicit skip; undefined → auto-discover\n const qualifier = signOpts?.identity\n if (qualifier === null) {\n return this.helper.handleNullIdentity()\n }\n\n const keychainFile = (await this.codeSigningInfo.value).keychainFile\n // `config` is a custom fn/string module path when it's non-null and not an options object\n const hasCustomSign = config != null && !signOpts\n const isMas = MacTargetHelper.isMasTarget(targetPlatform)\n\n const identity = await this.helper.findSigningIdentity(targetPlatform, qualifier, keychainFile, hasCustomSign, signOpts)\n\n if (!identity) {\n return \"skipped:no-certificate\"\n }\n\n if (!isMacOsHighSierra()) {\n throw new InvalidConfigurationError(\"macOS High Sierra 10.13.6 is required to sign\")\n }\n\n const signOptions = await this.helper.buildSignOptions(appPath, identity, signOpts, keychainFile, arch, targetPlatform)\n await this.doSign(signOptions, config, identity)\n\n // now that everything is signed, flag binaries that still carry a foreign (or missing) signature and would\n // fail library validation at launch — the case the old blanket entitlements default used to mask\n if (!hasCustomSign) {\n await this.helper.warnAboutForeignSignedBinaries(appPath, identity, targetPlatform, signOpts)\n }\n\n // Handle notarization for non-MAS builds\n if (!isMas) {\n await this.helper.notarizeIfProvided(appPath)\n }\n\n return hasCustomSign ? \"signed:custom\" : \"signed\"\n }\n\n //noinspection JSMethodCanBeStatic\n protected async doSign(opts: SignOptions, signConfig: MacConfiguration[\"sign\"], identity: Identity | null): Promise<void> {\n // Resolve a custom signer only when signConfig is a function or string module path.\n // ElectronSignOptions objects and undefined use @electron/osx-sign directly.\n const customSign =\n signConfig == null || isElectronSignOptions(signConfig) ? null : await resolveFunction(this.appInfo.type, signConfig, \"sign\", await this.info.getWorkspaceRoot())\n\n const { app, platform, type, provisioningProfile } = opts\n log.info(\n {\n file: log.filePath(app),\n platform,\n type,\n identityName: identity?.name || \"none\",\n identityHash: identity?.hash || \"none\",\n provisioningProfile: provisioningProfile || \"none\",\n },\n customSign ? \"executing custom sign\" : \"signing\"\n )\n\n return customSign ? Promise.resolve(customSign(opts, this)) : sign({ ...opts, identity: identity ? identity.name : undefined })\n }\n\n //noinspection JSMethodCanBeStatic\n public async doFlat(appPath: string, outFile: string, identity: Identity, keychain: string | Nullish): Promise<any> {\n const safeAppPath = sanitizeDirPath(appPath)\n const safeOutFile = sanitizeDirPath(outFile)\n // productbuild doesn't created directory for out file\n await mkdir(path.dirname(safeOutFile), { recursive: true })\n\n const args = prepareProductBuildArgs(identity, keychain)\n args.push(\"--component\", safeAppPath, \"/Applications\")\n args.push(safeOutFile)\n return await exec(\"productbuild\", args)\n }\n\n public getElectronSrcDir(dist: string) {\n return path.resolve(this.projectDir, dist, this.info.framework.distMacOsAppName)\n }\n\n public getElectronDestinationDir(appOutDir: string) {\n return path.join(appOutDir, this.info.framework.distMacOsAppName)\n }\n\n // todo fileAssociations\n async applyCommonInfo(appPlist: any, contentsPath: string, cascadedOptions: MacConfiguration | MasConfiguration): Promise<void> {\n const appInfo = this.appInfo\n const appFilename = appInfo.productFilename\n\n // https://github.com/electron-userland/electron-builder/issues/1278\n appPlist.CFBundleExecutable = appFilename.endsWith(\" Helper\") ? appFilename.substring(0, appFilename.length - \" Helper\".length) : appFilename\n\n const resourcesPath = path.join(contentsPath, \"Resources\")\n\n // Support both legacy `.icns` and modern `.icon` (Icon Composer) inputs via `mac.icon`.\n // Prefer `.icon` if provided; still accept `.icns`.\n const configuredIcon = this.platformSpecificBuildOptions.icon\n const isIconComposer = typeof configuredIcon === \"string\" && configuredIcon.toLowerCase().endsWith(\".icon\")\n\n // Set the app name. The product name is used verbatim (it is validated in `prepareAppInfo` to\n // require no filename sanitization), so `CFBundleName` matches the on-disk helper bundle names\n // that Electron resolves as `${CFBundleName} Helper.app`.\n appPlist.CFBundleName = appInfo.productName\n appPlist.CFBundleDisplayName = appInfo.productName\n\n // Bundle legacy `icns` format - this should also run when `.icon` is provided\n const setIcnsFile = async (iconPath: string) => {\n const oldIcon = appPlist.CFBundleIconFile\n if (oldIcon != null) {\n await unlinkIfExists(path.join(resourcesPath, oldIcon))\n }\n const iconFileName = \"icon.icns\"\n appPlist.CFBundleIconFile = iconFileName\n await copyFile(iconPath, path.join(resourcesPath, iconFileName))\n }\n\n const icnsFilePath = await this.getIconPath()\n if (icnsFilePath != null) {\n await setIcnsFile(icnsFilePath)\n }\n\n // Bundle new `icon` format\n if (isIconComposer && configuredIcon) {\n const iconComposerPath = await this.getResource(configuredIcon)\n if (iconComposerPath) {\n const { assetCatalog } = await this.generateAssetCatalogData(iconComposerPath)\n\n // Create and setup the asset catalog\n appPlist.CFBundleIconName = \"Icon\"\n await fs.writeFile(path.join(resourcesPath, \"Assets.car\"), assetCatalog)\n }\n }\n\n const minimumSystemVersion = this.platformSpecificBuildOptions.minimumSystemVersion\n if (minimumSystemVersion != null) {\n appPlist.LSMinimumSystemVersion = minimumSystemVersion\n }\n\n // const activeOpts = this.getPlatformConfig(distType).config\n appPlist.CFBundleShortVersionString = cascadedOptions.bundleShortVersion || appInfo.version\n appPlist.CFBundleVersion = cascadedOptions.bundleVersion || appInfo.buildVersion\n\n use(this.platformSpecificBuildOptions.category || (this.config as any).category, it => (appPlist.LSApplicationCategoryType = it))\n appPlist.NSHumanReadableCopyright = appInfo.copyright\n\n if (this.platformSpecificBuildOptions.darkModeSupport) {\n appPlist.NSRequiresAquaSystemAppearance = false\n }\n\n const extendInfo = this.platformSpecificBuildOptions.extendInfo\n if (extendInfo != null) {\n deepAssign(appPlist, extendInfo)\n }\n for (const [k, v] of Object.entries(appPlist)) {\n if (v === null || v === undefined) {\n delete appPlist[k]\n }\n }\n }\n\n protected async signApp(packContext: AfterPackContext, isAsar: boolean, platformType?: PlatformType): Promise<SigningResult> {\n const targetPlatform: PlatformType = platformType ?? (packContext.electronPlatformName === \"mas\" ? \"mas\" : \"mac\")\n const readDirectoryAndSign = async (sourceDirectory: string, directories: string[], shouldSign: (file: string) => boolean): Promise<Array<SigningResult>> => {\n const normalizedSourceDirectory = path.resolve(sourceDirectory)\n MacTargetHelper.assertSafePathForCommandUsage(normalizedSourceDirectory, \"application output directory\")\n return await Promise.all(\n directories\n .filter(file => shouldSign(file))\n .map(async (file: string) => {\n const entryName = path.basename(file)\n if (file !== entryName) {\n throw new InvalidConfigurationError(`Invalid entry name in source directory: ${file}`)\n }\n const signTarget = path.resolve(normalizedSourceDirectory, entryName)\n const safeSignTarget = sanitizeDirPath(signTarget, normalizedSourceDirectory)\n return await this.sign(safeSignTarget, packContext.arch, targetPlatform)\n })\n )\n }\n\n const appFileName = `${this.appInfo.productFilename}.app`\n // the combined result gates the `afterSign` hook — a signed result wins (see PlatformPackager.doSignAfterPack)\n const results = await readDirectoryAndSign(packContext.appOutDir, await readdir(packContext.appOutDir), file => file === appFileName)\n if (!isAsar) {\n return combineSignResults(results)\n }\n\n const outResourcesDir = path.join(packContext.appOutDir, \"resources\", \"app.asar.unpacked\")\n results.push(...(await readDirectoryAndSign(outResourcesDir, await orIfFileNotExist(readdir(outResourcesDir), []), file => file.endsWith(\".app\"))))\n\n return combineSignResults(results)\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node-module-collector/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAE,MA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