app-builder-lib 26.0.8 → 26.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/out/electron/electronMac.js +45 -45
  2. package/out/electron/electronMac.js.map +1 -1
  3. package/out/frameworks/LibUiFramework.js +4 -6
  4. package/out/frameworks/LibUiFramework.js.map +1 -1
  5. package/out/macPackager.js +1 -1
  6. package/out/macPackager.js.map +1 -1
  7. package/out/node-module-collector/index.d.ts +3 -0
  8. package/out/node-module-collector/index.js +13 -2
  9. package/out/node-module-collector/index.js.map +1 -1
  10. package/out/node-module-collector/nodeModulesCollector.d.ts +7 -1
  11. package/out/node-module-collector/nodeModulesCollector.js +1 -1
  12. package/out/node-module-collector/nodeModulesCollector.js.map +1 -1
  13. package/out/node-module-collector/npmNodeModulesCollector.d.ts +8 -2
  14. package/out/node-module-collector/npmNodeModulesCollector.js +3 -3
  15. package/out/node-module-collector/npmNodeModulesCollector.js.map +1 -1
  16. package/out/node-module-collector/pnpmNodeModulesCollector.d.ts +9 -2
  17. package/out/node-module-collector/pnpmNodeModulesCollector.js +18 -3
  18. package/out/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
  19. package/out/node-module-collector/yarnNodeModulesCollector.d.ts +5 -0
  20. package/out/node-module-collector/yarnNodeModulesCollector.js +5 -0
  21. package/out/node-module-collector/yarnNodeModulesCollector.js.map +1 -1
  22. package/out/packager.d.ts +2 -2
  23. package/out/packager.js +10 -10
  24. package/out/packager.js.map +1 -1
  25. package/out/publish/PublishManager.js +3 -2
  26. package/out/publish/PublishManager.js.map +1 -1
  27. package/out/targets/pkg.js +3 -3
  28. package/out/targets/pkg.js.map +1 -1
  29. package/out/targets/snap.js +5 -7
  30. package/out/targets/snap.js.map +1 -1
  31. package/out/util/asyncEventEmitter.d.ts +2 -2
  32. package/out/util/asyncEventEmitter.js +1 -4
  33. package/out/util/asyncEventEmitter.js.map +1 -1
  34. package/out/util/plist.d.ts +7 -0
  35. package/out/util/plist.js +31 -0
  36. package/out/util/plist.js.map +1 -0
  37. package/out/version.d.ts +1 -1
  38. package/out/version.js +1 -1
  39. package/out/version.js.map +1 -1
  40. package/package.json +9 -7
  41. package/templates/nsis/uninstaller.nsh +4 -4
@@ -4,9 +4,10 @@ exports.createMacApp = createMacApp;
4
4
  const builder_util_1 = require("builder-util");
5
5
  const promises_1 = require("fs/promises");
6
6
  const path = require("path");
7
+ const fs = require("fs");
7
8
  const appInfo_1 = require("../appInfo");
8
9
  const platformPackager_1 = require("../platformPackager");
9
- const appBuilder_1 = require("../util/appBuilder");
10
+ const plist_1 = require("../util/plist");
10
11
  const ElectronFramework_1 = require("./ElectronFramework");
