app-builder-lib 26.9.1 → 26.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/out/ProtonFramework.d.ts +1 -1
  2. package/out/ProtonFramework.js +2 -2
  3. package/out/ProtonFramework.js.map +1 -1
  4. package/out/binDownload.d.ts +2 -18
  5. package/out/binDownload.js +33 -185
  6. package/out/binDownload.js.map +1 -1
  7. package/out/codeSign/windowsSignToolManager.js +1 -1
  8. package/out/codeSign/windowsSignToolManager.js.map +1 -1
  9. package/out/configuration.d.ts +100 -68
  10. package/out/configuration.js.map +1 -1
  11. package/out/core.d.ts +2 -2
  12. package/out/core.js.map +1 -1
  13. package/out/electron/ElectronFramework.d.ts +2 -19
  14. package/out/electron/ElectronFramework.js +47 -40
  15. package/out/electron/ElectronFramework.js.map +1 -1
  16. package/out/electron/injectFFMPEG.d.ts +10 -1
  17. package/out/electron/injectFFMPEG.js +48 -34
  18. package/out/electron/injectFFMPEG.js.map +1 -1
  19. package/out/frameworks/LibUiFramework.d.ts +3 -2
  20. package/out/frameworks/LibUiFramework.js +5 -2
  21. package/out/frameworks/LibUiFramework.js.map +1 -1
  22. package/out/index.d.ts +3 -2
  23. package/out/index.js +1 -1
  24. package/out/index.js.map +1 -1
  25. package/out/macPackager.js +24 -3
  26. package/out/macPackager.js.map +1 -1
  27. package/out/node-module-collector/moduleManager.d.ts +7 -1
  28. package/out/node-module-collector/moduleManager.js +9 -2
  29. package/out/node-module-collector/moduleManager.js.map +1 -1
  30. package/out/node-module-collector/nodeModulesCollector.js +5 -3
  31. package/out/node-module-collector/nodeModulesCollector.js.map +1 -1
  32. package/out/node-module-collector/pnpmNodeModulesCollector.d.ts +26 -2
  33. package/out/node-module-collector/pnpmNodeModulesCollector.js +98 -18
  34. package/out/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
  35. package/out/options/AppXOptions.d.ts +1 -1
  36. package/out/options/AppXOptions.js.map +1 -1
  37. package/out/options/PlatformSpecificBuildOptions.d.ts +31 -11
  38. package/out/options/PlatformSpecificBuildOptions.js.map +1 -1
  39. package/out/options/SnapOptions.d.ts +1 -1
  40. package/out/options/SnapOptions.js.map +1 -1
  41. package/out/options/linuxOptions.d.ts +38 -12
  42. package/out/options/linuxOptions.js.map +1 -1
  43. package/out/options/macOptions.d.ts +10 -7
  44. package/out/options/macOptions.js.map +1 -1
  45. package/out/options/metadata.d.ts +1 -2
  46. package/out/options/metadata.js.map +1 -1
  47. package/out/options/pkgOptions.d.ts +1 -1
  48. package/out/options/pkgOptions.js.map +1 -1
  49. package/out/options/winOptions.d.ts +15 -5
  50. package/out/options/winOptions.js.map +1 -1
  51. package/out/packager.js +12 -12
  52. package/out/packager.js.map +1 -1
  53. package/out/platformPackager.js +2 -5
  54. package/out/platformPackager.js.map +1 -1
  55. package/out/targets/FpmTarget.js +3 -2
  56. package/out/targets/FpmTarget.js.map +1 -1
  57. package/out/targets/LinuxTargetHelper.d.ts +4 -4
  58. package/out/targets/LinuxTargetHelper.js.map +1 -1
  59. package/out/targets/MsiTarget.js +1 -1
  60. package/out/targets/MsiTarget.js.map +1 -1
  61. package/out/targets/appimage/AppImageTarget.d.ts +1 -0
  62. package/out/targets/appimage/AppImageTarget.js +30 -10
  63. package/out/targets/appimage/AppImageTarget.js.map +1 -1
  64. package/out/targets/appimage/appImageUtil.d.ts +30 -2
  65. package/out/targets/appimage/appImageUtil.js +26 -24
  66. package/out/targets/appimage/appImageUtil.js.map +1 -1
  67. package/out/targets/appimage/appLauncher.d.ts +1 -1
  68. package/out/targets/appimage/appLauncher.js +7 -3
  69. package/out/targets/appimage/appLauncher.js.map +1 -1
  70. package/out/targets/archive.js +20 -6
  71. package/out/targets/archive.js.map +1 -1
  72. package/out/targets/nsis/NsisTarget.js +11 -11
  73. package/out/targets/nsis/NsisTarget.js.map +1 -1
  74. package/out/targets/nsis/nsisOptions.d.ts +20 -16
  75. package/out/targets/nsis/nsisOptions.js.map +1 -1
  76. package/out/targets/nsis/nsisScriptGenerator.d.ts +1 -0
  77. package/out/targets/nsis/nsisScriptGenerator.js +14 -1
  78. package/out/targets/nsis/nsisScriptGenerator.js.map +1 -1
  79. package/out/targets/nsis/nsisUtil.js +4 -3
  80. package/out/targets/nsis/nsisUtil.js.map +1 -1
  81. package/out/toolsets/linux.js +8 -8
  82. package/out/toolsets/linux.js.map +1 -1
  83. package/out/toolsets/windows.d.ts +16 -16
  84. package/out/toolsets/windows.js +29 -21
  85. package/out/toolsets/windows.js.map +1 -1
  86. package/out/util/NodeModuleCopyHelper.js +1 -1
  87. package/out/util/NodeModuleCopyHelper.js.map +1 -1
  88. package/out/util/appBuilder.js +1 -1
  89. package/out/util/appBuilder.js.map +1 -1
  90. package/out/util/cacheState.d.ts +28 -0
  91. package/out/util/cacheState.js +143 -0
  92. package/out/util/cacheState.js.map +1 -0
  93. package/out/util/electronGet.d.ts +56 -0
  94. package/out/util/electronGet.js +388 -0
  95. package/out/util/electronGet.js.map +1 -0
  96. package/out/util/macroExpander.js +3 -0
  97. package/out/util/macroExpander.js.map +1 -1
  98. package/out/util/resEdit.d.ts +10 -0
  99. package/out/util/resEdit.js +48 -0
  100. package/out/util/resEdit.js.map +1 -0
  101. package/out/util/resolve.d.ts +1 -1
  102. package/out/util/resolve.js +16 -1
  103. package/out/util/resolve.js.map +1 -1
  104. package/out/version.d.ts +1 -1
  105. package/out/version.js +1 -1
  106. package/out/version.js.map +1 -1
  107. package/out/vm/ParallelsVm.d.ts +16 -0
  108. package/out/vm/ParallelsVm.js +0 -1
  109. package/out/vm/ParallelsVm.js.map +1 -1
  110. package/out/winPackager.js +44 -42
  111. package/out/winPackager.js.map +1 -1
  112. package/package.json +11 -9
  113. package/scheme.json +672 -135
@@ -1,9 +1,9 @@
1
1
  import { Arch } from "builder-util";
2
2
  import { BeforeBuildContext, Target } from "./core";
3
- import { ElectronBrandingOptions, ElectronDownloadOptions } from "./electron/ElectronFramework";
3
+ import { ElectronBrandingOptions } from "./electron/ElectronFramework";
4
4
  import { PrepareApplicationStageDirectoryOptions } from "./Framework";
5
5
  import { AppXOptions } from "./options/AppXOptions";
6
- import { AppImageOptions, DebOptions, FlatpakOptions, LinuxConfiguration, LinuxTargetSpecificOptions } from "./options/linuxOptions";
6
+ import { AppImageOptions, DebOptions, FlatpakOptions, LinuxConfiguration, LinuxTargetSpecificOptions, PacmanOptions, RpmOptions } from "./options/linuxOptions";
7
7
  import { DmgOptions, MacConfiguration, MasConfiguration } from "./options/macOptions";
8
8
  import { MsiOptions } from "./options/MsiOptions";
9
9
  import { MsiWrappedOptions } from "./options/MsiWrappedOptions";
@@ -16,6 +16,7 @@ import { BuildResult } from "./packager";
16
16
  import { ArtifactBuildStarted, ArtifactCreated } from "./packagerApi";
17
17
  import { PlatformPackager } from "./platformPackager";
18
18
  import { NsisOptions, NsisWebOptions, PortableOptions } from "./targets/nsis/nsisOptions";
19
+ import { ElectronDownloadOptions, ElectronGetOptions } from "./util/electronGet";
19
20
  /**
20
21
  * Configuration Options
21
22
  */
