app-builder-lib 26.12.0 → 26.13.0

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 (107) hide show
  1. package/out/asar/asarFileChecker.d.ts +2 -2
  2. package/out/asar/asarFileChecker.js +3 -2
  3. package/out/asar/asarFileChecker.js.map +1 -1
  4. package/out/asar/asarUtil.js +3 -2
  5. package/out/asar/asarUtil.js.map +1 -1
  6. package/out/binDownload.js +36 -9
  7. package/out/binDownload.js.map +1 -1
  8. package/out/codeSign/certInfo.d.ts +54 -0
  9. package/out/codeSign/certInfo.js +466 -0
  10. package/out/codeSign/certInfo.js.map +1 -0
  11. package/out/codeSign/macCodeSign.d.ts +1 -1
  12. package/out/codeSign/macCodeSign.js +10 -9
  13. package/out/codeSign/macCodeSign.js.map +1 -1
  14. package/out/codeSign/windowsSignToolManager.js +3 -9
  15. package/out/codeSign/windowsSignToolManager.js.map +1 -1
  16. package/out/configuration.d.ts +5 -0
  17. package/out/configuration.js.map +1 -1
  18. package/out/electron/ElectronFramework.js +4 -1
  19. package/out/electron/ElectronFramework.js.map +1 -1
  20. package/out/electron/electronVersion.js +9 -4
  21. package/out/electron/electronVersion.js.map +1 -1
  22. package/out/fileTransformer.js +2 -1
  23. package/out/fileTransformer.js.map +1 -1
  24. package/out/forge-maker.js +6 -2
  25. package/out/forge-maker.js.map +1 -1
  26. package/out/mac/MacTargetHelper.d.ts +24 -0
  27. package/out/mac/MacTargetHelper.js +269 -0
  28. package/out/mac/MacTargetHelper.js.map +1 -0
  29. package/out/macPackager.d.ts +21 -7
  30. package/out/macPackager.js +219 -346
  31. package/out/macPackager.js.map +1 -1
  32. package/out/node-module-collector/moduleManager.d.ts +12 -2
  33. package/out/node-module-collector/moduleManager.js +3 -0
  34. package/out/node-module-collector/moduleManager.js.map +1 -1
  35. package/out/options/linuxOptions.d.ts +4 -3
  36. package/out/options/linuxOptions.js.map +1 -1
  37. package/out/options/macOptions.d.ts +6 -0
  38. package/out/options/macOptions.js.map +1 -1
  39. package/out/options/metadata.d.ts +2 -0
  40. package/out/options/metadata.js.map +1 -1
  41. package/out/packager.js +4 -4
  42. package/out/packager.js.map +1 -1
  43. package/out/platformPackager.d.ts +1 -1
  44. package/out/platformPackager.js +27 -21
  45. package/out/platformPackager.js.map +1 -1
  46. package/out/targets/AppxTarget.js +2 -1
  47. package/out/targets/AppxTarget.js.map +1 -1
  48. package/out/targets/FlatpakTarget.js +2 -4
  49. package/out/targets/FlatpakTarget.js.map +1 -1
  50. package/out/targets/FpmTarget.js +30 -6
  51. package/out/targets/FpmTarget.js.map +1 -1
  52. package/out/targets/LinuxTargetHelper.d.ts +1 -1
  53. package/out/targets/LinuxTargetHelper.js +79 -14
  54. package/out/targets/LinuxTargetHelper.js.map +1 -1
  55. package/out/targets/MsiTarget.js +1 -1
  56. package/out/targets/MsiTarget.js.map +1 -1
  57. package/out/targets/MsiWrappedTarget.js +1 -1
  58. package/out/targets/MsiWrappedTarget.js.map +1 -1
  59. package/out/targets/appimage/AppImageTarget.d.ts +0 -2
  60. package/out/targets/appimage/AppImageTarget.js +27 -42
  61. package/out/targets/appimage/AppImageTarget.js.map +1 -1
  62. package/out/targets/appimage/appImageUtil.d.ts +3 -1
  63. package/out/targets/appimage/appImageUtil.js +33 -0
  64. package/out/targets/appimage/appImageUtil.js.map +1 -1
  65. package/out/targets/nsis/NsisTarget.js +15 -5
  66. package/out/targets/nsis/NsisTarget.js.map +1 -1
  67. package/out/targets/nsis/WebInstallerTarget.js +2 -2
  68. package/out/targets/nsis/WebInstallerTarget.js.map +1 -1
  69. package/out/targets/nsis/nsisScriptGenerator.js +2 -3
  70. package/out/targets/nsis/nsisScriptGenerator.js.map +1 -1
  71. package/out/targets/pkg.js +1 -1
  72. package/out/targets/pkg.js.map +1 -1
  73. package/out/targets/snap/SnapTarget.js +2 -1
  74. package/out/targets/snap/SnapTarget.js.map +1 -1
  75. package/out/targets/snap/core24.js +5 -4
  76. package/out/targets/snap/core24.js.map +1 -1
  77. package/out/targets/snap/coreLegacy.js +5 -5
  78. package/out/targets/snap/coreLegacy.js.map +1 -1
  79. package/out/targets/snap/snapcraftBuilder.js +4 -3
  80. package/out/targets/snap/snapcraftBuilder.js.map +1 -1
  81. package/out/toolsets/linux.d.ts +3 -1
  82. package/out/toolsets/linux.js +49 -21
  83. package/out/toolsets/linux.js.map +1 -1
  84. package/out/toolsets/windows.js +7 -17
  85. package/out/toolsets/windows.js.map +1 -1
  86. package/out/util/bundledTool.js +2 -1
  87. package/out/util/bundledTool.js.map +1 -1
  88. package/out/util/config/config.js +4 -3
  89. package/out/util/config/config.js.map +1 -1
  90. package/out/util/dynamicImport.d.ts +1 -0
  91. package/out/util/dynamicImport.js +14 -0
  92. package/out/util/dynamicImport.js.map +1 -0
  93. package/out/util/electronGet.d.ts +2 -0
  94. package/out/util/electronGet.js +38 -2
  95. package/out/util/electronGet.js.map +1 -1
  96. package/out/util/packageMetadata.js +2 -1
  97. package/out/util/packageMetadata.js.map +1 -1
  98. package/out/util/rebuild.d.ts +1 -1
  99. package/out/util/rebuild.js.map +1 -1
  100. package/out/util/yarn.js +1 -1
  101. package/out/util/yarn.js.map +1 -1
  102. package/out/version.d.ts +1 -1
  103. package/out/version.js +1 -1
  104. package/out/version.js.map +1 -1
  105. package/package.json +11 -8
  106. package/scheme.json +22 -1
  107. package/templates/nsis/include/allowOnlyOneInstallerInstance.nsh +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"macPackager.js","sourceRoot":"","sources":["../src/macPackager.ts"],"names":[],"mappings":";;;AAAA,iDAA6C;AAG7C,iFAAsE;AACtE,+CAcqB;AACrB,+DAAwD;AACxD,kCAAiC;AACjC,0CAA4C;AAC5C,uCAA+B;AAC/B,6BAA4B;AAC5B,uCAAmC;AACnC,wDAAyK;AACzK,iCAAqD;AAIrD,yDAAmF;AACnF,2DAAuD;AACvD,uCAAkE;AAClE,2DAAwE;AACxE,sDAAuD;AACvD,oDAAoD;AACpD,4CAA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;AAhoBD,kCAgoBC;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 { Identity } from \"@electron/osx-sign/dist/cjs/util-identities\"\nimport {\n Arch,\n AsyncTaskManager,\n copyFile,\n deepAssign,\n exec,\n exists,\n getArchSuffix,\n InvalidConfigurationError,\n log,\n orIfFileNotExist,\n statOrNull,\n unlinkIfExists,\n use,\n} from \"builder-util\"\nimport { MemoLazy, Nullish } from \"builder-util-runtime\"\nimport * as fs from \"fs/promises\"\nimport { mkdir, readdir } from \"fs/promises\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { AppInfo } from \"./appInfo\"\nimport { CertType, CodeSigningInfo, createKeychain, CreateKeychainOptions, findIdentity, 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\"\nimport { expandMacro as doExpandMacro } from \"./util/macroExpander\"\nimport { makeUniversalApp } from \"@electron/universal\"\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 expandArch(pattern: string, arch?: Arch | null): string[] {\n if (arch === Arch.universal) {\n // Universal build has `app-x64.asar.unpacked` & `app-arm64.asar.unpacked`\n return [doExpandMacro(pattern, Arch[Arch.arm64], this.appInfo, {}, false), doExpandMacro(pattern, Arch[Arch.x64], this.appInfo, {}, false)]\n }\n // Every other build keeps the name as `app.asar.unpacked`\n return [doExpandMacro(pattern, null, this.appInfo, {}, false)]\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected prepareAppInfo(appInfo: AppInfo): AppInfo {\n // 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\n // Make sure the Assets.car file is the same for both architectures\n const sourceCatalogPath = path.join(x64AppOutDir, appFile, \"Contents/Resources/Assets.car\")\n if (await exists(sourceCatalogPath)) {\n const targetCatalogPath = path.join(arm64AppOutPath, appFile, \"Contents/Resources/Assets.car\")\n await fs.copyFile(sourceCatalogPath, targetCatalogPath)\n }\n\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, // must be ?? to allow false\n singleArchFiles: platformSpecificBuildOptions.singleArchFiles || undefined,\n x64ArchFiles: platformSpecificBuildOptions.x64ArchFiles || undefined,\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): 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 const fallBackToAdhoc = (arch === Arch.arm64 || arch === Arch.universal) && !this.forceCodeSigning\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 if (fallBackToAdhoc) {\n log.warn(\"arm64 requires signing, but identity is set to null and signing is being skipped\")\n }\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 const noIdentity = !options.sign && identity == null\n if (qualifier === \"-\") {\n identity = new Identity(\"-\", undefined)\n } else if (noIdentity && fallBackToAdhoc) {\n log.warn(null, \"falling back to ad-hoc signature for macOS application code signing\")\n identity = new Identity(\"-\", undefined)\n } else if (noIdentity) {\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 =\n filter == null\n ? null\n : filter.map(it => {\n try {\n return new RegExp(it)\n } catch (e: any) {\n throw new InvalidConfigurationError(`Invalid regex filter pattern: ${it}. ${e.message}`)\n }\n })\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 = (\n await Promise.all(\n binaries.flatMap(async destination => {\n const expandedDestination = this.expandArch(destination, arch)\n return await Promise.all(\n expandedDestination.map(async d => {\n if (await statOrNull(d)) {\n return d\n }\n return path.resolve(appPath, d)\n })\n )\n })\n )\n ).flat()\n log.info({ binaries, arch: arch == null ? null : Arch[arch] }, \"signing additional user-defined binaries for arch\")\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.info.emitArtifactBuildCompleted({\n file: artifactPath,\n target: null,\n arch: Arch.x64,\n safeArtifactName: this.computeSafeArtifactName(artifactName, \"pkg\", arch, true, this.platformSpecificBuildOptions.defaultArch),\n packager: this,\n })\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 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\", await this.info.getWorkspaceRoot())\n\n const { app, platform, type, provisioningProfile } = opts\n log.info(\n {\n file: log.filePath(app),\n platform,\n type,\n identityName: identity?.name || \"none\",\n identityHash: identity?.hash || \"none\",\n provisioningProfile: provisioningProfile || \"none\",\n },\n customSign ? \"executing custom sign\" : \"signing\"\n )\n\n return customSign ? Promise.resolve(customSign(opts, this)) : sign({ ...opts, identity: identity ? identity.name : undefined })\n }\n\n //noinspection JSMethodCanBeStatic\n 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 resourcesPath = path.join(contentsPath, \"Resources\")\n\n // Support both legacy `.icns` and modern `.icon` (Icon Composer) inputs via `mac.icon`.\n // Prefer `.icon` if provided; still accept `.icns`.\n const configuredIcon = this.platformSpecificBuildOptions.icon\n const isIconComposer = typeof configuredIcon === \"string\" && configuredIcon.toLowerCase().endsWith(\".icon\")\n\n // Set the app name\n appPlist.CFBundleName = appInfo.productName\n appPlist.CFBundleDisplayName = appInfo.productName\n\n // Bundle legacy `icns` format - this should also run when `.icon` is provided\n const setIcnsFile = async (iconPath: string) => {\n const oldIcon = appPlist.CFBundleIconFile\n if (oldIcon != null) {\n await unlinkIfExists(path.join(resourcesPath, oldIcon))\n }\n const iconFileName = \"icon.icns\"\n appPlist.CFBundleIconFile = iconFileName\n await copyFile(iconPath, path.join(resourcesPath, iconFileName))\n }\n\n const icnsFilePath = await this.getIconPath()\n if (icnsFilePath != null) {\n await setIcnsFile(icnsFilePath)\n }\n\n // Bundle new `icon` format\n if (isIconComposer && configuredIcon) {\n const iconComposerPath = await this.getResource(configuredIcon)\n if (iconComposerPath) {\n const { assetCatalog } = await this.generateAssetCatalogData(iconComposerPath)\n\n // Create and setup the asset catalog\n appPlist.CFBundleIconName = \"Icon\"\n await fs.writeFile(path.join(resourcesPath, \"Assets.car\"), assetCatalog)\n }\n }\n\n const minimumSystemVersion = this.platformSpecificBuildOptions.minimumSystemVersion\n if (minimumSystemVersion != null) {\n appPlist.LSMinimumSystemVersion = minimumSystemVersion\n }\n\n 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 deepAssign(appPlist, extendInfo)\n }\n for (const [k, v] of Object.entries(appPlist)) {\n if (v === null || v === undefined) {\n delete appPlist[k]\n }\n }\n }\n\n protected async signApp(packContext: AfterPackContext, isAsar: boolean): 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, packContext.arch)\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":";;;AAEA,+CAcqB;AACrB,+DAAwD;AACxD,kCAAiC;AACjC,0CAA4C;AAC5C,uCAA+B;AAC/B,6BAA4B;AAC5B,uCAAmC;AACnC,wDAAoI;AACpI,iCAAqD;AAErD,2DAAqE;AAGrE,yDAAmF;AACnF,2DAAuD;AACvD,uCAAkE;AAClE,2DAAwE;AACxE,wDAAoD;AACpD,sDAAuD;AACvD,wDAAmE;AACnE,4CAAgD;AAYhD,MAAa,WAAY,SAAQ,mCAAqD;IA0CpF,YAAY,IAAc;QACxB,KAAK,CAAC,IAAI,EAAE,eAAQ,CAAC,GAAG,CAAC,CAAA;QA1ClB,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,EAA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AAC,SAAS,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAA;QAC1F,MAAM,oBAAoB,CAAC,eAAe,EAAE,MAAM,IAAA,+BAAgB,EAAC,IAAA,kBAAO,EAAC,eAAe,CAAC,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAA;QAEhI,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AA9fD,kCA8fC","sourcesContent":["import { SignOptions } from \"@electron/osx-sign/dist/cjs/types\"\nimport { Identity } from \"@electron/osx-sign/dist/cjs/util-identities\"\nimport {\n Arch,\n AsyncTaskManager,\n copyFile,\n deepAssign,\n exec,\n exists,\n getArchSuffix,\n InvalidConfigurationError,\n log,\n orIfFileNotExist,\n sanitizeDirPath,\n unlinkIfExists,\n use,\n} from \"builder-util\"\nimport { MemoLazy, Nullish } from \"builder-util-runtime\"\nimport * as fs from \"fs/promises\"\nimport { mkdir, readdir } from \"fs/promises\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { AppInfo } from \"./appInfo\"\nimport { CodeSigningInfo, createKeychain, CreateKeychainOptions, isSignAllowed, removeKeychain, sign } from \"./codeSign/macCodeSign\"\nimport { DIR_TARGET, Platform, Target } from \"./core\"\nimport { AfterPackContext, ElectronPlatformName } from \"./index\"\nimport { MacTargetHelper, PlatformType } from \"./mac/MacTargetHelper\"\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 { dynamicImport } from \"./util/dynamicImport\"\nimport { isMacOsHighSierra } from \"./util/macosVersion\"\nimport { expandMacro as doExpandMacro } from \"./util/macroExpander\"\nimport { resolveFunction } from \"./util/resolve\"\n\nexport type CustomMacSignOptions = SignOptions\nexport type CustomMacSign = (configuration: CustomMacSignOptions, packager: MacPackager) => Promise<void>\n\ninterface PlatformConfig {\n type: PlatformType\n config: MacConfiguration | MasConfiguration\n isDevelopment: boolean\n platformName: ElectronPlatformName\n}\n\nexport class MacPackager extends PlatformPackager<MacConfiguration | MasConfiguration> {\n readonly codeSigningInfo = new MemoLazy<CreateKeychainOptions | null, CodeSigningInfo>(\n () => {\n const cscLink = this.getCscLink()\n if (cscLink == null || process.platform !== \"darwin\") {\n return null\n }\n\n const selected = {\n tmpDir: this.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 // Set/cleared in doPack so applyCommonInfo can read the per-pack platformSpecificBuildOptions\n // (the framework call chain doesn't thread it through to applyCommonInfo). Fixes #8909.\n private _activePackConfig: MacConfiguration | MasConfiguration | null = null\n\n readonly helper = new MacTargetHelper(this)\n\n constructor(info: Packager) {\n super(info, Platform.MAC)\n }\n\n get defaultTarget(): Array<string> {\n return this.info.framework.macOsDefaultTargets\n }\n\n /**\n * Get the merged configuration for a specific platform type\n */\n private getPlatformConfig(platformType: PlatformType): PlatformConfig {\n let config: MacConfiguration | MasConfiguration\n let isDevelopment = false\n let platformName: ElectronPlatformName\n\n switch (platformType) {\n case \"mas\":\n config = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas)\n isDevelopment = false\n platformName = \"mas\"\n break\n\n case \"mas-dev\":\n config = deepAssign({}, this.platformSpecificBuildOptions, this.config.mas, this.config.masDev, {\n type: \"development\",\n })\n isDevelopment = true\n platformName = \"mas\"\n break\n\n case \"mac\":\n default:\n config = this.platformSpecificBuildOptions\n isDevelopment = false\n platformName = this.platform.nodeName as ElectronPlatformName\n break\n }\n\n return { type: platformType, config, isDevelopment, platformName }\n }\n\n expandArch(pattern: string, arch?: Arch | null): string[] {\n if (arch === Arch.universal) {\n // Universal build has `app-x64.asar.unpacked` & `app-arm64.asar.unpacked`\n return [doExpandMacro(pattern, Arch[Arch.arm64], this.appInfo, {}, false), doExpandMacro(pattern, Arch[Arch.x64], this.appInfo, {}, false)]\n }\n // Every other build keeps the name as `app.asar.unpacked`\n return [doExpandMacro(pattern, null, this.appInfo, {}, false)]\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected prepareAppInfo(appInfo: AppInfo): AppInfo {\n // 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 => (MacTargetHelper.isMasTarget(name) ? new NoOpTarget(name) : createCommonTarget(name, outDir, this)))\n break\n }\n }\n }\n\n protected async doPack(config: DoPackOptions<MacConfiguration>): Promise<any> {\n if (config.arch === Arch.universal) {\n return this.doUniversalPack(config)\n }\n // Bridge the per-pack platformSpecificBuildOptions to applyCommonInfo, which is called deep in the\n // framework stack (doPack → beforeCopyExtraFiles → createMacApp → applyCommonInfo) without it.\n this._activePackConfig = config.platformSpecificBuildOptions\n try {\n return await super.doPack(config)\n } finally {\n this._activePackConfig = null\n }\n }\n\n /**\n * Handle universal build packing\n */\n private async doUniversalPack(config: DoPackOptions<MacConfiguration>): Promise<void> {\n this._activePackConfig = config.platformSpecificBuildOptions\n try {\n const { outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets } = config\n\n const outDirName = (arch: Arch) => `${appOutDir}-${Arch[arch]}-temp`\n const options = {\n ...config,\n options: {\n sign: false,\n disableAsarIntegrity: true,\n disableFuses: true,\n },\n }\n\n const x64Arch = Arch.x64\n const x64AppOutDir = outDirName(x64Arch)\n await super.doPack({ ...options, appOutDir: x64AppOutDir, arch: x64Arch })\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const arm64Arch = Arch.arm64\n const arm64AppOutPath = outDirName(arm64Arch)\n await super.doPack({ ...options, appOutDir: arm64AppOutPath, arch: arm64Arch })\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n const framework = this.info.framework\n log.info(\n {\n platform: platformName,\n arch: Arch[arch],\n [`${framework.name}`]: framework.version,\n appOutDir: log.filePath(appOutDir),\n },\n `packaging`\n )\n const appFile = `${this.appInfo.productFilename}.app`\n\n // Make sure the Assets.car file is the same for both architectures\n const safeX64AppOutDir = sanitizeDirPath(x64AppOutDir)\n const safeArm64AppOutPath = sanitizeDirPath(arm64AppOutPath)\n const safeAppOutDir = sanitizeDirPath(appOutDir)\n\n const sourceCatalogPath = path.join(safeX64AppOutDir, appFile, \"Contents/Resources/Assets.car\")\n if (await exists(sourceCatalogPath)) {\n const targetCatalogPath = path.join(safeArm64AppOutPath, appFile, \"Contents/Resources/Assets.car\")\n await fs.copyFile(sourceCatalogPath, targetCatalogPath)\n }\n\n const { makeUniversalApp } = await dynamicImport<typeof import(\"@electron/universal\")>(\"@electron/universal\")\n await makeUniversalApp({\n x64AppPath: path.join(safeX64AppOutDir, appFile),\n arm64AppPath: path.join(safeArm64AppOutPath, appFile),\n outAppPath: path.join(safeAppOutDir, appFile),\n force: true,\n mergeASARs: platformSpecificBuildOptions.mergeASARs ?? true, // must be ?? to allow false\n singleArchFiles: platformSpecificBuildOptions.singleArchFiles || undefined,\n x64ArchFiles: platformSpecificBuildOptions.x64ArchFiles || undefined,\n })\n await fs.rm(x64AppOutDir, { recursive: true, force: true })\n await fs.rm(arm64AppOutPath, { recursive: true, force: true })\n\n // Give users a final opportunity to perform things on the combined universal package before signing\n const packContext: AfterPackContext = {\n appOutDir,\n outDir,\n arch,\n targets,\n packager: this,\n electronPlatformName: platformName,\n }\n await this.info.emitAfterPack(packContext)\n\n if (this.info.cancellationToken.cancelled) {\n return\n }\n\n await this.doAddElectronFuses(packContext)\n\n // Mirror the base-class guard: skip signing when the caller explicitly set sign:false\n // (e.g. packMasTargets passes sign:false so that signMas() is the sole signing step).\n if (config.options?.sign ?? true) {\n await this.doSignAfterPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets)\n }\n } finally {\n this._activePackConfig = null\n }\n }\n\n async pack(outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): Promise<void> {\n const masTargets = targets.filter(it => MacTargetHelper.isMasTarget(it.name))\n const nonMasTargets = targets.filter(it => !MacTargetHelper.isMasTarget(it.name))\n const prepackaged = this.packagerOptions.prepackaged\n const hasMas = masTargets.length > 0\n\n // mas always first\n await this.packMasTargets(outDir, arch, masTargets, prepackaged)\n\n // Mirror master's condition: skip the non-MAS darwin pack only when there are exclusively MAS\n // targets (hasMas=true, targets.length=1). DIR_TARGET passes targets=[] to pack() because\n // MacPackager.createTargets() doesn't call mapper() for it, so hasMas=false and doPack still runs.\n if (!hasMas || targets.length > 1) {\n await this.packMacTargets(outDir, arch, nonMasTargets, prepackaged, taskManager)\n }\n }\n\n private async packMasTargets(outDir: string, arch: Arch, targets: Array<Target>, prepackaged: string | null | undefined): Promise<void> {\n const resolvedOutDir = path.resolve(outDir)\n MacTargetHelper.assertSafePathForCommandUsage(resolvedOutDir, \"output directory\")\n\n for (const target of targets) {\n const platformType = MacTargetHelper.getPlatformTypeFromTarget(target.name)\n const platformConfig = this.getPlatformConfig(platformType)\n const targetOutDir = path.resolve(resolvedOutDir, `${target.name}${getArchSuffix(arch, this.platformSpecificBuildOptions.defaultArch)}`)\n MacTargetHelper.assertSafePathForCommandUsage(targetOutDir, \"target output directory\")\n\n const relativeTargetOutDir = path.relative(resolvedOutDir, targetOutDir)\n if (relativeTargetOutDir.startsWith(\"..\") || path.isAbsolute(relativeTargetOutDir)) {\n throw new InvalidConfigurationError(`Invalid target output directory: ${targetOutDir}`)\n }\n\n if (prepackaged == null) {\n await this.doPack({\n outDir: resolvedOutDir,\n appOutDir: targetOutDir,\n platformName: platformConfig.platformName,\n arch,\n platformSpecificBuildOptions: platformConfig.config,\n targets: [target],\n options: { sign: false },\n })\n MacTargetHelper.assertSafePathForCommandUsage(this.appInfo.productFilename, \"product filename\")\n await this.signMas(path.resolve(targetOutDir, `${path.basename(this.appInfo.productFilename)}.app`), targetOutDir, platformConfig, arch)\n } else {\n await this.signMas(prepackaged, targetOutDir, platformConfig, arch)\n }\n }\n }\n\n private async packMacTargets(outDir: string, arch: Arch, targets: Array<Target>, prepackaged: string | null | undefined, taskManager: AsyncTaskManager): Promise<void> {\n const appPath = prepackaged == null ? path.join(this.computeAppOutDir(outDir, arch), `${path.basename(this.appInfo.productFilename)}.app`) : prepackaged\n\n if (prepackaged == null) {\n const platformConfig = this.getPlatformConfig(\"mac\")\n await this.doPack({\n outDir,\n appOutDir: path.dirname(appPath),\n platformName: platformConfig.platformName,\n arch,\n platformSpecificBuildOptions: platformConfig.config,\n targets,\n })\n }\n\n this.packageInDistributableFormat(appPath, arch, targets, taskManager)\n }\n\n private async signMas(appPath: string, outDir: string, platformConfig: PlatformConfig, arch: Arch): Promise<boolean> {\n const signed = await this.sign(appPath, outDir, platformConfig.config as MasConfiguration, arch, true)\n return signed\n }\n\n /**\n * Main signing method with platform awareness\n */\n private async sign(appPath: string, outDir: string | null, options: MasConfiguration | MacConfiguration | null, arch: Arch, isMas: boolean = false): Promise<boolean> {\n if (!isSignAllowed()) {\n return false\n }\n\n const config = options ?? this.platformSpecificBuildOptions\n const qualifier = config.identity\n const fallBackToAdhoc = (arch === Arch.arm64 || arch === Arch.universal) && !this.forceCodeSigning\n\n if (qualifier === null) {\n return this.helper.handleNullIdentity(fallBackToAdhoc)\n }\n\n const keychainFile = (await this.codeSigningInfo.value).keychainFile\n const explicitType = config.type\n const type = explicitType || \"distribution\"\n const isDevelopment = type === \"development\"\n\n const identity = await this.helper.findSigningIdentity(isMas, isDevelopment, qualifier, keychainFile, config, fallBackToAdhoc)\n\n if (!identity) {\n return false\n }\n\n if (!isMacOsHighSierra()) {\n throw new InvalidConfigurationError(\"macOS High Sierra 10.13.6 is required to sign\")\n }\n\n const signOptions = await this.helper.buildSignOptions(appPath, identity, type, isMas, config, keychainFile, arch)\n await this.doSign(signOptions, config, identity)\n\n // Handle MAS installer creation\n if (isMas && !isDevelopment && outDir) {\n await this.helper.createMasInstaller(appPath, outDir, config as MasConfiguration, keychainFile, isDevelopment, arch)\n }\n\n // Handle notarization for non-MAS builds\n if (!isMas) {\n await this.helper.notarizeIfProvided(appPath)\n }\n\n return true\n }\n\n //noinspection JSMethodCanBeStatic\n protected async doSign(opts: SignOptions, customSignOptions: MacConfiguration | MasConfiguration, identity: Identity | null): Promise<void> {\n const customSign = await resolveFunction(this.appInfo.type, customSignOptions.sign, \"sign\", await this.info.getWorkspaceRoot())\n\n const { app, platform, type, provisioningProfile } = opts\n log.info(\n {\n file: log.filePath(app),\n platform,\n type,\n identityName: identity?.name || \"none\",\n identityHash: identity?.hash || \"none\",\n provisioningProfile: provisioningProfile || \"none\",\n },\n customSign ? \"executing custom sign\" : \"signing\"\n )\n\n return customSign ? Promise.resolve(customSign(opts, this)) : sign({ ...opts, identity: identity ? identity.name : undefined })\n }\n\n //noinspection JSMethodCanBeStatic\n public async doFlat(appPath: string, outFile: string, identity: Identity, keychain: string | Nullish): Promise<any> {\n const safeAppPath = sanitizeDirPath(appPath)\n const safeOutFile = sanitizeDirPath(outFile)\n // productbuild doesn't created directory for out file\n await mkdir(path.dirname(safeOutFile), { recursive: true })\n\n const args = prepareProductBuildArgs(identity, keychain)\n args.push(\"--component\", safeAppPath, \"/Applications\")\n args.push(safeOutFile)\n return await exec(\"productbuild\", args)\n }\n\n public getElectronSrcDir(dist: string) {\n return path.resolve(this.projectDir, dist, this.info.framework.distMacOsAppName)\n }\n\n public getElectronDestinationDir(appOutDir: string) {\n return path.join(appOutDir, this.info.framework.distMacOsAppName)\n }\n\n // todo fileAssociations\n async applyCommonInfo(appPlist: any, contentsPath: string) {\n const appInfo = this.appInfo\n const appFilename = appInfo.productFilename\n\n // https://github.com/electron-userland/electron-builder/issues/1278\n appPlist.CFBundleExecutable = appFilename.endsWith(\" Helper\") ? appFilename.substring(0, appFilename.length - \" Helper\".length) : appFilename\n\n const resourcesPath = path.join(contentsPath, \"Resources\")\n\n // Support both legacy `.icns` and modern `.icon` (Icon Composer) inputs via `mac.icon`.\n // Prefer `.icon` if provided; still accept `.icns`.\n const configuredIcon = this.platformSpecificBuildOptions.icon\n const isIconComposer = typeof configuredIcon === \"string\" && configuredIcon.toLowerCase().endsWith(\".icon\")\n\n // Set the app name\n appPlist.CFBundleName = appInfo.productName\n appPlist.CFBundleDisplayName = appInfo.productName\n\n // Bundle legacy `icns` format - this should also run when `.icon` is provided\n const setIcnsFile = async (iconPath: string) => {\n const oldIcon = appPlist.CFBundleIconFile\n if (oldIcon != null) {\n await unlinkIfExists(path.join(resourcesPath, oldIcon))\n }\n const iconFileName = \"icon.icns\"\n appPlist.CFBundleIconFile = iconFileName\n await copyFile(iconPath, path.join(resourcesPath, iconFileName))\n }\n\n const icnsFilePath = await this.getIconPath()\n if (icnsFilePath != null) {\n await setIcnsFile(icnsFilePath)\n }\n\n // Bundle new `icon` format\n if (isIconComposer && configuredIcon) {\n const iconComposerPath = await this.getResource(configuredIcon)\n if (iconComposerPath) {\n const { assetCatalog } = await this.generateAssetCatalogData(iconComposerPath)\n\n // Create and setup the asset catalog\n appPlist.CFBundleIconName = \"Icon\"\n await fs.writeFile(path.join(resourcesPath, \"Assets.car\"), assetCatalog)\n }\n }\n\n const minimumSystemVersion = this.platformSpecificBuildOptions.minimumSystemVersion\n if (minimumSystemVersion != null) {\n appPlist.LSMinimumSystemVersion = minimumSystemVersion\n }\n\n const activeOpts = this._activePackConfig ?? this.platformSpecificBuildOptions\n appPlist.CFBundleShortVersionString = activeOpts.bundleShortVersion || appInfo.version\n appPlist.CFBundleVersion = activeOpts.bundleVersion || appInfo.buildVersion\n\n use(this.platformSpecificBuildOptions.category || (this.config as any).category, it => (appPlist.LSApplicationCategoryType = it))\n appPlist.NSHumanReadableCopyright = appInfo.copyright\n\n if (this.platformSpecificBuildOptions.darkModeSupport) {\n appPlist.NSRequiresAquaSystemAppearance = false\n }\n\n const extendInfo = this.platformSpecificBuildOptions.extendInfo\n if (extendInfo != null) {\n deepAssign(appPlist, extendInfo)\n }\n for (const [k, v] of Object.entries(appPlist)) {\n if (v === null || v === undefined) {\n delete appPlist[k]\n }\n }\n }\n\n protected async signApp(packContext: AfterPackContext, isAsar: boolean): Promise<boolean> {\n const isMas = packContext.electronPlatformName === \"mas\"\n const activeConfig = this._activePackConfig ?? this.platformSpecificBuildOptions\n const readDirectoryAndSign = async (sourceDirectory: string, directories: string[], shouldSign: (file: string) => boolean): Promise<boolean> => {\n const normalizedSourceDirectory = path.resolve(sourceDirectory)\n MacTargetHelper.assertSafePathForCommandUsage(normalizedSourceDirectory, \"application output directory\")\n await Promise.all(\n directories.map(async (file: string) => {\n if (shouldSign(file)) {\n const entryName = path.basename(file)\n if (file !== entryName) {\n throw new InvalidConfigurationError(`Invalid entry name in source directory: ${file}`)\n }\n const signTarget = path.resolve(normalizedSourceDirectory, entryName)\n const safeSignTarget = sanitizeDirPath(signTarget, normalizedSourceDirectory)\n await this.sign(safeSignTarget, null, isMas ? activeConfig : null, packContext.arch, isMas)\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"]}
