app-builder-lib 27.0.0-alpha.6 → 27.0.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/codeSign/win/signtoolBaseSignManager.d.ts +23 -0
  2. package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -1
  3. package/dist/codeSign/win/signtoolBaseSignManager.js +71 -0
  4. package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -1
  5. package/dist/configuration.d.ts +42 -5
  6. package/dist/configuration.d.ts.map +1 -1
  7. package/dist/configuration.js.map +1 -1
  8. package/dist/fileMatcher.d.ts +15 -0
  9. package/dist/fileMatcher.d.ts.map +1 -1
  10. package/dist/fileMatcher.js +41 -2
  11. package/dist/fileMatcher.js.map +1 -1
  12. package/dist/indexInternal.d.ts +2 -1
  13. package/dist/indexInternal.d.ts.map +1 -1
  14. package/dist/indexInternal.js +2 -1
  15. package/dist/indexInternal.js.map +1 -1
  16. package/dist/macPackager.d.ts.map +1 -1
  17. package/dist/macPackager.js +2 -3
  18. package/dist/macPackager.js.map +1 -1
  19. package/dist/node-module-collector/nodeModulesCollector.d.ts +11 -1
  20. package/dist/node-module-collector/nodeModulesCollector.d.ts.map +1 -1
  21. package/dist/node-module-collector/nodeModulesCollector.js +28 -5
  22. package/dist/node-module-collector/nodeModulesCollector.js.map +1 -1
  23. package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts.map +1 -1
  24. package/dist/node-module-collector/pnpmNodeModulesCollector.js +3 -1
  25. package/dist/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
  26. package/dist/options/SnapOptions.d.ts +8 -4
  27. package/dist/options/SnapOptions.d.ts.map +1 -1
  28. package/dist/options/SnapOptions.js.map +1 -1
  29. package/dist/options/macOptions.d.ts +17 -7
  30. package/dist/options/macOptions.d.ts.map +1 -1
  31. package/dist/options/macOptions.js.map +1 -1
  32. package/dist/options/winOptions.d.ts +5 -4
  33. package/dist/options/winOptions.d.ts.map +1 -1
  34. package/dist/options/winOptions.js.map +1 -1
  35. package/dist/packager.js +1 -1
  36. package/dist/packager.js.map +1 -1
  37. package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
  38. package/dist/publish/updateInfoBuilder.js +3 -1
  39. package/dist/publish/updateInfoBuilder.js.map +1 -1
  40. package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -1
  41. package/dist/targets/linux/FlatpakTarget.js +4 -1
  42. package/dist/targets/linux/FlatpakTarget.js.map +1 -1
  43. package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
  44. package/dist/targets/linux/FpmTarget.js +9 -0
  45. package/dist/targets/linux/FpmTarget.js.map +1 -1
  46. package/dist/targets/linux/appimage/appImageUtil.d.ts +1 -1
  47. package/dist/targets/linux/appimage/appImageUtil.js +3 -3
  48. package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
  49. package/dist/targets/linux/snap/core24.d.ts +27 -0
  50. package/dist/targets/linux/snap/core24.d.ts.map +1 -1
  51. package/dist/targets/linux/snap/core24.js +92 -57
  52. package/dist/targets/linux/snap/core24.js.map +1 -1
  53. package/dist/targets/mac/MacTargetHelper.d.ts +12 -2
  54. package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
  55. package/dist/targets/mac/MacTargetHelper.js +20 -11
  56. package/dist/targets/mac/MacTargetHelper.js.map +1 -1
  57. package/dist/targets/win/MsiTarget.js +2 -2
  58. package/dist/targets/win/MsiTarget.js.map +1 -1
  59. package/dist/toolsets/custom.js +4 -2
  60. package/dist/toolsets/custom.js.map +1 -1
  61. package/dist/toolsets/icons.d.ts.map +1 -1
  62. package/dist/toolsets/icons.js +4 -1
  63. package/dist/toolsets/icons.js.map +1 -1
  64. package/dist/util/appFileCopier.d.ts.map +1 -1
  65. package/dist/util/appFileCopier.js +63 -2
  66. package/dist/util/appFileCopier.js.map +1 -1
  67. package/dist/util/electronGet.d.ts +5 -0
  68. package/dist/util/electronGet.d.ts.map +1 -1
  69. package/dist/util/electronGet.js +107 -7
  70. package/dist/util/electronGet.js.map +1 -1
  71. package/dist/util/packageMetadata.js +46 -21
  72. package/dist/util/packageMetadata.js.map +1 -1
  73. package/dist/version.d.ts +1 -1
  74. package/dist/version.js +1 -1
  75. package/dist/version.js.map +1 -1
  76. package/package.json +8 -8
  77. package/scheme.json +36 -10
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.js","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"AAsBA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAA0B,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAA","sourcesContent":["import { Arch } from \"builder-util\"\nimport { BeforeBuildContext, Target } from \"./core.js\"\nimport { ElectronBrandingOptions } from \"./electron/ElectronFramework.js\"\nimport { PrepareApplicationStageDirectoryOptions } from \"./Framework.js\"\nimport { AppXOptions } from \"./options/AppXOptions.js\"\nimport { AppImageOptions, DebOptions, FlatpakOptions, LinuxConfiguration, LinuxTargetSpecificOptions, PacmanOptions, RpmOptions } from \"./options/linuxOptions.js\"\nimport { DmgOptions, MacConfiguration, MasConfiguration } from \"./options/macOptions.js\"\nimport { MsiOptions } from \"./options/MsiOptions.js\"\nimport { MsiWrappedOptions } from \"./options/MsiWrappedOptions.js\"\nimport { MsixOptions } from \"./options/MsixOptions.js\"\nimport { PkgOptions } from \"./options/pkgOptions.js\"\nimport { PlatformSpecificBuildOptions } from \"./options/PlatformSpecificBuildOptions.js\"\nimport { SnapcraftOptions } from \"./options/SnapOptions.js\"\nimport { SquirrelWindowsOptions } from \"./options/SquirrelWindowsOptions.js\"\nimport { WindowsConfiguration } from \"./options/winOptions.js\"\nimport { BuildResult } from \"./packager.js\"\nimport { ArtifactBuildStarted, ArtifactCreated } from \"./packagerApi.js\"\nimport { PlatformPackager } from \"./platformPackager.js\"\nimport { NsisOptions, NsisWebOptions, PortableOptions } from \"./targets/win/nsis/nsisOptions.js\"\nimport { ElectronGetOptions } from \"./util/electronGet.js\"\nimport { FuseOptionsV1 } from \"./options/FuseOptionsV1.js\"\n\n/**\n * Production dependencies that are excluded from the copied `node_modules` by default. These are\n * still legitimate production dependencies (for SBOM, license, and vulnerability tracking), but\n * electron-builder already provides them another way — notably the Electron runtime, which is\n * embedded separately — so copying them into the app would just duplicate what is already there.\n * Users can override the set via {@link CommonConfiguration.ignoredProductionDependencies}.\n *\n * Declared next to the option so the code constant, the jsdoc `@default`, and the generated\n * `scheme.json` stay in one place; a test asserts the generated schema matches this constant.\n */\nexport const DEFAULT_IGNORED_PRODUCTION_DEPENDENCIES: ReadonlyArray<string> = [\"electron\", \"electron-builder\"]\n\n// duplicate appId here because it is important\n/**\n * Configuration options shared across all platforms.\n *\n * These properties apply regardless of the target platform and control general build behaviour such\n * as the application identity, output paths, native dependency rebuilding, toolset versions, and\n * platform-specific target sub-configurations.\n */\nexport interface CommonConfiguration {\n /**\n * The application identifier.\n *\n * Used as [`CFBundleIdentifier`](https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleidentifier)\n * on macOS and as the\n * [Application User Model ID](https://learn.microsoft.com/en-us/windows/win32/shell/appids)\n * on Windows (NSIS target only; Squirrel.Windows does not support custom Application User Model IDs).\n *\n * It is strongly recommended to set an explicit, reverse-DNS-style identifier (e.g. `\"com.example.myapp\"`)\n * rather than relying on the generated default.\n *\n * @default com.electron.${name}\n */\n readonly appId?: string | null\n\n /**\n * The human-readable product name displayed in installers, the macOS dock, and the Windows\n * Apps & Features list.\n *\n * Unlike the `name` field in `package.json`, this value may contain spaces and other characters\n * that are not allowed in npm package names.\n *\n * Resolution order:\n * 1. `productName` inside the `build` configuration block.\n * 2. `productName` at the top level of `package.json`.\n * 3. `name` at the top level of `package.json`.\n */\n readonly productName?: string | null\n\n /**\n * The copyright string embedded in the built artifacts.\n *\n * Appears in the Windows `LegalCopyright` version-info field and the macOS `NSHumanReadableCopyright`\n * Info.plist key.\n *\n * @default Copyright © ${year} ${author}\n */\n readonly copyright?: string | null\n\n /**\n * Overrides for input/output directory paths used during the build.\n *\n * @see {@link MetadataDirectories}\n */\n readonly directories?: MetadataDirectories | null\n\n /**\n * Pinned versions of the binary toolsets electron-builder downloads and uses internally.\n *\n * Each property selects a specific release of the corresponding tool bundle. Set a property to\n * `\"0.0.0\"` to force the legacy bundle (pre-v27 behaviour). Leave a property unset (or set to\n * `null`) to use the modern default for that toolset.\n *\n * @see {@link ToolsetConfig}\n */\n readonly toolsets?: ToolsetConfig | null\n\n /**\n * macOS-specific build options (signing, entitlements, notarization, target categories, etc.).\n * @see {@link MacConfiguration}\n */\n readonly mac?: MacConfiguration | null\n /**\n * macOS App Store (MAS) submission options.\n * @see {@link MasConfiguration}\n */\n readonly mas?: MasConfiguration | null\n /**\n * macOS App Store development-signing options (`mas-dev` target).\n * Used for local testing of MAS builds without submitting to the store.\n * @see {@link MasConfiguration}\n */\n readonly masDev?: MasConfiguration | null\n /**\n * macOS DMG disk image options (background image, window position, icon layout, licence, etc.).\n * @see {@link DmgOptions}\n */\n readonly dmg?: DmgOptions | null\n /**\n * macOS PKG flat-package installer options.\n * @see {@link PkgOptions}\n */\n readonly pkg?: PkgOptions | null\n\n /**\n * Windows-specific build options (signing, NSIS, icon, file associations, etc.).\n * @see {@link WindowsConfiguration}\n */\n readonly win?: WindowsConfiguration | null\n /**\n * NSIS one-click installer options.\n *\n * NSIS (Nullsoft Scriptable Install System) is the default Windows installer format produced by\n * electron-builder. It generates a lightweight, self-extracting `.exe` installer.\n *\n * @see {@link NsisOptions}\n */\n readonly nsis?: NsisOptions | null\n /**\n * NSIS web installer options.\n *\n * Like the standard NSIS installer but the app payload is downloaded from a remote URL at install\n * time rather than bundled into the `.exe`. Useful for very large apps or staged rollouts.\n *\n * @see {@link NsisWebOptions}\n */\n readonly nsisWeb?: NsisWebOptions | null\n /**\n * Portable executable options.\n *\n * Produces a single `.exe` that requires no installation — it extracts and runs directly.\n *\n * @see {@link PortableOptions}\n */\n readonly portable?: PortableOptions | null\n /**\n * Windows Store (MSIX/AppX) package options.\n *\n * Produces a `.appx` or `.msix` package suitable for distribution through the Microsoft Store or\n * side-loading.\n *\n * @see {@link AppXOptions}\n */\n readonly appx?: AppXOptions | null\n /** MSIX package options. MSIX is the modern successor to AppX with additional deployment features. */\n readonly msix?: MsixOptions | null\n /**\n * WiX-based MSI installer options.\n *\n * Produces a traditional `.msi` package built with the WiX Toolset. Best for enterprise\n * deployments that require MSI-based installation policies.\n *\n * @see {@link MsiOptions}\n */\n readonly msi?: MsiOptions | null\n /**\n * MSI-wrapped NSIS installer options.\n *\n * Wraps the standard NSIS installer inside an MSI package so that it can be deployed via\n * Group Policy or other MSI-only channels while preserving the NSIS installer UX.\n *\n * @see {@link MsiWrappedOptions}\n */\n readonly msiWrapped?: MsiWrappedOptions | null\n /**\n * Squirrel.Windows auto-update installer options.\n *\n * Requires the `electron-builder-squirrel-windows` optional dependency.\n *\n * @see {@link SquirrelWindowsOptions}\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 * @see {@link LinuxConfiguration}\n */\n readonly linux?: LinuxConfiguration | null\n /**\n * Debian package options.\n *\n * Targets Debian, Ubuntu, and Debian-based distributions. Produces a `.deb` archive\n * installable via `dpkg -i` or `apt install ./package.deb`.\n *\n * @see {@link DebOptions}\n */\n readonly deb?: DebOptions | null\n /**\n * Snapcraft configuration.\n *\n * Selects the snapcraft base and provides per-core options:\n * - `base: \"core18\" | \"core20\" | \"core22\"` — legacy bases; still functional but not recommended\n * for new apps.\n * - `base: \"core24\"` — modern base with the GNOME extension (recommended, requires Electron 25+).\n * - `base: \"custom\"` — pass an existing `snapcraft.yaml` through unchanged; no plugs, extensions,\n * or desktop files are injected.\n *\n * @example\n * ```json\n * { \"snapcraft\": { \"base\": \"core24\", \"core24\": { \"useLXD\": true } } }\n * ```\n *\n * @see {@link SnapcraftOptions}\n */\n readonly snapcraft?: SnapcraftOptions | null\n /**\n * AppImage options.\n *\n * AppImage is a portable application format that bundles the app and its runtime dependencies\n * into a single self-contained executable that runs on most Linux distributions without\n * installation. The produced `.AppImage` file is executable after `chmod +x`.\n *\n * @see {@link AppImageOptions}\n */\n readonly appImage?: AppImageOptions | null\n /**\n * Flatpak options.\n *\n * Flatpak is a sandboxed application distribution format for Linux distributed via\n * [Flathub](https://flathub.org/) or self-hosted OSTree repositories.\n *\n * @see {@link FlatpakOptions}\n */\n readonly flatpak?: FlatpakOptions | null\n /**\n * Pacman package options.\n *\n * Targets Arch Linux and Arch-based distributions (Manjaro, EndeavourOS, etc.).\n * Produces a `.pacman` archive installable via `pacman -U ./package.pacman`.\n *\n * @see {@link PacmanOptions}\n */\n readonly pacman?: PacmanOptions | null\n /**\n * RPM package options.\n *\n * Targets Fedora, Red Hat Enterprise Linux, SUSE, and RPM-based distributions.\n * Produces a `.rpm` archive installable via `rpm -i` or `dnf install ./package.rpm`.\n *\n * @see {@link RpmOptions}\n */\n readonly rpm?: RpmOptions | null\n /**\n * FreeBSD `pkg` package options.\n *\n * Produces a `.pkg` archive for the FreeBSD package manager.\n */\n readonly freebsd?: LinuxTargetSpecificOptions | null\n /**\n * Solaris IPS package options.\n *\n * Produces a `.p5p` archive for the Solaris Image Packaging System (`pkg`).\n */\n readonly p5p?: LinuxTargetSpecificOptions | null\n /**\n * Alpine Linux APK package options.\n *\n * Produces an `.apk` archive installable via `apk add --allow-untrusted ./package.apk`.\n */\n readonly apk?: LinuxTargetSpecificOptions | null\n\n /**\n * Additional command-line arguments appended to the package manager's `install` command when\n * electron-builder installs app dependencies (i.e., when `node_modules` is missing and a fresh\n * install is required).\n *\n * These arguments are appended **only** during the install phase, not during the rebuild phase.\n * To influence `@electron/rebuild` directly, see {@link NativeModulesConfig.rebuildMode}.\n *\n * @example\n * ```json\n * { \"npmArgs\": [\"--prefer-offline\", \"--ignore-scripts\"] }\n * ```\n */\n readonly npmArgs?: Array<string> | string | null\n\n /**\n * Names of production dependencies that are excluded from the copied `node_modules`, even if they\n * are declared in the `dependencies` section of `package.json`.\n *\n * electron-builder copies the resolved production dependency tree into the app. Some packages —\n * notably `electron` — are already provided another way (the Electron runtime is embedded\n * separately), so copying them would just duplicate what is already there. Such packages are\n * excluded from the copy rather than rejected: they remain valid production dependencies for\n * tooling purposes (e.g. SBOM, license, and vulnerability tracking) without being shipped twice.\n *\n * Only dependencies **declared by the app itself** are eligible: a listed name and the transitive\n * dependencies required *only* by it are dropped, while anything also required by another (kept)\n * production dependency stays bundled. A matching name that appears solely as a transitive\n * dependency of a kept package is never excluded. Note that a kept package which `require()`s an\n * excluded name at runtime *without declaring it* (relying on hoisting) will fail with\n * `MODULE_NOT_FOUND` — declare such a dependency properly or remove the name from this list.\n *\n * Matching is by the dependency name as declared in `package.json`: an npm alias\n * (`\"custom-electron\": \"npm:electron@^30.0.0\"`) is matched by its alias key (`custom-electron`),\n * never by the underlying package name.\n *\n * Overriding this option **replaces** the default list, so include `electron` and `electron-builder`\n * unless you intend to ship them. The most common reason to override is to *add* a dependency that a\n * bundler (Vite, webpack, esbuild, …) already inlines into your app code: keep it in `dependencies`\n * so SBOM/license tooling still sees it, and list it here so a duplicate copy is not packaged — e.g.\n * `[\"electron\", \"electron-builder\", \"react\", \"react-dom\"]`. Removing a default name keeps that\n * package in the copied `node_modules`. Setting the option to `null` (or omitting it) applies the\n * default list; to disable exclusion entirely, set it to an empty array `[]`. Each excluded package\n * is logged once during packaging.\n *\n * @default [\"electron\", \"electron-builder\"]\n */\n readonly ignoredProductionDependencies?: Array<string> | null\n\n /**\n * Configuration for native Node.js module installation and rebuilding.\n *\n * Groups all options that control how electron-builder handles native modules — from forcing\n * source builds during install through to the `@electron/rebuild` compilation mode.\n *\n * @see {@link NativeModulesConfig}\n */\n readonly nativeModules?: NativeModulesConfig | null\n\n /**\n * The build number.\n *\n * Maps to the `--iteration` flag for FPM-based Linux targets and is appended to the version\n * string in `CFBundleVersion` (macOS) and `FileVersion` (Windows) when {@link buildVersion} is\n * not set explicitly.\n *\n * If not set, falls back to the first defined environment variable among:\n * `BUILD_NUMBER`, `TRAVIS_BUILD_NUMBER`, `APPVEYOR_BUILD_NUMBER`, `CIRCLE_BUILD_NUM`,\n * `BUILD_BUILDNUMBER`, `CI_PIPELINE_IID`.\n */\n readonly buildNumber?: string | null\n\n /**\n * The full build version string.\n *\n * Maps to `CFBundleVersion` on macOS and the `FileVersion` metadata field on Windows.\n * Defaults to the `version` field from `package.json`.\n *\n * If `buildVersion` is not set but {@link buildNumber} is defined (or resolved from an\n * environment variable), the effective build version becomes `${version}.${buildNumber}`.\n */\n readonly buildVersion?: string | null\n\n /**\n * Whether to download the FFmpeg library variant from Electron's release assets and replace the\n * default (proprietary codec) FFmpeg library before signing.\n *\n * The alternate FFmpeg is compiled without proprietary codec support (H.264, AAC, etc.) and is\n * required for distributing on certain platforms (e.g., Linux distributions that prohibit\n * proprietary codecs). Enabling this swaps the bundled `ffmpeg` dynamic library before the app\n * is signed.\n */\n readonly downloadAlternateFFmpeg?: boolean\n\n /**\n * Additional properties to deep-merge into the app's `package.json` at build time.\n *\n * Useful for injecting build-time metadata (e.g., a git commit hash or CI build URL) that\n * should be readable at runtime via `require('./package.json')` or `import.meta.url`.\n *\n * @example\n * ```json\n * { \"extraMetadata\": { \"commitHash\": \"abc1234\", \"buildDate\": \"2025-01-01\" } }\n * ```\n */\n readonly extraMetadata?: any\n\n /**\n * Whether to throw an error and abort the build if the app could not be code-signed.\n *\n * Set to `true` in release pipelines to catch missing or misconfigured signing credentials\n * before producing unsigned artifacts. When `false` (the default), missing signing credentials\n * produce a warning and the build continues unsigned.\n *\n * @default false\n */\n readonly forceCodeSigning?: boolean\n\n /**\n * Whether to include `.pdb` (Program Database) symbol files in the output.\n *\n * PDB files enable Windows crash-dump analysis but significantly increase artifact size. Enable\n * for internal builds where you want symbol information; disable for public distribution.\n *\n * @default false\n */\n readonly includePdb?: boolean\n\n /**\n * Whether to remove the `scripts` field from bundled `package.json` files.\n *\n * Lifecycle scripts (`preinstall`, `postinstall`, etc.) have no meaning inside a packaged\n * Electron app and can trigger unintended behaviour if any tooling inspects the bundled\n * `package.json`. Removing them reduces artifact size and prevents accidental execution.\n *\n * @default true\n */\n readonly removePackageScripts?: boolean\n\n /**\n * Whether to remove the `keywords` field from bundled `package.json` files.\n *\n * The `keywords` array is only meaningful for package registry discoverability and has no\n * runtime value inside a packaged Electron app. Removing it marginally reduces artifact size.\n *\n * @default true\n */\n readonly removePackageKeywords?: boolean\n\n /**\n * Options forwarded to [`@electron/fuses`](https://github.com/electron/fuses) to flip Electron\n * feature flags in the binary.\n *\n * Fuses are compile-time-like flags baked into the Electron binary that cannot be changed at\n * runtime. Flipping them is the approved mechanism for hardening Electron apps (e.g., disabling\n * `ELECTRON_RUN_AS_NODE`, enabling ASAR integrity, etc.).\n *\n * electron-builder flips fuses after packaging but before signing so that the final signature\n * covers the modified binary.\n *\n * @see {@link FuseOptionsV1}\n */\n readonly electronFuses?: FuseOptionsV1 | null\n\n /**\n * Configuration for experimental concurrent (multi-platform / multi-arch) builds.\n *\n * When `jobs > 1`, electron-builder runs up to `jobs` platform builds in parallel. This is an\n * experimental feature — use with caution and verify that your hook functions and build resources\n * are safe to execute concurrently.\n *\n * @see {@link Concurrency}\n */\n readonly concurrency?: Concurrency | null\n}\n\n/**\n * The root build configuration object passed to electron-builder.\n *\n * Extends {@link CommonConfiguration} with top-level Electron-specific options, configuration\n * inheritance/presets, and all per-platform build hooks.\n */\nexport interface Configuration extends CommonConfiguration, PlatformSpecificBuildOptions, Hooks {\n /**\n * Options forwarded to [`@electron/get`](https://github.com/electron/get) when downloading the\n * Electron distribution to package.\n */\n readonly electronGet?: ElectronGetOptions | null\n\n /**\n * Electron branding overrides.\n *\n * Required only when packaging a custom Electron fork that ships a modified `BRANDING.json`\n * (e.g., a fork that renames the `Electron Helper` process or the `Electron Framework`).\n * Standard Electron builds do not need this.\n */\n readonly electronBranding?: ElectronBrandingOptions\n\n /**\n * The Electron version to package against.\n *\n * Defaults to the version of the `electron` (or `electron-prebuilt`) dependency declared in\n * `package.json`. Set this explicitly only when the installed Electron version is not the one\n * you want to package against (e.g., in monorepos where the Electron dependency lives in a\n * different workspace).\n */\n electronVersion?: string | null\n\n /**\n * One or more configuration presets or file paths to merge into this configuration.\n *\n * Accepts a string or array of strings, each of which is either:\n * - A built-in preset name (`\"react-cra\"` is the only currently supported value).\n * - A path to a JS/JSON config file relative to the project directory.\n *\n * Configs are merged left-to-right using a deep-assign strategy that properly combines `files`\n * glob patterns rather than replacing them.\n *\n * The `react-cra` preset is applied automatically when `react-scripts` is found in\n * `dependencies`. Set `extends: null` to opt out of automatic preset detection.\n */\n extends?: Array<string> | string | null\n}\n\n/**\n * Configuration for native Node.js module installation and rebuilding.\n *\n * All options that control how electron-builder handles native modules — from forcing source\n * builds at install time through to the `@electron/rebuild` compilation mode.\n */\nexport interface NativeModulesConfig {\n /**\n * Whether to pass `--build-from-source` to the package manager when installing native\n * dependencies, forcing them to compile from source rather than using pre-built binaries.\n *\n * Useful when pre-built binaries are not available for the target platform/arch combination,\n * or when you need to ensure native modules are compiled against the exact Electron ABI.\n *\n * @default false\n */\n buildDependenciesFromSource?: boolean\n\n /**\n * Whether to run `node-gyp rebuild` with Electron headers before packaging.\n *\n * This is a low-level escape hatch for cases where the standard `@electron/rebuild` path\n * (controlled by {@link npmRebuild}) is insufficient. Most projects should leave this `false`\n * and rely on `@electron/rebuild` instead.\n *\n * When `true`, electron-builder runs `node-gyp rebuild` with the correct `npm_config_*`\n * environment variables set for the target Electron version and architecture before the\n * normal rebuild step.\n *\n * @default false\n */\n readonly nodeGypRebuild?: boolean\n\n /**\n * Whether to rebuild native Node.js modules for the target Electron version and architecture\n * before packaging.\n *\n * When `true` (the default), electron-builder runs `@electron/rebuild` against the app's\n * `node_modules` directory to ensure all native modules are compiled against the correct Electron\n * ABI. Set to `false` to skip this step entirely — useful when native modules are pre-built\n * elsewhere in your pipeline or when the app has no native dependencies.\n *\n * The compilation mode (`sequential` vs `parallel`) is controlled by {@link rebuildMode}.\n *\n * @default true\n */\n readonly npmRebuild?: boolean\n\n /**\n * Compilation mode for `@electron/rebuild`.\n *\n * - `\"sequential\"` — rebuilds native modules one at a time. Safer in memory-constrained\n * environments and produces cleaner log output.\n * - `\"parallel\"` — rebuilds all native modules concurrently. Faster on machines with many cores\n * and plentiful memory, but may exhaust resources on CI agents with limited RAM.\n *\n * @default \"sequential\"\n */\n readonly rebuildMode?: \"sequential\" | \"parallel\" | null\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 * Version pins and custom bundle overrides for the binary toolsets that electron-builder downloads and caches locally.\n *\n * Each toolset is a versioned archive hosted at [electron-userland/electron-builder-binaries](https://github.com/electron-userland/electron-builder-binaries/releases).\n * Omitting a property (or setting it to `latest`) selects the modern default for that toolset.\n *\n * To supply your own bundle, set the property to a {@link ToolsetCustom} object with a `url` (https:// or file://) and a `checksum` for verification. The bundle must mirror the expected directory layout of the corresponding built-in bundle; see the build scripts at\n * https://github.com/electron-userland/electron-builder-binaries/tree/master/packages.\n */\nexport interface ToolsetConfig {\n /**\n * Version of the `win-codesign` bundle used for Windows code signing and resource editing.\n *\n * The bundle ships:\n * - **`signtool.exe`** (Windows) / **`osslsigncode`** (macOS & Linux) — used to sign `.exe`,\n * `.dll`, and `.msix` artifacts.\n * - **`rcedit`** — embeds version metadata and icons into `.exe` files (legacy usage, migrated to npm `resedit` package).\n * - **Windows Kits** — used by AppX/MSIX packaging (`makeappx`, `signtool`).\n *\n * Available versions:\n * | Version | Notes |\n * |---------|-------|\n * | `\"0.0.0\"` | Legacy bundle — `winCodeSign-2.6.0` (pre-v27) |\n * | `\"1.0.0\"` | Windows Kits 10.0.26100.0, `osslsigncode` v2.9 |\n * | `\"1.1.1\"` | Updates `osslsigncode` to v2.11 |\n * | `\"1.2.1\"` | Adds native `osslsigncode` arm64 |\n * | `\"1.3.0\"` | Includes support for Azure Trusted Signing `signtool` via dlib and .NET 8 runtime |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/win-codesign/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly winCodeSign?: \"0.0.0\" | \"1.0.0\" | \"1.1.0\" | \"1.1.1\" | \"1.2.1\" | \"1.3.0\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the AppImage toolset bundle used for building `.AppImage` files.\n *\n * The bundle ships:\n * - **`mksquashfs`** — creates the SquashFS filesystem embedded in the AppImage.\n * - **`desktop-file-validate`** — validates the generated `.desktop` entry.\n * - **AppImage runtime** — the self-executing stub that mounts the SquashFS at launch.\n *\n * Available versions:\n * | Version | Runtime date | Notes |\n * |---------|-------------|-------|\n * | `\"0.0.0\"` | Legacy | FUSE2-based AppImage runtime (pre-v27) |\n * | `\"1.0.3\"` | 20251108 | Introduces static AppImage runtime |\n * | `\"1.1.0\"` | 20251108 | Adds `unsquashfs` support |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/appimage/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly appimage?: \"0.0.0\" | \"1.0.3\" | \"1.1.0\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the NSIS toolset bundle used to compile Windows installers.\n *\n * The bundle ships:\n * - **`makensis`** — the NSIS compiler invoked to build `.nsi` scripts into `.exe` installers.\n * - **NSIS plugins** — the plugin DLLs (`NsisMultiUser`, `UAC`, `StdUtils`, etc.) referenced by\n * electron-builder's default installer scripts.\n * - **`elevate.exe`** — UAC elevation helper included in NSIS installers.\n *\n * Available versions:\n * | Version | `makensis` version | Notes |\n * |---------|------------------|-------|\n * | `\"0.0.0\"` | 3.0.4.1 | Legacy split bundle — `nsis` + `nsis-resources` archives (pre-v27) |\n * | `\"1.2.1\"` | 3.12 | Unified bundle — single archive, entrypoint scripts auto-set `NSISDIR` |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/nsis/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly nsis?: \"0.0.0\" | \"1.2.1\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the Wine bundle used to run Windows tools (NSIS, rcedit, signtool) on\n * non-Windows hosts (macOS and Linux).\n *\n * Wine is only required when building Windows targets on a non-Windows machine. On Windows,\n * this setting has no effect.\n *\n * Available versions:\n * | Version | Wine version | Platform support | Notes |\n * |---------|-------------|-----------------|-------|\n * | `\"0.0.0\"` | 4.0.1 | macOS | Legacy portable bundle (pre-v27) |\n * | `\"1.0.1\"` | 11.0 | macOS | Supports arm64 macOS via Rosetta |\n *\n * To use a custom Wine binary, use a `ToolsetCustom` object.\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/wine/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly wine?: \"0.0.0\" | \"1.0.1\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the FPM bundle used to build Linux packages (`.deb`, `.rpm`, `.pacman`, etc.)\n * on macOS and Linux hosts.\n *\n * Available versions:\n * | Version | FPM version | Notes |\n * |---------|------------|-------|\n * | `\"2.2.1\"` | 1.17.0 (Ruby 3.4.3) | Current default |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/fpm/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly fpm?: \"2.2.1\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the Linux-tools-mac bundle used to produce `.tar.lz` archives and build\n * Linux targets on macOS hosts.\n *\n * The bundle ships macOS-native builds of `ar`, `lzip`, and `gtar` (GNU tar).\n *\n * Available versions:\n * | Version | Notes |\n * |---------|-------|\n * | `\"1.0.0\"` | gnu-tar, lzip, makedepend, glib, libgsf, libtool, pcre, gettext, binutils |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/linux-tools-mac/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly linuxToolsMac?: \"1.0.0\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the 7-Zip binary bundle used internally to extract `.7z` and `.tar.xz` archives.\n *\n * Set to a {@link ToolsetCustom} object to supply your own 7za binary.\n * The `url` must point to a directory (or a `.tar.gz`/`.zip` archive of one) that contains\n * `bin/7za` (macOS/Linux) or `bin/7za.exe` (Windows).\n *\n * **Bootstrap constraint:** the custom bundle itself must be a `.tar.gz` or `.zip` archive\n * (or a bare `file://` directory). `.7z` and `.tar.xz` archives cannot be used here because\n * extracting them requires 7za — a circular dependency.\n *\n * @default \"latest\"\n */\n readonly sevenZip?: \"1.0.0\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the icons-conversion bundle used to convert source images to `.icns`, `.ico`,\n * and PNG icon sets.\n *\n * Set to a {@link ToolsetCustom} object to supply your own icons bundle directory.\n *\n * Available versions:\n * | Version | Notes |\n * |---------|-------|\n * | `\"1.2.1\"` | `wasm-vips` + `@resvg/resvg-wasm` |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/icons/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly icons?: \"1.2.1\" | ToolsetCustom | \"latest\"\n}\n\n/**\n * A custom toolset bundle supplied by the user in place of a built-in versioned bundle.\n *\n * The bundle must mirror the expected directory layout of the corresponding built-in bundle.\n * See the build scripts at\n * https://github.com/electron-userland/electron-builder-binaries/tree/master/packages.\n *\n * File formats supported for `url` archives: `.zip`, `.7z`, `.tar.gz`, `.tar.xz`.\n *\n * @example\n * ```json\n * {\n * \"toolsets\": {\n * \"nsis\": {\n * \"url\": \"file:///path/to/my-nsis-bundle.tar.gz\",\n * \"checksum\": \"abc123...\",\n * \"version\": \"my-custom-1.0\"\n * }\n * }\n * }\n * ```\n */\nexport interface ToolsetCustom {\n /**\n * The `https://` URL or `file://` path to load the custom toolset bundle from.\n *\n * - `https://` — downloaded and cached locally; the archive is extracted before use.\n * - `file:///absolute/path` — used directly; relative paths must be within the project resources dir.\n *\n * Archives (`.zip`, `.7z`, `.tar.gz`, `.tar.xz`) are extracted automatically.\n * A bare directory path (no archive) is used as-is.\n */\n readonly url: string\n\n /**\n * SHA checksum of the custom toolset bundle for verification.\n * Required for remote (`https://`) URLs and local archive files (`file://`).\n * Not needed for bare directory paths — the directory is used as-is with no caching.\n */\n readonly checksum?: string\n\n /**\n * Optional version label used in the local cache directory name.\n * Falls back to the first 8 characters of `checksum` when omitted.\n */\n readonly version?: string\n}\n\n/**\n * Lifecycle hooks that run at specific points during the electron-builder pipeline.\n *\n * Each hook can be specified as:\n * - An **inline function** (JavaScript/TypeScript config files only):\n * ```js\n * // electron-builder.config.js\n * module.exports = { beforePack: async (context) => { /* ... *\\/ } }\n * ```\n * - A **path** to a CommonJS/ESM module (relative to the project directory) that exports the\n * hook as its **default export**:\n * ```json\n * { \"build\": { \"beforePack\": \"./scripts/myHook.js\" } }\n * ```\n * ```js\n * // scripts/myHook.js\n * export default async function (context) { /* ... *\\/ }\n * ```\n */\nexport interface Hooks {\n /**\n * Called immediately before electron-builder begins packing the app for each platform/arch\n * combination.\n *\n * Use this hook to perform last-minute modifications to source files or build resources before\n * they are read by the packager.\n *\n * Receives a {@link BeforePackContext}.\n */\n readonly beforePack?: Hook<BeforePackContext, void> | string | null\n\n /**\n * Called after the prebuilt Electron binary has been extracted to the staging directory but\n * before the app files have been copied into it.\n *\n * Use this hook to patch or augment the Electron binary itself (e.g. rename helper processes,\n * inject native libraries) before the app payload is laid down on top.\n *\n * Receives an {@link AfterExtractContext}.\n */\n readonly afterExtract?: Hook<AfterExtractContext, void> | string | null\n\n /**\n * Called after the app files have been copied into the staging directory (and ASAR created if\n * applicable) but **before** signing and before the output archive/installer is built.\n *\n * Use this hook to post-process the staged app bundle (e.g. strip debug symbols, inject\n * platform-specific resources).\n *\n * Receives an {@link AfterPackContext}.\n */\n readonly afterPack?: Hook<AfterPackContext, void> | string | null\n\n /**\n * Called after code signing but **before** the signed app is packed into the final\n * distributable format (e.g. before `dmg` is created from the signed `.app`).\n *\n * Use this hook to perform post-sign validation or to add signed resources that are not part of\n * the main app bundle.\n *\n * Receives an {@link AfterPackContext}.\n */\n readonly afterSign?: Hook<AfterPackContext, void> | string | null\n\n /**\n * Called when an individual artifact build starts (e.g. just before a `.dmg` or `.exe` is\n * written to disk).\n *\n * Receives an {@link ArtifactBuildStarted}.\n */\n readonly artifactBuildStarted?: Hook<ArtifactBuildStarted, void> | string | null\n\n /**\n * Called when an individual artifact has been successfully built and written to disk.\n *\n * Use this hook to collect artifact paths, upload to custom destinations, or trigger\n * post-processing steps.\n *\n * Receives an {@link ArtifactCreated}.\n */\n readonly artifactBuildCompleted?: Hook<ArtifactCreated, void> | string | null\n\n /**\n * Called after **all** artifacts across all platforms/architectures have been built.\n *\n * May return an array of additional file paths that should be treated as publish targets\n * (i.e. uploaded to the configured publisher).\n *\n * Receives a {@link BuildResult}.\n *\n * @example\n * ```js\n * export default async function afterAllArtifactBuild(result) {\n * return [\"/path/to/extra-file.txt\"]\n * }\n * ```\n */\n readonly afterAllArtifactBuild?: Hook<BuildResult, Array<string>> | string | null\n\n /**\n * Called after the WiX MSI project XML has been written to a temporary directory but before\n * `candle.exe` / `light.exe` compile it into a `.msi` package.\n *\n * The hook receives the path to the project directory as a string. Use it to patch the generated\n * `.wxs` files for customizations not exposed through electron-builder's options.\n */\n readonly msiProjectCreated?: Hook<string, void> | string | null\n\n /**\n * Called after the AppX/MSIX manifest XML has been written to the staging directory but before\n * `makeappx` packages it.\n *\n * The hook receives the path to the manifest file as a string. Use it to inject custom manifest\n * extensions (capabilities, protocol handlers, etc.) not exposed through {@link AppXOptions}.\n */\n readonly appxManifestCreated?: Hook<string, void> | string | null\n\n /**\n * Called for every file inside each `node_modules` package directory as electron-builder\n * decides whether to include it in the packaged app.\n *\n * Return `true` to force-include the file regardless of the default exclusion rules.\n * Return `false` or `undefined` to let electron-builder apply its normal filtering logic.\n *\n * Receives the absolute path of the file as a string.\n */\n readonly onNodeModuleFile?: Hook<string, void | boolean> | string | null\n\n /**\n * Called before dependencies are installed or native modules are rebuilt.\n *\n * Return `false` (or a `Promise` that resolves to `false`) to skip the install/rebuild step\n * entirely — useful when you manage `node_modules` externally (e.g. in a CI pipeline that\n * restores them from cache). When not set, electron-builder proceeds with the normal\n * install/rebuild flow.\n *\n * If this hook is provided and `node_modules` is missing, electron-builder will not perform\n * the production-dependencies check.\n *\n * Receives a {@link BeforeBuildContext}.\n */\n readonly beforeBuild?: Hook<BeforeBuildContext, boolean | void> | string | null\n\n /**\n * Override the source of the Electron distribution to stage.\n *\n * Should return the path to either:\n * - A **directory** containing a pre-built, unpacked Electron app (e.g. `~/electron/out/R`).\n * - A **directory** containing Electron zip archives following the naming convention\n * `electron-v${version}-${platformName}-${arch}.zip`.\n *\n * When not set, electron-builder downloads the official Electron release from GitHub (or the\n * mirror configured via `electronDownload`).\n *\n * Receives a {@link PrepareApplicationStageDirectoryOptions}.\n */\n readonly electronDist?: Hook<PrepareApplicationStageDirectoryOptions, string> | string | null\n}\n\n/**\n * Overrides for the input and output directories used during the build.\n */\nexport interface MetadataDirectories {\n /**\n * The directory that contains static build resources (icons, background images, license files,\n * custom NSIS scripts, etc.) that electron-builder reads during packaging.\n *\n * **Build resources are not copied into the packaged app.** If you need runtime access to a\n * file (e.g. a tray icon), include it explicitly via the `files` option:\n * ```json\n * { \"files\": [\"**\\/*\", \"build/icon.*\"] }\n * ```\n *\n * @default \"build\"\n */\n readonly buildResources?: string | null\n\n /**\n * The directory where electron-builder writes its output (installers, zip archives, etc.).\n *\n * [File macros](https://www.electron.build/file-patterns#file-macros) are supported, e.g.\n * `\"dist/${os}-${arch}\"` to separate outputs by platform and architecture.\n *\n * @default \"dist\"\n */\n readonly output?: string | null\n\n /**\n * The directory that contains the application's `package.json` and source code.\n *\n * Defaults to `app`, then `www`, then the project root. Set this when your packagable app\n * lives in a subdirectory (common in monorepos or when using a separate frontend build step).\n */\n readonly app?: string | null\n}\n\n/**\n * Configuration for experimental concurrent builds.\n */\nexport interface Concurrency {\n /**\n * Maximum number of platform/architecture builds to run in parallel.\n *\n * Set to `1` to disable concurrency (sequential builds, the safe default). Higher values\n * reduce wall-clock time on multi-platform builds at the cost of increased memory and CPU\n * usage. Ensure that your {@link Hooks} and build resources are safe to execute concurrently\n * before raising this limit.\n *\n * @default 1\n */\n jobs: number\n}\n"]}
1
+ {"version":3,"file":"configuration.js","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"AAsBA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAA0B,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAA","sourcesContent":["import { Arch } from \"builder-util\"\nimport { BeforeBuildContext, Target } from \"./core.js\"\nimport { ElectronBrandingOptions } from \"./electron/ElectronFramework.js\"\nimport { PrepareApplicationStageDirectoryOptions } from \"./Framework.js\"\nimport { AppXOptions } from \"./options/AppXOptions.js\"\nimport { AppImageOptions, DebOptions, FlatpakOptions, LinuxConfiguration, LinuxTargetSpecificOptions, PacmanOptions, RpmOptions } from \"./options/linuxOptions.js\"\nimport { DmgOptions, MacConfiguration, MasConfiguration } from \"./options/macOptions.js\"\nimport { MsiOptions } from \"./options/MsiOptions.js\"\nimport { MsiWrappedOptions } from \"./options/MsiWrappedOptions.js\"\nimport { MsixOptions } from \"./options/MsixOptions.js\"\nimport { PkgOptions } from \"./options/pkgOptions.js\"\nimport { PlatformSpecificBuildOptions } from \"./options/PlatformSpecificBuildOptions.js\"\nimport { SnapcraftOptions } from \"./options/SnapOptions.js\"\nimport { SquirrelWindowsOptions } from \"./options/SquirrelWindowsOptions.js\"\nimport { WindowsConfiguration } from \"./options/winOptions.js\"\nimport { BuildResult } from \"./packager.js\"\nimport { ArtifactBuildStarted, ArtifactCreated } from \"./packagerApi.js\"\nimport { PlatformPackager } from \"./platformPackager.js\"\nimport { NsisOptions, NsisWebOptions, PortableOptions } from \"./targets/win/nsis/nsisOptions.js\"\nimport { ElectronGetOptions } from \"./util/electronGet.js\"\nimport { FuseOptionsV1 } from \"./options/FuseOptionsV1.js\"\n\n/**\n * Production dependencies that are excluded from the copied `node_modules` by default. These are\n * still legitimate production dependencies (for SBOM, license, and vulnerability tracking), but\n * electron-builder already provides them another way — notably the Electron runtime, which is\n * embedded separately — so copying them into the app would just duplicate what is already there.\n * Users can override the set via {@link CommonConfiguration.ignoredProductionDependencies}.\n *\n * Declared next to the option so the code constant, the jsdoc `@default`, and the generated\n * `scheme.json` stay in one place; a test asserts the generated schema matches this constant.\n */\nexport const DEFAULT_IGNORED_PRODUCTION_DEPENDENCIES: ReadonlyArray<string> = [\"electron\", \"electron-builder\"]\n\n// duplicate appId here because it is important\n/**\n * Configuration options shared across all platforms.\n *\n * These properties apply regardless of the target platform and control general build behaviour such\n * as the application identity, output paths, native dependency rebuilding, toolset versions, and\n * platform-specific target sub-configurations.\n */\nexport interface CommonConfiguration {\n /**\n * The application identifier.\n *\n * Used as [`CFBundleIdentifier`](https://developer.apple.com/documentation/bundleresources/information_property_list/cfbundleidentifier)\n * on macOS and as the\n * [Application User Model ID](https://learn.microsoft.com/en-us/windows/win32/shell/appids)\n * on Windows (NSIS target only; Squirrel.Windows does not support custom Application User Model IDs).\n *\n * It is strongly recommended to set an explicit, reverse-DNS-style identifier (e.g. `\"com.example.myapp\"`)\n * rather than relying on the generated default.\n *\n * @default com.electron.${name}\n */\n readonly appId?: string | null\n\n /**\n * The human-readable product name displayed in installers, the macOS dock, and the Windows\n * Apps & Features list.\n *\n * Unlike the `name` field in `package.json`, this value may contain spaces and other characters\n * that are not allowed in npm package names.\n *\n * Resolution order:\n * 1. `productName` inside the `build` configuration block.\n * 2. `productName` at the top level of `package.json`.\n * 3. `name` at the top level of `package.json`.\n */\n readonly productName?: string | null\n\n /**\n * The copyright string embedded in the built artifacts.\n *\n * Appears in the Windows `LegalCopyright` version-info field and the macOS `NSHumanReadableCopyright`\n * Info.plist key.\n *\n * @default Copyright © ${year} ${author}\n */\n readonly copyright?: string | null\n\n /**\n * Overrides for input/output directory paths used during the build.\n *\n * @see {@link MetadataDirectories}\n */\n readonly directories?: MetadataDirectories | null\n\n /**\n * Pinned versions of the binary toolsets electron-builder downloads and uses internally.\n *\n * Each property selects a specific release of the corresponding tool bundle. Set a property to\n * `\"0.0.0\"` to force the legacy bundle (pre-v27 behaviour). Leave a property unset (or set it to\n * `\"latest\"`) to use the modern default (newest bundle) for that toolset.\n *\n * Note: Toolset versioning can drop intermediate releases (such as if a problem is discovered in a bundle). If you need to pin to a specific release, check the release notes for the toolset to ensure the version you specify is valid.\n *\n * @see {@link ToolsetConfig}\n */\n readonly toolsets?: ToolsetConfig | null\n\n /**\n * macOS-specific build options (signing, entitlements, notarization, target categories, etc.).\n * @see {@link MacConfiguration}\n */\n readonly mac?: MacConfiguration | null\n /**\n * macOS App Store (MAS) submission options.\n * @see {@link MasConfiguration}\n */\n readonly mas?: MasConfiguration | null\n /**\n * macOS App Store development-signing options (`mas-dev` target).\n * Used for local testing of MAS builds without submitting to the store.\n * @see {@link MasConfiguration}\n */\n readonly masDev?: MasConfiguration | null\n /**\n * macOS DMG disk image options (background image, window position, icon layout, licence, etc.).\n * @see {@link DmgOptions}\n */\n readonly dmg?: DmgOptions | null\n /**\n * macOS PKG flat-package installer options.\n * @see {@link PkgOptions}\n */\n readonly pkg?: PkgOptions | null\n\n /**\n * Windows-specific build options (signing, NSIS, icon, file associations, etc.).\n * @see {@link WindowsConfiguration}\n */\n readonly win?: WindowsConfiguration | null\n /**\n * NSIS one-click installer options.\n *\n * NSIS (Nullsoft Scriptable Install System) is the default Windows installer format produced by\n * electron-builder. It generates a lightweight, self-extracting `.exe` installer.\n *\n * @see {@link NsisOptions}\n */\n readonly nsis?: NsisOptions | null\n /**\n * NSIS web installer options.\n *\n * Like the standard NSIS installer but the app payload is downloaded from a remote URL at install\n * time rather than bundled into the `.exe`. Useful for very large apps or staged rollouts.\n *\n * @see {@link NsisWebOptions}\n */\n readonly nsisWeb?: NsisWebOptions | null\n /**\n * Portable executable options.\n *\n * Produces a single `.exe` that requires no installation — it extracts and runs directly.\n *\n * @see {@link PortableOptions}\n */\n readonly portable?: PortableOptions | null\n /**\n * Windows Store (MSIX/AppX) package options.\n *\n * Produces a `.appx` or `.msix` package suitable for distribution through the Microsoft Store or\n * side-loading.\n *\n * @see {@link AppXOptions}\n */\n readonly appx?: AppXOptions | null\n /** MSIX package options. MSIX is the modern successor to AppX with additional deployment features. */\n readonly msix?: MsixOptions | null\n /**\n * WiX-based MSI installer options.\n *\n * Produces a traditional `.msi` package built with the WiX Toolset. Best for enterprise\n * deployments that require MSI-based installation policies.\n *\n * @see {@link MsiOptions}\n */\n readonly msi?: MsiOptions | null\n /**\n * MSI-wrapped NSIS installer options.\n *\n * Wraps the standard NSIS installer inside an MSI package so that it can be deployed via\n * Group Policy or other MSI-only channels while preserving the NSIS installer UX.\n *\n * @see {@link MsiWrappedOptions}\n */\n readonly msiWrapped?: MsiWrappedOptions | null\n /**\n * Squirrel.Windows auto-update installer options.\n *\n * Requires the `electron-builder-squirrel-windows` optional dependency.\n *\n * @see {@link SquirrelWindowsOptions}\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 * @see {@link LinuxConfiguration}\n */\n readonly linux?: LinuxConfiguration | null\n /**\n * Debian package options.\n *\n * Targets Debian, Ubuntu, and Debian-based distributions. Produces a `.deb` archive\n * installable via `dpkg -i` or `apt install ./package.deb`.\n *\n * @see {@link DebOptions}\n */\n readonly deb?: DebOptions | null\n /**\n * Snapcraft configuration.\n *\n * Selects the snapcraft base and provides per-core options:\n * - `base: \"core18\" | \"core20\" | \"core22\"` — legacy bases; still functional but not recommended\n * for new apps.\n * - `base: \"core24\"` — modern base with the GNOME extension (recommended, requires Electron 25+).\n * - `base: \"custom\"` — pass an existing `snapcraft.yaml` through unchanged; no plugs, extensions,\n * or desktop files are injected.\n *\n * @example\n * ```json\n * { \"snapcraft\": { \"base\": \"core24\", \"core24\": { \"useLXD\": true } } }\n * ```\n *\n * @see {@link SnapcraftOptions}\n */\n readonly snapcraft?: SnapcraftOptions | null\n /**\n * AppImage options.\n *\n * AppImage is a portable application format that bundles the app and its runtime dependencies\n * into a single self-contained executable that runs on most Linux distributions without\n * installation. The produced `.AppImage` file is executable after `chmod +x`.\n *\n * @see {@link AppImageOptions}\n */\n readonly appImage?: AppImageOptions | null\n /**\n * Flatpak options.\n *\n * Flatpak is a sandboxed application distribution format for Linux distributed via\n * [Flathub](https://flathub.org/) or self-hosted OSTree repositories.\n *\n * @see {@link FlatpakOptions}\n */\n readonly flatpak?: FlatpakOptions | null\n /**\n * Pacman package options.\n *\n * Targets Arch Linux and Arch-based distributions (Manjaro, EndeavourOS, etc.).\n * Produces a `.pacman` archive installable via `pacman -U ./package.pacman`.\n *\n * @see {@link PacmanOptions}\n */\n readonly pacman?: PacmanOptions | null\n /**\n * RPM package options.\n *\n * Targets Fedora, Red Hat Enterprise Linux, SUSE, and RPM-based distributions.\n * Produces a `.rpm` archive installable via `rpm -i` or `dnf install ./package.rpm`.\n *\n * @see {@link RpmOptions}\n */\n readonly rpm?: RpmOptions | null\n /**\n * FreeBSD `pkg` package options.\n *\n * Produces a `.pkg` archive for the FreeBSD package manager.\n */\n readonly freebsd?: LinuxTargetSpecificOptions | null\n /**\n * Solaris IPS package options.\n *\n * Produces a `.p5p` archive for the Solaris Image Packaging System (`pkg`).\n */\n readonly p5p?: LinuxTargetSpecificOptions | null\n /**\n * Alpine Linux APK package options.\n *\n * Produces an `.apk` archive installable via `apk add --allow-untrusted ./package.apk`.\n */\n readonly apk?: LinuxTargetSpecificOptions | null\n\n /**\n * Additional command-line arguments appended to the package manager's `install` command when\n * electron-builder installs app dependencies (i.e., when `node_modules` is missing and a fresh\n * install is required).\n *\n * These arguments are appended **only** during the install phase, not during the rebuild phase.\n * To influence `@electron/rebuild` directly, see {@link NativeModulesConfig.rebuildMode}.\n *\n * @example\n * ```json\n * { \"npmArgs\": [\"--prefer-offline\", \"--ignore-scripts\"] }\n * ```\n */\n readonly npmArgs?: Array<string> | string | null\n\n /**\n * Names of production dependencies that are excluded from the copied `node_modules`, even if they\n * are declared in the `dependencies` section of `package.json`.\n *\n * electron-builder copies the resolved production dependency tree into the app. Some packages —\n * notably `electron` — are already provided another way (the Electron runtime is embedded\n * separately), so copying them would just duplicate what is already there. Such packages are\n * excluded from the copy rather than rejected: they remain valid production dependencies for\n * tooling purposes (e.g. SBOM, license, and vulnerability tracking) without being shipped twice.\n *\n * Only dependencies **declared by the app itself** are eligible: a listed name and the transitive\n * dependencies required *only* by it are dropped, while anything also required by another (kept)\n * production dependency stays bundled. A matching name that appears solely as a transitive\n * dependency of a kept package is never excluded. Note that a kept package which `require()`s an\n * excluded name at runtime *without declaring it* (relying on hoisting) will fail with\n * `MODULE_NOT_FOUND` — declare such a dependency properly or remove the name from this list.\n *\n * Matching is by the dependency name as declared in `package.json`: an npm alias\n * (`\"custom-electron\": \"npm:electron@^30.0.0\"`) is matched by its alias key (`custom-electron`),\n * never by the underlying package name.\n *\n * Overriding this option **replaces** the default list, so include `electron` and `electron-builder`\n * unless you intend to ship them. The most common reason to override is to *add* a dependency that a\n * bundler (Vite, webpack, esbuild, …) already inlines into your app code: keep it in `dependencies`\n * so SBOM/license tooling still sees it, and list it here so a duplicate copy is not packaged — e.g.\n * `[\"electron\", \"electron-builder\", \"react\", \"react-dom\"]`. Removing a default name keeps that\n * package in the copied `node_modules`. Setting the option to `null` (or omitting it) applies the\n * default list; to disable exclusion entirely, set it to an empty array `[]`. Each excluded package\n * is logged once during packaging.\n *\n * @default [\"electron\", \"electron-builder\"]\n */\n readonly ignoredProductionDependencies?: Array<string> | 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 * - `false` or `null` (default): the build fails after dependency collection completes,\n * reporting the **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 still 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 * - `true`: missing production dependencies are only logged as warnings (the electron-builder\n * ≤ 26 behavior).\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 * Independent of {@link ignoredProductionDependencies}, which controls which dependencies are\n * excluded from the copied `node_modules`; this option only controls validation of the\n * collection result.\n *\n * @default false\n */\n readonly allowMissingDependencies?: boolean | Array<string> | null\n\n /**\n * Configuration for native Node.js module installation and rebuilding.\n *\n * Groups all options that control how electron-builder handles native modules — from forcing\n * source builds during install through to the `@electron/rebuild` compilation mode.\n *\n * @see {@link NativeModulesConfig}\n */\n readonly nativeModules?: NativeModulesConfig | null\n\n /**\n * The build number.\n *\n * Maps to the `--iteration` flag for FPM-based Linux targets and is appended to the version\n * string in `CFBundleVersion` (macOS) and `FileVersion` (Windows) when {@link buildVersion} is\n * not set explicitly.\n *\n * If not set, falls back to the first defined environment variable among:\n * `BUILD_NUMBER`, `TRAVIS_BUILD_NUMBER`, `APPVEYOR_BUILD_NUMBER`, `CIRCLE_BUILD_NUM`,\n * `BUILD_BUILDNUMBER`, `CI_PIPELINE_IID`.\n */\n readonly buildNumber?: string | null\n\n /**\n * The full build version string.\n *\n * Maps to `CFBundleVersion` on macOS and the `FileVersion` metadata field on Windows.\n * Defaults to the `version` field from `package.json`.\n *\n * If `buildVersion` is not set but {@link buildNumber} is defined (or resolved from an\n * environment variable), the effective build version becomes `${version}.${buildNumber}`.\n */\n readonly buildVersion?: string | null\n\n /**\n * Whether to download the FFmpeg library variant from Electron's release assets and replace the\n * default (proprietary codec) FFmpeg library before signing.\n *\n * The alternate FFmpeg is compiled without proprietary codec support (H.264, AAC, etc.) and is\n * required for distributing on certain platforms (e.g., Linux distributions that prohibit\n * proprietary codecs). Enabling this swaps the bundled `ffmpeg` dynamic library before the app\n * is signed.\n */\n readonly downloadAlternateFFmpeg?: boolean\n\n /**\n * Additional properties to deep-merge into the app's `package.json` at build time.\n *\n * Useful for injecting build-time metadata (e.g., a git commit hash or CI build URL) that\n * should be readable at runtime via `require('./package.json')` or `import.meta.url`.\n *\n * @example\n * ```json\n * { \"extraMetadata\": { \"commitHash\": \"abc1234\", \"buildDate\": \"2025-01-01\" } }\n * ```\n */\n readonly extraMetadata?: any\n\n /**\n * Whether to throw an error and abort the build if the app could not be code-signed.\n *\n * Set to `true` in release pipelines to catch missing or misconfigured signing credentials\n * before producing unsigned artifacts. When `false` (the default), missing signing credentials\n * produce a warning and the build continues unsigned.\n *\n * @default false\n */\n readonly forceCodeSigning?: boolean\n\n /**\n * Whether to include `.pdb` (Program Database) symbol files in the output.\n *\n * PDB files enable Windows crash-dump analysis but significantly increase artifact size. Enable\n * for internal builds where you want symbol information; disable for public distribution.\n *\n * @default false\n */\n readonly includePdb?: boolean\n\n /**\n * Whether to remove the `scripts` field from bundled `package.json` files.\n *\n * Lifecycle scripts (`preinstall`, `postinstall`, etc.) have no meaning inside a packaged\n * Electron app and can trigger unintended behaviour if any tooling inspects the bundled\n * `package.json`. Removing them reduces artifact size and prevents accidental execution.\n *\n * @default true\n */\n readonly removePackageScripts?: boolean\n\n /**\n * Whether to remove the `keywords` field from bundled `package.json` files.\n *\n * The `keywords` array is only meaningful for package registry discoverability and has no\n * runtime value inside a packaged Electron app. Removing it marginally reduces artifact size.\n *\n * @default true\n */\n readonly removePackageKeywords?: boolean\n\n /**\n * Options forwarded to [`@electron/fuses`](https://github.com/electron/fuses) to flip Electron\n * feature flags in the binary.\n *\n * Fuses are compile-time-like flags baked into the Electron binary that cannot be changed at\n * runtime. Flipping them is the approved mechanism for hardening Electron apps (e.g., disabling\n * `ELECTRON_RUN_AS_NODE`, enabling ASAR integrity, etc.).\n *\n * electron-builder flips fuses after packaging but before signing so that the final signature\n * covers the modified binary.\n *\n * @see {@link FuseOptionsV1}\n */\n readonly electronFuses?: FuseOptionsV1 | null\n\n /**\n * Configuration for experimental concurrent (multi-platform / multi-arch) builds.\n *\n * When `jobs > 1`, electron-builder runs up to `jobs` platform builds in parallel. This is an\n * experimental feature — use with caution and verify that your hook functions and build resources\n * are safe to execute concurrently.\n *\n * @see {@link Concurrency}\n */\n readonly concurrency?: Concurrency | null\n}\n\n/**\n * The root build configuration object passed to electron-builder.\n *\n * Extends {@link CommonConfiguration} with top-level Electron-specific options, configuration\n * inheritance/presets, and all per-platform build hooks.\n */\nexport interface Configuration extends CommonConfiguration, PlatformSpecificBuildOptions, Hooks {\n /**\n * Options forwarded to [`@electron/get`](https://github.com/electron/get) when downloading the\n * Electron distribution to package.\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 electronGet?: ElectronGetOptions | null\n\n /**\n * Electron branding overrides.\n *\n * Required only when packaging a custom Electron fork that ships a modified `BRANDING.json`\n * (e.g., a fork that renames the `Electron Helper` process or the `Electron Framework`).\n * Standard Electron builds do not need this.\n */\n readonly electronBranding?: ElectronBrandingOptions\n\n /**\n * The Electron version to package against.\n *\n * Defaults to the version of the `electron` (or `electron-prebuilt`) dependency declared in\n * `package.json`. Set this explicitly only when the installed Electron version is not the one\n * you want to package against (e.g., in monorepos where the Electron dependency lives in a\n * different workspace).\n */\n electronVersion?: string | null\n\n /**\n * One or more configuration presets or file paths to merge into this configuration.\n *\n * Accepts a string or array of strings, each of which is either:\n * - A built-in preset name (`\"react-cra\"` is the only currently supported value).\n * - A path to a JS/JSON config file relative to the project directory.\n *\n * Configs are merged left-to-right using a deep-assign strategy that properly combines `files`\n * glob patterns rather than replacing them.\n *\n * The `react-cra` preset is applied automatically when `react-scripts` is found in\n * `dependencies`. Set `extends: null` to opt out of automatic preset detection.\n */\n extends?: Array<string> | string | null\n}\n\n/**\n * Configuration for native Node.js module installation and rebuilding.\n *\n * All options that control how electron-builder handles native modules — from forcing source\n * builds at install time through to the `@electron/rebuild` compilation mode.\n */\nexport interface NativeModulesConfig {\n /**\n * Whether to pass `--build-from-source` to the package manager when installing native\n * dependencies, forcing them to compile from source rather than using pre-built binaries.\n *\n * Useful when pre-built binaries are not available for the target platform/arch combination,\n * or when you need to ensure native modules are compiled against the exact Electron ABI.\n *\n * @default false\n */\n buildDependenciesFromSource?: boolean\n\n /**\n * Whether to run `node-gyp rebuild` with Electron headers before packaging.\n *\n * This is a low-level escape hatch for cases where the standard `@electron/rebuild` path\n * (controlled by {@link npmRebuild}) is insufficient. Most projects should leave this `false`\n * and rely on `@electron/rebuild` instead.\n *\n * When `true`, electron-builder runs `node-gyp rebuild` with the correct `npm_config_*`\n * environment variables set for the target Electron version and architecture before the\n * normal rebuild step.\n *\n * @default false\n */\n readonly nodeGypRebuild?: boolean\n\n /**\n * Whether to rebuild native Node.js modules for the target Electron version and architecture\n * before packaging.\n *\n * When `true` (the default), electron-builder runs `@electron/rebuild` against the app's\n * `node_modules` directory to ensure all native modules are compiled against the correct Electron\n * ABI. Set to `false` to skip this step entirely — useful when native modules are pre-built\n * elsewhere in your pipeline or when the app has no native dependencies.\n *\n * The compilation mode (`sequential` vs `parallel`) is controlled by {@link rebuildMode}.\n *\n * @default true\n */\n readonly npmRebuild?: boolean\n\n /**\n * Compilation mode for `@electron/rebuild`.\n *\n * - `\"sequential\"` — rebuilds native modules one at a time. Safer in memory-constrained\n * environments and produces cleaner log output.\n * - `\"parallel\"` — rebuilds all native modules concurrently. Faster on machines with many cores\n * and plentiful memory, but may exhaust resources on CI agents with limited RAM.\n *\n * @default \"sequential\"\n */\n readonly rebuildMode?: \"sequential\" | \"parallel\" | null\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 * Version pins and custom bundle overrides for the binary toolsets that electron-builder downloads and caches locally.\n *\n * Each toolset is a versioned archive hosted at [electron-userland/electron-builder-binaries](https://github.com/electron-userland/electron-builder-binaries/releases).\n * Omitting a property (or setting it to `latest`) selects the modern default for that toolset.\n *\n * To supply your own bundle, set the property to a {@link ToolsetCustom} object with a `url` (https:// or file://) and a `checksum` for verification. The bundle must mirror the expected directory layout of the corresponding built-in bundle; see the build scripts at\n * https://github.com/electron-userland/electron-builder-binaries/tree/master/packages.\n */\nexport interface ToolsetConfig {\n /**\n * Version of the `win-codesign` bundle used for Windows code signing and resource editing.\n *\n * The bundle ships:\n * - **`signtool.exe`** (Windows) / **`osslsigncode`** (macOS & Linux) — used to sign `.exe`,\n * `.dll`, and `.msix` artifacts.\n * - **`rcedit`** — embeds version metadata and icons into `.exe` files (legacy usage, migrated to npm `resedit` package).\n * - **Windows Kits** — used by AppX/MSIX packaging (`makeappx`, `signtool`).\n *\n * Available versions:\n * | Version | Notes |\n * |---------|-------|\n * | `\"0.0.0\"` | Legacy bundle — `winCodeSign-2.6.0` (pre-v27) |\n * | `\"1.0.0\"` | Windows Kits 10.0.26100.0, `osslsigncode` v2.9 |\n * | `\"1.1.1\"` | Updates `osslsigncode` to v2.11 |\n * | `\"1.2.1\"` | Adds native `osslsigncode` arm64 |\n * | `\"1.3.0\"` | Includes support for Azure Trusted Signing `signtool` via dlib and .NET 8 runtime |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/win-codesign/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly winCodeSign?: \"0.0.0\" | \"1.0.0\" | \"1.1.0\" | \"1.1.1\" | \"1.2.1\" | \"1.3.0\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the AppImage toolset bundle used for building `.AppImage` files.\n *\n * The bundle ships:\n * - **`mksquashfs`** — creates the SquashFS filesystem embedded in the AppImage.\n * - **`desktop-file-validate`** — validates the generated `.desktop` entry.\n * - **AppImage runtime** — the self-executing stub that mounts the SquashFS at launch.\n *\n * Available versions:\n * | Version | Runtime date | Notes |\n * |---------|-------------|-------|\n * | `\"0.0.0\"` | Legacy | FUSE2-based AppImage runtime (pre-v27) |\n * | `\"1.0.3\"` | 20251108 | Introduces static AppImage runtime |\n * | `\"1.1.0\"` | 20251108 | Adds `unsquashfs` support |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/appimage/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly appimage?: \"0.0.0\" | \"1.0.3\" | \"1.1.0\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the NSIS toolset bundle used to compile Windows installers.\n *\n * The bundle ships:\n * - **`makensis`** — the NSIS compiler invoked to build `.nsi` scripts into `.exe` installers.\n * - **NSIS plugins** — the plugin DLLs (`NsisMultiUser`, `UAC`, `StdUtils`, etc.) referenced by\n * electron-builder's default installer scripts.\n * - **`elevate.exe`** — UAC elevation helper included in NSIS installers.\n *\n * Available versions:\n * | Version | `makensis` version | Notes |\n * |---------|------------------|-------|\n * | `\"0.0.0\"` | 3.0.4.1 | Legacy split bundle — `nsis` + `nsis-resources` archives (pre-v27) |\n * | `\"1.2.1\"` | 3.12 | Unified bundle — single archive, entrypoint scripts auto-set `NSISDIR` |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/nsis/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly nsis?: \"0.0.0\" | \"1.2.1\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the Wine bundle used to run Windows tools (NSIS, rcedit, signtool) on\n * non-Windows hosts (macOS and Linux).\n *\n * Wine is only required when building Windows targets on a non-Windows machine. On Windows,\n * this setting has no effect.\n *\n * Available versions:\n * | Version | Wine version | Platform support | Notes |\n * |---------|-------------|-----------------|-------|\n * | `\"0.0.0\"` | 4.0.1 | macOS | Legacy portable bundle (pre-v27) |\n * | `\"1.0.1\"` | 11.0 | macOS | Supports arm64 macOS via Rosetta |\n *\n * To use a custom Wine binary, use a `ToolsetCustom` object.\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/wine/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly wine?: \"0.0.0\" | \"1.0.1\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the FPM bundle used to build Linux packages (`.deb`, `.rpm`, `.pacman`, etc.)\n * on macOS and Linux hosts.\n *\n * Available versions:\n * | Version | FPM version | Notes |\n * |---------|------------|-------|\n * | `\"2.2.1\"` | 1.17.0 (Ruby 3.4.3) | Current default |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/fpm/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly fpm?: \"2.2.1\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the Linux-tools-mac bundle used to produce `.tar.lz` archives and build\n * Linux targets on macOS hosts.\n *\n * The bundle ships macOS-native builds of `ar`, `lzip`, and `gtar` (GNU tar).\n *\n * Available versions:\n * | Version | Notes |\n * |---------|-------|\n * | `\"1.0.0\"` | gnu-tar, lzip, makedepend, glib, libgsf, libtool, pcre, gettext, binutils |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/linux-tools-mac/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly linuxToolsMac?: \"1.0.0\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the 7-Zip binary bundle used internally to extract `.7z` and `.tar.xz` archives.\n *\n * Set to a {@link ToolsetCustom} object to supply your own 7za binary.\n * The `url` must point to a directory (or a `.tar.gz`/`.zip` archive of one) that contains\n * `bin/7za` (macOS/Linux) or `bin/7za.exe` (Windows).\n *\n * **Bootstrap constraint:** the custom bundle itself must be a `.tar.gz` or `.zip` archive\n * (or a bare `file://` directory). `.7z` and `.tar.xz` archives cannot be used here because\n * extracting them requires 7za — a circular dependency.\n *\n * @default \"latest\"\n */\n readonly sevenZip?: \"1.0.0\" | ToolsetCustom | \"latest\"\n\n /**\n * Version of the icons-conversion bundle used to convert source images to `.icns`, `.ico`,\n * and PNG icon sets.\n *\n * Set to a {@link ToolsetCustom} object to supply your own icons bundle directory.\n *\n * Available versions:\n * | Version | Notes |\n * |---------|-------|\n * | `\"1.2.3\"` | Writes 16px/32px ICNS entries as `ic04`/`ic05` ARGB (fixes corrupt small icons in Finder) |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/icons/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly icons?: \"1.2.3\" | ToolsetCustom | \"latest\"\n}\n\n/**\n * A custom toolset bundle supplied by the user in place of a built-in versioned bundle.\n *\n * The bundle must mirror the expected directory layout of the corresponding built-in bundle.\n * See the build scripts at\n * https://github.com/electron-userland/electron-builder-binaries/tree/master/packages.\n *\n * File formats supported for `url` archives: `.zip`, `.7z`, `.tar.gz`, `.tar.xz`.\n *\n * @example\n * ```json\n * {\n * \"toolsets\": {\n * \"nsis\": {\n * \"url\": \"file:///path/to/my-nsis-bundle.tar.gz\",\n * \"checksum\": \"abc123...\",\n * \"version\": \"my-custom-1.0\"\n * }\n * }\n * }\n * ```\n */\nexport interface ToolsetCustom {\n /**\n * The `https://` URL or `file://` path to load the custom toolset bundle from.\n *\n * - `https://` — downloaded and cached locally; the archive is extracted before use.\n * - `file:///absolute/path` — used directly; relative paths must be within the project resources dir.\n *\n * Archives (`.zip`, `.7z`, `.tar.gz`, `.tar.xz`) are extracted automatically.\n * A bare directory path (no archive) is used as-is.\n */\n readonly url: string\n\n /**\n * SHA checksum of the custom toolset bundle for verification.\n * Required for remote (`https://`) URLs and local archive files (`file://`).\n * Not needed for bare directory paths — the directory is used as-is with no caching.\n */\n readonly checksum?: string\n\n /**\n * Optional version label used in the local cache directory name.\n * Falls back to the first 8 characters of `checksum` when omitted.\n */\n readonly version?: string\n}\n\n/**\n * Lifecycle hooks that run at specific points during the electron-builder pipeline.\n *\n * Each hook can be specified as:\n * - An **inline function** (JavaScript/TypeScript config files only):\n * ```js\n * // electron-builder.config.js\n * module.exports = { beforePack: async (context) => { /* ... *\\/ } }\n * ```\n * - A **path** to a CommonJS/ESM module (relative to the project directory) that exports the\n * hook as its **default export**:\n * ```json\n * { \"build\": { \"beforePack\": \"./scripts/myHook.js\" } }\n * ```\n * ```js\n * // scripts/myHook.js\n * export default async function (context) { /* ... *\\/ }\n * ```\n */\nexport interface Hooks {\n /**\n * Called immediately before electron-builder begins packing the app for each platform/arch\n * combination.\n *\n * Use this hook to perform last-minute modifications to source files or build resources before\n * they are read by the packager.\n *\n * Receives a {@link BeforePackContext}.\n */\n readonly beforePack?: Hook<BeforePackContext, void> | string | null\n\n /**\n * Called after the prebuilt Electron binary has been extracted to the staging directory but\n * before the app files have been copied into it.\n *\n * Use this hook to patch or augment the Electron binary itself (e.g. rename helper processes,\n * inject native libraries) before the app payload is laid down on top.\n *\n * Receives an {@link AfterExtractContext}.\n */\n readonly afterExtract?: Hook<AfterExtractContext, void> | string | null\n\n /**\n * Called after the app files have been copied into the staging directory (and ASAR created if\n * applicable) but **before** signing and before the output archive/installer is built.\n *\n * Use this hook to post-process the staged app bundle (e.g. strip debug symbols, inject\n * platform-specific resources).\n *\n * Receives an {@link AfterPackContext}.\n */\n readonly afterPack?: Hook<AfterPackContext, void> | string | null\n\n /**\n * Called after code signing but **before** the signed app is packed into the final\n * distributable format (e.g. before `dmg` is created from the signed `.app`).\n *\n * Use this hook to perform post-sign validation or to add signed resources that are not part of\n * the main app bundle.\n *\n * Receives an {@link AfterPackContext}.\n */\n readonly afterSign?: Hook<AfterPackContext, void> | string | null\n\n /**\n * Called when an individual artifact build starts (e.g. just before a `.dmg` or `.exe` is\n * written to disk).\n *\n * Receives an {@link ArtifactBuildStarted}.\n */\n readonly artifactBuildStarted?: Hook<ArtifactBuildStarted, void> | string | null\n\n /**\n * Called when an individual artifact has been successfully built and written to disk.\n *\n * Use this hook to collect artifact paths, upload to custom destinations, or trigger\n * post-processing steps.\n *\n * Receives an {@link ArtifactCreated}.\n */\n readonly artifactBuildCompleted?: Hook<ArtifactCreated, void> | string | null\n\n /**\n * Called after **all** artifacts across all platforms/architectures have been built.\n *\n * May return an array of additional file paths that should be treated as publish targets\n * (i.e. uploaded to the configured publisher).\n *\n * Receives a {@link BuildResult}.\n *\n * @example\n * ```js\n * export default async function afterAllArtifactBuild(result) {\n * return [\"/path/to/extra-file.txt\"]\n * }\n * ```\n */\n readonly afterAllArtifactBuild?: Hook<BuildResult, Array<string>> | string | null\n\n /**\n * Called after the WiX MSI project XML has been written to a temporary directory but before\n * `candle.exe` / `light.exe` compile it into a `.msi` package.\n *\n * The hook receives the path to the project directory as a string. Use it to patch the generated\n * `.wxs` files for customizations not exposed through electron-builder's options.\n */\n readonly msiProjectCreated?: Hook<string, void> | string | null\n\n /**\n * Called after the AppX/MSIX manifest XML has been written to the staging directory but before\n * `makeappx` packages it.\n *\n * The hook receives the path to the manifest file as a string. Use it to inject custom manifest\n * extensions (capabilities, protocol handlers, etc.) not exposed through {@link AppXOptions}.\n */\n readonly appxManifestCreated?: Hook<string, void> | string | null\n\n /**\n * Called for every file inside each `node_modules` package directory as electron-builder\n * decides whether to include it in the packaged app.\n *\n * Return `true` to force-include the file regardless of the default exclusion rules.\n * Return `false` or `undefined` to let electron-builder apply its normal filtering logic.\n *\n * Receives the absolute path of the file as a string.\n */\n readonly onNodeModuleFile?: Hook<string, void | boolean> | string | null\n\n /**\n * Called before dependencies are installed or native modules are rebuilt.\n *\n * Return `false` (or a `Promise` that resolves to `false`) to skip the install/rebuild step\n * entirely — useful when you manage `node_modules` externally (e.g. in a CI pipeline that\n * restores them from cache). When not set, electron-builder proceeds with the normal\n * install/rebuild flow.\n *\n * If this hook is provided and `node_modules` is missing, electron-builder will not perform\n * the production-dependencies check.\n *\n * Receives a {@link BeforeBuildContext}.\n */\n readonly beforeBuild?: Hook<BeforeBuildContext, boolean | void> | string | null\n\n /**\n * Override the source of the Electron distribution to stage.\n *\n * Should return the path to either:\n * - A **directory** containing a pre-built, unpacked Electron app (e.g. `~/electron/out/R`).\n * - A **directory** containing Electron zip archives following the naming convention\n * `electron-v${version}-${platformName}-${arch}.zip`.\n *\n * When not set, electron-builder downloads the official Electron release from GitHub (or the\n * mirror configured via `electronGet`).\n *\n * Receives a {@link PrepareApplicationStageDirectoryOptions}.\n */\n readonly electronDist?: Hook<PrepareApplicationStageDirectoryOptions, string> | string | null\n}\n\n/**\n * Overrides for the input and output directories used during the build.\n */\nexport interface MetadataDirectories {\n /**\n * The directory that contains static build resources (icons, background images, license files,\n * custom NSIS scripts, etc.) that electron-builder reads during packaging.\n *\n * **Build resources are not copied into the packaged app.** If you need runtime access to a\n * file (e.g. a tray icon), include it explicitly via the `files` option:\n * ```json\n * { \"files\": [\"**\\/*\", \"build/icon.*\"] }\n * ```\n *\n * @default \"build\"\n */\n readonly buildResources?: string | null\n\n /**\n * The directory where electron-builder writes its output (installers, zip archives, etc.).\n *\n * [File macros](https://www.electron.build/file-patterns#file-macros) are supported, e.g.\n * `\"dist/${os}-${arch}\"` to separate outputs by platform and architecture.\n *\n * @default \"dist\"\n */\n readonly output?: string | null\n\n /**\n * The directory that contains the application's `package.json` and source code.\n *\n * Defaults to `app`, then `www`, then the project root. Set this when your packagable app\n * lives in a subdirectory (common in monorepos or when using a separate frontend build step).\n */\n readonly app?: string | null\n}\n\n/**\n * Configuration for experimental concurrent builds.\n */\nexport interface Concurrency {\n /**\n * Maximum number of platform/architecture builds to run in parallel.\n *\n * Set to `1` to disable concurrency (sequential builds, the safe default). Higher values\n * reduce wall-clock time on multi-platform builds at the cost of increased memory and CPU\n * usage. Ensure that your {@link Hooks} and build resources are safe to execute concurrently\n * before raising this limit.\n *\n * @default 1\n */\n jobs: number\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import { Filter } from "builder-util";
2
+ import { Nullish } from "builder-util-runtime";
2
3
  import { Minimatch } from "minimatch";
3
4
  import type { Configuration } from "./configuration.js";
4
5
  import { PlatformSpecificBuildOptions } from "./options/PlatformSpecificBuildOptions.js";
@@ -52,5 +53,19 @@ export interface GetFileMatchersOptions {
52
53
  readonly globalOutDir: string;
53
54
  readonly defaultSrc: string;
54
55
  }
56
+ /**
57
+ * Resolves a file set `to` to the destination a FileMatcher should copy into.
58
+ *
59
+ * - A missing `to` falls back to `defaultDestination`.
60
+ * - For file sets that are physically copied into the build output directory
61
+ * (see {@link VALIDATED_DESTINATION_NAMES}), the result is validated to stay inside it:
62
+ * absolute `to` values (POSIX, Windows drive-letter, or UNC — files would be copied to that
63
+ * literal path on the build machine) and relative values that escape `globalOutDir`
64
+ * (e.g. `../../usr/share`) throw. Relative hops that stay inside the build output directory
65
+ * (e.g. `to: "../Frameworks"` from `Contents/Resources` on macOS) remain valid.
66
+ * - `files` sets are exempt from validation: their `to` only participates in in-package (asar)
67
+ * relative math, so it is plainly resolved against `defaultDestination`.
68
+ */
69
+ export declare function resolveFileSetDestination(name: string, to: string | Nullish, defaultDestination: string, globalOutDir: string): string;
55
70
  export declare function getFileMatchers(config: Configuration, name: "files" | "extraFiles" | "extraResources" | "extraDistFiles", defaultDestination: string, options: GetFileMatchersOptions): Array<FileMatcher> | null;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AAO,EAAE,MAAM;IAOhC,UAAU,CAAC,OAAO,EAAE,MAAM;IAI1B,cAAc,CAAC,OAAO,EAAE,MAAM;IAI9B,OAAO;IAIP,kBAAkB,IAAI,OAAO;IAI7B,qBAAqB,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI;IA0BvE,YAAY,IAAI,MAAM;IAMtB,QAAQ;CAGT;AAyJD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAA;IACnD,QAAQ,CAAC,kBAAkB,EAAE,4BAA4B,CAAA;IACzD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAE7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;CAC5B;AAUD;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CA2BtI;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,OAAO,GAAG,YAAY,GAAG,gBAAgB,GAAG,gBAAgB,EAClE,kBAAkB,EAAE,MAAM,EAC1B,OAAO,EAAE,sBAAsB,GAC9B,KAAK,CAAC,WAAW,CAAC,GAAG,IAAI,CA4C3B"}
@@ -1,4 +1,4 @@
1
- import { asArray, copyDir, copyOrLinkFile, log, statOrNull, USE_HARD_LINKS } from "builder-util";
1
+ import { asArray, copyDir, copyOrLinkFile, InvalidConfigurationError, log, statOrNull, USE_HARD_LINKS } from "builder-util";
2
2
  import { mkdir } from "fs/promises";
3
3
  import { Minimatch } from "minimatch";
4
4
  import * as path from "path";
@@ -394,6 +394,45 @@ export function getNodeModuleFileMatcher(appDir, destination, macroExpander, pla
394
394
  }
395
395
  return matcher;
396
396
  }
397
+ // The names whose file sets are physically copied into the build output directory, so a `to` that
398
+ // resolves outside of it writes onto the build machine itself (https://github.com/electron-userland/electron-builder/issues/1993).
399
+ // `files` is excluded: its `to` is only used for in-package (asar) relative math.
400
+ const VALIDATED_DESTINATION_NAMES = ["extraFiles", "extraResources", "extraDistFiles"];
401
+ const FPM_MAPPING_HINT = 'To install a file at an absolute path inside a deb/rpm package, use the fpm file-mapping syntax instead, e.g. "deb": { "fpm": ["build/file.xml=/usr/share/metainfo/file.xml"] }.';
402
+ /**
403
+ * Resolves a file set `to` to the destination a FileMatcher should copy into.
404
+ *
405
+ * - A missing `to` falls back to `defaultDestination`.
406
+ * - For file sets that are physically copied into the build output directory
407
+ * (see {@link VALIDATED_DESTINATION_NAMES}), the result is validated to stay inside it:
408
+ * absolute `to` values (POSIX, Windows drive-letter, or UNC — files would be copied to that
409
+ * literal path on the build machine) and relative values that escape `globalOutDir`
410
+ * (e.g. `../../usr/share`) throw. Relative hops that stay inside the build output directory
411
+ * (e.g. `to: "../Frameworks"` from `Contents/Resources` on macOS) remain valid.
412
+ * - `files` sets are exempt from validation: their `to` only participates in in-package (asar)
413
+ * relative math, so it is plainly resolved against `defaultDestination`.
414
+ */
415
+ export function resolveFileSetDestination(name, to, defaultDestination, globalOutDir) {
416
+ if (to == null) {
417
+ return defaultDestination;
418
+ }
419
+ if (!VALIDATED_DESTINATION_NAMES.includes(name)) {
420
+ return path.resolve(defaultDestination, to);
421
+ }
422
+ // path.win32.isAbsolute also covers POSIX absolute paths, and treats drive-letter (C:\) and
423
+ // UNC (\\server\share) paths as absolute no matter which OS the build runs on
424
+ if (path.win32.isAbsolute(to) || path.posix.isAbsolute(to)) {
425
+ throw new InvalidConfigurationError(`The "to" path "${to}" in "${name}" is absolute. Absolute destinations are not copied into the packaged app — they would be written to that literal path on the build machine. Use a relative path instead. ${FPM_MAPPING_HINT}`);
426
+ }
427
+ // FileMatcher later converts all separators to path.sep, so normalize before resolving to make
428
+ // sure `..\\..` segments written with backslashes are seen as parent hops here too
429
+ const resolved = path.resolve(defaultDestination, to.replace(/[/\\]/g, path.sep));
430
+ const relativeToOutDir = path.relative(path.resolve(globalOutDir), resolved);
431
+ if (relativeToOutDir.startsWith(`..${path.sep}`) || relativeToOutDir === ".." || path.isAbsolute(relativeToOutDir)) {
432
+ throw new InvalidConfigurationError(`The "to" path "${to}" in "${name}" resolves to "${resolved}", which is outside the build output directory "${path.resolve(globalOutDir)}". The files would be copied onto the build machine instead of into the packaged app. Use a relative path that stays within the package. ${FPM_MAPPING_HINT}`);
433
+ }
434
+ return resolved;
435
+ }
397
436
  export function getFileMatchers(config, name, defaultDestination, options) {
398
437
  const defaultMatcher = new FileMatcher(options.defaultSrc, defaultDestination, options.macroExpander);
399
438
  const fileMatchers = [];
@@ -415,7 +454,7 @@ export function getFileMatchers(config, name, defaultDestination, options) {
415
454
  }
416
455
  else {
417
456
  const from = pattern.from == null ? options.defaultSrc : path.resolve(options.defaultSrc, pattern.from);
418
- const to = pattern.to == null ? defaultDestination : path.resolve(defaultDestination, pattern.to);
457
+ const to = resolveFileSetDestination(name, pattern.to, defaultDestination, options.globalOutDir);
419
458
  fileMatchers.push(new FileMatcher(from, to, options.macroExpander, pattern.filter));
420
459
  }
421
460
  }