@@ -68,39 +69,75 @@ export interface CommonConfiguration {
68
69
  * Options related to how build Windows targets.
69
70
  */
70
71
  readonly win?: WindowsConfiguration | null;
72
+ /** NSIS installer options. */
71
73
  readonly nsis?: NsisOptions | null;
74
+ /** NSIS web installer options (downloads app package at install time). */
72
75
  readonly nsisWeb?: NsisWebOptions | null;
76
+ /** Portable executable options (no installation required). */
73
77
  readonly portable?: PortableOptions | null;
78
+ /** Windows Store (AppX) package options. */
74
79
  readonly appx?: AppXOptions | null;
75
- /** @private */
80
+ /**
81
+ * MSI package options.
82
+ */
76
83
  readonly msi?: MsiOptions | null;
77
- /** @private */
84
+ /**
85
+ * MSI-wrapped installer options.
86
+ */
78
87
  readonly msiWrapped?: MsiWrappedOptions | null;
88
+ /**
89
+ * Squirrel.Windows installer options. Requires the `electron-builder-squirrel-windows` dependency.
90
+ */
79
91
  readonly squirrelWindows?: SquirrelWindowsOptions | null;
80
92
  /**
81
- * Options related to how build Linux targets.
93
+ * General Linux build options shared across all Linux targets (icon, category, desktop entry,
94
+ * executable name, etc.). Target-specific compression and packaging options live in the
95
+ * per-format interfaces (`DebOptions`, `RpmOptions`, `PacmanOptions`, etc.).
82
96
  */
83
97
  readonly linux?: LinuxConfiguration | null;
84
98
  /**
85
- * Debian package options.
99
+ * Debian package options. Targets Debian, Ubuntu, and Debian-based distributions.
100
+ * Produces a `.deb` archive installable via `dpkg -i` or `apt install`.
86
101
  */
87
102
  readonly deb?: DebOptions | null;
88
103
  /**
89
- * Snap options.
104
+ * Snap package options. Requires [snapcraft](https://snapcraft.io/) to be installed.
90
105
  */
91
106
  readonly snap?: SnapOptions | null;
92
107
  /**
93
- * AppImage options.
108
+ * AppImage options. AppImage is a portable application format that bundles the app
109
+ * and its dependencies into a single self-contained executable that runs on most
110
+ * Linux distributions without installation.
94
111
  */
95
112
  readonly appImage?: AppImageOptions | null;
96
113
  /**
97
- * Flatpak options.
114
+ * Flatpak options. Flatpak is a sandboxed application distribution format for Linux
115
+ * that runs in a controlled environment and is distributed via [Flathub](https://flathub.org/)
116
+ * or other Flatpak repositories.
98
117
  */
99
118
  readonly flatpak?: FlatpakOptions | null;
100
- readonly pacman?: LinuxTargetSpecificOptions | null;
101
- readonly rpm?: LinuxTargetSpecificOptions | null;
119
+ /**
120
+ * Pacman package options. Targets Arch Linux and Arch-based distributions
121
+ * (Manjaro, EndeavourOS, etc.). Produces a `.pacman` archive installable via `pacman -U`.
122
+ */
123
+ readonly pacman?: PacmanOptions | null;
124
+ /**
125
+ * RPM package options. Targets Fedora, Red Hat Enterprise Linux, SUSE, and related
126
+ * distributions. Produces a `.rpm` archive installable via `rpm` or `dnf`.
127
+ */
128
+ readonly rpm?: RpmOptions | null;
129
+ /**
130
+ * FreeBSD package options. Produces a `.pkg` archive for the FreeBSD `pkg` package manager.
131
+ */
102
132
  readonly freebsd?: LinuxTargetSpecificOptions | null;
133
+ /**
134
+ * Solaris IPS package options. Produces a `.p5p` archive for the Solaris Image Packaging
135
+ * System (`pkg`).
136
+ */
103
137
  readonly p5p?: LinuxTargetSpecificOptions | null;
138
+ /**
139
+ * Alpine Linux APK package options. Produces an `.apk` archive installable via `apk add`.
140
+ */
104
141
  readonly apk?: LinuxTargetSpecificOptions | null;
105
142
  /**
106
143
  * Whether to build the application native dependencies from source.
@@ -181,12 +218,14 @@ export interface CommonConfiguration {
181
218
  export interface Configuration extends CommonConfiguration, PlatformSpecificBuildOptions, Hooks {
182
219
  /**
183
220
  * Whether to use [electron-compile](http://github.com/electron/electron-compile) to compile app. Defaults to `true` if `electron-compile` in the dependencies. And `false` if in the `devDependencies` or doesn't specified.
221
+ * @deprecated `electron-compile` is no longer maintained. Compile your app with a modern bundler (webpack, vite, etc.) instead.
184
222
  */
185
223
  readonly electronCompile?: boolean;
186
224
  /**
187
- * The [electron-download](https://github.com/electron-userland/electron-download#usage) options.
225
+ * The [electron-download](https://github.com/electron-userland/electron-download#usage) options. (legacy)
226
+ * Alternatively, you can use [electron/get](https://github.com/electron/get#usage) options.
188
227
  */
189
- readonly electronDownload?: ElectronDownloadOptions;
228
+ readonly electronDownload?: ElectronDownloadOptions | ElectronGetOptions | null;
190
229
  /**
191
230
  * The branding used by Electron's distributables. This is needed if a fork has modified Electron's BRANDING.json file.
192
231
  */
@@ -206,14 +245,17 @@ export interface Configuration extends CommonConfiguration, PlatformSpecificBuil
206
245
  /**
207
246
  * *libui-based frameworks only* The version of NodeJS you are packaging for.
208
247
  * You can set it to `current` to set the Node.js version that you use to run.
248
+ * @deprecated libui-based frameworks (proton-native, etc.) are no longer actively maintained. This option has no effect when using Electron.
209
249
  */
210
250
  readonly nodeVersion?: string | null;
211
251
  /**
212
252
  * *libui-based frameworks only* The version of LaunchUI you are packaging for. Applicable for Windows only. Defaults to version suitable for used framework version.
253
+ * @deprecated libui-based frameworks (proton-native, etc.) are no longer actively maintained. This option has no effect when using Electron.
213
254
  */
214
255
  readonly launchUiVersion?: boolean | string | null;
215
256
  /**
216
257
  * The framework name. One of `electron`, `proton`, `libui`. Defaults to `electron`.
258
+ * @deprecated `proton` and `libui` framework support is no longer actively maintained. Use `electron` (the default).
217
259
  */
218
260
  readonly framework?: string | null;
219
261
  /**
@@ -267,79 +309,69 @@ export interface ToolsetConfig {
267
309
  }
268
310
  export interface Hooks {
269
311
  /**
270
- The function (or path to file or module id) to be run before pack.
271
-
272
- ```typescript
273
- (context: BeforePackContext): Promise<any> | any
274
- ```
275
-
276
- !!! example "As function"
277
-
278
- ```js
279
- beforePack: async (context) => {
280
- // your code
281
- }
282
- ```
283
-
284
- Because in a configuration file you cannot use JavaScript, can be specified as a path to file or module id. Function must be exported as default export.
285
-
286
- ```json
287
- "build": {
288
- "beforePack": "./myBeforePackHook.js"
289
- }
290
- ```
291
-
292
- File `myBeforePackHook.js` in the project root directory:
293
-
294
- !!! example "myBeforePackHook.js"
295
- ```js
296
- exports.default = async function(context) {
297
- // your custom code
298
- }
299
- ```
312
+ * The function (or path to file or module id) to be run before pack.
313
+ * Receives a {@link BeforePackContext}.
314
+ *
315
+ * Can be specified inline as a function in JavaScript configs:
316
+ * ```js
317
+ * // electron-builder.config.js
318
+ * module.exports = {
319
+ * beforePack: async (context) => {
320
+ * // your code
321
+ * }
322
+ * }
323
+ * ```
324
+ *
325
+ * Or as a path to a module that exports the function as its default export:
326
+ * ```json
327
+ * { "build": { "beforePack": "./myBeforePackHook.js" } }
328
+ * ```
329
+ * ```js
330
+ * // myBeforePackHook.js
331
+ * exports.default = async function(context) {
332
+ * // your custom code
333
+ * }
334
+ * ```
300
335
  */
301
336
  readonly beforePack?: Hook<BeforePackContext, void> | string | null;
302
337
  /**
303
- * The function (or path to file or module id) to be [run after the prebuilt Electron binary has been extracted to the output directory](#afterextract)
304
- * Same setup as {@link beforePack}
338
+ * The function (or path to file or module id) to be run after the prebuilt Electron binary has been extracted to the output directory.
339
+ * Receives an {@link AfterExtractContext}. For file/module setup, see {@link beforePack}.
305
340
  */
306
341
  readonly afterExtract?: Hook<AfterExtractContext, void> | string | null;
307
342
  /**
308
- * The function (or path to file or module id) to be [run after pack](#afterpack) (but before pack into distributable format and sign).
309
- * Same setup as {@link beforePack}
343
+ * The function (or path to file or module id) to be run after pack but before pack into distributable format and sign.
344
+ * Receives an {@link AfterPackContext}. For file/module setup, see {@link beforePack}.
310
345
  */
311
346
  readonly afterPack?: Hook<AfterPackContext, void> | string | null;
312
347
  /**
313
- * The function (or path to file or module id) to be [run after pack and sign](#aftersign) (but before pack into distributable format).
314
- * Same setup as {@link beforePack}
348
+ * The function (or path to file or module id) to be run after pack and sign but before pack into distributable format.
349
+ * Receives an {@link AfterPackContext}. For file/module setup, see {@link beforePack}.
315
350
  */
316
351
  readonly afterSign?: Hook<AfterPackContext, void> | string | null;
317
352
  /**
318
- * The function (or path to file or module id) to be run on artifact build start.
319
- * Same setup as {@link beforePack}
353
+ * The function (or path to file or module id) to be run when an individual artifact build starts.
354
+ * Receives an {@link ArtifactBuildStarted}. For file/module setup, see {@link beforePack}.
320
355
  */
321
356
  readonly artifactBuildStarted?: Hook<ArtifactBuildStarted, void> | string | null;
322
357
  /**
323
- * The function (or path to file or module id) to be run on artifact build completed.
324
- * Same setup as {@link beforePack}
358
+ * The function (or path to file or module id) to be run when an individual artifact build completes.
359
+ * Receives an {@link ArtifactCreated}. For file/module setup, see {@link beforePack}.
325
360
  */
326
361
  readonly artifactBuildCompleted?: Hook<ArtifactCreated, void> | string | null;
327
362
  /**
328
363
  * The function (or path to file or module id) to be run after all artifacts are built.
329
-
330
- ```typescript
331
- (buildResult: BuildResult): Promise<Array<string>> | Array<string>
332
- ```
333
-
334
- Configuration in the same way as `afterPack` (see above).
335
-
336
- !!! example "myAfterAllArtifactBuild.js"
337
- ```js
338
- exports.default = function () {
339
- // you can return additional files to publish
340
- return ["/path/to/additional/result/file"]
341
- }
342
- ```
364
+ * Receives a {@link BuildResult}. May return an array of additional file paths to publish.
365
+ *
366
+ * For file/module setup, see {@link beforePack}.
367
+ *
368
+ * @example
369
+ * ```js
370
+ * exports.default = function () {
371
+ * // return additional files to publish
372
+ * return ["/path/to/additional/result/file"]
373
+ * }
374
+ * ```
343
375
  */
344
376
  readonly afterAllArtifactBuild?: Hook<BuildResult, Array<string>> | string | null;
345
377
  /**
@@ -377,7 +409,7 @@ export interface MetadataDirectories {
377
409
  */
378
410
  readonly buildResources?: string | null;
379
411
  /**
380
- * The output directory. [File macros](./file-patterns.md#file-macros) are supported.
412
+ * The output directory. [File macros](https://www.electron.build/file-patterns#file-macros) are supported.
381
413
  * @default dist
382
414
  */
383
415
  readonly output?: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.js","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"","sourcesContent":["import { Arch } from \"builder-util\"\nimport { BeforeBuildContext, Target } from \"./core\"\nimport { ElectronBrandingOptions, ElectronDownloadOptions } from \"./electron/ElectronFramework\"\nimport { PrepareApplicationStageDirectoryOptions } from \"./Framework\"\nimport { AppXOptions } from \"./options/AppXOptions\"\nimport { AppImageOptions, DebOptions, FlatpakOptions, LinuxConfiguration, LinuxTargetSpecificOptions } from \"./options/linuxOptions\"\nimport { DmgOptions, MacConfiguration, MasConfiguration } from \"./options/macOptions\"\nimport { MsiOptions } from \"./options/MsiOptions\"\nimport { MsiWrappedOptions } from \"./options/MsiWrappedOptions\"\nimport { PkgOptions } from \"./options/pkgOptions\"\nimport { PlatformSpecificBuildOptions } from \"./options/PlatformSpecificBuildOptions\"\nimport { SnapOptions } from \"./options/SnapOptions\"\nimport { SquirrelWindowsOptions } from \"./options/SquirrelWindowsOptions\"\nimport { WindowsConfiguration } from \"./options/winOptions\"\nimport { BuildResult } from \"./packager\"\nimport { ArtifactBuildStarted, ArtifactCreated } from \"./packagerApi\"\nimport { PlatformPackager } from \"./platformPackager\"\nimport { NsisOptions, NsisWebOptions, PortableOptions } from \"./targets/nsis/nsisOptions\"\n\n// duplicate appId here because it is important\n/**\n * Configuration Options\n */\nexport interface CommonConfiguration {\n /**\n * The application id. Used as [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as\n * [Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.\n * @default com.electron.${name}\n */\n readonly appId?: string | null\n\n /**\n * As [name](#metadata), but allows you to specify a product name for your executable which contains spaces and other special characters not allowed in the [name property](https://docs.npmjs.com/files/package.json#name).\n * If not specified inside of the `build` configuration, `productName` property defined at the top level of `package.json` is used. If not specified at the top level of `package.json`, [name property](https://docs.npmjs.com/files/package.json#name) is used.\n */\n readonly productName?: string | null\n\n /**\n * The human-readable copyright line for the app.\n * @default Copyright © year ${author}\n */\n readonly copyright?: string | null\n\n /**\n * Directories for build resources\n */\n readonly directories?: MetadataDirectories | null\n\n /**\n * Configuration of toolsets utilized by electron-builder\n */\n readonly toolsets?: ToolsetConfig | null\n\n /**\n * Options related to how build macOS targets.\n */\n readonly mac?: MacConfiguration | null\n /**\n * MAS (Mac Application Store) options.\n */\n readonly mas?: MasConfiguration | null\n /**\n * MAS (Mac Application Store) development options (`mas-dev` target).\n */\n readonly masDev?: MasConfiguration | null\n /**\n * macOS DMG options.\n */\n readonly dmg?: DmgOptions | null\n /**\n * macOS PKG options.\n */\n readonly pkg?: PkgOptions | null\n\n /**\n * Options related to how build Windows targets.\n */\n readonly win?: WindowsConfiguration | null\n readonly nsis?: NsisOptions | null\n readonly nsisWeb?: NsisWebOptions | null\n readonly portable?: PortableOptions | null\n readonly appx?: AppXOptions | null\n /** @private */\n readonly msi?: MsiOptions | null\n /** @private */\n readonly msiWrapped?: MsiWrappedOptions | null\n readonly squirrelWindows?: SquirrelWindowsOptions | null\n\n /**\n * Options related to how build Linux targets.\n */\n readonly linux?: LinuxConfiguration | null\n /**\n * Debian package options.\n */\n readonly deb?: DebOptions | null\n /**\n * Snap options.\n */\n readonly snap?: SnapOptions | null\n /**\n * AppImage options.\n */\n readonly appImage?: AppImageOptions | null\n /**\n * Flatpak options.\n */\n readonly flatpak?: FlatpakOptions | null\n readonly pacman?: LinuxTargetSpecificOptions | null\n readonly rpm?: LinuxTargetSpecificOptions | null\n readonly freebsd?: LinuxTargetSpecificOptions | null\n readonly p5p?: LinuxTargetSpecificOptions | null\n readonly apk?: LinuxTargetSpecificOptions | null\n\n /**\n * Whether to build the application native dependencies from source.\n * @default false\n */\n buildDependenciesFromSource?: boolean\n /**\n * Whether to execute `node-gyp rebuild` before starting to package the app.\n *\n * Don't [use](https://github.com/electron-userland/electron-builder/issues/683#issuecomment-241214075) [npm](http://electron.atom.io/docs/tutorial/using-native-node-modules/#using-npm) (neither `.npmrc`) for configuring electron headers. Use `electron-builder node-gyp-rebuild` instead.\n * @default false\n */\n readonly nodeGypRebuild?: boolean\n /**\n * Additional command line arguments to use when installing app native deps.\n */\n readonly npmArgs?: Array<string> | string | null\n /**\n * Whether to [rebuild](https://docs.npmjs.com/cli/rebuild) native dependencies before starting to package the app.\n * @default true\n */\n readonly npmRebuild?: boolean\n /**\n * Use `legacy` app-builder binary for installing native dependencies, or `@electron/rebuild` in `sequential` or `parallel` compilation modes.\n * @default sequential\n */\n readonly nativeRebuilder?: \"legacy\" | \"sequential\" | \"parallel\" | null\n\n /**\n * The build number. Maps to the `--iteration` flag for builds using FPM on Linux.\n * If not defined, then it will fallback to `BUILD_NUMBER` or `TRAVIS_BUILD_NUMBER` or `APPVEYOR_BUILD_NUMBER` or `CIRCLE_BUILD_NUM` or `BUILD_BUILDNUMBER` or `CI_PIPELINE_IID` env.\n */\n readonly buildNumber?: string | null\n\n /**\n * The build version. Maps to the `CFBundleVersion` on macOS, and `FileVersion` metadata property on Windows. Defaults to the `version`.\n * If `buildVersion` is not defined and `buildNumber` (or one of the `buildNumber` envs) is defined, it will be used as a build version (`version.buildNumber`).\n */\n readonly buildVersion?: string | null\n\n /**\n * Whether to download the alternate FFmpeg library from Electron's release assets and replace the default FFmpeg library prior to signing\n */\n readonly downloadAlternateFFmpeg?: boolean\n\n /**\n * Inject properties to `package.json`.\n */\n readonly extraMetadata?: any\n\n /**\n * Whether to fail if the application is not signed (to prevent unsigned app if code signing configuration is not correct).\n * @default false\n */\n readonly forceCodeSigning?: boolean\n\n /**\n * Whether to include PDB files.\n * @default false\n */\n readonly includePdb?: boolean\n\n /**\n * Whether to remove `scripts` field from `package.json` files.\n *\n * @default true\n */\n readonly removePackageScripts?: boolean\n\n /**\n * Whether to remove `keywords` field from `package.json` files.\n *\n * @default true\n */\n readonly removePackageKeywords?: boolean\n\n /**\n * Options to pass to `@electron/fuses`\n * Ref: https://github.com/electron/fuses\n */\n readonly electronFuses?: FuseOptionsV1 | null\n\n /**\n * [Experimental] Configuration for concurrent builds.\n */\n readonly concurrency?: Concurrency | null\n}\n\nexport interface Configuration extends CommonConfiguration, PlatformSpecificBuildOptions, Hooks {\n /**\n * Whether to use [electron-compile](http://github.com/electron/electron-compile) to compile app. Defaults to `true` if `electron-compile` in the dependencies. And `false` if in the `devDependencies` or doesn't specified.\n */\n readonly electronCompile?: boolean\n\n /**\n * The [electron-download](https://github.com/electron-userland/electron-download#usage) options.\n */\n readonly electronDownload?: ElectronDownloadOptions\n\n /**\n * The branding used by Electron's distributables. This is needed if a fork has modified Electron's BRANDING.json file.\n */\n readonly electronBranding?: ElectronBrandingOptions\n\n /**\n * The version of electron you are packaging for. Defaults to version of `electron`, `electron-prebuilt` or `electron-prebuilt-compile` dependency.\n */\n electronVersion?: string | null\n\n /**\n * The name of a built-in configuration preset (currently, only `react-cra` is supported) or any number of paths to config files (relative to project dir).\n *\n * The latter allows to mixin a config from multiple other configs, as if you `Object.assign` them, but properly combine `files` glob patterns.\n *\n * If `react-scripts` in the app dependencies, `react-cra` will be set automatically. Set to `null` to disable automatic detection.\n */\n extends?: Array<string> | string | null\n\n /**\n * *libui-based frameworks only* The version of NodeJS you are packaging for.\n * You can set it to `current` to set the Node.js version that you use to run.\n */\n readonly nodeVersion?: string | null\n\n /**\n * *libui-based frameworks only* The version of LaunchUI you are packaging for. Applicable for Windows only. Defaults to version suitable for used framework version.\n */\n readonly launchUiVersion?: boolean | string | null\n\n /**\n * The framework name. One of `electron`, `proton`, `libui`. Defaults to `electron`.\n */\n readonly framework?: string | null\n\n /**\n * Whether to disable sanity check asar package (useful for custom electron forks that implement their own encrypted integrity validation)\n * @default false\n */\n readonly disableSanityCheckAsar?: boolean\n}\n\nexport type Hook<T, V> = (contextOrPath: T) => Promise<V> | V\n\nexport interface PackContext {\n readonly outDir: string\n readonly appOutDir: string\n readonly packager: PlatformPackager<any>\n readonly electronPlatformName: string\n readonly arch: Arch\n readonly targets: Array<Target>\n}\nexport type AfterPackContext = PackContext\nexport type BeforePackContext = PackContext\nexport type AfterExtractContext = PackContext\n\n/**\n * Configuration of toolsets utilized by electron-builder\n */\nexport interface ToolsetConfig {\n /**\n * `win-codesign` version to use for signing Windows artifacts.\n * Located at https://github.com/electron-userland/electron-builder-binaries/releases?q=win-codesign&expanded=true\n *\n * Stable:\n * v0.0.0 (winCodeSign)\n *\n * Beta:\n * Windows Kits 10.0.26100.0\n * v1.0.0, v1.1.0\n *\n * @default \"0.0.0\"\n */\n readonly winCodeSign?: \"0.0.0\" | \"1.0.0\" | \"1.1.0\" | null\n\n /**\n * `appimage` bundle version to use for Appimage packaging and runtime.\n * Located at https://github.com/electron-userland/electron-builder-binaries/releases?q=appimage&expanded=true\n * 0.0.0 - legacy toolset (appimage)\n *\n * Betas:\n * 1.0.2 - Runtime 20251108\n * 1.0.3 - Runtime 20251108 (Resolves GH issue #9598)\n *\n * @default \"0.0.0\"\n */\n readonly appimage?: \"0.0.0\" | \"1.0.2\" | \"1.0.3\" | null\n}\n\nexport interface Hooks {\n /**\nThe function (or path to file or module id) to be run before pack.\n\n```typescript\n(context: BeforePackContext): Promise<any> | any\n```\n\n!!! example \"As function\"\n\n ```js\n beforePack: async (context) => {\n // your code\n }\n ```\n\nBecause in a configuration file you cannot use JavaScript, can be specified as a path to file or module id. Function must be exported as default export.\n\n```json\n\"build\": {\n \"beforePack\": \"./myBeforePackHook.js\"\n}\n```\n\nFile `myBeforePackHook.js` in the project root directory:\n\n!!! example \"myBeforePackHook.js\"\n ```js\n exports.default = async function(context) {\n // your custom code\n }\n ```\n */\n readonly beforePack?: Hook<BeforePackContext, void> | string | null\n\n /**\n * The function (or path to file or module id) to be [run after the prebuilt Electron binary has been extracted to the output directory](#afterextract)\n * Same setup as {@link beforePack}\n */\n readonly afterExtract?: Hook<AfterExtractContext, void> | string | null\n\n /**\n * The function (or path to file or module id) to be [run after pack](#afterpack) (but before pack into distributable format and sign).\n * Same setup as {@link beforePack}\n */\n readonly afterPack?: Hook<AfterPackContext, void> | string | null\n\n /**\n * The function (or path to file or module id) to be [run after pack and sign](#aftersign) (but before pack into distributable format).\n * Same setup as {@link beforePack}\n */\n readonly afterSign?: Hook<AfterPackContext, void> | string | null\n\n /**\n * The function (or path to file or module id) to be run on artifact build start.\n * Same setup as {@link beforePack}\n */\n readonly artifactBuildStarted?: Hook<ArtifactBuildStarted, void> | string | null\n /**\n * The function (or path to file or module id) to be run on artifact build completed.\n * Same setup as {@link beforePack}\n */\n readonly artifactBuildCompleted?: Hook<ArtifactCreated, void> | string | null\n /**\n * The function (or path to file or module id) to be run after all artifacts are built.\n\n```typescript\n(buildResult: BuildResult): Promise<Array<string>> | Array<string>\n```\n\nConfiguration in the same way as `afterPack` (see above).\n\n!!! example \"myAfterAllArtifactBuild.js\"\n ```js\n exports.default = function () {\n // you can return additional files to publish\n return [\"/path/to/additional/result/file\"]\n }\n ```\n */\n readonly afterAllArtifactBuild?: Hook<BuildResult, Array<string>> | string | null\n /**\n * The function (or path to file or module id) to be run after MSI project created on disk - not packed into .msi package yet.\n */\n readonly msiProjectCreated?: Hook<string, void> | string | null\n /**\n * The function (or path to file or module id) to be run after Appx manifest created on disk - not packed into .appx package yet.\n */\n readonly appxManifestCreated?: Hook<string, void> | string | null\n /**\n * The function (or path to file or module id) to be [run on each node module](#onnodemodulefile) file. Returning `true`/`false` will determine whether to force include or to use the default copier logic\n */\n readonly onNodeModuleFile?: Hook<string, void | boolean> | string | null\n /**\n * The function (or path to file or module id) to be run before dependencies are installed or rebuilt. Works when `npmRebuild` is set to `true`. Resolving to `false` will skip dependencies install or rebuild.\n *\n * If provided and `node_modules` are missing, it will not invoke production dependencies check.\n */\n readonly beforeBuild?: Hook<BeforeBuildContext, boolean | void> | string | null\n /**\n * The function (or path to file or module id) to be run when staging the electron artifact environment.\n * Returns the path to custom Electron build (e.g. `~/electron/out/R`) or folder of electron zips.\n *\n * Zip files must follow the pattern `electron-v${version}-${platformName}-${arch}.zip`, otherwise it will be assumed to be an unpacked Electron app directory\n */\n readonly electronDist?: Hook<PrepareApplicationStageDirectoryOptions, string> | string | null\n}\n\nexport interface MetadataDirectories {\n /**\n * The path to build resources.\n *\n * Please note — build resources are not packed into the app. If you need to use some files, e.g. as tray icon, please include required files explicitly: `\"files\": [\"**\\/*\", \"build/icon.*\"]`\n * @default build\n */\n readonly buildResources?: string | null\n\n /**\n * The output directory. [File macros](./file-patterns.md#file-macros) are supported.\n * @default dist\n */\n readonly output?: string | null\n\n /**\n * The application directory (containing the application package.json), defaults to `app`, `www` or working directory.\n */\n readonly app?: string | null\n}\n\n/**\n * All options come from [@electron/fuses](https://github.com/electron/fuses)\n * Ref: https://raw.githubusercontent.com/electron/electron/refs/heads/main/docs/tutorial/fuses.md\n */\nexport interface FuseOptionsV1 {\n /**\n *The runAsNode fuse toggles whether the `ELECTRON_RUN_AS_NODE` environment variable is respected or not. Please note that if this fuse is disabled then `process.fork` in the main process will not function as expected as it depends on this environment variable to function. Instead, we recommend that you use [Utility Processes](https://github.com/electron/electron/blob/main/docs/api/utility-process.md), which work for many use cases where you need a standalone Node.js process (like a Sqlite server process or similar scenarios).\n */\n runAsNode?: boolean\n /**\n * The cookieEncryption fuse toggles whether the cookie store on disk is encrypted using OS level cryptography keys. By default the sqlite database that Chromium uses to store cookies stores the values in plaintext. If you wish to ensure your apps cookies are encrypted in the same way Chrome does then you should enable this fuse. Please note it is a one-way transition, if you enable this fuse existing unencrypted cookies will be encrypted-on-write but if you then disable the fuse again your cookie store will effectively be corrupt and useless. Most apps can safely enable this fuse.\n */\n enableCookieEncryption?: boolean\n /**\n * The nodeOptions fuse toggles whether the [`NODE_OPTIONS`](https://nodejs.org/api/cli.html#node_optionsoptions) and [`NODE_EXTRA_CA_CERTS`](https://github.com/nodejs/node/blob/main/doc/api/cli.md#node_extra_ca_certsfile) environment variables are respected. The `NODE_OPTIONS` environment variable can be used to pass all kinds of custom options to the Node.js runtime and isn't typically used by apps in production. Most apps can safely disable this fuse.\n */\n enableNodeOptionsEnvironmentVariable?: boolean\n /**\n * The nodeCliInspect fuse toggles whether the `--inspect`, `--inspect-brk`, etc. flags are respected or not. When disabled it also ensures that `SIGUSR1` signal does not initialize the main process inspector. Most apps can safely disable this fuse.\n */\n enableNodeCliInspectArguments?: boolean\n /**\n * The embeddedAsarIntegrityValidation fuse toggles an experimental feature on macOS that validates the content of the `app.asar` file when it is loaded. This feature is designed to have a minimal performance impact but may marginally slow down file reads from inside the `app.asar` archive.\n * Currently, ASAR integrity checking is supported on:\n *\n * - macOS as of electron>=16.0.0\n * - Windows as of electron>=30.0.0\n *\n * For more information on how to use asar integrity validation please read the [Asar Integrity](https://github.com/electron/electron/blob/main/docs/tutorial/asar-integrity.md) documentation.\n */\n enableEmbeddedAsarIntegrityValidation?: boolean\n /**\n * The onlyLoadAppFromAsar fuse changes the search system that Electron uses to locate your app code. By default Electron will search in the following order `app.asar` -> `app` -> `default_app.asar`. When this fuse is enabled the search order becomes a single entry `app.asar` thus ensuring that when combined with the `embeddedAsarIntegrityValidation` fuse it is impossible to load non-validated code.\n */\n onlyLoadAppFromAsar?: boolean\n /**\n * The loadBrowserProcessSpecificV8Snapshot fuse changes which V8 snapshot file is used for the browser process. By default Electron's processes will all use the same V8 snapshot file. When this fuse is enabled the browser process uses the file called `browser_v8_context_snapshot.bin` for its V8 snapshot. The other processes will use the V8 snapshot file that they normally do.\n */\n loadBrowserProcessSpecificV8Snapshot?: boolean\n /**\n * The grantFileProtocolExtraPrivileges fuse changes whether pages loaded from the `file://` protocol are given privileges beyond what they would receive in a traditional web browser. This behavior was core to Electron apps in original versions of Electron but is no longer required as apps should be [serving local files from custom protocols](https://github.com/electron/electron/blob/main/docs/tutorial/security.md#18-avoid-usage-of-the-file-protocol-and-prefer-usage-of-custom-protocols) now instead. If you aren't serving pages from `file://` you should disable this fuse.\n * The extra privileges granted to the `file://` protocol by this fuse are incompletely documented below:\n *\n * - `file://` protocol pages can use `fetch` to load other assets over `file://`\n * - `file://` protocol pages can use service workers\n * - `file://` protocol pages have universal access granted to child frames also running on `file://` protocols regardless of sandbox settings\n */\n grantFileProtocolExtraPrivileges?: boolean\n /**\n * Resets the app signature, specifically used for macOS.\n * Note: This should be unneeded since electron-builder signs the app directly after flipping the fuses.\n * Ref: https://github.com/electron/fuses?tab=readme-ov-file#apple-silicon\n */\n resetAdHocDarwinSignature?: boolean\n}\n\nexport interface Concurrency {\n /**\n * The maximum number of concurrent jobs to run.\n * @default 1\n */\n jobs: number\n}\n"]}
1
+ {"version":3,"file":"configuration.js","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":"","sourcesContent":["import { Arch } from \"builder-util\"\nimport { BeforeBuildContext, Target } from \"./core\"\nimport { ElectronBrandingOptions } from \"./electron/ElectronFramework\"\nimport { PrepareApplicationStageDirectoryOptions } from \"./Framework\"\nimport { AppXOptions } from \"./options/AppXOptions\"\nimport { AppImageOptions, DebOptions, FlatpakOptions, LinuxConfiguration, LinuxTargetSpecificOptions, PacmanOptions, RpmOptions } from \"./options/linuxOptions\"\nimport { DmgOptions, MacConfiguration, MasConfiguration } from \"./options/macOptions\"\nimport { MsiOptions } from \"./options/MsiOptions\"\nimport { MsiWrappedOptions } from \"./options/MsiWrappedOptions\"\nimport { PkgOptions } from \"./options/pkgOptions\"\nimport { PlatformSpecificBuildOptions } from \"./options/PlatformSpecificBuildOptions\"\nimport { SnapOptions } from \"./options/SnapOptions\"\nimport { SquirrelWindowsOptions } from \"./options/SquirrelWindowsOptions\"\nimport { WindowsConfiguration } from \"./options/winOptions\"\nimport { BuildResult } from \"./packager\"\nimport { ArtifactBuildStarted, ArtifactCreated } from \"./packagerApi\"\nimport { PlatformPackager } from \"./platformPackager\"\nimport { NsisOptions, NsisWebOptions, PortableOptions } from \"./targets/nsis/nsisOptions\"\nimport { ElectronDownloadOptions, ElectronGetOptions } from \"./util/electronGet\"\n\n// duplicate appId here because it is important\n/**\n * Configuration Options\n */\nexport interface CommonConfiguration {\n /**\n * The application id. Used as [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as\n * [Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.\n * @default com.electron.${name}\n */\n readonly appId?: string | null\n\n /**\n * As [name](#metadata), but allows you to specify a product name for your executable which contains spaces and other special characters not allowed in the [name property](https://docs.npmjs.com/files/package.json#name).\n * If not specified inside of the `build` configuration, `productName` property defined at the top level of `package.json` is used. If not specified at the top level of `package.json`, [name property](https://docs.npmjs.com/files/package.json#name) is used.\n */\n readonly productName?: string | null\n\n /**\n * The human-readable copyright line for the app.\n * @default Copyright © year ${author}\n */\n readonly copyright?: string | null\n\n /**\n * Directories for build resources\n */\n readonly directories?: MetadataDirectories | null\n\n /**\n * Configuration of toolsets utilized by electron-builder\n */\n readonly toolsets?: ToolsetConfig | null\n\n /**\n * Options related to how build macOS targets.\n */\n readonly mac?: MacConfiguration | null\n /**\n * MAS (Mac Application Store) options.\n */\n readonly mas?: MasConfiguration | null\n /**\n * MAS (Mac Application Store) development options (`mas-dev` target).\n */\n readonly masDev?: MasConfiguration | null\n /**\n * macOS DMG options.\n */\n readonly dmg?: DmgOptions | null\n /**\n * macOS PKG options.\n */\n readonly pkg?: PkgOptions | null\n\n /**\n * Options related to how build Windows targets.\n */\n readonly win?: WindowsConfiguration | null\n /** NSIS installer options. */\n readonly nsis?: NsisOptions | null\n /** NSIS web installer options (downloads app package at install time). */\n readonly nsisWeb?: NsisWebOptions | null\n /** Portable executable options (no installation required). */\n readonly portable?: PortableOptions | null\n /** Windows Store (AppX) package options. */\n readonly appx?: AppXOptions | null\n /**\n * MSI package options.\n */\n readonly msi?: MsiOptions | null\n /**\n * MSI-wrapped installer options.\n */\n readonly msiWrapped?: MsiWrappedOptions | null\n /**\n * Squirrel.Windows installer options. Requires the `electron-builder-squirrel-windows` dependency.\n */\n readonly squirrelWindows?: SquirrelWindowsOptions | null\n /**\n * General Linux build options shared across all Linux targets (icon, category, desktop entry,\n * executable name, etc.). Target-specific compression and packaging options live in the\n * per-format interfaces (`DebOptions`, `RpmOptions`, `PacmanOptions`, etc.).\n */\n readonly linux?: LinuxConfiguration | null\n /**\n * Debian package options. Targets Debian, Ubuntu, and Debian-based distributions.\n * Produces a `.deb` archive installable via `dpkg -i` or `apt install`.\n */\n readonly deb?: DebOptions | null\n /**\n * Snap package options. Requires [snapcraft](https://snapcraft.io/) to be installed.\n */\n readonly snap?: SnapOptions | null\n /**\n * AppImage options. AppImage is a portable application format that bundles the app\n * and its dependencies into a single self-contained executable that runs on most\n * Linux distributions without installation.\n */\n readonly appImage?: AppImageOptions | null\n /**\n * Flatpak options. Flatpak is a sandboxed application distribution format for Linux\n * that runs in a controlled environment and is distributed via [Flathub](https://flathub.org/)\n * or other Flatpak repositories.\n */\n readonly flatpak?: FlatpakOptions | null\n /**\n * Pacman package options. Targets Arch Linux and Arch-based distributions\n * (Manjaro, EndeavourOS, etc.). Produces a `.pacman` archive installable via `pacman -U`.\n */\n readonly pacman?: PacmanOptions | null\n /**\n * RPM package options. Targets Fedora, Red Hat Enterprise Linux, SUSE, and related\n * distributions. Produces a `.rpm` archive installable via `rpm` or `dnf`.\n */\n readonly rpm?: RpmOptions | null\n /**\n * FreeBSD package options. Produces a `.pkg` archive for the FreeBSD `pkg` package manager.\n */\n readonly freebsd?: LinuxTargetSpecificOptions | null\n /**\n * Solaris IPS package options. Produces a `.p5p` archive for the Solaris Image Packaging\n * System (`pkg`).\n */\n readonly p5p?: LinuxTargetSpecificOptions | null\n /**\n * Alpine Linux APK package options. Produces an `.apk` archive installable via `apk add`.\n */\n readonly apk?: LinuxTargetSpecificOptions | null\n\n /**\n * Whether to build the application native dependencies from source.\n * @default false\n */\n buildDependenciesFromSource?: boolean\n /**\n * Whether to execute `node-gyp rebuild` before starting to package the app.\n *\n * Don't [use](https://github.com/electron-userland/electron-builder/issues/683#issuecomment-241214075) [npm](http://electron.atom.io/docs/tutorial/using-native-node-modules/#using-npm) (neither `.npmrc`) for configuring electron headers. Use `electron-builder node-gyp-rebuild` instead.\n * @default false\n */\n readonly nodeGypRebuild?: boolean\n /**\n * Additional command line arguments to use when installing app native deps.\n */\n readonly npmArgs?: Array<string> | string | null\n /**\n * Whether to [rebuild](https://docs.npmjs.com/cli/rebuild) native dependencies before starting to package the app.\n * @default true\n */\n readonly npmRebuild?: boolean\n /**\n * Use `legacy` app-builder binary for installing native dependencies, or `@electron/rebuild` in `sequential` or `parallel` compilation modes.\n * @default sequential\n */\n readonly nativeRebuilder?: \"legacy\" | \"sequential\" | \"parallel\" | null\n\n /**\n * The build number. Maps to the `--iteration` flag for builds using FPM on Linux.\n * If not defined, then it will fallback to `BUILD_NUMBER` or `TRAVIS_BUILD_NUMBER` or `APPVEYOR_BUILD_NUMBER` or `CIRCLE_BUILD_NUM` or `BUILD_BUILDNUMBER` or `CI_PIPELINE_IID` env.\n */\n readonly buildNumber?: string | null\n\n /**\n * The build version. Maps to the `CFBundleVersion` on macOS, and `FileVersion` metadata property on Windows. Defaults to the `version`.\n * If `buildVersion` is not defined and `buildNumber` (or one of the `buildNumber` envs) is defined, it will be used as a build version (`version.buildNumber`).\n */\n readonly buildVersion?: string | null\n\n /**\n * Whether to download the alternate FFmpeg library from Electron's release assets and replace the default FFmpeg library prior to signing\n */\n readonly downloadAlternateFFmpeg?: boolean\n\n /**\n * Inject properties to `package.json`.\n */\n readonly extraMetadata?: any\n\n /**\n * Whether to fail if the application is not signed (to prevent unsigned app if code signing configuration is not correct).\n * @default false\n */\n readonly forceCodeSigning?: boolean\n\n /**\n * Whether to include PDB files.\n * @default false\n */\n readonly includePdb?: boolean\n\n /**\n * Whether to remove `scripts` field from `package.json` files.\n *\n * @default true\n */\n readonly removePackageScripts?: boolean\n\n /**\n * Whether to remove `keywords` field from `package.json` files.\n *\n * @default true\n */\n readonly removePackageKeywords?: boolean\n\n /**\n * Options to pass to `@electron/fuses`\n * Ref: https://github.com/electron/fuses\n */\n readonly electronFuses?: FuseOptionsV1 | null\n\n /**\n * [Experimental] Configuration for concurrent builds.\n */\n readonly concurrency?: Concurrency | null\n}\n\nexport interface Configuration extends CommonConfiguration, PlatformSpecificBuildOptions, Hooks {\n /**\n * Whether to use [electron-compile](http://github.com/electron/electron-compile) to compile app. Defaults to `true` if `electron-compile` in the dependencies. And `false` if in the `devDependencies` or doesn't specified.\n * @deprecated `electron-compile` is no longer maintained. Compile your app with a modern bundler (webpack, vite, etc.) instead.\n */\n readonly electronCompile?: boolean\n\n /**\n * The [electron-download](https://github.com/electron-userland/electron-download#usage) options. (legacy)\n * Alternatively, you can use [electron/get](https://github.com/electron/get#usage) options.\n */\n readonly electronDownload?: ElectronDownloadOptions | ElectronGetOptions | null\n\n /**\n * The branding used by Electron's distributables. This is needed if a fork has modified Electron's BRANDING.json file.\n */\n readonly electronBranding?: ElectronBrandingOptions\n\n /**\n * The version of electron you are packaging for. Defaults to version of `electron`, `electron-prebuilt` or `electron-prebuilt-compile` dependency.\n */\n electronVersion?: string | null\n\n /**\n * The name of a built-in configuration preset (currently, only `react-cra` is supported) or any number of paths to config files (relative to project dir).\n *\n * The latter allows to mixin a config from multiple other configs, as if you `Object.assign` them, but properly combine `files` glob patterns.\n *\n * If `react-scripts` in the app dependencies, `react-cra` will be set automatically. Set to `null` to disable automatic detection.\n */\n extends?: Array<string> | string | null\n\n /**\n * *libui-based frameworks only* The version of NodeJS you are packaging for.\n * You can set it to `current` to set the Node.js version that you use to run.\n * @deprecated libui-based frameworks (proton-native, etc.) are no longer actively maintained. This option has no effect when using Electron.\n */\n readonly nodeVersion?: string | null\n\n /**\n * *libui-based frameworks only* The version of LaunchUI you are packaging for. Applicable for Windows only. Defaults to version suitable for used framework version.\n * @deprecated libui-based frameworks (proton-native, etc.) are no longer actively maintained. This option has no effect when using Electron.\n */\n readonly launchUiVersion?: boolean | string | null\n\n /**\n * The framework name. One of `electron`, `proton`, `libui`. Defaults to `electron`.\n * @deprecated `proton` and `libui` framework support is no longer actively maintained. Use `electron` (the default).\n */\n readonly framework?: string | null\n\n /**\n * Whether to disable sanity check asar package (useful for custom electron forks that implement their own encrypted integrity validation)\n * @default false\n */\n readonly disableSanityCheckAsar?: boolean\n}\n\nexport type Hook<T, V> = (contextOrPath: T) => Promise<V> | V\n\nexport interface PackContext {\n readonly outDir: string\n readonly appOutDir: string\n readonly packager: PlatformPackager<any>\n readonly electronPlatformName: string\n readonly arch: Arch\n readonly targets: Array<Target>\n}\nexport type AfterPackContext = PackContext\nexport type BeforePackContext = PackContext\nexport type AfterExtractContext = PackContext\n\n/**\n * Configuration of toolsets utilized by electron-builder\n */\nexport interface ToolsetConfig {\n /**\n * `win-codesign` version to use for signing Windows artifacts.\n * Located at https://github.com/electron-userland/electron-builder-binaries/releases?q=win-codesign&expanded=true\n *\n * Stable:\n * v0.0.0 (winCodeSign)\n *\n * Beta:\n * Windows Kits 10.0.26100.0\n * v1.0.0, v1.1.0\n *\n * @default \"0.0.0\"\n */\n readonly winCodeSign?: \"0.0.0\" | \"1.0.0\" | \"1.1.0\" | null\n\n /**\n * `appimage` bundle version to use for Appimage packaging and runtime.\n * Located at https://github.com/electron-userland/electron-builder-binaries/releases?q=appimage&expanded=true\n * 0.0.0 - legacy toolset (appimage)\n *\n * Betas:\n * 1.0.2 - Runtime 20251108\n * 1.0.3 - Runtime 20251108 (Resolves GH issue #9598)\n *\n * @default \"0.0.0\"\n */\n readonly appimage?: \"0.0.0\" | \"1.0.2\" | \"1.0.3\" | null\n}\n\nexport interface Hooks {\n /**\n * The function (or path to file or module id) to be run before pack.\n * Receives a {@link BeforePackContext}.\n *\n * Can be specified inline as a function in JavaScript configs:\n * ```js\n * // electron-builder.config.js\n * module.exports = {\n * beforePack: async (context) => {\n * // your code\n * }\n * }\n * ```\n *\n * Or as a path to a module that exports the function as its default export:\n * ```json\n * { \"build\": { \"beforePack\": \"./myBeforePackHook.js\" } }\n * ```\n * ```js\n * // myBeforePackHook.js\n * exports.default = async function(context) {\n * // your custom code\n * }\n * ```\n */\n readonly beforePack?: Hook<BeforePackContext, void> | string | null\n\n /**\n * The function (or path to file or module id) to be run after the prebuilt Electron binary has been extracted to the output directory.\n * Receives an {@link AfterExtractContext}. For file/module setup, see {@link beforePack}.\n */\n readonly afterExtract?: Hook<AfterExtractContext, void> | string | null\n\n /**\n * The function (or path to file or module id) to be run after pack but before pack into distributable format and sign.\n * Receives an {@link AfterPackContext}. For file/module setup, see {@link beforePack}.\n */\n readonly afterPack?: Hook<AfterPackContext, void> | string | null\n\n /**\n * The function (or path to file or module id) to be run after pack and sign but before pack into distributable format.\n * Receives an {@link AfterPackContext}. For file/module setup, see {@link beforePack}.\n */\n readonly afterSign?: Hook<AfterPackContext, void> | string | null\n\n /**\n * The function (or path to file or module id) to be run when an individual artifact build starts.\n * Receives an {@link ArtifactBuildStarted}. For file/module setup, see {@link beforePack}.\n */\n readonly artifactBuildStarted?: Hook<ArtifactBuildStarted, void> | string | null\n /**\n * The function (or path to file or module id) to be run when an individual artifact build completes.\n * Receives an {@link ArtifactCreated}. For file/module setup, see {@link beforePack}.\n */\n readonly artifactBuildCompleted?: Hook<ArtifactCreated, void> | string | null\n /**\n * The function (or path to file or module id) to be run after all artifacts are built.\n * Receives a {@link BuildResult}. May return an array of additional file paths to publish.\n *\n * For file/module setup, see {@link beforePack}.\n *\n * @example\n * ```js\n * exports.default = function () {\n * // return additional files to publish\n * return [\"/path/to/additional/result/file\"]\n * }\n * ```\n */\n readonly afterAllArtifactBuild?: Hook<BuildResult, Array<string>> | string | null\n /**\n * The function (or path to file or module id) to be run after MSI project created on disk - not packed into .msi package yet.\n */\n readonly msiProjectCreated?: Hook<string, void> | string | null\n /**\n * The function (or path to file or module id) to be run after Appx manifest created on disk - not packed into .appx package yet.\n */\n readonly appxManifestCreated?: Hook<string, void> | string | null\n /**\n * The function (or path to file or module id) to be [run on each node module](#onnodemodulefile) file. Returning `true`/`false` will determine whether to force include or to use the default copier logic\n */\n readonly onNodeModuleFile?: Hook<string, void | boolean> | string | null\n /**\n * The function (or path to file or module id) to be run before dependencies are installed or rebuilt. Works when `npmRebuild` is set to `true`. Resolving to `false` will skip dependencies install or rebuild.\n *\n * If provided and `node_modules` are missing, it will not invoke production dependencies check.\n */\n readonly beforeBuild?: Hook<BeforeBuildContext, boolean | void> | string | null\n /**\n * The function (or path to file or module id) to be run when staging the electron artifact environment.\n * Returns the path to custom Electron build (e.g. `~/electron/out/R`) or folder of electron zips.\n *\n * Zip files must follow the pattern `electron-v${version}-${platformName}-${arch}.zip`, otherwise it will be assumed to be an unpacked Electron app directory\n */\n readonly electronDist?: Hook<PrepareApplicationStageDirectoryOptions, string> | string | null\n}\n\nexport interface MetadataDirectories {\n /**\n * The path to build resources.\n *\n * Please note — build resources are not packed into the app. If you need to use some files, e.g. as tray icon, please include required files explicitly: `\"files\": [\"**\\/*\", \"build/icon.*\"]`\n * @default build\n */\n readonly buildResources?: string | null\n\n /**\n * The output directory. [File macros](https://www.electron.build/file-patterns#file-macros) are supported.\n * @default dist\n */\n readonly output?: string | null\n\n /**\n * The application directory (containing the application package.json), defaults to `app`, `www` or working directory.\n */\n readonly app?: string | null\n}\n\n/**\n * All options come from [@electron/fuses](https://github.com/electron/fuses)\n * Ref: https://raw.githubusercontent.com/electron/electron/refs/heads/main/docs/tutorial/fuses.md\n */\nexport interface FuseOptionsV1 {\n /**\n *The runAsNode fuse toggles whether the `ELECTRON_RUN_AS_NODE` environment variable is respected or not. Please note that if this fuse is disabled then `process.fork` in the main process will not function as expected as it depends on this environment variable to function. Instead, we recommend that you use [Utility Processes](https://github.com/electron/electron/blob/main/docs/api/utility-process.md), which work for many use cases where you need a standalone Node.js process (like a Sqlite server process or similar scenarios).\n */\n runAsNode?: boolean\n /**\n * The cookieEncryption fuse toggles whether the cookie store on disk is encrypted using OS level cryptography keys. By default the sqlite database that Chromium uses to store cookies stores the values in plaintext. If you wish to ensure your apps cookies are encrypted in the same way Chrome does then you should enable this fuse. Please note it is a one-way transition, if you enable this fuse existing unencrypted cookies will be encrypted-on-write but if you then disable the fuse again your cookie store will effectively be corrupt and useless. Most apps can safely enable this fuse.\n */\n enableCookieEncryption?: boolean\n /**\n * The nodeOptions fuse toggles whether the [`NODE_OPTIONS`](https://nodejs.org/api/cli.html#node_optionsoptions) and [`NODE_EXTRA_CA_CERTS`](https://github.com/nodejs/node/blob/main/doc/api/cli.md#node_extra_ca_certsfile) environment variables are respected. The `NODE_OPTIONS` environment variable can be used to pass all kinds of custom options to the Node.js runtime and isn't typically used by apps in production. Most apps can safely disable this fuse.\n */\n enableNodeOptionsEnvironmentVariable?: boolean\n /**\n * The nodeCliInspect fuse toggles whether the `--inspect`, `--inspect-brk`, etc. flags are respected or not. When disabled it also ensures that `SIGUSR1` signal does not initialize the main process inspector. Most apps can safely disable this fuse.\n */\n enableNodeCliInspectArguments?: boolean\n /**\n * The embeddedAsarIntegrityValidation fuse toggles an experimental feature on macOS that validates the content of the `app.asar` file when it is loaded. This feature is designed to have a minimal performance impact but may marginally slow down file reads from inside the `app.asar` archive.\n * Currently, ASAR integrity checking is supported on:\n *\n * - macOS as of electron>=16.0.0\n * - Windows as of electron>=30.0.0\n *\n * For more information on how to use asar integrity validation please read the [Asar Integrity](https://github.com/electron/electron/blob/main/docs/tutorial/asar-integrity.md) documentation.\n */\n enableEmbeddedAsarIntegrityValidation?: boolean\n /**\n * The onlyLoadAppFromAsar fuse changes the search system that Electron uses to locate your app code. By default Electron will search in the following order `app.asar` -> `app` -> `default_app.asar`. When this fuse is enabled the search order becomes a single entry `app.asar` thus ensuring that when combined with the `embeddedAsarIntegrityValidation` fuse it is impossible to load non-validated code.\n */\n onlyLoadAppFromAsar?: boolean\n /**\n * The loadBrowserProcessSpecificV8Snapshot fuse changes which V8 snapshot file is used for the browser process. By default Electron's processes will all use the same V8 snapshot file. When this fuse is enabled the browser process uses the file called `browser_v8_context_snapshot.bin` for its V8 snapshot. The other processes will use the V8 snapshot file that they normally do.\n */\n loadBrowserProcessSpecificV8Snapshot?: boolean\n /**\n * The grantFileProtocolExtraPrivileges fuse changes whether pages loaded from the `file://` protocol are given privileges beyond what they would receive in a traditional web browser. This behavior was core to Electron apps in original versions of Electron but is no longer required as apps should be [serving local files from custom protocols](https://github.com/electron/electron/blob/main/docs/tutorial/security.md#18-avoid-usage-of-the-file-protocol-and-prefer-usage-of-custom-protocols) now instead. If you aren't serving pages from `file://` you should disable this fuse.\n * The extra privileges granted to the `file://` protocol by this fuse are incompletely documented below:\n *\n * - `file://` protocol pages can use `fetch` to load other assets over `file://`\n * - `file://` protocol pages can use service workers\n * - `file://` protocol pages have universal access granted to child frames also running on `file://` protocols regardless of sandbox settings\n */\n grantFileProtocolExtraPrivileges?: boolean\n /**\n * Resets the app signature, specifically used for macOS.\n * Note: This should be unneeded since electron-builder signs the app directly after flipping the fuses.\n * Ref: https://github.com/electron/fuses?tab=readme-ov-file#apple-silicon\n */\n resetAdHocDarwinSignature?: boolean\n}\n\nexport interface Concurrency {\n /**\n * The maximum number of concurrent jobs to run.\n * @default 1\n */\n jobs: number\n}\n"]}
package/out/core.d.ts CHANGED
@@ -31,14 +31,14 @@ export declare abstract class Target {
31
31
  abstract readonly outDir: string;
32
32
  abstract readonly options: TargetSpecificOptions | Nullish;
33
33
  readonly buildQueueManager: AsyncTaskManager;
34
- protected constructor(name: string, isAsyncSupported?: boolean);
34
+ constructor(name: string, isAsyncSupported?: boolean);
35
35
  checkOptions(): Promise<any>;
36
36
  abstract build(appOutDir: string, arch: Arch): Promise<any>;
37
37
  finishBuild(): Promise<any>;
38
38
  }
39
39
  export interface TargetSpecificOptions {
40
40
  /**
41
- The [artifact file name template](./configuration.md#artifact-file-name-template).
41
+ The [artifact file name template](https://www.electron.build/configuration#artifact-file-name-template).
42
42
  */
43
43
  readonly artifactName?: string | null;
44
44
  publish?: Publish;
package/out/core.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"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","sourcesContent":["import { Arch, archFromString, ArchType, AsyncTaskManager } from \"builder-util\"\nimport { AllPublishOptions, CancellationToken, Nullish } from \"builder-util-runtime\"\n\n// https://github.com/YousefED/typescript-json-schema/issues/80\nexport type Publish = AllPublishOptions | Array<AllPublishOptions> | null\n\nexport type TargetConfigType = Array<string | TargetConfiguration> | string | TargetConfiguration | null\n\nexport interface TargetConfiguration {\n /**\n * The target name. e.g. `snap`.\n */\n readonly target: string\n\n /**\n * The arch or list of archs.\n */\n readonly arch?: Array<ArchType> | ArchType\n}\n\nexport class Platform {\n static MAC = new Platform(\"mac\", \"mac\", \"darwin\")\n static LINUX = new Platform(\"linux\", \"linux\", \"linux\")\n static WINDOWS = new Platform(\"windows\", \"win\", \"win32\")\n\n constructor(\n public name: string,\n public buildConfigurationKey: string,\n public nodeName: NodeJS.Platform\n ) {}\n\n toString() {\n return this.name\n }\n\n createTarget(type?: string | Array<string> | null, ...archs: Array<Arch>): Map<Platform, Map<Arch, Array<string>>> {\n if (type == null && (archs == null || archs.length === 0)) {\n return new Map([[this, new Map()]])\n }\n\n const archToType = new Map()\n\n for (const arch of archs == null || archs.length === 0 ? [archFromString(process.arch)] : archs) {\n archToType.set(arch, type == null ? [] : Array.isArray(type) ? type : [type])\n }\n return new Map([[this, archToType]])\n }\n\n static current(): Platform {\n return Platform.fromString(process.platform)\n }\n\n static fromString(name: string): Platform {\n name = name.toLowerCase()\n switch (name) {\n case Platform.MAC.nodeName:\n case Platform.MAC.name:\n return Platform.MAC\n\n case Platform.WINDOWS.nodeName:\n case Platform.WINDOWS.name:\n case Platform.WINDOWS.buildConfigurationKey:\n return Platform.WINDOWS\n\n case Platform.LINUX.nodeName:\n return Platform.LINUX\n\n default:\n throw new Error(`Unknown platform: ${name}`)\n }\n }\n}\n\nexport abstract class Target {\n abstract readonly outDir: string\n abstract readonly options: TargetSpecificOptions | Nullish\n\n // use only for tasks that cannot be executed in parallel (such as signing on windows and hdiutil on macOS due to file locking)\n readonly buildQueueManager = new AsyncTaskManager(new CancellationToken())\n\n protected constructor(\n readonly name: string,\n readonly isAsyncSupported: boolean = true\n ) {}\n\n async checkOptions(): Promise<any> {\n // ignore\n }\n\n abstract build(appOutDir: string, arch: Arch): Promise<any>\n\n async finishBuild(): Promise<any> {\n await this.buildQueueManager.awaitTasks()\n }\n}\n\nexport interface TargetSpecificOptions {\n /**\n The [artifact file name template](./configuration.md#artifact-file-name-template).\n */\n readonly artifactName?: string | null\n\n publish?: Publish\n}\n\nexport const DEFAULT_TARGET = \"default\"\nexport const DIR_TARGET = \"dir\"\n\nexport type CompressionLevel = \"store\" | \"normal\" | \"maximum\"\n\nexport interface BeforeBuildContext {\n readonly appDir: string\n readonly electronVersion: string\n readonly platform: Platform\n readonly arch: string\n}\n\nexport interface SourceRepositoryInfo {\n type?: string\n domain?: string\n user: string\n project: string\n}\n"]}
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"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","sourcesContent":["import { Arch, archFromString, ArchType, AsyncTaskManager } from \"builder-util\"\nimport { AllPublishOptions, CancellationToken, Nullish } from \"builder-util-runtime\"\n\n// https://github.com/YousefED/typescript-json-schema/issues/80\nexport type Publish = AllPublishOptions | Array<AllPublishOptions> | null\n\nexport type TargetConfigType = Array<string | TargetConfiguration> | string | TargetConfiguration | null\n\nexport interface TargetConfiguration {\n /**\n * The target name. e.g. `snap`.\n */\n readonly target: string\n\n /**\n * The arch or list of archs.\n */\n readonly arch?: Array<ArchType> | ArchType\n}\n\nexport class Platform {\n static MAC = new Platform(\"mac\", \"mac\", \"darwin\")\n static LINUX = new Platform(\"linux\", \"linux\", \"linux\")\n static WINDOWS = new Platform(\"windows\", \"win\", \"win32\")\n\n constructor(\n public name: string,\n public buildConfigurationKey: string,\n public nodeName: NodeJS.Platform\n ) {}\n\n toString() {\n return this.name\n }\n\n createTarget(type?: string | Array<string> | null, ...archs: Array<Arch>): Map<Platform, Map<Arch, Array<string>>> {\n if (type == null && (archs == null || archs.length === 0)) {\n return new Map([[this, new Map()]])\n }\n\n const archToType = new Map()\n\n for (const arch of archs == null || archs.length === 0 ? [archFromString(process.arch)] : archs) {\n archToType.set(arch, type == null ? [] : Array.isArray(type) ? type : [type])\n }\n return new Map([[this, archToType]])\n }\n\n static current(): Platform {\n return Platform.fromString(process.platform)\n }\n\n static fromString(name: string): Platform {\n name = name.toLowerCase()\n switch (name) {\n case Platform.MAC.nodeName:\n case Platform.MAC.name:\n return Platform.MAC\n\n case Platform.WINDOWS.nodeName:\n case Platform.WINDOWS.name:\n case Platform.WINDOWS.buildConfigurationKey:\n return Platform.WINDOWS\n\n case Platform.LINUX.nodeName:\n return Platform.LINUX\n\n default:\n throw new Error(`Unknown platform: ${name}`)\n }\n }\n}\n\nexport abstract class Target {\n abstract readonly outDir: string\n abstract readonly options: TargetSpecificOptions | Nullish\n\n // use only for tasks that cannot be executed in parallel (such as signing on windows and hdiutil on macOS due to file locking)\n readonly buildQueueManager = new AsyncTaskManager(new CancellationToken())\n\n public constructor(\n readonly name: string,\n readonly isAsyncSupported: boolean = true\n ) {}\n\n async checkOptions(): Promise<any> {\n // ignore\n }\n\n abstract build(appOutDir: string, arch: Arch): Promise<any>\n\n async finishBuild(): Promise<any> {\n await this.buildQueueManager.awaitTasks()\n }\n}\n\nexport interface TargetSpecificOptions {\n /**\n The [artifact file name template](https://www.electron.build/configuration#artifact-file-name-template).\n */\n readonly artifactName?: string | null\n\n publish?: Publish\n}\n\nexport const DEFAULT_TARGET = \"default\"\nexport const DIR_TARGET = \"dir\"\n\nexport type CompressionLevel = \"store\" | \"normal\" | \"maximum\"\n\nexport interface BeforeBuildContext {\n readonly appDir: string\n readonly electronVersion: string\n readonly platform: Platform\n readonly arch: string\n}\n\nexport interface SourceRepositoryInfo {\n type?: string\n domain?: string\n user: string\n project: string\n}\n"]}
@@ -1,6 +1,8 @@
1
1
  import { Configuration } from "../configuration";