@@ -51,8 +51,18 @@ export declare class ModuleManager {
51
51
  }): string;
52
52
  protected locatePackageVersionFromCacheKey(key: string): Promise<Package | null>;
53
53
  locatePackageVersion({ parentDir, pkgName, requiredRange, skipDownwardSearch, }: {
54
- parentDir: string;
55
- pkgName: string;
54
+ /**
55
+ * The directory to start searching from. Typed optional because pnpm JSON output can omit
56
+ * the `path` field at runtime even when the TypeScript type says `string`. An undefined
57
+ * parentDir is treated as "package not found" rather than a crash.
58
+ */
59
+ parentDir?: string;
60
+ /**
61
+ * The package name to locate. Typed optional for the same reason as parentDir: the pnpm
62
+ * list JSON can omit `name`/`from` fields (e.g. when the root package.json has no name),
63
+ * producing an undefined pkgName at runtime despite the TypeScript type.
64
+ */
65
+ pkgName?: string;
56
66
  requiredRange?: string;
57
67
  /**
58
68
  * When true, skip the BFS-based `downwardSearch`. Use for layouts that are guaranteed flat
@@ -109,6 +109,9 @@ class ModuleManager {
109
109
  return { ...result, packageDir: await this.realPath[result.packageDir] };
110
110
  }
111
111
  async locatePackageVersion({ parentDir, pkgName, requiredRange, skipDownwardSearch = false, }) {
112
+ if (!parentDir || !pkgName) {
113
+ return null;
114
+ }
112
115
  // 1) check direct parent node_modules/pkgName first
113
116
  const direct = path.join(path.resolve(parentDir), "node_modules", pkgName, "package.json");
114
117
  if (await this.exists[direct]) {
@@ -1 +1 @@
1
- {"version":3,"file":"moduleManager.js","sourceRoot":"","sources":["../../src/node-module-collector/moduleManager.ts"],"names":[],"mappings":";;;AAAA,+CAAqE;AAErE,+BAA8B;AAC9B,6BAA4B;AAC5B,iCAAgC;AAEhC,IAAY,eASX;AATD,WAAY,eAAe;IACzB,wEAAqD,CAAA;IACrD,8FAA2E,CAAA;IAC3E,oEAAiD,CAAA;IACjD,mEAAgD,CAAA;IAChD,iEAA8C,CAAA;IAC9C,+EAA4D,CAAA;IAC5D,6PAAqO,CAAA;IACrO,mEAAgD,CAAA;AAClD,CAAC,EATW,eAAe,+BAAf,eAAe,QAS1B;AACY,QAAA,oBAAoB,GAAsC;IACrE,CAAC,eAAe,CAAC,iBAAiB,CAAC,EAAE,MAAM;IAC3C,CAAC,eAAe,CAAC,4BAA4B,CAAC,EAAE,MAAM;IACtD,CAAC,eAAe,CAAC,aAAa,CAAC,EAAE,MAAM;IACvC,CAAC,eAAe,CAAC,eAAe,CAAC,EAAE,MAAM;IACzC,CAAC,eAAe,CAAC,YAAY,CAAC,EAAE,OAAO;IACvC,CAAC,eAAe,CAAC,0BAA0B,CAAC,EAAE,MAAM;IACpD,CAAC,eAAe,CAAC,mCAAmC,CAAC,EAAE,MAAM;IAC7D,CAAC,eAAe,CAAC,oBAAoB,CAAC,EAAE,MAAM;CAC/C,CAAA;AAYD,MAAa,aAAa;IAqBxB;QAPiB,YAAO,GAAoC,IAAI,GAAG,EAAE,CAAA;QACpD,gBAAW,GAAwB,IAAI,GAAG,EAAE,CAAA;QAC5C,cAAS,GAAyB,IAAI,GAAG,EAAE,CAAA;QAC3C,aAAQ,GAAiC,IAAI,GAAG,EAAE,CAAA;QAClD,mBAAc,GAAgC,IAAI,GAAG,EAAE,CAAA;QACvD,kBAAa,GAAmC,IAAI,GAAG,EAAE,CAAA;QAGxE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,yBAA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AAS,EAAE,cAAc,CAAC,CAAA;gBAC5D,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,KAAI,MAAA,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,0CAAE,WAAW,EAAE,CAAA,EAAE,CAAC;oBAC/F,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,CAAC;wBAClC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;wBAC5B,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC,CAAA;oBACxD,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AA7SD,sCA6SC","sourcesContent":["import { exists, isEmptyOrSpaces, log, LogLevel } from \"builder-util\"\nimport { PackageJson } from \"./types\"\nimport * as fs from \"fs-extra\"\nimport * as path from \"path\"\nimport * as semver from \"semver\"\n\nexport enum LogMessageByKey {\n PKG_DUPLICATE_REF = \"duplicate dependency references\",\n PKG_DUPLICATE_REF_UNRESOLVED = \"unresolved duplicate dependency references\",\n PKG_NOT_FOUND = \"cannot find path for dependency\",\n PKG_NOT_ON_DISK = \"dependency not found on disk\",\n PKG_SELF_REF = \"self-referential dependencies\",\n PKG_OPTIONAL_NOT_INSTALLED = \"missing optional dependencies\",\n PKG_OPTIONAL_PLATFORM_NOT_INSTALLED = \"platform-specific optional dependencies not bundled — add them to your project's optionalDependencies if your app requires them (pnpm 10+ does not auto-install transitive platform binaries)\",\n PKG_COLLECTOR_OUTPUT = \"collector stderr output\",\n}\nexport const logMessageLevelByKey: Record<LogMessageByKey, LogLevel> = {\n [LogMessageByKey.PKG_DUPLICATE_REF]: \"info\",\n [LogMessageByKey.PKG_DUPLICATE_REF_UNRESOLVED]: \"warn\",\n [LogMessageByKey.PKG_NOT_FOUND]: \"warn\",\n [LogMessageByKey.PKG_NOT_ON_DISK]: \"warn\",\n [LogMessageByKey.PKG_SELF_REF]: \"debug\",\n [LogMessageByKey.PKG_OPTIONAL_NOT_INSTALLED]: \"info\",\n [LogMessageByKey.PKG_OPTIONAL_PLATFORM_NOT_INSTALLED]: \"warn\",\n [LogMessageByKey.PKG_COLLECTOR_OUTPUT]: \"warn\",\n}\n\nexport type Package = { packageDir: string; packageJson: PackageJson }\n\n// Type aliases for clarity\ntype JsonCache = Record<string, Promise<PackageJson | null>>\ntype RealPathCache = Record<string, Promise<string>>\ntype ExistsCache = Record<string, Promise<boolean>>\ntype LstatCache = Record<string, Promise<fs.Stats | null>>\ntype PackageCache = Record<string, Promise<Package | null>>\ntype LogSummaryCache = Record<LogMessageByKey, string[]>\n\nexport class ModuleManager {\n /** Cache for package.json contents (readJson) */\n readonly json: JsonCache\n /** Cache for resolved real paths (if symlink, realpath; otherwise resolve) */\n readonly realPath: RealPathCache\n /** Cache for file/directory existence checks */\n readonly exists: ExistsCache\n /** Cache for lstat results */\n readonly lstat: LstatCache\n /** Cache for package lookups (key: \"packageName||fromDir||semverRange\"). Use helper function `versionedCacheKey` */\n readonly packageData: PackageCache\n /** For logging purposes, just track all dependencies for each key */\n readonly logSummary: LogSummaryCache\n\n private readonly jsonMap: Map<string, PackageJson | null> = new Map()\n private readonly realPathMap: Map<string, string> = new Map()\n private readonly existsMap: Map<string, boolean> = new Map()\n private readonly lstatMap: Map<string, fs.Stats | null> = new Map()\n private readonly packageDataMap: Map<string, Package | null> = new Map()\n private readonly logSummaryMap: Map<LogMessageByKey, string[]> = new Map()\n\n constructor() {\n this.logSummary = this.createLogSummarySyncProxy()\n\n this.exists = this.createAsyncProxy(this.existsMap, (p: string) => exists(p))\n this.json = this.createAsyncProxy(this.jsonMap, (p: string) => fs.readJson(p).catch(() => null))\n this.lstat = this.createAsyncProxy(this.lstatMap, (p: string) => fs.lstat(p).catch(() => null))\n this.packageData = this.createAsyncProxy(this.packageDataMap, (p: string) => this.locatePackageVersionFromCacheKey(p).catch(() => null))\n this.realPath = this.createAsyncProxy(this.realPathMap, async (p: string) => {\n const filePath = path.resolve(p)\n const stat = await this.lstat[filePath]\n return stat?.isSymbolicLink() ? fs.realpath(filePath) : filePath\n })\n }\n\n private createLogSummarySyncProxy(): LogSummaryCache {\n return new Proxy({} as LogSummaryCache, {\n get: (_, key: LogMessageByKey) => {\n if (!this.logSummaryMap.has(key)) {\n this.logSummaryMap.set(key, [])\n }\n return this.logSummaryMap.get(key)!\n },\n set: (_, key: LogMessageByKey, value: string[]) => {\n this.logSummaryMap.set(key, value)\n return true\n },\n has: (_, key: LogMessageByKey) => {\n return this.logSummaryMap.has(key)\n },\n // Add these to make Object.entries() work\n ownKeys: _ => {\n return Array.from(this.logSummaryMap.keys())\n },\n getOwnPropertyDescriptor: (_, key) => {\n if (this.logSummaryMap.has(key as LogMessageByKey)) {\n return {\n enumerable: true,\n configurable: true,\n }\n }\n return undefined\n },\n })\n }\n\n // this allows dot-notation access while still supporting async retrieval\n // e.g., cache.packageJson[somePath] returns Promise<PackageJson>\n private createAsyncProxy<T>(map: Map<string, T>, compute: (key: string) => T | Promise<T>): Record<string, Promise<T>> {\n return new Proxy({} as Record<string, Promise<T>>, {\n async get(_, key: string) {\n if (map.has(key)) {\n return Promise.resolve(map.get(key)!)\n }\n return await Promise.resolve(compute(key)).then(value => {\n map.set(key, value)\n return value\n })\n },\n set(_, key: string, value: T) {\n map.set(key, value)\n return true\n },\n has(_, key: string) {\n return map.has(key)\n },\n })\n }\n\n versionedCacheKey(pkg: { name: string; path: string; semver?: string }): string {\n return [pkg.name, pkg.path, pkg.semver || \"\"].join(\"||\")\n }\n\n protected async locatePackageVersionFromCacheKey(key: string): Promise<Package | null> {\n const [name, fromDir, semverRange] = key.split(\"||\")\n const result = await this.locatePackageVersion({ parentDir: fromDir, pkgName: name, requiredRange: semverRange })\n if (result == null) {\n return null\n }\n return { ...result, packageDir: await this.realPath[result.packageDir] }\n }\n\n public async locatePackageVersion({\n parentDir,\n pkgName,\n requiredRange,\n skipDownwardSearch = false,\n }: {\n parentDir: string\n pkgName: string\n requiredRange?: string\n /**\n * When true, skip the BFS-based `downwardSearch`. Use for layouts that are guaranteed flat\n * (e.g. pnpm's `.pnpm` virtual store), where the downward walk burns thousands of `readdir`\n * / `lstat` calls and finds nothing.\n */\n skipDownwardSearch?: boolean\n }): Promise<Package | null> {\n // 1) check direct parent node_modules/pkgName first\n const direct = path.join(path.resolve(parentDir), \"node_modules\", pkgName, \"package.json\")\n if (await this.exists[direct]) {\n const json = await this.json[direct]\n if (json && this.semverSatisfies(json.version, requiredRange)) {\n return { packageDir: path.dirname(direct), packageJson: json }\n }\n }\n\n // 2) upward hoisted search, then 3) downward non-hoisted search\n const upward = await this.upwardSearch(parentDir, pkgName, requiredRange)\n if (upward) {\n return upward\n }\n if (skipDownwardSearch) {\n return null\n }\n return (await this.downwardSearch(parentDir, pkgName, requiredRange)) || null\n }\n\n private semverSatisfies(found: string, range?: string): boolean {\n if (isEmptyOrSpaces(range) || range === \"*\") {\n return true\n }\n\n if (range === found) {\n return true\n }\n\n if (semver.validRange(range) == null) {\n // ignore, we can't verify non-semver ranges\n // e.g. git urls, file:, patch:, etc. Example:\n // \"@ai-sdk/google\": \"patch:@ai-sdk/google@npm%3A2.0.43#~/.yarn/patches/@ai-sdk-google-npm-2.0.43-689ed559b3.patch\"\n log.debug({ found, range }, \"unable to validate semver version range, assuming match\")\n return true\n }\n\n try {\n return semver.satisfies(found, range)\n } catch {\n // fallback: simple equality or basic prefix handling (^, ~)\n if (range.startsWith(\"^\") || range.startsWith(\"~\")) {\n const r = range.slice(1)\n return r === found\n }\n // if range is like \"8.x\" or \"8.*\" match major\n const m = range.match(/^(\\d+)[.(*|x)]*/)\n const fm = found.match(/^(\\d+)\\./)\n if (m && fm) {\n return m[1] === fm[1]\n }\n return false\n }\n }\n\n /**\n * Upward search (hoisted)\n */\n private async upwardSearch(parentDir: string, pkgName: string, requiredRange?: string): Promise<Package | null> {\n let current = path.resolve(parentDir)\n const root = path.parse(current).root\n while (true) {\n const candidate = path.join(current, \"node_modules\", pkgName, \"package.json\")\n if (await this.exists[candidate]) {\n const json = await this.json[candidate]\n if (json && this.semverSatisfies(json.version, requiredRange)) {\n return { packageDir: path.dirname(candidate), packageJson: json }\n }\n // otherwise keep searching upward (we may find a different hoisted version)\n }\n if (current === root) {\n break\n }\n const parent = path.dirname(current)\n if (parent === current) {\n break\n }\n current = parent\n }\n return null\n }\n\n /**\n * Breadth-first downward search from parentDir/node_modules\n * Looks for node_modules/\\*\\/node_modules/pkgName (and deeper)\n */\n private async downwardSearch(parentDir: string, pkgName: string, requiredRange?: string, maxExplored = 2000, maxDepth = 6): Promise<Package | null> {\n const start = path.join(path.resolve(parentDir), \"node_modules\")\n if (!(await this.exists[start]) || !(await this.lstat[start])?.isDirectory()) {\n return null\n }\n\n const visited = new Set<string>()\n const queue: Array<{ dir: string; depth: number }> = [{ dir: start, depth: 0 }]\n let explored = 0\n\n while (queue.length > 0) {\n const { dir, depth } = queue.shift()!\n if (explored++ > maxExplored) {\n break\n }\n if (depth > maxDepth) {\n continue\n }\n let entries: string[]\n try {\n entries = await fs.readdir(dir)\n } catch {\n continue\n }\n for (const entry of entries) {\n if (entry.startsWith(\".\")) {\n continue\n }\n const entryPath = path.join(dir, entry)\n // handle scoped packages @scope/name\n if (entry.startsWith(\"@\")) {\n // queue the scope directory itself to explore its children\n if ((await this.exists[entryPath]) && (await this.lstat[entryPath])?.isDirectory()) {\n const scopeEntries = await fs.readdir(entryPath)\n for (const sc of scopeEntries) {\n const scPath = path.join(entryPath, sc)\n // check scPath/node_modules/pkgName\n const candidatePkgJson = path.join(scPath, \"node_modules\", pkgName, \"package.json\")\n if (await this.exists[candidatePkgJson]) {\n const json = await this.json[candidatePkgJson]\n if (json && this.semverSatisfies(json.version, requiredRange)) {\n return { packageDir: path.dirname(candidatePkgJson), packageJson: json }\n }\n }\n // enqueue scPath/node_modules to explore further\n const scNodeModules = path.join(scPath, \"node_modules\")\n if ((await this.exists[scNodeModules]) && (await this.lstat[scNodeModules])?.isDirectory()) {\n if (!visited.has(scNodeModules)) {\n visited.add(scNodeModules)\n queue.push({ dir: scNodeModules, depth: depth + 1 })\n }\n }\n }\n }\n continue\n }\n\n // check for direct candidate: entry/node_modules/pkgName\n try {\n const stat = await this.lstat[entryPath]\n if (!stat?.isDirectory()) {\n continue\n }\n } catch {\n continue\n }\n\n const candidatePkgJson = path.join(entryPath, \"node_modules\", pkgName, \"package.json\")\n if (await this.exists[candidatePkgJson]) {\n const json = await this.json[candidatePkgJson]\n if (json && this.semverSatisfies(json.version, requiredRange)) {\n return { packageDir: path.dirname(candidatePkgJson), packageJson: json }\n }\n }\n\n // also check entry/node_modules directly for pkgName (some layouts)\n const candidateDirect = path.join(entryPath, pkgName, \"package.json\")\n if (await this.exists[candidateDirect]) {\n const json = await this.json[candidateDirect]\n if (json && this.semverSatisfies(json.version, requiredRange)) {\n return { packageDir: path.dirname(candidateDirect), packageJson: json }\n }\n }\n\n // enqueue entry/node_modules for deeper traversal\n const nextNodeModules = path.join(entryPath, \"node_modules\")\n if ((await this.exists[nextNodeModules]) && (await this.lstat[nextNodeModules])?.isDirectory()) {\n if (!visited.has(nextNodeModules)) {\n visited.add(nextNodeModules)\n queue.push({ dir: nextNodeModules, depth: depth + 1 })\n }\n }\n }\n }\n\n return null\n }\n}\n"]}
1
+ {"version":3,"file":"moduleManager.js","sourceRoot":"","sources":["../../src/node-module-collector/moduleManager.ts"],"names":[],"mappings":";;;AAAA,+CAAqE;AAErE,+BAA8B;AAC9B,6BAA4B;AAC5B,iCAAgC;AAEhC,IAAY,eASX;AATD,WAAY,eAAe;IACzB,wEAAqD,CAAA;IACrD,8FAA2E,CAAA;IAC3E,oEAAiD,CAAA;IACjD,mEAAgD,CAAA;IAChD,iEAA8C,CAAA;IAC9C,+EAA4D,CAAA;IAC5D,6PAAqO,CAAA;IACrO,mEAAgD,CAAA;AAClD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AC5B,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC,CAAA;oBACxD,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AA1TD,sCA0TC","sourcesContent":["import { exists, isEmptyOrSpaces, log, LogLevel } from \"builder-util\"\nimport { PackageJson } from \"./types\"\nimport * as fs from \"fs-extra\"\nimport * as path from \"path\"\nimport * as semver from \"semver\"\n\nexport enum LogMessageByKey {\n PKG_DUPLICATE_REF = \"duplicate dependency references\",\n PKG_DUPLICATE_REF_UNRESOLVED = \"unresolved duplicate dependency references\",\n PKG_NOT_FOUND = \"cannot find path for dependency\",\n PKG_NOT_ON_DISK = \"dependency not found on disk\",\n PKG_SELF_REF = \"self-referential dependencies\",\n PKG_OPTIONAL_NOT_INSTALLED = \"missing optional dependencies\",\n PKG_OPTIONAL_PLATFORM_NOT_INSTALLED = \"platform-specific optional dependencies not bundled — add them to your project's optionalDependencies if your app requires them (pnpm 10+ does not auto-install transitive platform binaries)\",\n PKG_COLLECTOR_OUTPUT = \"collector stderr output\",\n}\nexport const logMessageLevelByKey: Record<LogMessageByKey, LogLevel> = {\n [LogMessageByKey.PKG_DUPLICATE_REF]: \"info\",\n [LogMessageByKey.PKG_DUPLICATE_REF_UNRESOLVED]: \"warn\",\n [LogMessageByKey.PKG_NOT_FOUND]: \"warn\",\n [LogMessageByKey.PKG_NOT_ON_DISK]: \"warn\",\n [LogMessageByKey.PKG_SELF_REF]: \"debug\",\n [LogMessageByKey.PKG_OPTIONAL_NOT_INSTALLED]: \"info\",\n [LogMessageByKey.PKG_OPTIONAL_PLATFORM_NOT_INSTALLED]: \"warn\",\n [LogMessageByKey.PKG_COLLECTOR_OUTPUT]: \"warn\",\n}\n\nexport type Package = { packageDir: string; packageJson: PackageJson }\n\n// Type aliases for clarity\ntype JsonCache = Record<string, Promise<PackageJson | null>>\ntype RealPathCache = Record<string, Promise<string>>\ntype ExistsCache = Record<string, Promise<boolean>>\ntype LstatCache = Record<string, Promise<fs.Stats | null>>\ntype PackageCache = Record<string, Promise<Package | null>>\ntype LogSummaryCache = Record<LogMessageByKey, string[]>\n\nexport class ModuleManager {\n /** Cache for package.json contents (readJson) */\n readonly json: JsonCache\n /** Cache for resolved real paths (if symlink, realpath; otherwise resolve) */\n readonly realPath: RealPathCache\n /** Cache for file/directory existence checks */\n readonly exists: ExistsCache\n /** Cache for lstat results */\n readonly lstat: LstatCache\n /** Cache for package lookups (key: \"packageName||fromDir||semverRange\"). Use helper function `versionedCacheKey` */\n readonly packageData: PackageCache\n /** For logging purposes, just track all dependencies for each key */\n readonly logSummary: LogSummaryCache\n\n private readonly jsonMap: Map<string, PackageJson | null> = new Map()\n private readonly realPathMap: Map<string, string> = new Map()\n private readonly existsMap: Map<string, boolean> = new Map()\n private readonly lstatMap: Map<string, fs.Stats | null> = new Map()\n private readonly packageDataMap: Map<string, Package | null> = new Map()\n private readonly logSummaryMap: Map<LogMessageByKey, string[]> = new Map()\n\n constructor() {\n this.logSummary = this.createLogSummarySyncProxy()\n\n this.exists = this.createAsyncProxy(this.existsMap, (p: string) => exists(p))\n this.json = this.createAsyncProxy(this.jsonMap, (p: string) => fs.readJson(p).catch(() => null))\n this.lstat = this.createAsyncProxy(this.lstatMap, (p: string) => fs.lstat(p).catch(() => null))\n this.packageData = this.createAsyncProxy(this.packageDataMap, (p: string) => this.locatePackageVersionFromCacheKey(p).catch(() => null))\n this.realPath = this.createAsyncProxy(this.realPathMap, async (p: string) => {\n const filePath = path.resolve(p)\n const stat = await this.lstat[filePath]\n return stat?.isSymbolicLink() ? fs.realpath(filePath) : filePath\n })\n }\n\n private createLogSummarySyncProxy(): LogSummaryCache {\n return new Proxy({} as LogSummaryCache, {\n get: (_, key: LogMessageByKey) => {\n if (!this.logSummaryMap.has(key)) {\n this.logSummaryMap.set(key, [])\n }\n return this.logSummaryMap.get(key)!\n },\n set: (_, key: LogMessageByKey, value: string[]) => {\n this.logSummaryMap.set(key, value)\n return true\n },\n has: (_, key: LogMessageByKey) => {\n return this.logSummaryMap.has(key)\n },\n // Add these to make Object.entries() work\n ownKeys: _ => {\n return Array.from(this.logSummaryMap.keys())\n },\n getOwnPropertyDescriptor: (_, key) => {\n if (this.logSummaryMap.has(key as LogMessageByKey)) {\n return {\n enumerable: true,\n configurable: true,\n }\n }\n return undefined\n },\n })\n }\n\n // this allows dot-notation access while still supporting async retrieval\n // e.g., cache.packageJson[somePath] returns Promise<PackageJson>\n private createAsyncProxy<T>(map: Map<string, T>, compute: (key: string) => T | Promise<T>): Record<string, Promise<T>> {\n return new Proxy({} as Record<string, Promise<T>>, {\n async get(_, key: string) {\n if (map.has(key)) {\n return Promise.resolve(map.get(key)!)\n }\n return await Promise.resolve(compute(key)).then(value => {\n map.set(key, value)\n return value\n })\n },\n set(_, key: string, value: T) {\n map.set(key, value)\n return true\n },\n has(_, key: string) {\n return map.has(key)\n },\n })\n }\n\n versionedCacheKey(pkg: { name: string; path: string; semver?: string }): string {\n return [pkg.name, pkg.path, pkg.semver || \"\"].join(\"||\")\n }\n\n protected async locatePackageVersionFromCacheKey(key: string): Promise<Package | null> {\n const [name, fromDir, semverRange] = key.split(\"||\")\n const result = await this.locatePackageVersion({ parentDir: fromDir, pkgName: name, requiredRange: semverRange })\n if (result == null) {\n return null\n }\n return { ...result, packageDir: await this.realPath[result.packageDir] }\n }\n\n public async locatePackageVersion({\n parentDir,\n pkgName,\n requiredRange,\n skipDownwardSearch = false,\n }: {\n /**\n * The directory to start searching from. Typed optional because pnpm JSON output can omit\n * the `path` field at runtime even when the TypeScript type says `string`. An undefined\n * parentDir is treated as \"package not found\" rather than a crash.\n */\n parentDir?: string\n /**\n * The package name to locate. Typed optional for the same reason as parentDir: the pnpm\n * list JSON can omit `name`/`from` fields (e.g. when the root package.json has no name),\n * producing an undefined pkgName at runtime despite the TypeScript type.\n */\n pkgName?: string\n requiredRange?: string\n /**\n * When true, skip the BFS-based `downwardSearch`. Use for layouts that are guaranteed flat\n * (e.g. pnpm's `.pnpm` virtual store), where the downward walk burns thousands of `readdir`\n * / `lstat` calls and finds nothing.\n */\n skipDownwardSearch?: boolean\n }): Promise<Package | null> {\n if (!parentDir || !pkgName) {\n return null\n }\n // 1) check direct parent node_modules/pkgName first\n const direct = path.join(path.resolve(parentDir), \"node_modules\", pkgName, \"package.json\")\n if (await this.exists[direct]) {\n const json = await this.json[direct]\n if (json && this.semverSatisfies(json.version, requiredRange)) {\n return { packageDir: path.dirname(direct), packageJson: json }\n }\n }\n\n // 2) upward hoisted search, then 3) downward non-hoisted search\n const upward = await this.upwardSearch(parentDir, pkgName, requiredRange)\n if (upward) {\n return upward\n }\n if (skipDownwardSearch) {\n return null\n }\n return (await this.downwardSearch(parentDir, pkgName, requiredRange)) || null\n }\n\n private semverSatisfies(found: string, range?: string): boolean {\n if (isEmptyOrSpaces(range) || range === \"*\") {\n return true\n }\n\n if (range === found) {\n return true\n }\n\n if (semver.validRange(range) == null) {\n // ignore, we can't verify non-semver ranges\n // e.g. git urls, file:, patch:, etc. Example:\n // \"@ai-sdk/google\": \"patch:@ai-sdk/google@npm%3A2.0.43#~/.yarn/patches/@ai-sdk-google-npm-2.0.43-689ed559b3.patch\"\n log.debug({ found, range }, \"unable to validate semver version range, assuming match\")\n return true\n }\n\n try {\n return semver.satisfies(found, range)\n } catch {\n // fallback: simple equality or basic prefix handling (^, ~)\n if (range.startsWith(\"^\") || range.startsWith(\"~\")) {\n const r = range.slice(1)\n return r === found\n }\n // if range is like \"8.x\" or \"8.*\" match major\n const m = range.match(/^(\\d+)[.(*|x)]*/)\n const fm = found.match(/^(\\d+)\\./)\n if (m && fm) {\n return m[1] === fm[1]\n }\n return false\n }\n }\n\n /**\n * Upward search (hoisted)\n */\n private async upwardSearch(parentDir: string, pkgName: string, requiredRange?: string): Promise<Package | null> {\n let current = path.resolve(parentDir)\n const root = path.parse(current).root\n while (true) {\n const candidate = path.join(current, \"node_modules\", pkgName, \"package.json\")\n if (await this.exists[candidate]) {\n const json = await this.json[candidate]\n if (json && this.semverSatisfies(json.version, requiredRange)) {\n return { packageDir: path.dirname(candidate), packageJson: json }\n }\n // otherwise keep searching upward (we may find a different hoisted version)\n }\n if (current === root) {\n break\n }\n const parent = path.dirname(current)\n if (parent === current) {\n break\n }\n current = parent\n }\n return null\n }\n\n /**\n * Breadth-first downward search from parentDir/node_modules\n * Looks for node_modules/\\*\\/node_modules/pkgName (and deeper)\n */\n private async downwardSearch(parentDir: string, pkgName: string, requiredRange?: string, maxExplored = 2000, maxDepth = 6): Promise<Package | null> {\n const start = path.join(path.resolve(parentDir), \"node_modules\")\n if (!(await this.exists[start]) || !(await this.lstat[start])?.isDirectory()) {\n return null\n }\n\n const visited = new Set<string>()\n const queue: Array<{ dir: string; depth: number }> = [{ dir: start, depth: 0 }]\n let explored = 0\n\n while (queue.length > 0) {\n const { dir, depth } = queue.shift()!\n if (explored++ > maxExplored) {\n break\n }\n if (depth > maxDepth) {\n continue\n }\n let entries: string[]\n try {\n entries = await fs.readdir(dir)\n } catch {\n continue\n }\n for (const entry of entries) {\n if (entry.startsWith(\".\")) {\n continue\n }\n const entryPath = path.join(dir, entry)\n // handle scoped packages @scope/name\n if (entry.startsWith(\"@\")) {\n // queue the scope directory itself to explore its children\n if ((await this.exists[entryPath]) && (await this.lstat[entryPath])?.isDirectory()) {\n const scopeEntries = await fs.readdir(entryPath)\n for (const sc of scopeEntries) {\n const scPath = path.join(entryPath, sc)\n // check scPath/node_modules/pkgName\n const candidatePkgJson = path.join(scPath, \"node_modules\", pkgName, \"package.json\")\n if (await this.exists[candidatePkgJson]) {\n const json = await this.json[candidatePkgJson]\n if (json && this.semverSatisfies(json.version, requiredRange)) {\n return { packageDir: path.dirname(candidatePkgJson), packageJson: json }\n }\n }\n // enqueue scPath/node_modules to explore further\n const scNodeModules = path.join(scPath, \"node_modules\")\n if ((await this.exists[scNodeModules]) && (await this.lstat[scNodeModules])?.isDirectory()) {\n if (!visited.has(scNodeModules)) {\n visited.add(scNodeModules)\n queue.push({ dir: scNodeModules, depth: depth + 1 })\n }\n }\n }\n }\n continue\n }\n\n // check for direct candidate: entry/node_modules/pkgName\n try {\n const stat = await this.lstat[entryPath]\n if (!stat?.isDirectory()) {\n continue\n }\n } catch {\n continue\n }\n\n const candidatePkgJson = path.join(entryPath, \"node_modules\", pkgName, \"package.json\")\n if (await this.exists[candidatePkgJson]) {\n const json = await this.json[candidatePkgJson]\n if (json && this.semverSatisfies(json.version, requiredRange)) {\n return { packageDir: path.dirname(candidatePkgJson), packageJson: json }\n }\n }\n\n // also check entry/node_modules directly for pkgName (some layouts)\n const candidateDirect = path.join(entryPath, pkgName, \"package.json\")\n if (await this.exists[candidateDirect]) {\n const json = await this.json[candidateDirect]\n if (json && this.semverSatisfies(json.version, requiredRange)) {\n return { packageDir: path.dirname(candidateDirect), packageJson: json }\n }\n }\n\n // enqueue entry/node_modules for deeper traversal\n const nextNodeModules = path.join(entryPath, \"node_modules\")\n if ((await this.exists[nextNodeModules]) && (await this.lstat[nextNodeModules])?.isDirectory()) {\n if (!visited.has(nextNodeModules)) {\n visited.add(nextNodeModules)\n queue.push({ dir: nextNodeModules, depth: depth + 1 })\n }\n }\n }\n }\n\n return null\n }\n}\n"]}
@@ -172,9 +172,10 @@ export interface AppImageOptions extends CommonLinuxOptions, TargetSpecificOptio
172
172
  /**
173
173
  * The compression algorithm passed to the AppImage build tool.
174
174
  *
175
- * **FUSE2 toolset (`"0.0.0"` or unset):** `"xz"` is forwarded as `--compression xz`.
176
- * `"gzip"`, `"zstd"`, `null`, and unset all fall through to the root-level `compression` option:
177
- * - `"maximum"` → `--compression xz` (overrides any per-target gzip/zstd value)
175
+ * **FUSE2 toolset (`"0.0.0"` or unset):** only `"xz"` and `"gzip"` are forwarded
176
+ * to mksquashfs (`-comp <value>`); `"xz"` additionally passes `-Xdict-size 100% -b 1048576`.
177
+ * `"zstd"`, `null`, and unset fall through to the root-level `compression` option:
178
+ * - `"maximum"` → `"xz"`
178
179
  * - anything else → flag omitted (mksquashfs defaults to gzip)
179
180
  *
180
181
  * **Static-runtime toolsets (`>= 1.0.0`):** `"gzip"` and `"zstd"` are forwarded
@@ -1 +1 @@
1
- {"version":3,"file":"linuxOptions.js","sourceRoot":"","sources":["../../src/options/linuxOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { PlatformSpecificBuildOptions, TargetConfigType, TargetSpecificOptions } from \"../index\"\n\n/**\n * Example Spec: https://specifications.freedesktop.org/desktop-entry-spec/latest/example.html\n */\nexport interface LinuxDesktopFile {\n /**\n * `[Desktop Entry]` metadata entries (name to value). Overwrites default values calculated by electron-builder\n */\n entry?: {\n [k: string]: string\n } | null\n /**\n * `[Desktop Actions <ActionName>]` metadata entries (name to value).\n *\n * Config Example:\n * ```js\n * desktopActions: {\n * NewWindow: {\n * Name: 'New Window',\n * Exec: 'app --new-window',\n * }\n * }\n * ```\n */\n desktopActions?: {\n [ActionName: string]: any\n } | null\n}\n\nexport interface LinuxConfiguration extends CommonLinuxOptions, PlatformSpecificBuildOptions {\n /**\n * Target package type: list of `AppImage`, `flatpak`, `snap`, `deb`, `rpm`, `freebsd`, `pacman`, `p5p`, `apk`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.\n *\n * electron-builder [docker image](https://www.electron.build/multi-platform-build#docker) can be used to build Linux targets on any platform.\n *\n * Please [do not put an AppImage into another archive](https://github.com/probonopd/AppImageKit/wiki/Creating-AppImages#common-mistake) like a .zip or .tar.gz.\n * @default AppImage\n */\n readonly target?: TargetConfigType\n\n /**\n * The maintainer. Defaults to [author](https://www.electron.build/configuration#author).\n */\n readonly maintainer?: string | null\n\n /**\n * The vendor. Defaults to [author](https://www.electron.build/configuration#author).\n */\n readonly vendor?: string | null\n\n /**\n * The path to icon set directory or one png file, relative to the [build resources](https://www.electron.build/contents#extraresources) or to the project directory. The icon filename must contain the size (e.g. 32x32.png) of the icon.\n * By default will be generated automatically based on the macOS icns file.\n */\n readonly icon?: string\n\n /**\n * @private\n * @internal Allows specifying an FPM-only package category for all FPM targets in one place.\n * For user-facing category configuration use the target-specific options (e.g. {@link DebOptions}).\n */\n readonly packageCategory?: string | null\n}\n\n/**\n * Desktop-entry and runtime fields shared by all Linux targets and all snap core strategies.\n *\n * Fields set under `linux.*` in your build config (i.e. on {@link LinuxConfiguration}) are\n * automatically cascaded into each snap core's options by `LinuxTargetHelper.getSnapCore()`.\n * You do not need to duplicate them under `snapcraft.core24.*`, `snapcraft.core22.*`, etc.\n * Per-core values always take precedence when both are set.\n */\nexport interface CommonLinuxOptions {\n /**\n * The [short description](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description).\n */\n readonly synopsis?: string | null\n\n /**\n * As [description](https://www.electron.build/configuration#description) from application package.json, but allows you to specify different for Linux.\n */\n readonly description?: string | null\n\n /**\n * The [application category](https://specifications.freedesktop.org/menu-spec/latest/apa.html#main-category-registry).\n */\n readonly category?: string | null\n\n /**\n * The mime types in addition to specified in the file associations. Use it if you don't want to register a new mime type, but reuse existing.\n */\n readonly mimeTypes?: Array<string> | null\n\n /**\n * The [Desktop file](https://developer.gnome.org/documentation/guidelines/maintainer/integrating.html#desktop-files)\n */\n readonly desktop?: LinuxDesktopFile | null\n\n /**\n * The executable parameters. Pass to executableName\n */\n readonly executableArgs?: Array<string> | null\n}\n\n// fpm-only specific options\nexport interface LinuxTargetSpecificOptions extends CommonLinuxOptions, TargetSpecificOptions {\n /**\n * Package dependencies.\n * `rpm` defaults to `[\"gtk3\", \"libnotify\", \"nss\", \"libXScrnSaver\", \"(libXtst or libXtst6)\", \"xdg-utils\", \"at-spi2-core\", \"(libuuid or libuuid1)\"]`\n * `pacman` defaults to `[\"c-ares\", \"ffmpeg\", \"gtk3\", \"http-parser\", \"libevent\", \"libvpx\", \"libxslt\", \"libxss\", \"minizip\", \"nss\", \"re2\", \"snappy\", \"libnotify\", \"libappindicator-gtk3\"]`\n */\n readonly depends?: Array<string> | null\n\n /**\n * The compression type passed to fpm. For `deb`, `rpm`, and `pacman` targets prefer the\n * typed per-format interfaces (`DebOptions`, `RpmOptions`, `PacmanOptions`) which narrow\n * this to only the values that fpm actually accepts for that format.\n * @default xz\n */\n readonly compression?: \"gz\" | \"bzip2\" | \"xz\" | \"xzmt\" | \"gzip\" | \"zst\" | \"zstd\" | null\n\n readonly icon?: string\n\n /**\n * The package category.\n */\n readonly packageCategory?: string | null\n\n /**\n * The name of the package.\n */\n readonly packageName?: string | null\n\n readonly vendor?: string | null\n readonly maintainer?: string | null\n\n /**\n * File path to script to be passed to FPM for `--after-install` arg.\n */\n readonly afterInstall?: string | null\n /**\n * File path to script to be passed to FPM for `--after-remove` arg.\n */\n readonly afterRemove?: string | null\n /**\n * File path to custom AppArmor profile (Ubuntu 24+)\n */\n readonly appArmorProfile?: string | null\n\n /**\n * *Advanced only* The [fpm](https://fpm.readthedocs.io/en/latest/cli-reference.html) options.\n *\n * Example: `[\"--before-install=build/deb-preinstall.sh\", \"--after-upgrade=build/deb-postinstall.sh\"]`\n */\n readonly fpm?: Array<string> | null\n}\nexport interface DebOptions extends LinuxTargetSpecificOptions {\n /**\n * Package dependencies.\n * If need to support Debian, `libappindicator1` should be removed, it is [deprecated in Debian](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895037).\n * If need to support KDE, `gconf2` and `gconf-service` should be removed as it's no longer used [by GNOME](https://packages.debian.org/bullseye/gconf2).\n * @default [\"libgtk-3-0\", \"libnotify4\", \"libnss3\", \"libxss1\", \"libxtst6\", \"xdg-utils\", \"libatspi2.0-0\", \"libuuid1\", \"libsecret-1-0\"]\n */\n readonly depends?: Array<string> | null\n\n /**\n * The [recommended package dependencies](https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps).\n * @default [\"libappindicator3-1\"]\n */\n readonly recommends?: Array<string> | null\n\n /**\n * The [package category](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Section).\n */\n readonly packageCategory?: string | null\n\n /**\n * The [Priority](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Priority) attribute.\n */\n readonly priority?: string | null\n\n /** @default xz */\n readonly compression?: \"gz\" | \"bzip2\" | \"xz\" | \"zst\" | null\n}\n\nexport interface RpmOptions extends LinuxTargetSpecificOptions {\n /**\n * Passed to fpm via `--rpm-compression`. `\"xzmt\"` uses multi-threaded xz (fpm's RPM default).\n * `\"xz\"` is automatically promoted to `\"xzmt\"`. `\"gzip\"` and `\"bzip2\"` pass through as-is.\n * @default xzmt\n */\n readonly compression?: \"xz\" | \"xzmt\" | \"gzip\" | \"bzip2\" | null\n}\n\nexport interface PacmanOptions extends LinuxTargetSpecificOptions {\n /** @default xz */\n readonly compression?: \"gz\" | \"bzip2\" | \"xz\" | \"zstd\" | null\n}\n\nexport interface AppImageOptions extends CommonLinuxOptions, TargetSpecificOptions {\n /**\n * The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). Only plain text is supported.\n */\n readonly license?: string | null\n /**\n * The compression algorithm passed to the AppImage build tool.\n *\n * **FUSE2 toolset (`\"0.0.0\"` or unset):** `\"xz\"` is forwarded as `--compression xz`.\n * `\"gzip\"`, `\"zstd\"`, `null`, and unset all fall through to the root-level `compression` option:\n * - `\"maximum\"` → `--compression xz` (overrides any per-target gzip/zstd value)\n * - anything else → flag omitted (mksquashfs defaults to gzip)\n *\n * **Static-runtime toolsets (`>= 1.0.0`):** `\"gzip\"` and `\"zstd\"` are forwarded\n * directly. `\"xz\"` is mapped to `\"zstd\"` (nearest supported equivalent). `null`\n * or unset falls through to the root-level `compression` option:\n * - `\"store\"` → `\"gzip\"`\n * - `\"normal\"` / `\"maximum\"` / unset → `\"zstd\"`\n */\n readonly compression?: \"gzip\" | \"xz\" | \"zstd\" | null\n}\n\nexport interface FlatpakOptions extends CommonLinuxOptions, TargetSpecificOptions {\n /**\n * The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). Only plain text is supported.\n */\n readonly license?: string | null\n\n /**\n * The name of the runtime that the application uses. Defaults to `org.freedesktop.Platform`.\n *\n * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).\n */\n readonly runtime?: string\n\n /**\n * The version of the runtime that the application uses. Defaults to `20.08`.\n *\n * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).\n */\n readonly runtimeVersion?: string\n\n /**\n * The name of the development runtime that the application builds with. Defaults to `org.freedesktop.Sdk`.\n *\n * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).\n */\n readonly sdk?: string\n\n /**\n * Start with the files from the specified application. This can be used to create applications that extend another application.\n * Defaults to [org.electronjs.Electron2.BaseApp](https://github.com/flathub/org.electronjs.Electron2.BaseApp).\n *\n * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).\n */\n readonly base?: string\n\n /**\n * Use this specific version of the application specified in base. Defaults to `20.08`.\n *\n * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).\n */\n readonly baseVersion?: string\n\n /**\n * The branch to use when exporting the application. Defaults to `master`.\n *\n * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).\n */\n readonly branch?: string\n\n /**\n * An array of arguments passed to the flatpak build-finish command. Defaults to:\n * ```json\n * [\n * // Wayland/X11 Rendering\n * \"--socket=wayland\",\n * \"--socket=x11\",\n * \"--share=ipc\",\n * // Open GL\n * \"--device=dri\",\n * // Audio output\n * \"--socket=pulseaudio\",\n * // Read/write home directory access\n * \"--filesystem=home\",\n * // Allow communication with network\n * \"--share=network\",\n * // System notifications with libnotify\n * \"--talk-name=org.freedesktop.Notifications\",\n * ]\n * ```\n *\n * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).\n */\n readonly finishArgs?: string[]\n\n /**\n * An array of objects specifying the modules to be built in order.\n *\n * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).\n */\n readonly modules?: (string | any)[]\n\n /**\n * Files to copy directly into the app. Should be a list of [source, dest] tuples. Source should be a relative/absolute path to a file/directory to copy into the flatpak, and dest should be the path inside the app install prefix (e.g. /share/applications/).\n *\n * See [@malept/flatpak-bundler documentation](https://github.com/malept/flatpak-bundler#build-options).\n */\n readonly files?: [string, string][]\n\n /**\n * Symlinks to create in the app files. Should be a list of [target, location] symlink tuples. Target can be either a relative or absolute path inside the app install prefix, and location should be a absolute path inside the prefix to create the symlink at.\n *\n * See [@malept/flatpak-bundler documentation](https://github.com/malept/flatpak-bundler#build-options).\n */\n readonly symlinks?: [string, string][]\n\n /**\n * Whether to enable the Wayland specific flags (`--enable-features=UseOzonePlatform --ozone-platform=wayland`) in the wrapper script. These flags are only available starting with Electron version 12. Defaults to `false`.\n */\n readonly useWaylandFlags?: boolean\n}\n"]}
1
+ {"version":3,"file":"linuxOptions.js","sourceRoot":"","sources":["../../src/options/linuxOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { PlatformSpecificBuildOptions, TargetConfigType, TargetSpecificOptions } from \"../index\"\n\n/**\n * Example Spec: https://specifications.freedesktop.org/desktop-entry-spec/latest/example.html\n */\nexport interface LinuxDesktopFile {\n /**\n * `[Desktop Entry]` metadata entries (name to value). Overwrites default values calculated by electron-builder\n */\n entry?: {\n [k: string]: string\n } | null\n /**\n * `[Desktop Actions <ActionName>]` metadata entries (name to value).\n *\n * Config Example:\n * ```js\n * desktopActions: {\n * NewWindow: {\n * Name: 'New Window',\n * Exec: 'app --new-window',\n * }\n * }\n * ```\n */\n desktopActions?: {\n [ActionName: string]: any\n } | null\n}\n\nexport interface LinuxConfiguration extends CommonLinuxOptions, PlatformSpecificBuildOptions {\n /**\n * Target package type: list of `AppImage`, `flatpak`, `snap`, `deb`, `rpm`, `freebsd`, `pacman`, `p5p`, `apk`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.\n *\n * electron-builder [docker image](https://www.electron.build/multi-platform-build#docker) can be used to build Linux targets on any platform.\n *\n * Please [do not put an AppImage into another archive](https://github.com/probonopd/AppImageKit/wiki/Creating-AppImages#common-mistake) like a .zip or .tar.gz.\n * @default AppImage\n */\n readonly target?: TargetConfigType\n\n /**\n * The maintainer. Defaults to [author](https://www.electron.build/configuration#author).\n */\n readonly maintainer?: string | null\n\n /**\n * The vendor. Defaults to [author](https://www.electron.build/configuration#author).\n */\n readonly vendor?: string | null\n\n /**\n * The path to icon set directory or one png file, relative to the [build resources](https://www.electron.build/contents#extraresources) or to the project directory. The icon filename must contain the size (e.g. 32x32.png) of the icon.\n * By default will be generated automatically based on the macOS icns file.\n */\n readonly icon?: string\n\n /**\n * @private\n * @internal Allows specifying an FPM-only package category for all FPM targets in one place.\n * For user-facing category configuration use the target-specific options (e.g. {@link DebOptions}).\n */\n readonly packageCategory?: string | null\n}\n\n/**\n * Desktop-entry and runtime fields shared by all Linux targets and all snap core strategies.\n *\n * Fields set under `linux.*` in your build config (i.e. on {@link LinuxConfiguration}) are\n * automatically cascaded into each snap core's options by `LinuxTargetHelper.getSnapCore()`.\n * You do not need to duplicate them under `snapcraft.core24.*`, `snapcraft.core22.*`, etc.\n * Per-core values always take precedence when both are set.\n */\nexport interface CommonLinuxOptions {\n /**\n * The [short description](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description).\n */\n readonly synopsis?: string | null\n\n /**\n * As [description](https://www.electron.build/configuration#description) from application package.json, but allows you to specify different for Linux.\n */\n readonly description?: string | null\n\n /**\n * The [application category](https://specifications.freedesktop.org/menu-spec/latest/apa.html#main-category-registry).\n */\n readonly category?: string | null\n\n /**\n * The mime types in addition to specified in the file associations. Use it if you don't want to register a new mime type, but reuse existing.\n */\n readonly mimeTypes?: Array<string> | null\n\n /**\n * The [Desktop file](https://developer.gnome.org/documentation/guidelines/maintainer/integrating.html#desktop-files)\n */\n readonly desktop?: LinuxDesktopFile | null\n\n /**\n * The executable parameters. Pass to executableName\n */\n readonly executableArgs?: Array<string> | null\n}\n\n// fpm-only specific options\nexport interface LinuxTargetSpecificOptions extends CommonLinuxOptions, TargetSpecificOptions {\n /**\n * Package dependencies.\n * `rpm` defaults to `[\"gtk3\", \"libnotify\", \"nss\", \"libXScrnSaver\", \"(libXtst or libXtst6)\", \"xdg-utils\", \"at-spi2-core\", \"(libuuid or libuuid1)\"]`\n * `pacman` defaults to `[\"c-ares\", \"ffmpeg\", \"gtk3\", \"http-parser\", \"libevent\", \"libvpx\", \"libxslt\", \"libxss\", \"minizip\", \"nss\", \"re2\", \"snappy\", \"libnotify\", \"libappindicator-gtk3\"]`\n */\n readonly depends?: Array<string> | null\n\n /**\n * The compression type passed to fpm. For `deb`, `rpm`, and `pacman` targets prefer the\n * typed per-format interfaces (`DebOptions`, `RpmOptions`, `PacmanOptions`) which narrow\n * this to only the values that fpm actually accepts for that format.\n * @default xz\n */\n readonly compression?: \"gz\" | \"bzip2\" | \"xz\" | \"xzmt\" | \"gzip\" | \"zst\" | \"zstd\" | null\n\n readonly icon?: string\n\n /**\n * The package category.\n */\n readonly packageCategory?: string | null\n\n /**\n * The name of the package.\n */\n readonly packageName?: string | null\n\n readonly vendor?: string | null\n readonly maintainer?: string | null\n\n /**\n * File path to script to be passed to FPM for `--after-install` arg.\n */\n readonly afterInstall?: string | null\n /**\n * File path to script to be passed to FPM for `--after-remove` arg.\n */\n readonly afterRemove?: string | null\n /**\n * File path to custom AppArmor profile (Ubuntu 24+)\n */\n readonly appArmorProfile?: string | null\n\n /**\n * *Advanced only* The [fpm](https://fpm.readthedocs.io/en/latest/cli-reference.html) options.\n *\n * Example: `[\"--before-install=build/deb-preinstall.sh\", \"--after-upgrade=build/deb-postinstall.sh\"]`\n */\n readonly fpm?: Array<string> | null\n}\nexport interface DebOptions extends LinuxTargetSpecificOptions {\n /**\n * Package dependencies.\n * If need to support Debian, `libappindicator1` should be removed, it is [deprecated in Debian](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895037).\n * If need to support KDE, `gconf2` and `gconf-service` should be removed as it's no longer used [by GNOME](https://packages.debian.org/bullseye/gconf2).\n * @default [\"libgtk-3-0\", \"libnotify4\", \"libnss3\", \"libxss1\", \"libxtst6\", \"xdg-utils\", \"libatspi2.0-0\", \"libuuid1\", \"libsecret-1-0\"]\n */\n readonly depends?: Array<string> | null\n\n /**\n * The [recommended package dependencies](https://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps).\n * @default [\"libappindicator3-1\"]\n */\n readonly recommends?: Array<string> | null\n\n /**\n * The [package category](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Section).\n */\n readonly packageCategory?: string | null\n\n /**\n * The [Priority](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Priority) attribute.\n */\n readonly priority?: string | null\n\n /** @default xz */\n readonly compression?: \"gz\" | \"bzip2\" | \"xz\" | \"zst\" | null\n}\n\nexport interface RpmOptions extends LinuxTargetSpecificOptions {\n /**\n * Passed to fpm via `--rpm-compression`. `\"xzmt\"` uses multi-threaded xz (fpm's RPM default).\n * `\"xz\"` is automatically promoted to `\"xzmt\"`. `\"gzip\"` and `\"bzip2\"` pass through as-is.\n * @default xzmt\n */\n readonly compression?: \"xz\" | \"xzmt\" | \"gzip\" | \"bzip2\" | null\n}\n\nexport interface PacmanOptions extends LinuxTargetSpecificOptions {\n /** @default xz */\n readonly compression?: \"gz\" | \"bzip2\" | \"xz\" | \"zstd\" | null\n}\n\nexport interface AppImageOptions extends CommonLinuxOptions, TargetSpecificOptions {\n /**\n * The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). Only plain text is supported.\n */\n readonly license?: string | null\n /**\n * The compression algorithm passed to the AppImage build tool.\n *\n * **FUSE2 toolset (`\"0.0.0\"` or unset):** only `\"xz\"` and `\"gzip\"` are forwarded\n * to mksquashfs (`-comp <value>`); `\"xz\"` additionally passes `-Xdict-size 100% -b 1048576`.\n * `\"zstd\"`, `null`, and unset fall through to the root-level `compression` option:\n * - `\"maximum\"` → `\"xz\"`\n * - anything else → flag omitted (mksquashfs defaults to gzip)\n *\n * **Static-runtime toolsets (`>= 1.0.0`):** `\"gzip\"` and `\"zstd\"` are forwarded\n * directly. `\"xz\"` is mapped to `\"zstd\"` (nearest supported equivalent). `null`\n * or unset falls through to the root-level `compression` option:\n * - `\"store\"` → `\"gzip\"`\n * - `\"normal\"` / `\"maximum\"` / unset → `\"zstd\"`\n */\n readonly compression?: \"gzip\" | \"xz\" | \"zstd\" | null\n}\n\nexport interface FlatpakOptions extends CommonLinuxOptions, TargetSpecificOptions {\n /**\n * The path to EULA license file. Defaults to `license.txt` or `eula.txt` (or uppercase variants). Only plain text is supported.\n */\n readonly license?: string | null\n\n /**\n * The name of the runtime that the application uses. Defaults to `org.freedesktop.Platform`.\n *\n * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).\n */\n readonly runtime?: string\n\n /**\n * The version of the runtime that the application uses. Defaults to `20.08`.\n *\n * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).\n */\n readonly runtimeVersion?: string\n\n /**\n * The name of the development runtime that the application builds with. Defaults to `org.freedesktop.Sdk`.\n *\n * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).\n */\n readonly sdk?: string\n\n /**\n * Start with the files from the specified application. This can be used to create applications that extend another application.\n * Defaults to [org.electronjs.Electron2.BaseApp](https://github.com/flathub/org.electronjs.Electron2.BaseApp).\n *\n * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).\n */\n readonly base?: string\n\n /**\n * Use this specific version of the application specified in base. Defaults to `20.08`.\n *\n * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).\n */\n readonly baseVersion?: string\n\n /**\n * The branch to use when exporting the application. Defaults to `master`.\n *\n * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).\n */\n readonly branch?: string\n\n /**\n * An array of arguments passed to the flatpak build-finish command. Defaults to:\n * ```json\n * [\n * // Wayland/X11 Rendering\n * \"--socket=wayland\",\n * \"--socket=x11\",\n * \"--share=ipc\",\n * // Open GL\n * \"--device=dri\",\n * // Audio output\n * \"--socket=pulseaudio\",\n * // Read/write home directory access\n * \"--filesystem=home\",\n * // Allow communication with network\n * \"--share=network\",\n * // System notifications with libnotify\n * \"--talk-name=org.freedesktop.Notifications\",\n * ]\n * ```\n *\n * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).\n */\n readonly finishArgs?: string[]\n\n /**\n * An array of objects specifying the modules to be built in order.\n *\n * See [flatpak manifest documentation](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest).\n */\n readonly modules?: (string | any)[]\n\n /**\n * Files to copy directly into the app. Should be a list of [source, dest] tuples. Source should be a relative/absolute path to a file/directory to copy into the flatpak, and dest should be the path inside the app install prefix (e.g. /share/applications/).\n *\n * See [@malept/flatpak-bundler documentation](https://github.com/malept/flatpak-bundler#build-options).\n */\n readonly files?: [string, string][]\n\n /**\n * Symlinks to create in the app files. Should be a list of [target, location] symlink tuples. Target can be either a relative or absolute path inside the app install prefix, and location should be a absolute path inside the prefix to create the symlink at.\n *\n * See [@malept/flatpak-bundler documentation](https://github.com/malept/flatpak-bundler#build-options).\n */\n readonly symlinks?: [string, string][]\n\n /**\n * Whether to enable the Wayland specific flags (`--enable-features=UseOzonePlatform --ozone-platform=wayland`) in the wrapper script. These flags are only available starting with Electron version 12. Defaults to `false`.\n */\n readonly useWaylandFlags?: boolean\n}\n"]}
@@ -249,6 +249,12 @@ export interface DmgOptions extends TargetSpecificOptions {
249
249
  * @default UDZO
250
250
  */
251
251
  format?: "UDRW" | "UDRO" | "UDCO" | "UDZO" | "UDBZ" | "ULFO";
252
+ /**
253
+ * The filesystem for the DMG volume (e.g. `"APFS"` or `"HFS+"`)
254
+ * This will be changed to APFS in the next major release, so it is recommended to set it explicitly to HFS+ if you want to keep using HFS+ (e.g. for better compatibility with older macOS versions).
255
+ * @default HFS+
256
+ */
257
+ readonly filesystem?: "HFS+" | "APFS" | null;
252
258
  /**
253
259
  * The initial size of the DMG filesystem. Accepts the same syntax as the `-size` argument to `hdiutil`, e.g. `"150m"`, `"4g"`.
254
260
  * If not specified, the size is calculated automatically.
@@ -1 +1 @@
1
- {"version":3,"file":"macOptions.js","sourceRoot":"","sources":["../../src/options/macOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { PlatformSpecificBuildOptions, TargetConfiguration, TargetSpecificOptions } from \"../index\"\nimport { CustomMacSign } from \"../macPackager\"\n\nexport type MacOsTargetName = \"default\" | \"dmg\" | \"mas\" | \"mas-dev\" | \"pkg\" | \"7z\" | \"zip\" | \"tar.xz\" | \"tar.lz\" | \"tar.gz\" | \"tar.bz2\" | \"dir\"\n\nexport interface MacConfiguration extends PlatformSpecificBuildOptions {\n /**\n * The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory.\n *\n * For example, `\"category\": \"public.app-category.developer-tools\"` will set the application category to *Developer Tools*.\n *\n * Valid values are listed in [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8).\n */\n readonly category?: string | null\n\n /**\n * The target package type: list of `default`, `dmg`, `mas`, `mas-dev`, `pkg`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.\n * Note: Squirrel.Mac auto update mechanism requires both `dmg` and `zip` to be enabled, even when only `dmg` is used. Disabling `zip` will break auto update in `dmg` packages.\n * @default default (dmg and zip for Squirrel.Mac)\n */\n readonly target?: Array<MacOsTargetName | TargetConfiguration> | MacOsTargetName | TargetConfiguration | null\n\n /**\n * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](https://www.electron.build/code-signing) instead of specifying this option.\n * MAS installer identity is specified in the [mas](https://www.electron.build/mas).\n *\n * Set to `-` to use an ad-hoc identity for signing. Set to `null` to skip signing entirely.\n */\n readonly identity?: string | null\n\n /**\n * The path to application icon.\n * Accepts `.icns` (legacy) or `.icon` (Icon Composer asset).\n * If a `.icon` asset is provided, it will be preferred and compiled to an asset catalog.\n * @default build/icon.icns\n */\n readonly icon?: string | null\n\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mac.plist` will be used if exists (it is a recommended way to set).\n * MAS entitlements is specified in the [mas](https://www.electron.build/mas).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mac.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n *\n * This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Path to login helper entitlement file.\n * When using App Sandbox, the the `com.apple.security.inherit` key that is normally in the inherited entitlements cannot be inherited since the login helper is a standalone executable.\n * Defaults to the value provided for `entitlements`. This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsLoginHelper?: string | null\n\n /**\n * The path to the provisioning profile to use when signing, absolute or relative to the app root.\n */\n readonly provisioningProfile?: string | null\n\n /**\n * The `CFBundleVersion`. Do not use it unless [you need to](https://github.com/electron-userland/electron-builder/issues/565#issuecomment-230678643).\n */\n readonly bundleVersion?: string | null\n\n /**\n * The `CFBundleShortVersionString`. Do not use it unless you need to.\n */\n readonly bundleShortVersion?: string | null\n\n /**\n * Whether a dark mode is supported. If your app does have a dark mode, you can make your app follow the system-wide dark mode setting.\n * @default false\n */\n readonly darkModeSupport?: boolean\n\n /**\n * The bundle identifier to use in the application helper's plist.\n * @default ${appBundleIdentifier}.helper\n */\n readonly helperBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Renderer helper's plist.\n * @default ${appBundleIdentifier}.helper.Renderer\n */\n readonly helperRendererBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Plugin helper's plist.\n * @default ${appBundleIdentifier}.helper.Plugin\n */\n readonly helperPluginBundleId?: string | null\n\n /**\n * The bundle identifier to use in the GPU helper's plist.\n * @default ${appBundleIdentifier}.helper.GPU\n */\n readonly helperGPUBundleId?: string | null\n\n /**\n * The bundle identifier to use in the EH helper's plist.\n * @default ${appBundleIdentifier}.helper.EH\n */\n readonly helperEHBundleId?: string | null\n\n /**\n * The bundle identifier to use in the NP helper's plist.\n * @default ${appBundleIdentifier}.helper.NP\n */\n readonly helperNPBundleId?: string | null\n\n /**\n * Whether to sign app for development or for distribution.\n * @default distribution\n */\n readonly type?: \"distribution\" | \"development\" | null\n\n /**\n * The extra entries for `Info.plist`.\n */\n readonly extendInfo?: any\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n\n /**\n * The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.\n */\n readonly minimumSystemVersion?: string | null\n\n /**\n * Path of [requirements file](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used in signing. Not applicable for MAS.\n */\n readonly requirements?: string | null\n\n /** @private */\n readonly cscInstallerLink?: string | null\n /** @private */\n readonly cscInstallerKeyPassword?: string | null\n\n /**\n * Extra files to put in archive. Not applicable for `tar.*`.\n */\n readonly extraDistFiles?: Array<string> | string | null\n\n /**\n * Whether your app has to be signed with hardened runtime.\n * @default true\n */\n readonly hardenedRuntime?: boolean\n\n /**\n * Whether to let `@electron/osx-sign` validate the signing or not.\n * @default false\n */\n readonly gatekeeperAssess?: boolean\n\n /**\n * Whether to let `@electron/osx-sign` verify the contents or not.\n * @default true\n */\n readonly strictVerify?: boolean\n\n /**\n * Whether to enable entitlements automation from `@electron/osx-sign`.\n * @default true\n */\n readonly preAutoEntitlements?: boolean\n\n /**\n * Regex or an array of regex's that signal skipping signing a file.\n */\n readonly signIgnore?: Array<string> | string | null\n\n /**\n * The custom function (or path to file or module id) to sign an app bundle.\n */\n readonly sign?: CustomMacSign | string | null\n\n /**\n * Specify the URL of the timestamp authority server\n */\n readonly timestamp?: string | null\n\n /**\n * Whether to merge ASAR files for different architectures or not.\n *\n * This option has no effect unless building for \"universal\" arch.\n * @default true\n */\n readonly mergeASARs?: boolean\n\n /**\n * Minimatch pattern of paths that are allowed to be present in one of the\n * ASAR files, but not in the other.\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly singleArchFiles?: string | null\n\n /**\n * Minimatch pattern of paths that are allowed to be x64 binaries in both\n * ASAR files\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly x64ArchFiles?: string | null\n\n /**\n * Array of strings specifying additional arguments to pass to the `codesign` command used to sign a specific file.\n *\n * Some subresources that you may include in your Electron app may need to be signed with --deep, this is not typically safe to apply to the entire Electron app and therefore should be applied to just your file.\n * Usage Example: `['--deep']`\n */\n readonly additionalArguments?: Array<string> | null\n\n /**\n * Whether to disable electron-builder's [@electron/notarize](https://github.com/electron/notarize) integration.\n *\n * Note: In order to activate the notarization step You MUST specify one of the following via environment variables:\n *\n * 1. `APPLE_API_KEY`, `APPLE_API_KEY_ID` and `APPLE_API_ISSUER`.\n * 2. `APPLE_ID`, `APPLE_APP_SPECIFIC_PASSWORD`, and `APPLE_TEAM_ID`\n * 3. `APPLE_KEYCHAIN` and `APPLE_KEYCHAIN_PROFILE`\n *\n * For security reasons it is recommended to use the first option (see https://github.com/electron-userland/electron-builder/issues/7859)\n */\n readonly notarize?: boolean\n}\n\nexport interface DmgOptions extends TargetSpecificOptions {\n /**\n * The path to background image (default: `build/background.tiff` or `build/background.png` if exists). The resolution of this file determines the resolution of the installer window.\n * If background is not specified, use `window.size`. Default locations expected background size to be 540x380.\n * @see [DMG with Retina background support](http://stackoverflow.com/a/11204769/1910191).\n */\n background?: string | null\n\n /**\n * The background color (accepts css colors). Used when no background image is set.\n * @default #ffffff\n */\n backgroundColor?: string | null\n\n /**\n * The path to DMG icon (badge icon), which will be shown when mounted, relative to the [build resources](https://www.electron.build/contents#extraresources) or to the project directory.\n */\n badgeIcon?: string | null\n\n /**\n * The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](https://www.electron.build/contents#extraresources) or to the project directory.\n * Defaults to the application icon (`build/icon.icns`).\n */\n icon?: string | null\n\n /**\n * The size of all the icons inside the DMG.\n * @default 80\n */\n readonly iconSize?: number | null\n\n /**\n * The size of all the icon texts inside the DMG.\n * @default 12\n */\n readonly iconTextSize?: number | null\n\n /**\n * The title of the produced DMG, which will be shown when mounted (volume name).\n *\n * Macro `${productName}`, `${version}` and `${name}` are supported.\n * @default ${productName} ${version}\n */\n readonly title?: string | null\n\n /**\n * The content — to customize icon locations. The x and y coordinates refer to the position of the **center** of the icon (at 1x scale), and do not take the label into account.\n */\n contents?: Array<DmgContent>\n\n /**\n * The disk image format. `ULFO` (lzfse-compressed image (OS X 10.11+ only)).\n * @default UDZO\n */\n format?: \"UDRW\" | \"UDRO\" | \"UDCO\" | \"UDZO\" | \"UDBZ\" | \"ULFO\"\n\n /**\n * The initial size of the DMG filesystem. Accepts the same syntax as the `-size` argument to `hdiutil`, e.g. `\"150m\"`, `\"4g\"`.\n * If not specified, the size is calculated automatically.\n * Set this explicitly for large apps or apps with sparse files to avoid \"No space left on device\" errors.\n */\n readonly size?: string | null\n\n /**\n * Whether to shrink the DMG filesystem to the minimum size after copying files.\n * Set to `false` to preserve the explicit `size` you specified.\n * @default true\n */\n readonly shrink?: boolean\n\n /**\n * The DMG window position and size. With y co-ordinates running from bottom to top.\n *\n * The Finder makes sure that the window will be on the user’s display, so if you want your window at the top left of the display you could use `\"x\": 0, \"y\": 100000` as the x, y co-ordinates.\n * It is not to be possible to position the window relative to the [top left](https://github.com/electron-userland/electron-builder/issues/3990#issuecomment-512960957) or relative to the center of the user’s screen.\n */\n window?: DmgWindow\n\n /**\n * Whether to create internet-enabled disk image (when it is downloaded using a browser it will automatically decompress the image, put the application on the desktop, unmount and remove the disk image file).\n * @default false\n */\n readonly internetEnabled?: boolean\n\n /**\n * Whether to sign the DMG or not. Signing is not required and will lead to unwanted errors in combination with notarization requirements.\n * @default false\n */\n readonly sign?: boolean\n\n /**\n * @private\n * @default true\n */\n writeUpdateInfo?: boolean\n}\n\nexport interface DmgWindow {\n /**\n * The X position relative to left of the screen.\n * @default 400\n */\n x?: number\n\n /**\n * The Y position relative to bottom of the screen.\n * @default 100\n */\n y?: number\n\n /**\n * The width. Defaults to background image width or 540.\n */\n width?: number\n\n /**\n * The height. Defaults to background image height or 380.\n */\n height?: number\n}\n\nexport interface DmgContent {\n /**\n * The device-independent pixel offset from the left of the window to the **center** of the icon.\n */\n x: number\n /**\n * The device-independent pixel offset from the top of the window to the **center** of the icon.\n */\n y: number\n type?: \"link\" | \"file\" | \"dir\"\n\n /**\n * The name of the file within the DMG. Defaults to basename of `path`.\n */\n name?: string\n\n /**\n * The path of the file within the DMG.\n */\n path?: string\n}\n\nexport interface MasConfiguration extends MacConfiguration {\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mas.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mas.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n}\n"]}
1
+ {"version":3,"file":"macOptions.js","sourceRoot":"","sources":["../../src/options/macOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { PlatformSpecificBuildOptions, TargetConfiguration, TargetSpecificOptions } from \"../index\"\nimport { CustomMacSign } from \"../macPackager\"\n\nexport type MacOsTargetName = \"default\" | \"dmg\" | \"mas\" | \"mas-dev\" | \"pkg\" | \"7z\" | \"zip\" | \"tar.xz\" | \"tar.lz\" | \"tar.gz\" | \"tar.bz2\" | \"dir\"\n\nexport interface MacConfiguration extends PlatformSpecificBuildOptions {\n /**\n * The application category type, as shown in the Finder via *View -> Arrange by Application Category* when viewing the Applications directory.\n *\n * For example, `\"category\": \"public.app-category.developer-tools\"` will set the application category to *Developer Tools*.\n *\n * Valid values are listed in [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8).\n */\n readonly category?: string | null\n\n /**\n * The target package type: list of `default`, `dmg`, `mas`, `mas-dev`, `pkg`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.\n * Note: Squirrel.Mac auto update mechanism requires both `dmg` and `zip` to be enabled, even when only `dmg` is used. Disabling `zip` will break auto update in `dmg` packages.\n * @default default (dmg and zip for Squirrel.Mac)\n */\n readonly target?: Array<MacOsTargetName | TargetConfiguration> | MacOsTargetName | TargetConfiguration | null\n\n /**\n * The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](https://www.electron.build/code-signing) instead of specifying this option.\n * MAS installer identity is specified in the [mas](https://www.electron.build/mas).\n *\n * Set to `-` to use an ad-hoc identity for signing. Set to `null` to skip signing entirely.\n */\n readonly identity?: string | null\n\n /**\n * The path to application icon.\n * Accepts `.icns` (legacy) or `.icon` (Icon Composer asset).\n * If a `.icon` asset is provided, it will be preferred and compiled to an asset catalog.\n * @default build/icon.icns\n */\n readonly icon?: string | null\n\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mac.plist` will be used if exists (it is a recommended way to set).\n * MAS entitlements is specified in the [mas](https://www.electron.build/mas).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mac.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n *\n * This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Path to login helper entitlement file.\n * When using App Sandbox, the the `com.apple.security.inherit` key that is normally in the inherited entitlements cannot be inherited since the login helper is a standalone executable.\n * Defaults to the value provided for `entitlements`. This option only applies when signing with `entitlements` provided.\n */\n readonly entitlementsLoginHelper?: string | null\n\n /**\n * The path to the provisioning profile to use when signing, absolute or relative to the app root.\n */\n readonly provisioningProfile?: string | null\n\n /**\n * The `CFBundleVersion`. Do not use it unless [you need to](https://github.com/electron-userland/electron-builder/issues/565#issuecomment-230678643).\n */\n readonly bundleVersion?: string | null\n\n /**\n * The `CFBundleShortVersionString`. Do not use it unless you need to.\n */\n readonly bundleShortVersion?: string | null\n\n /**\n * Whether a dark mode is supported. If your app does have a dark mode, you can make your app follow the system-wide dark mode setting.\n * @default false\n */\n readonly darkModeSupport?: boolean\n\n /**\n * The bundle identifier to use in the application helper's plist.\n * @default ${appBundleIdentifier}.helper\n */\n readonly helperBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Renderer helper's plist.\n * @default ${appBundleIdentifier}.helper.Renderer\n */\n readonly helperRendererBundleId?: string | null\n\n /**\n * The bundle identifier to use in the Plugin helper's plist.\n * @default ${appBundleIdentifier}.helper.Plugin\n */\n readonly helperPluginBundleId?: string | null\n\n /**\n * The bundle identifier to use in the GPU helper's plist.\n * @default ${appBundleIdentifier}.helper.GPU\n */\n readonly helperGPUBundleId?: string | null\n\n /**\n * The bundle identifier to use in the EH helper's plist.\n * @default ${appBundleIdentifier}.helper.EH\n */\n readonly helperEHBundleId?: string | null\n\n /**\n * The bundle identifier to use in the NP helper's plist.\n * @default ${appBundleIdentifier}.helper.NP\n */\n readonly helperNPBundleId?: string | null\n\n /**\n * Whether to sign app for development or for distribution.\n * @default distribution\n */\n readonly type?: \"distribution\" | \"development\" | null\n\n /**\n * The extra entries for `Info.plist`.\n */\n readonly extendInfo?: any\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n\n /**\n * The minimum version of macOS required for the app to run. Corresponds to `LSMinimumSystemVersion`.\n */\n readonly minimumSystemVersion?: string | null\n\n /**\n * Path of [requirements file](https://developer.apple.com/library/mac/documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html) used in signing. Not applicable for MAS.\n */\n readonly requirements?: string | null\n\n /** @private */\n readonly cscInstallerLink?: string | null\n /** @private */\n readonly cscInstallerKeyPassword?: string | null\n\n /**\n * Extra files to put in archive. Not applicable for `tar.*`.\n */\n readonly extraDistFiles?: Array<string> | string | null\n\n /**\n * Whether your app has to be signed with hardened runtime.\n * @default true\n */\n readonly hardenedRuntime?: boolean\n\n /**\n * Whether to let `@electron/osx-sign` validate the signing or not.\n * @default false\n */\n readonly gatekeeperAssess?: boolean\n\n /**\n * Whether to let `@electron/osx-sign` verify the contents or not.\n * @default true\n */\n readonly strictVerify?: boolean\n\n /**\n * Whether to enable entitlements automation from `@electron/osx-sign`.\n * @default true\n */\n readonly preAutoEntitlements?: boolean\n\n /**\n * Regex or an array of regex's that signal skipping signing a file.\n */\n readonly signIgnore?: Array<string> | string | null\n\n /**\n * The custom function (or path to file or module id) to sign an app bundle.\n */\n readonly sign?: CustomMacSign | string | null\n\n /**\n * Specify the URL of the timestamp authority server\n */\n readonly timestamp?: string | null\n\n /**\n * Whether to merge ASAR files for different architectures or not.\n *\n * This option has no effect unless building for \"universal\" arch.\n * @default true\n */\n readonly mergeASARs?: boolean\n\n /**\n * Minimatch pattern of paths that are allowed to be present in one of the\n * ASAR files, but not in the other.\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly singleArchFiles?: string | null\n\n /**\n * Minimatch pattern of paths that are allowed to be x64 binaries in both\n * ASAR files\n *\n * This option has no effect unless building for \"universal\" arch and applies\n * only if `mergeASARs` is `true`.\n */\n readonly x64ArchFiles?: string | null\n\n /**\n * Array of strings specifying additional arguments to pass to the `codesign` command used to sign a specific file.\n *\n * Some subresources that you may include in your Electron app may need to be signed with --deep, this is not typically safe to apply to the entire Electron app and therefore should be applied to just your file.\n * Usage Example: `['--deep']`\n */\n readonly additionalArguments?: Array<string> | null\n\n /**\n * Whether to disable electron-builder's [@electron/notarize](https://github.com/electron/notarize) integration.\n *\n * Note: In order to activate the notarization step You MUST specify one of the following via environment variables:\n *\n * 1. `APPLE_API_KEY`, `APPLE_API_KEY_ID` and `APPLE_API_ISSUER`.\n * 2. `APPLE_ID`, `APPLE_APP_SPECIFIC_PASSWORD`, and `APPLE_TEAM_ID`\n * 3. `APPLE_KEYCHAIN` and `APPLE_KEYCHAIN_PROFILE`\n *\n * For security reasons it is recommended to use the first option (see https://github.com/electron-userland/electron-builder/issues/7859)\n */\n readonly notarize?: boolean\n}\n\nexport interface DmgOptions extends TargetSpecificOptions {\n /**\n * The path to background image (default: `build/background.tiff` or `build/background.png` if exists). The resolution of this file determines the resolution of the installer window.\n * If background is not specified, use `window.size`. Default locations expected background size to be 540x380.\n * @see [DMG with Retina background support](http://stackoverflow.com/a/11204769/1910191).\n */\n background?: string | null\n\n /**\n * The background color (accepts css colors). Used when no background image is set.\n * @default #ffffff\n */\n backgroundColor?: string | null\n\n /**\n * The path to DMG icon (badge icon), which will be shown when mounted, relative to the [build resources](https://www.electron.build/contents#extraresources) or to the project directory.\n */\n badgeIcon?: string | null\n\n /**\n * The path to DMG icon (volume icon), which will be shown when mounted, relative to the [build resources](https://www.electron.build/contents#extraresources) or to the project directory.\n * Defaults to the application icon (`build/icon.icns`).\n */\n icon?: string | null\n\n /**\n * The size of all the icons inside the DMG.\n * @default 80\n */\n readonly iconSize?: number | null\n\n /**\n * The size of all the icon texts inside the DMG.\n * @default 12\n */\n readonly iconTextSize?: number | null\n\n /**\n * The title of the produced DMG, which will be shown when mounted (volume name).\n *\n * Macro `${productName}`, `${version}` and `${name}` are supported.\n * @default ${productName} ${version}\n */\n readonly title?: string | null\n\n /**\n * The content — to customize icon locations. The x and y coordinates refer to the position of the **center** of the icon (at 1x scale), and do not take the label into account.\n */\n contents?: Array<DmgContent>\n\n /**\n * The disk image format. `ULFO` (lzfse-compressed image (OS X 10.11+ only)).\n * @default UDZO\n */\n format?: \"UDRW\" | \"UDRO\" | \"UDCO\" | \"UDZO\" | \"UDBZ\" | \"ULFO\"\n\n /**\n * The filesystem for the DMG volume (e.g. `\"APFS\"` or `\"HFS+\"`)\n * This will be changed to APFS in the next major release, so it is recommended to set it explicitly to HFS+ if you want to keep using HFS+ (e.g. for better compatibility with older macOS versions).\n * @default HFS+\n */\n readonly filesystem?: \"HFS+\" | \"APFS\" | null\n\n /**\n * The initial size of the DMG filesystem. Accepts the same syntax as the `-size` argument to `hdiutil`, e.g. `\"150m\"`, `\"4g\"`.\n * If not specified, the size is calculated automatically.\n * Set this explicitly for large apps or apps with sparse files to avoid \"No space left on device\" errors.\n */\n readonly size?: string | null\n\n /**\n * Whether to shrink the DMG filesystem to the minimum size after copying files.\n * Set to `false` to preserve the explicit `size` you specified.\n * @default true\n */\n readonly shrink?: boolean\n\n /**\n * The DMG window position and size. With y co-ordinates running from bottom to top.\n *\n * The Finder makes sure that the window will be on the user’s display, so if you want your window at the top left of the display you could use `\"x\": 0, \"y\": 100000` as the x, y co-ordinates.\n * It is not to be possible to position the window relative to the [top left](https://github.com/electron-userland/electron-builder/issues/3990#issuecomment-512960957) or relative to the center of the user’s screen.\n */\n window?: DmgWindow\n\n /**\n * Whether to create internet-enabled disk image (when it is downloaded using a browser it will automatically decompress the image, put the application on the desktop, unmount and remove the disk image file).\n * @default false\n */\n readonly internetEnabled?: boolean\n\n /**\n * Whether to sign the DMG or not. Signing is not required and will lead to unwanted errors in combination with notarization requirements.\n * @default false\n */\n readonly sign?: boolean\n\n /**\n * @private\n * @default true\n */\n writeUpdateInfo?: boolean\n}\n\nexport interface DmgWindow {\n /**\n * The X position relative to left of the screen.\n * @default 400\n */\n x?: number\n\n /**\n * The Y position relative to bottom of the screen.\n * @default 100\n */\n y?: number\n\n /**\n * The width. Defaults to background image width or 540.\n */\n width?: number\n\n /**\n * The height. Defaults to background image height or 380.\n */\n height?: number\n}\n\nexport interface DmgContent {\n /**\n * The device-independent pixel offset from the left of the window to the **center** of the icon.\n */\n x: number\n /**\n * The device-independent pixel offset from the top of the window to the **center** of the icon.\n */\n y: number\n type?: \"link\" | \"file\" | \"dir\"\n\n /**\n * The name of the file within the DMG. Defaults to basename of `path`.\n */\n name?: string\n\n /**\n * The path of the file within the DMG.\n */\n path?: string\n}\n\nexport interface MasConfiguration extends MacConfiguration {\n /**\n * The path to entitlements file for signing the app. `build/entitlements.mas.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n * Be aware that your app may crash if the right entitlements are not set like `com.apple.security.cs.allow-jit` for example on arm64 builds with Electron 20+.\n * See [Signing and Notarizing macOS Builds from the Electron documentation](https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds) for more information.\n */\n readonly entitlements?: string | null\n\n /**\n * The path to child entitlements which inherit the security settings for signing frameworks and bundles of a distribution. `build/entitlements.mas.inherit.plist` will be used if exists (it is a recommended way to set).\n * See [this folder in osx-sign's repository](https://github.com/electron/osx-sign/tree/main/entitlements) for examples.\n */\n readonly entitlementsInherit?: string | null\n\n /**\n * Paths of any extra binaries that need to be signed.\n */\n readonly binaries?: Array<string> | null\n}\n"]}
@@ -41,6 +41,8 @@ export interface Metadata {
41
41
  readonly productName?: string | null;
42
42
  /** @private */
43
43
  readonly main?: string | null;
44
+ /** @private */
45
+ readonly desktopName?: string | null;
44
46
  }
45
47
  export interface AuthorMetadata {
46
48
  readonly name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/options/metadata.ts"],"names":[],"mappings":"","sourcesContent":["import { Configuration } from \"../configuration\"\n\nexport interface Metadata {\n /**\n * The application name. Required.\n */\n readonly name?: string\n\n /**\n * The application description.\n */\n readonly description?: string\n\n /**\n * The url to the project [homepage](https://docs.npmjs.com/files/package.json#homepage) (NuGet Package `projectUrl` (optional) or Linux Package URL (required)).\n *\n * If not specified and your project repository is public on GitHub, it will be `https://github.com/${user}/${project}` by default.\n */\n readonly homepage?: string | null\n\n /**\n * *linux-only.* The [license](https://docs.npmjs.com/files/package.json#license) name.\n */\n readonly license?: string | null\n\n readonly author?: AuthorMetadata | null\n\n /**\n * The [repository](https://docs.npmjs.com/files/package.json#repository).\n */\n readonly repository?: string | RepositoryInfo | null\n\n /**\n * The electron-builder configuration.\n */\n readonly build?: Configuration\n\n /** @private */\n readonly dependencies?: Record<string, string>\n /** @private */\n readonly version?: string\n /** @private */\n readonly type?: string\n /** @private */\n readonly shortVersion?: string | null\n /** @private */\n readonly shortVersionWindows?: string | null\n /** @private */\n readonly productName?: string | null\n /** @private */\n readonly main?: string | null\n}\n\nexport interface AuthorMetadata {\n readonly name: string\n readonly email?: string\n}\n\nexport interface RepositoryInfo {\n readonly url: string\n}\n"]}
1
+ {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/options/metadata.ts"],"names":[],"mappings":"","sourcesContent":["import { Configuration } from \"../configuration\"\n\nexport interface Metadata {\n /**\n * The application name. Required.\n */\n readonly name?: string\n\n /**\n * The application description.\n */\n readonly description?: string\n\n /**\n * The url to the project [homepage](https://docs.npmjs.com/files/package.json#homepage) (NuGet Package `projectUrl` (optional) or Linux Package URL (required)).\n *\n * If not specified and your project repository is public on GitHub, it will be `https://github.com/${user}/${project}` by default.\n */\n readonly homepage?: string | null\n\n /**\n * *linux-only.* The [license](https://docs.npmjs.com/files/package.json#license) name.\n */\n readonly license?: string | null\n\n readonly author?: AuthorMetadata | null\n\n /**\n * The [repository](https://docs.npmjs.com/files/package.json#repository).\n */\n readonly repository?: string | RepositoryInfo | null\n\n /**\n * The electron-builder configuration.\n */\n readonly build?: Configuration\n\n /** @private */\n readonly dependencies?: Record<string, string>\n /** @private */\n readonly version?: string\n /** @private */\n readonly type?: string\n /** @private */\n readonly shortVersion?: string | null\n /** @private */\n readonly shortVersionWindows?: string | null\n /** @private */\n readonly productName?: string | null\n /** @private */\n readonly main?: string | null\n /** @private */\n readonly desktopName?: string | null\n}\n\nexport interface AuthorMetadata {\n readonly name: string\n readonly email?: string\n}\n\nexport interface RepositoryInfo {\n readonly url: string\n}\n"]}