app-builder-lib 27.0.0-alpha.8 → 27.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asar/asarUtil.js +21 -11
- package/dist/asar/asarUtil.js.map +1 -1
- package/dist/configuration.d.ts +31 -1
- package/dist/configuration.d.ts.map +1 -1
- package/dist/configuration.js.map +1 -1
- package/dist/electron/ElectronFramework.d.ts +2 -1
- package/dist/electron/ElectronFramework.d.ts.map +1 -1
- package/dist/electron/ElectronFramework.js +14 -7
- package/dist/electron/ElectronFramework.js.map +1 -1
- package/dist/electron/mac/electronMac.js +2 -6
- package/dist/electron/mac/electronMac.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/indexInternal.d.ts +9 -2
- package/dist/indexInternal.d.ts.map +1 -1
- package/dist/indexInternal.js +8 -2
- package/dist/indexInternal.js.map +1 -1
- package/dist/linuxPackager.d.ts.map +1 -1
- package/dist/linuxPackager.js +19 -1
- package/dist/linuxPackager.js.map +1 -1
- package/dist/macPackager.d.ts.map +1 -1
- package/dist/macPackager.js +20 -0
- package/dist/macPackager.js.map +1 -1
- package/dist/node-module-collector/index.d.ts.map +1 -1
- package/dist/node-module-collector/index.js +47 -16
- package/dist/node-module-collector/index.js.map +1 -1
- package/dist/node-module-collector/moduleManager.d.ts.map +1 -1
- package/dist/node-module-collector/moduleManager.js +16 -8
- package/dist/node-module-collector/moduleManager.js.map +1 -1
- package/dist/node-module-collector/nodeModulesCollector.d.ts +7 -2
- package/dist/node-module-collector/nodeModulesCollector.d.ts.map +1 -1
- package/dist/node-module-collector/nodeModulesCollector.js +13 -17
- package/dist/node-module-collector/nodeModulesCollector.js.map +1 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts +44 -4
- package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts.map +1 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.js +130 -34
- package/dist/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.d.ts +29 -0
- package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
- package/dist/options/SquirrelWindowsOptions.d.ts +0 -5
- package/dist/options/SquirrelWindowsOptions.d.ts.map +1 -1
- package/dist/options/SquirrelWindowsOptions.js.map +1 -1
- package/dist/options/macOptions.d.ts +11 -6
- package/dist/options/macOptions.d.ts.map +1 -1
- package/dist/options/macOptions.js.map +1 -1
- package/dist/packager.d.ts +2 -0
- package/dist/packager.d.ts.map +1 -1
- package/dist/packager.js +47 -0
- package/dist/packager.js.map +1 -1
- package/dist/packagerApi.d.ts +1 -1
- package/dist/packagerApi.d.ts.map +1 -1
- package/dist/packagerApi.js.map +1 -1
- package/dist/platformPackager.d.ts +13 -1
- package/dist/platformPackager.d.ts.map +1 -1
- package/dist/platformPackager.js +26 -2
- package/dist/platformPackager.js.map +1 -1
- package/dist/publish/PublishManager.d.ts.map +1 -1
- package/dist/publish/PublishManager.js +89 -7
- package/dist/publish/PublishManager.js.map +1 -1
- package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
- package/dist/publish/updateInfoBuilder.js +57 -4
- package/dist/publish/updateInfoBuilder.js.map +1 -1
- package/dist/targets/ArchiveTarget.js +1 -1
- package/dist/targets/ArchiveTarget.js.map +1 -1
- package/dist/targets/archive.d.ts +12 -0
- package/dist/targets/archive.d.ts.map +1 -1
- package/dist/targets/archive.js +44 -1
- package/dist/targets/archive.js.map +1 -1
- package/dist/targets/differentialUpdateInfoBuilder.d.ts +2 -1
- package/dist/targets/differentialUpdateInfoBuilder.d.ts.map +1 -1
- package/dist/targets/differentialUpdateInfoBuilder.js +2 -2
- package/dist/targets/differentialUpdateInfoBuilder.js.map +1 -1
- package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -1
- package/dist/targets/linux/FlatpakTarget.js +5 -1
- package/dist/targets/linux/FlatpakTarget.js.map +1 -1
- package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
- package/dist/targets/linux/FpmTarget.js +25 -2
- package/dist/targets/linux/FpmTarget.js.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.d.ts +1 -0
- package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.js +17 -1
- package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
- package/dist/targets/linux/snap/core24.js +3 -3
- package/dist/targets/linux/snap/core24.js.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.js +1 -1
- package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
- package/dist/targets/mac/MacTargetHelper.d.ts +70 -4
- package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
- package/dist/targets/mac/MacTargetHelper.js +294 -36
- package/dist/targets/mac/MacTargetHelper.js.map +1 -1
- package/dist/targets/mac/pkg.d.ts +16 -0
- package/dist/targets/mac/pkg.d.ts.map +1 -1
- package/dist/targets/mac/pkg.js +26 -0
- package/dist/targets/mac/pkg.js.map +1 -1
- package/dist/targets/win/MsiTarget.d.ts.map +1 -1
- package/dist/targets/win/MsiTarget.js +6 -3
- package/dist/targets/win/MsiTarget.js.map +1 -1
- package/dist/targets/win/nsis/Defines.d.ts +2 -0
- package/dist/targets/win/nsis/Defines.d.ts.map +1 -1
- package/dist/targets/win/nsis/Defines.js.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.d.ts +18 -0
- package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.js +79 -19
- package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
- package/dist/targets/win/nsis/WebInstallerTarget.d.ts.map +1 -1
- package/dist/targets/win/nsis/WebInstallerTarget.js +19 -12
- package/dist/targets/win/nsis/WebInstallerTarget.js.map +1 -1
- package/dist/targets/win/nsis/nsisOptions.d.ts +29 -4
- package/dist/targets/win/nsis/nsisOptions.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisOptions.js.map +1 -1
- package/dist/toolsets/wine.d.ts.map +1 -1
- package/dist/toolsets/wine.js +17 -12
- package/dist/toolsets/wine.js.map +1 -1
- package/dist/util/NodeModuleCopyHelper.js +12 -4
- package/dist/util/NodeModuleCopyHelper.js.map +1 -1
- package/dist/util/appFileCopier.d.ts +5 -0
- package/dist/util/appFileCopier.d.ts.map +1 -1
- package/dist/util/appFileCopier.js +39 -1
- package/dist/util/appFileCopier.js.map +1 -1
- package/dist/util/config/config.d.ts.map +1 -1
- package/dist/util/config/config.js +4 -0
- package/dist/util/config/config.js.map +1 -1
- package/dist/util/config/legacyConfigGuard.d.ts +7 -0
- package/dist/util/config/legacyConfigGuard.d.ts.map +1 -0
- package/dist/util/config/legacyConfigGuard.js +187 -0
- package/dist/util/config/legacyConfigGuard.js.map +1 -0
- package/dist/util/config/legacyOptions.d.ts +73 -0
- package/dist/util/config/legacyOptions.d.ts.map +1 -0
- package/dist/util/config/legacyOptions.js +369 -0
- package/dist/util/config/legacyOptions.js.map +1 -0
- package/dist/util/config/schemaValidator.d.ts.map +1 -1
- package/dist/util/config/schemaValidator.js +16 -0
- package/dist/util/config/schemaValidator.js.map +1 -1
- package/dist/util/electronGet.d.ts +0 -4
- package/dist/util/electronGet.d.ts.map +1 -1
- package/dist/util/electronGet.js +17 -0
- package/dist/util/electronGet.js.map +1 -1
- package/dist/util/flags.d.ts +5 -0
- package/dist/util/flags.d.ts.map +1 -1
- package/dist/util/flags.js +124 -1
- package/dist/util/flags.js.map +1 -1
- package/dist/util/packageMetadata.js +11 -0
- package/dist/util/packageMetadata.js.map +1 -1
- package/dist/util/resolve.js +1 -1
- package/dist/util/resolve.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +10 -10
- package/scheme.json +368 -23
- package/templates/entitlements.mac.adhoc.plist +15 -0
- package/templates/entitlements.mac.plist +9 -6
- package/templates/nsis/include/installer.nsh +1 -30
- package/templates/nsis/include/webPackage.nsh +33 -23
- package/templates/nsis/multiUserUi.nsh +1 -1
package/dist/asar/asarUtil.js
CHANGED
|
@@ -32,6 +32,23 @@ const ALLOWLIST = resolvePaths([
|
|
|
32
32
|
os.homedir(), // always allow home dir
|
|
33
33
|
]);
|
|
34
34
|
/** @internal */
|
|
35
|
+
export async function withElectronAsarLogging(task) {
|
|
36
|
+
// override logger temporarily to clean up console (electron/asar does some internal logging that blogs up the default electron-builder logs)
|
|
37
|
+
const consoleLogger = console.log;
|
|
38
|
+
console.log = (...args) => {
|
|
39
|
+
if (args[0] === "Ordering file has 100% coverage.") {
|
|
40
|
+
return; // no need to log, this means our ordering logic is working correctly
|
|
41
|
+
}
|
|
42
|
+
log.info({ args }, "logging @electron/asar");
|
|
43
|
+
};
|
|
44
|
+
try {
|
|
45
|
+
return await task();
|
|
46
|
+
}
|
|
47
|
+
finally {
|
|
48
|
+
console.log = consoleLogger;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/** @internal */
|
|
35
52
|
export class AsarPackager {
|
|
36
53
|
constructor(packager, config) {
|
|
37
54
|
this.packager = packager;
|
|
@@ -49,17 +66,10 @@ export class AsarPackager {
|
|
|
49
66
|
await this.executeElectronAsar(streams);
|
|
50
67
|
}
|
|
51
68
|
async executeElectronAsar(streams) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return; // no need to log, this means our ordering logic is working correctly
|
|
57
|
-
}
|
|
58
|
-
log.info({ args }, "logging @electron/asar");
|
|
59
|
-
};
|
|
60
|
-
const { createPackageFromStreams } = await dynamicImport("@electron/asar");
|
|
61
|
-
await createPackageFromStreams(this.outFile, streams);
|
|
62
|
-
console.log = consoleLogger;
|
|
69
|
+
await withElectronAsarLogging(async () => {
|
|
70
|
+
const { createPackageFromStreams } = await dynamicImport("@electron/asar");
|
|
71
|
+
await createPackageFromStreams(this.outFile, streams);
|
|
72
|
+
});
|
|
63
73
|
}
|
|
64
74
|
async processFileSets(fileSets) {
|
|
65
75
|
const unpackedPaths = new Set();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asarUtil.js","sourceRoot":"","sources":["../../src/asar/asarUtil.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAuB,eAAe,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,MAAM,UAAU,CAAA;AAEzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAG5B,OAAO,EAAmB,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACjC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAA;AAEvB,MAAM,WAAW,GAAG,KAAK,EAAE,IAAwB,EAA+B,EAAE,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;AACnL,MAAM,YAAY,GAAG,KAAK,EAAE,SAAiC,EAAE,EAAE;IAC/D,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,EAAgB,EAAE,CAAC,EAAE,IAAI,IAAI,CAAC,CAAC,CAAA;AAC9G,CAAC,CAAA;AAED,M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AC/B,IAAI,SAAS,IAAI,QAAQ,EAAE,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YACjD,OAAM;QACR,CAAC;QAED,6BAA6B;QAC7B,IAAI,MAAM,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,MAAM,SAAS,CAAC,EAAE,CAAC;YACxD,OAAM;QACR,CAAC;QAED,iBAAiB;QACjB,IAAI,MAAM,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,MAAM,QAAQ,CAAC,EAAE,CAAC;YACvD,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,wCAAwC,CAAC,CAAA;YAC9D,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,wBAAwB,QAAQ,kDAAkD,CAAC,CAAA;QAC9H,CAAC;QAED,4DAA4D;QAC5D,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,4DAA4D,CAAC,CAAA;IACpF,CAAC;CACF","sourcesContent":["import type { AsarStreamType, AsarDirectory } from \"@electron/asar\"\nimport { exists, Filter, FilterStats, isEmptyOrSpaces, log } from \"builder-util\"\nimport { dynamicImport } from \"../util/dynamicImport.js\"\nimport fs from \"fs-extra\"\n\nimport * as path from \"path\"\nimport { AsarOptions } from \"../options/PlatformSpecificBuildOptions.js\"\nimport { PlatformPackager } from \"../platformPackager.js\"\nimport { ResolvedFileSet, getDestinationPath } from \"../util/appFileCopier.js\"\nimport { detectUnpackedDirs } from \"./unpackDetector.js\"\nimport { Readable } from \"stream\"\nimport * as os from \"os\"\nconst { readlink } = fs\n\nconst resolvePath = async (file: string | undefined): Promise<string | undefined> => (file && (await exists(file)) ? fs.realpath(file).catch(() => path.resolve(file)) : undefined)\nconst resolvePaths = async (filepaths: (string | undefined)[]) => {\n return Promise.all(filepaths.map(resolvePath)).then(paths => paths.filter((it): it is string => it != null))\n}\n\nconst DENYLIST = resolvePaths([\n \"/usr\",\n \"/lib\",\n \"/bin\",\n \"/sbin\",\n \"/etc\",\n\n \"/tmp\",\n \"/var\", // block whole /var by default. If $HOME is under /var, it's explicitly in ALLOWLIST - https://github.com/electron-userland/electron-builder/issues/9025#issuecomment-3575380041\n\n // macOS system directories\n \"/System\",\n \"/Library\",\n \"/private\",\n\n // Windows system directories\n process.env.SystemRoot,\n process.env.WINDIR,\n])\n\nconst ALLOWLIST = resolvePaths([\n os.tmpdir(), // always allow temp dir\n os.homedir(), // always allow home dir\n])\n\n/** @internal */\nexport class AsarPackager {\n private readonly outFile: string\n\n constructor(\n readonly packager: PlatformPackager<any>,\n private readonly config: {\n defaultDestination: string\n resourcePath: string\n options: AsarOptions\n unpackPattern: Filter | undefined\n }\n ) {\n this.outFile = path.join(config.resourcePath, `app.asar`)\n }\n\n async pack(fileSets: Array<ResolvedFileSet>) {\n const orderedFileSets = [\n // Write dependencies first to minimize offset changes to asar header\n ...fileSets.slice(1),\n\n // Finish with the app files that change most often\n fileSets[0],\n ].map(set => this.orderFileSet(set))\n\n const streams = await this.processFileSets(orderedFileSets)\n await this.executeElectronAsar(streams)\n }\n\n private async executeElectronAsar(streams: AsarStreamType[]) {\n // override logger temporarily to clean up console (electron/asar does some internal logging that blogs up the default electron-builder logs)\n const consoleLogger = console.log\n console.log = (...args) => {\n if (args[0] === \"Ordering file has 100% coverage.\") {\n return // no need to log, this means our ordering logic is working correctly\n }\n log.info({ args }, \"logging @electron/asar\")\n }\n const { createPackageFromStreams } = await dynamicImport<typeof import(\"@electron/asar\")>(\"@electron/asar\")\n await createPackageFromStreams(this.outFile, streams)\n console.log = consoleLogger\n }\n\n private async processFileSets(fileSets: ResolvedFileSet[]): Promise<AsarStreamType[]> {\n const unpackedPaths = new Set<string>()\n if (this.config.options.smartUnpack !== false) {\n for (const fileSet of fileSets) {\n detectUnpackedDirs(fileSet, unpackedPaths)\n }\n }\n\n const resultsMap = new Map<string, AsarStreamType>()\n const streamOrdering: string[] = []\n const normalizedUnpackedPaths = Array.from(unpackedPaths).map(p => path.normalize(p))\n\n // Check whether a file or directory should be unpacked, using pre-normalized unpacked paths and early returns\n const isUnpacked = (dir: string, file?: string, stat?: FilterStats): boolean => {\n const normalizedDir = path.normalize(dir)\n\n // Check file pattern first (most specific)\n if (!isEmptyOrSpaces(file) && stat && this.config.unpackPattern?.(file, stat)) {\n return true\n }\n\n // Check if path is within any unpacked directory\n for (const unpackedPath of normalizedUnpackedPaths) {\n if (normalizedDir === unpackedPath || normalizedDir.startsWith(unpackedPath + path.sep)) {\n return true\n }\n }\n\n return false\n }\n\n // First pass: process all files in order, ensuring parent directories exist\n for (const fileSet of fileSets) {\n // Don't use Promise.all, we need to retain order of execution/iteration through the already-ordered fileset\n for (const [index, file] of fileSet.files.entries()) {\n const transformedData = fileSet.transformedFiles?.get(index)\n const stat = fileSet.metadata.get(file)!\n const destination = path.relative(this.config.defaultDestination, getDestinationPath(file, fileSet))\n\n // Ensure parent directories exist before processing file\n this.ensureParentDirectories(destination, resultsMap, streamOrdering)\n\n const result = await this.processFileOrSymlink({\n file,\n destination,\n fileSet,\n transformedData,\n stat,\n isUnpacked,\n })\n\n if (result && !resultsMap.has(result.path)) {\n resultsMap.set(result.path, result)\n streamOrdering.push(result.path)\n }\n }\n }\n\n // Second pass: propagate unpacked flag to parent directories\n for (const entry of resultsMap.values()) {\n if (entry.unpacked) {\n this.markParentDirectoriesAsUnpacked(entry.path, resultsMap, isUnpacked)\n }\n }\n\n // Build final results array maintaining processing order\n return streamOrdering.reduce<AsarStreamType[]>((streams, path) => {\n const stream = resultsMap.has(path) ? resultsMap.get(path) : null\n if (stream != null) {\n streams.push(stream)\n }\n return streams\n }, [])\n }\n\n private ensureParentDirectories(destination: string, resultsMap: Map<string, AsarStreamType>, streamOrdering: string[]): void {\n const parents: string[] = []\n let current = path.dirname(path.normalize(destination))\n\n // Collect all parent directories from deepest to root\n while (current !== \".\") {\n parents.unshift(current)\n current = path.dirname(current)\n }\n\n // Add parent directories in order (root to deepest)\n for (const parentPath of parents) {\n if (!resultsMap.has(parentPath)) {\n const dir: AsarDirectory = {\n type: \"directory\",\n path: parentPath,\n unpacked: false, // Updated in second pass if needed\n }\n resultsMap.set(parentPath, dir)\n streamOrdering.push(parentPath)\n }\n }\n }\n\n private markParentDirectoriesAsUnpacked(destination: string, resultsMap: Map<string, AsarStreamType>, isUnpacked: (path: string) => boolean): void {\n let current = path.dirname(path.normalize(destination))\n\n while (current !== \".\") {\n const entry = resultsMap.get(current)\n if (entry && isUnpacked(current)) {\n entry.unpacked = true\n }\n current = path.dirname(current)\n }\n }\n\n private async processFileOrSymlink(options: {\n file: string\n destination: string\n stat: fs.Stats\n fileSet: ResolvedFileSet\n transformedData: string | Buffer | undefined\n isUnpacked: (dir: string, file?: string, stat?: FilterStats) => boolean\n }): Promise<AsarStreamType> {\n const { isUnpacked, transformedData, file, destination, stat } = options\n const unpacked = isUnpacked(destination, file, stat)\n\n // Handle directories\n if (!stat.isFile() && !stat.isSymbolicLink()) {\n return { path: destination, unpacked, type: \"directory\" }\n }\n\n // Handle transformed data (pre-processed content)\n if (transformedData != null) {\n const size = Buffer.byteLength(transformedData)\n return {\n path: destination,\n streamGenerator: () =>\n new Readable({\n read() {\n this.push(transformedData)\n this.push(null)\n },\n }),\n unpacked,\n type: \"file\",\n stat: { mode: stat.mode, size },\n }\n }\n\n // verify that the file is not a direct link or symlinked to access/copy a system file\n await this.protectSystemAndUnsafePaths(file, await this.packager.getWorkspaceRoot())\n\n const baseConfig = {\n path: destination,\n streamGenerator: () => fs.createReadStream(file),\n unpacked,\n stat,\n }\n\n // Handle regular files\n if (!stat.isSymbolicLink()) {\n return { ...baseConfig, type: \"file\" }\n }\n\n // Handle symlinks - make relative to source location\n let link = await readlink(file)\n if (path.isAbsolute(link)) {\n link = path.relative(path.dirname(file), link)\n }\n\n return {\n ...baseConfig,\n type: \"link\",\n symlink: link,\n }\n }\n\n private orderFileSet(fileSet: ResolvedFileSet): ResolvedFileSet {\n const sortedFileEntries = Array.from(fileSet.files.entries())\n\n sortedFileEntries.sort(([, a], [, b]) => {\n if (a === b) {\n return 0\n }\n\n // Place addons last because their signature changes per build\n const isAAddon = a.endsWith(\".node\")\n const isBAddon = b.endsWith(\".node\")\n if (isAAddon && !isBAddon) {\n return 1\n }\n if (isBAddon && !isAAddon) {\n return -1\n }\n\n // Otherwise order by name\n return a < b ? -1 : 1\n })\n\n let transformedFiles: Map<number, string | Buffer> | undefined\n if (fileSet.transformedFiles) {\n transformedFiles = new Map()\n\n const indexMap = new Map<number, number>()\n for (const [newIndex, [oldIndex]] of sortedFileEntries.entries()) {\n indexMap.set(oldIndex, newIndex)\n }\n\n for (const [oldIndex, value] of fileSet.transformedFiles) {\n const newIndex = indexMap.get(oldIndex)\n if (newIndex === undefined) {\n throw new Error(`Internal error: ${fileSet.files[oldIndex]} was lost while ordering asar`)\n }\n transformedFiles.set(newIndex, value)\n }\n }\n\n return {\n src: fileSet.src,\n destination: fileSet.destination,\n metadata: fileSet.metadata,\n files: sortedFileEntries.map(([, file]) => file),\n transformedFiles,\n }\n }\n\n private async checkAgainstRoots(target: string, allowRoots: string[]): Promise<boolean> {\n const resolved = await resolvePath(target)\n if (resolved == null || isEmptyOrSpaces(resolved)) {\n return false\n }\n\n for (const root of allowRoots) {\n if (resolved === root || resolved.startsWith(root + path.sep)) {\n return true\n }\n }\n return false\n }\n\n private async protectSystemAndUnsafePaths(file: string, workspaceRoot: string): Promise<void> {\n const resolved = await resolvePath(file)\n const logFields = { source: file, realPath: resolved }\n\n const workspace = await resolvePath(workspaceRoot)\n\n // If in workspace, always safe\n if (workspace && resolved?.startsWith(workspace)) {\n return\n }\n\n // Check allowlist (priority)\n if (await this.checkAgainstRoots(file, await ALLOWLIST)) {\n return\n }\n\n // Check denylist\n if (await this.checkAgainstRoots(file, await DENYLIST)) {\n log.error(logFields, `denied access to system or unsafe path`)\n throw new Error(`Cannot copy file [${file}] symlinked to file [${resolved}] outside the package to a system or unsafe path`)\n }\n\n // Default: outside explicit paths but not explicitly denied\n log.debug(logFields, `path is outside of explicit safe paths, defaulting to safe`)\n }\n}\n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EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAA;QAEtD,MAAM,SAAS,GAAG,MAAM,WAAW,CAAC,aAAa,CAAC,CAAA;QAElD,+BAA+B;QAC/B,IAAI,SAAS,IAAI,QAAQ,EAAE,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YACjD,OAAM;QACR,CAAC;QAED,6BAA6B;QAC7B,IAAI,MAAM,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,MAAM,SAAS,CAAC,EAAE,CAAC;YACxD,OAAM;QACR,CAAC;QAED,iBAAiB;QACjB,IAAI,MAAM,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,MAAM,QAAQ,CAAC,EAAE,CAAC;YACvD,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,wCAAwC,CAAC,CAAA;YAC9D,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,wBAAwB,QAAQ,kDAAkD,CAAC,CAAA;QAC9H,CAAC;QAED,4DAA4D;QAC5D,GAAG,CAAC,KAAK,CAAC,SAAS,EAAE,4DAA4D,CAAC,CAAA;IACpF,CAAC;CACF","sourcesContent":["import type { AsarStreamType, AsarDirectory } from \"@electron/asar\"\nimport { exists, Filter, FilterStats, isEmptyOrSpaces, log } from \"builder-util\"\nimport { dynamicImport } from \"../util/dynamicImport.js\"\nimport fs from \"fs-extra\"\n\nimport * as path from \"path\"\nimport { AsarOptions } from \"../options/PlatformSpecificBuildOptions.js\"\nimport { PlatformPackager } from \"../platformPackager.js\"\nimport { ResolvedFileSet, getDestinationPath } from \"../util/appFileCopier.js\"\nimport { detectUnpackedDirs } from \"./unpackDetector.js\"\nimport { Readable } from \"stream\"\nimport * as os from \"os\"\nconst { readlink } = fs\n\nconst resolvePath = async (file: string | undefined): Promise<string | undefined> => (file && (await exists(file)) ? fs.realpath(file).catch(() => path.resolve(file)) : undefined)\nconst resolvePaths = async (filepaths: (string | undefined)[]) => {\n return Promise.all(filepaths.map(resolvePath)).then(paths => paths.filter((it): it is string => it != null))\n}\n\nconst DENYLIST = resolvePaths([\n \"/usr\",\n \"/lib\",\n \"/bin\",\n \"/sbin\",\n \"/etc\",\n\n \"/tmp\",\n \"/var\", // block whole /var by default. If $HOME is under /var, it's explicitly in ALLOWLIST - https://github.com/electron-userland/electron-builder/issues/9025#issuecomment-3575380041\n\n // macOS system directories\n \"/System\",\n \"/Library\",\n \"/private\",\n\n // Windows system directories\n process.env.SystemRoot,\n process.env.WINDIR,\n])\n\nconst ALLOWLIST = resolvePaths([\n os.tmpdir(), // always allow temp dir\n os.homedir(), // always allow home dir\n])\n\n/** @internal */\nexport async function withElectronAsarLogging<T>(task: () => Promise<T>): Promise<T> {\n // override logger temporarily to clean up console (electron/asar does some internal logging that blogs up the default electron-builder logs)\n const consoleLogger = console.log\n console.log = (...args) => {\n if (args[0] === \"Ordering file has 100% coverage.\") {\n return // no need to log, this means our ordering logic is working correctly\n }\n log.info({ args }, \"logging @electron/asar\")\n }\n try {\n return await task()\n } finally {\n console.log = consoleLogger\n }\n}\n\n/** @internal */\nexport class AsarPackager {\n private readonly outFile: string\n\n constructor(\n readonly packager: PlatformPackager<any>,\n private readonly config: {\n defaultDestination: string\n resourcePath: string\n options: AsarOptions\n unpackPattern: Filter | undefined\n }\n ) {\n this.outFile = path.join(config.resourcePath, `app.asar`)\n }\n\n async pack(fileSets: Array<ResolvedFileSet>) {\n const orderedFileSets = [\n // Write dependencies first to minimize offset changes to asar header\n ...fileSets.slice(1),\n\n // Finish with the app files that change most often\n fileSets[0],\n ].map(set => this.orderFileSet(set))\n\n const streams = await this.processFileSets(orderedFileSets)\n await this.executeElectronAsar(streams)\n }\n\n private async executeElectronAsar(streams: AsarStreamType[]) {\n await withElectronAsarLogging(async () => {\n const { createPackageFromStreams } = await dynamicImport<typeof import(\"@electron/asar\")>(\"@electron/asar\")\n await createPackageFromStreams(this.outFile, streams)\n })\n }\n\n private async processFileSets(fileSets: ResolvedFileSet[]): Promise<AsarStreamType[]> {\n const unpackedPaths = new Set<string>()\n if (this.config.options.smartUnpack !== false) {\n for (const fileSet of fileSets) {\n detectUnpackedDirs(fileSet, unpackedPaths)\n }\n }\n\n const resultsMap = new Map<string, AsarStreamType>()\n const streamOrdering: string[] = []\n const normalizedUnpackedPaths = Array.from(unpackedPaths).map(p => path.normalize(p))\n\n // Check whether a file or directory should be unpacked, using pre-normalized unpacked paths and early returns\n const isUnpacked = (dir: string, file?: string, stat?: FilterStats): boolean => {\n const normalizedDir = path.normalize(dir)\n\n // Check file pattern first (most specific)\n if (!isEmptyOrSpaces(file) && stat && this.config.unpackPattern?.(file, stat)) {\n return true\n }\n\n // Check if path is within any unpacked directory\n for (const unpackedPath of normalizedUnpackedPaths) {\n if (normalizedDir === unpackedPath || normalizedDir.startsWith(unpackedPath + path.sep)) {\n return true\n }\n }\n\n return false\n }\n\n // First pass: process all files in order, ensuring parent directories exist\n for (const fileSet of fileSets) {\n // Don't use Promise.all, we need to retain order of execution/iteration through the already-ordered fileset\n for (const [index, file] of fileSet.files.entries()) {\n const transformedData = fileSet.transformedFiles?.get(index)\n const stat = fileSet.metadata.get(file)!\n const destination = path.relative(this.config.defaultDestination, getDestinationPath(file, fileSet))\n\n // Ensure parent directories exist before processing file\n this.ensureParentDirectories(destination, resultsMap, streamOrdering)\n\n const result = await this.processFileOrSymlink({\n file,\n destination,\n fileSet,\n transformedData,\n stat,\n isUnpacked,\n })\n\n if (result && !resultsMap.has(result.path)) {\n resultsMap.set(result.path, result)\n streamOrdering.push(result.path)\n }\n }\n }\n\n // Second pass: propagate unpacked flag to parent directories\n for (const entry of resultsMap.values()) {\n if (entry.unpacked) {\n this.markParentDirectoriesAsUnpacked(entry.path, resultsMap, isUnpacked)\n }\n }\n\n // Build final results array maintaining processing order\n return streamOrdering.reduce<AsarStreamType[]>((streams, path) => {\n const stream = resultsMap.has(path) ? resultsMap.get(path) : null\n if (stream != null) {\n streams.push(stream)\n }\n return streams\n }, [])\n }\n\n private ensureParentDirectories(destination: string, resultsMap: Map<string, AsarStreamType>, streamOrdering: string[]): void {\n const parents: string[] = []\n let current = path.dirname(path.normalize(destination))\n\n // Collect all parent directories from deepest to root\n while (current !== \".\") {\n parents.unshift(current)\n current = path.dirname(current)\n }\n\n // Add parent directories in order (root to deepest)\n for (const parentPath of parents) {\n if (!resultsMap.has(parentPath)) {\n const dir: AsarDirectory = {\n type: \"directory\",\n path: parentPath,\n unpacked: false, // Updated in second pass if needed\n }\n resultsMap.set(parentPath, dir)\n streamOrdering.push(parentPath)\n }\n }\n }\n\n private markParentDirectoriesAsUnpacked(destination: string, resultsMap: Map<string, AsarStreamType>, isUnpacked: (path: string) => boolean): void {\n let current = path.dirname(path.normalize(destination))\n\n while (current !== \".\") {\n const entry = resultsMap.get(current)\n if (entry && isUnpacked(current)) {\n entry.unpacked = true\n }\n current = path.dirname(current)\n }\n }\n\n private async processFileOrSymlink(options: {\n file: string\n destination: string\n stat: fs.Stats\n fileSet: ResolvedFileSet\n transformedData: string | Buffer | undefined\n isUnpacked: (dir: string, file?: string, stat?: FilterStats) => boolean\n }): Promise<AsarStreamType> {\n const { isUnpacked, transformedData, file, destination, stat } = options\n const unpacked = isUnpacked(destination, file, stat)\n\n // Handle directories\n if (!stat.isFile() && !stat.isSymbolicLink()) {\n return { path: destination, unpacked, type: \"directory\" }\n }\n\n // Handle transformed data (pre-processed content)\n if (transformedData != null) {\n const size = Buffer.byteLength(transformedData)\n return {\n path: destination,\n streamGenerator: () =>\n new Readable({\n read() {\n this.push(transformedData)\n this.push(null)\n },\n }),\n unpacked,\n type: \"file\",\n stat: { mode: stat.mode, size },\n }\n }\n\n // verify that the file is not a direct link or symlinked to access/copy a system file\n await this.protectSystemAndUnsafePaths(file, await this.packager.getWorkspaceRoot())\n\n const baseConfig = {\n path: destination,\n streamGenerator: () => fs.createReadStream(file),\n unpacked,\n stat,\n }\n\n // Handle regular files\n if (!stat.isSymbolicLink()) {\n return { ...baseConfig, type: \"file\" }\n }\n\n // Handle symlinks - make relative to source location\n let link = await readlink(file)\n if (path.isAbsolute(link)) {\n link = path.relative(path.dirname(file), link)\n }\n\n return {\n ...baseConfig,\n type: \"link\",\n symlink: link,\n }\n }\n\n private orderFileSet(fileSet: ResolvedFileSet): ResolvedFileSet {\n const sortedFileEntries = Array.from(fileSet.files.entries())\n\n sortedFileEntries.sort(([, a], [, b]) => {\n if (a === b) {\n return 0\n }\n\n // Place addons last because their signature changes per build\n const isAAddon = a.endsWith(\".node\")\n const isBAddon = b.endsWith(\".node\")\n if (isAAddon && !isBAddon) {\n return 1\n }\n if (isBAddon && !isAAddon) {\n return -1\n }\n\n // Otherwise order by name\n return a < b ? -1 : 1\n })\n\n let transformedFiles: Map<number, string | Buffer> | undefined\n if (fileSet.transformedFiles) {\n transformedFiles = new Map()\n\n const indexMap = new Map<number, number>()\n for (const [newIndex, [oldIndex]] of sortedFileEntries.entries()) {\n indexMap.set(oldIndex, newIndex)\n }\n\n for (const [oldIndex, value] of fileSet.transformedFiles) {\n const newIndex = indexMap.get(oldIndex)\n if (newIndex === undefined) {\n throw new Error(`Internal error: ${fileSet.files[oldIndex]} was lost while ordering asar`)\n }\n transformedFiles.set(newIndex, value)\n }\n }\n\n return {\n src: fileSet.src,\n destination: fileSet.destination,\n metadata: fileSet.metadata,\n files: sortedFileEntries.map(([, file]) => file),\n transformedFiles,\n }\n }\n\n private async checkAgainstRoots(target: string, allowRoots: string[]): Promise<boolean> {\n const resolved = await resolvePath(target)\n if (resolved == null || isEmptyOrSpaces(resolved)) {\n return false\n }\n\n for (const root of allowRoots) {\n if (resolved === root || resolved.startsWith(root + path.sep)) {\n return true\n }\n }\n return false\n }\n\n private async protectSystemAndUnsafePaths(file: string, workspaceRoot: string): Promise<void> {\n const resolved = await resolvePath(file)\n const logFields = { source: file, realPath: resolved }\n\n const workspace = await resolvePath(workspaceRoot)\n\n // If in workspace, always safe\n if (workspace && resolved?.startsWith(workspace)) {\n return\n }\n\n // Check allowlist (priority)\n if (await this.checkAgainstRoots(file, await ALLOWLIST)) {\n return\n }\n\n // Check denylist\n if (await this.checkAgainstRoots(file, await DENYLIST)) {\n log.error(logFields, `denied access to system or unsafe path`)\n throw new Error(`Cannot copy file [${file}] symlinked to file [${resolved}] outside the package to a system or unsafe path`)\n }\n\n // Default: outside explicit paths but not explicitly denied\n log.debug(logFields, `path is outside of explicit safe paths, defaulting to safe`)\n }\n}\n"]}
|
package/dist/configuration.d.ts
CHANGED
|
@@ -672,6 +672,12 @@ export interface ToolsetConfig {
|
|
|
672
672
|
* |---------|-------------|-----------------|-------|
|
|
673
673
|
* | `"0.0.0"` | 4.0.1 | macOS | Legacy portable bundle (pre-v27) |
|
|
674
674
|
* | `"1.0.1"` | 11.0 | macOS | Supports arm64 macOS via Rosetta |
|
|
675
|
+
* | `"system"` | host install | macOS, Linux | Uses the `wine` binary on `PATH` instead of a bundle |
|
|
676
|
+
*
|
|
677
|
+
* `"system"` is the replacement for the `USE_SYSTEM_WINE` environment variable removed in v27, and
|
|
678
|
+
* is what `"latest"` (the default) currently resolves to on every platform: the published `"1.0.1"`
|
|
679
|
+
* bundles ship no PE builtins, so a host Wine installation is required to build Windows targets on
|
|
680
|
+
* macOS or Linux.
|
|
675
681
|
*
|
|
676
682
|
* To use a custom Wine binary, use a `ToolsetCustom` object.
|
|
677
683
|
*
|
|
@@ -679,7 +685,7 @@ export interface ToolsetConfig {
|
|
|
679
685
|
*
|
|
680
686
|
* @default "latest"
|
|
681
687
|
*/
|
|
682
|
-
readonly wine?: "0.0.0" | "1.0.1" | ToolsetCustom | "latest";
|
|
688
|
+
readonly wine?: "0.0.0" | "1.0.1" | "system" | ToolsetCustom | "latest";
|
|
683
689
|
/**
|
|
684
690
|
* Version of the FPM bundle used to build Linux packages (`.deb`, `.rpm`, `.pacman`, etc.)
|
|
685
691
|
* on macOS and Linux hosts.
|
|
@@ -749,6 +755,30 @@ export interface ToolsetConfig {
|
|
|
749
755
|
* @default "latest"
|
|
750
756
|
*/
|
|
751
757
|
readonly icons?: "1.2.3" | ToolsetCustom | "latest";
|
|
758
|
+
/**
|
|
759
|
+
* Version of the `squirrel.windows` bundle used to build Squirrel.Windows installers.
|
|
760
|
+
*
|
|
761
|
+
* The bundle ships the Squirrel vendor toolset under `electron-winstaller/vendor/`:
|
|
762
|
+
* - **`Squirrel.exe`** / **`Squirrel-Mono.exe`** — releasify the app into `Setup.exe` (and an optional MSI).
|
|
763
|
+
* - **`SyncReleases.exe`** — downloads prior releases to produce delta packages.
|
|
764
|
+
* - **`nuget.exe`**, **`7z`** — pack the app into a `.nupkg` and compress release assets.
|
|
765
|
+
*
|
|
766
|
+
* `rcedit.exe` is provisioned from the {@link winCodeSign} toolset at runtime (on every platform;
|
|
767
|
+
* under Wine on non-Windows hosts). Building an MSI additionally uses the shared WiX toolset.
|
|
768
|
+
*
|
|
769
|
+
* Available versions:
|
|
770
|
+
* | Version | Notes |
|
|
771
|
+
* |---------|-------|
|
|
772
|
+
* | `"1.1.1"` | Squirrel.Windows 2.0.1 (patched) with a standalone, checksum-verified `nuget.exe` 6.14.0 |
|
|
773
|
+
*
|
|
774
|
+
* Set to a {@link ToolsetCustom} object to supply your own bundle — it must contain the
|
|
775
|
+
* `electron-winstaller/vendor/` subtree. Only used when building the `squirrelWindows` target.
|
|
776
|
+
*
|
|
777
|
+
* Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/squirrel.windows/CHANGELOG.md
|
|
778
|
+
*
|
|
779
|
+
* @default "latest"
|
|
780
|
+
*/
|
|
781
|
+
readonly squirrel?: "1.1.1" | ToolsetCustom | "latest";
|
|
752
782
|
}
|
|
753
783
|
/**
|
|
754
784
|
* A custom toolset bundle supplied by the user in place of a built-in versioned bundle.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,E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CAAC,EAAE,IAAI,CAAC,uCAAuC,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,IAAI,CAAA;CAC9F;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAEvC;;;;;;;OAOG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAE/B;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;OASG;IACH,IAAI,EAAE,MAAM,CAAA;CACb"}
|
|
@@ -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 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 * | `\"1.0.1\"` | Same tools rebuilt on macOS 15 runners — binaries run on macOS 15+ (1.0.0 required macOS 26) |\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\" | \"1.0.1\" | 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 * Available versions:\n * | Version | Notes |\n * |---------|-------|\n * | `\"1.0.0\"` | Shipped the 32-bit `7za.exe` for every Windows arch (1.75 GiB memory cap, no LZMA2 multithreading on x64/arm64) |\n * | `\"1.0.1\"` | Correct per-arch Windows binaries (x64, ia32, arm64) |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/7zip/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly sevenZip?: \"1.0.0\" | \"1.0.1\" | 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-256 checksum of the custom toolset bundle for verification, as a lowercase hex string\n * (e.g. the output of `shasum -a 256 bundle.tar.gz`) — not the base64 values GitHub release\n * notes may show.\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
|
+
{"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 * | `\"system\"` | host install | macOS, Linux | Uses the `wine` binary on `PATH` instead of a bundle |\n *\n * `\"system\"` is the replacement for the `USE_SYSTEM_WINE` environment variable removed in v27, and\n * is what `\"latest\"` (the default) currently resolves to on every platform: the published `\"1.0.1\"`\n * bundles ship no PE builtins, so a host Wine installation is required to build Windows targets on\n * macOS or Linux.\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\" | \"system\" | 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 * | `\"1.0.1\"` | Same tools rebuilt on macOS 15 runners — binaries run on macOS 15+ (1.0.0 required macOS 26) |\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\" | \"1.0.1\" | 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 * Available versions:\n * | Version | Notes |\n * |---------|-------|\n * | `\"1.0.0\"` | Shipped the 32-bit `7za.exe` for every Windows arch (1.75 GiB memory cap, no LZMA2 multithreading on x64/arm64) |\n * | `\"1.0.1\"` | Correct per-arch Windows binaries (x64, ia32, arm64) |\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/7zip/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly sevenZip?: \"1.0.0\" | \"1.0.1\" | 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 * Version of the `squirrel.windows` bundle used to build Squirrel.Windows installers.\n *\n * The bundle ships the Squirrel vendor toolset under `electron-winstaller/vendor/`:\n * - **`Squirrel.exe`** / **`Squirrel-Mono.exe`** — releasify the app into `Setup.exe` (and an optional MSI).\n * - **`SyncReleases.exe`** — downloads prior releases to produce delta packages.\n * - **`nuget.exe`**, **`7z`** — pack the app into a `.nupkg` and compress release assets.\n *\n * `rcedit.exe` is provisioned from the {@link winCodeSign} toolset at runtime (on every platform;\n * under Wine on non-Windows hosts). Building an MSI additionally uses the shared WiX toolset.\n *\n * Available versions:\n * | Version | Notes |\n * |---------|-------|\n * | `\"1.1.1\"` | Squirrel.Windows 2.0.1 (patched) with a standalone, checksum-verified `nuget.exe` 6.14.0 |\n *\n * Set to a {@link ToolsetCustom} object to supply your own bundle — it must contain the\n * `electron-winstaller/vendor/` subtree. Only used when building the `squirrelWindows` target.\n *\n * Releases: https://github.com/electron-userland/electron-builder-binaries/blob/master/packages/squirrel.windows/CHANGELOG.md\n *\n * @default \"latest\"\n */\n readonly squirrel?: \"1.1.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-256 checksum of the custom toolset bundle for verification, as a lowercase hex string\n * (e.g. the output of `shasum -a 256 bundle.tar.gz`) — not the base64 values GitHub release\n * notes may show.\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,5 +1,5 @@
|
|
|
1
1
|
import { Configuration } from "../configuration.js";
|
|
2
|
-
import { BeforeCopyExtraFilesOptions, Framework } from "../Framework.js";
|
|
2
|
+
import { BeforeCopyExtraFilesOptions, Framework, PrepareApplicationStageDirectoryOptions } from "../Framework.js";
|
|
3
3
|
import { Packager } from "../index.js";
|
|
4
4
|
export type ElectronPlatformName = "darwin" | "linux" | "win32" | "mas";
|
|
5
5
|
/**
|
|
@@ -13,4 +13,5 @@ export interface ElectronBrandingOptions {
|
|
|
13
13
|
export declare function createBrandingOpts(opts: Configuration): Required<ElectronBrandingOptions>;
|
|
14
14
|
export declare function removeUnusedLanguagesIfNeeded(options: BeforeCopyExtraFilesOptions): Promise<void>;
|
|
15
15
|
export declare function createElectronFrameworkSupport(configuration: Configuration, packager: Packager): Promise<Framework>;
|
|
16
|
+
export declare function cleanupAfterUnpack(prepareOptions: PrepareApplicationStageDirectoryOptions, distMacOsAppName: string, isFullCleanup: boolean): Promise<[void, void, void]>;
|
|
16
17
|
//# sourceMappingURL=ElectronFramework.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElectronFramework.d.ts","sourceRoot":"","sources":["../../src/electron/ElectronFramework.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,2BAA2B,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"ElectronFramework.d.ts","sourceRoot":"","sources":["../../src/electron/ElectronFramework.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,2BAA2B,EAAE,SAAS,EAAE,uCAAuC,EAAE,MAAM,iBAAiB,CAAA;AACjH,OAAO,EAAE,QAAQ,EAAY,MAAM,aAAa,CAAA;AAahD,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,CAAA;AAEvE;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,aAAa,GAAG,QAAQ,CAAC,uBAAuB,CAAC,CAKzF;AAuBD,wBAAsB,6BAA6B,CAAC,OAAO,EAAE,2BAA2B,iBAsDvF;AA6CD,wBAAsB,8BAA8B,CAAC,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC,CAiBzH;AA+ED,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,uCAAuC,EAAE,gBAAgB,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,+BAU3I"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { asArray, copyDir, DO_NOT_USE_HARD_LINKS, isEmptyOrSpaces, log, MAX_FILE_REQUESTS, sanitizeDirPath, statOrNull, unlinkIfExists } from "builder-util";
|
|
1
|
+
import { asArray, copyDir, DO_NOT_USE_HARD_LINKS, isEmptyOrSpaces, log, MAX_FILE_REQUESTS, orIfFileNotExist, sanitizeDirPath, statOrNull, unlinkIfExists } from "builder-util";
|
|
2
2
|
import _fsExtra from "fs-extra";
|
|
3
3
|
import * as path from "path";
|
|
4
4
|
import asyncPool from "tiny-async-pool";
|
|
@@ -211,18 +211,25 @@ async function unpack(prepareOptions, _distMacOsAppName) {
|
|
|
211
211
|
}
|
|
212
212
|
return selectElectron(resolvedDist);
|
|
213
213
|
}
|
|
214
|
-
function cleanupAfterUnpack(prepareOptions, distMacOsAppName, isFullCleanup) {
|
|
214
|
+
export function cleanupAfterUnpack(prepareOptions, distMacOsAppName, isFullCleanup) {
|
|
215
215
|
const out = prepareOptions.appOutDir;
|
|
216
216
|
const isMac = prepareOptions.packager.platform === Platform.MAC;
|
|
217
217
|
const resourcesPath = isMac ? path.join(out, distMacOsAppName, "Contents", "Resources") : path.join(out, "resources");
|
|
218
218
|
return Promise.all([
|
|
219
219
|
isFullCleanup ? unlinkIfExists(path.join(resourcesPath, "default_app.asar")) : Promise.resolve(),
|
|
220
220
|
isFullCleanup ? unlinkIfExists(path.join(out, "version")) : Promise.resolve(),
|
|
221
|
-
isMac
|
|
222
|
-
? Promise.resolve()
|
|
223
|
-
: rename(path.join(out, "LICENSE"), path.join(out, "LICENSE.electron.txt")).catch(() => {
|
|
224
|
-
/* ignore */
|
|
225
|
-
}),
|
|
221
|
+
retainElectronLicenseFiles(out, resourcesPath, isMac),
|
|
226
222
|
]);
|
|
227
223
|
}
|
|
224
|
+
/**
|
|
225
|
+
* The Electron dist ships Electron's own `LICENSE` and Chromium's `LICENSES.chromium.html` next to the binary, and both licenses require them to be
|
|
226
|
+
* retained in distributables. On win/linux they stay next to the executable, but on macOS they sit outside the `.app` bundle, which is the only thing
|
|
227
|
+
* packaged into the artifacts, so move them into `Contents/Resources`. See https://github.com/electron-userland/electron-builder/issues/9407
|
|
228
|
+
*/
|
|
229
|
+
async function retainElectronLicenseFiles(appOutDir, resourcesPath, isMac) {
|
|
230
|
+
const destinationDir = isMac ? resourcesPath : appOutDir;
|
|
231
|
+
// a custom Electron distribution may not ship license files, so only a missing source file is tolerated; any other error propagates
|
|
232
|
+
const move = (name, newName = name) => orIfFileNotExist(rename(path.join(appOutDir, name), path.join(destinationDir, newName)), undefined);
|
|
233
|
+
await Promise.all([move("LICENSE", "LICENSE.electron.txt"), ...(isMac ? [move("LICENSES.chromium.html")] : [])]);
|
|
234
|
+
}
|
|
228
235
|
//# sourceMappingURL=ElectronFramework.js.map
|