2
2
  import { Framework } from "../Framework";
3
3
  import { Packager } from "../index";
4
+ import { ElectronDownloadOptions } from "../util/electronGet";
5
+ export { ElectronDownloadOptions };
4
6
  export type ElectronPlatformName = "darwin" | "linux" | "win32" | "mas";
5
7
  /**
6
8
  * Electron distributables branding options.
@@ -11,23 +13,4 @@ export interface ElectronBrandingOptions {
11
13
  productName?: string;
12
14
  }
13
15
  export declare function createBrandingOpts(opts: Configuration): Required<ElectronBrandingOptions>;
14
- export interface ElectronDownloadOptions {
15
- version?: string;
16
- /**
17
- * The [cache location](https://github.com/electron-userland/electron-download#cache-location).
18
- */
19
- cache?: string | null;
20
- /**
21
- * The mirror.
22
- */
23
- mirror?: string | null;
24
- /** @private */
25
- customDir?: string | null;
26
- /** @private */
27
- customFilename?: string | null;
28
- strictSSL?: boolean;
29
- isVerifyChecksum?: boolean;
30
- platform?: ElectronPlatformName;
31
- arch?: string;
32
- }
33
16
  export declare function createElectronFrameworkSupport(configuration: Configuration, packager: Packager): Promise<Framework>;