11
12
  function doRename(basePath, oldName, newName) {
12
13
  return (0, promises_1.rename)(path.join(basePath, oldName), path.join(basePath, newName));
@@ -56,36 +57,24 @@ async function createMacApp(packager, appOutDir, asarIntegrity, isMas) {
56
57
  const helperPluginPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (Plugin).app`, "Contents", "Info.plist");
57
58
  const helperGPUPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (GPU).app`, "Contents", "Info.plist");
58
59
  const helperLoginPlistFilename = path.join(loginItemPath, `${electronBranding.productName} Login Helper.app`, "Contents", "Info.plist");
59
- const plistContent = await (0, appBuilder_1.executeAppBuilderAsJson)([
60
- "decode-plist",
61
- "-f",
62
- appPlistFilename,
63
- "-f",
64
- helperPlistFilename,
65
- "-f",
66
- helperEHPlistFilename,
67
- "-f",
68
- helperNPPlistFilename,
69
- "-f",
70
- helperRendererPlistFilename,
71
- "-f",
72
- helperPluginPlistFilename,
73
- "-f",
74
- helperGPUPlistFilename,
75
- "-f",
76
- helperLoginPlistFilename,
77
- ]);
78
- if (plistContent[0] == null) {
60
+ const safeParsePlistFile = async (filePath) => {
61
+ if (!fs.existsSync(filePath)) {
62
+ return null;
63
+ }
64
+ return await (0, plist_1.parsePlistFile)(filePath);
65
+ };
66
+ const appPlist = (await safeParsePlistFile(appPlistFilename));
67
+ if (appPlist == null) {
79
68
  throw new Error("corrupted Electron dist");
80
69
  }
81
- const appPlist = plistContent[0];
82
- const helperPlist = plistContent[1];
83
- const helperEHPlist = plistContent[2];
84
- const helperNPPlist = plistContent[3];
85
- const helperRendererPlist = plistContent[4];
86
- const helperPluginPlist = plistContent[5];
87
- const helperGPUPlist = plistContent[6];
88
- const helperLoginPlist = plistContent[7];
70
+ // Replace the multiple parsePlistFile calls with:
71
+ const helperPlist = await safeParsePlistFile(helperPlistFilename);
72
+ const helperEHPlist = await safeParsePlistFile(helperEHPlistFilename);
73
+ const helperNPPlist = await safeParsePlistFile(helperNPPlistFilename);
74
+ const helperRendererPlist = await safeParsePlistFile(helperRendererPlistFilename);
75
+ const helperPluginPlist = await safeParsePlistFile(helperPluginPlistFilename);
76
+ const helperGPUPlist = await safeParsePlistFile(helperGPUPlistFilename);
77
+ const helperLoginPlist = await safeParsePlistFile(helperLoginPlistFilename);
89
78
  const buildMetadata = packager.config;
90
79
  /**
91
80
  * Configure bundleIdentifier for the generic Electron Helper process
@@ -107,10 +96,12 @@ async function createMacApp(packager, appOutDir, asarIntegrity, isMas) {
107
96
  if (!isMas) {
108
97
  configureLocalhostAts(appPlist);
109
98
  }
110
- helperPlist.CFBundleExecutable = `${appFilename} Helper`;
111
- helperPlist.CFBundleDisplayName = `${appInfo.productName} Helper`;
112
- helperPlist.CFBundleIdentifier = helperBundleIdentifier;
113
- helperPlist.CFBundleVersion = appPlist.CFBundleVersion;
99
+ if (helperPlist != null) {
100
+ helperPlist.CFBundleExecutable = `${appFilename} Helper`;
101
+ helperPlist.CFBundleDisplayName = `${appInfo.productName} Helper`;
102
+ helperPlist.CFBundleIdentifier = helperBundleIdentifier;
103
+ helperPlist.CFBundleVersion = appPlist.CFBundleVersion;
104
+ }
114
105
  /**
115
106
  * Configure bundleIdentifier for Electron 5+ Helper processes
116
107
  *
@@ -188,33 +179,42 @@ async function createMacApp(packager, appOutDir, asarIntegrity, isMas) {
188
179
  // `CFBundleDocumentTypes` may be defined in `mac.extendInfo`, so we need to merge it in that case
189
180
  appPlist.CFBundleDocumentTypes = [...(appPlist.CFBundleDocumentTypes || []), ...documentTypes];
190
181
  }
182
+ const toPlistObject = (asarIntegrity) => {
183
+ const result = {};
184
+ for (const [filePath, headerHash] of Object.entries(asarIntegrity)) {
185
+ result[filePath] = {
186
+ algorithm: headerHash.algorithm,
187
+ hash: headerHash.hash,
188
+ };
189
+ }
190
+ return result;
191
+ };
191
192
  if (asarIntegrity != null) {
192
- appPlist.ElectronAsarIntegrity = asarIntegrity;
193
+ appPlist.ElectronAsarIntegrity = toPlistObject(asarIntegrity);
193
194
  }
194
- const plistDataToWrite = {
195
- [appPlistFilename]: appPlist,
196
- [helperPlistFilename]: helperPlist,
197
- };
198
195
  if (helperEHPlist != null) {
199
- plistDataToWrite[helperEHPlistFilename] = helperEHPlist;
196
+ await (0, plist_1.savePlistFile)(helperEHPlistFilename, helperEHPlist);
200
197
  }
201
198
  if (helperNPPlist != null) {
202
- plistDataToWrite[helperNPPlistFilename] = helperNPPlist;
199
+ await (0, plist_1.savePlistFile)(helperNPPlistFilename, helperNPPlist);
203
200
  }
204
201
  if (helperRendererPlist != null) {
205
- plistDataToWrite[helperRendererPlistFilename] = helperRendererPlist;
202
+ await (0, plist_1.savePlistFile)(helperRendererPlistFilename, helperRendererPlist);
206
203
  }
207
204
  if (helperPluginPlist != null) {
208
- plistDataToWrite[helperPluginPlistFilename] = helperPluginPlist;
205
+ await (0, plist_1.savePlistFile)(helperPluginPlistFilename, helperPluginPlist);
209
206
  }
210
207
  if (helperGPUPlist != null) {
211
- plistDataToWrite[helperGPUPlistFilename] = helperGPUPlist;
208
+ await (0, plist_1.savePlistFile)(helperGPUPlistFilename, helperGPUPlist);
212
209
  }
213
210
  if (helperLoginPlist != null) {
214
- plistDataToWrite[helperLoginPlistFilename] = helperLoginPlist;
211
+ await (0, plist_1.savePlistFile)(helperLoginPlistFilename, helperLoginPlist);
212
+ }
213
+ await (0, plist_1.savePlistFile)(appPlistFilename, appPlist);
214
+ if (helperPlist != null) {
215
+ await (0, plist_1.savePlistFile)(helperPlistFilename, helperPlist);
215
216
  }
216
217
  await Promise.all([
217
- (0, appBuilder_1.executeAppBuilderAndWriteJson)(["encode-plist"], plistDataToWrite),
218
218
  doRename(path.join(contentsPath, "MacOS"), electronBranding.productName, appPlist.CFBundleExecutable),
219
219
  (0, builder_util_1.unlinkIfExists)(path.join(appOutDir, "LICENSE")),
220
220
  (0, builder_util_1.unlinkIfExists)(path.join(appOutDir, "LICENSES.chromium.html")),
@@ -1 +1 @@
1
- {"version":3,"file":"electronMac.js","sourceRoot":"","sources":["../../src/electron/electronMac.ts"],"names":[],"mappings":";;AAkDA,oCAsOC;AAxRD,+CAA+H;AAC/H,0CAA4C;AAC5C,6BAA4B;AAC5B,wCAAqD;AAGrD,0DAAkD;AAClD,mDAA2F;AAC3F,2DAAwD;AAExD,SAAS,QAAQ,CAAC,QAAgB,EAAE,OAAe,EAAE,OAAe;IAClE,OAAO,IAAA,iBAAM,EAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAA;AAC3E,CAAC;AAED,SAAS,WAAW,CAAC,cAA6B,EAAE,cAAsB,EAAE,OAAe,EAAE,MAAc;IACzG,OAAO,OAAO,CAAC,GAAG,CAChB,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;QAC1B,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,MAAM,GAAG,MAAM,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;QACnG,OAAO,QAAQ,CAAC,kBAAkB,EAAE,GAAG,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CA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AAC;QACvC,MAAM,SAAS,GAAG;YAChB,4CAA4C,EAAE,KAAK;YACnD,oBAAoB,EAAE,KAAK;YAC3B,2CAA2C,EAAE,IAAI;YACjD,qCAAqC,EAAE,KAAK;YAC5C,0CAA0C,EAAE,KAAK;SAClD,CAAA;QACD,gBAAgB,CAAC,SAAS,GAAG,SAAS,CAAA;QACtC,gBAAgB,CAAC,WAAW,CAAC,GAAG,SAAS,CAAA;IAC3C,CAAC;AACH,CAAC","sourcesContent":["import { asArray, copyOrLinkFile, getPlatformIconFileName, InvalidConfigurationError, log, unlinkIfExists } from \"builder-util\"\nimport { rename, utimes } from \"fs/promises\"\nimport * as path from \"path\"\nimport { filterCFBundleIdentifier } from \"../appInfo\"\nimport { AsarIntegrity } from \"../asar/integrity\"\nimport { MacPackager } from \"../macPackager\"\nimport { normalizeExt } from \"../platformPackager\"\nimport { executeAppBuilderAndWriteJson, executeAppBuilderAsJson } from \"../util/appBuilder\"\nimport { createBrandingOpts } from \"./ElectronFramework\"\n\nfunction doRename(basePath: string, oldName: string, newName: string) {\n return rename(path.join(basePath, oldName), path.join(basePath, newName))\n}\n\nfunction moveHelpers(helperSuffixes: Array<string>, frameworksPath: string, appName: string, prefix: string): Promise<any> {\n return Promise.all(\n helperSuffixes.map(suffix => {\n const executableBasePath = path.join(frameworksPath, `${prefix}${suffix}.app`, \"Contents\", \"MacOS\")\n return doRename(executableBasePath, `${prefix}${suffix}`, appName + suffix).then(() => doRename(frameworksPath, `${prefix}${suffix}.app`, `${appName}${suffix}.app`))\n })\n )\n}\n\nfunction getAvailableHelperSuffixes(\n helperEHPlist: string | null,\n helperNPPlist: string | null,\n helperRendererPlist: string | null,\n helperPluginPlist: string | null,\n helperGPUPlist: string | null\n) {\n const result = [\" Helper\"]\n if (helperEHPlist != null) {\n result.push(\" Helper EH\")\n }\n if (helperNPPlist != null) {\n result.push(\" Helper NP\")\n }\n if (helperRendererPlist != null) {\n result.push(\" Helper (Renderer)\")\n }\n if (helperPluginPlist != null) {\n result.push(\" Helper (Plugin)\")\n }\n if (helperGPUPlist != null) {\n result.push(\" Helper (GPU)\")\n }\n return result\n}\n\n/** @internal */\nexport async function createMacApp(packager: MacPackager, appOutDir: string, asarIntegrity: AsarIntegrity | null, isMas: boolean) {\n const appInfo = packager.appInfo\n // Electon uses the application name (CFBundleName) to resolve helper apps\n // https://github.com/electron/electron/blob/main/shell/app/electron_main_delegate_mac.mm\n // https://github.com/electron-userland/electron-builder/issues/6962\n const appFilename = appInfo.sanitizedProductName\n const electronBranding = createBrandingOpts(packager.config)\n\n const contentsPath = path.join(appOutDir, packager.info.framework.distMacOsAppName, \"Contents\")\n const frameworksPath = path.join(contentsPath, \"Frameworks\")\n const loginItemPath = path.join(contentsPath, \"Library\", \"LoginItems\")\n\n const appPlistFilename = path.join(contentsPath, \"Info.plist\")\n const helperPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper.app`, \"Contents\", \"Info.plist\")\n const helperEHPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper EH.app`, \"Contents\", \"Info.plist\")\n const helperNPPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper NP.app`, \"Contents\", \"Info.plist\")\n const helperRendererPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (Renderer).app`, \"Contents\", \"Info.plist\")\n const helperPluginPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (Plugin).app`, \"Contents\", \"Info.plist\")\n const helperGPUPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (GPU).app`, \"Contents\", \"Info.plist\")\n const helperLoginPlistFilename = path.join(loginItemPath, `${electronBranding.productName} Login Helper.app`, \"Contents\", \"Info.plist\")\n\n const plistContent: Array<any> = await executeAppBuilderAsJson([\n \"decode-plist\",\n \"-f\",\n appPlistFilename,\n \"-f\",\n helperPlistFilename,\n \"-f\",\n helperEHPlistFilename,\n \"-f\",\n helperNPPlistFilename,\n \"-f\",\n helperRendererPlistFilename,\n \"-f\",\n helperPluginPlistFilename,\n \"-f\",\n helperGPUPlistFilename,\n \"-f\",\n helperLoginPlistFilename,\n ])\n\n if (plistContent[0] == null) {\n throw new Error(\"corrupted Electron dist\")\n }\n\n const appPlist = plistContent[0]!\n const helperPlist = plistContent[1]!\n const helperEHPlist = plistContent[2]\n const helperNPPlist = plistContent[3]\n const helperRendererPlist = plistContent[4]\n const helperPluginPlist = plistContent[5]\n const helperGPUPlist = plistContent[6]\n const helperLoginPlist = plistContent[7]\n\n const buildMetadata = packager.config\n\n /**\n * Configure bundleIdentifier for the generic Electron Helper process\n *\n * This was the only Helper in Electron 5 and before. Allow users to configure\n * the bundleIdentifier for continuity.\n */\n\n const oldHelperBundleId = (buildMetadata as any)[\"helper-bundle-id\"]\n if (oldHelperBundleId != null) {\n log.warn(\"build.helper-bundle-id is deprecated, please set as build.mac.helperBundleId\")\n }\n\n const defaultAppId = packager.platformSpecificBuildOptions.appId\n const cfBundleIdentifier = filterCFBundleIdentifier((isMas ? packager.config.mas?.appId : defaultAppId) || defaultAppId || appInfo.macBundleIdentifier)\n\n const defaultHelperId = packager.platformSpecificBuildOptions.helperBundleId\n const helperBundleIdentifier = filterCFBundleIdentifier(\n (isMas ? packager.config.mas?.helperBundleId : defaultHelperId) || defaultHelperId || oldHelperBundleId || `${cfBundleIdentifier}.helper`\n )\n\n appPlist.CFBundleIdentifier = cfBundleIdentifier\n\n await packager.applyCommonInfo(appPlist, contentsPath)\n\n // required for electron-updater proxy\n if (!isMas) {\n configureLocalhostAts(appPlist)\n }\n\n helperPlist.CFBundleExecutable = `${appFilename} Helper`\n helperPlist.CFBundleDisplayName = `${appInfo.productName} Helper`\n helperPlist.CFBundleIdentifier = helperBundleIdentifier\n helperPlist.CFBundleVersion = appPlist.CFBundleVersion\n\n /**\n * Configure bundleIdentifier for Electron 5+ Helper processes\n *\n * In Electron 6, parts of the generic Electron Helper process were split into\n * individual helper processes. Allow users to configure the bundleIdentifiers\n * for continuity, specifically because macOS keychain access relies on\n * bundleIdentifiers not changing (i.e. across versions of Electron).\n */\n\n function configureHelper(helper: any, postfix: string, userProvidedBundleIdentifier?: string | null) {\n helper.CFBundleExecutable = `${appFilename} Helper ${postfix}`\n helper.CFBundleDisplayName = `${appInfo.productName} Helper ${postfix}`\n helper.CFBundleIdentifier = userProvidedBundleIdentifier\n ? filterCFBundleIdentifier(userProvidedBundleIdentifier)\n : filterCFBundleIdentifier(`${helperBundleIdentifier}.${postfix}`)\n helper.CFBundleVersion = appPlist.CFBundleVersion\n }\n\n if (helperRendererPlist != null) {\n configureHelper(helperRendererPlist, \"(Renderer)\", packager.platformSpecificBuildOptions.helperRendererBundleId)\n }\n if (helperPluginPlist != null) {\n configureHelper(helperPluginPlist, \"(Plugin)\", packager.platformSpecificBuildOptions.helperPluginBundleId)\n }\n if (helperGPUPlist != null) {\n configureHelper(helperGPUPlist, \"(GPU)\", packager.platformSpecificBuildOptions.helperGPUBundleId)\n }\n if (helperEHPlist != null) {\n configureHelper(helperEHPlist, \"EH\", packager.platformSpecificBuildOptions.helperEHBundleId)\n }\n if (helperNPPlist != null) {\n configureHelper(helperNPPlist, \"NP\", packager.platformSpecificBuildOptions.helperNPBundleId)\n }\n if (helperLoginPlist != null) {\n helperLoginPlist.CFBundleExecutable = `${appFilename} Login Helper`\n helperLoginPlist.CFBundleDisplayName = `${appInfo.productName} Login Helper`\n // noinspection SpellCheckingInspection\n helperLoginPlist.CFBundleIdentifier = `${cfBundleIdentifier}.loginhelper`\n helperLoginPlist.CFBundleVersion = appPlist.CFBundleVersion\n }\n\n const protocols = asArray(buildMetadata.protocols).concat(asArray(packager.platformSpecificBuildOptions.protocols))\n if (protocols.length > 0) {\n appPlist.CFBundleURLTypes = protocols.map(protocol => {\n const schemes = asArray(protocol.schemes)\n if (schemes.length === 0) {\n throw new InvalidConfigurationError(`Protocol \"${protocol.name}\": must be at least one scheme specified`)\n }\n return {\n CFBundleURLName: protocol.name,\n CFBundleTypeRole: protocol.role || \"Editor\",\n CFBundleURLSchemes: schemes.slice(),\n }\n })\n }\n\n const fileAssociations = packager.fileAssociations\n if (fileAssociations.length > 0) {\n const documentTypes = await Promise.all(\n fileAssociations.map(async fileAssociation => {\n const extensions = asArray(fileAssociation.ext).map(normalizeExt)\n const customIcon = await packager.getResource(getPlatformIconFileName(fileAssociation.icon, true), `${extensions[0]}.icns`)\n let iconFile = appPlist.CFBundleIconFile\n if (customIcon != null) {\n iconFile = path.basename(customIcon)\n await copyOrLinkFile(customIcon, path.join(path.join(contentsPath, \"Resources\"), iconFile))\n }\n\n const result = {\n CFBundleTypeExtensions: extensions,\n CFBundleTypeName: fileAssociation.name || extensions[0],\n CFBundleTypeRole: fileAssociation.role || \"Editor\",\n LSHandlerRank: fileAssociation.rank || \"Default\",\n CFBundleTypeIconFile: iconFile,\n } as any\n\n if (fileAssociation.isPackage) {\n result.LSTypeIsPackage = true\n }\n return result\n })\n )\n\n // `CFBundleDocumentTypes` may be defined in `mac.extendInfo`, so we need to merge it in that case\n appPlist.CFBundleDocumentTypes = [...(appPlist.CFBundleDocumentTypes || []), ...documentTypes]\n }\n\n if (asarIntegrity != null) {\n appPlist.ElectronAsarIntegrity = asarIntegrity\n }\n\n const plistDataToWrite: any = {\n [appPlistFilename]: appPlist,\n [helperPlistFilename]: helperPlist,\n }\n if (helperEHPlist != null) {\n plistDataToWrite[helperEHPlistFilename] = helperEHPlist\n }\n if (helperNPPlist != null) {\n plistDataToWrite[helperNPPlistFilename] = helperNPPlist\n }\n if (helperRendererPlist != null) {\n plistDataToWrite[helperRendererPlistFilename] = helperRendererPlist\n }\n if (helperPluginPlist != null) {\n plistDataToWrite[helperPluginPlistFilename] = helperPluginPlist\n }\n if (helperGPUPlist != null) {\n plistDataToWrite[helperGPUPlistFilename] = helperGPUPlist\n }\n if (helperLoginPlist != null) {\n plistDataToWrite[helperLoginPlistFilename] = helperLoginPlist\n }\n\n await Promise.all([\n executeAppBuilderAndWriteJson([\"encode-plist\"], plistDataToWrite),\n doRename(path.join(contentsPath, \"MacOS\"), electronBranding.productName, appPlist.CFBundleExecutable),\n unlinkIfExists(path.join(appOutDir, \"LICENSE\")),\n unlinkIfExists(path.join(appOutDir, \"LICENSES.chromium.html\")),\n ])\n\n await moveHelpers(\n getAvailableHelperSuffixes(helperEHPlist, helperNPPlist, helperRendererPlist, helperPluginPlist, helperGPUPlist),\n frameworksPath,\n appFilename,\n electronBranding.productName\n )\n\n if (helperLoginPlist != null) {\n const prefix = electronBranding.productName\n const suffix = \" Login Helper\"\n const executableBasePath = path.join(loginItemPath, `${prefix}${suffix}.app`, \"Contents\", \"MacOS\")\n await doRename(executableBasePath, `${prefix}${suffix}`, appFilename + suffix).then(() => doRename(loginItemPath, `${prefix}${suffix}.app`, `${appFilename}${suffix}.app`))\n }\n\n const appPath = path.join(appOutDir, `${appInfo.productFilename}.app`)\n await rename(path.dirname(contentsPath), appPath)\n // https://github.com/electron-userland/electron-builder/issues/840\n const now = Date.now() / 1000\n await utimes(appPath, now, now)\n}\n\nfunction configureLocalhostAts(appPlist: any) {\n // https://bencoding.com/2015/07/20/app-transport-security-and-localhost/\n let ats = appPlist.NSAppTransportSecurity\n if (ats == null) {\n ats = {}\n appPlist.NSAppTransportSecurity = ats\n }\n\n ats.NSAllowsLocalNetworking = true\n // https://github.com/electron-userland/electron-builder/issues/3377#issuecomment-446035814\n ats.NSAllowsArbitraryLoads = true\n\n let exceptionDomains = ats.NSExceptionDomains\n if (exceptionDomains == null) {\n exceptionDomains = {}\n ats.NSExceptionDomains = exceptionDomains\n }\n\n if (exceptionDomains.localhost == null) {\n const allowHttp = {\n NSTemporaryExceptionAllowsInsecureHTTPSLoads: false,\n NSIncludesSubdomains: false,\n NSTemporaryExceptionAllowsInsecureHTTPLoads: true,\n NSTemporaryExceptionMinimumTLSVersion: \"1.0\",\n NSTemporaryExceptionRequiresForwardSecrecy: false,\n }\n exceptionDomains.localhost = allowHttp\n exceptionDomains[\"127.0.0.1\"] = allowHttp\n }\n}\n"]}
1
+ {"version":3,"file":"electronMac.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AgB,GAAG,EAAE,CAAA;QACrB,GAAG,CAAC,kBAAkB,GAAG,gBAAgB,CAAA;IAC3C,CAAC;IAED,IAAI,gBAAgB,CAAC,SAAS,IAAI,IAAI,EAAE,CAAC;QACvC,MAAM,SAAS,GAAG;YAChB,4CAA4C,EAAE,KAAK;YACnD,oBAAoB,EAAE,KAAK;YAC3B,2CAA2C,EAAE,IAAI;YACjD,qCAAqC,EAAE,KAAK;YAC5C,0CAA0C,EAAE,KAAK;SAClD,CAAA;QACD,gBAAgB,CAAC,SAAS,GAAG,SAAS,CAAA;QACtC,gBAAgB,CAAC,WAAW,CAAC,GAAG,SAAS,CAAA;IAC3C,CAAC;AACH,CAAC","sourcesContent":["import { asArray, copyOrLinkFile, getPlatformIconFileName, InvalidConfigurationError, log, unlinkIfExists } from \"builder-util\"\nimport { rename, utimes } from \"fs/promises\"\nimport * as path from \"path\"\nimport * as fs from \"fs\"\nimport { filterCFBundleIdentifier } from \"../appInfo\"\nimport { AsarIntegrity } from \"../asar/integrity\"\nimport { MacPackager } from \"../macPackager\"\nimport { normalizeExt } from \"../platformPackager\"\nimport { savePlistFile, parsePlistFile, PlistObject, PlistValue } from \"../util/plist\"\nimport { createBrandingOpts } from \"./ElectronFramework\"\n\nfunction doRename(basePath: string, oldName: string, newName: string) {\n return rename(path.join(basePath, oldName), path.join(basePath, newName))\n}\n\nfunction moveHelpers(helperSuffixes: Array<string>, frameworksPath: string, appName: string, prefix: string): Promise<any> {\n return Promise.all(\n helperSuffixes.map(suffix => {\n const executableBasePath = path.join(frameworksPath, `${prefix}${suffix}.app`, \"Contents\", \"MacOS\")\n return doRename(executableBasePath, `${prefix}${suffix}`, appName + suffix).then(() => doRename(frameworksPath, `${prefix}${suffix}.app`, `${appName}${suffix}.app`))\n })\n )\n}\n\nfunction getAvailableHelperSuffixes(\n helperEHPlist: PlistObject | null,\n helperNPPlist: PlistObject | null,\n helperRendererPlist: PlistObject | null,\n helperPluginPlist: PlistObject | null,\n helperGPUPlist: PlistObject | null\n) {\n const result = [\" Helper\"]\n if (helperEHPlist != null) {\n result.push(\" Helper EH\")\n }\n if (helperNPPlist != null) {\n result.push(\" Helper NP\")\n }\n if (helperRendererPlist != null) {\n result.push(\" Helper (Renderer)\")\n }\n if (helperPluginPlist != null) {\n result.push(\" Helper (Plugin)\")\n }\n if (helperGPUPlist != null) {\n result.push(\" Helper (GPU)\")\n }\n return result\n}\n\n/** @internal */\nexport async function createMacApp(packager: MacPackager, appOutDir: string, asarIntegrity: AsarIntegrity | null, isMas: boolean) {\n const appInfo = packager.appInfo\n // Electon uses the application name (CFBundleName) to resolve helper apps\n // https://github.com/electron/electron/blob/main/shell/app/electron_main_delegate_mac.mm\n // https://github.com/electron-userland/electron-builder/issues/6962\n const appFilename = appInfo.sanitizedProductName\n const electronBranding = createBrandingOpts(packager.config)\n\n const contentsPath = path.join(appOutDir, packager.info.framework.distMacOsAppName, \"Contents\")\n const frameworksPath = path.join(contentsPath, \"Frameworks\")\n const loginItemPath = path.join(contentsPath, \"Library\", \"LoginItems\")\n\n const appPlistFilename = path.join(contentsPath, \"Info.plist\")\n const helperPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper.app`, \"Contents\", \"Info.plist\")\n const helperEHPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper EH.app`, \"Contents\", \"Info.plist\")\n const helperNPPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper NP.app`, \"Contents\", \"Info.plist\")\n const helperRendererPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (Renderer).app`, \"Contents\", \"Info.plist\")\n const helperPluginPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (Plugin).app`, \"Contents\", \"Info.plist\")\n const helperGPUPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (GPU).app`, \"Contents\", \"Info.plist\")\n const helperLoginPlistFilename = path.join(loginItemPath, `${electronBranding.productName} Login Helper.app`, \"Contents\", \"Info.plist\")\n\n const safeParsePlistFile = async (filePath: string): Promise<PlistObject | null> => {\n if (!fs.existsSync(filePath)) {\n return null\n }\n return await parsePlistFile(filePath)\n }\n\n const appPlist = (await safeParsePlistFile(appPlistFilename))!\n if (appPlist == null) {\n throw new Error(\"corrupted Electron dist\")\n }\n\n // Replace the multiple parsePlistFile calls with:\n const helperPlist = await safeParsePlistFile(helperPlistFilename)\n const helperEHPlist = await safeParsePlistFile(helperEHPlistFilename)\n const helperNPPlist = await safeParsePlistFile(helperNPPlistFilename)\n const helperRendererPlist = await safeParsePlistFile(helperRendererPlistFilename)\n const helperPluginPlist = await safeParsePlistFile(helperPluginPlistFilename)\n const helperGPUPlist = await safeParsePlistFile(helperGPUPlistFilename)\n const helperLoginPlist = await safeParsePlistFile(helperLoginPlistFilename)\n\n const buildMetadata = packager.config\n\n /**\n * Configure bundleIdentifier for the generic Electron Helper process\n *\n * This was the only Helper in Electron 5 and before. Allow users to configure\n * the bundleIdentifier for continuity.\n */\n\n const oldHelperBundleId = (buildMetadata as any)[\"helper-bundle-id\"]\n if (oldHelperBundleId != null) {\n log.warn(\"build.helper-bundle-id is deprecated, please set as build.mac.helperBundleId\")\n }\n\n const defaultAppId = packager.platformSpecificBuildOptions.appId\n const cfBundleIdentifier = filterCFBundleIdentifier((isMas ? packager.config.mas?.appId : defaultAppId) || defaultAppId || appInfo.macBundleIdentifier)\n\n const defaultHelperId = packager.platformSpecificBuildOptions.helperBundleId\n const helperBundleIdentifier = filterCFBundleIdentifier(\n (isMas ? packager.config.mas?.helperBundleId : defaultHelperId) || defaultHelperId || oldHelperBundleId || `${cfBundleIdentifier}.helper`\n )\n\n appPlist.CFBundleIdentifier = cfBundleIdentifier\n\n await packager.applyCommonInfo(appPlist, contentsPath)\n\n // required for electron-updater proxy\n if (!isMas) {\n configureLocalhostAts(appPlist)\n }\n\n if (helperPlist != null) {\n helperPlist.CFBundleExecutable = `${appFilename} Helper`\n helperPlist.CFBundleDisplayName = `${appInfo.productName} Helper`\n helperPlist.CFBundleIdentifier = helperBundleIdentifier\n helperPlist.CFBundleVersion = appPlist.CFBundleVersion\n }\n\n /**\n * Configure bundleIdentifier for Electron 5+ Helper processes\n *\n * In Electron 6, parts of the generic Electron Helper process were split into\n * individual helper processes. Allow users to configure the bundleIdentifiers\n * for continuity, specifically because macOS keychain access relies on\n * bundleIdentifiers not changing (i.e. across versions of Electron).\n */\n\n function configureHelper(helper: any, postfix: string, userProvidedBundleIdentifier?: string | null) {\n helper.CFBundleExecutable = `${appFilename} Helper ${postfix}`\n helper.CFBundleDisplayName = `${appInfo.productName} Helper ${postfix}`\n helper.CFBundleIdentifier = userProvidedBundleIdentifier\n ? filterCFBundleIdentifier(userProvidedBundleIdentifier)\n : filterCFBundleIdentifier(`${helperBundleIdentifier}.${postfix}`)\n helper.CFBundleVersion = appPlist.CFBundleVersion\n }\n\n if (helperRendererPlist != null) {\n configureHelper(helperRendererPlist, \"(Renderer)\", packager.platformSpecificBuildOptions.helperRendererBundleId)\n }\n if (helperPluginPlist != null) {\n configureHelper(helperPluginPlist, \"(Plugin)\", packager.platformSpecificBuildOptions.helperPluginBundleId)\n }\n if (helperGPUPlist != null) {\n configureHelper(helperGPUPlist, \"(GPU)\", packager.platformSpecificBuildOptions.helperGPUBundleId)\n }\n if (helperEHPlist != null) {\n configureHelper(helperEHPlist, \"EH\", packager.platformSpecificBuildOptions.helperEHBundleId)\n }\n if (helperNPPlist != null) {\n configureHelper(helperNPPlist, \"NP\", packager.platformSpecificBuildOptions.helperNPBundleId)\n }\n if (helperLoginPlist != null) {\n helperLoginPlist.CFBundleExecutable = `${appFilename} Login Helper`\n helperLoginPlist.CFBundleDisplayName = `${appInfo.productName} Login Helper`\n // noinspection SpellCheckingInspection\n helperLoginPlist.CFBundleIdentifier = `${cfBundleIdentifier}.loginhelper`\n helperLoginPlist.CFBundleVersion = appPlist.CFBundleVersion\n }\n\n const protocols = asArray(buildMetadata.protocols).concat(asArray(packager.platformSpecificBuildOptions.protocols))\n if (protocols.length > 0) {\n appPlist.CFBundleURLTypes = protocols.map(protocol => {\n const schemes = asArray(protocol.schemes)\n if (schemes.length === 0) {\n throw new InvalidConfigurationError(`Protocol \"${protocol.name}\": must be at least one scheme specified`)\n }\n return {\n CFBundleURLName: protocol.name,\n CFBundleTypeRole: protocol.role || \"Editor\",\n CFBundleURLSchemes: schemes.slice(),\n }\n })\n }\n\n const fileAssociations = packager.fileAssociations\n if (fileAssociations.length > 0) {\n const documentTypes = await Promise.all(\n fileAssociations.map(async fileAssociation => {\n const extensions = asArray(fileAssociation.ext).map(normalizeExt)\n const customIcon = await packager.getResource(getPlatformIconFileName(fileAssociation.icon, true), `${extensions[0]}.icns`)\n let iconFile = appPlist.CFBundleIconFile\n if (customIcon != null) {\n iconFile = path.basename(customIcon)\n await copyOrLinkFile(customIcon, path.join(path.join(contentsPath, \"Resources\"), iconFile))\n }\n\n const result = {\n CFBundleTypeExtensions: extensions,\n CFBundleTypeName: fileAssociation.name || extensions[0],\n CFBundleTypeRole: fileAssociation.role || \"Editor\",\n LSHandlerRank: fileAssociation.rank || \"Default\",\n CFBundleTypeIconFile: iconFile,\n } as any\n\n if (fileAssociation.isPackage) {\n result.LSTypeIsPackage = true\n }\n return result\n })\n )\n\n // `CFBundleDocumentTypes` may be defined in `mac.extendInfo`, so we need to merge it in that case\n appPlist.CFBundleDocumentTypes = [...((appPlist.CFBundleDocumentTypes as PlistValue[]) || []), ...documentTypes]\n }\n\n const toPlistObject = (asarIntegrity: AsarIntegrity): PlistObject => {\n const result: PlistObject = {}\n for (const [filePath, headerHash] of Object.entries(asarIntegrity)) {\n result[filePath] = {\n algorithm: headerHash.algorithm,\n hash: headerHash.hash,\n }\n }\n return result\n }\n\n if (asarIntegrity != null) {\n appPlist.ElectronAsarIntegrity = toPlistObject(asarIntegrity)\n }\n\n if (helperEHPlist != null) {\n await savePlistFile(helperEHPlistFilename, helperEHPlist)\n }\n\n if (helperNPPlist != null) {\n await savePlistFile(helperNPPlistFilename, helperNPPlist)\n }\n\n if (helperRendererPlist != null) {\n await savePlistFile(helperRendererPlistFilename, helperRendererPlist)\n }\n\n if (helperPluginPlist != null) {\n await savePlistFile(helperPluginPlistFilename, helperPluginPlist)\n }\n\n if (helperGPUPlist != null) {\n await savePlistFile(helperGPUPlistFilename, helperGPUPlist)\n }\n\n if (helperLoginPlist != null) {\n await savePlistFile(helperLoginPlistFilename, helperLoginPlist)\n }\n\n await savePlistFile(appPlistFilename, appPlist)\n if (helperPlist != null) {\n await savePlistFile(helperPlistFilename, helperPlist)\n }\n\n await Promise.all([\n doRename(path.join(contentsPath, \"MacOS\"), electronBranding.productName, appPlist.CFBundleExecutable as string),\n unlinkIfExists(path.join(appOutDir, \"LICENSE\")),\n unlinkIfExists(path.join(appOutDir, \"LICENSES.chromium.html\")),\n ])\n\n await moveHelpers(\n getAvailableHelperSuffixes(helperEHPlist, helperNPPlist, helperRendererPlist, helperPluginPlist, helperGPUPlist),\n frameworksPath,\n appFilename,\n electronBranding.productName\n )\n\n if (helperLoginPlist != null) {\n const prefix = electronBranding.productName\n const suffix = \" Login Helper\"\n const executableBasePath = path.join(loginItemPath, `${prefix}${suffix}.app`, \"Contents\", \"MacOS\")\n await doRename(executableBasePath, `${prefix}${suffix}`, appFilename + suffix).then(() => doRename(loginItemPath, `${prefix}${suffix}.app`, `${appFilename}${suffix}.app`))\n }\n\n const appPath = path.join(appOutDir, `${appInfo.productFilename}.app`)\n await rename(path.dirname(contentsPath), appPath)\n // https://github.com/electron-userland/electron-builder/issues/840\n const now = Date.now() / 1000\n await utimes(appPath, now, now)\n}\n\nfunction configureLocalhostAts(appPlist: any) {\n // https://bencoding.com/2015/07/20/app-transport-security-and-localhost/\n let ats = appPlist.NSAppTransportSecurity\n if (ats == null) {\n ats = {}\n appPlist.NSAppTransportSecurity = ats\n }\n\n ats.NSAllowsLocalNetworking = true\n // https://github.com/electron-userland/electron-builder/issues/3377#issuecomment-446035814\n ats.NSAllowsArbitraryLoads = true\n\n let exceptionDomains = ats.NSExceptionDomains\n if (exceptionDomains == null) {\n exceptionDomains = {}\n ats.NSExceptionDomains = exceptionDomains\n }\n\n if (exceptionDomains.localhost == null) {\n const allowHttp = {\n NSTemporaryExceptionAllowsInsecureHTTPSLoads: false,\n NSIncludesSubdomains: false,\n NSTemporaryExceptionAllowsInsecureHTTPLoads: true,\n NSTemporaryExceptionMinimumTLSVersion: \"1.0\",\n NSTemporaryExceptionRequiresForwardSecrecy: false,\n }\n exceptionDomains.localhost = allowHttp\n exceptionDomains[\"127.0.0.1\"] = allowHttp\n }\n}\n"]}
@@ -6,7 +6,7 @@ const fs_extra_1 = require("fs-extra");
6
6
  const promises_1 = require("fs/promises");
7
7
  const path = require("path");
8
8
  const core_1 = require("../core");
9
- const appBuilder_1 = require("../util/appBuilder");
9
+ const plist_1 = require("../util/plist");
10
10
  class LibUiFramework {
11
11
  constructor(version, distMacOsAppName, isUseLaunchUi) {
12
12
  this.version = version;
@@ -60,13 +60,11 @@ class LibUiFramework {
60
60
  NSHighResolutionCapable: true,
61
61
  };
62
62
  await packager.applyCommonInfo(appPlist, appContentsDir);
63
- await Promise.all([
64
- (0, appBuilder_1.executeAppBuilderAndWriteJson)(["encode-plist"], { [path.join(appContentsDir, "Info.plist")]: appPlist }),
65
- writeExecutableMain(path.join(appContentsDir, "MacOS", appPlist.CFBundleExecutable), `#!/bin/sh
63
+ await (0, plist_1.savePlistFile)(path.join(appContentsDir, "Info.plist"), appPlist);
64
+ await writeExecutableMain(path.join(appContentsDir, "MacOS", appPlist.CFBundleExecutable), `#!/bin/sh
66
65
  DIR=$(dirname "$0")
67
66
  "$DIR/node" "$DIR/../Resources/app/${options.packager.info.metadata.main || "index.js"}"
68
- `),
69
- ]);
67
+ `);
70
68
  }
71
69
  async prepareLinuxApplicationStageDirectory(options) {
72
70
  const appOutDir = options.appOutDir;
@@ -1 +1 @@
1
- {"version":3,"file":"LibUiFramework.js","sourceRoot":"","sources":["../../src/frameworks/LibUiFramework.ts"],"names":[],"mappings":";;;AAAA,+CAAgD;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,CAAC,CAAA;IAC7G,CAAC;IAED,WAAW,CAAC,QAAkB;QAC5B,OAAO,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAA;IACnE,CAAC;IAEO,wBAAwB,CAAC,QAAkB;QACjD,OAAO,QAAQ,KAAK,eAAQ,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,QAAQ,KAAK,eAAQ,CAAC,KAAK,CAAC,CAAA;IAC7F,CAAC;IAED,uBAAuB,CAAC,QAAkB;QACxC,mBAAmB;QACnB,OAAO,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IACxE,CAAC;CACF;AAlHD,wCAkHC;AAED,KAAK,UAAU,mBAAmB,CAAC,IAAY,EAAE,OAAe;IAC9D,MAAM,IAAA,oBAAS,EAAC,IAAI,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;IAC/C,MAAM,IAAA,gBAAK,EAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AAC1B,CAAC","sourcesContent":["import { executeAppBuilder } from \"builder-util\"\nimport { emptyDir } from \"fs-extra\"\nimport { chmod, mkdir, rename, writeFile } from \"fs/promises\"\nimport * as path from \"path\"\nimport { AfterPackContext } from \"../configuration\"\nimport { Platform } from \"../core\"\nimport { Framework, PrepareApplicationStageDirectoryOptions } from \"../Framework\"\nimport { LinuxPackager } from \"../linuxPackager\"\nimport { MacPackager } from \"../macPackager\"\nimport { executeAppBuilderAndWriteJson } from \"../util/appBuilder\"\n\nexport class LibUiFramework implements Framework {\n readonly name: string = \"libui\"\n // noinspection JSUnusedGlobalSymbols\n readonly macOsDefaultTargets = [\"dmg\"]\n\n readonly defaultAppIdPrefix: string = \"com.libui.\"\n\n // noinspection JSUnusedGlobalSymbols\n readonly isCopyElevateHelper = false\n\n // noinspection JSUnusedGlobalSymbols\n readonly isNpmRebuildRequired = false\n\n constructor(\n readonly version: string,\n readonly distMacOsAppName: string,\n protected readonly isUseLaunchUi: boolean\n ) {}\n\n async prepareApplicationStageDirectory(options: PrepareApplicationStageDirectoryOptions) {\n await emptyDir(options.appOutDir)\n\n const packager = options.packager\n const platform = packager.platform\n\n if (this.isUseLaunchUiForPlatform(platform)) {\n const appOutDir = options.appOutDir\n await executeAppBuilder([\n \"proton-native\",\n \"--node-version\",\n this.version,\n \"--use-launch-ui\",\n \"--platform\",\n platform.nodeName,\n \"--arch\",\n options.arch,\n \"--stage\",\n appOutDir,\n \"--executable\",\n `${packager.appInfo.productFilename}${platform === Platform.WINDOWS ? \".exe\" : \"\"}`,\n ])\n return\n }\n\n if (platform === Platform.MAC) {\n await this.prepareMacosApplicationStageDirectory(packager as MacPackager, options)\n } else if (platform === Platform.LINUX) {\n await this.prepareLinuxApplicationStageDirectory(options)\n }\n }\n\n private async prepareMacosApplicationStageDirectory(packager: MacPackager, options: PrepareApplicationStageDirectoryOptions) {\n const appContentsDir = path.join(options.appOutDir, this.distMacOsAppName, \"Contents\")\n await mkdir(path.join(appContentsDir, \"Resources\"), { recursive: true })\n await mkdir(path.join(appContentsDir, \"MacOS\"), { recursive: true })\n await executeAppBuilder([\"proton-native\", \"--node-version\", this.version, \"--platform\", \"darwin\", \"--stage\", path.join(appContentsDir, \"MacOS\")])\n\n const appPlist: any = {\n // https://github.com/albe-rosado/create-proton-app/issues/13\n NSHighResolutionCapable: true,\n }\n await packager.applyCommonInfo(appPlist, appContentsDir)\n await Promise.all([\n executeAppBuilderAndWriteJson([\"encode-plist\"], { [path.join(appContentsDir, \"Info.plist\")]: appPlist }),\n writeExecutableMain(\n path.join(appContentsDir, \"MacOS\", appPlist.CFBundleExecutable),\n `#!/bin/sh\n DIR=$(dirname \"$0\")\n \"$DIR/node\" \"$DIR/../Resources/app/${options.packager.info.metadata.main || \"index.js\"}\"\n `\n ),\n ])\n }\n\n private async prepareLinuxApplicationStageDirectory(options: PrepareApplicationStageDirectoryOptions) {\n const appOutDir = options.appOutDir\n await executeAppBuilder([\"proton-native\", \"--node-version\", this.version, \"--platform\", \"linux\", \"--arch\", options.arch, \"--stage\", appOutDir])\n const mainPath = path.join(appOutDir, (options.packager as LinuxPackager).executableName)\n await writeExecutableMain(\n mainPath,\n `#!/bin/sh\n DIR=$(dirname \"$0\")\n \"$DIR/node\" \"$DIR/app/${options.packager.info.metadata.main || \"index.js\"}\"\n `\n )\n }\n\n async afterPack(context: AfterPackContext) {\n const packager = context.packager\n if (!this.isUseLaunchUiForPlatform(packager.platform)) {\n return\n }\n\n // LaunchUI requires main.js, rename if need\n const userMain = packager.info.metadata.main || \"index.js\"\n if (userMain === \"main.js\") {\n return\n }\n\n await rename(path.join(context.appOutDir, \"app\", userMain), path.join(context.appOutDir, \"app\", \"main.js\"))\n }\n\n getMainFile(platform: Platform): string | null {\n return this.isUseLaunchUiForPlatform(platform) ? \"main.js\" : null\n }\n\n private isUseLaunchUiForPlatform(platform: Platform) {\n return platform === Platform.WINDOWS || (this.isUseLaunchUi && platform === Platform.LINUX)\n }\n\n getExcludedDependencies(platform: Platform): Array<string> | null {\n // part of launchui\n return this.isUseLaunchUiForPlatform(platform) ? [\"libui-node\"] : null\n }\n}\n\nasync function writeExecutableMain(file: string, content: string) {\n await writeFile(file, content, { mode: 0o755 })\n await chmod(file, 0o755)\n}\n"]}
1
+ {"version":3,"file":"LibUiFramework.js","sourceRoot":"","sources":["../../src/frameworks/LibUiFramework.ts"],"names":[],"mappings":";;;AAAA,+CAAgD;AAChD,uCAAmC;AACnC,0CAA6D;AAC7D,6BAA4B;AAE5B,kCAAkC;AAIlC,yCAA6C;AAE7C,MAAa,cAAc;IAazB,YACW,OAAe,EACf,gBAAwB,EACd,aAAsB;QAFhC,YAAO,GAAP,OAAO,CAAQ;QACf,qBAAgB,GAAhB,gBAAgB,CAAQ;QACd,kBAAa,GAAb,aAAa,CAAS;QAfl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AAA;IAC7F,CAAC;IAED,uBAAuB,CAAC,QAAkB;QACxC,mBAAmB;QACnB,OAAO,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IACxE,CAAC;CACF;AAhHD,wCAgHC;AAED,KAAK,UAAU,mBAAmB,CAAC,IAAY,EAAE,OAAe;IAC9D,MAAM,IAAA,oBAAS,EAAC,IAAI,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;IAC/C,MAAM,IAAA,gBAAK,EAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AAC1B,CAAC","sourcesContent":["import { executeAppBuilder } from \"builder-util\"\nimport { emptyDir } from \"fs-extra\"\nimport { chmod, mkdir, rename, writeFile } from \"fs/promises\"\nimport * as path from \"path\"\nimport { AfterPackContext } from \"../configuration\"\nimport { Platform } from \"../core\"\nimport { Framework, PrepareApplicationStageDirectoryOptions } from \"../Framework\"\nimport { LinuxPackager } from \"../linuxPackager\"\nimport { MacPackager } from \"../macPackager\"\nimport { savePlistFile } from \"../util/plist\"\n\nexport class LibUiFramework implements Framework {\n readonly name: string = \"libui\"\n // noinspection JSUnusedGlobalSymbols\n readonly macOsDefaultTargets = [\"dmg\"]\n\n readonly defaultAppIdPrefix: string = \"com.libui.\"\n\n // noinspection JSUnusedGlobalSymbols\n readonly isCopyElevateHelper = false\n\n // noinspection JSUnusedGlobalSymbols\n readonly isNpmRebuildRequired = false\n\n constructor(\n readonly version: string,\n readonly distMacOsAppName: string,\n protected readonly isUseLaunchUi: boolean\n ) {}\n\n async prepareApplicationStageDirectory(options: PrepareApplicationStageDirectoryOptions) {\n await emptyDir(options.appOutDir)\n\n const packager = options.packager\n const platform = packager.platform\n\n if (this.isUseLaunchUiForPlatform(platform)) {\n const appOutDir = options.appOutDir\n await executeAppBuilder([\n \"proton-native\",\n \"--node-version\",\n this.version,\n \"--use-launch-ui\",\n \"--platform\",\n platform.nodeName,\n \"--arch\",\n options.arch,\n \"--stage\",\n appOutDir,\n \"--executable\",\n `${packager.appInfo.productFilename}${platform === Platform.WINDOWS ? \".exe\" : \"\"}`,\n ])\n return\n }\n\n if (platform === Platform.MAC) {\n await this.prepareMacosApplicationStageDirectory(packager as MacPackager, options)\n } else if (platform === Platform.LINUX) {\n await this.prepareLinuxApplicationStageDirectory(options)\n }\n }\n\n private async prepareMacosApplicationStageDirectory(packager: MacPackager, options: PrepareApplicationStageDirectoryOptions) {\n const appContentsDir = path.join(options.appOutDir, this.distMacOsAppName, \"Contents\")\n await mkdir(path.join(appContentsDir, \"Resources\"), { recursive: true })\n await mkdir(path.join(appContentsDir, \"MacOS\"), { recursive: true })\n await executeAppBuilder([\"proton-native\", \"--node-version\", this.version, \"--platform\", \"darwin\", \"--stage\", path.join(appContentsDir, \"MacOS\")])\n\n const appPlist: any = {\n // https://github.com/albe-rosado/create-proton-app/issues/13\n NSHighResolutionCapable: true,\n }\n await packager.applyCommonInfo(appPlist, appContentsDir)\n await savePlistFile(path.join(appContentsDir, \"Info.plist\"), appPlist)\n await writeExecutableMain(\n path.join(appContentsDir, \"MacOS\", appPlist.CFBundleExecutable),\n `#!/bin/sh\n DIR=$(dirname \"$0\")\n \"$DIR/node\" \"$DIR/../Resources/app/${options.packager.info.metadata.main || \"index.js\"}\"\n `\n )\n }\n\n private async prepareLinuxApplicationStageDirectory(options: PrepareApplicationStageDirectoryOptions) {\n const appOutDir = options.appOutDir\n await executeAppBuilder([\"proton-native\", \"--node-version\", this.version, \"--platform\", \"linux\", \"--arch\", options.arch, \"--stage\", appOutDir])\n const mainPath = path.join(appOutDir, (options.packager as LinuxPackager).executableName)\n await writeExecutableMain(\n mainPath,\n `#!/bin/sh\n DIR=$(dirname \"$0\")\n \"$DIR/node\" \"$DIR/app/${options.packager.info.metadata.main || \"index.js\"}\"\n `\n )\n }\n\n async afterPack(context: AfterPackContext) {\n const packager = context.packager\n if (!this.isUseLaunchUiForPlatform(packager.platform)) {\n return\n }\n\n // LaunchUI requires main.js, rename if need\n const userMain = packager.info.metadata.main || \"index.js\"\n if (userMain === \"main.js\") {\n return\n }\n\n await rename(path.join(context.appOutDir, \"app\", userMain), path.join(context.appOutDir, \"app\", \"main.js\"))\n }\n\n getMainFile(platform: Platform): string | null {\n return this.isUseLaunchUiForPlatform(platform) ? \"main.js\" : null\n }\n\n private isUseLaunchUiForPlatform(platform: Platform) {\n return platform === Platform.WINDOWS || (this.isUseLaunchUi && platform === Platform.LINUX)\n }\n\n getExcludedDependencies(platform: Platform): Array<string> | null {\n // part of launchui\n return this.isUseLaunchUiForPlatform(platform) ? [\"libui-node\"] : null\n }\n}\n\nasync function writeExecutableMain(file: string, content: string) {\n await writeFile(file, content, { mode: 0o755 })\n await chmod(file, 0o755)\n}\n"]}
@@ -368,7 +368,7 @@ class MacPackager extends platformPackager_1.PlatformPackager {
368
368
  identityHash: (identity === null || identity === void 0 ? void 0 : identity.hash) || "none",
369
369
  provisioningProfile: provisioningProfile || "none",
370
370
  }, customSign ? "executing custom sign" : "signing");
371
- return customSign ? Promise.resolve(customSign(opts, this)) : (0, macCodeSign_1.sign)(opts);
371
+ return customSign ? Promise.resolve(customSign(opts, this)) : (0, macCodeSign_1.sign)({ ...opts, identity: identity ? identity.name : undefined });
372
372
  }
373
373
  //noinspection JSMethodCanBeStatic
374
374
  async doFlat(appPath, outFile, identity, keychain) {
@@ -1 +1 @@
1
- {"version":3,"file":"macPackager.js","sourceRoot":"","sources":["../src/macPackager.ts"],"names":[],"mappings":";;;AAAA,iDAA6C;AAG7C,+CAAmL;AACnL,+DAAwD;AACxD,kCAAiC;AACjC,0CAA4C;AAC5C,uCAA+B;AAC/B,6BAA4B;AAC5B,uCAAmC;AACnC,wDAAmL;AACnL,iCAAqD;AAIrD,yDAAmF;AACnF,2DAAuD;AACvD,uCAAkE;AAClE,2DAAwE;AACxE,sDAAuD;AACvD,oDAAoD;AACpD,4CAAgD;AAKhD,M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,EAAE,CAAA;QACtE,CAAC;QAED,qBAAqB;QACrB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAA;QAC3C,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAA;QAC1D,IAAI,eAAe,EAAE,CAAC;YACpB,IAAI,IAAI,GAAkC,EAAE,eAAe,EAAE,CAAA;YAC7D,IAAI,QAAQ,EAAE,CAAC;gBACb,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAA;YAC9B,CAAC;YACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,CAAA;QACnC,CAAC;QAED,4CAA4C;QAC5C,OAAO,SAAS,CAAA;IAClB,CAAC;CACF;AAnjBD,kCAmjBC;AAED,SAAS,mBAAmB,CAAC,KAAc,EAAE,aAAsB;IACjE,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,EAAE,0BAA0B,CAAC,CAAA;IACvG,CAAC;IACD,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,oBAAoB,EAAE,qCAAqC,CAAC,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAA;AAC7G,CAAC","sourcesContent":["import { notarize } from \"@electron/notarize\"\nimport { NotarizeOptionsNotaryTool, NotaryToolKeychainCredentials } from \"@electron/notarize/lib/types\"\nimport { PerFileSignOptions, SignOptions } from \"@electron/osx-sign/dist/cjs/types\"\nimport { Arch, AsyncTaskManager, copyFile, deepAssign, exec, getArchSuffix, InvalidConfigurationError, log, orIfFileNotExist, statOrNull, unlinkIfExists, use } 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\"\nimport { CertType, CodeSigningInfo, createKeychain, CreateKeychainOptions, findIdentity, Identity, isSignAllowed, removeKeychain, reportError, sign } from \"./codeSign/macCodeSign\"\nimport { DIR_TARGET, Platform, Target } from \"./core\"\nimport { AfterPackContext, ElectronPlatformName } from \"./index\"\nimport { MacConfiguration, MasConfiguration } from \"./options/macOptions\"\nimport { Packager } from \"./packager\"\nimport { chooseNotNull, DoPackOptions, PlatformPackager } from \"./platformPackager\"\nimport { ArchiveTarget } from \"./targets/ArchiveTarget\"\nimport { PkgTarget, prepareProductBuildArgs } from \"./targets/pkg\"\nimport { createCommonTarget, NoOpTarget } from \"./targets/targetFactory\"\nimport { isMacOsHighSierra } from \"./util/macosVersion\"\nimport { getTemplatePath } from \"./util/pathManager\"\nimport { resolveFunction } from \"./util/resolve\"\n\nexport type CustomMacSignOptions = SignOptions\nexport type CustomMacSign = (configuration: CustomMacSignOptions, packager: MacPackager) => Promise<void>\n\nexport class MacPackager extends PlatformPackager<MacConfiguration> {\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.info.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 constructor(info: Packager) {\n super(info, Platform.MAC)\n }\n\n get defaultTarget(): Array<string> {\n return this.info.framework.macOsDefaultTargets\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected prepareAppInfo(appInfo: AppInfo): AppInfo {\n // codesign requires the filename to be normalized to the NFD form\n return new AppInfo(this.info, this.platformSpecificBuildOptions.bundleVersion, this.platformSpecificBuildOptions, true)\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 const { DmgTarget } = require(\"dmg-builder\")\n mapper(name, outDir => new DmgTarget(this, outDir))\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 => (name === \"mas\" || name === \"mas-dev\" ? new NoOpTarget(name) : createCommonTarget(name, outDir, this)))\n break\n }\n }\n }\n\n protected async doPack(config: DoPackOptions<MacConfiguration>): Promise<any> {\n const { outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets } = config\n\n switch (arch) {\n default: {\n return super.doPack(config)\n }\n case Arch.universal: {\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 },\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 const { makeUniversalApp } = require(\"@electron/universal\")\n await makeUniversalApp({\n x64AppPath: path.join(x64AppOutDir, appFile),\n arm64AppPath: path.join(arm64AppOutPath, appFile),\n outAppPath: path.join(appOutDir, appFile),\n force: true,\n mergeASARs: platformSpecificBuildOptions.mergeASARs ?? true,\n singleArchFiles: platformSpecificBuildOptions.singleArchFiles,\n x64ArchFiles: platformSpecificBuildOptions.x64ArchFiles,\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 await this.doSignAfterPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets)\n break\n }\n }\n }\n\n async pack(outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): Promise<void> {\n const hasMas = targets.length !== 0 && targets.some(it => it.name === \"mas\" || it.name === \"mas-dev\")\n const prepackaged = this.packagerOptions.prepackaged\n\n for (const target of targets) {\n const targetName = target.name\n if (!(targetName === \"mas\" || targetName === \"mas-dev\")) {\n continue\n }\n\n const masBuildOptions = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas)\n if (targetName === \"mas-dev\") {\n deepAssign(masBuildOptions, this.config.masDev, {\n type: \"development\",\n })\n }\n\n const targetOutDir = path.join(outDir, `${targetName}${getArchSuffix(arch, this.platformSpecificBuildOptions.defaultArch)}`)\n if (prepackaged == null) {\n await this.doPack({ outDir, appOutDir: targetOutDir, platformName: \"mas\", arch, platformSpecificBuildOptions: masBuildOptions, targets: [target] })\n await this.sign(path.join(targetOutDir, `${this.appInfo.productFilename}.app`), targetOutDir, masBuildOptions, arch)\n } else {\n await this.sign(prepackaged, targetOutDir, masBuildOptions, arch)\n }\n }\n\n if (!hasMas || targets.length > 1) {\n const appPath = prepackaged == null ? path.join(this.computeAppOutDir(outDir, arch), `${this.appInfo.productFilename}.app`) : prepackaged\n if (prepackaged == null) {\n await this.doPack({\n outDir,\n appOutDir: path.dirname(appPath),\n platformName: this.platform.nodeName as ElectronPlatformName,\n arch,\n platformSpecificBuildOptions: this.platformSpecificBuildOptions,\n targets,\n })\n }\n this.packageInDistributableFormat(appPath, arch, targets, taskManager)\n }\n }\n\n private async sign(appPath: string, outDir: string | null, masOptions: MasConfiguration | null, arch: Arch | null): Promise<boolean> {\n if (!isSignAllowed()) {\n return false\n }\n\n const isMas = masOptions != null\n const options = masOptions == null ? this.platformSpecificBuildOptions : masOptions\n const qualifier = options.identity\n\n if (qualifier === null) {\n if (this.forceCodeSigning) {\n throw new InvalidConfigurationError(\"identity explicitly is set to null, but forceCodeSigning is set to true\")\n }\n log.info({ reason: \"identity explicitly is set to null\" }, \"skipped macOS code signing\")\n return false\n }\n\n const keychainFile = (await this.codeSigningInfo.value).keychainFile\n const explicitType = options.type\n const type = explicitType || \"distribution\"\n const isDevelopment = type === \"development\"\n const certificateTypes = getCertificateTypes(isMas, isDevelopment)\n\n let identity = null\n for (const certificateType of certificateTypes) {\n identity = await findIdentity(certificateType, qualifier, keychainFile)\n if (identity != null) {\n break\n }\n }\n\n if (identity == null) {\n if (!isMas && !isDevelopment && explicitType !== \"distribution\") {\n identity = await findIdentity(\"Mac Developer\", qualifier, keychainFile)\n if (identity != null) {\n log.warn(\"Mac Developer is used to sign app — it is only for development and testing, not for production\")\n }\n }\n\n if (!options.sign && identity == null) {\n await reportError(isMas, certificateTypes, qualifier, keychainFile, this.forceCodeSigning)\n return false\n }\n }\n\n if (!isMacOsHighSierra()) {\n throw new InvalidConfigurationError(\"macOS High Sierra 10.13.6 is required to sign\")\n }\n\n let filter = options.signIgnore\n if (Array.isArray(filter)) {\n if (filter.length == 0) {\n filter = null\n }\n } else if (filter != null) {\n filter = filter.length === 0 ? null : [filter]\n }\n\n const filterRe = filter == null ? null : filter.map(it => new RegExp(it))\n\n let binaries = options.binaries || undefined\n if (binaries) {\n // Accept absolute paths for external binaries, else resolve relative paths from the artifact's app Contents path.\n binaries = await Promise.all(\n binaries.map(async destination => {\n if (await statOrNull(destination)) {\n return destination\n }\n return path.resolve(appPath, destination)\n })\n )\n log.info({ binaries }, \"signing additional user-defined binaries\")\n }\n const customSignOptions: MasConfiguration | MacConfiguration = (isMas ? masOptions : this.platformSpecificBuildOptions) || this.platformSpecificBuildOptions\n\n const signOptions: SignOptions = {\n identityValidation: false,\n // https://github.com/electron-userland/electron-builder/issues/1699\n // kext are signed by the chipset manufacturers. You need a special certificate (only available on request) from Apple to be able to sign kext.\n ignore: (file: string) => {\n if (filterRe != null) {\n for (const regExp of filterRe) {\n if (regExp.test(file)) {\n return true\n }\n }\n }\n return (\n file.endsWith(\".kext\") ||\n file.startsWith(\"/Contents/PlugIns\", appPath.length) ||\n file.includes(\"/node_modules/puppeteer/.local-chromium\") ||\n file.includes(\"/node_modules/playwright-firefox/.local-browsers\") ||\n file.includes(\"/node_modules/playwright/.local-browsers\")\n )\n\n /* Those are browser automating modules, browser (chromium, nightly) cannot be signed\n https://github.com/electron-userland/electron-builder/issues/2010\n https://github.com/electron-userland/electron-builder/issues/5383\n */\n },\n identity: identity ? identity.hash || identity.name : undefined,\n type,\n platform: isMas ? \"mas\" : \"darwin\",\n version: this.config.electronVersion || undefined,\n app: appPath,\n keychain: keychainFile || undefined,\n binaries,\n // https://github.com/electron-userland/electron-builder/issues/1480\n strictVerify: options.strictVerify,\n preAutoEntitlements: options.preAutoEntitlements,\n optionsForFile: await this.getOptionsForFile(appPath, isMas, customSignOptions),\n provisioningProfile: customSignOptions.provisioningProfile || undefined,\n }\n\n await this.doSign(signOptions, customSignOptions, identity)\n\n // https://github.com/electron-userland/electron-builder/issues/1196#issuecomment-312310209\n if (masOptions != null && !isDevelopment) {\n const certType = isDevelopment ? \"Mac Developer\" : \"3rd Party Mac Developer Installer\"\n const masInstallerIdentity = await findIdentity(certType, masOptions.identity, keychainFile)\n if (masInstallerIdentity == null) {\n throw new InvalidConfigurationError(`Cannot find valid \"${certType}\" identity to sign MAS installer, please see https://electron.build/code-signing`)\n }\n\n // mas uploaded to AppStore, so, use \"-\" instead of space for name\n const artifactName = this.expandArtifactNamePattern(masOptions, \"pkg\", arch)\n const artifactPath = path.join(outDir!, artifactName)\n await this.doFlat(appPath, artifactPath, masInstallerIdentity, keychainFile)\n await this.dispatchArtifactCreated(artifactPath, null, Arch.x64, this.computeSafeArtifactName(artifactName, \"pkg\", arch, true, this.platformSpecificBuildOptions.defaultArch))\n }\n\n if (!isMas) {\n await this.notarizeIfProvided(appPath)\n }\n return true\n }\n\n private async getOptionsForFile(appPath: string, isMas: boolean, customSignOptions: MacConfiguration) {\n const resourceList = await this.resourceList\n const entitlementsSuffix = isMas ? \"mas\" : \"mac\"\n\n const getEntitlements = (filePath: string) => {\n // check if root app, then use main entitlements\n if (filePath === appPath) {\n if (customSignOptions.entitlements) {\n return customSignOptions.entitlements\n }\n const p = `entitlements.${entitlementsSuffix}.plist`\n if (resourceList.includes(p)) {\n return path.join(this.info.buildResourcesDir, p)\n } else {\n return getTemplatePath(\"entitlements.mac.plist\")\n }\n }\n\n // It's a login helper...\n if (filePath.includes(\"Library/LoginItems\")) {\n return customSignOptions.entitlementsLoginHelper\n }\n\n // Only remaining option is that it's inherited entitlements\n if (customSignOptions.entitlementsInherit) {\n return customSignOptions.entitlementsInherit\n }\n const p = `entitlements.${entitlementsSuffix}.inherit.plist`\n if (resourceList.includes(p)) {\n return path.join(this.info.buildResourcesDir, p)\n } else {\n return getTemplatePath(\"entitlements.mac.plist\")\n }\n }\n\n const requirements = isMas || this.platformSpecificBuildOptions.requirements == null ? undefined : await this.getResource(this.platformSpecificBuildOptions.requirements)\n\n // harden by default for mac builds. Only harden mas builds if explicitly true (backward compatibility)\n const hardenedRuntime = isMas ? customSignOptions.hardenedRuntime === true : customSignOptions.hardenedRuntime !== false\n\n const optionsForFile: (filePath: string) => PerFileSignOptions = filePath => {\n const entitlements = getEntitlements(filePath)\n const args = {\n entitlements: entitlements || undefined,\n hardenedRuntime: hardenedRuntime ?? undefined,\n timestamp: customSignOptions.timestamp || undefined,\n requirements: requirements || undefined,\n additionalArguments: customSignOptions.additionalArguments || [],\n }\n log.debug({ file: log.filePath(filePath), ...args }, \"selecting signing options\")\n return args\n }\n return optionsForFile\n }\n\n //noinspection JSMethodCanBeStatic\n protected async doSign(opts: SignOptions, customSignOptions: MacConfiguration, identity: Identity | null): Promise<void> {\n const customSign = await resolveFunction(this.appInfo.type, customSignOptions.sign, \"sign\")\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)\n }\n\n //noinspection JSMethodCanBeStatic\n protected async doFlat(appPath: string, outFile: string, identity: Identity, keychain: string | Nullish): Promise<any> {\n // productbuild doesn't created directory for out file\n await mkdir(path.dirname(outFile), { recursive: true })\n\n const args = prepareProductBuildArgs(identity, keychain)\n args.push(\"--component\", appPath, \"/Applications\")\n args.push(outFile)\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) {\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 icon = await this.getIconPath()\n if (icon != null) {\n const oldIcon = appPlist.CFBundleIconFile\n const resourcesPath = path.join(contentsPath, \"Resources\")\n if (oldIcon != null) {\n await unlinkIfExists(path.join(resourcesPath, oldIcon))\n }\n const iconFileName = \"icon.icns\"\n appPlist.CFBundleIconFile = iconFileName\n await copyFile(icon, path.join(resourcesPath, iconFileName))\n }\n appPlist.CFBundleName = appInfo.productName\n appPlist.CFBundleDisplayName = appInfo.productName\n\n const minimumSystemVersion = this.platformSpecificBuildOptions.minimumSystemVersion\n if (minimumSystemVersion != null) {\n appPlist.LSMinimumSystemVersion = minimumSystemVersion\n }\n\n appPlist.CFBundleShortVersionString = this.platformSpecificBuildOptions.bundleShortVersion || appInfo.version\n appPlist.CFBundleVersion = 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 Object.assign(appPlist, extendInfo)\n }\n }\n\n protected async signApp(packContext: AfterPackContext, isAsar: boolean): Promise<boolean> {\n const readDirectoryAndSign = async (sourceDirectory: string, directories: string[], shouldSign: (file: string) => boolean): Promise<boolean> => {\n await Promise.all(\n directories.map(async (file: string) => {\n if (shouldSign(file)) {\n await this.sign(path.join(sourceDirectory, file), null, null, null)\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 async notarizeIfProvided(appPath: string) {\n const notarizeOptions = this.platformSpecificBuildOptions.notarize\n if (notarizeOptions === false) {\n log.info({ reason: \"`notarize` options were set explicitly `false`\" }, \"skipped macOS notarization\")\n return\n }\n const options = this.getNotarizeOptions(appPath)\n if (!options) {\n log.warn({ reason: \"`notarize` options were unable to be generated\" }, \"skipped macOS notarization\")\n return\n }\n await notarize(options)\n log.info(null, \"notarization successful\")\n }\n\n private getNotarizeOptions(appPath: string): NotarizeOptionsNotaryTool | undefined {\n const teamId = process.env.APPLE_TEAM_ID\n const appleId = process.env.APPLE_ID\n const appleIdPassword = process.env.APPLE_APP_SPECIFIC_PASSWORD\n const tool = \"notarytool\"\n\n // option 1: app specific password\n if (appleId || appleIdPassword) {\n if (!appleId) {\n throw new InvalidConfigurationError(`APPLE_ID env var needs to be set`)\n }\n if (!appleIdPassword) {\n throw new InvalidConfigurationError(`APPLE_APP_SPECIFIC_PASSWORD env var needs to be set`)\n }\n if (!teamId) {\n throw new InvalidConfigurationError(`APPLE_TEAM_ID env var needs to be set`)\n }\n return { tool, appPath, appleId, appleIdPassword, teamId }\n }\n\n // option 2: API key\n const appleApiKey = process.env.APPLE_API_KEY\n const appleApiKeyId = process.env.APPLE_API_KEY_ID\n const appleApiIssuer = process.env.APPLE_API_ISSUER\n if (appleApiKey || appleApiKeyId || appleApiIssuer) {\n if (!appleApiKey || !appleApiKeyId || !appleApiIssuer) {\n throw new InvalidConfigurationError(`Env vars APPLE_API_KEY, APPLE_API_KEY_ID and APPLE_API_ISSUER need to be set`)\n }\n return { tool, appPath, appleApiKey, appleApiKeyId, appleApiIssuer }\n }\n\n // option 3: keychain\n const keychain = process.env.APPLE_KEYCHAIN\n const keychainProfile = process.env.APPLE_KEYCHAIN_PROFILE\n if (keychainProfile) {\n let args: NotaryToolKeychainCredentials = { keychainProfile }\n if (keychain) {\n args = { ...args, keychain }\n }\n return { tool, appPath, ...args }\n }\n\n // if no credentials provided, skip silently\n return undefined\n }\n}\n\nfunction getCertificateTypes(isMas: boolean, isDevelopment: boolean): CertType[] {\n if (isDevelopment) {\n return isMas ? [\"Mac Developer\", \"Apple Development\"] : [\"Mac Developer\", \"Developer ID Application\"]\n }\n return isMas ? [\"Apple Distribution\", \"3rd Party Mac Developer Application\"] : [\"Developer ID Application\"]\n}\n"]}
1
+ {"version":3,"file":"macPackager.js","sourceRoot":"","sources":["../src/macPackager.ts"],"names":[],"mappings":";;;AAAA,iDAA6C;AAG7C,+CAAmL;AACnL,+DAAwD;AACxD,kCAAiC;AACjC,0CAA4C;AAC5C,uCAA+B;AAC/B,6BAA4B;AAC5B,uCAAmC;AACnC,wDAAmL;AACnL,iCAAqD;AAIrD,yDAAmF;AACnF,2DAAuD;AACvD,uCAAkE;AAClE,2DAAwE;AACxE,sDAAuD;AACvD,oDAAoD;AACpD,4CAAgD;AAKhD,MAAa,WAAY,SAAQ,mCAAkC;IAoCjE,YAAY,IAAc;QACxB,KAAK,CAAC,IAAI,EAAE,eAAQ,CAAC,GAAG,CAAC,CAAA;QApClB,oBAAe,GAAG,IAAI,+BAAQ,CACrC,GAAG,EAAE;YACH,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAA;YACjC,IAAI,OAAO,IAAI,IAAI,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;gBACrD,OAAO,IAAI,CAAA;YACb,CAAC;YAED,MAAM,QAAQ,GAAG;gBACf,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,cAAc;gBAChC,OAAO;gBACP,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE;gBACrC,QAAQ,EAAE,IAAA,gCAAa,EAAC,IAAI,CAAC,4BAA4B,CAAC,gBAAgB,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;gBAC3G,eAAe,EAAE,IAAA,gCAAa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ED,SAAS,mBAAmB,CAAC,KAAc,EAAE,aAAsB;IACjE,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,EAAE,0BAA0B,CAAC,CAAA;IACvG,CAAC;IACD,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,oBAAoB,EAAE,qCAAqC,CAAC,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAA;AAC7G,CAAC","sourcesContent":["import { notarize } from \"@electron/notarize\"\nimport { NotarizeOptionsNotaryTool, NotaryToolKeychainCredentials } from \"@electron/notarize/lib/types\"\nimport { PerFileSignOptions, SignOptions } from \"@electron/osx-sign/dist/cjs/types\"\nimport { Arch, AsyncTaskManager, copyFile, deepAssign, exec, getArchSuffix, InvalidConfigurationError, log, orIfFileNotExist, statOrNull, unlinkIfExists, use } 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\"\nimport { CertType, CodeSigningInfo, createKeychain, CreateKeychainOptions, findIdentity, Identity, isSignAllowed, removeKeychain, reportError, sign } from \"./codeSign/macCodeSign\"\nimport { DIR_TARGET, Platform, Target } from \"./core\"\nimport { AfterPackContext, ElectronPlatformName } from \"./index\"\nimport { MacConfiguration, MasConfiguration } from \"./options/macOptions\"\nimport { Packager } from \"./packager\"\nimport { chooseNotNull, DoPackOptions, PlatformPackager } from \"./platformPackager\"\nimport { ArchiveTarget } from \"./targets/ArchiveTarget\"\nimport { PkgTarget, prepareProductBuildArgs } from \"./targets/pkg\"\nimport { createCommonTarget, NoOpTarget } from \"./targets/targetFactory\"\nimport { isMacOsHighSierra } from \"./util/macosVersion\"\nimport { getTemplatePath } from \"./util/pathManager\"\nimport { resolveFunction } from \"./util/resolve\"\n\nexport type CustomMacSignOptions = SignOptions\nexport type CustomMacSign = (configuration: CustomMacSignOptions, packager: MacPackager) => Promise<void>\n\nexport class MacPackager extends PlatformPackager<MacConfiguration> {\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.info.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 constructor(info: Packager) {\n super(info, Platform.MAC)\n }\n\n get defaultTarget(): Array<string> {\n return this.info.framework.macOsDefaultTargets\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected prepareAppInfo(appInfo: AppInfo): AppInfo {\n // codesign requires the filename to be normalized to the NFD form\n return new AppInfo(this.info, this.platformSpecificBuildOptions.bundleVersion, this.platformSpecificBuildOptions, true)\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 const { DmgTarget } = require(\"dmg-builder\")\n mapper(name, outDir => new DmgTarget(this, outDir))\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 => (name === \"mas\" || name === \"mas-dev\" ? new NoOpTarget(name) : createCommonTarget(name, outDir, this)))\n break\n }\n }\n }\n\n protected async doPack(config: DoPackOptions<MacConfiguration>): Promise<any> {\n const { outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets } = config\n\n switch (arch) {\n default: {\n return super.doPack(config)\n }\n case Arch.universal: {\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 },\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 const { makeUniversalApp } = require(\"@electron/universal\")\n await makeUniversalApp({\n x64AppPath: path.join(x64AppOutDir, appFile),\n arm64AppPath: path.join(arm64AppOutPath, appFile),\n outAppPath: path.join(appOutDir, appFile),\n force: true,\n mergeASARs: platformSpecificBuildOptions.mergeASARs ?? true,\n singleArchFiles: platformSpecificBuildOptions.singleArchFiles,\n x64ArchFiles: platformSpecificBuildOptions.x64ArchFiles,\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 await this.doSignAfterPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets)\n break\n }\n }\n }\n\n async pack(outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): Promise<void> {\n const hasMas = targets.length !== 0 && targets.some(it => it.name === \"mas\" || it.name === \"mas-dev\")\n const prepackaged = this.packagerOptions.prepackaged\n\n for (const target of targets) {\n const targetName = target.name\n if (!(targetName === \"mas\" || targetName === \"mas-dev\")) {\n continue\n }\n\n const masBuildOptions = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas)\n if (targetName === \"mas-dev\") {\n deepAssign(masBuildOptions, this.config.masDev, {\n type: \"development\",\n })\n }\n\n const targetOutDir = path.join(outDir, `${targetName}${getArchSuffix(arch, this.platformSpecificBuildOptions.defaultArch)}`)\n if (prepackaged == null) {\n await this.doPack({ outDir, appOutDir: targetOutDir, platformName: \"mas\", arch, platformSpecificBuildOptions: masBuildOptions, targets: [target] })\n await this.sign(path.join(targetOutDir, `${this.appInfo.productFilename}.app`), targetOutDir, masBuildOptions, arch)\n } else {\n await this.sign(prepackaged, targetOutDir, masBuildOptions, arch)\n }\n }\n\n if (!hasMas || targets.length > 1) {\n const appPath = prepackaged == null ? path.join(this.computeAppOutDir(outDir, arch), `${this.appInfo.productFilename}.app`) : prepackaged\n if (prepackaged == null) {\n await this.doPack({\n outDir,\n appOutDir: path.dirname(appPath),\n platformName: this.platform.nodeName as ElectronPlatformName,\n arch,\n platformSpecificBuildOptions: this.platformSpecificBuildOptions,\n targets,\n })\n }\n this.packageInDistributableFormat(appPath, arch, targets, taskManager)\n }\n }\n\n private async sign(appPath: string, outDir: string | null, masOptions: MasConfiguration | null, arch: Arch | null): Promise<boolean> {\n if (!isSignAllowed()) {\n return false\n }\n\n const isMas = masOptions != null\n const options = masOptions == null ? this.platformSpecificBuildOptions : masOptions\n const qualifier = options.identity\n\n if (qualifier === null) {\n if (this.forceCodeSigning) {\n throw new InvalidConfigurationError(\"identity explicitly is set to null, but forceCodeSigning is set to true\")\n }\n log.info({ reason: \"identity explicitly is set to null\" }, \"skipped macOS code signing\")\n return false\n }\n\n const keychainFile = (await this.codeSigningInfo.value).keychainFile\n const explicitType = options.type\n const type = explicitType || \"distribution\"\n const isDevelopment = type === \"development\"\n const certificateTypes = getCertificateTypes(isMas, isDevelopment)\n\n let identity = null\n for (const certificateType of certificateTypes) {\n identity = await findIdentity(certificateType, qualifier, keychainFile)\n if (identity != null) {\n break\n }\n }\n\n if (identity == null) {\n if (!isMas && !isDevelopment && explicitType !== \"distribution\") {\n identity = await findIdentity(\"Mac Developer\", qualifier, keychainFile)\n if (identity != null) {\n log.warn(\"Mac Developer is used to sign app — it is only for development and testing, not for production\")\n }\n }\n\n if (!options.sign && identity == null) {\n await reportError(isMas, certificateTypes, qualifier, keychainFile, this.forceCodeSigning)\n return false\n }\n }\n\n if (!isMacOsHighSierra()) {\n throw new InvalidConfigurationError(\"macOS High Sierra 10.13.6 is required to sign\")\n }\n\n let filter = options.signIgnore\n if (Array.isArray(filter)) {\n if (filter.length == 0) {\n filter = null\n }\n } else if (filter != null) {\n filter = filter.length === 0 ? null : [filter]\n }\n\n const filterRe = filter == null ? null : filter.map(it => new RegExp(it))\n\n let binaries = options.binaries || undefined\n if (binaries) {\n // Accept absolute paths for external binaries, else resolve relative paths from the artifact's app Contents path.\n binaries = await Promise.all(\n binaries.map(async destination => {\n if (await statOrNull(destination)) {\n return destination\n }\n return path.resolve(appPath, destination)\n })\n )\n log.info({ binaries }, \"signing additional user-defined binaries\")\n }\n const customSignOptions: MasConfiguration | MacConfiguration = (isMas ? masOptions : this.platformSpecificBuildOptions) || this.platformSpecificBuildOptions\n\n const signOptions: SignOptions = {\n identityValidation: false,\n // https://github.com/electron-userland/electron-builder/issues/1699\n // kext are signed by the chipset manufacturers. You need a special certificate (only available on request) from Apple to be able to sign kext.\n ignore: (file: string) => {\n if (filterRe != null) {\n for (const regExp of filterRe) {\n if (regExp.test(file)) {\n return true\n }\n }\n }\n return (\n file.endsWith(\".kext\") ||\n file.startsWith(\"/Contents/PlugIns\", appPath.length) ||\n file.includes(\"/node_modules/puppeteer/.local-chromium\") ||\n file.includes(\"/node_modules/playwright-firefox/.local-browsers\") ||\n file.includes(\"/node_modules/playwright/.local-browsers\")\n )\n\n /* Those are browser automating modules, browser (chromium, nightly) cannot be signed\n https://github.com/electron-userland/electron-builder/issues/2010\n https://github.com/electron-userland/electron-builder/issues/5383\n */\n },\n identity: identity ? identity.hash || identity.name : undefined,\n type,\n platform: isMas ? \"mas\" : \"darwin\",\n version: this.config.electronVersion || undefined,\n app: appPath,\n keychain: keychainFile || undefined,\n binaries,\n // https://github.com/electron-userland/electron-builder/issues/1480\n strictVerify: options.strictVerify,\n preAutoEntitlements: options.preAutoEntitlements,\n optionsForFile: await this.getOptionsForFile(appPath, isMas, customSignOptions),\n provisioningProfile: customSignOptions.provisioningProfile || undefined,\n }\n\n await this.doSign(signOptions, customSignOptions, identity)\n\n // https://github.com/electron-userland/electron-builder/issues/1196#issuecomment-312310209\n if (masOptions != null && !isDevelopment) {\n const certType = isDevelopment ? \"Mac Developer\" : \"3rd Party Mac Developer Installer\"\n const masInstallerIdentity = await findIdentity(certType, masOptions.identity, keychainFile)\n if (masInstallerIdentity == null) {\n throw new InvalidConfigurationError(`Cannot find valid \"${certType}\" identity to sign MAS installer, please see https://electron.build/code-signing`)\n }\n\n // mas uploaded to AppStore, so, use \"-\" instead of space for name\n const artifactName = this.expandArtifactNamePattern(masOptions, \"pkg\", arch)\n const artifactPath = path.join(outDir!, artifactName)\n await this.doFlat(appPath, artifactPath, masInstallerIdentity, keychainFile)\n await this.dispatchArtifactCreated(artifactPath, null, Arch.x64, this.computeSafeArtifactName(artifactName, \"pkg\", arch, true, this.platformSpecificBuildOptions.defaultArch))\n }\n\n if (!isMas) {\n await this.notarizeIfProvided(appPath)\n }\n return true\n }\n\n private async getOptionsForFile(appPath: string, isMas: boolean, customSignOptions: MacConfiguration) {\n const resourceList = await this.resourceList\n const entitlementsSuffix = isMas ? \"mas\" : \"mac\"\n\n const getEntitlements = (filePath: string) => {\n // check if root app, then use main entitlements\n if (filePath === appPath) {\n if (customSignOptions.entitlements) {\n return customSignOptions.entitlements\n }\n const p = `entitlements.${entitlementsSuffix}.plist`\n if (resourceList.includes(p)) {\n return path.join(this.info.buildResourcesDir, p)\n } else {\n return getTemplatePath(\"entitlements.mac.plist\")\n }\n }\n\n // It's a login helper...\n if (filePath.includes(\"Library/LoginItems\")) {\n return customSignOptions.entitlementsLoginHelper\n }\n\n // Only remaining option is that it's inherited entitlements\n if (customSignOptions.entitlementsInherit) {\n return customSignOptions.entitlementsInherit\n }\n const p = `entitlements.${entitlementsSuffix}.inherit.plist`\n if (resourceList.includes(p)) {\n return path.join(this.info.buildResourcesDir, p)\n } else {\n return getTemplatePath(\"entitlements.mac.plist\")\n }\n }\n\n const requirements = isMas || this.platformSpecificBuildOptions.requirements == null ? undefined : await this.getResource(this.platformSpecificBuildOptions.requirements)\n\n // harden by default for mac builds. Only harden mas builds if explicitly true (backward compatibility)\n const hardenedRuntime = isMas ? customSignOptions.hardenedRuntime === true : customSignOptions.hardenedRuntime !== false\n\n const optionsForFile: (filePath: string) => PerFileSignOptions = filePath => {\n const entitlements = getEntitlements(filePath)\n const args = {\n entitlements: entitlements || undefined,\n hardenedRuntime: hardenedRuntime ?? undefined,\n timestamp: customSignOptions.timestamp || undefined,\n requirements: requirements || undefined,\n additionalArguments: customSignOptions.additionalArguments || [],\n }\n log.debug({ file: log.filePath(filePath), ...args }, \"selecting signing options\")\n return args\n }\n return optionsForFile\n }\n\n //noinspection JSMethodCanBeStatic\n protected async doSign(opts: SignOptions, customSignOptions: MacConfiguration, identity: Identity | null): Promise<void> {\n const customSign = await resolveFunction(this.appInfo.type, customSignOptions.sign, \"sign\")\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 protected async doFlat(appPath: string, outFile: string, identity: Identity, keychain: string | Nullish): Promise<any> {\n // productbuild doesn't created directory for out file\n await mkdir(path.dirname(outFile), { recursive: true })\n\n const args = prepareProductBuildArgs(identity, keychain)\n args.push(\"--component\", appPath, \"/Applications\")\n args.push(outFile)\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) {\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 icon = await this.getIconPath()\n if (icon != null) {\n const oldIcon = appPlist.CFBundleIconFile\n const resourcesPath = path.join(contentsPath, \"Resources\")\n if (oldIcon != null) {\n await unlinkIfExists(path.join(resourcesPath, oldIcon))\n }\n const iconFileName = \"icon.icns\"\n appPlist.CFBundleIconFile = iconFileName\n await copyFile(icon, path.join(resourcesPath, iconFileName))\n }\n appPlist.CFBundleName = appInfo.productName\n appPlist.CFBundleDisplayName = appInfo.productName\n\n const minimumSystemVersion = this.platformSpecificBuildOptions.minimumSystemVersion\n if (minimumSystemVersion != null) {\n appPlist.LSMinimumSystemVersion = minimumSystemVersion\n }\n\n appPlist.CFBundleShortVersionString = this.platformSpecificBuildOptions.bundleShortVersion || appInfo.version\n appPlist.CFBundleVersion = 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 Object.assign(appPlist, extendInfo)\n }\n }\n\n protected async signApp(packContext: AfterPackContext, isAsar: boolean): Promise<boolean> {\n const readDirectoryAndSign = async (sourceDirectory: string, directories: string[], shouldSign: (file: string) => boolean): Promise<boolean> => {\n await Promise.all(\n directories.map(async (file: string) => {\n if (shouldSign(file)) {\n await this.sign(path.join(sourceDirectory, file), null, null, null)\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 async notarizeIfProvided(appPath: string) {\n const notarizeOptions = this.platformSpecificBuildOptions.notarize\n if (notarizeOptions === false) {\n log.info({ reason: \"`notarize` options were set explicitly `false`\" }, \"skipped macOS notarization\")\n return\n }\n const options = this.getNotarizeOptions(appPath)\n if (!options) {\n log.warn({ reason: \"`notarize` options were unable to be generated\" }, \"skipped macOS notarization\")\n return\n }\n await notarize(options)\n log.info(null, \"notarization successful\")\n }\n\n private getNotarizeOptions(appPath: string): NotarizeOptionsNotaryTool | undefined {\n const teamId = process.env.APPLE_TEAM_ID\n const appleId = process.env.APPLE_ID\n const appleIdPassword = process.env.APPLE_APP_SPECIFIC_PASSWORD\n const tool = \"notarytool\"\n\n // option 1: app specific password\n if (appleId || appleIdPassword) {\n if (!appleId) {\n throw new InvalidConfigurationError(`APPLE_ID env var needs to be set`)\n }\n if (!appleIdPassword) {\n throw new InvalidConfigurationError(`APPLE_APP_SPECIFIC_PASSWORD env var needs to be set`)\n }\n if (!teamId) {\n throw new InvalidConfigurationError(`APPLE_TEAM_ID env var needs to be set`)\n }\n return { tool, appPath, appleId, appleIdPassword, teamId }\n }\n\n // option 2: API key\n const appleApiKey = process.env.APPLE_API_KEY\n const appleApiKeyId = process.env.APPLE_API_KEY_ID\n const appleApiIssuer = process.env.APPLE_API_ISSUER\n if (appleApiKey || appleApiKeyId || appleApiIssuer) {\n if (!appleApiKey || !appleApiKeyId || !appleApiIssuer) {\n throw new InvalidConfigurationError(`Env vars APPLE_API_KEY, APPLE_API_KEY_ID and APPLE_API_ISSUER need to be set`)\n }\n return { tool, appPath, appleApiKey, appleApiKeyId, appleApiIssuer }\n }\n\n // option 3: keychain\n const keychain = process.env.APPLE_KEYCHAIN\n const keychainProfile = process.env.APPLE_KEYCHAIN_PROFILE\n if (keychainProfile) {\n let args: NotaryToolKeychainCredentials = { keychainProfile }\n if (keychain) {\n args = { ...args, keychain }\n }\n return { tool, appPath, ...args }\n }\n\n // if no credentials provided, skip silently\n return undefined\n }\n}\n\nfunction getCertificateTypes(isMas: boolean, isDevelopment: boolean): CertType[] {\n if (isDevelopment) {\n return isMas ? [\"Mac Developer\", \"Apple Development\"] : [\"Mac Developer\", \"Developer ID Application\"]\n }\n return isMas ? [\"Apple Distribution\", \"3rd Party Mac Developer Application\"] : [\"Developer ID Application\"]\n}\n"]}
@@ -1,4 +1,7 @@
1
+ import { NpmNodeModulesCollector } from "./npmNodeModulesCollector";
2
+ import { PnpmNodeModulesCollector } from "./pnpmNodeModulesCollector";
1
3
  import { detect, PM, getPackageManagerVersion } from "./packageManager";
2
4
  import { NodeModuleInfo } from "./types";
5
+ export declare function getCollectorByPackageManager(rootDir: string): Promise<NpmNodeModulesCollector | PnpmNodeModulesCollector>;
3
6
  export declare function getNodeModules(rootDir: string): Promise<NodeModuleInfo[]>;
4
7
  export { detect, getPackageManagerVersion, PM };
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getPackageManagerVersion = exports.detect = void 0;
4
+ exports.getCollectorByPackageManager = getCollectorByPackageManager;
4
5
  exports.getNodeModules = getNodeModules;
5
6
  const npmNodeModulesCollector_1 = require("./npmNodeModulesCollector");
6
7
  const pnpmNodeModulesCollector_1 = require("./pnpmNodeModulesCollector");
@@ -8,13 +9,23 @@ const yarnNodeModulesCollector_1 = require("./yarnNodeModulesCollector");
8
9
  const packageManager_1 = require("./packageManager");
9
10
  Object.defineProperty(exports, "detect", { enumerable: true, get: function () { return packageManager_1.detect; } });
10
11
  Object.defineProperty(exports, "getPackageManagerVersion", { enumerable: true, get: function () { return packageManager_1.getPackageManagerVersion; } });
12
+ const builder_util_1 = require("builder-util");
13
+ async function isPnpmProjectHoisted(rootDir) {
14
+ const command = await pnpmNodeModulesCollector_1.PnpmNodeModulesCollector.pmCommand.value;
15
+ const config = await (0, builder_util_1.exec)(command, ["config", "list"], { cwd: rootDir, shell: true });
16
+ const lines = Object.fromEntries(config.split("\n").map(line => line.split("=").map(s => s.trim())));
17
+ return lines["node-linker"] === "hoisted";
18
+ }
11
19
  async function getCollectorByPackageManager(rootDir) {
12
20
  const manager = await (0, packageManager_1.detect)({ cwd: rootDir });
13
21
  switch (manager) {
14
- case "npm":
15
- return new npmNodeModulesCollector_1.NpmNodeModulesCollector(rootDir);
16
22
  case "pnpm":
23
+ if (await isPnpmProjectHoisted(rootDir)) {
24
+ return new npmNodeModulesCollector_1.NpmNodeModulesCollector(rootDir);
25
+ }
17
26
  return new pnpmNodeModulesCollector_1.PnpmNodeModulesCollector(rootDir);
27
+ case "npm":
28
+ return new npmNodeModulesCollector_1.NpmNodeModulesCollector(rootDir);
18
29
  case "yarn":
19
30
  return new yarnNodeModulesCollector_1.YarnNodeModulesCollector(rootDir);
20
31
  default: