diff --git a/docs/Auto Update.md b/docs/Auto Update.md index 6cea302293f..0ab82befd21 100644 --- a/docs/Auto Update.md +++ b/docs/Auto Update.md @@ -20,17 +20,17 @@ Simplified auto-update is not supported for Squirrel.Windows. **NOTICE**: -1. Do not call [setFeedURL](https://github.com/electron-userland/electron-builder/wiki/Auto-Update#autoupdatersetfeedurloptions). electron-builder automatically creates `app-update.yml` file for you on build in the `resources` (this file is internal, you don't need to be aware of it). +1. Do not call [setFeedURL](#module_electron-updater/out/AppUpdater.AppUpdater+setFeedURL). electron-builder automatically creates `app-update.yml` file for you on build in the `resources` (this file is internal, you don't need to be aware of it). 2. Bintray provider doesn't support [macOS auto-update](https://github.com/electron-userland/electron-builder/issues/1172) currently. -3. `zip` target for macOS is **required** for Squirrel.Mac, whereas `latest-mac.json` cannot be created, which causes `autoUpdater` error. +3. `zip` target for macOS is **required** for Squirrel.Mac, whereas `latest-mac.json` cannot be created, which causes `autoUpdater` error. Default [target](https://github.com/electron-userland/electron-builder/wiki/Options#MacOptions-target) for macOS `dmg`+`zip`, you don't need to explicitly specify target. ### Examples -**Auto Update** +#### Auto Update A [complete example](https://github.com/iffy/electron-updater-example) showing how to use. -**Manual Update** +#### Manual Update The following code snippet gives another example, which illustrate an encapsulated manual update via menu. @@ -39,12 +39,13 @@ The following code snippet gives another example, which illustrate an encapsulat const { dialog } = require('electron') const { autoUpdater } = require('electron-updater') - let updater autoUpdater.autoDownload = false + autoUpdater.on('error', (event, error) => { dialog.showErrorBox('Error: ', error) }) + autoUpdater.on('update-available', () => { dialog.showMessageBox({ type: 'info', @@ -54,12 +55,14 @@ autoUpdater.on('update-available', () => { }, (buttonIndex) => { if (buttonIndex === 0) { autoUpdater.downloadUpdate() - } else { + } + else { updater.enabled = true updater = null } }) }) + autoUpdater.on('update-not-available', () => { dialog.showMessageBox({ title: 'No Updates', @@ -68,6 +71,7 @@ autoUpdater.on('update-not-available', () => { updater.enabled = true updater = null }) + autoUpdater.on('update-downloaded', () => { dialog.showMessageBox({ title: 'Install Updates', @@ -77,7 +81,6 @@ autoUpdater.on('update-downloaded', () => { }) }) - // export this to MenuItem click callback function checkForUpdates (menuItem, focusedWindow, event) { updater = menuItem @@ -96,11 +99,14 @@ Import steps: `latest.yml` (or `latest-mac.json` for macOS) will be generated and uploaded for all providers except `bintray` (because not required, `bintray` doesn't use `latest.yml`). -## Private Update Repo +## Private GitHub Update Repo + +You can use a private repository for updates with electron-updater by setting the `GH_TOKEN` environment variable (on user machine) and `private` option. +If `GH_TOKEN` is set, electron-updater will use the GitHub API for updates allowing private repositories to work. -You can use a private repository for updates with electron-updater by setting the `GH_TOKEN` environment variable. If `GH_TOKEN` is set, electron-updater will use the GitHub API for updates allowing private repositories to work. +Only for [very special](https://github.com/electron-userland/electron-builder/issues/1393#issuecomment-288191885) cases — not intended and not suitable for all users. -**Note:** The GitHub API currently has a rate limit of 5000 requests per user per hour. An update check uses up to 3 requests per check. If you are worried about hitting your rate limit, consider using [conditional requests](https://developer.github.com/v3/#conditional-requests) before checking for updates to reduce rate limit usage. +**Note:** The GitHub API currently has a rate limit of 5000 requests per user per hour. An update check uses up to 3 requests per check. ## Debugging @@ -231,7 +237,7 @@ Emitted on progress. Only supported over Windows build, since `Squirrel.Mac` [do | Param | Type | | --- | --- | -| value | [RequestHeaders](Developer-API#RequestHeaders) | null | +| value | [RequestHeaders](Developer-API#RequestHeaders) \| null | @@ -326,11 +332,11 @@ Emitted on progress. Only supported over Windows build, since `Squirrel.Mac` [do * [.AppUpdater](#AppUpdater) ⇐ internal:EventEmitter * [`.checkForUpdates()`](#module_electron-updater/out/AppUpdater.AppUpdater+checkForUpdates) ⇒ Promise<[UpdateCheckResult](#UpdateCheckResult)> * [`.downloadUpdate(cancellationToken)`](#module_electron-updater/out/AppUpdater.AppUpdater+downloadUpdate) ⇒ Promise<any> - * [`.getFeedURL()`](#module_electron-updater/out/AppUpdater.AppUpdater+getFeedURL) ⇒ undefined | null | string + * [`.getFeedURL()`](#module_electron-updater/out/AppUpdater.AppUpdater+getFeedURL) ⇒ undefined \| null \| string * [`.setFeedURL(options)`](#module_electron-updater/out/AppUpdater.AppUpdater+setFeedURL) * [`.loadUpdateConfig()`](#module_electron-updater/out/AppUpdater.AppUpdater+loadUpdateConfig) ⇒ Promise<any> * [`.quitAndInstall()`](#module_electron-updater/out/AppUpdater.AppUpdater+quitAndInstall) - * [`.computeRequestHeaders(fileInfo)`](#module_electron-updater/out/AppUpdater.AppUpdater+computeRequestHeaders) ⇒ null | [RequestHeaders](Developer-API#RequestHeaders) + * [`.computeRequestHeaders(fileInfo)`](#module_electron-updater/out/AppUpdater.AppUpdater+computeRequestHeaders) ⇒ null \| [RequestHeaders](Developer-API#RequestHeaders) * [`.dispatchError(e)`](#module_electron-updater/out/AppUpdater.AppUpdater+dispatchError) * [`.doDownloadUpdate(versionInfo, fileInfo, cancellationToken)`](#module_electron-updater/out/AppUpdater.AppUpdater+doDownloadUpdate) ⇒ Promise<any> * [`.onUpdateAvailable(versionInfo, fileInfo)`](#module_electron-updater/out/AppUpdater.AppUpdater+onUpdateAvailable) @@ -381,11 +387,11 @@ Emitted on progress. Only supported over Windows build, since `Squirrel.Mac` [do * [.AppUpdater](#AppUpdater) ⇐ internal:EventEmitter * [`.checkForUpdates()`](#module_electron-updater/out/AppUpdater.AppUpdater+checkForUpdates) ⇒ Promise<[UpdateCheckResult](#UpdateCheckResult)> * [`.downloadUpdate(cancellationToken)`](#module_electron-updater/out/AppUpdater.AppUpdater+downloadUpdate) ⇒ Promise<any> - * [`.getFeedURL()`](#module_electron-updater/out/AppUpdater.AppUpdater+getFeedURL) ⇒ undefined | null | string + * [`.getFeedURL()`](#module_electron-updater/out/AppUpdater.AppUpdater+getFeedURL) ⇒ undefined \| null \| string * [`.setFeedURL(options)`](#module_electron-updater/out/AppUpdater.AppUpdater+setFeedURL) * [`.loadUpdateConfig()`](#module_electron-updater/out/AppUpdater.AppUpdater+loadUpdateConfig) ⇒ Promise<any> * [`.quitAndInstall()`](#module_electron-updater/out/AppUpdater.AppUpdater+quitAndInstall) - * [`.computeRequestHeaders(fileInfo)`](#module_electron-updater/out/AppUpdater.AppUpdater+computeRequestHeaders) ⇒ null | [RequestHeaders](Developer-API#RequestHeaders) + * [`.computeRequestHeaders(fileInfo)`](#module_electron-updater/out/AppUpdater.AppUpdater+computeRequestHeaders) ⇒ null \| [RequestHeaders](Developer-API#RequestHeaders) * [`.dispatchError(e)`](#module_electron-updater/out/AppUpdater.AppUpdater+dispatchError) * [`.doDownloadUpdate(versionInfo, fileInfo, cancellationToken)`](#module_electron-updater/out/AppUpdater.AppUpdater+doDownloadUpdate) ⇒ Promise<any> * [`.onUpdateAvailable(versionInfo, fileInfo)`](#module_electron-updater/out/AppUpdater.AppUpdater+onUpdateAvailable) @@ -421,7 +427,7 @@ Configure update provider. If value is `string`, [module:electron-builder-http/o | Param | Type | Description | | --- | --- | --- | -| options | [PublishConfiguration](Publishing-Artifacts#PublishConfiguration) | [GenericServerOptions](Publishing-Artifacts#GenericServerOptions) | [S3Options](Publishing-Artifacts#S3Options) | [BintrayOptions](Publishing-Artifacts#BintrayOptions) | [GithubOptions](Publishing-Artifacts#GithubOptions) | string | If you want to override configuration in the `app-update.yml`. | +| options | [PublishConfiguration](Publishing-Artifacts#PublishConfiguration) \| [GenericServerOptions](Publishing-Artifacts#GenericServerOptions) \| [S3Options](Publishing-Artifacts#S3Options) \| [BintrayOptions](Publishing-Artifacts#BintrayOptions) \| [GithubOptions](Publishing-Artifacts#GithubOptions) \| string | If you want to override configuration in the `app-update.yml`. | diff --git a/docs/Developer API.md b/docs/Developer API.md index b83c3218cf6..20071e09461 100644 --- a/docs/Developer API.md +++ b/docs/Developer API.md @@ -15,6 +15,8 @@
electron-builder/out/fileMatcher
+
electron-builder/out/fileTransformer
+
electron-builder/out/linuxPackager
electron-builder/out/macPackager
@@ -121,7 +123,7 @@ * [electron-builder/out/appInfo](#module_electron-builder/out/appInfo) * [.AppInfo](#AppInfo) - * [`.computePackageUrl()`](#module_electron-builder/out/appInfo.AppInfo+computePackageUrl) ⇒ Promise< | string> + * [`.computePackageUrl()`](#module_electron-builder/out/appInfo.AppInfo+computePackageUrl) ⇒ Promise< \| string> @@ -268,32 +270,52 @@ ## electron-builder/out/asarUtil * [electron-builder/out/asarUtil](#module_electron-builder/out/asarUtil) + * [.AsarPackager](#AsarPackager) + * [`.detectUnpackedDirs(files, metadata, autoUnpackDirs, unpackedDest)`](#module_electron-builder/out/asarUtil.AsarPackager+detectUnpackedDirs) ⇒ Promise<void> + * [`.pack(filter, transformer)`](#module_electron-builder/out/asarUtil.AsarPackager+pack) ⇒ Promise<void> * [`.checkFileInArchive(asarFile, relativeFile, messagePrefix)`](#module_electron-builder/out/asarUtil.checkFileInArchive) ⇒ Promise<void> - * [`.createAsarArchive(src, resourcesPath, options, filter, unpackPattern)`](#module_electron-builder/out/asarUtil.createAsarArchive) ⇒ Promise<any> - + -### `electron-builder/out/asarUtil.checkFileInArchive(asarFile, relativeFile, messagePrefix)` ⇒ Promise<void> -**Kind**: method of [electron-builder/out/asarUtil](#module_electron-builder/out/asarUtil) +### AsarPackager +**Kind**: class of [electron-builder/out/asarUtil](#module_electron-builder/out/asarUtil) + +* [.AsarPackager](#AsarPackager) + * [`.detectUnpackedDirs(files, metadata, autoUnpackDirs, unpackedDest)`](#module_electron-builder/out/asarUtil.AsarPackager+detectUnpackedDirs) ⇒ Promise<void> + * [`.pack(filter, transformer)`](#module_electron-builder/out/asarUtil.AsarPackager+pack) ⇒ Promise<void> + + + +#### `asarPackager.detectUnpackedDirs(files, metadata, autoUnpackDirs, unpackedDest)` ⇒ Promise<void> +**Kind**: instance method of [AsarPackager](#AsarPackager) | Param | Type | | --- | --- | -| asarFile | string | -| relativeFile | string | -| messagePrefix | string | +| files | Array<string> | +| metadata | Map<string \| module:fs.Stats> | +| autoUnpackDirs | Set<string> | +| unpackedDest | string | - + -### `electron-builder/out/asarUtil.createAsarArchive(src, resourcesPath, options, filter, unpackPattern)` ⇒ Promise<any> -**Kind**: method of [electron-builder/out/asarUtil](#module_electron-builder/out/asarUtil) +#### `asarPackager.pack(filter, transformer)` ⇒ Promise<void> +**Kind**: instance method of [AsarPackager](#AsarPackager) | Param | Type | | --- | --- | -| src | string | -| resourcesPath | string | -| options | [AsarOptions](#AsarOptions) | | filter | module:electron-builder-util/out/fs.__type | -| unpackPattern | module:electron-builder-util/out/fs.__type | null | +| transformer | module:electron-builder/out/asarUtil.__type \| null | + + + +### `electron-builder/out/asarUtil.checkFileInArchive(asarFile, relativeFile, messagePrefix)` ⇒ Promise<void> +**Kind**: method of [electron-builder/out/asarUtil](#module_electron-builder/out/asarUtil) + +| Param | Type | +| --- | --- | +| asarFile | string | +| relativeFile | string | +| messagePrefix | string | @@ -320,10 +342,10 @@ * [electron-builder/out/codeSign](#module_electron-builder/out/codeSign) * [`.CodeSigningInfo`](#CodeSigningInfo) - * [`.findIdentityRawResult`](#module_electron-builder/out/codeSign.findIdentityRawResult) : Promise<Array<string>> | null + * [`.findIdentityRawResult`](#module_electron-builder/out/codeSign.findIdentityRawResult) : Promise<Array<string>> \| null * [`.createKeychain(tmpDir, cscLink, cscKeyPassword, cscILink, cscIKeyPassword)`](#module_electron-builder/out/codeSign.createKeychain) ⇒ Promise<[CodeSigningInfo](#CodeSigningInfo)> * [`.downloadCertificate(urlOrBase64, tmpDir)`](#module_electron-builder/out/codeSign.downloadCertificate) ⇒ Promise<string> - * [`.findIdentity(certType, qualifier, keychain)`](#module_electron-builder/out/codeSign.findIdentity) ⇒ Promise< | string> + * [`.findIdentity(certType, qualifier, keychain)`](#module_electron-builder/out/codeSign.findIdentity) ⇒ Promise< \| string> * [`.sign(path, name, keychain)`](#module_electron-builder/out/codeSign.sign) ⇒ Promise<any> @@ -350,8 +372,8 @@ | tmpDir | [TmpDir](#TmpDir) | | cscLink | string | | cscKeyPassword | string | -| cscILink | string | null | -| cscIKeyPassword | string | null | +| cscILink | string \| null | +| cscIKeyPassword | string \| null | @@ -370,9 +392,9 @@ | Param | Type | | --- | --- | -| certType | "Developer ID Application" | "Developer ID Installer" | "3rd Party Mac Developer Application" | "3rd Party Mac Developer Installer" | "Mac Developer" | -| qualifier | string | null | -| keychain | string | null | +| certType | "Developer ID Application" \| "Developer ID Installer" \| "3rd Party Mac Developer Application" \| "3rd Party Mac Developer Installer" \| "Mac Developer" | +| qualifier | string \| null | +| keychain | string \| null | @@ -394,9 +416,9 @@ * [`.addAllPattern()`](#module_electron-builder/out/fileMatcher.FileMatcher+addAllPattern) * [`.addPattern(pattern)`](#module_electron-builder/out/fileMatcher.FileMatcher+addPattern) * [`.computeParsedPatterns(result, fromDir)`](#module_electron-builder/out/fileMatcher.FileMatcher+computeParsedPatterns) - * [`.containsOnlyIgnore()`](#module_electron-builder/out/fileMatcher.FileMatcher+containsOnlyIgnore) ⇒ "undefined" | "undefined" + * [`.containsOnlyIgnore()`](#module_electron-builder/out/fileMatcher.FileMatcher+containsOnlyIgnore) ⇒ "undefined" \| "undefined" * [`.createFilter(ignoreFiles, rawFilter, excludePatterns)`](#module_electron-builder/out/fileMatcher.FileMatcher+createFilter) ⇒ module:electron-builder-util/out/fs.__type - * [`.isEmpty()`](#module_electron-builder/out/fileMatcher.FileMatcher+isEmpty) ⇒ "undefined" | "undefined" + * [`.isEmpty()`](#module_electron-builder/out/fileMatcher.FileMatcher+isEmpty) ⇒ "undefined" \| "undefined" * [`.copyFiles(patterns)`](#module_electron-builder/out/fileMatcher.copyFiles) ⇒ Promise<any> @@ -408,9 +430,9 @@ * [`.addAllPattern()`](#module_electron-builder/out/fileMatcher.FileMatcher+addAllPattern) * [`.addPattern(pattern)`](#module_electron-builder/out/fileMatcher.FileMatcher+addPattern) * [`.computeParsedPatterns(result, fromDir)`](#module_electron-builder/out/fileMatcher.FileMatcher+computeParsedPatterns) - * [`.containsOnlyIgnore()`](#module_electron-builder/out/fileMatcher.FileMatcher+containsOnlyIgnore) ⇒ "undefined" | "undefined" + * [`.containsOnlyIgnore()`](#module_electron-builder/out/fileMatcher.FileMatcher+containsOnlyIgnore) ⇒ "undefined" \| "undefined" * [`.createFilter(ignoreFiles, rawFilter, excludePatterns)`](#module_electron-builder/out/fileMatcher.FileMatcher+createFilter) ⇒ module:electron-builder-util/out/fs.__type - * [`.isEmpty()`](#module_electron-builder/out/fileMatcher.FileMatcher+isEmpty) ⇒ "undefined" | "undefined" + * [`.isEmpty()`](#module_electron-builder/out/fileMatcher.FileMatcher+isEmpty) ⇒ "undefined" \| "undefined" @@ -448,7 +470,7 @@ | --- | --- | | ignoreFiles | Set<string> | | rawFilter | callback | -| excludePatterns | Array<minimatch:Minimatch> | undefined | null | +| excludePatterns | Array<minimatch:Minimatch> \| undefined \| null | @@ -461,7 +483,21 @@ | Param | Type | | --- | --- | -| patterns | Array<[FileMatcher](#FileMatcher)> | null | +| patterns | Array<[FileMatcher](#FileMatcher)> \| null | + + + +## electron-builder/out/fileTransformer + + +### `electron-builder/out/fileTransformer.createTransformer(projectDir, srcDir, packager)` ⇒ Promise<module:electron-builder-util/out/fs.__type> +**Kind**: method of [electron-builder/out/fileTransformer](#module_electron-builder/out/fileTransformer) + +| Param | Type | +| --- | --- | +| projectDir | string | +| srcDir | string | +| packager | [PlatformPackager](#PlatformPackager)<any> | @@ -471,16 +507,16 @@ * [.LinuxPackager](#LinuxPackager) ⇐ [PlatformPackager](#PlatformPackager) * [`.createTargets(targets, mapper, cleanupTasks)`](#module_electron-builder/out/linuxPackager.LinuxPackager+createTargets) * [`.postInitApp(appOutDir)`](#module_electron-builder/out/linuxPackager.LinuxPackager+postInitApp) ⇒ Promise<any> - * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< | string> + * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< \| string> * [`.dispatchArtifactCreated(file, target, safeArtifactName)`](#module_electron-builder/out/platformPackager.PlatformPackager+dispatchArtifactCreated) * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ string * [`.expandMacro(pattern, arch, extra)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandMacro) ⇒ string * [`.generateName(ext, arch, deployment, classifier)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName) ⇒ string * [`.generateName2(ext, classifier, deployment)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName2) ⇒ string - * [`.getIconPath()`](#module_electron-builder/out/platformPackager.PlatformPackager+getIconPath) ⇒ Promise< | string> + * [`.getIconPath()`](#module_electron-builder/out/platformPackager.PlatformPackager+getIconPath) ⇒ Promise< \| string> * [`.getMacOsResourcesDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getMacOsResourcesDir) ⇒ string * [`.pack(outDir, arch, targets, postAsyncTasks)`](#module_electron-builder/out/platformPackager.PlatformPackager+pack) ⇒ Promise<any> - * [`.getResource(custom, names)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResource) ⇒ Promise< | string> + * [`.getResource(custom, names)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResource) ⇒ Promise< \| string> * [`.getResourcesDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResourcesDir) ⇒ string * [`.getTempFile(suffix)`](#module_electron-builder/out/platformPackager.PlatformPackager+getTempFile) ⇒ Promise<string> * [`.computeAppOutDir(outDir, arch)`](#module_electron-builder/out/platformPackager.PlatformPackager+computeAppOutDir) ⇒ string @@ -499,16 +535,16 @@ * [.LinuxPackager](#LinuxPackager) ⇐ [PlatformPackager](#PlatformPackager) * [`.createTargets(targets, mapper, cleanupTasks)`](#module_electron-builder/out/linuxPackager.LinuxPackager+createTargets) * [`.postInitApp(appOutDir)`](#module_electron-builder/out/linuxPackager.LinuxPackager+postInitApp) ⇒ Promise<any> - * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< | string> + * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< \| string> * [`.dispatchArtifactCreated(file, target, safeArtifactName)`](#module_electron-builder/out/platformPackager.PlatformPackager+dispatchArtifactCreated) * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ string * [`.expandMacro(pattern, arch, extra)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandMacro) ⇒ string * [`.generateName(ext, arch, deployment, classifier)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName) ⇒ string * [`.generateName2(ext, classifier, deployment)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName2) ⇒ string - * [`.getIconPath()`](#module_electron-builder/out/platformPackager.PlatformPackager+getIconPath) ⇒ Promise< | string> + * [`.getIconPath()`](#module_electron-builder/out/platformPackager.PlatformPackager+getIconPath) ⇒ Promise< \| string> * [`.getMacOsResourcesDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getMacOsResourcesDir) ⇒ string * [`.pack(outDir, arch, targets, postAsyncTasks)`](#module_electron-builder/out/platformPackager.PlatformPackager+pack) ⇒ Promise<any> - * [`.getResource(custom, names)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResource) ⇒ Promise< | string> + * [`.getResource(custom, names)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResource) ⇒ Promise< \| string> * [`.getResourcesDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResourcesDir) ⇒ string * [`.getTempFile(suffix)`](#module_electron-builder/out/platformPackager.PlatformPackager+getTempFile) ⇒ Promise<string> * [`.computeAppOutDir(outDir, arch)`](#module_electron-builder/out/platformPackager.PlatformPackager+computeAppOutDir) ⇒ string @@ -558,7 +594,7 @@ | Param | Type | | --- | --- | | file | string | -| target | [Target](#Target) | null | +| target | [Target](#Target) \| null | | safeArtifactName | string | @@ -568,9 +604,9 @@ | Param | Type | | --- | --- | -| targetSpecificOptions | [TargetSpecificOptions](#TargetSpecificOptions) | undefined | null | +| targetSpecificOptions | [TargetSpecificOptions](#TargetSpecificOptions) \| undefined \| null | | ext | string | -| arch | [Arch](#Arch) | null | +| arch | [Arch](#Arch) \| null | | defaultPattern | string | @@ -581,7 +617,7 @@ | Param | Type | | --- | --- | | pattern | string | -| arch | [Arch](#Arch) | undefined | null | +| arch | [Arch](#Arch) \| undefined \| null | | extra | any | @@ -591,10 +627,10 @@ | Param | Type | | --- | --- | -| ext | string | null | +| ext | string \| null | | arch | [Arch](#Arch) | | deployment | boolean | -| classifier | string | null | +| classifier | string \| null | @@ -603,8 +639,8 @@ | Param | Type | | --- | --- | -| ext | string | null | -| classifier | string | undefined | null | +| ext | string \| null | +| classifier | string \| undefined \| null | | deployment | boolean | @@ -639,7 +675,7 @@ | Param | Type | | --- | --- | -| custom | string | undefined | null | +| custom | string \| undefined \| null | | names | Array<string> | @@ -726,19 +762,19 @@ * [electron-builder/out/macPackager](#module_electron-builder/out/macPackager) * [.MacPackager](#MacPackager) ⇐ [PlatformPackager](#PlatformPackager) * [`.createTargets(targets, mapper, cleanupTasks)`](#module_electron-builder/out/macPackager.MacPackager+createTargets) - * [`.getIconPath()`](#module_electron-builder/out/macPackager.MacPackager+getIconPath) ⇒ Promise< | string> + * [`.getIconPath()`](#module_electron-builder/out/macPackager.MacPackager+getIconPath) ⇒ Promise< \| string> * [`.pack(outDir, arch, targets, postAsyncTasks)`](#module_electron-builder/out/macPackager.MacPackager+pack) ⇒ Promise<any> * [`.doFlat(appPath, outFile, identity, keychain)`](#module_electron-builder/out/macPackager.MacPackager+doFlat) ⇒ Promise<any> * [`.doSign(opts)`](#module_electron-builder/out/macPackager.MacPackager+doSign) ⇒ Promise<any> * [`.prepareAppInfo(appInfo)`](#module_electron-builder/out/macPackager.MacPackager+prepareAppInfo) ⇒ [AppInfo](#AppInfo) - * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< | string> + * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< \| string> * [`.dispatchArtifactCreated(file, target, safeArtifactName)`](#module_electron-builder/out/platformPackager.PlatformPackager+dispatchArtifactCreated) * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ string * [`.expandMacro(pattern, arch, extra)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandMacro) ⇒ string * [`.generateName(ext, arch, deployment, classifier)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName) ⇒ string * [`.generateName2(ext, classifier, deployment)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName2) ⇒ string * [`.getMacOsResourcesDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getMacOsResourcesDir) ⇒ string - * [`.getResource(custom, names)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResource) ⇒ Promise< | string> + * [`.getResource(custom, names)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResource) ⇒ Promise< \| string> * [`.getResourcesDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResourcesDir) ⇒ string * [`.getTempFile(suffix)`](#module_electron-builder/out/platformPackager.PlatformPackager+getTempFile) ⇒ Promise<string> * [`.computeAppOutDir(outDir, arch)`](#module_electron-builder/out/platformPackager.PlatformPackager+computeAppOutDir) ⇒ string @@ -756,19 +792,19 @@ * [.MacPackager](#MacPackager) ⇐ [PlatformPackager](#PlatformPackager) * [`.createTargets(targets, mapper, cleanupTasks)`](#module_electron-builder/out/macPackager.MacPackager+createTargets) - * [`.getIconPath()`](#module_electron-builder/out/macPackager.MacPackager+getIconPath) ⇒ Promise< | string> + * [`.getIconPath()`](#module_electron-builder/out/macPackager.MacPackager+getIconPath) ⇒ Promise< \| string> * [`.pack(outDir, arch, targets, postAsyncTasks)`](#module_electron-builder/out/macPackager.MacPackager+pack) ⇒ Promise<any> * [`.doFlat(appPath, outFile, identity, keychain)`](#module_electron-builder/out/macPackager.MacPackager+doFlat) ⇒ Promise<any> * [`.doSign(opts)`](#module_electron-builder/out/macPackager.MacPackager+doSign) ⇒ Promise<any> * [`.prepareAppInfo(appInfo)`](#module_electron-builder/out/macPackager.MacPackager+prepareAppInfo) ⇒ [AppInfo](#AppInfo) - * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< | string> + * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< \| string> * [`.dispatchArtifactCreated(file, target, safeArtifactName)`](#module_electron-builder/out/platformPackager.PlatformPackager+dispatchArtifactCreated) * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ string * [`.expandMacro(pattern, arch, extra)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandMacro) ⇒ string * [`.generateName(ext, arch, deployment, classifier)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName) ⇒ string * [`.generateName2(ext, classifier, deployment)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName2) ⇒ string * [`.getMacOsResourcesDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getMacOsResourcesDir) ⇒ string - * [`.getResource(custom, names)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResource) ⇒ Promise< | string> + * [`.getResource(custom, names)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResource) ⇒ Promise< \| string> * [`.getResourcesDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResourcesDir) ⇒ string * [`.getTempFile(suffix)`](#module_electron-builder/out/platformPackager.PlatformPackager+getTempFile) ⇒ Promise<string> * [`.computeAppOutDir(outDir, arch)`](#module_electron-builder/out/platformPackager.PlatformPackager+computeAppOutDir) ⇒ string @@ -819,7 +855,7 @@ | appPath | string | | outFile | string | | identity | string | -| keychain | string | undefined | null | +| keychain | string \| undefined \| null | @@ -859,7 +895,7 @@ | Param | Type | | --- | --- | | file | string | -| target | [Target](#Target) | null | +| target | [Target](#Target) \| null | | safeArtifactName | string | @@ -869,9 +905,9 @@ | Param | Type | | --- | --- | -| targetSpecificOptions | [TargetSpecificOptions](#TargetSpecificOptions) | undefined | null | +| targetSpecificOptions | [TargetSpecificOptions](#TargetSpecificOptions) \| undefined \| null | | ext | string | -| arch | [Arch](#Arch) | null | +| arch | [Arch](#Arch) \| null | | defaultPattern | string | @@ -882,7 +918,7 @@ | Param | Type | | --- | --- | | pattern | string | -| arch | [Arch](#Arch) | undefined | null | +| arch | [Arch](#Arch) \| undefined \| null | | extra | any | @@ -892,10 +928,10 @@ | Param | Type | | --- | --- | -| ext | string | null | +| ext | string \| null | | arch | [Arch](#Arch) | | deployment | boolean | -| classifier | string | null | +| classifier | string \| null | @@ -904,8 +940,8 @@ | Param | Type | | --- | --- | -| ext | string | null | -| classifier | string | undefined | null | +| ext | string \| null | +| classifier | string \| undefined \| null | | deployment | boolean | @@ -924,7 +960,7 @@ | Param | Type | | --- | --- | -| custom | string | undefined | null | +| custom | string \| undefined \| null | | names | Array<string> | @@ -1057,7 +1093,7 @@ | Param | Type | | --- | --- | -| rawPlatforms | Array<string | [Platform](#Platform)> | string | [Platform](#Platform) | undefined | null | +| rawPlatforms | Array<string \| [Platform](#Platform)> \| string \| [Platform](#Platform) \| undefined \| null | @@ -1066,16 +1102,16 @@ * [electron-builder/out/platformPackager](#module_electron-builder/out/platformPackager) * [.PlatformPackager](#PlatformPackager) * [`.createTargets(targets, mapper, cleanupTasks)`](#module_electron-builder/out/platformPackager.PlatformPackager+createTargets) - * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< | string> + * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< \| string> * [`.dispatchArtifactCreated(file, target, safeArtifactName)`](#module_electron-builder/out/platformPackager.PlatformPackager+dispatchArtifactCreated) * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ string * [`.expandMacro(pattern, arch, extra)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandMacro) ⇒ string * [`.generateName(ext, arch, deployment, classifier)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName) ⇒ string * [`.generateName2(ext, classifier, deployment)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName2) ⇒ string - * [`.getIconPath()`](#module_electron-builder/out/platformPackager.PlatformPackager+getIconPath) ⇒ Promise< | string> + * [`.getIconPath()`](#module_electron-builder/out/platformPackager.PlatformPackager+getIconPath) ⇒ Promise< \| string> * [`.getMacOsResourcesDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getMacOsResourcesDir) ⇒ string * [`.pack(outDir, arch, targets, postAsyncTasks)`](#module_electron-builder/out/platformPackager.PlatformPackager+pack) ⇒ Promise<any> - * [`.getResource(custom, names)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResource) ⇒ Promise< | string> + * [`.getResource(custom, names)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResource) ⇒ Promise< \| string> * [`.getResourcesDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResourcesDir) ⇒ string * [`.getTempFile(suffix)`](#module_electron-builder/out/platformPackager.PlatformPackager+getTempFile) ⇒ Promise<string> * [`.computeAppOutDir(outDir, arch)`](#module_electron-builder/out/platformPackager.PlatformPackager+computeAppOutDir) ⇒ string @@ -1094,16 +1130,16 @@ * [.PlatformPackager](#PlatformPackager) * [`.createTargets(targets, mapper, cleanupTasks)`](#module_electron-builder/out/platformPackager.PlatformPackager+createTargets) - * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< | string> + * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< \| string> * [`.dispatchArtifactCreated(file, target, safeArtifactName)`](#module_electron-builder/out/platformPackager.PlatformPackager+dispatchArtifactCreated) * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ string * [`.expandMacro(pattern, arch, extra)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandMacro) ⇒ string * [`.generateName(ext, arch, deployment, classifier)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName) ⇒ string * [`.generateName2(ext, classifier, deployment)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName2) ⇒ string - * [`.getIconPath()`](#module_electron-builder/out/platformPackager.PlatformPackager+getIconPath) ⇒ Promise< | string> + * [`.getIconPath()`](#module_electron-builder/out/platformPackager.PlatformPackager+getIconPath) ⇒ Promise< \| string> * [`.getMacOsResourcesDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getMacOsResourcesDir) ⇒ string * [`.pack(outDir, arch, targets, postAsyncTasks)`](#module_electron-builder/out/platformPackager.PlatformPackager+pack) ⇒ Promise<any> - * [`.getResource(custom, names)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResource) ⇒ Promise< | string> + * [`.getResource(custom, names)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResource) ⇒ Promise< \| string> * [`.getResourcesDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResourcesDir) ⇒ string * [`.getTempFile(suffix)`](#module_electron-builder/out/platformPackager.PlatformPackager+getTempFile) ⇒ Promise<string> * [`.computeAppOutDir(outDir, arch)`](#module_electron-builder/out/platformPackager.PlatformPackager+computeAppOutDir) ⇒ string @@ -1142,7 +1178,7 @@ | Param | Type | | --- | --- | | file | string | -| target | [Target](#Target) | null | +| target | [Target](#Target) \| null | | safeArtifactName | string | @@ -1152,9 +1188,9 @@ | Param | Type | | --- | --- | -| targetSpecificOptions | [TargetSpecificOptions](#TargetSpecificOptions) | undefined | null | +| targetSpecificOptions | [TargetSpecificOptions](#TargetSpecificOptions) \| undefined \| null | | ext | string | -| arch | [Arch](#Arch) | null | +| arch | [Arch](#Arch) \| null | | defaultPattern | string | @@ -1165,7 +1201,7 @@ | Param | Type | | --- | --- | | pattern | string | -| arch | [Arch](#Arch) | undefined | null | +| arch | [Arch](#Arch) \| undefined \| null | | extra | any | @@ -1175,10 +1211,10 @@ | Param | Type | | --- | --- | -| ext | string | null | +| ext | string \| null | | arch | [Arch](#Arch) | | deployment | boolean | -| classifier | string | null | +| classifier | string \| null | @@ -1187,8 +1223,8 @@ | Param | Type | | --- | --- | -| ext | string | null | -| classifier | string | undefined | null | +| ext | string \| null | +| classifier | string \| undefined \| null | | deployment | boolean | @@ -1223,7 +1259,7 @@ | Param | Type | | --- | --- | -| custom | string | undefined | null | +| custom | string \| undefined \| null | | names | Array<string> | @@ -1330,11 +1366,11 @@ * [.PublishManager](#PublishManager) ⇐ [PublishContext](Publishing-Artifacts#PublishContext) * [`.awaitTasks()`](#module_electron-builder/out/publish/PublishManager.PublishManager+awaitTasks) ⇒ Promise<void> * [`.cancelTasks()`](#module_electron-builder/out/publish/PublishManager.PublishManager+cancelTasks) - * [`.getOrCreatePublisher(publishConfig, buildInfo)`](#module_electron-builder/out/publish/PublishManager.PublishManager+getOrCreatePublisher) ⇒ null | [Publisher](Publishing-Artifacts#Publisher) + * [`.getOrCreatePublisher(publishConfig, buildInfo)`](#module_electron-builder/out/publish/PublishManager.PublishManager+getOrCreatePublisher) ⇒ null \| [Publisher](Publishing-Artifacts#Publisher) * [`.computeDownloadUrl(publishConfig, fileName, packager)`](#module_electron-builder/out/publish/PublishManager.computeDownloadUrl) ⇒ string - * [`.createPublisher(context, version, publishConfig, options)`](#module_electron-builder/out/publish/PublishManager.createPublisher) ⇒ null | [Publisher](Publishing-Artifacts#Publisher) - * [`.getPublishConfigs(packager, targetSpecificOptions)`](#module_electron-builder/out/publish/PublishManager.getPublishConfigs) ⇒ Promise< | Array> - * [`.getPublishConfigsForUpdateInfo(packager, publishConfigs)`](#module_electron-builder/out/publish/PublishManager.getPublishConfigsForUpdateInfo) ⇒ Promise< | Array> + * [`.createPublisher(context, version, publishConfig, options)`](#module_electron-builder/out/publish/PublishManager.createPublisher) ⇒ null \| [Publisher](Publishing-Artifacts#Publisher) + * [`.getPublishConfigs(packager, targetSpecificOptions)`](#module_electron-builder/out/publish/PublishManager.getPublishConfigs) ⇒ Promise< \| Array> + * [`.getPublishConfigsForUpdateInfo(packager, publishConfigs)`](#module_electron-builder/out/publish/PublishManager.getPublishConfigsForUpdateInfo) ⇒ Promise< \| Array> @@ -1345,7 +1381,7 @@ * [.PublishManager](#PublishManager) ⇐ [PublishContext](Publishing-Artifacts#PublishContext) * [`.awaitTasks()`](#module_electron-builder/out/publish/PublishManager.PublishManager+awaitTasks) ⇒ Promise<void> * [`.cancelTasks()`](#module_electron-builder/out/publish/PublishManager.PublishManager+cancelTasks) - * [`.getOrCreatePublisher(publishConfig, buildInfo)`](#module_electron-builder/out/publish/PublishManager.PublishManager+getOrCreatePublisher) ⇒ null | [Publisher](Publishing-Artifacts#Publisher) + * [`.getOrCreatePublisher(publishConfig, buildInfo)`](#module_electron-builder/out/publish/PublishManager.PublishManager+getOrCreatePublisher) ⇒ null \| [Publisher](Publishing-Artifacts#Publisher) @@ -1373,7 +1409,7 @@ | Param | Type | | --- | --- | | publishConfig | [PublishConfiguration](Publishing-Artifacts#PublishConfiguration) | -| fileName | string | null | +| fileName | string \| null | | packager | [PlatformPackager](#PlatformPackager)<any> | @@ -1396,7 +1432,7 @@ | Param | Type | | --- | --- | | packager | [PlatformPackager](#PlatformPackager)<any> | -| targetSpecificOptions | [PlatformSpecificBuildOptions](#PlatformSpecificBuildOptions) | null | undefined | +| targetSpecificOptions | [PlatformSpecificBuildOptions](#PlatformSpecificBuildOptions) \| null \| undefined | @@ -1406,7 +1442,7 @@ | Param | Type | | --- | --- | | packager | [PlatformPackager](#PlatformPackager)<any> | -| publishConfigs | Array<[PublishConfiguration](Publishing-Artifacts#PublishConfiguration)> | null | +| publishConfigs | Array<[PublishConfiguration](Publishing-Artifacts#PublishConfiguration)> \| null | @@ -1414,7 +1450,7 @@ * [electron-builder/out/readInstalled](#module_electron-builder/out/readInstalled) * [`.Dependency`](#Dependency) - * [`.readInstalled(folder)`](#module_electron-builder/out/readInstalled.readInstalled) ⇒ Promise<Map<string | [Dependency](#Dependency)>> + * [`.readInstalled(folder)`](#module_electron-builder/out/readInstalled.readInstalled) ⇒ Promise<Map<string \| [Dependency](#Dependency)>> @@ -1445,7 +1481,7 @@ * [electron-builder/out/repositoryInfo](#module_electron-builder/out/repositoryInfo) * [`.RepositorySlug`](#RepositorySlug) - * [`.getRepositoryInfo(projectDir, metadata, devMetadata)`](#module_electron-builder/out/repositoryInfo.getRepositoryInfo) ⇒ Promise< | module:hosted-git-info.Info> + * [`.getRepositoryInfo(projectDir, metadata, devMetadata)`](#module_electron-builder/out/repositoryInfo.getRepositoryInfo) ⇒ Promise< \| module:hosted-git-info.Info> @@ -1552,7 +1588,7 @@ | Param | Type | | --- | --- | -| compression | "store" | "normal" | "maximum" | undefined | null | +| compression | "store" \| "normal" \| "maximum" \| undefined \| null | | format | string | | outFile | string | | dirToArchive | string | @@ -1565,7 +1601,7 @@ | Param | Type | | --- | --- | -| compression | "store" | "normal" | "maximum" | undefined | null | +| compression | "store" \| "normal" \| "maximum" \| undefined \| null | | format | string | | outFile | string | | dirToArchive | string | @@ -1651,7 +1687,7 @@ | Param | Type | | --- | --- | -| custom | string | null | +| custom | string \| null | @@ -1729,7 +1765,7 @@ | --- | --- | | platformSpecificBuildOptions | [LinuxBuildOptions](Options#LinuxBuildOptions) | | exec | string | -| destination | string | null | +| destination | string \| null | | extra | Object<string, any> | @@ -1838,8 +1874,8 @@ | Param | Type | | --- | --- | -| identity | string | undefined | null | -| keychain | string | undefined | null | +| identity | string \| undefined \| null | +| keychain | string \| undefined \| null | @@ -1883,7 +1919,7 @@ * [.NoOpTarget](#NoOpTarget) ⇐ [Target](#Target) * [`.build(appOutDir, arch)`](#module_electron-builder/out/targets/targetFactory.NoOpTarget+build) ⇒ Promise<any> * [`.finishBuild()`](#module_electron-builder-core.Target+finishBuild) ⇒ Promise<any> - * [`.computeArchToTargetNamesMap(raw, options, platform)`](#module_electron-builder/out/targets/targetFactory.computeArchToTargetNamesMap) ⇒ Map<[Arch](#Arch) | Array<string>> + * [`.computeArchToTargetNamesMap(raw, options, platform)`](#module_electron-builder/out/targets/targetFactory.computeArchToTargetNamesMap) ⇒ Map<[Arch](#Arch) \| Array<string>> * [`.createCommonTarget(target, outDir, packager)`](#module_electron-builder/out/targets/targetFactory.createCommonTarget) ⇒ [Target](#Target) * [`.createTargets(nameToTarget, rawList, outDir, packager, cleanupTasks)`](#module_electron-builder/out/targets/targetFactory.createTargets) ⇒ Array<[Target](#Target)> @@ -1919,7 +1955,7 @@ | Param | Type | | --- | --- | -| raw | Map<[Arch](#Arch) | Array<string>> | +| raw | Map<[Arch](#Arch) \| Array<string>> | | options | [PlatformSpecificBuildOptions](#PlatformSpecificBuildOptions) | | platform | [Platform](#Platform) | @@ -1941,7 +1977,7 @@ | Param | Type | | --- | --- | -| nameToTarget | Map<String | [Target](#Target)> | +| nameToTarget | Map<String \| [Target](#Target)> | | rawList | Array<string> | | outDir | string | | packager | [PlatformPackager](#PlatformPackager)<any> | @@ -1988,7 +2024,7 @@ * [electron-builder/out/util/filter](#module_electron-builder/out/util/filter) * [`.createFilter(src, patterns, ignoreFiles, rawFilter, excludePatterns)`](#module_electron-builder/out/util/filter.createFilter) ⇒ module:electron-builder-util/out/fs.__type - * [`.hasMagic(pattern)`](#module_electron-builder/out/util/filter.hasMagic) ⇒ "undefined" | "undefined" + * [`.hasMagic(pattern)`](#module_electron-builder/out/util/filter.hasMagic) ⇒ "undefined" \| "undefined" @@ -2001,7 +2037,7 @@ | patterns | Array<minimatch:Minimatch> | | ignoreFiles | Set<string> | | rawFilter | callback | -| excludePatterns | Array<minimatch:Minimatch> | null | +| excludePatterns | Array<minimatch:Minimatch> \| null | @@ -2019,7 +2055,7 @@ * [electron-builder/out/util/readPackageJson](#module_electron-builder/out/util/readPackageJson) * [`.doLoadConfig(configFile, projectDir)`](#module_electron-builder/out/util/readPackageJson.doLoadConfig) ⇒ Promise<any> * [`.getElectronVersion(config, projectDir, projectMetadata)`](#module_electron-builder/out/util/readPackageJson.getElectronVersion) ⇒ Promise<string> - * [`.loadConfig(projectDir)`](#module_electron-builder/out/util/readPackageJson.loadConfig) ⇒ Promise< | [Config](Options#Config)> + * [`.loadConfig(projectDir)`](#module_electron-builder/out/util/readPackageJson.loadConfig) ⇒ Promise< \| [Config](Options#Config)> * [`.readPackageJson(file)`](#module_electron-builder/out/util/readPackageJson.readPackageJson) ⇒ Promise<any> * [`.validateConfig(config)`](#module_electron-builder/out/util/readPackageJson.validateConfig) ⇒ Promise<void> @@ -2040,9 +2076,9 @@ | Param | Type | | --- | --- | -| config | [Config](Options#Config) | null | undefined | +| config | [Config](Options#Config) \| null \| undefined | | projectDir | string | -| projectMetadata | any | null | +| projectMetadata | any \| null | @@ -2140,7 +2176,7 @@ * [`.doGetCscPassword()`](#module_electron-builder/out/winPackager.WinPackager+doGetCscPassword) ⇒ string * [`.doSign(options)`](#module_electron-builder/out/winPackager.WinPackager+doSign) ⇒ Promise<any> * [`.postInitApp(appOutDir)`](#module_electron-builder/out/winPackager.WinPackager+postInitApp) ⇒ Promise<void> - * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< | string> + * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< \| string> * [`.dispatchArtifactCreated(file, target, safeArtifactName)`](#module_electron-builder/out/platformPackager.PlatformPackager+dispatchArtifactCreated) * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ string * [`.expandMacro(pattern, arch, extra)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandMacro) ⇒ string @@ -2148,7 +2184,7 @@ * [`.generateName2(ext, classifier, deployment)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName2) ⇒ string * [`.getMacOsResourcesDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getMacOsResourcesDir) ⇒ string * [`.pack(outDir, arch, targets, postAsyncTasks)`](#module_electron-builder/out/platformPackager.PlatformPackager+pack) ⇒ Promise<any> - * [`.getResource(custom, names)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResource) ⇒ Promise< | string> + * [`.getResource(custom, names)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResource) ⇒ Promise< \| string> * [`.getResourcesDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResourcesDir) ⇒ string * [`.getTempFile(suffix)`](#module_electron-builder/out/platformPackager.PlatformPackager+getTempFile) ⇒ Promise<string> * [`.computeAppOutDir(outDir, arch)`](#module_electron-builder/out/platformPackager.PlatformPackager+computeAppOutDir) ⇒ string @@ -2171,7 +2207,7 @@ * [`.doGetCscPassword()`](#module_electron-builder/out/winPackager.WinPackager+doGetCscPassword) ⇒ string * [`.doSign(options)`](#module_electron-builder/out/winPackager.WinPackager+doSign) ⇒ Promise<any> * [`.postInitApp(appOutDir)`](#module_electron-builder/out/winPackager.WinPackager+postInitApp) ⇒ Promise<void> - * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< | string> + * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< \| string> * [`.dispatchArtifactCreated(file, target, safeArtifactName)`](#module_electron-builder/out/platformPackager.PlatformPackager+dispatchArtifactCreated) * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ string * [`.expandMacro(pattern, arch, extra)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandMacro) ⇒ string @@ -2179,7 +2215,7 @@ * [`.generateName2(ext, classifier, deployment)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName2) ⇒ string * [`.getMacOsResourcesDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getMacOsResourcesDir) ⇒ string * [`.pack(outDir, arch, targets, postAsyncTasks)`](#module_electron-builder/out/platformPackager.PlatformPackager+pack) ⇒ Promise<any> - * [`.getResource(custom, names)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResource) ⇒ Promise< | string> + * [`.getResource(custom, names)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResource) ⇒ Promise< \| string> * [`.getResourcesDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResourcesDir) ⇒ string * [`.getTempFile(suffix)`](#module_electron-builder/out/platformPackager.PlatformPackager+getTempFile) ⇒ Promise<string> * [`.computeAppOutDir(outDir, arch)`](#module_electron-builder/out/platformPackager.PlatformPackager+computeAppOutDir) ⇒ string @@ -2268,7 +2304,7 @@ | Param | Type | | --- | --- | | file | string | -| target | [Target](#Target) | null | +| target | [Target](#Target) \| null | | safeArtifactName | string | @@ -2278,9 +2314,9 @@ | Param | Type | | --- | --- | -| targetSpecificOptions | [TargetSpecificOptions](#TargetSpecificOptions) | undefined | null | +| targetSpecificOptions | [TargetSpecificOptions](#TargetSpecificOptions) \| undefined \| null | | ext | string | -| arch | [Arch](#Arch) | null | +| arch | [Arch](#Arch) \| null | | defaultPattern | string | @@ -2291,7 +2327,7 @@ | Param | Type | | --- | --- | | pattern | string | -| arch | [Arch](#Arch) | undefined | null | +| arch | [Arch](#Arch) \| undefined \| null | | extra | any | @@ -2301,10 +2337,10 @@ | Param | Type | | --- | --- | -| ext | string | null | +| ext | string \| null | | arch | [Arch](#Arch) | | deployment | boolean | -| classifier | string | null | +| classifier | string \| null | @@ -2313,8 +2349,8 @@ | Param | Type | | --- | --- | -| ext | string | null | -| classifier | string | undefined | null | +| ext | string \| null | +| classifier | string \| undefined \| null | | deployment | boolean | @@ -2345,7 +2381,7 @@ | Param | Type | | --- | --- | -| custom | string | undefined | null | +| custom | string \| undefined \| null | | names | Array<string> | @@ -2487,7 +2523,7 @@ * [`.TargetConfig`](#TargetConfig) * [`.TargetSpecificOptions`](#TargetSpecificOptions) * [.Platform](#Platform) - * [`.createTarget(type, archs)`](#module_electron-builder-core.Platform+createTarget) ⇒ Map<[Platform](#Platform) | Map<[Arch](#Arch) | Array<string>>> + * [`.createTarget(type, archs)`](#module_electron-builder-core.Platform+createTarget) ⇒ Map<[Platform](#Platform) \| Map<[Arch](#Arch) \| Array<string>>> * [`.current()`](#module_electron-builder-core.Platform+current) ⇒ [Platform](#Platform) * [`.fromString(name)`](#module_electron-builder-core.Platform+fromString) ⇒ [Platform](#Platform) * [`.toString()`](#module_electron-builder-core.Platform+toString) ⇒ string @@ -2497,7 +2533,7 @@ * [`.Arch`](#Arch) : enum * [`.archFromString(name)`](#module_electron-builder-core.archFromString) ⇒ [Arch](#Arch) * [`.getArchSuffix(arch)`](#module_electron-builder-core.getArchSuffix) ⇒ string - * [`.toLinuxArchString(arch)`](#module_electron-builder-core.toLinuxArchString) ⇒ "armv7l" | "i386" | "amd64" + * [`.toLinuxArchString(arch)`](#module_electron-builder-core.toLinuxArchString) ⇒ "armv7l" \| "i386" \| "amd64" @@ -2509,7 +2545,6 @@ | --- | --- | | smartUnpack| boolean | | ordering| string \| null | -| extraMetadata| any \| null | @@ -2668,7 +2703,7 @@ Please note — on macOS [you need to register an `open-url` event handler](http **Kind**: class of [electron-builder-core](#module_electron-builder-core) * [.Platform](#Platform) - * [`.createTarget(type, archs)`](#module_electron-builder-core.Platform+createTarget) ⇒ Map<[Platform](#Platform) | Map<[Arch](#Arch) | Array<string>>> + * [`.createTarget(type, archs)`](#module_electron-builder-core.Platform+createTarget) ⇒ Map<[Platform](#Platform) \| Map<[Arch](#Arch) \| Array<string>>> * [`.current()`](#module_electron-builder-core.Platform+current) ⇒ [Platform](#Platform) * [`.fromString(name)`](#module_electron-builder-core.Platform+fromString) ⇒ [Platform](#Platform) * [`.toString()`](#module_electron-builder-core.Platform+toString) ⇒ string @@ -2680,7 +2715,7 @@ Please note — on macOS [you need to register an `open-url` event handler](http | Param | Type | | --- | --- | -| type | string | Array<string> | null | +| type | string \| Array<string> \| null | | archs | Array<[Arch](#Arch)> | @@ -2855,10 +2890,10 @@ Please note — on macOS [you need to register an `open-url` event handler](http | Param | Type | | --- | --- | | path | string | -| auth | string | null | -| data | Object<string, any> | null | +| auth | string \| null | +| data | Object<string, any> \| null | | cancellationToken | [CancellationToken](#CancellationToken) | -| method | "GET" | "DELETE" | "PUT" | +| method | "GET" \| "DELETE" \| "PUT" | @@ -3070,7 +3105,7 @@ Please note — on macOS [you need to register an `open-url` event handler](http | --- | --- | | options | module:http.RequestOptions | | cancellationToken | [CancellationToken](#CancellationToken) | -| data | Object<string, any> | null | +| data | Object<string, any> \| null | @@ -3150,8 +3185,8 @@ Please note — on macOS [you need to register an `open-url` event handler](http | Param | Type | | --- | --- | | options | module:http.RequestOptions | -| token | string | null | -| method | "GET" | "DELETE" | "PUT" | +| token | string \| null | +| method | "GET" \| "DELETE" \| "PUT" | @@ -3162,7 +3197,7 @@ Please note — on macOS [you need to register an `open-url` event handler](http | --- | --- | | url | string | | destination | string | -| options | [DownloadOptions](#DownloadOptions) | null | +| options | [DownloadOptions](#DownloadOptions) \| null | @@ -3182,7 +3217,7 @@ Please note — on macOS [you need to register an `open-url` event handler](http | --- | --- | | options | module:http.RequestOptions | | cancellationToken | [CancellationToken](#CancellationToken) | -| data | Object<string, any> | null | +| data | Object<string, any> \| null | @@ -3427,7 +3462,7 @@ Please note — on macOS [you need to register an `open-url` event handler](http | --- | --- | | options | module:http.RequestOptions | | cancellationToken | [CancellationToken](#CancellationToken) | -| data | Object<string, any> | null | +| data | Object<string, any> \| null | @@ -3744,11 +3779,11 @@ Start downloading update manually. You can use this method if `autoDownload` opt * [electron-builder-util/out/fs](#module_electron-builder-util/out/fs) * [.FileCopier](#FileCopier) * [`.copy(src, dest, stat)`](#module_electron-builder-util/out/fs.FileCopier+copy) ⇒ Promise<void> - * [`.copyDir(src, destination, filter, isUseHardLink)`](#module_electron-builder-util/out/fs.copyDir) ⇒ Promise<any> + * [`.copyDir(src, destination, filter, transformer, isUseHardLink)`](#module_electron-builder-util/out/fs.copyDir) ⇒ Promise<any> * [`.copyFile(src, dest, stats, isUseHardLink)`](#module_electron-builder-util/out/fs.copyFile) ⇒ Promise<any> - * [`.exists(file)`](#module_electron-builder-util/out/fs.exists) ⇒ Promise<"undefined" | "undefined"> - * [`.statOrNull(file)`](#module_electron-builder-util/out/fs.statOrNull) ⇒ Promise< | module:fs.Stats> - * [`.unlinkIfExists(file)`](#module_electron-builder-util/out/fs.unlinkIfExists) ⇒ Promise<string | void> + * [`.exists(file)`](#module_electron-builder-util/out/fs.exists) ⇒ Promise<"undefined" \| "undefined"> + * [`.statOrNull(file)`](#module_electron-builder-util/out/fs.statOrNull) ⇒ Promise< \| module:fs.Stats> + * [`.unlinkIfExists(file)`](#module_electron-builder-util/out/fs.unlinkIfExists) ⇒ Promise<string \| void> * [`.walk(initialDirPath, filter, consumer)`](#module_electron-builder-util/out/fs.walk) ⇒ Promise<Array<string>> @@ -3764,11 +3799,11 @@ Start downloading update manually. You can use this method if `autoDownload` opt | --- | --- | | src | string | | dest | string | -| stat | module:fs.Stats | undefined | +| stat | module:fs.Stats \| undefined | -### `electron-builder-util/out/fs.copyDir(src, destination, filter, isUseHardLink)` ⇒ Promise<any> +### `electron-builder-util/out/fs.copyDir(src, destination, filter, transformer, isUseHardLink)` ⇒ Promise<any> Empty directories is never created. Hard links is used if supported and allowed. @@ -3779,6 +3814,7 @@ Hard links is used if supported and allowed. | src | string | | destination | string | | filter | module:electron-builder-util/out/fs.__type | +| transformer | module:electron-builder-util/out/fs.__type | | isUseHardLink | callback | @@ -3793,7 +3829,7 @@ File permission is fixed — allow execute for all if owner can, allow read for | --- | --- | | src | string | | dest | string | -| stats | module:fs.Stats | null | +| stats | module:fs.Stats \| null | | isUseHardLink | | @@ -3831,7 +3867,7 @@ File permission is fixed — allow execute for all if owner can, allow read for | Param | Type | | --- | --- | | initialDirPath | string | -| filter | module:electron-builder-util/out/fs.__type | null | +| filter | module:electron-builder-util/out/fs.__type \| null | | consumer | callback | @@ -3861,7 +3897,7 @@ File permission is fixed — allow execute for all if owner can, allow read for | Param | Type | | --- | --- | -| value | module:electron-builder-util/out/log.__type | null | +| value | module:electron-builder-util/out/log.__type \| null | @@ -3871,7 +3907,7 @@ File permission is fixed — allow execute for all if owner can, allow read for | Param | Type | | --- | --- | | title | string | -| promise | module:bluebird-lst.Bluebird<any> | Promise<any> | +| promise | module:bluebird-lst.Bluebird<any> \| Promise<any> | @@ -3881,7 +3917,7 @@ File permission is fixed — allow execute for all if owner can, allow read for | Param | Type | | --- | --- | | title | string | -| promise | module:bluebird-lst.Bluebird<any> | Promise<any> | +| promise | module:bluebird-lst.Bluebird<any> \| Promise<any> | @@ -3968,7 +4004,7 @@ File permission is fixed — allow execute for all if owner can, allow read for | --- | --- | | options | module:http.RequestOptions | | cancellationToken | [CancellationToken](#CancellationToken) | -| data | Object<string, any> | null | +| data | Object<string, any> \| null | @@ -4116,17 +4152,18 @@ File permission is fixed — allow execute for all if owner can, allow read for * [`.exec(file, args, options)`](#module_electron-builder-util.exec) ⇒ Promise<string> * [`.execWine(file, args, options)`](#module_electron-builder-util.execWine) ⇒ Promise<string> * [`.getCacheDirectory()`](#module_electron-builder-util.getCacheDirectory) ⇒ string - * [`.getPlatformIconFileName(value, isMac)`](#module_electron-builder-util.getPlatformIconFileName) ⇒ undefined | null | string + * [`.getPlatformIconFileName(value, isMac)`](#module_electron-builder-util.getPlatformIconFileName) ⇒ undefined \| null \| string * [`.getTempName(prefix)`](#module_electron-builder-util.getTempName) ⇒ string * [`.handleProcess(event, childProcess, command, resolve, reject)`](#module_electron-builder-util.handleProcess) - * [`.isEmptyOrSpaces(s)`](#module_electron-builder-util.isEmptyOrSpaces) ⇒ "undefined" | "undefined" - * [`.isPullRequest()`](#module_electron-builder-util.isPullRequest) ⇒ "undefined" | "undefined" | "" + * [`.isEmptyOrSpaces(s)`](#module_electron-builder-util.isEmptyOrSpaces) ⇒ "undefined" \| "undefined" + * [`.isPullRequest()`](#module_electron-builder-util.isPullRequest) ⇒ "undefined" \| "undefined" \| "" * [`.prepareArgs(args, exePath)`](#module_electron-builder-util.prepareArgs) ⇒ Array<string> * [`.removePassword(input)`](#module_electron-builder-util.removePassword) ⇒ string * [`.replaceDefault(inList, defaultList)`](#module_electron-builder-util.replaceDefault) ⇒ Array<string> + * [`.safeStringifyJson(data)`](#module_electron-builder-util.safeStringifyJson) ⇒ string * [`.smarten(s)`](#module_electron-builder-util.smarten) ⇒ string * [`.spawn(command, args, options)`](#module_electron-builder-util.spawn) ⇒ Promise<any> - * [`.use(value, task)`](#module_electron-builder-util.use) ⇒ null | module:electron-builder-util.R + * [`.use(value, task)`](#module_electron-builder-util.use) ⇒ null \| module:electron-builder-util.R @@ -4166,7 +4203,7 @@ File permission is fixed — allow execute for all if owner can, allow read for | Param | Type | | --- | --- | -| map | Map<module:electron-builder-util.K | Array<module:electron-builder-util.T>> | +| map | Map<module:electron-builder-util.K \| Array<module:electron-builder-util.T>> | | key | module:electron-builder-util.K | | value | module:electron-builder-util.T | @@ -4177,7 +4214,7 @@ File permission is fixed — allow execute for all if owner can, allow read for | Param | Type | | --- | --- | -| v | null | undefined | module:electron-builder-util.T | Array<module:electron-builder-util.T> | +| v | null \| undefined \| module:electron-builder-util.T \| Array<module:electron-builder-util.T> | @@ -4187,7 +4224,7 @@ File permission is fixed — allow execute for all if owner can, allow read for | Param | Type | | --- | --- | | projectDir | string | -| userAppDir | string | null | undefined | +| userAppDir | string \| null \| undefined | @@ -4196,7 +4233,7 @@ File permission is fixed — allow execute for all if owner can, allow read for | Param | Type | | --- | --- | -| command | "a" | "x" | +| command | "a" \| "x" | @@ -4218,7 +4255,7 @@ File permission is fixed — allow execute for all if owner can, allow read for | Param | Type | | --- | --- | | file | string | -| args | Array<string> | null | +| args | Array<string> \| null | | options | [ExecOptions](#ExecOptions) | @@ -4243,7 +4280,7 @@ File permission is fixed — allow execute for all if owner can, allow read for | Param | Type | | --- | --- | -| value | string | null | undefined | +| value | string \| null \| undefined | | isMac | boolean | @@ -4253,7 +4290,7 @@ File permission is fixed — allow execute for all if owner can, allow read for | Param | Type | | --- | --- | -| prefix | string | null | undefined | +| prefix | string \| null \| undefined | @@ -4265,7 +4302,7 @@ File permission is fixed — allow execute for all if owner can, allow read for | event | string | | childProcess | module:child_process.ChildProcess | | command | string | -| resolve | module:electron-builder-util.__type | null | +| resolve | module:electron-builder-util.__type \| null | | reject | callback | @@ -4275,7 +4312,7 @@ File permission is fixed — allow execute for all if owner can, allow read for | Param | Type | | --- | --- | -| s | string | null | undefined | +| s | string \| null \| undefined | @@ -4307,9 +4344,18 @@ File permission is fixed — allow execute for all if owner can, allow read for | Param | Type | | --- | --- | -| inList | Array<string> | null | undefined | +| inList | Array<string> \| null \| undefined | | defaultList | Array<string> | + + +### `electron-builder-util.safeStringifyJson(data)` ⇒ string +**Kind**: method of [electron-builder-util](#module_electron-builder-util) + +| Param | Type | +| --- | --- | +| data | any | + ### `electron-builder-util.smarten(s)` ⇒ string @@ -4327,7 +4373,7 @@ File permission is fixed — allow execute for all if owner can, allow read for | Param | Type | | --- | --- | | command | string | -| args | Array<string> | null | +| args | Array<string> \| null | | options | module:child_process.SpawnOptions | @@ -4337,6 +4383,6 @@ File permission is fixed — allow execute for all if owner can, allow read for | Param | Type | | --- | --- | -| value | module:electron-builder-util.T | null | +| value | module:electron-builder-util.T \| null | | task | callback | diff --git a/docs/Options.md b/docs/Options.md index ab38f555863..8329518b2bd 100644 --- a/docs/Options.md +++ b/docs/Options.md @@ -115,7 +115,7 @@ You can use [file macros](#file-macros) in the `from` and `to` fields as well. * [`.WinBuildOptions`](#WinBuildOptions) ⇐ [PlatformSpecificBuildOptions](Developer-API#PlatformSpecificBuildOptions) * [.Packager](#Packager) ⇐ [BuildInfo](#BuildInfo) * [`.build(rawOptions)`](#module_electron-builder.build) ⇒ Promise<Array<string>> - * [`.createTargets(platforms, type, arch)`](#module_electron-builder.createTargets) ⇒ Map<[Platform](Developer-API#Platform) | Map<[Arch](Developer-API#Arch) | Array<string>>> + * [`.createTargets(platforms, type, arch)`](#module_electron-builder.createTargets) ⇒ Map<[Platform](Developer-API#Platform) \| Map<[Arch](Developer-API#Arch) \| Array<string>>> @@ -173,6 +173,7 @@ AppX Options | --- | --- | | **options**| [PackagerOptions](#PackagerOptions) | | **metadata**| [Metadata](#Metadata) | +| **devMetadata**| [Metadata](#Metadata) | | **config**| [Config](#Config) | | **projectDir**| string | | **appDir**| string | @@ -609,8 +610,8 @@ Windows Specific Options | Param | Type | | --- | --- | | platforms | Array<[Platform](Developer-API#Platform)> | -| type | string | null | -| arch | string | null | +| type | string \| null | +| arch | string \| null | \ No newline at end of file diff --git a/docs/Publishing Artifacts.md b/docs/Publishing Artifacts.md index e9f6061f759..ccd2d4aea21 100644 --- a/docs/Publishing Artifacts.md +++ b/docs/Publishing Artifacts.md @@ -138,6 +138,7 @@ GitHub options. | host = "github.com"| string \| null | The host (including the port if need). | | protocol = https| "https" \| "http" \| null | The protocol. GitHub Publisher supports only `https`. | | token| string \| null | The access token to support auto-update from private github repositories. Never specify it in the configuration files. Only for [setFeedURL](module:electron-updater/out/AppUpdater.AppUpdater+setFeedURL). | +| private| boolean \| null | Whether to use private github auto-update provider if `GH_TOKEN` environment variable is set. See: https://github.com/electron-userland/electron-builder/wiki/Auto-Update#private-github-update-repo | @@ -232,12 +233,12 @@ Amazon S3 options. `https` must be used, so, if you use direct Amazon S3 endpoin * [`.uploadData(data, fileName)`](#module_electron-publish.HttpPublisher+uploadData) ⇒ Promise<any> * [`.doUpload(fileName, dataLength, requestProcessor, file)`](#module_electron-publish.HttpPublisher+doUpload) ⇒ Promise<any> * [`.toString()`](#module_electron-publish.Publisher+toString) ⇒ string - * [`.createProgressBar(fileName, fileStat)`](#module_electron-publish.Publisher+createProgressBar) ⇒ null | module:progress-ex.default + * [`.createProgressBar(fileName, fileStat)`](#module_electron-publish.Publisher+createProgressBar) ⇒ null \| module:progress-ex.default * [`.createReadStreamAndProgressBar(file, fileStat, progressBar, reject)`](#module_electron-publish.Publisher+createReadStreamAndProgressBar) ⇒ NodeJS:ReadableStream * [.Publisher](#Publisher) * [`.toString()`](#module_electron-publish.Publisher+toString) ⇒ string * [`.upload(file, safeArtifactName)`](#module_electron-publish.Publisher+upload) ⇒ Promise<any> - * [`.createProgressBar(fileName, fileStat)`](#module_electron-publish.Publisher+createProgressBar) ⇒ null | module:progress-ex.default + * [`.createProgressBar(fileName, fileStat)`](#module_electron-publish.Publisher+createProgressBar) ⇒ null \| module:progress-ex.default * [`.createReadStreamAndProgressBar(file, fileStat, progressBar, reject)`](#module_electron-publish.Publisher+createReadStreamAndProgressBar) ⇒ NodeJS:ReadableStream @@ -274,7 +275,7 @@ Amazon S3 options. `https` must be used, so, if you use direct Amazon S3 endpoin * [`.uploadData(data, fileName)`](#module_electron-publish.HttpPublisher+uploadData) ⇒ Promise<any> * [`.doUpload(fileName, dataLength, requestProcessor, file)`](#module_electron-publish.HttpPublisher+doUpload) ⇒ Promise<any> * [`.toString()`](#module_electron-publish.Publisher+toString) ⇒ string - * [`.createProgressBar(fileName, fileStat)`](#module_electron-publish.Publisher+createProgressBar) ⇒ null | module:progress-ex.default + * [`.createProgressBar(fileName, fileStat)`](#module_electron-publish.Publisher+createProgressBar) ⇒ null \| module:progress-ex.default * [`.createReadStreamAndProgressBar(file, fileStat, progressBar, reject)`](#module_electron-publish.Publisher+createReadStreamAndProgressBar) ⇒ NodeJS:ReadableStream @@ -336,7 +337,7 @@ Amazon S3 options. `https` must be used, so, if you use direct Amazon S3 endpoin | --- | --- | | file | string | | fileStat | module:fs.Stats | -| progressBar | module:progress-ex.default | null | +| progressBar | module:progress-ex.default \| null | | reject | callback | @@ -347,7 +348,7 @@ Amazon S3 options. `https` must be used, so, if you use direct Amazon S3 endpoin * [.Publisher](#Publisher) * [`.toString()`](#module_electron-publish.Publisher+toString) ⇒ string * [`.upload(file, safeArtifactName)`](#module_electron-publish.Publisher+upload) ⇒ Promise<any> - * [`.createProgressBar(fileName, fileStat)`](#module_electron-publish.Publisher+createProgressBar) ⇒ null | module:progress-ex.default + * [`.createProgressBar(fileName, fileStat)`](#module_electron-publish.Publisher+createProgressBar) ⇒ null \| module:progress-ex.default * [`.createReadStreamAndProgressBar(file, fileStat, progressBar, reject)`](#module_electron-publish.Publisher+createReadStreamAndProgressBar) ⇒ NodeJS:ReadableStream @@ -385,7 +386,7 @@ Amazon S3 options. `https` must be used, so, if you use direct Amazon S3 endpoin | --- | --- | | file | string | | fileStat | module:fs.Stats | -| progressBar | module:progress-ex.default | null | +| progressBar | module:progress-ex.default \| null | | reject | callback | diff --git a/packages/electron-builder-http/src/publishOptions.ts b/packages/electron-builder-http/src/publishOptions.ts index 91d03790186..c3fcc5cb1c2 100644 --- a/packages/electron-builder-http/src/publishOptions.ts +++ b/packages/electron-builder-http/src/publishOptions.ts @@ -57,6 +57,12 @@ export interface GithubOptions extends PublishConfiguration { * The access token to support auto-update from private github repositories. Never specify it in the configuration files. Only for [setFeedURL](module:electron-updater/out/AppUpdater.AppUpdater+setFeedURL). */ readonly token?: string | null + + /** + * Whether to use private github auto-update provider if `GH_TOKEN` environment variable is set. + * @see https://github.com/electron-userland/electron-builder/wiki/Auto-Update#private-github-update-repo + */ + readonly private?: boolean | null } export function githubUrl(options: GithubOptions) { diff --git a/packages/electron-builder/src/publish/PublishManager.ts b/packages/electron-builder/src/publish/PublishManager.ts index 3e013055e18..6af5a3cd0d9 100644 --- a/packages/electron-builder/src/publish/PublishManager.ts +++ b/packages/electron-builder/src/publish/PublishManager.ts @@ -503,6 +503,9 @@ async function getResolvedPublishConfig(packager: PlatformPackager, options } if (isGithub) { + if (options.token != null && !(options).private) { + warn('"token" specified in the github publish options. It should be used only for [setFeedURL](module:electron-updater/out/AppUpdater.AppUpdater+setFeedURL).') + } return Object.assign({owner, repo: project}, options) } else { diff --git a/packages/electron-updater/src/AppUpdater.ts b/packages/electron-updater/src/AppUpdater.ts index 3a7bd61cc97..b779007ed62 100644 --- a/packages/electron-updater/src/AppUpdater.ts +++ b/packages/electron-updater/src/AppUpdater.ts @@ -277,7 +277,7 @@ function createClient(data: string | PublishConfiguration) { switch (provider) { case "github": const githubOptions = data - const token = process.env.GH_TOKEN || githubOptions.token + const token = (githubOptions.private ? process.env.GH_TOKEN : null) || githubOptions.token if (token == null) { return new GitHubProvider(githubOptions) }