@@ -1 +1 @@
1
- {"version":3,"file":"fileMatcher.js","sourceRoot":"","sources":["../src/fileMatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAA2B,GAAG,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAEzH,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAK5B,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEzD,mEAAmE;AACnE,MAAM,gBAAgB,GAAG,EAAE,GAAG,EA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AC3C,oEAAoE;YACpE,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC;gBAC3C,OAAO,MAAM,cAAc,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAA;YACxH,CAAC;YAED,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;YAC1D,OAAO,MAAM,cAAc,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;QACjE,CAAC;QAED,IAAI,OAAO,CAAC,OAAO,EAAE,IAAI,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;YACtD,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;QAChC,CAAC;QACD,GAAG,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,EAAE,6BAA6B,CAAC,CAAA;QACrD,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,YAAY,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;IACvJ,CAAC,CAAC,CACH,CAAA;AACH,CAAC","sourcesContent":["import { asArray, copyDir, copyOrLinkFile, FileTransformer, Filter, log, statOrNull, USE_HARD_LINKS } from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport { mkdir } from \"fs/promises\"\nimport { Minimatch } from \"minimatch\"\nimport * as path from \"path\"\nimport type { Configuration } from \"./configuration.js\"\nimport type { Packager } from \"./packager.js\"\nimport { FileSet, PlatformSpecificBuildOptions } from \"./options/PlatformSpecificBuildOptions.js\"\nimport { PlatformPackager } from \"./platformPackager.js\"\nimport { createFilter, hasMagic } from \"./util/filter.js\"\n\n// https://github.com/electron-userland/electron-builder/issues/733\nconst minimatchOptions = { dot: true }\n\n// noinspection SpellCheckingInspection\n// File/dir names excluded by default from the packaged app. A `files` entry may opt any of these\n// back in (see collectExplicitReincludes / getDefaultIgnoredPatterns).\nexport const DEFAULT_EXCLUDED_NAMES: ReadonlyArray<string> = [\n \".git\",\n \".hg\",\n \".svn\",\n \"CVS\",\n \"RCS\",\n \"SCCS\",\n \"__pycache__\",\n \".DS_Store\",\n \"thumbs.db\",\n \".gitignore\",\n \".gitkeep\",\n \".gitattributes\",\n \".npmignore\",\n \".idea\",\n \".vs\",\n \".flowconfig\",\n \".jshintrc\",\n \".eslintrc\",\n \".circleci\",\n \".yarn-integrity\",\n \".yarn-metadata.json\",\n \"yarn-error.log\",\n \"yarn.lock\",\n \"package-lock.json\",\n \"npm-debug.log\",\n \"pnpm-lock.yaml\",\n \"bun.lock\",\n \"bun.lockb\",\n \"appveyor.yml\",\n \".travis.yml\",\n \"circle.yml\",\n \".nyc_output\",\n \".husky\",\n \".github\",\n \"electron-builder.env\",\n]\n\n// File extensions (without leading dot) excluded by default from the packaged app.\nexport const DEFAULT_EXCLUDED_EXTENSIONS: ReadonlyArray<string> = [\n \"iml\",\n \"hprof\",\n \"orig\",\n \"pyc\",\n \"pyo\",\n \"rbc\",\n \"swp\",\n \"csproj\",\n \"sln\",\n \"suo\",\n \"xproj\",\n \"cc\",\n \"d.ts\",\n // https://github.com/electron-userland/electron-builder/issues/7512\n \"mk\",\n \"a\",\n \"o\",\n \"obj\",\n \"forge-meta\",\n]\n\n// Hard cap on the number of strings a single pattern may expand to. Real opt-in patterns expand to a\n// handful (`{obj,gltf,glb}`); this bound makes the expansion provably finite so a pathological pattern\n// (e.g. nested or many large `{...}` groups whose product is huge) degrades to \"treated literally\"\n// rather than hanging/OOM-ing the build. minimatch performs the authoritative expansion downstream.\nconst MAX_BRACE_EXPANSIONS = 64\n\n// Expands `{a,b,c}` brace alternations in a pattern, honoring nesting. Returns the value unchanged\n// when it has no braces or would expand beyond MAX_BRACE_EXPANSIONS. Used only to detect which\n// extensions/names a `files` entry references — not for matching.\nfunction expandBraces(value: string): Array<string> {\n const open = value.indexOf(\"{\")\n if (open === -1) {\n return [value]\n }\n // Find the `}` that closes the first `{`, accounting for nested braces.\n let depth = 0\n let close = -1\n for (let i = open; i < value.length; i++) {\n if (value[i] === \"{\") {\n depth++\n } else if (value[i] === \"}\" && --depth === 0) {\n close = i\n break\n }\n }\n if (close === -1) {\n return [value]\n }\n\n const prefix = value.slice(0, open)\n const suffix = value.slice(close + 1)\n const result: Array<string> = []\n for (const alternative of splitTopLevel(value.slice(open + 1, close))) {\n for (const expanded of expandBraces(`${prefix}${alternative}${suffix}`)) {\n if (result.length >= MAX_BRACE_EXPANSIONS) {\n return [value]\n }\n result.push(expanded)\n }\n }\n return result\n}\n\n// Splits on commas that are not inside a nested brace group, so `a,{b,c}` yields [\"a\", \"{b,c}\"].\nfunction splitTopLevel(value: string): Array<string> {\n const parts: Array<string> = []\n let depth = 0\n let start = 0\n for (let i = 0; i < value.length; i++) {\n const ch = value[i]\n if (ch === \"{\") {\n depth++\n } else if (ch === \"}\") {\n depth--\n } else if (ch === \",\" && depth === 0) {\n parts.push(value.slice(start, i))\n start = i + 1\n }\n }\n parts.push(value.slice(start))\n return parts\n}\n\n/**\n * Determines which default-excluded extensions and names a user has explicitly opted back in to via\n * their `files` patterns, so the corresponding defaults are not re-applied.\n *\n * A default is treated as opted back in only when a non-negated pattern references it concretely:\n * an extension when a pattern's basename ends with `.<ext>` (e.g. `**\\/*.obj`, `assets/*.{obj,gltf}`,\n * `**\\/*.d.ts`); a name when any path segment equals it (e.g. `**\\/.github/**`, `**\\/yarn.lock`).\n * Broad patterns such as `**\\/*` reference nothing concrete and therefore opt nothing in.\n */\nexport function collectExplicitReincludes(patterns: ReadonlyArray<string>): { extensions: Set<string>; names: Set<string> } {\n const segments = new Set<string>()\n const basenames: Array<string> = []\n for (const pattern of patterns) {\n if (pattern.startsWith(\"!\")) {\n continue\n }\n for (const expanded of expandBraces(pattern)) {\n const parts = expanded.split(\"/\")\n for (const part of parts) {\n segments.add(part)\n }\n basenames.push(parts[parts.length - 1])\n }\n }\n\n const extensions = new Set(DEFAULT_EXCLUDED_EXTENSIONS.filter(ext => basenames.some(name => name.endsWith(`.${ext}`))))\n const names = new Set(DEFAULT_EXCLUDED_NAMES.filter(name => segments.has(name)))\n return { extensions, names }\n}\n\n/**\n * Builds the trailing list of default ignore globs appended to the main app file matcher. Extensions\n * and names the user has explicitly re-included (see {@link collectExplicitReincludes}) are omitted,\n * so a `files` entry like `**\\/*.obj` overrides the matching built-in exclusion.\n */\nexport function getDefaultIgnoredPatterns(userPatterns: ReadonlyArray<string>, includePdb: boolean): Array<string> {\n const reincluded = collectExplicitReincludes(userPatterns)\n\n const extensions = DEFAULT_EXCLUDED_EXTENSIONS.filter(ext => !reincluded.extensions.has(ext))\n if (!includePdb) {\n extensions.push(\"pdb\")\n }\n const names = DEFAULT_EXCLUDED_NAMES.filter(name => !reincluded.names.has(name))\n\n const patterns: Array<string> = []\n // minimatch does not expand a single-member brace (`{x}` is matched literally), so emit a bare\n // glob when only one extension/name survives the opt-in filtering.\n if (extensions.length === 1) {\n patterns.push(`!**/*.${extensions[0]}`)\n } else if (extensions.length > 1) {\n patterns.push(`!**/*.{${extensions.join(\",\")}}`)\n }\n patterns.push(\"!**/._*\")\n patterns.push(\"!**/electron-builder.{yaml,yml,json,json5,toml,ts}\")\n if (names.length === 1) {\n patterns.push(`!**/${names[0]}`)\n } else if (names.length > 1) {\n patterns.push(`!**/{${names.join(\",\")}}`)\n }\n patterns.push(\"!.yarn{,/**/*}\")\n // https://github.com/electron-userland/electron-builder/issues/1969\n // exclude only for app root, use .yarnclean to clean node_modules\n patterns.push(\"!.editorconfig\")\n patterns.push(\"!.yarnrc.yml\")\n return patterns\n}\n\n/**\n * Returns the default-excluded names/extensions that the given `files` patterns opt back in, formatted\n * for display (extensions as `*.<ext>`, names verbatim). Empty when nothing default-excluded is\n * re-included. Used to warn that files normally kept out of the package will now be included.\n */\nexport function getReincludedDefaultExclusions(patterns: ReadonlyArray<string>): Array<string> {\n const reincluded = collectExplicitReincludes(patterns)\n return [...[...reincluded.extensions].map(ext => `*.${ext}`), ...reincluded.names]\n}\n\nfunction ensureNoEndSlash(file: string): string {\n if (path.sep !== \"/\") {\n file = file.replace(/\\//g, path.sep)\n }\n if (path.sep !== \"\\\\\") {\n file = file.replace(/\\\\/g, path.sep)\n }\n\n if (file.endsWith(path.sep)) {\n return file.substring(0, file.length - 1)\n } else {\n return file\n }\n}\n\nexport class FileMatcher {\n readonly from: string\n readonly to: string\n\n readonly patterns: Array<string>\n\n excludePatterns: Array<Minimatch> | null = null\n\n readonly isSpecifiedAsEmptyArray: boolean\n\n constructor(\n from: string,\n to: string,\n readonly macroExpander: (pattern: string) => string,\n patterns?: Array<string> | string | null\n ) {\n this.from = ensureNoEndSlash(macroExpander(from))\n this.to = ensureNoEndSlash(macroExpander(to))\n this.patterns = asArray(patterns).map(it => this.normalizePattern(it))\n this.isSpecifiedAsEmptyArray = Array.isArray(patterns) && patterns.length === 0\n }\n\n normalizePattern(pattern: string) {\n if (pattern.startsWith(\"./\")) {\n pattern = pattern.substring(\"./\".length)\n }\n return path.posix.normalize(this.macroExpander(pattern.replace(/\\\\/g, \"/\")))\n }\n\n addPattern(pattern: string) {\n this.patterns.push(this.normalizePattern(pattern))\n }\n\n prependPattern(pattern: string) {\n this.patterns.unshift(this.normalizePattern(pattern))\n }\n\n isEmpty() {\n return this.patterns.length === 0\n }\n\n containsOnlyIgnore(): boolean {\n return !this.isEmpty() && this.patterns.find(it => !it.startsWith(\"!\")) == null\n }\n\n computeParsedPatterns(result: Array<Minimatch>, fromDir?: string): void {\n const relativeFrom = fromDir == null ? null : path.relative(fromDir, this.from)\n\n if (this.patterns.length === 0 && relativeFrom != null) {\n // file mappings, from here is a file\n result.push(new Minimatch(relativeFrom, minimatchOptions))\n return\n }\n\n for (let pattern of this.patterns) {\n if (relativeFrom != null) {\n pattern = path.join(relativeFrom, pattern)\n }\n\n const parsedPattern = new Minimatch(pattern, minimatchOptions)\n result.push(parsedPattern)\n\n // do not add if contains dot (possibly file if has extension)\n if (!pattern.includes(\".\") && !hasMagic(parsedPattern)) {\n // https://github.com/electron-userland/electron-builder/issues/545\n // add **/*\n result.push(new Minimatch(`${pattern}/**/*`, minimatchOptions))\n }\n }\n }\n\n createFilter(): Filter {\n const parsedPatterns: Array<Minimatch> = []\n this.computeParsedPatterns(parsedPatterns)\n return createFilter(this.from, parsedPatterns, this.excludePatterns)\n }\n\n toString() {\n return `from: ${this.from}, to: ${this.to}, patterns: ${this.patterns.join(\", \")}`\n }\n}\n\n/** @internal */\nexport function getMainFileMatchers(\n appDir: string,\n destination: string,\n macroExpander: (pattern: string) => string,\n platformSpecificBuildOptions: PlatformSpecificBuildOptions,\n platformPackager: PlatformPackager<any>,\n outDir: string\n): Array<FileMatcher> {\n const buildResourceDir = path.resolve(platformPackager.projectDir, platformPackager.buildResourcesDir)\n\n let matchers = platformPackager.isPrepackedAppAsar\n ? null\n : getFileMatchers(platformPackager.config, \"files\", destination, {\n macroExpander,\n customBuildOptions: platformSpecificBuildOptions,\n globalOutDir: outDir,\n defaultSrc: appDir,\n })\n if (matchers == null) {\n matchers = [new FileMatcher(appDir, destination, macroExpander)]\n }\n\n const matcher = matchers[0]\n // add default patterns, but only if from equals to app dir\n if (matcher.from !== appDir) {\n return matchers\n }\n\n // https://github.com/electron-userland/electron-builder/issues/1741#issuecomment-311111418 so, do not use inclusive patterns\n const patterns = matcher.patterns\n\n // Snapshot the user-specified patterns before the default/auto patterns are injected so a `files`\n // entry can opt back in to a default-excluded extension/name (see getDefaultIgnoredPatterns).\n const userSpecifiedPatterns = patterns.slice()\n\n const customFirstPatterns: Array<string> = []\n // electron-webpack - we need to copy only package.json and node_modules from root dir (and these files are added by default), so, explicit empty array is specified\n if (!matcher.isSpecifiedAsEmptyArray && (matcher.isEmpty() || matcher.containsOnlyIgnore())) {\n customFirstPatterns.push(\"**/*\")\n } else if (!patterns.includes(\"package.json\")) {\n patterns.push(\"package.json\")\n }\n\n let insertExculdeNodeModulesIndex = -1\n for (let i = 0; i < patterns.length; i++) {\n if (!patterns[i].startsWith(\"!\") && (patterns[i].includes(\"/node_modules\") || patterns[i].includes(\"node_modules/\"))) {\n insertExculdeNodeModulesIndex = i\n break\n }\n }\n\n if (insertExculdeNodeModulesIndex !== -1) {\n patterns.splice(insertExculdeNodeModulesIndex, 0, ...[\"!**/node_modules/**\"])\n } else {\n customFirstPatterns.push(\"!**/node_modules/**\")\n }\n\n // https://github.com/electron-userland/electron-builder/issues/1482\n const relativeBuildResourceDir = path.relative(matcher.from, buildResourceDir)\n if (relativeBuildResourceDir.length !== 0 && !relativeBuildResourceDir.startsWith(\".\")) {\n customFirstPatterns.push(`!${relativeBuildResourceDir}{,/**/*}`)\n }\n\n const relativeOutDir = matcher.normalizePattern(path.relative(platformPackager.projectDir, outDir))\n if (!relativeOutDir.startsWith(\".\")) {\n customFirstPatterns.push(`!${relativeOutDir}{,/**/*}`)\n }\n\n // add our default exclusions after last user possibly defined \"all\"/permissive pattern\n let insertIndex = 0\n for (let i = patterns.length - 1; i >= 0; i--) {\n if (patterns[i].startsWith(\"**/\")) {\n insertIndex = i + 1\n break\n }\n }\n patterns.splice(insertIndex, 0, ...customFirstPatterns)\n\n const reincludedDefaults = getReincludedDefaultExclusions(userSpecifiedPatterns)\n if (reincludedDefaults.length > 0) {\n // These files are kept out of the package by default; a user `files` pattern is opting them back in.\n log.warn({ files: reincludedDefaults.join(\", \") }, \"`files` configuration re-includes files that are excluded by default — verify this is intentional\")\n }\n\n patterns.push(...getDefaultIgnoredPatterns(userSpecifiedPatterns, platformPackager.config.includePdb === true))\n\n const debugLogger = platformPackager.debugLogger\n if (debugLogger.isEnabled) {\n //tslint:disable-next-line:no-invalid-template-strings\n debugLogger.add(`${macroExpander(\"${arch}\")}.firstOrDefaultFilePatterns`, patterns)\n }\n return matchers\n}\n\n/** @internal */\nexport function getNodeModuleFileMatcher(\n appDir: string,\n destination: string,\n macroExpander: (pattern: string) => string,\n platformSpecificBuildOptions: PlatformSpecificBuildOptions,\n packager: Packager\n): FileMatcher {\n // https://github.com/electron-userland/electron-builder/pull/2948#issuecomment-392241632\n // grab only excludes\n const matcher = new FileMatcher(appDir, destination, macroExpander)\n\n function addPatterns(patterns: Array<string | FileSet> | string | Nullish | FileSet) {\n if (patterns == null) {\n return\n } else if (!Array.isArray(patterns)) {\n if (typeof patterns === \"string\" && patterns.startsWith(\"!\")) {\n matcher.addPattern(patterns)\n return\n }\n // ignore object form\n return\n }\n\n for (const pattern of patterns) {\n if (typeof pattern === \"string\") {\n if (pattern.startsWith(\"!\")) {\n matcher.addPattern(pattern)\n }\n } else {\n const fileSet = pattern\n if (fileSet.from == null || fileSet.from === \".\") {\n for (const p of asArray(fileSet.filter)) {\n matcher.addPattern(p)\n }\n }\n }\n }\n }\n\n addPatterns(packager.config.files)\n addPatterns(platformSpecificBuildOptions.files)\n\n if (!matcher.isEmpty()) {\n matcher.prependPattern(\"**/*\")\n }\n\n const debugLogger = packager.debugLogger\n if (debugLogger.isEnabled) {\n //tslint:disable-next-line:no-invalid-template-strings\n debugLogger.add(`${macroExpander(\"${arch}\")}.nodeModuleFilePatterns`, matcher.patterns)\n }\n\n return matcher\n}\n\nexport interface GetFileMatchersOptions {\n readonly macroExpander: (pattern: string) => string\n readonly customBuildOptions: PlatformSpecificBuildOptions\n readonly globalOutDir: string\n\n readonly defaultSrc: string\n}\n\nexport function getFileMatchers(\n config: Configuration,\n name: \"files\" | \"extraFiles\" | \"extraResources\" | \"extraDistFiles\",\n defaultDestination: string,\n options: GetFileMatchersOptions\n): Array<FileMatcher> | null {\n const defaultMatcher = new FileMatcher(options.defaultSrc, defaultDestination, options.macroExpander)\n const fileMatchers: Array<FileMatcher> = []\n\n function addPatterns(patterns: Array<string | FileSet> | string | Nullish | FileSet) {\n if (patterns == null) {\n return\n } else if (!Array.isArray(patterns)) {\n if (typeof patterns === \"string\") {\n defaultMatcher.addPattern(patterns)\n return\n }\n patterns = [patterns]\n }\n\n for (const pattern of patterns) {\n if (typeof pattern === \"string\") {\n // use normalize to transform ./foo to foo\n defaultMatcher.addPattern(pattern)\n } else {\n const from = pattern.from == null ? options.defaultSrc : path.resolve(options.defaultSrc, pattern.from)\n const to = pattern.to == null ? defaultDestination : path.resolve(defaultDestination, pattern.to)\n fileMatchers.push(new FileMatcher(from, to, options.macroExpander, pattern.filter))\n }\n }\n }\n\n if (name !== \"extraDistFiles\") {\n addPatterns((config as any)[name])\n }\n addPatterns((options.customBuildOptions as any)[name])\n\n if (!defaultMatcher.isEmpty()) {\n // default matcher should be first in the array\n fileMatchers.unshift(defaultMatcher)\n }\n\n // we cannot exclude the whole out dir, because sometimes users want to use some file in the out dir in the patterns\n const relativeOutDir = defaultMatcher.normalizePattern(path.relative(options.defaultSrc, options.globalOutDir))\n if (!relativeOutDir.startsWith(\".\")) {\n defaultMatcher.addPattern(`!${relativeOutDir}/*-unpacked{,/**/*}`)\n }\n\n return fileMatchers.length === 0 ? null : fileMatchers\n}\n\n/** @internal */\nexport function copyFiles(matchers: Array<FileMatcher> | null, transformer: FileTransformer | null, isUseHardLink?: boolean): Promise<any> {\n if (matchers == null || matchers.length === 0) {\n return Promise.resolve()\n }\n\n return Promise.all(\n matchers.map(async (matcher: FileMatcher) => {\n const fromStat = await statOrNull(matcher.from)\n if (fromStat == null) {\n log.warn({ from: matcher.from }, `file source doesn't exist`)\n return\n }\n\n if (fromStat.isFile()) {\n const toStat = await statOrNull(matcher.to)\n // https://github.com/electron-userland/electron-builder/issues/1245\n if (toStat != null && toStat.isDirectory()) {\n return await copyOrLinkFile(matcher.from, path.join(matcher.to, path.basename(matcher.from)), fromStat, isUseHardLink)\n }\n\n await mkdir(path.dirname(matcher.to), { recursive: true })\n return await copyOrLinkFile(matcher.from, matcher.to, fromStat)\n }\n\n if (matcher.isEmpty() || matcher.containsOnlyIgnore()) {\n matcher.prependPattern(\"**/*\")\n }\n log.debug({ matcher }, \"copying files using pattern\")\n return await copyDir(matcher.from, matcher.to, { filter: matcher.createFilter(), transformer, isUseHardLink: isUseHardLink ? USE_HARD_LINKS : null })\n })\n )\n}\n"]}
1
+ {"version":3,"file":"fileMatcher.js","sourceRoot":"","sources":["../src/fileMatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAA2B,yBAAyB,EAAE,GAAG,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAEpJ,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAK5B,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEzD,mEAAmE;AACnE,MAAM,gBAAgB,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAA;AAEtC,uCAAuC;AACvC,iGAAiG;AACjG,uEAAuE;AACvE,MAAM,CAAC,MAAM,sBAAsB,GAA0B;IAC3D,MAAM;IACN,KAAK;IACL,MAAM;IACN,KAAK;IACL,KAAK;IACL,MAAM;IACN,aAAa;IACb,WAAW;IACX,WAAW;IACX,YAAY;IACZ,UAAU;IACV,gBAAgB;IAChB,YAAY;IACZ,OAAO;IACP,KAAK;IACL,aAAa;IACb,WAAW;IACX,WAAW;IACX,WAAW;IACX,iBAAiB;IACjB,qBAAqB;IACrB,gBAAgB;IAChB,WAAW;IACX,mBAAmB;IACnB,eAAe;IACf,gBAAgB;IAChB,UAAU;IACV,WAAW;IACX,cAAc;IACd,aAAa;IACb,YAAY;IACZ,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AC,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;YAC1D,OAAO,MAAM,cAAc,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;QACjE,CAAC;QAED,IAAI,OAAO,CAAC,OAAO,EAAE,IAAI,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;YACtD,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;QAChC,CAAC;QACD,GAAG,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,EAAE,6BAA6B,CAAC,CAAA;QACrD,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,YAAY,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;IACvJ,CAAC,CAAC,CACH,CAAA;AACH,CAAC","sourcesContent":["import { asArray, copyDir, copyOrLinkFile, FileTransformer, Filter, InvalidConfigurationError, log, statOrNull, USE_HARD_LINKS } from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport { mkdir } from \"fs/promises\"\nimport { Minimatch } from \"minimatch\"\nimport * as path from \"path\"\nimport type { Configuration } from \"./configuration.js\"\nimport type { Packager } from \"./packager.js\"\nimport { FileSet, PlatformSpecificBuildOptions } from \"./options/PlatformSpecificBuildOptions.js\"\nimport { PlatformPackager } from \"./platformPackager.js\"\nimport { createFilter, hasMagic } from \"./util/filter.js\"\n\n// https://github.com/electron-userland/electron-builder/issues/733\nconst minimatchOptions = { dot: true }\n\n// noinspection SpellCheckingInspection\n// File/dir names excluded by default from the packaged app. A `files` entry may opt any of these\n// back in (see collectExplicitReincludes / getDefaultIgnoredPatterns).\nexport const DEFAULT_EXCLUDED_NAMES: ReadonlyArray<string> = [\n \".git\",\n \".hg\",\n \".svn\",\n \"CVS\",\n \"RCS\",\n \"SCCS\",\n \"__pycache__\",\n \".DS_Store\",\n \"thumbs.db\",\n \".gitignore\",\n \".gitkeep\",\n \".gitattributes\",\n \".npmignore\",\n \".idea\",\n \".vs\",\n \".flowconfig\",\n \".jshintrc\",\n \".eslintrc\",\n \".circleci\",\n \".yarn-integrity\",\n \".yarn-metadata.json\",\n \"yarn-error.log\",\n \"yarn.lock\",\n \"package-lock.json\",\n \"npm-debug.log\",\n \"pnpm-lock.yaml\",\n \"bun.lock\",\n \"bun.lockb\",\n \"appveyor.yml\",\n \".travis.yml\",\n \"circle.yml\",\n \".nyc_output\",\n \".husky\",\n \".github\",\n \"electron-builder.env\",\n]\n\n// File extensions (without leading dot) excluded by default from the packaged app.\nexport const DEFAULT_EXCLUDED_EXTENSIONS: ReadonlyArray<string> = [\n \"iml\",\n \"hprof\",\n \"orig\",\n \"pyc\",\n \"pyo\",\n \"rbc\",\n \"swp\",\n \"csproj\",\n \"sln\",\n \"suo\",\n \"xproj\",\n \"cc\",\n \"d.ts\",\n // https://github.com/electron-userland/electron-builder/issues/7512\n \"mk\",\n \"a\",\n \"o\",\n \"obj\",\n \"forge-meta\",\n]\n\n// Hard cap on the number of strings a single pattern may expand to. Real opt-in patterns expand to a\n// handful (`{obj,gltf,glb}`); this bound makes the expansion provably finite so a pathological pattern\n// (e.g. nested or many large `{...}` groups whose product is huge) degrades to \"treated literally\"\n// rather than hanging/OOM-ing the build. minimatch performs the authoritative expansion downstream.\nconst MAX_BRACE_EXPANSIONS = 64\n\n// Expands `{a,b,c}` brace alternations in a pattern, honoring nesting. Returns the value unchanged\n// when it has no braces or would expand beyond MAX_BRACE_EXPANSIONS. Used only to detect which\n// extensions/names a `files` entry references — not for matching.\nfunction expandBraces(value: string): Array<string> {\n const open = value.indexOf(\"{\")\n if (open === -1) {\n return [value]\n }\n // Find the `}` that closes the first `{`, accounting for nested braces.\n let depth = 0\n let close = -1\n for (let i = open; i < value.length; i++) {\n if (value[i] === \"{\") {\n depth++\n } else if (value[i] === \"}\" && --depth === 0) {\n close = i\n break\n }\n }\n if (close === -1) {\n return [value]\n }\n\n const prefix = value.slice(0, open)\n const suffix = value.slice(close + 1)\n const result: Array<string> = []\n for (const alternative of splitTopLevel(value.slice(open + 1, close))) {\n for (const expanded of expandBraces(`${prefix}${alternative}${suffix}`)) {\n if (result.length >= MAX_BRACE_EXPANSIONS) {\n return [value]\n }\n result.push(expanded)\n }\n }\n return result\n}\n\n// Splits on commas that are not inside a nested brace group, so `a,{b,c}` yields [\"a\", \"{b,c}\"].\nfunction splitTopLevel(value: string): Array<string> {\n const parts: Array<string> = []\n let depth = 0\n let start = 0\n for (let i = 0; i < value.length; i++) {\n const ch = value[i]\n if (ch === \"{\") {\n depth++\n } else if (ch === \"}\") {\n depth--\n } else if (ch === \",\" && depth === 0) {\n parts.push(value.slice(start, i))\n start = i + 1\n }\n }\n parts.push(value.slice(start))\n return parts\n}\n\n/**\n * Determines which default-excluded extensions and names a user has explicitly opted back in to via\n * their `files` patterns, so the corresponding defaults are not re-applied.\n *\n * A default is treated as opted back in only when a non-negated pattern references it concretely:\n * an extension when a pattern's basename ends with `.<ext>` (e.g. `**\\/*.obj`, `assets/*.{obj,gltf}`,\n * `**\\/*.d.ts`); a name when any path segment equals it (e.g. `**\\/.github/**`, `**\\/yarn.lock`).\n * Broad patterns such as `**\\/*` reference nothing concrete and therefore opt nothing in.\n */\nexport function collectExplicitReincludes(patterns: ReadonlyArray<string>): { extensions: Set<string>; names: Set<string> } {\n const segments = new Set<string>()\n const basenames: Array<string> = []\n for (const pattern of patterns) {\n if (pattern.startsWith(\"!\")) {\n continue\n }\n for (const expanded of expandBraces(pattern)) {\n const parts = expanded.split(\"/\")\n for (const part of parts) {\n segments.add(part)\n }\n basenames.push(parts[parts.length - 1])\n }\n }\n\n const extensions = new Set(DEFAULT_EXCLUDED_EXTENSIONS.filter(ext => basenames.some(name => name.endsWith(`.${ext}`))))\n const names = new Set(DEFAULT_EXCLUDED_NAMES.filter(name => segments.has(name)))\n return { extensions, names }\n}\n\n/**\n * Builds the trailing list of default ignore globs appended to the main app file matcher. Extensions\n * and names the user has explicitly re-included (see {@link collectExplicitReincludes}) are omitted,\n * so a `files` entry like `**\\/*.obj` overrides the matching built-in exclusion.\n */\nexport function getDefaultIgnoredPatterns(userPatterns: ReadonlyArray<string>, includePdb: boolean): Array<string> {\n const reincluded = collectExplicitReincludes(userPatterns)\n\n const extensions = DEFAULT_EXCLUDED_EXTENSIONS.filter(ext => !reincluded.extensions.has(ext))\n if (!includePdb) {\n extensions.push(\"pdb\")\n }\n const names = DEFAULT_EXCLUDED_NAMES.filter(name => !reincluded.names.has(name))\n\n const patterns: Array<string> = []\n // minimatch does not expand a single-member brace (`{x}` is matched literally), so emit a bare\n // glob when only one extension/name survives the opt-in filtering.\n if (extensions.length === 1) {\n patterns.push(`!**/*.${extensions[0]}`)\n } else if (extensions.length > 1) {\n patterns.push(`!**/*.{${extensions.join(\",\")}}`)\n }\n patterns.push(\"!**/._*\")\n patterns.push(\"!**/electron-builder.{yaml,yml,json,json5,toml,ts}\")\n if (names.length === 1) {\n patterns.push(`!**/${names[0]}`)\n } else if (names.length > 1) {\n patterns.push(`!**/{${names.join(\",\")}}`)\n }\n patterns.push(\"!.yarn{,/**/*}\")\n // https://github.com/electron-userland/electron-builder/issues/1969\n // exclude only for app root, use .yarnclean to clean node_modules\n patterns.push(\"!.editorconfig\")\n patterns.push(\"!.yarnrc.yml\")\n return patterns\n}\n\n/**\n * Returns the default-excluded names/extensions that the given `files` patterns opt back in, formatted\n * for display (extensions as `*.<ext>`, names verbatim). Empty when nothing default-excluded is\n * re-included. Used to warn that files normally kept out of the package will now be included.\n */\nexport function getReincludedDefaultExclusions(patterns: ReadonlyArray<string>): Array<string> {\n const reincluded = collectExplicitReincludes(patterns)\n return [...[...reincluded.extensions].map(ext => `*.${ext}`), ...reincluded.names]\n}\n\nfunction ensureNoEndSlash(file: string): string {\n if (path.sep !== \"/\") {\n file = file.replace(/\\//g, path.sep)\n }\n if (path.sep !== \"\\\\\") {\n file = file.replace(/\\\\/g, path.sep)\n }\n\n if (file.endsWith(path.sep)) {\n return file.substring(0, file.length - 1)\n } else {\n return file\n }\n}\n\nexport class FileMatcher {\n readonly from: string\n readonly to: string\n\n readonly patterns: Array<string>\n\n excludePatterns: Array<Minimatch> | null = null\n\n readonly isSpecifiedAsEmptyArray: boolean\n\n constructor(\n from: string,\n to: string,\n readonly macroExpander: (pattern: string) => string,\n patterns?: Array<string> | string | null\n ) {\n this.from = ensureNoEndSlash(macroExpander(from))\n this.to = ensureNoEndSlash(macroExpander(to))\n this.patterns = asArray(patterns).map(it => this.normalizePattern(it))\n this.isSpecifiedAsEmptyArray = Array.isArray(patterns) && patterns.length === 0\n }\n\n normalizePattern(pattern: string) {\n if (pattern.startsWith(\"./\")) {\n pattern = pattern.substring(\"./\".length)\n }\n return path.posix.normalize(this.macroExpander(pattern.replace(/\\\\/g, \"/\")))\n }\n\n addPattern(pattern: string) {\n this.patterns.push(this.normalizePattern(pattern))\n }\n\n prependPattern(pattern: string) {\n this.patterns.unshift(this.normalizePattern(pattern))\n }\n\n isEmpty() {\n return this.patterns.length === 0\n }\n\n containsOnlyIgnore(): boolean {\n return !this.isEmpty() && this.patterns.find(it => !it.startsWith(\"!\")) == null\n }\n\n computeParsedPatterns(result: Array<Minimatch>, fromDir?: string): void {\n const relativeFrom = fromDir == null ? null : path.relative(fromDir, this.from)\n\n if (this.patterns.length === 0 && relativeFrom != null) {\n // file mappings, from here is a file\n result.push(new Minimatch(relativeFrom, minimatchOptions))\n return\n }\n\n for (let pattern of this.patterns) {\n if (relativeFrom != null) {\n pattern = path.join(relativeFrom, pattern)\n }\n\n const parsedPattern = new Minimatch(pattern, minimatchOptions)\n result.push(parsedPattern)\n\n // do not add if contains dot (possibly file if has extension)\n if (!pattern.includes(\".\") && !hasMagic(parsedPattern)) {\n // https://github.com/electron-userland/electron-builder/issues/545\n // add **/*\n result.push(new Minimatch(`${pattern}/**/*`, minimatchOptions))\n }\n }\n }\n\n createFilter(): Filter {\n const parsedPatterns: Array<Minimatch> = []\n this.computeParsedPatterns(parsedPatterns)\n return createFilter(this.from, parsedPatterns, this.excludePatterns)\n }\n\n toString() {\n return `from: ${this.from}, to: ${this.to}, patterns: ${this.patterns.join(\", \")}`\n }\n}\n\n/** @internal */\nexport function getMainFileMatchers(\n appDir: string,\n destination: string,\n macroExpander: (pattern: string) => string,\n platformSpecificBuildOptions: PlatformSpecificBuildOptions,\n platformPackager: PlatformPackager<any>,\n outDir: string\n): Array<FileMatcher> {\n const buildResourceDir = path.resolve(platformPackager.projectDir, platformPackager.buildResourcesDir)\n\n let matchers = platformPackager.isPrepackedAppAsar\n ? null\n : getFileMatchers(platformPackager.config, \"files\", destination, {\n macroExpander,\n customBuildOptions: platformSpecificBuildOptions,\n globalOutDir: outDir,\n defaultSrc: appDir,\n })\n if (matchers == null) {\n matchers = [new FileMatcher(appDir, destination, macroExpander)]\n }\n\n const matcher = matchers[0]\n // add default patterns, but only if from equals to app dir\n if (matcher.from !== appDir) {\n return matchers\n }\n\n // https://github.com/electron-userland/electron-builder/issues/1741#issuecomment-311111418 so, do not use inclusive patterns\n const patterns = matcher.patterns\n\n // Snapshot the user-specified patterns before the default/auto patterns are injected so a `files`\n // entry can opt back in to a default-excluded extension/name (see getDefaultIgnoredPatterns).\n const userSpecifiedPatterns = patterns.slice()\n\n const customFirstPatterns: Array<string> = []\n // electron-webpack - we need to copy only package.json and node_modules from root dir (and these files are added by default), so, explicit empty array is specified\n if (!matcher.isSpecifiedAsEmptyArray && (matcher.isEmpty() || matcher.containsOnlyIgnore())) {\n customFirstPatterns.push(\"**/*\")\n } else if (!patterns.includes(\"package.json\")) {\n patterns.push(\"package.json\")\n }\n\n let insertExculdeNodeModulesIndex = -1\n for (let i = 0; i < patterns.length; i++) {\n if (!patterns[i].startsWith(\"!\") && (patterns[i].includes(\"/node_modules\") || patterns[i].includes(\"node_modules/\"))) {\n insertExculdeNodeModulesIndex = i\n break\n }\n }\n\n if (insertExculdeNodeModulesIndex !== -1) {\n patterns.splice(insertExculdeNodeModulesIndex, 0, ...[\"!**/node_modules/**\"])\n } else {\n customFirstPatterns.push(\"!**/node_modules/**\")\n }\n\n // https://github.com/electron-userland/electron-builder/issues/1482\n const relativeBuildResourceDir = path.relative(matcher.from, buildResourceDir)\n if (relativeBuildResourceDir.length !== 0 && !relativeBuildResourceDir.startsWith(\".\")) {\n customFirstPatterns.push(`!${relativeBuildResourceDir}{,/**/*}`)\n }\n\n const relativeOutDir = matcher.normalizePattern(path.relative(platformPackager.projectDir, outDir))\n if (!relativeOutDir.startsWith(\".\")) {\n customFirstPatterns.push(`!${relativeOutDir}{,/**/*}`)\n }\n\n // add our default exclusions after last user possibly defined \"all\"/permissive pattern\n let insertIndex = 0\n for (let i = patterns.length - 1; i >= 0; i--) {\n if (patterns[i].startsWith(\"**/\")) {\n insertIndex = i + 1\n break\n }\n }\n patterns.splice(insertIndex, 0, ...customFirstPatterns)\n\n const reincludedDefaults = getReincludedDefaultExclusions(userSpecifiedPatterns)\n if (reincludedDefaults.length > 0) {\n // These files are kept out of the package by default; a user `files` pattern is opting them back in.\n log.warn({ files: reincludedDefaults.join(\", \") }, \"`files` configuration re-includes files that are excluded by default — verify this is intentional\")\n }\n\n patterns.push(...getDefaultIgnoredPatterns(userSpecifiedPatterns, platformPackager.config.includePdb === true))\n\n const debugLogger = platformPackager.debugLogger\n if (debugLogger.isEnabled) {\n //tslint:disable-next-line:no-invalid-template-strings\n debugLogger.add(`${macroExpander(\"${arch}\")}.firstOrDefaultFilePatterns`, patterns)\n }\n return matchers\n}\n\n/** @internal */\nexport function getNodeModuleFileMatcher(\n appDir: string,\n destination: string,\n macroExpander: (pattern: string) => string,\n platformSpecificBuildOptions: PlatformSpecificBuildOptions,\n packager: Packager\n): FileMatcher {\n // https://github.com/electron-userland/electron-builder/pull/2948#issuecomment-392241632\n // grab only excludes\n const matcher = new FileMatcher(appDir, destination, macroExpander)\n\n function addPatterns(patterns: Array<string | FileSet> | string | Nullish | FileSet) {\n if (patterns == null) {\n return\n } else if (!Array.isArray(patterns)) {\n if (typeof patterns === \"string\" && patterns.startsWith(\"!\")) {\n matcher.addPattern(patterns)\n return\n }\n // ignore object form\n return\n }\n\n for (const pattern of patterns) {\n if (typeof pattern === \"string\") {\n if (pattern.startsWith(\"!\")) {\n matcher.addPattern(pattern)\n }\n } else {\n const fileSet = pattern\n if (fileSet.from == null || fileSet.from === \".\") {\n for (const p of asArray(fileSet.filter)) {\n matcher.addPattern(p)\n }\n }\n }\n }\n }\n\n addPatterns(packager.config.files)\n addPatterns(platformSpecificBuildOptions.files)\n\n if (!matcher.isEmpty()) {\n matcher.prependPattern(\"**/*\")\n }\n\n const debugLogger = packager.debugLogger\n if (debugLogger.isEnabled) {\n //tslint:disable-next-line:no-invalid-template-strings\n debugLogger.add(`${macroExpander(\"${arch}\")}.nodeModuleFilePatterns`, matcher.patterns)\n }\n\n return matcher\n}\n\nexport interface GetFileMatchersOptions {\n readonly macroExpander: (pattern: string) => string\n readonly customBuildOptions: PlatformSpecificBuildOptions\n readonly globalOutDir: string\n\n readonly defaultSrc: string\n}\n\n// The names whose file sets are physically copied into the build output directory, so a `to` that\n// resolves outside of it writes onto the build machine itself (https://github.com/electron-userland/electron-builder/issues/1993).\n// `files` is excluded: its `to` is only used for in-package (asar) relative math.\nconst VALIDATED_DESTINATION_NAMES: ReadonlyArray<string> = [\"extraFiles\", \"extraResources\", \"extraDistFiles\"]\n\nconst FPM_MAPPING_HINT =\n 'To install a file at an absolute path inside a deb/rpm package, use the fpm file-mapping syntax instead, e.g. \"deb\": { \"fpm\": [\"build/file.xml=/usr/share/metainfo/file.xml\"] }.'\n\n/**\n * Resolves a file set `to` to the destination a FileMatcher should copy into.\n *\n * - A missing `to` falls back to `defaultDestination`.\n * - For file sets that are physically copied into the build output directory\n * (see {@link VALIDATED_DESTINATION_NAMES}), the result is validated to stay inside it:\n * absolute `to` values (POSIX, Windows drive-letter, or UNC — files would be copied to that\n * literal path on the build machine) and relative values that escape `globalOutDir`\n * (e.g. `../../usr/share`) throw. Relative hops that stay inside the build output directory\n * (e.g. `to: \"../Frameworks\"` from `Contents/Resources` on macOS) remain valid.\n * - `files` sets are exempt from validation: their `to` only participates in in-package (asar)\n * relative math, so it is plainly resolved against `defaultDestination`.\n */\nexport function resolveFileSetDestination(name: string, to: string | Nullish, defaultDestination: string, globalOutDir: string): string {\n if (to == null) {\n return defaultDestination\n }\n\n if (!VALIDATED_DESTINATION_NAMES.includes(name)) {\n return path.resolve(defaultDestination, to)\n }\n\n // path.win32.isAbsolute also covers POSIX absolute paths, and treats drive-letter (C:\\) and\n // UNC (\\\\server\\share) paths as absolute no matter which OS the build runs on\n if (path.win32.isAbsolute(to) || path.posix.isAbsolute(to)) {\n throw new InvalidConfigurationError(\n `The \"to\" path \"${to}\" in \"${name}\" is absolute. Absolute destinations are not copied into the packaged app — they would be written to that literal path on the build machine. Use a relative path instead. ${FPM_MAPPING_HINT}`\n )\n }\n\n // FileMatcher later converts all separators to path.sep, so normalize before resolving to make\n // sure `..\\\\..` segments written with backslashes are seen as parent hops here too\n const resolved = path.resolve(defaultDestination, to.replace(/[/\\\\]/g, path.sep))\n const relativeToOutDir = path.relative(path.resolve(globalOutDir), resolved)\n if (relativeToOutDir.startsWith(`..${path.sep}`) || relativeToOutDir === \"..\" || path.isAbsolute(relativeToOutDir)) {\n throw new InvalidConfigurationError(\n `The \"to\" path \"${to}\" in \"${name}\" resolves to \"${resolved}\", which is outside the build output directory \"${path.resolve(globalOutDir)}\". The files would be copied onto the build machine instead of into the packaged app. Use a relative path that stays within the package. ${FPM_MAPPING_HINT}`\n )\n }\n return resolved\n}\n\nexport function getFileMatchers(\n config: Configuration,\n name: \"files\" | \"extraFiles\" | \"extraResources\" | \"extraDistFiles\",\n defaultDestination: string,\n options: GetFileMatchersOptions\n): Array<FileMatcher> | null {\n const defaultMatcher = new FileMatcher(options.defaultSrc, defaultDestination, options.macroExpander)\n const fileMatchers: Array<FileMatcher> = []\n\n function addPatterns(patterns: Array<string | FileSet> | string | Nullish | FileSet) {\n if (patterns == null) {\n return\n } else if (!Array.isArray(patterns)) {\n if (typeof patterns === \"string\") {\n defaultMatcher.addPattern(patterns)\n return\n }\n patterns = [patterns]\n }\n\n for (const pattern of patterns) {\n if (typeof pattern === \"string\") {\n // use normalize to transform ./foo to foo\n defaultMatcher.addPattern(pattern)\n } else {\n const from = pattern.from == null ? options.defaultSrc : path.resolve(options.defaultSrc, pattern.from)\n const to = resolveFileSetDestination(name, pattern.to, defaultDestination, options.globalOutDir)\n fileMatchers.push(new FileMatcher(from, to, options.macroExpander, pattern.filter))\n }\n }\n }\n\n if (name !== \"extraDistFiles\") {\n addPatterns((config as any)[name])\n }\n addPatterns((options.customBuildOptions as any)[name])\n\n if (!defaultMatcher.isEmpty()) {\n // default matcher should be first in the array\n fileMatchers.unshift(defaultMatcher)\n }\n\n // we cannot exclude the whole out dir, because sometimes users want to use some file in the out dir in the patterns\n const relativeOutDir = defaultMatcher.normalizePattern(path.relative(options.defaultSrc, options.globalOutDir))\n if (!relativeOutDir.startsWith(\".\")) {\n defaultMatcher.addPattern(`!${relativeOutDir}/*-unpacked{,/**/*}`)\n }\n\n return fileMatchers.length === 0 ? null : fileMatchers\n}\n\n/** @internal */\nexport function copyFiles(matchers: Array<FileMatcher> | null, transformer: FileTransformer | null, isUseHardLink?: boolean): Promise<any> {\n if (matchers == null || matchers.length === 0) {\n return Promise.resolve()\n }\n\n return Promise.all(\n matchers.map(async (matcher: FileMatcher) => {\n const fromStat = await statOrNull(matcher.from)\n if (fromStat == null) {\n log.warn({ from: matcher.from }, `file source doesn't exist`)\n return\n }\n\n if (fromStat.isFile()) {\n const toStat = await statOrNull(matcher.to)\n // https://github.com/electron-userland/electron-builder/issues/1245\n if (toStat != null && toStat.isDirectory()) {\n return await copyOrLinkFile(matcher.from, path.join(matcher.to, path.basename(matcher.from)), fromStat, isUseHardLink)\n }\n\n await mkdir(path.dirname(matcher.to), { recursive: true })\n return await copyOrLinkFile(matcher.from, matcher.to, fromStat)\n }\n\n if (matcher.isEmpty() || matcher.containsOnlyIgnore()) {\n matcher.prependPattern(\"**/*\")\n }\n log.debug({ matcher }, \"copying files using pattern\")\n return await copyDir(matcher.from, matcher.to, { filter: matcher.createFilter(), transformer, isUseHardLink: isUseHardLink ? USE_HARD_LINKS : null })\n })\n )\n}\n"]}
@@ -8,7 +8,7 @@ export { Configuration, DEFAULT_IGNORED_PRODUCTION_DEPENDENCIES, ToolsetConfig,
8
8
  export { Publish } from "./core.js";
9
9
  export { getElectronVersion } from "./electron/electronVersion.js";
10
10
  export { collectNodeModulesWithLogging } from "./util/appFileCopier.js";
11
- export { collectExplicitReincludes, DEFAULT_EXCLUDED_EXTENSIONS, DEFAULT_EXCLUDED_NAMES, FileMatcher, getDefaultIgnoredPatterns, getFileMatchers, GetFileMatchersOptions, getMainFileMatchers, getReincludedDefaultExclusions, } from "./fileMatcher.js";
11
+ export { collectExplicitReincludes, DEFAULT_EXCLUDED_EXTENSIONS, DEFAULT_EXCLUDED_NAMES, FileMatcher, getDefaultIgnoredPatterns, getFileMatchers, GetFileMatchersOptions, getMainFileMatchers, getReincludedDefaultExclusions, resolveFileSetDestination, } from "./fileMatcher.js";
12
12
  export { hoist, HoisterDependencyKind, HoisterResult, HoisterTree } from "./node-module-collector/hoist.js";
13
13
  export { BunNodeModulesCollector, determinePackageManagerEnv, getCollectorByPackageManager, PnpmNodeModulesCollector, TraversalNodeModulesCollector, YarnBerryNodeModulesCollector, YarnNodeModulesCollector, } from "./node-module-collector/index.js";
14
14
  export { PM } from "./node-module-collector/packageManager.js";
@@ -38,6 +38,7 @@ export { buildSourceCandidates, convertIcon, getPngSize } from "./util/iconConve
38
38
  export { getLicenseAssets, getLicenseFiles } from "./util/license.js";
39
39
  export { parsePlistFile, PlistObject } from "./util/mac/plist.js";
40
40
  export { expandMacro } from "./util/macroExpander.js";
41
+ export { checkMetadata } from "./util/packageMetadata.js";
41
42
  export { getRepositoryInfo } from "./util/repositoryInfo.js";
42
43
  export { withToolsetLock } from "./util/toolsetLock.js";
43
44
  export { editWindowsResources, ResourceEditOptions } from "./util/win/resEdit.js";
@@ -1 +1 @@
1
- {"version":3,"file":"indexInternal.d.ts","sourceRoot":"","sources":["../src/indexInternal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAC3G,YAAY,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAA;AAC1G,OAAO,EAAE,aAAa,EAAE,uCAAuC,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACzH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAClE,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAA;AACvE,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,sBAAsB,EACtB,WAAW,EACX,yBAAyB,EACzB,eAAe,EACf,sBAAsB,EACtB,mBAAmB,EACnB,8BAA8B,GAC/B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAC3G,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,4BAA4B,EAC5B,wBAAwB,EACxB,6BAA6B,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,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,6BAA6B,EAC7B,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACxF,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACrE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AACjF,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAClG,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA"}
@@ -4,7 +4,7 @@ export { createKeychain, findIdentity, isSignAllowed, removeKeychain } from "./c
4
4
  export { DEFAULT_IGNORED_PRODUCTION_DEPENDENCIES } from "./configuration.js";
5
5
  export { getElectronVersion } from "./electron/electronVersion.js";
6
6
  export { collectNodeModulesWithLogging } from "./util/appFileCopier.js";
7
- export { collectExplicitReincludes, DEFAULT_EXCLUDED_EXTENSIONS, DEFAULT_EXCLUDED_NAMES, FileMatcher, getDefaultIgnoredPatterns, getFileMatchers, getMainFileMatchers, getReincludedDefaultExclusions, } from "./fileMatcher.js";
7
+ export { collectExplicitReincludes, DEFAULT_EXCLUDED_EXTENSIONS, DEFAULT_EXCLUDED_NAMES, FileMatcher, getDefaultIgnoredPatterns, getFileMatchers, getMainFileMatchers, getReincludedDefaultExclusions, resolveFileSetDestination, } from "./fileMatcher.js";
8
8
  export { hoist, HoisterDependencyKind } from "./node-module-collector/hoist.js";
9
9
  export { BunNodeModulesCollector, determinePackageManagerEnv, getCollectorByPackageManager, PnpmNodeModulesCollector, TraversalNodeModulesCollector, YarnBerryNodeModulesCollector, YarnNodeModulesCollector, } from "./node-module-collector/index.js";
10
10
  export { PM } from "./node-module-collector/packageManager.js";
@@ -32,6 +32,7 @@ export { buildSourceCandidates, convertIcon, getPngSize } from "./util/iconConve
32
32
  export { getLicenseAssets, getLicenseFiles } from "./util/license.js";
33
33
  export { parsePlistFile } from "./util/mac/plist.js";
34
34
  export { expandMacro } from "./util/macroExpander.js";
35
+ export { checkMetadata } from "./util/packageMetadata.js";
35
36
  export { getRepositoryInfo } from "./util/repositoryInfo.js";
36
37
  export { withToolsetLock } from "./util/toolsetLock.js";
37
38
  export { editWindowsResources } from "./util/win/resEdit.js";