app-builder-lib 26.15.7 → 26.16.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.
- package/out/configuration.d.ts +32 -0
- package/out/configuration.js.map +1 -1
- package/out/macPackager.d.ts +7 -2
- package/out/macPackager.js +40 -11
- package/out/macPackager.js.map +1 -1
- package/out/node-module-collector/nodeModulesCollector.d.ts +11 -1
- package/out/node-module-collector/nodeModulesCollector.js +16 -2
- package/out/node-module-collector/nodeModulesCollector.js.map +1 -1
- package/out/node-module-collector/pnpmNodeModulesCollector.js +3 -1
- package/out/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
- package/out/targets/AppxTarget.js +5 -5
- package/out/targets/AppxTarget.js.map +1 -1
- package/out/targets/MsiTarget.js +8 -11
- package/out/targets/MsiTarget.js.map +1 -1
- package/out/targets/appimage/appImageUtil.d.ts +1 -1
- package/out/targets/appimage/appImageUtil.js +3 -3
- package/out/targets/appimage/appImageUtil.js.map +1 -1
- package/out/targets/appimage/appLauncher.js +3 -9
- package/out/targets/appimage/appLauncher.js.map +1 -1
- package/out/targets/blockmap/blockmap.js +2 -2
- package/out/targets/blockmap/blockmap.js.map +1 -1
- package/out/targets/nsis/nsisOptions.d.ts +2 -0
- package/out/targets/nsis/nsisOptions.js.map +1 -1
- package/out/toolsets/icons.js +2 -2
- package/out/toolsets/icons.js.map +1 -1
- package/out/toolsets/linux.js +3 -3
- package/out/toolsets/linux.js.map +1 -1
- package/out/util/appFileCopier.d.ts +21 -0
- package/out/util/appFileCopier.js +58 -0
- package/out/util/appFileCopier.js.map +1 -1
- package/out/util/electronGet.d.ts +46 -0
- package/out/util/electronGet.js +174 -24
- package/out/util/electronGet.js.map +1 -1
- package/out/version.d.ts +1 -1
- package/out/version.js +1 -1
- package/out/version.js.map +1 -1
- package/package.json +8 -8
- package/scheme.json +20 -1
- package/templates/appx/appxmanifest.xml +1 -2
- package/templates/nsis/include/allowOnlyOneInstallerInstance.nsh +4 -4
package/out/configuration.d.ts
CHANGED
|
@@ -188,6 +188,31 @@ export interface CommonConfiguration {
|
|
|
188
188
|
* @default sequential
|
|
189
189
|
*/
|
|
190
190
|
readonly nativeRebuilder?: "legacy" | "sequential" | "parallel" | null;
|
|
191
|
+
/**
|
|
192
|
+
* Whether production dependencies that cannot be resolved during node-module collection are
|
|
193
|
+
* allowed — i.e. whether the build should continue with a warning instead of failing.
|
|
194
|
+
*
|
|
195
|
+
* During collection every production dependency must resolve to an installed package on disk. A
|
|
196
|
+
* dependency that does not resolve (`cannot find path for dependency` / `dependency not found on
|
|
197
|
+
* disk`) is not bundled, which typically breaks the packaged app at runtime with
|
|
198
|
+
* `MODULE_NOT_FOUND`.
|
|
199
|
+
*
|
|
200
|
+
* - `true` (or omitted — the v26 default): missing production dependencies are only logged as
|
|
201
|
+
* warnings, keeping the historical behavior of the stable 26.x line. (electron-builder 27+
|
|
202
|
+
* defaults to `false` and fails the build instead.)
|
|
203
|
+
* - `false` or `null`: the build fails after dependency collection completes, reporting the
|
|
204
|
+
* **complete** list of missing production dependencies at once.
|
|
205
|
+
* - `string[]`: the listed dependency names are allowed to be missing; any other missing
|
|
206
|
+
* production dependency fails the build. Entries match the package name of the reported
|
|
207
|
+
* `name@version` entry (e.g. `some-native-module`, `@scope/pkg`), or an exact `name@version`
|
|
208
|
+
* string to allow only that resolved version to be missing.
|
|
209
|
+
*
|
|
210
|
+
* Missing *optional* dependencies (declared in `optionalDependencies`, e.g. `fsevents` on
|
|
211
|
+
* Linux/Windows, or platform-specific packages) are always allowed and never fail the build.
|
|
212
|
+
*
|
|
213
|
+
* @default true
|
|
214
|
+
*/
|
|
215
|
+
readonly allowMissingDependencies?: boolean | Array<string> | null;
|
|
191
216
|
/**
|
|
192
217
|
* The build number. Maps to the `--iteration` flag for builds using FPM on Linux.
|
|
193
218
|
* If not defined, then it will fallback to `BUILD_NUMBER` or `TRAVIS_BUILD_NUMBER` or `APPVEYOR_BUILD_NUMBER` or `CIRCLE_BUILD_NUM` or `BUILD_BUILDNUMBER` or `CI_PIPELINE_IID` env.
|
|
@@ -247,6 +272,13 @@ export interface Configuration extends CommonConfiguration, PlatformSpecificBuil
|
|
|
247
272
|
/**
|
|
248
273
|
* The [electron-download](https://github.com/electron-userland/electron-download#usage) options. (legacy)
|
|
249
274
|
* Alternatively, you can use [electron/get](https://github.com/electron/get#usage) options.
|
|
275
|
+
*
|
|
276
|
+
* `checksums` (a map of artifact file name → SHA-256 hex) makes checksum validation fully offline —
|
|
277
|
+
* without it, `@electron/get` fetches `SHASUMS256.txt` from the network on every build, even when the
|
|
278
|
+
* artifact itself is already cached. When `checksums` is not configured, electron-builder automatically
|
|
279
|
+
* picks up a locally seeded `SHASUMS256.txt-<version>` (or `SHASUMS256.txt`) file at the root of the
|
|
280
|
+
* Electron cache directory. See the
|
|
281
|
+
* [air-gapped / offline builds guide](https://www.electron.build/tutorials/offline-air-gapped-builds).
|
|
250
282
|
*/
|
|
251
283
|
readonly electronDownload?: ElectronDownloadOptions | ElectronGetOptions | null;
|
|
252
284
|
/**
|
package/out/configuration.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"","sourcesContent":["import { Arch } from \"builder-util\"\nimport { BeforeBuildContext, Target } from \"./core\"\nimport { ElectronBrandingOptions } from \"./electron/ElectronFramework\"\nimport { PrepareApplicationStageDirectoryOptions } from \"./Framework\"\nimport { AppXOptions } from \"./options/AppXOptions\"\nimport { AppImageOptions, DebOptions, FlatpakOptions, LinuxConfiguration, LinuxTargetSpecificOptions, PacmanOptions, RpmOptions } from \"./options/linuxOptions\"\nimport { DmgOptions, MacConfiguration, MasConfiguration } from \"./options/macOptions\"\nimport { MsiOptions } from \"./options/MsiOptions\"\nimport { MsiWrappedOptions } from \"./options/MsiWrappedOptions\"\nimport { PkgOptions } from \"./options/pkgOptions\"\nimport { PlatformSpecificBuildOptions } from \"./options/PlatformSpecificBuildOptions\"\nimport { SnapcraftOptions, SnapOptions } from \"./options/SnapOptions\"\nimport { SquirrelWindowsOptions } from \"./options/SquirrelWindowsOptions\"\nimport { WindowsConfiguration } from \"./options/winOptions\"\nimport { BuildResult } from \"./packager\"\nimport { ArtifactBuildStarted, ArtifactCreated } from \"./packagerApi\"\nimport { PlatformPackager } from \"./platformPackager\"\nimport { NsisOptions, NsisWebOptions, PortableOptions } from \"./targets/nsis/nsisOptions\"\nimport { ElectronDownloadOptions, ElectronGetOptions } from \"./util/electronGet\"\n\n// duplicate appId here because it is important\n/**\n * Configuration Options\n */\nexport interface CommonConfiguration {\n /**\n * The application id. Used as [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as\n * [Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.\n * @default com.electron.${name}\n */\n readonly appId?: string | null\n\n /**\n * As [name](#metadata), but allows you to specify a product name for your executable which contains spaces and other special characters not allowed in the [name property](https://docs.npmjs.com/files/package.json#name).\n * If not specified inside of the `build` configuration, `productName` property defined at the top level of `package.json` is used. If not specified at the top level of `package.json`, [name property](https://docs.npmjs.com/files/package.json#name) is used.\n */\n readonly productName?: string | null\n\n /**\n * The human-readable copyright line for the app.\n * @default Copyright © year ${author}\n */\n readonly copyright?: string | null\n\n /**\n * Directories for build resources\n */\n readonly directories?: MetadataDirectories | null\n\n /**\n * Configuration of toolsets utilized by electron-builder\n */\n readonly toolsets?: ToolsetConfig | null\n\n /**\n * Options related to how build macOS targets.\n */\n readonly mac?: MacConfiguration | null\n /**\n * MAS (Mac Application Store) options.\n */\n readonly mas?: MasConfiguration | null\n /**\n * MAS (Mac Application Store) development options (`mas-dev` target).\n */\n readonly masDev?: MasConfiguration | null\n /**\n * macOS DMG options.\n */\n readonly dmg?: DmgOptions | null\n /**\n * macOS PKG options.\n */\n readonly pkg?: PkgOptions | null\n\n /**\n * Options related to how build Windows targets.\n */\n readonly win?: WindowsConfiguration | null\n /** NSIS installer options. */\n readonly nsis?: NsisOptions | null\n /** NSIS web installer options (downloads app package at install time). */\n readonly nsisWeb?: NsisWebOptions | null\n /** Portable executable options (no installation required). */\n readonly portable?: PortableOptions | null\n /** Windows Store (AppX) package options. */\n readonly appx?: AppXOptions | null\n /**\n * MSI package options.\n */\n readonly msi?: MsiOptions | null\n /**\n * MSI-wrapped installer options.\n */\n readonly msiWrapped?: MsiWrappedOptions | null\n /**\n * Squirrel.Windows installer options. Requires the `electron-builder-squirrel-windows` dependency.\n */\n readonly squirrelWindows?: SquirrelWindowsOptions | null\n /**\n * General Linux build options shared across all Linux targets (icon, category, desktop entry,\n * executable name, etc.). Target-specific compression and packaging options live in the\n * per-format interfaces (`DebOptions`, `RpmOptions`, `PacmanOptions`, etc.).\n */\n readonly linux?: LinuxConfiguration | null\n /**\n * Debian package options. Targets Debian, Ubuntu, and Debian-based distributions.\n * Produces a `.deb` archive installable via `dpkg -i` or `apt install`.\n */\n readonly deb?: DebOptions | null\n /**\n * Flat snap configuration targeting core22 and older snap bases.\n *\n * @deprecated Use `snapcraft` instead — it supersedes `snap` when both are present and supports\n * all snap bases including core24. `snap` will be removed in a future major release.\n * See {@link SnapOptions} for available properties.\n */\n readonly snap?: SnapOptions | null\n /**\n * Snapcraft configuration. Prefer this over the deprecated `snap` field.\n *\n * Selects the snapcraft base and provides per-core options:\n * - `base: \"core18\" | \"core20\" | \"core22\"` — legacy builds; accepts the same options as `snap`\n * - `base: \"core24\"` — modern builds with the GNOME extension (recommended for new apps, requires Electron 25+)\n * - `base: \"custom\"` — pass an existing `snapcraft.yaml` through unchanged; no plugs, extensions,\n * or desktop files are injected\n *\n * When both `snapcraft` and `snap` are set, `snapcraft` takes precedence.\n *\n * @example\n * ```json\n * { \"snapcraft\": { \"base\": \"core24\", \"core24\": { \"useLXD\": true } } }\n * ```\n *\n * See {@link SnapcraftOptions} for all available properties.\n */\n readonly snapcraft?: SnapcraftOptions | null\n /**\n * AppImage options. AppImage is a portable application format that bundles the app\n * and its dependencies into a single self-contained executable that runs on most\n * Linux distributions without installation.\n */\n readonly appImage?: AppImageOptions | null\n /**\n * Flatpak options. Flatpak is a sandboxed application distribution format for Linux\n * that runs in a controlled environment and is distributed via [Flathub](https://flathub.org/)\n * or other Flatpak repositories.\n */\n readonly flatpak?: FlatpakOptions | null\n /**\n * Pacman package options. Targets Arch Linux and Arch-based distributions\n * (Manjaro, EndeavourOS, etc.). Produces a `.pacman` archive installable via `pacman -U`.\n */\n readonly pacman?: PacmanOptions | null\n /**\n * RPM package options. Targets Fedora, Red Hat Enterprise Linux, SUSE, and related\n * distributions. Produces a `.rpm` archive installable via `rpm` or `dnf`.\n */\n readonly rpm?: RpmOptions | null\n /**\n * FreeBSD package options. Produces a `.pkg` archive for the FreeBSD `pkg` package manager.\n */\n readonly freebsd?: LinuxTargetSpecificOptions | null\n /**\n * Solaris IPS package options. Produces a `.p5p` archive for the Solaris Image Packaging\n * System (`pkg`).\n */\n readonly p5p?: LinuxTargetSpecificOptions | null\n /**\n * Alpine Linux APK package options. Produces an `.apk` archive installable via `apk add`.\n */\n readonly apk?: LinuxTargetSpecificOptions | null\n\n /**\n * Whether to build the application native dependencies from source.\n * @default false\n */\n buildDependenciesFromSource?: boolean\n /**\n * Whether to execute `node-gyp rebuild` before starting to package the app.\n *\n * Don't [use](https://github.com/electron-userland/electron-builder/issues/683#issuecomment-241214075) [npm](http://electron.atom.io/docs/tutorial/using-native-node-modules/#using-npm) (neither `.npmrc`) for configuring electron headers. Use `electron-builder node-gyp-rebuild` instead.\n * @default false\n */\n readonly nodeGypRebuild?: boolean\n /**\n * Additional command line arguments to use when installing app native deps.\n */\n readonly npmArgs?: Array<string> | string | null\n /**\n * Whether to [rebuild](https://docs.npmjs.com/cli/rebuild) native dependencies before starting to package the app.\n * @default true\n */\n readonly npmRebuild?: boolean\n /**\n * Use `legacy` app-builder binary for installing native dependencies, or `@electron/rebuild` in `sequential` or `parallel` compilation modes.\n * @default sequential\n */\n readonly nativeRebuilder?: \"legacy\" | \"sequential\" | \"parallel\" | null\n\n /**\n * The build number. Maps to the `--iteration` flag for builds using FPM on Linux.\n * If not defined, then it will fallback to `BUILD_NUMBER` or `TRAVIS_BUILD_NUMBER` or `APPVEYOR_BUILD_NUMBER` or `CIRCLE_BUILD_NUM` or `BUILD_BUILDNUMBER` or `CI_PIPELINE_IID` env.\n */\n readonly buildNumber?: string | null\n\n /**\n * The build version. Maps to the `CFBundleVersion` on macOS, and `FileVersion` metadata property on Windows. Defaults to the `version`.\n * If `buildVersion` is not defined and `buildNumber` (or one of the `buildNumber` envs) is defined, it will be used as a build version (`version.buildNumber`).\n */\n readonly buildVersion?: string | null\n\n /**\n * Whether to download the alternate FFmpeg library from Electron's release assets and replace the default FFmpeg library prior to signing\n */\n readonly downloadAlternateFFmpeg?: boolean\n\n /**\n * Inject properties to `package.json`.\n */\n readonly extraMetadata?: any\n\n /**\n * Whether to fail if the application is not signed (to prevent unsigned app if code signing configuration is not correct).\n * @default false\n */\n readonly forceCodeSigning?: boolean\n\n /**\n * Whether to include PDB files.\n * @default false\n */\n readonly includePdb?: boolean\n\n /**\n * Whether to remove `scripts` field from `package.json` files.\n *\n * @default true\n */\n readonly removePackageScripts?: boolean\n\n /**\n * Whether to remove `keywords` field from `package.json` files.\n *\n * @default true\n */\n readonly removePackageKeywords?: boolean\n\n /**\n * Options to pass to `@electron/fuses`\n * Ref: https://github.com/electron/fuses\n */\n readonly electronFuses?: FuseOptionsV1 | null\n\n /**\n * [Experimental] Configuration for concurrent builds.\n */\n readonly concurrency?: Concurrency | null\n}\n\nexport interface Configuration extends CommonConfiguration, PlatformSpecificBuildOptions, Hooks {\n /**\n * Whether to use [electron-compile](http://github.com/electron/electron-compile) to compile app. Defaults to `true` if `electron-compile` in the dependencies. And `false` if in the `devDependencies` or doesn't specified.\n * @deprecated `electron-compile` is no longer maintained. Compile your app with a modern bundler (webpack, vite, etc.) instead.\n */\n readonly electronCompile?: boolean\n\n /**\n * The [electron-download](https://github.com/electron-userland/electron-download#usage) options. (legacy)\n * Alternatively, you can use [electron/get](https://github.com/electron/get#usage) options.\n */\n readonly electronDownload?: ElectronDownloadOptions | ElectronGetOptions | null\n\n /**\n * The branding used by Electron's distributables. This is needed if a fork has modified Electron's BRANDING.json file.\n */\n readonly electronBranding?: ElectronBrandingOptions\n\n /**\n * The version of electron you are packaging for. Defaults to version of `electron`, `electron-prebuilt` or `electron-prebuilt-compile` dependency.\n */\n electronVersion?: string | null\n\n /**\n * The name of a built-in configuration preset (currently, only `react-cra` is supported) or any number of paths to config files (relative to project dir).\n *\n * The latter allows to mixin a config from multiple other configs, as if you `Object.assign` them, but properly combine `files` glob patterns.\n *\n * If `react-scripts` in the app dependencies, `react-cra` will be set automatically. Set to `null` to disable automatic detection.\n */\n extends?: Array<string> | string | null\n\n /**\n * *libui-based frameworks only* The version of NodeJS you are packaging for.\n * You can set it to `current` to set the Node.js version that you use to run.\n * @deprecated libui-based frameworks (proton-native, etc.) are no longer actively maintained. This option has no effect when using Electron.\n */\n readonly nodeVersion?: string | null\n\n /**\n * *libui-based frameworks only* The version of LaunchUI you are packaging for. Applicable for Windows only. Defaults to version suitable for used framework version.\n * @deprecated libui-based frameworks (proton-native, etc.) are no longer actively maintained. This option has no effect when using Electron.\n */\n readonly launchUiVersion?: boolean | string | null\n\n /**\n * The framework name. One of `electron`, `proton`, `libui`. Defaults to `electron`.\n * @deprecated `proton` and `libui` framework support is no longer actively maintained. Use `electron` (the default).\n */\n readonly framework?: string | null\n\n /**\n * Whether to disable sanity check asar package (useful for custom electron forks that implement their own encrypted integrity validation)\n * @default false\n */\n readonly disableSanityCheckAsar?: boolean\n\n /**\n * Whether to skip ASAR integrity hash computation. Useful for custom electron forks with encrypted ASAR support where the header is not readable by standard tools.\n * @default false\n */\n readonly disableAsarIntegrity?: boolean\n}\n\nexport type Hook<T, V> = (contextOrPath: T) => Promise<V> | V\n\nexport interface PackContext {\n readonly outDir: string\n readonly appOutDir: string\n readonly packager: PlatformPackager<any>\n readonly electronPlatformName: string\n readonly arch: Arch\n readonly targets: Array<Target>\n}\nexport type AfterPackContext = PackContext\nexport type BeforePackContext = PackContext\nexport type AfterExtractContext = PackContext\n\n/**\n * Configuration of toolsets utilized by electron-builder\n */\nexport interface ToolsetConfig {\n /**\n * `win-codesign` version to use for signing Windows artifacts.\n * Located at https://github.com/electron-userland/electron-builder-binaries/releases?q=win-codesign&expanded=true\n *\n * Stable:\n * v0.0.0 (winCodeSign)\n *\n * Beta:\n * Windows Kits 10.0.26100.0\n * v1.0.0, v1.1.0\n *\n * @default \"0.0.0\"\n */\n readonly winCodeSign?: \"0.0.0\" | \"1.0.0\" | \"1.1.0\" | null\n\n /**\n * `appimage` bundle version to use for Appimage packaging and runtime.\n * Located at https://github.com/electron-userland/electron-builder-binaries/releases?q=appimage&expanded=true\n * 0.0.0 - legacy toolset (appimage)\n *\n * Betas:\n * 1.0.2 - Runtime 20251108\n * 1.0.3 - Runtime 20251108 (Resolves GH issue #9598)\n *\n * @default \"0.0.0\"\n */\n readonly appimage?: \"0.0.0\" | \"1.0.2\" | \"1.0.3\" | null\n\n /**\n * `nsis` bundle version to use for NSIS installer compilation.\n * Located at https://github.com/electron-userland/electron-builder-binaries/releases?q=nsis&expanded=true\n * 0.0.0 - legacy toolset (nsis-3.0.4.1 + nsis-resources-3.4.1)\n *\n * Betas:\n * 1.2.1 - unified bundle (makensis 3.12 + plugins in one archive, entrypoint scripts auto-set NSISDIR)\n *\n * @default \"0.0.0\"\n */\n readonly nsis?: \"0.0.0\" | \"1.2.1\" | null\n\n /**\n * `wine` bundle version to use for running Windows tools on non-Windows platforms.\n * Located at https://github.com/electron-userland/electron-builder-binaries/releases?q=wine&expanded=true\n * 0.0.0 - legacy toolset (wine 4.0.1 portable; mac-only support)\n *\n * Beta:\n * 1.0.1 - Wine 11 bundle (unified wine binary, ia32 via WoW64)\n *\n * @default \"0.0.0\"\n */\n readonly wine?: \"0.0.0\" | \"1.0.1\" | null\n}\n\nexport interface Hooks {\n /**\n * The function (or path to file or module id) to be run before pack.\n * Receives a {@link BeforePackContext}.\n *\n * Can be specified inline as a function in JavaScript configs:\n * ```js\n * // electron-builder.config.js\n * module.exports = {\n * beforePack: async (context) => {\n * // your code\n * }\n * }\n * ```\n *\n * Or as a path to a module that exports the function as its default export:\n * ```json\n * { \"build\": { \"beforePack\": \"./myBeforePackHook.js\" } }\n * ```\n * ```js\n * // myBeforePackHook.js\n * exports.default = async function(context) {\n * // your custom code\n * }\n * ```\n */\n readonly beforePack?: Hook<BeforePackContext, void> | string | null\n\n /**\n * The function (or path to file or module id) to be run after the prebuilt Electron binary has been extracted to the output directory.\n * Receives an {@link AfterExtractContext}. For file/module setup, see {@link beforePack}.\n */\n readonly afterExtract?: Hook<AfterExtractContext, void> | string | null\n\n /**\n * The function (or path to file or module id) to be run after pack but before pack into distributable format and sign.\n * Receives an {@link AfterPackContext}. For file/module setup, see {@link beforePack}.\n */\n readonly afterPack?: Hook<AfterPackContext, void> | string | null\n\n /**\n * The function (or path to file or module id) to be run after pack and sign but before pack into distributable format.\n * Receives an {@link AfterPackContext}. For file/module setup, see {@link beforePack}.\n */\n readonly afterSign?: Hook<AfterPackContext, void> | string | null\n\n /**\n * The function (or path to file or module id) to be run when an individual artifact build starts.\n * Receives an {@link ArtifactBuildStarted}. For file/module setup, see {@link beforePack}.\n */\n readonly artifactBuildStarted?: Hook<ArtifactBuildStarted, void> | string | null\n /**\n * The function (or path to file or module id) to be run when an individual artifact build completes.\n * Receives an {@link ArtifactCreated}. For file/module setup, see {@link beforePack}.\n */\n readonly artifactBuildCompleted?: Hook<ArtifactCreated, void> | string | null\n /**\n * The function (or path to file or module id) to be run after all artifacts are built.\n * Receives a {@link BuildResult}. May return an array of additional file paths to publish.\n *\n * For file/module setup, see {@link beforePack}.\n *\n * @example\n * ```js\n * exports.default = function () {\n * // return additional files to publish\n * return [\"/path/to/additional/result/file\"]\n * }\n * ```\n */\n readonly afterAllArtifactBuild?: Hook<BuildResult, Array<string>> | string | null\n /**\n * The function (or path to file or module id) to be run after MSI project created on disk - not packed into .msi package yet.\n */\n readonly msiProjectCreated?: Hook<string, void> | string | null\n /**\n * The function (or path to file or module id) to be run after Appx manifest created on disk - not packed into .appx package yet.\n */\n readonly appxManifestCreated?: Hook<string, void> | string | null\n /**\n * The function (or path to file or module id) to be [run on each node module](#onnodemodulefile) file. Returning `true`/`false` will determine whether to force include or to use the default copier logic\n */\n readonly onNodeModuleFile?: Hook<string, void | boolean> | string | null\n /**\n * The function (or path to file or module id) to be run before dependencies are installed or rebuilt. Works when `npmRebuild` is set to `true`. Resolving to `false` will skip dependencies install or rebuild.\n *\n * If provided and `node_modules` are missing, it will not invoke production dependencies check.\n */\n readonly beforeBuild?: Hook<BeforeBuildContext, boolean | void> | string | null\n /**\n * The function (or path to file or module id) to be run when staging the electron artifact environment.\n * Returns the path to custom Electron build (e.g. `~/electron/out/R`) or folder of electron zips.\n *\n * Zip files must follow the pattern `electron-v${version}-${platformName}-${arch}.zip`, otherwise it will be assumed to be an unpacked Electron app directory\n */\n readonly electronDist?: Hook<PrepareApplicationStageDirectoryOptions, string> | string | null\n}\n\nexport interface MetadataDirectories {\n /**\n * The path to build resources.\n *\n * Please note — build resources are not packed into the app. If you need to use some files, e.g. as tray icon, please include required files explicitly: `\"files\": [\"**\\/*\", \"build/icon.*\"]`\n * @default build\n */\n readonly buildResources?: string | null\n\n /**\n * The output directory. [File macros](https://www.electron.build/file-patterns#file-macros) are supported.\n * @default dist\n */\n readonly output?: string | null\n\n /**\n * The application directory (containing the application package.json), defaults to `app`, `www` or working directory.\n */\n readonly app?: string | null\n}\n\n/**\n * All options come from [@electron/fuses](https://github.com/electron/fuses)\n * Ref: https://raw.githubusercontent.com/electron/electron/refs/heads/main/docs/tutorial/fuses.md\n */\nexport interface FuseOptionsV1 {\n /**\n *The runAsNode fuse toggles whether the `ELECTRON_RUN_AS_NODE` environment variable is respected or not. Please note that if this fuse is disabled then `process.fork` in the main process will not function as expected as it depends on this environment variable to function. Instead, we recommend that you use [Utility Processes](https://github.com/electron/electron/blob/main/docs/api/utility-process.md), which work for many use cases where you need a standalone Node.js process (like a Sqlite server process or similar scenarios).\n */\n runAsNode?: boolean\n /**\n * The cookieEncryption fuse toggles whether the cookie store on disk is encrypted using OS level cryptography keys. By default the sqlite database that Chromium uses to store cookies stores the values in plaintext. If you wish to ensure your apps cookies are encrypted in the same way Chrome does then you should enable this fuse. Please note it is a one-way transition, if you enable this fuse existing unencrypted cookies will be encrypted-on-write but if you then disable the fuse again your cookie store will effectively be corrupt and useless. Most apps can safely enable this fuse.\n */\n enableCookieEncryption?: boolean\n /**\n * The nodeOptions fuse toggles whether the [`NODE_OPTIONS`](https://nodejs.org/api/cli.html#node_optionsoptions) and [`NODE_EXTRA_CA_CERTS`](https://github.com/nodejs/node/blob/main/doc/api/cli.md#node_extra_ca_certsfile) environment variables are respected. The `NODE_OPTIONS` environment variable can be used to pass all kinds of custom options to the Node.js runtime and isn't typically used by apps in production. Most apps can safely disable this fuse.\n */\n enableNodeOptionsEnvironmentVariable?: boolean\n /**\n * The nodeCliInspect fuse toggles whether the `--inspect`, `--inspect-brk`, etc. flags are respected or not. When disabled it also ensures that `SIGUSR1` signal does not initialize the main process inspector. Most apps can safely disable this fuse.\n */\n enableNodeCliInspectArguments?: boolean\n /**\n * The embeddedAsarIntegrityValidation fuse toggles an experimental feature on macOS that validates the content of the `app.asar` file when it is loaded. This feature is designed to have a minimal performance impact but may marginally slow down file reads from inside the `app.asar` archive.\n * Currently, ASAR integrity checking is supported on:\n *\n * - macOS as of electron>=16.0.0\n * - Windows as of electron>=30.0.0\n *\n * For more information on how to use asar integrity validation please read the [Asar Integrity](https://github.com/electron/electron/blob/main/docs/tutorial/asar-integrity.md) documentation.\n */\n enableEmbeddedAsarIntegrityValidation?: boolean\n /**\n * The onlyLoadAppFromAsar fuse changes the search system that Electron uses to locate your app code. By default Electron will search in the following order `app.asar` -> `app` -> `default_app.asar`. When this fuse is enabled the search order becomes a single entry `app.asar` thus ensuring that when combined with the `embeddedAsarIntegrityValidation` fuse it is impossible to load non-validated code.\n */\n onlyLoadAppFromAsar?: boolean\n /**\n * The loadBrowserProcessSpecificV8Snapshot fuse changes which V8 snapshot file is used for the browser process. By default Electron's processes will all use the same V8 snapshot file. When this fuse is enabled the browser process uses the file called `browser_v8_context_snapshot.bin` for its V8 snapshot. The other processes will use the V8 snapshot file that they normally do.\n */\n loadBrowserProcessSpecificV8Snapshot?: boolean\n /**\n * The grantFileProtocolExtraPrivileges fuse changes whether pages loaded from the `file://` protocol are given privileges beyond what they would receive in a traditional web browser. This behavior was core to Electron apps in original versions of Electron but is no longer required as apps should be [serving local files from custom protocols](https://github.com/electron/electron/blob/main/docs/tutorial/security.md#18-avoid-usage-of-the-file-protocol-and-prefer-usage-of-custom-protocols) now instead. If you aren't serving pages from `file://` you should disable this fuse.\n * The extra privileges granted to the `file://` protocol by this fuse are incompletely documented below:\n *\n * - `file://` protocol pages can use `fetch` to load other assets over `file://`\n * - `file://` protocol pages can use service workers\n * - `file://` protocol pages have universal access granted to child frames also running on `file://` protocols regardless of sandbox settings\n */\n grantFileProtocolExtraPrivileges?: boolean\n /**\n * Resets the app signature, specifically used for macOS.\n * Note: This should be unneeded since electron-builder signs the app directly after flipping the fuses.\n * Ref: https://github.com/electron/fuses?tab=readme-ov-file#apple-silicon\n */\n resetAdHocDarwinSignature?: boolean\n}\n\nexport interface Concurrency {\n /**\n * The maximum number of concurrent jobs to run.\n * @default 1\n */\n jobs: number\n}\n"]}
|
|
1
|
+
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"","sourcesContent":["import { Arch } from \"builder-util\"\nimport { BeforeBuildContext, Target } from \"./core\"\nimport { ElectronBrandingOptions } from \"./electron/ElectronFramework\"\nimport { PrepareApplicationStageDirectoryOptions } from \"./Framework\"\nimport { AppXOptions } from \"./options/AppXOptions\"\nimport { AppImageOptions, DebOptions, FlatpakOptions, LinuxConfiguration, LinuxTargetSpecificOptions, PacmanOptions, RpmOptions } from \"./options/linuxOptions\"\nimport { DmgOptions, MacConfiguration, MasConfiguration } from \"./options/macOptions\"\nimport { MsiOptions } from \"./options/MsiOptions\"\nimport { MsiWrappedOptions } from \"./options/MsiWrappedOptions\"\nimport { PkgOptions } from \"./options/pkgOptions\"\nimport { PlatformSpecificBuildOptions } from \"./options/PlatformSpecificBuildOptions\"\nimport { SnapcraftOptions, SnapOptions } from \"./options/SnapOptions\"\nimport { SquirrelWindowsOptions } from \"./options/SquirrelWindowsOptions\"\nimport { WindowsConfiguration } from \"./options/winOptions\"\nimport { BuildResult } from \"./packager\"\nimport { ArtifactBuildStarted, ArtifactCreated } from \"./packagerApi\"\nimport { PlatformPackager } from \"./platformPackager\"\nimport { NsisOptions, NsisWebOptions, PortableOptions } from \"./targets/nsis/nsisOptions\"\nimport { ElectronDownloadOptions, ElectronGetOptions } from \"./util/electronGet\"\n\n// duplicate appId here because it is important\n/**\n * Configuration Options\n */\nexport interface CommonConfiguration {\n /**\n * The application id. Used as [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as\n * [Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.\n * @default com.electron.${name}\n */\n readonly appId?: string | null\n\n /**\n * As [name](#metadata), but allows you to specify a product name for your executable which contains spaces and other special characters not allowed in the [name property](https://docs.npmjs.com/files/package.json#name).\n * If not specified inside of the `build` configuration, `productName` property defined at the top level of `package.json` is used. If not specified at the top level of `package.json`, [name property](https://docs.npmjs.com/files/package.json#name) is used.\n */\n readonly productName?: string | null\n\n /**\n * The human-readable copyright line for the app.\n * @default Copyright © year ${author}\n */\n readonly copyright?: string | null\n\n /**\n * Directories for build resources\n */\n readonly directories?: MetadataDirectories | null\n\n /**\n * Configuration of toolsets utilized by electron-builder\n */\n readonly toolsets?: ToolsetConfig | null\n\n /**\n * Options related to how build macOS targets.\n */\n readonly mac?: MacConfiguration | null\n /**\n * MAS (Mac Application Store) options.\n */\n readonly mas?: MasConfiguration | null\n /**\n * MAS (Mac Application Store) development options (`mas-dev` target).\n */\n readonly masDev?: MasConfiguration | null\n /**\n * macOS DMG options.\n */\n readonly dmg?: DmgOptions | null\n /**\n * macOS PKG options.\n */\n readonly pkg?: PkgOptions | null\n\n /**\n * Options related to how build Windows targets.\n */\n readonly win?: WindowsConfiguration | null\n /** NSIS installer options. */\n readonly nsis?: NsisOptions | null\n /** NSIS web installer options (downloads app package at install time). */\n readonly nsisWeb?: NsisWebOptions | null\n /** Portable executable options (no installation required). */\n readonly portable?: PortableOptions | null\n /** Windows Store (AppX) package options. */\n readonly appx?: AppXOptions | null\n /**\n * MSI package options.\n */\n readonly msi?: MsiOptions | null\n /**\n * MSI-wrapped installer options.\n */\n readonly msiWrapped?: MsiWrappedOptions | null\n /**\n * Squirrel.Windows installer options. Requires the `electron-builder-squirrel-windows` dependency.\n */\n readonly squirrelWindows?: SquirrelWindowsOptions | null\n /**\n * General Linux build options shared across all Linux targets (icon, category, desktop entry,\n * executable name, etc.). Target-specific compression and packaging options live in the\n * per-format interfaces (`DebOptions`, `RpmOptions`, `PacmanOptions`, etc.).\n */\n readonly linux?: LinuxConfiguration | null\n /**\n * Debian package options. Targets Debian, Ubuntu, and Debian-based distributions.\n * Produces a `.deb` archive installable via `dpkg -i` or `apt install`.\n */\n readonly deb?: DebOptions | null\n /**\n * Flat snap configuration targeting core22 and older snap bases.\n *\n * @deprecated Use `snapcraft` instead — it supersedes `snap` when both are present and supports\n * all snap bases including core24. `snap` will be removed in a future major release.\n * See {@link SnapOptions} for available properties.\n */\n readonly snap?: SnapOptions | null\n /**\n * Snapcraft configuration. Prefer this over the deprecated `snap` field.\n *\n * Selects the snapcraft base and provides per-core options:\n * - `base: \"core18\" | \"core20\" | \"core22\"` — legacy builds; accepts the same options as `snap`\n * - `base: \"core24\"` — modern builds with the GNOME extension (recommended for new apps, requires Electron 25+)\n * - `base: \"custom\"` — pass an existing `snapcraft.yaml` through unchanged; no plugs, extensions,\n * or desktop files are injected\n *\n * When both `snapcraft` and `snap` are set, `snapcraft` takes precedence.\n *\n * @example\n * ```json\n * { \"snapcraft\": { \"base\": \"core24\", \"core24\": { \"useLXD\": true } } }\n * ```\n *\n * See {@link SnapcraftOptions} for all available properties.\n */\n readonly snapcraft?: SnapcraftOptions | null\n /**\n * AppImage options. AppImage is a portable application format that bundles the app\n * and its dependencies into a single self-contained executable that runs on most\n * Linux distributions without installation.\n */\n readonly appImage?: AppImageOptions | null\n /**\n * Flatpak options. Flatpak is a sandboxed application distribution format for Linux\n * that runs in a controlled environment and is distributed via [Flathub](https://flathub.org/)\n * or other Flatpak repositories.\n */\n readonly flatpak?: FlatpakOptions | null\n /**\n * Pacman package options. Targets Arch Linux and Arch-based distributions\n * (Manjaro, EndeavourOS, etc.). Produces a `.pacman` archive installable via `pacman -U`.\n */\n readonly pacman?: PacmanOptions | null\n /**\n * RPM package options. Targets Fedora, Red Hat Enterprise Linux, SUSE, and related\n * distributions. Produces a `.rpm` archive installable via `rpm` or `dnf`.\n */\n readonly rpm?: RpmOptions | null\n /**\n * FreeBSD package options. Produces a `.pkg` archive for the FreeBSD `pkg` package manager.\n */\n readonly freebsd?: LinuxTargetSpecificOptions | null\n /**\n * Solaris IPS package options. Produces a `.p5p` archive for the Solaris Image Packaging\n * System (`pkg`).\n */\n readonly p5p?: LinuxTargetSpecificOptions | null\n /**\n * Alpine Linux APK package options. Produces an `.apk` archive installable via `apk add`.\n */\n readonly apk?: LinuxTargetSpecificOptions | null\n\n /**\n * Whether to build the application native dependencies from source.\n * @default false\n */\n buildDependenciesFromSource?: boolean\n /**\n * Whether to execute `node-gyp rebuild` before starting to package the app.\n *\n * Don't [use](https://github.com/electron-userland/electron-builder/issues/683#issuecomment-241214075) [npm](http://electron.atom.io/docs/tutorial/using-native-node-modules/#using-npm) (neither `.npmrc`) for configuring electron headers. Use `electron-builder node-gyp-rebuild` instead.\n * @default false\n */\n readonly nodeGypRebuild?: boolean\n /**\n * Additional command line arguments to use when installing app native deps.\n */\n readonly npmArgs?: Array<string> | string | null\n /**\n * Whether to [rebuild](https://docs.npmjs.com/cli/rebuild) native dependencies before starting to package the app.\n * @default true\n */\n readonly npmRebuild?: boolean\n /**\n * Use `legacy` app-builder binary for installing native dependencies, or `@electron/rebuild` in `sequential` or `parallel` compilation modes.\n * @default sequential\n */\n readonly nativeRebuilder?: \"legacy\" | \"sequential\" | \"parallel\" | null\n\n /**\n * Whether production dependencies that cannot be resolved during node-module collection are\n * allowed — i.e. whether the build should continue with a warning instead of failing.\n *\n * During collection every production dependency must resolve to an installed package on disk. A\n * dependency that does not resolve (`cannot find path for dependency` / `dependency not found on\n * disk`) is not bundled, which typically breaks the packaged app at runtime with\n * `MODULE_NOT_FOUND`.\n *\n * - `true` (or omitted — the v26 default): missing production dependencies are only logged as\n * warnings, keeping the historical behavior of the stable 26.x line. (electron-builder 27+\n * defaults to `false` and fails the build instead.)\n * - `false` or `null`: the build fails after dependency collection completes, reporting the\n * **complete** list of missing production dependencies at once.\n * - `string[]`: the listed dependency names are allowed to be missing; any other missing\n * production dependency fails the build. Entries match the package name of the reported\n * `name@version` entry (e.g. `some-native-module`, `@scope/pkg`), or an exact `name@version`\n * string to allow only that resolved version to be missing.\n *\n * Missing *optional* dependencies (declared in `optionalDependencies`, e.g. `fsevents` on\n * Linux/Windows, or platform-specific packages) are always allowed and never fail the build.\n *\n * @default true\n */\n readonly allowMissingDependencies?: boolean | Array<string> | null\n\n /**\n * The build number. Maps to the `--iteration` flag for builds using FPM on Linux.\n * If not defined, then it will fallback to `BUILD_NUMBER` or `TRAVIS_BUILD_NUMBER` or `APPVEYOR_BUILD_NUMBER` or `CIRCLE_BUILD_NUM` or `BUILD_BUILDNUMBER` or `CI_PIPELINE_IID` env.\n */\n readonly buildNumber?: string | null\n\n /**\n * The build version. Maps to the `CFBundleVersion` on macOS, and `FileVersion` metadata property on Windows. Defaults to the `version`.\n * If `buildVersion` is not defined and `buildNumber` (or one of the `buildNumber` envs) is defined, it will be used as a build version (`version.buildNumber`).\n */\n readonly buildVersion?: string | null\n\n /**\n * Whether to download the alternate FFmpeg library from Electron's release assets and replace the default FFmpeg library prior to signing\n */\n readonly downloadAlternateFFmpeg?: boolean\n\n /**\n * Inject properties to `package.json`.\n */\n readonly extraMetadata?: any\n\n /**\n * Whether to fail if the application is not signed (to prevent unsigned app if code signing configuration is not correct).\n * @default false\n */\n readonly forceCodeSigning?: boolean\n\n /**\n * Whether to include PDB files.\n * @default false\n */\n readonly includePdb?: boolean\n\n /**\n * Whether to remove `scripts` field from `package.json` files.\n *\n * @default true\n */\n readonly removePackageScripts?: boolean\n\n /**\n * Whether to remove `keywords` field from `package.json` files.\n *\n * @default true\n */\n readonly removePackageKeywords?: boolean\n\n /**\n * Options to pass to `@electron/fuses`\n * Ref: https://github.com/electron/fuses\n */\n readonly electronFuses?: FuseOptionsV1 | null\n\n /**\n * [Experimental] Configuration for concurrent builds.\n */\n readonly concurrency?: Concurrency | null\n}\n\nexport interface Configuration extends CommonConfiguration, PlatformSpecificBuildOptions, Hooks {\n /**\n * Whether to use [electron-compile](http://github.com/electron/electron-compile) to compile app. Defaults to `true` if `electron-compile` in the dependencies. And `false` if in the `devDependencies` or doesn't specified.\n * @deprecated `electron-compile` is no longer maintained. Compile your app with a modern bundler (webpack, vite, etc.) instead.\n */\n readonly electronCompile?: boolean\n\n /**\n * The [electron-download](https://github.com/electron-userland/electron-download#usage) options. (legacy)\n * Alternatively, you can use [electron/get](https://github.com/electron/get#usage) options.\n *\n * `checksums` (a map of artifact file name → SHA-256 hex) makes checksum validation fully offline —\n * without it, `@electron/get` fetches `SHASUMS256.txt` from the network on every build, even when the\n * artifact itself is already cached. When `checksums` is not configured, electron-builder automatically\n * picks up a locally seeded `SHASUMS256.txt-<version>` (or `SHASUMS256.txt`) file at the root of the\n * Electron cache directory. See the\n * [air-gapped / offline builds guide](https://www.electron.build/tutorials/offline-air-gapped-builds).\n */\n readonly electronDownload?: ElectronDownloadOptions | ElectronGetOptions | null\n\n /**\n * The branding used by Electron's distributables. This is needed if a fork has modified Electron's BRANDING.json file.\n */\n readonly electronBranding?: ElectronBrandingOptions\n\n /**\n * The version of electron you are packaging for. Defaults to version of `electron`, `electron-prebuilt` or `electron-prebuilt-compile` dependency.\n */\n electronVersion?: string | null\n\n /**\n * The name of a built-in configuration preset (currently, only `react-cra` is supported) or any number of paths to config files (relative to project dir).\n *\n * The latter allows to mixin a config from multiple other configs, as if you `Object.assign` them, but properly combine `files` glob patterns.\n *\n * If `react-scripts` in the app dependencies, `react-cra` will be set automatically. Set to `null` to disable automatic detection.\n */\n extends?: Array<string> | string | null\n\n /**\n * *libui-based frameworks only* The version of NodeJS you are packaging for.\n * You can set it to `current` to set the Node.js version that you use to run.\n * @deprecated libui-based frameworks (proton-native, etc.) are no longer actively maintained. This option has no effect when using Electron.\n */\n readonly nodeVersion?: string | null\n\n /**\n * *libui-based frameworks only* The version of LaunchUI you are packaging for. Applicable for Windows only. Defaults to version suitable for used framework version.\n * @deprecated libui-based frameworks (proton-native, etc.) are no longer actively maintained. This option has no effect when using Electron.\n */\n readonly launchUiVersion?: boolean | string | null\n\n /**\n * The framework name. One of `electron`, `proton`, `libui`. Defaults to `electron`.\n * @deprecated `proton` and `libui` framework support is no longer actively maintained. Use `electron` (the default).\n */\n readonly framework?: string | null\n\n /**\n * Whether to disable sanity check asar package (useful for custom electron forks that implement their own encrypted integrity validation)\n * @default false\n */\n readonly disableSanityCheckAsar?: boolean\n\n /**\n * Whether to skip ASAR integrity hash computation. Useful for custom electron forks with encrypted ASAR support where the header is not readable by standard tools.\n * @default false\n */\n readonly disableAsarIntegrity?: boolean\n}\n\nexport type Hook<T, V> = (contextOrPath: T) => Promise<V> | V\n\nexport interface PackContext {\n readonly outDir: string\n readonly appOutDir: string\n readonly packager: PlatformPackager<any>\n readonly electronPlatformName: string\n readonly arch: Arch\n readonly targets: Array<Target>\n}\nexport type AfterPackContext = PackContext\nexport type BeforePackContext = PackContext\nexport type AfterExtractContext = PackContext\n\n/**\n * Configuration of toolsets utilized by electron-builder\n */\nexport interface ToolsetConfig {\n /**\n * `win-codesign` version to use for signing Windows artifacts.\n * Located at https://github.com/electron-userland/electron-builder-binaries/releases?q=win-codesign&expanded=true\n *\n * Stable:\n * v0.0.0 (winCodeSign)\n *\n * Beta:\n * Windows Kits 10.0.26100.0\n * v1.0.0, v1.1.0\n *\n * @default \"0.0.0\"\n */\n readonly winCodeSign?: \"0.0.0\" | \"1.0.0\" | \"1.1.0\" | null\n\n /**\n * `appimage` bundle version to use for Appimage packaging and runtime.\n * Located at https://github.com/electron-userland/electron-builder-binaries/releases?q=appimage&expanded=true\n * 0.0.0 - legacy toolset (appimage)\n *\n * Betas:\n * 1.0.2 - Runtime 20251108\n * 1.0.3 - Runtime 20251108 (Resolves GH issue #9598)\n *\n * @default \"0.0.0\"\n */\n readonly appimage?: \"0.0.0\" | \"1.0.2\" | \"1.0.3\" | null\n\n /**\n * `nsis` bundle version to use for NSIS installer compilation.\n * Located at https://github.com/electron-userland/electron-builder-binaries/releases?q=nsis&expanded=true\n * 0.0.0 - legacy toolset (nsis-3.0.4.1 + nsis-resources-3.4.1)\n *\n * Betas:\n * 1.2.1 - unified bundle (makensis 3.12 + plugins in one archive, entrypoint scripts auto-set NSISDIR)\n *\n * @default \"0.0.0\"\n */\n readonly nsis?: \"0.0.0\" | \"1.2.1\" | null\n\n /**\n * `wine` bundle version to use for running Windows tools on non-Windows platforms.\n * Located at https://github.com/electron-userland/electron-builder-binaries/releases?q=wine&expanded=true\n * 0.0.0 - legacy toolset (wine 4.0.1 portable; mac-only support)\n *\n * Beta:\n * 1.0.1 - Wine 11 bundle (unified wine binary, ia32 via WoW64)\n *\n * @default \"0.0.0\"\n */\n readonly wine?: \"0.0.0\" | \"1.0.1\" | null\n}\n\nexport interface Hooks {\n /**\n * The function (or path to file or module id) to be run before pack.\n * Receives a {@link BeforePackContext}.\n *\n * Can be specified inline as a function in JavaScript configs:\n * ```js\n * // electron-builder.config.js\n * module.exports = {\n * beforePack: async (context) => {\n * // your code\n * }\n * }\n * ```\n *\n * Or as a path to a module that exports the function as its default export:\n * ```json\n * { \"build\": { \"beforePack\": \"./myBeforePackHook.js\" } }\n * ```\n * ```js\n * // myBeforePackHook.js\n * exports.default = async function(context) {\n * // your custom code\n * }\n * ```\n */\n readonly beforePack?: Hook<BeforePackContext, void> | string | null\n\n /**\n * The function (or path to file or module id) to be run after the prebuilt Electron binary has been extracted to the output directory.\n * Receives an {@link AfterExtractContext}. For file/module setup, see {@link beforePack}.\n */\n readonly afterExtract?: Hook<AfterExtractContext, void> | string | null\n\n /**\n * The function (or path to file or module id) to be run after pack but before pack into distributable format and sign.\n * Receives an {@link AfterPackContext}. For file/module setup, see {@link beforePack}.\n */\n readonly afterPack?: Hook<AfterPackContext, void> | string | null\n\n /**\n * The function (or path to file or module id) to be run after pack and sign but before pack into distributable format.\n * Receives an {@link AfterPackContext}. For file/module setup, see {@link beforePack}.\n */\n readonly afterSign?: Hook<AfterPackContext, void> | string | null\n\n /**\n * The function (or path to file or module id) to be run when an individual artifact build starts.\n * Receives an {@link ArtifactBuildStarted}. For file/module setup, see {@link beforePack}.\n */\n readonly artifactBuildStarted?: Hook<ArtifactBuildStarted, void> | string | null\n /**\n * The function (or path to file or module id) to be run when an individual artifact build completes.\n * Receives an {@link ArtifactCreated}. For file/module setup, see {@link beforePack}.\n */\n readonly artifactBuildCompleted?: Hook<ArtifactCreated, void> | string | null\n /**\n * The function (or path to file or module id) to be run after all artifacts are built.\n * Receives a {@link BuildResult}. May return an array of additional file paths to publish.\n *\n * For file/module setup, see {@link beforePack}.\n *\n * @example\n * ```js\n * exports.default = function () {\n * // return additional files to publish\n * return [\"/path/to/additional/result/file\"]\n * }\n * ```\n */\n readonly afterAllArtifactBuild?: Hook<BuildResult, Array<string>> | string | null\n /**\n * The function (or path to file or module id) to be run after MSI project created on disk - not packed into .msi package yet.\n */\n readonly msiProjectCreated?: Hook<string, void> | string | null\n /**\n * The function (or path to file or module id) to be run after Appx manifest created on disk - not packed into .appx package yet.\n */\n readonly appxManifestCreated?: Hook<string, void> | string | null\n /**\n * The function (or path to file or module id) to be [run on each node module](#onnodemodulefile) file. Returning `true`/`false` will determine whether to force include or to use the default copier logic\n */\n readonly onNodeModuleFile?: Hook<string, void | boolean> | string | null\n /**\n * The function (or path to file or module id) to be run before dependencies are installed or rebuilt. Works when `npmRebuild` is set to `true`. Resolving to `false` will skip dependencies install or rebuild.\n *\n * If provided and `node_modules` are missing, it will not invoke production dependencies check.\n */\n readonly beforeBuild?: Hook<BeforeBuildContext, boolean | void> | string | null\n /**\n * The function (or path to file or module id) to be run when staging the electron artifact environment.\n * Returns the path to custom Electron build (e.g. `~/electron/out/R`) or folder of electron zips.\n *\n * Zip files must follow the pattern `electron-v${version}-${platformName}-${arch}.zip`, otherwise it will be assumed to be an unpacked Electron app directory\n */\n readonly electronDist?: Hook<PrepareApplicationStageDirectoryOptions, string> | string | null\n}\n\nexport interface MetadataDirectories {\n /**\n * The path to build resources.\n *\n * Please note — build resources are not packed into the app. If you need to use some files, e.g. as tray icon, please include required files explicitly: `\"files\": [\"**\\/*\", \"build/icon.*\"]`\n * @default build\n */\n readonly buildResources?: string | null\n\n /**\n * The output directory. [File macros](https://www.electron.build/file-patterns#file-macros) are supported.\n * @default dist\n */\n readonly output?: string | null\n\n /**\n * The application directory (containing the application package.json), defaults to `app`, `www` or working directory.\n */\n readonly app?: string | null\n}\n\n/**\n * All options come from [@electron/fuses](https://github.com/electron/fuses)\n * Ref: https://raw.githubusercontent.com/electron/electron/refs/heads/main/docs/tutorial/fuses.md\n */\nexport interface FuseOptionsV1 {\n /**\n *The runAsNode fuse toggles whether the `ELECTRON_RUN_AS_NODE` environment variable is respected or not. Please note that if this fuse is disabled then `process.fork` in the main process will not function as expected as it depends on this environment variable to function. Instead, we recommend that you use [Utility Processes](https://github.com/electron/electron/blob/main/docs/api/utility-process.md), which work for many use cases where you need a standalone Node.js process (like a Sqlite server process or similar scenarios).\n */\n runAsNode?: boolean\n /**\n * The cookieEncryption fuse toggles whether the cookie store on disk is encrypted using OS level cryptography keys. By default the sqlite database that Chromium uses to store cookies stores the values in plaintext. If you wish to ensure your apps cookies are encrypted in the same way Chrome does then you should enable this fuse. Please note it is a one-way transition, if you enable this fuse existing unencrypted cookies will be encrypted-on-write but if you then disable the fuse again your cookie store will effectively be corrupt and useless. Most apps can safely enable this fuse.\n */\n enableCookieEncryption?: boolean\n /**\n * The nodeOptions fuse toggles whether the [`NODE_OPTIONS`](https://nodejs.org/api/cli.html#node_optionsoptions) and [`NODE_EXTRA_CA_CERTS`](https://github.com/nodejs/node/blob/main/doc/api/cli.md#node_extra_ca_certsfile) environment variables are respected. The `NODE_OPTIONS` environment variable can be used to pass all kinds of custom options to the Node.js runtime and isn't typically used by apps in production. Most apps can safely disable this fuse.\n */\n enableNodeOptionsEnvironmentVariable?: boolean\n /**\n * The nodeCliInspect fuse toggles whether the `--inspect`, `--inspect-brk`, etc. flags are respected or not. When disabled it also ensures that `SIGUSR1` signal does not initialize the main process inspector. Most apps can safely disable this fuse.\n */\n enableNodeCliInspectArguments?: boolean\n /**\n * The embeddedAsarIntegrityValidation fuse toggles an experimental feature on macOS that validates the content of the `app.asar` file when it is loaded. This feature is designed to have a minimal performance impact but may marginally slow down file reads from inside the `app.asar` archive.\n * Currently, ASAR integrity checking is supported on:\n *\n * - macOS as of electron>=16.0.0\n * - Windows as of electron>=30.0.0\n *\n * For more information on how to use asar integrity validation please read the [Asar Integrity](https://github.com/electron/electron/blob/main/docs/tutorial/asar-integrity.md) documentation.\n */\n enableEmbeddedAsarIntegrityValidation?: boolean\n /**\n * The onlyLoadAppFromAsar fuse changes the search system that Electron uses to locate your app code. By default Electron will search in the following order `app.asar` -> `app` -> `default_app.asar`. When this fuse is enabled the search order becomes a single entry `app.asar` thus ensuring that when combined with the `embeddedAsarIntegrityValidation` fuse it is impossible to load non-validated code.\n */\n onlyLoadAppFromAsar?: boolean\n /**\n * The loadBrowserProcessSpecificV8Snapshot fuse changes which V8 snapshot file is used for the browser process. By default Electron's processes will all use the same V8 snapshot file. When this fuse is enabled the browser process uses the file called `browser_v8_context_snapshot.bin` for its V8 snapshot. The other processes will use the V8 snapshot file that they normally do.\n */\n loadBrowserProcessSpecificV8Snapshot?: boolean\n /**\n * The grantFileProtocolExtraPrivileges fuse changes whether pages loaded from the `file://` protocol are given privileges beyond what they would receive in a traditional web browser. This behavior was core to Electron apps in original versions of Electron but is no longer required as apps should be [serving local files from custom protocols](https://github.com/electron/electron/blob/main/docs/tutorial/security.md#18-avoid-usage-of-the-file-protocol-and-prefer-usage-of-custom-protocols) now instead. If you aren't serving pages from `file://` you should disable this fuse.\n * The extra privileges granted to the `file://` protocol by this fuse are incompletely documented below:\n *\n * - `file://` protocol pages can use `fetch` to load other assets over `file://`\n * - `file://` protocol pages can use service workers\n * - `file://` protocol pages have universal access granted to child frames also running on `file://` protocols regardless of sandbox settings\n */\n grantFileProtocolExtraPrivileges?: boolean\n /**\n * Resets the app signature, specifically used for macOS.\n * Note: This should be unneeded since electron-builder signs the app directly after flipping the fuses.\n * Ref: https://github.com/electron/fuses?tab=readme-ov-file#apple-silicon\n */\n resetAdHocDarwinSignature?: boolean\n}\n\nexport interface Concurrency {\n /**\n * The maximum number of concurrent jobs to run.\n * @default 1\n */\n jobs: number\n}\n"]}
|
package/out/macPackager.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { AppInfo } from "./appInfo";
|
|
|
6
6
|
import { CodeSigningInfo, CreateKeychainOptions } from "./codeSign/macCodeSign";
|
|
7
7
|
import { Target } from "./core";
|
|
8
8
|
import { AfterPackContext } from "./index";
|
|
9
|
-
import { MacTargetHelper } from "./mac/MacTargetHelper";
|
|
9
|
+
import { MacTargetHelper, PlatformType } from "./mac/MacTargetHelper";
|
|
10
10
|
import { MacConfiguration, MasConfiguration } from "./options/macOptions";
|
|
11
11
|
import { Packager } from "./packager";
|
|
12
12
|
import { DoPackOptions, PlatformPackager } from "./platformPackager";
|
|
@@ -35,7 +35,12 @@ export declare class MacPackager extends PlatformPackager<MacConfiguration | Mas
|
|
|
35
35
|
pack(outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): Promise<void>;
|
|
36
36
|
private packMasTargets;
|
|
37
37
|
private packMacTargets;
|
|
38
|
-
|
|
38
|
+
protected signMas(appPath: string, arch: Arch, targetPlatform: PlatformType): Promise<boolean>;
|
|
39
|
+
/**
|
|
40
|
+
* Creates the signed MAS installer .pkg for an already codesigned app. Kept separate from `sign()`
|
|
41
|
+
* so that the `afterSign` hook can run between codesigning and installer creation (see `packMasTargets`).
|
|
42
|
+
*/
|
|
43
|
+
protected createMasInstaller(appPath: string, outDir: string, arch: Arch, targetPlatform: PlatformType): Promise<void>;
|
|
39
44
|
/**
|
|
40
45
|
* Main signing method with platform awareness
|
|
41
46
|
*/
|
package/out/macPackager.js
CHANGED
|
@@ -247,6 +247,7 @@ class MacPackager extends platformPackager_1.PlatformPackager {
|
|
|
247
247
|
if (relativeTargetOutDir.startsWith("..") || path.isAbsolute(relativeTargetOutDir)) {
|
|
248
248
|
throw new builder_util_1.InvalidConfigurationError(`Invalid target output directory: ${targetOutDir}`);
|
|
249
249
|
}
|
|
250
|
+
let appPath;
|
|
250
251
|
if (prepackaged == null) {
|
|
251
252
|
await this.doPack({
|
|
252
253
|
outDir: resolvedOutDir,
|
|
@@ -258,10 +259,32 @@ class MacPackager extends platformPackager_1.PlatformPackager {
|
|
|
258
259
|
options: { sign: false },
|
|
259
260
|
});
|
|
260
261
|
MacTargetHelper_1.MacTargetHelper.assertSafePathForCommandUsage(this.appInfo.productFilename, "product filename");
|
|
261
|
-
|
|
262
|
+
appPath = path.resolve(targetOutDir, `${path.basename(this.appInfo.productFilename)}.app`);
|
|
262
263
|
}
|
|
263
264
|
else {
|
|
264
|
-
|
|
265
|
+
appPath = prepackaged;
|
|
266
|
+
}
|
|
267
|
+
const signed = await this.signMas(appPath, arch, platformType);
|
|
268
|
+
// The MAS flow packs with sign:false and signs here, bypassing doSignAfterPack — the only other
|
|
269
|
+
// emitAfterSign site. Mirror its contract: fire afterSign after codesigning succeeded, but before
|
|
270
|
+
// the .pkg installer is built, and warn when signing was skipped (#9997).
|
|
271
|
+
const packContext = {
|
|
272
|
+
appOutDir: path.dirname(appPath),
|
|
273
|
+
outDir: resolvedOutDir,
|
|
274
|
+
arch,
|
|
275
|
+
targets: [target],
|
|
276
|
+
packager: this,
|
|
277
|
+
electronPlatformName: platformConfig.platformName,
|
|
278
|
+
};
|
|
279
|
+
if (signed) {
|
|
280
|
+
await this.info.emitAfterSign(packContext);
|
|
281
|
+
}
|
|
282
|
+
else if (this.info.filterPackagerEventListeners("afterSign", "user").length) {
|
|
283
|
+
builder_util_1.log.warn(null, `skipping "afterSign" hook as no signing occurred, perhaps you intended "afterPack"?`);
|
|
284
|
+
}
|
|
285
|
+
// development-signed builds (mas-dev) produce no installer
|
|
286
|
+
if (signed && (platformConfig.config.type || "distribution") !== "development") {
|
|
287
|
+
await this.createMasInstaller(appPath, targetOutDir, arch, platformType);
|
|
265
288
|
}
|
|
266
289
|
}
|
|
267
290
|
}
|
|
@@ -280,14 +303,24 @@ class MacPackager extends platformPackager_1.PlatformPackager {
|
|
|
280
303
|
}
|
|
281
304
|
this.packageInDistributableFormat(appPath, arch, targets, taskManager);
|
|
282
305
|
}
|
|
283
|
-
async signMas(appPath,
|
|
284
|
-
const
|
|
285
|
-
return
|
|
306
|
+
async signMas(appPath, arch, targetPlatform) {
|
|
307
|
+
const platformConfig = this.getPlatformConfig(targetPlatform);
|
|
308
|
+
return await this.sign(appPath, platformConfig.config, arch, true);
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Creates the signed MAS installer .pkg for an already codesigned app. Kept separate from `sign()`
|
|
312
|
+
* so that the `afterSign` hook can run between codesigning and installer creation (see `packMasTargets`).
|
|
313
|
+
*/
|
|
314
|
+
async createMasInstaller(appPath, outDir, arch, targetPlatform) {
|
|
315
|
+
const config = this.getPlatformConfig(targetPlatform).config;
|
|
316
|
+
const keychainFile = (await this.codeSigningInfo.value).keychainFile;
|
|
317
|
+
const isDevelopment = (config.type || "distribution") === "development";
|
|
318
|
+
await this.helper.createMasInstaller(appPath, outDir, config, keychainFile, isDevelopment, arch);
|
|
286
319
|
}
|
|
287
320
|
/**
|
|
288
321
|
* Main signing method with platform awareness
|
|
289
322
|
*/
|
|
290
|
-
async sign(appPath,
|
|
323
|
+
async sign(appPath, options, arch, isMas = false) {
|
|
291
324
|
if (!(0, macCodeSign_1.isSignAllowed)()) {
|
|
292
325
|
return false;
|
|
293
326
|
}
|
|
@@ -309,10 +342,6 @@ class MacPackager extends platformPackager_1.PlatformPackager {
|
|
|
309
342
|
}
|
|
310
343
|
const signOptions = await this.helper.buildSignOptions(appPath, identity, type, isMas, config, keychainFile, arch);
|
|
311
344
|
await this.doSign(signOptions, config, identity);
|
|
312
|
-
// Handle MAS installer creation
|
|
313
|
-
if (isMas && !isDevelopment && outDir) {
|
|
314
|
-
await this.helper.createMasInstaller(appPath, outDir, config, keychainFile, isDevelopment, arch);
|
|
315
|
-
}
|
|
316
345
|
// Handle notarization for non-MAS builds
|
|
317
346
|
if (!isMas) {
|
|
318
347
|
await this.helper.notarizeIfProvided(appPath);
|
|
@@ -426,7 +455,7 @@ class MacPackager extends platformPackager_1.PlatformPackager {
|
|
|
426
455
|
}
|
|
427
456
|
const signTarget = path.resolve(normalizedSourceDirectory, entryName);
|
|
428
457
|
const safeSignTarget = (0, builder_util_1.sanitizeDirPath)(signTarget, normalizedSourceDirectory);
|
|
429
|
-
await this.sign(safeSignTarget,
|
|
458
|
+
await this.sign(safeSignTarget, isMas ? activeConfig : null, packContext.arch, isMas);
|
|
430
459
|
}
|
|
431
460
|
}));
|
|
432
461
|
return true;
|
package/out/macPackager.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,EAAE,IAAA,gCAAa,EAAC,IAAI,CAAC,4BAA4B,CAAC,uBAAuB,EAAE,OAAO,CAAC,GAAG,CAA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,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AA7fD,kCA6fC","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\n if (qualifier === null) {\n return this.helper.handleNullIdentity()\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)\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"]}
|
|
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,EAAE,IAAA,gCAAa,EAAC,IAAI,CAAC,4BAA4B,CAAC,uBAAuB,EAAE,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC;gBACjI,UAAU,EAAE,IAAI,CAAC,UAAU;aAC5B,CAAA;YAED,OAAO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AC,OAAO,CAAC,yBAAyB,EAAE,SAAS,CAAC,CAAA;oBACrE,MAAM,cAAc,GAAG,IAAA,8BAAe,EAAC,UAAU,EAAE,yBAAyB,CAAC,CAAA;oBAC7E,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;gBACvF,CAAC;YACH,CAAC,CAAC,CACH,CAAA;YACD,OAAO,IAAI,CAAA;QACb,CAAC,CAAA;QAED,MAAM,WAAW,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,MAAM,CAAA;QACzD,MAAM,oBAAoB,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,IAAA,kBAAO,EAAC,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,WAAW,CAAC,CAAA;QACrH,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,IAAI,CAAA;QACb,CAAC;QAED,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,WAAW,EAAE,mBAAmB,CAAC,CAAA;QAC1F,MAAM,oBAAoB,CAAC,eAAe,EAAE,MAAM,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;AA3hBD,kCA2hBC","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 let appPath: string\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 appPath = path.resolve(targetOutDir, `${path.basename(this.appInfo.productFilename)}.app`)\n } else {\n appPath = prepackaged\n }\n const signed = await this.signMas(appPath, arch, platformType)\n\n // The MAS flow packs with sign:false and signs here, bypassing doSignAfterPack — the only other\n // emitAfterSign site. Mirror its contract: fire afterSign after codesigning succeeded, but before\n // the .pkg installer is built, and warn when signing was skipped (#9997).\n const packContext: AfterPackContext = {\n appOutDir: path.dirname(appPath),\n outDir: resolvedOutDir,\n arch,\n targets: [target],\n packager: this,\n electronPlatformName: platformConfig.platformName,\n }\n if (signed) {\n await this.info.emitAfterSign(packContext)\n } else if (this.info.filterPackagerEventListeners(\"afterSign\", \"user\").length) {\n log.warn(null, `skipping \"afterSign\" hook as no signing occurred, perhaps you intended \"afterPack\"?`)\n }\n\n // development-signed builds (mas-dev) produce no installer\n if (signed && (platformConfig.config.type || \"distribution\") !== \"development\") {\n await this.createMasInstaller(appPath, targetOutDir, arch, platformType)\n }\n }\n }\n\n private async packMacTargets(outDir: string, arch: Arch, targets: Array<Target>, prepackaged: string | null | undefined, taskManager: AsyncTaskManager): Promise<void> {\n const appPath = prepackaged == null ? path.join(this.computeAppOutDir(outDir, arch), `${path.basename(this.appInfo.productFilename)}.app`) : prepackaged\n\n if (prepackaged == null) {\n const platformConfig = this.getPlatformConfig(\"mac\")\n await this.doPack({\n outDir,\n appOutDir: path.dirname(appPath),\n platformName: platformConfig.platformName,\n arch,\n platformSpecificBuildOptions: platformConfig.config,\n targets,\n })\n }\n\n this.packageInDistributableFormat(appPath, arch, targets, taskManager)\n }\n\n protected async signMas(appPath: string, arch: Arch, targetPlatform: PlatformType): Promise<boolean> {\n const platformConfig = this.getPlatformConfig(targetPlatform)\n return await this.sign(appPath, platformConfig.config as MasConfiguration, arch, true)\n }\n\n /**\n * Creates the signed MAS installer .pkg for an already codesigned app. Kept separate from `sign()`\n * so that the `afterSign` hook can run between codesigning and installer creation (see `packMasTargets`).\n */\n protected async createMasInstaller(appPath: string, outDir: string, arch: Arch, targetPlatform: PlatformType): Promise<void> {\n const config = this.getPlatformConfig(targetPlatform).config as MasConfiguration\n const keychainFile = (await this.codeSigningInfo.value).keychainFile\n const isDevelopment = (config.type || \"distribution\") === \"development\"\n await this.helper.createMasInstaller(appPath, outDir, config, keychainFile, isDevelopment, arch)\n }\n\n /**\n * Main signing method with platform awareness\n */\n private async sign(appPath: string, 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\n if (qualifier === null) {\n return this.helper.handleNullIdentity()\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)\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 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, 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"]}
|
|
@@ -97,7 +97,17 @@ export declare abstract class NodeModulesCollector<ProdDepType extends Dependenc
|
|
|
97
97
|
protected getTreeFromWorkspaces(tree: ProdDepType, packageName: string): ProdDepType;
|
|
98
98
|
private transformToHoisterTree;
|
|
99
99
|
private _getNodeModules;
|
|
100
|
-
|
|
100
|
+
/**
|
|
101
|
+
* Records a dependency that could not be resolved on disk in the log summary.
|
|
102
|
+
*
|
|
103
|
+
* A platform-specific package name (e.g. `sass-embedded-linux-x64`) is always classified as a
|
|
104
|
+
* platform-specific optional dependency. Otherwise, `isDeclaredOptional` decides the bucket: a
|
|
105
|
+
* caller that *knows* the dependency was declared in `optionalDependencies` (e.g. the pnpm
|
|
106
|
+
* collector's optional-dependency check) reports a missing *optional* dependency — an expected
|
|
107
|
+
* condition — rather than the `PKG_NOT_ON_DISK` warning reserved for genuinely missing
|
|
108
|
+
* production dependencies.
|
|
109
|
+
*/
|
|
110
|
+
protected logMissingDependency(pkgName: string, isDeclaredOptional?: boolean): void;
|
|
101
111
|
protected asyncExec(command: string, args: string[], cwd?: string): Promise<{
|
|
102
112
|
stdout: string | undefined;
|
|
103
113
|
stderr: string | undefined;
|
|
@@ -277,9 +277,23 @@ class NodeModulesCollector {
|
|
|
277
277
|
}
|
|
278
278
|
result.sort((a, b) => a.name.localeCompare(b.name));
|
|
279
279
|
}
|
|
280
|
-
|
|
280
|
+
/**
|
|
281
|
+
* Records a dependency that could not be resolved on disk in the log summary.
|
|
282
|
+
*
|
|
283
|
+
* A platform-specific package name (e.g. `sass-embedded-linux-x64`) is always classified as a
|
|
284
|
+
* platform-specific optional dependency. Otherwise, `isDeclaredOptional` decides the bucket: a
|
|
285
|
+
* caller that *knows* the dependency was declared in `optionalDependencies` (e.g. the pnpm
|
|
286
|
+
* collector's optional-dependency check) reports a missing *optional* dependency — an expected
|
|
287
|
+
* condition — rather than the `PKG_NOT_ON_DISK` warning reserved for genuinely missing
|
|
288
|
+
* production dependencies.
|
|
289
|
+
*/
|
|
290
|
+
logMissingDependency(pkgName, isDeclaredOptional = false) {
|
|
281
291
|
const PLATFORM_PACKAGE_RE = /(linux|win32|darwin|freebsd|android)[-_](x64|arm64|ia32|arm|ppc64|s390x|loong64|riscv64|universal)/;
|
|
282
|
-
const diskLogKey = PLATFORM_PACKAGE_RE.test(pkgName)
|
|
292
|
+
const diskLogKey = PLATFORM_PACKAGE_RE.test(pkgName)
|
|
293
|
+
? moduleManager_1.LogMessageByKey.PKG_OPTIONAL_PLATFORM_NOT_INSTALLED
|
|
294
|
+
: isDeclaredOptional
|
|
295
|
+
? moduleManager_1.LogMessageByKey.PKG_OPTIONAL_NOT_INSTALLED
|
|
296
|
+
: moduleManager_1.LogMessageByKey.PKG_NOT_ON_DISK;
|
|
283
297
|
this.cache.logSummary[diskLogKey].push(pkgName);
|
|
284
298
|
}
|
|
285
299
|
async asyncExec(command, args, cwd = this.rootDir) {
|