From 157c730faec12df6bb4fd3a0e0846b4bf613314c Mon Sep 17 00:00:00 2001 From: develar Date: Wed, 14 Jun 2017 07:24:47 +0200 Subject: [PATCH] refactor: mark some members as internal --- .idea/electron-builder.iml | 1 + docs/Options.md | 6 +- docs/Publishing Artifacts.md | 2 +- docs/api/electron-builder-core.md | 24 ++-- docs/api/electron-builder-util.md | 4 +- docs/api/electron-builder.md | 123 +++++++----------- docs/api/electron-publish.md | 6 +- package.json | 6 +- packages/electron-builder-util/package.json | 2 +- packages/electron-builder/src/builder.ts | 10 +- .../src/cli/create-self-signed-cert.ts | 1 + .../src/cli/install-app-deps.ts | 2 + packages/electron-builder/src/packager.ts | 5 +- .../src/packager/dirPackager.ts | 2 + packages/electron-builder/src/packager/mac.ts | 2 + .../electron-builder/src/repositoryInfo.ts | 4 +- packages/tsconfig-base.json | 6 +- test/src/BuildTest.ts | 3 +- yarn.lock | 36 +++-- 19 files changed, 110 insertions(+), 135 deletions(-) diff --git a/.idea/electron-builder.iml b/.idea/electron-builder.iml index 383bc5b8228..cdea3c1d2d5 100644 --- a/.idea/electron-builder.iml +++ b/.idea/electron-builder.iml @@ -25,6 +25,7 @@ + diff --git a/docs/Options.md b/docs/Options.md index 4e469425587..2b78b36597f 100644 --- a/docs/Options.md +++ b/docs/Options.md @@ -146,7 +146,7 @@ Configuration Options * **`name`** String - The name. e.g. `IRC server URL`. * **`schemes`** Array<String> - The schemes. e.g. `["irc", "ircs"]`. * `role` = `Editor` "Editor" | "Viewer" | "Shell" | "None" - *macOS-only* The app’s role with respect to the type. -* `compression` = `normal` "undefined" | "undefined" | "undefined" - The compression level. If you want to rapidly test build, `store` can reduce build time significantly. +* `compression` = `normal` "store" | "normal" | "maximum" - The compression level. If you want to rapidly test build, `store` can reduce build time significantly. * `afterPack` callback - *programmatic API only* The function to be run after pack (but before pack into distributable format and sign). Promise must be returned. * `beforeBuild` callback - *programmatic API only* The function to be run before dependencies are installed or rebuilt. Works when `npmRebuild` is set to `true`. Promise must be returned. Resolving to `false` will skip dependencies install or rebuild. * `npmRebuild` = `true` Boolean - Whether to [rebuild](https://docs.npmjs.com/cli/rebuild) native dependencies (`npm rebuild`) before starting to package the app. @@ -173,7 +173,7 @@ Configuration Options For example, `"category": "public.app-category.developer-tools"` will set the application category to *Developer Tools*. Valid values are listed in [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/TP40009250-SW8). - * `target` Array<[TargetConfig](electron-builder-core#TargetConfig) | "undefined" | "undefined" | "undefined" | "undefined" | "undefined" | "undefined" | "undefined" | "undefined" | "undefined" | "undefined" | "undefined" | "undefined"> | "undefined" | "undefined" | "undefined" | "undefined" | "undefined" | "undefined" | "undefined" | "undefined" | "undefined" | "undefined" | "undefined" | "undefined" | [TargetConfig](electron-builder-core#TargetConfig) - The target package type: list of `default`, `dmg`, `mas`, `pkg`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`. Defaults to `default` (dmg and zip for Squirrel.Mac). + * `target` Array<[TargetConfig](electron-builder-core#TargetConfig) | "default" | "dmg" | "mas" | "mas-dev" | "pkg" | "7z" | "zip" | "tar.xz" | "tar.lz" | "tar.gz" | "tar.bz2" | "dir"> | "default" | "dmg" | "mas" | "mas-dev" | "pkg" | "7z" | "zip" | "tar.xz" | "tar.lz" | "tar.gz" | "tar.bz2" | "dir" | [TargetConfig](electron-builder-core#TargetConfig) - The target package type: list of `default`, `dmg`, `mas`, `pkg`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`. Defaults to `default` (dmg and zip for Squirrel.Mac). * `identity` String - The name of certificate to use when signing. Consider using environment variables [CSC_LINK or CSC_NAME](https://github.com/electron-userland/electron-builder/wiki/Code-Signing) instead of specifying this option. MAS installer identity is specified in the [mas](#MasBuildOptions-identity). * `icon` = `build/icon.icns` String - The path to application icon. * `entitlements` String - The path to entitlements file for signing the app. `build/entitlements.mac.plist` will be used if exists (it is a recommended way to set). MAS entitlements is specified in the [mas](#MasBuildOptions-entitlements). @@ -216,7 +216,7 @@ Configuration Options * `target` = `nsis` String | [TargetConfig](electron-builder-core#TargetConfig) | Array - Target package type: list of `nsis`, `nsis-web` (Web installer), `portable` (portable app without installation), `appx`, `squirrel`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`. AppX package can be built only on Windows 10. To use Squirrel.Windows please install `electron-builder-squirrel-windows` dependency. - * `signingHashAlgorithms` = `['sha1', 'sha256']` Array<"undefined" | "undefined"> - Array of signing algorithms used. For AppX `sha256` is always used. + * `signingHashAlgorithms` = `['sha1', 'sha256']` Array<"sha1" | "sha256"> - Array of signing algorithms used. For AppX `sha256` is always used. * `icon` = `build/icon.ico` String - The path to application icon. * `legalTrademarks` String - The trademarks and registered trademarks. * `certificateFile` String - The path to the *.pfx certificate you want to sign with. Please use it only if you cannot use env variable `CSC_LINK` (`WIN_CSC_LINK`) for some reason. Please see [Code Signing](https://github.com/electron-userland/electron-builder/wiki/Code-Signing). diff --git a/docs/Publishing Artifacts.md b/docs/Publishing Artifacts.md index b6ec9ba3295..9fb83bc8cde 100644 --- a/docs/Publishing Artifacts.md +++ b/docs/Publishing Artifacts.md @@ -147,7 +147,7 @@ If `BT_TOKEN` is set and `GH_TOKEN` is not set — defaults to `[{provider: "bin | Name | Type | Description | | --- | --- | --- | -| **provider**| "undefined" \| "undefined" \| "undefined" \| "undefined" | The provider. | +| **provider**| "github" \| "bintray" \| "s3" \| "generic" | The provider. | | owner| String \| null | The owner. | diff --git a/docs/api/electron-builder-core.md b/docs/api/electron-builder-core.md index 3ead0c50059..67cbdc95005 100644 --- a/docs/api/electron-builder-core.md +++ b/docs/api/electron-builder-core.md @@ -8,7 +8,7 @@ * [`.TargetConfig`](#TargetConfig) * [`.TargetSpecificOptions`](#TargetSpecificOptions) * [.Platform](#Platform) - * [`.createTarget(type, archs)`](#module_electron-builder-core.Platform+createTarget) ⇒ Map<[Platform](#Platform) \| Map<"undefined" \| "undefined" \| "undefined" \| 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 @@ -16,9 +16,9 @@ * [`.build(appOutDir, arch)`](#module_electron-builder-core.Target+build) ⇒ Promise<any> * [`.finishBuild()`](#module_electron-builder-core.Target+finishBuild) ⇒ Promise<any> * [`.Arch`](#Arch) : enum - * [`.archFromString(name)`](#module_electron-builder-core.archFromString) ⇒ "undefined" \| "undefined" \| "undefined" + * [`.archFromString(name)`](#module_electron-builder-core.archFromString) ⇒ [Arch](#Arch) * [`.getArchSuffix(arch)`](#module_electron-builder-core.getArchSuffix) ⇒ String - * [`.toLinuxArchString(arch)`](#module_electron-builder-core.toLinuxArchString) ⇒ "undefined" \| "undefined" \| "undefined" + * [`.toLinuxArchString(arch)`](#module_electron-builder-core.toLinuxArchString) ⇒ "armv7l" \| "i386" \| "amd64" @@ -55,7 +55,7 @@ | Name | Type | Description | | --- | --- | --- | | **target**| String | The target name. e.g. `snap`. | -| arch| Array<"undefined" \| "undefined" \| "undefined"> \| String | The arch or list of archs. | +| arch| Array<"x64" \| "ia32" \| "armv7l"> \| String | The arch or list of archs. | @@ -83,20 +83,20 @@ * [.Platform](#Platform) - * [`.createTarget(type, archs)`](#module_electron-builder-core.Platform+createTarget) ⇒ Map<[Platform](#Platform) \| Map<"undefined" \| "undefined" \| "undefined" \| 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 -#### `platform.createTarget(type, archs)` ⇒ Map<[Platform](#Platform) \| Map<"undefined" \| "undefined" \| "undefined" \| Array<String>>> +#### `platform.createTarget(type, archs)` ⇒ Map<[Platform](#Platform) \| Map<[Arch](#Arch) \| Array<String>>> **Kind**: instance method of [Platform](#Platform) | Param | Type | | --- | --- | | type | String \| Array<String> \| null | -| archs | Array<"undefined" \| "undefined" \| "undefined"> | +| archs | Array<[Arch](#Arch)> | @@ -139,7 +139,7 @@ | Param | Type | | --- | --- | | appOutDir | String | -| arch | "undefined" \| "undefined" \| "undefined" | +| arch | [Arch](#Arch) | @@ -159,7 +159,7 @@ -### `electron-builder-core.archFromString(name)` ⇒ "undefined" \| "undefined" \| "undefined" +### `electron-builder-core.archFromString(name)` ⇒ [Arch](#Arch) **Kind**: method of [electron-builder-core](#module_electron-builder-core) | Param | Type | @@ -173,14 +173,14 @@ | Param | Type | | --- | --- | -| arch | "undefined" \| "undefined" \| "undefined" | +| arch | [Arch](#Arch) | -### `electron-builder-core.toLinuxArchString(arch)` ⇒ "undefined" \| "undefined" \| "undefined" +### `electron-builder-core.toLinuxArchString(arch)` ⇒ "armv7l" \| "i386" \| "amd64" **Kind**: method of [electron-builder-core](#module_electron-builder-core) | Param | Type | | --- | --- | -| arch | "undefined" \| "undefined" \| "undefined" | +| arch | [Arch](#Arch) | diff --git a/docs/api/electron-builder-util.md b/docs/api/electron-builder-util.md index 23ca3fbdb58..85390f97d3f 100644 --- a/docs/api/electron-builder-util.md +++ b/docs/api/electron-builder-util.md @@ -406,7 +406,7 @@ ensureDir is not called, dest parent dir must exists * [`.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) ⇒ Boolean - * [`.isPullRequest()`](#module_electron-builder-util.isPullRequest) ⇒ "undefined" \| "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> @@ -572,7 +572,7 @@ ensureDir is not called, dest parent dir must exists -### `electron-builder-util.isPullRequest()` ⇒ "undefined" \| "undefined" \| "undefined" +### `electron-builder-util.isPullRequest()` ⇒ "undefined" \| "undefined" \| "" **Kind**: method of [electron-builder-util](#module_electron-builder-util) diff --git a/docs/api/electron-builder.md b/docs/api/electron-builder.md index c7b08fce289..5e3151e4121 100644 --- a/docs/api/electron-builder.md +++ b/docs/api/electron-builder.md @@ -8,16 +8,12 @@
electron-builder/out/appInfo
-
electron-builder/out/builder
-
electron-builder/out/codeSign
electron-builder/out/linuxPackager
electron-builder/out/macPackager
-
electron-builder/out/packager/mac
-
electron-builder/out/packager
electron-builder/out/platformPackager
@@ -76,7 +72,7 @@ * [`.dispatchArtifactCreated(event)`](#module_electron-builder.Packager+dispatchArtifactCreated) * [`.build(rawOptions)`](#module_electron-builder.build) ⇒ Promise<Array<String>> * [`.buildForge(forgeOptions, options)`](#module_electron-builder.buildForge) ⇒ Promise<Array<String>> - * [`.createTargets(platforms, type, arch)`](#module_electron-builder.createTargets) ⇒ Map<[Platform](electron-builder-core#Platform) \| Map<"undefined" \| "undefined" \| "undefined" \| Array<String>>> + * [`.createTargets(platforms, type, arch)`](#module_electron-builder.createTargets) ⇒ Map<[Platform](electron-builder-core#Platform) \| Map<[Arch](electron-builder-core#Arch) \| Array<String>>> @@ -89,7 +85,7 @@ | **appOutDir**| String | | **packager**| [PlatformPackager](#PlatformPackager)<any> | | **electronPlatformName**| String | -| **arch**| "undefined" \| "undefined" \| "undefined" | +| **arch**| [Arch](electron-builder-core#Arch) | | **targets**| Array<[Target](electron-builder-core#Target)> | @@ -102,7 +98,7 @@ | --- | --- | | **packager**| [PlatformPackager](#PlatformPackager)<any> | | target| [Target](electron-builder-core#Target) \| null | -| arch| "undefined" \| "undefined" \| "undefined" \| null | +| arch| [Arch](electron-builder-core#Arch) \| null | | file| String | | data| Buffer | | safeArtifactName| String | @@ -332,7 +328,7 @@ -### `electron-builder.createTargets(platforms, type, arch)` ⇒ Map<[Platform](electron-builder-core#Platform) \| Map<"undefined" \| "undefined" \| "undefined" \| Array<String>>> +### `electron-builder.createTargets(platforms, type, arch)` ⇒ Map<[Platform](electron-builder-core#Platform) \| Map<[Arch](electron-builder-core#Arch) \| Array<String>>> **Kind**: method of [electron-builder](Options#module_electron-builder) | Param | Type | @@ -373,9 +369,6 @@ #### `appInfo.computePackageUrl()` ⇒ Promise< \| String> **Kind**: instance method of [AppInfo](#AppInfo) - - -## electron-builder/out/builder ## electron-builder/out/codeSign @@ -445,7 +438,7 @@ | Param | Type | | --- | --- | -| certType | "undefined" \| "undefined" \| "undefined" \| "undefined" \| "undefined" | +| 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 | @@ -535,7 +528,7 @@ | Param | Type | | --- | --- | | ext | String | -| arch | "undefined" \| "undefined" \| "undefined" \| null | +| arch | [Arch](electron-builder-core#Arch) \| null | | skipArchIfX64 | | @@ -556,7 +549,7 @@ | --- | --- | | file | String | | target | [Target](electron-builder-core#Target) \| null | -| arch | "undefined" \| "undefined" \| "undefined" \| null | +| arch | [Arch](electron-builder-core#Arch) \| null | | safeArtifactName | String | @@ -586,7 +579,7 @@ | --- | --- | | targetSpecificOptions | [TargetSpecificOptions](electron-builder-core#TargetSpecificOptions) \| undefined \| null | | ext | String | -| arch | "undefined" \| "undefined" \| "undefined" \| null | +| arch | [Arch](electron-builder-core#Arch) \| null | | defaultPattern | String | | skipArchIfX64 | | @@ -609,7 +602,7 @@ | Param | Type | | --- | --- | | ext | String \| null | -| arch | "undefined" \| "undefined" \| "undefined" | +| arch | [Arch](electron-builder-core#Arch) | | deployment | Boolean | | classifier | String \| null | @@ -645,7 +638,7 @@ | Param | Type | | --- | --- | | outDir | String | -| arch | "undefined" \| "undefined" \| "undefined" | +| arch | [Arch](electron-builder-core#Arch) | | targets | Array<[Target](electron-builder-core#Target)> | | postAsyncTasks | Array<Promise<any>> | @@ -778,7 +771,7 @@ | Param | Type | | --- | --- | | outDir | String | -| arch | "undefined" \| "undefined" \| "undefined" | +| arch | [Arch](electron-builder-core#Arch) | | targets | Array<[Target](electron-builder-core#Target)> | | postAsyncTasks | Array<Promise<any>> | @@ -790,7 +783,7 @@ | Param | Type | | --- | --- | | ext | String | -| arch | "undefined" \| "undefined" \| "undefined" \| null | +| arch | [Arch](electron-builder-core#Arch) \| null | | skipArchIfX64 | | @@ -811,7 +804,7 @@ | --- | --- | | file | String | | target | [Target](electron-builder-core#Target) \| null | -| arch | "undefined" \| "undefined" \| "undefined" \| null | +| arch | [Arch](electron-builder-core#Arch) \| null | | safeArtifactName | String | @@ -823,7 +816,7 @@ | --- | --- | | targetSpecificOptions | [TargetSpecificOptions](electron-builder-core#TargetSpecificOptions) \| undefined \| null | | ext | String | -| arch | "undefined" \| "undefined" \| "undefined" \| null | +| arch | [Arch](electron-builder-core#Arch) \| null | | defaultPattern | String | | skipArchIfX64 | | @@ -846,7 +839,7 @@ | Param | Type | | --- | --- | | ext | String \| null | -| arch | "undefined" \| "undefined" \| "undefined" | +| arch | [Arch](electron-builder-core#Arch) | | deployment | Boolean | | classifier | String \| null | @@ -898,34 +891,6 @@ | --- | --- | | suffix | String | - - -## electron-builder/out/packager/mac - -* [electron-builder/out/packager/mac](#module_electron-builder/out/packager/mac) - * [`.createApp(packager, appOutDir, asarIntegrity)`](#module_electron-builder/out/packager/mac.createApp) ⇒ Promise<void> - * [`.filterCFBundleIdentifier(identifier)`](#module_electron-builder/out/packager/mac.filterCFBundleIdentifier) ⇒ String - - - -### `electron-builder/out/packager/mac.createApp(packager, appOutDir, asarIntegrity)` ⇒ Promise<void> -**Kind**: method of [electron-builder/out/packager/mac](#module_electron-builder/out/packager/mac) - -| Param | Type | -| --- | --- | -| packager | [PlatformPackager](#PlatformPackager)<any> | -| appOutDir | String | -| asarIntegrity | module:asar-integrity.AsarIntegrity | - - - -### `electron-builder/out/packager/mac.filterCFBundleIdentifier(identifier)` ⇒ String -**Kind**: method of [electron-builder/out/packager/mac](#module_electron-builder/out/packager/mac) - -| Param | Type | -| --- | --- | -| identifier | String | - ## electron-builder/out/packager @@ -980,9 +945,9 @@ | appInfo| [AppInfo](#AppInfo) | | **defaultTarget**| Array<String> | | **relativeBuildResourcesDirname**| String | -| **electronDistMacOsAppName**| "undefined" \| "undefined" | -| **electronDistExecutableName**| "undefined" \| "undefined" | -| **electronDistMacOsExecutableName**| "undefined" \| "undefined" | +| **electronDistMacOsAppName**| "Electron.app" \| "Brave.app" | +| **electronDistExecutableName**| "electron" \| "brave" | +| **electronDistMacOsExecutableName**| "Electron" \| "Brave" | | **fileAssociations**| Array<[FileAssociation](Options#FileAssociation)> | | **forceCodeSigning**| Boolean | @@ -1013,7 +978,7 @@ | Param | Type | | --- | --- | | ext | String | -| arch | "undefined" \| "undefined" \| "undefined" \| null | +| arch | [Arch](electron-builder-core#Arch) \| null | | skipArchIfX64 | | @@ -1045,7 +1010,7 @@ | --- | --- | | file | String | | target | [Target](electron-builder-core#Target) \| null | -| arch | "undefined" \| "undefined" \| "undefined" \| null | +| arch | [Arch](electron-builder-core#Arch) \| null | | safeArtifactName | String | @@ -1075,7 +1040,7 @@ | --- | --- | | targetSpecificOptions | [TargetSpecificOptions](electron-builder-core#TargetSpecificOptions) \| undefined \| null | | ext | String | -| arch | "undefined" \| "undefined" \| "undefined" \| null | +| arch | [Arch](electron-builder-core#Arch) \| null | | defaultPattern | String | | skipArchIfX64 | | @@ -1098,7 +1063,7 @@ | Param | Type | | --- | --- | | ext | String \| null | -| arch | "undefined" \| "undefined" \| "undefined" | +| arch | [Arch](electron-builder-core#Arch) | | deployment | Boolean | | classifier | String \| null | @@ -1134,7 +1099,7 @@ | Param | Type | | --- | --- | | outDir | String | -| arch | "undefined" \| "undefined" \| "undefined" | +| arch | [Arch](electron-builder-core#Arch) | | targets | Array<[Target](electron-builder-core#Target)> | | postAsyncTasks | Array<Promise<any>> | @@ -1245,7 +1210,7 @@ | --- | --- | | packager | [PlatformPackager](#PlatformPackager)<any> | | targetSpecificOptions | [PlatformSpecificBuildOptions](#PlatformSpecificBuildOptions) \| null \| undefined | -| arch | "undefined" \| "undefined" \| "undefined" \| null | +| arch | [Arch](electron-builder-core#Arch) \| null | @@ -1256,7 +1221,7 @@ | --- | --- | | packager | [PlatformPackager](#PlatformPackager)<any> | | publishConfigs | Array<[PublishConfiguration](Publishing-Artifacts#PublishConfiguration)> \| null | -| arch | "undefined" \| "undefined" \| "undefined" \| null | +| arch | [Arch](electron-builder-core#Arch) \| null | @@ -1285,7 +1250,7 @@ | Param | Type | | --- | --- | | appOutDir | String | -| arch | "undefined" \| "undefined" \| "undefined" | +| arch | [Arch](electron-builder-core#Arch) | @@ -1315,7 +1280,7 @@ | Param | Type | | --- | --- | | appOutDir | String | -| arch | "undefined" \| "undefined" \| "undefined" | +| arch | [Arch](electron-builder-core#Arch) | @@ -1353,7 +1318,7 @@ | Param | Type | | --- | --- | | appOutDir | String | -| arch | "undefined" \| "undefined" \| "undefined" | +| arch | [Arch](electron-builder-core#Arch) | @@ -1391,7 +1356,7 @@ | Param | Type | | --- | --- | | appPath | String | -| arch | "undefined" \| "undefined" \| "undefined" | +| arch | [Arch](electron-builder-core#Arch) | @@ -1444,7 +1409,7 @@ | Param | Type | | --- | --- | | appOutDir | String | -| arch | "undefined" \| "undefined" \| "undefined" | +| arch | [Arch](electron-builder-core#Arch) | @@ -1524,7 +1489,7 @@ | Param | Type | | --- | --- | -| arch | "undefined" \| "undefined" \| "undefined" | +| arch | [Arch](electron-builder-core#Arch) | | target | [NsisTarget](#NsisTarget) | @@ -1552,7 +1517,7 @@ | Param | Type | | --- | --- | | appOutDir | String | -| arch | "undefined" \| "undefined" \| "undefined" | +| arch | [Arch](electron-builder-core#Arch) | @@ -1586,7 +1551,7 @@ | Param | Type | | --- | --- | | appPath | String | -| arch | "undefined" \| "undefined" \| "undefined" | +| arch | [Arch](electron-builder-core#Arch) | @@ -1625,7 +1590,7 @@ | Param | Type | | --- | --- | | appOutDir | String | -| arch | "undefined" \| "undefined" \| "undefined" | +| arch | [Arch](electron-builder-core#Arch) | @@ -1634,7 +1599,7 @@ * [electron-builder/out/targets/targetFactory](#module_electron-builder/out/targets/targetFactory) * [.NoOpTarget](#NoOpTarget) ⇐ [Target](electron-builder-core#Target) * [`.build(appOutDir, arch)`](#module_electron-builder/out/targets/targetFactory.NoOpTarget+build) ⇒ Promise<any> - * [`.computeArchToTargetNamesMap(raw, options, platform)`](#module_electron-builder/out/targets/targetFactory.computeArchToTargetNamesMap) ⇒ Map<"undefined" \| "undefined" \| "undefined" \| Array<String>> + * [`.computeArchToTargetNamesMap(raw, options, platform)`](#module_electron-builder/out/targets/targetFactory.computeArchToTargetNamesMap) ⇒ Map<[Arch](electron-builder-core#Arch) \| Array<String>> * [`.createCommonTarget(target, outDir, packager)`](#module_electron-builder/out/targets/targetFactory.createCommonTarget) ⇒ [Target](electron-builder-core#Target) * [`.createTargets(nameToTarget, rawList, outDir, packager, cleanupTasks)`](#module_electron-builder/out/targets/targetFactory.createTargets) ⇒ Array<[Target](electron-builder-core#Target)> @@ -1658,16 +1623,16 @@ | Param | Type | | --- | --- | | appOutDir | String | -| arch | "undefined" \| "undefined" \| "undefined" | +| arch | [Arch](electron-builder-core#Arch) | -### `electron-builder/out/targets/targetFactory.computeArchToTargetNamesMap(raw, options, platform)` ⇒ Map<"undefined" \| "undefined" \| "undefined" \| Array<String>> +### `electron-builder/out/targets/targetFactory.computeArchToTargetNamesMap(raw, options, platform)` ⇒ Map<[Arch](electron-builder-core#Arch) \| Array<String>> **Kind**: method of [electron-builder/out/targets/targetFactory](#module_electron-builder/out/targets/targetFactory) | Param | Type | | --- | --- | -| raw | Map<"undefined" \| "undefined" \| "undefined" \| Array<String>> | +| raw | Map<[Arch](electron-builder-core#Arch) \| Array<String>> | | options | [PlatformSpecificBuildOptions](#PlatformSpecificBuildOptions) | | platform | [Platform](electron-builder-core#Platform) | @@ -1728,7 +1693,7 @@ | Param | Type | | --- | --- | | appOutDir | String | -| arch | "undefined" \| "undefined" \| "undefined" | +| arch | [Arch](electron-builder-core#Arch) | @@ -1973,7 +1938,7 @@ | Param | Type | | --- | --- | | ext | String | -| arch | "undefined" \| "undefined" \| "undefined" \| null | +| arch | [Arch](electron-builder-core#Arch) \| null | | skipArchIfX64 | | @@ -1994,7 +1959,7 @@ | --- | --- | | file | String | | target | [Target](electron-builder-core#Target) \| null | -| arch | "undefined" \| "undefined" \| "undefined" \| null | +| arch | [Arch](electron-builder-core#Arch) \| null | | safeArtifactName | String | @@ -2024,7 +1989,7 @@ | --- | --- | | targetSpecificOptions | [TargetSpecificOptions](electron-builder-core#TargetSpecificOptions) \| undefined \| null | | ext | String | -| arch | "undefined" \| "undefined" \| "undefined" \| null | +| arch | [Arch](electron-builder-core#Arch) \| null | | defaultPattern | String | | skipArchIfX64 | | @@ -2047,7 +2012,7 @@ | Param | Type | | --- | --- | | ext | String \| null | -| arch | "undefined" \| "undefined" \| "undefined" | +| arch | [Arch](electron-builder-core#Arch) | | deployment | Boolean | | classifier | String \| null | @@ -2079,7 +2044,7 @@ | Param | Type | | --- | --- | | outDir | String | -| arch | "undefined" \| "undefined" \| "undefined" | +| arch | [Arch](electron-builder-core#Arch) | | targets | Array<[Target](electron-builder-core#Target)> | | postAsyncTasks | Array<Promise<any>> | diff --git a/docs/api/electron-publish.md b/docs/api/electron-publish.md index dd564625e58..5808021d74e 100644 --- a/docs/api/electron-publish.md +++ b/docs/api/electron-publish.md @@ -33,7 +33,7 @@ | Name | Type | | --- | --- | -| providerName = Bintray| "undefined" | +| providerName = Bintray| "Bintray" | * [.BintrayPublisher](#BintrayPublisher) ⇐ [HttpPublisher](#HttpPublisher) @@ -108,7 +108,7 @@ | Name | Type | | --- | --- | -| providerName = GitHub| "undefined" | +| providerName = GitHub| "GitHub" | * [.GitHubPublisher](#GitHubPublisher) ⇐ [HttpPublisher](#HttpPublisher) @@ -310,7 +310,7 @@ A ratio of 0.5 will attempt to set the progress to halfway. | Name | Type | | --- | --- | -| publish| "undefined" \| "undefined" \| "undefined" \| "undefined" \| null | +| publish| "onTag" \| "onTagOrDraft" \| "always" \| "never" \| null | | draft| Boolean | | prerelease| Boolean | diff --git a/package.json b/package.json index 1c3b0a381c1..685d90674d8 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "ajv": "^5.1.5", "ajv-keywords": "^2.1.0", "archiver": "^1.3.0", - "aws-sdk": "^2.68.0", + "aws-sdk": "^2.69.0", "bluebird-lst": "^1.0.2", "chalk": "^1.1.3", "chromium-pickle-js": "^0.2.0", @@ -40,7 +40,7 @@ "electron-download-tf": "4.3.1", "electron-is-dev": "^0.1.2", "electron-osx-sign": "0.4.6", - "fcopy-pre-bundled": "0.2.0", + "fcopy-pre-bundled": "0.3.1", "fs-extra-p": "^4.3.0", "hosted-git-info": "^2.4.2", "ini": "^1.3.4", @@ -58,7 +58,7 @@ "sanitize-filename": "^1.6.1", "semver": "^5.3.0", "stat-mode": "^0.2.2", - "ts-jsdoc": "^1.3.1", + "ts-jsdoc": "^2.0.0", "tunnel-agent": "^0.6.0", "update-notifier": "^2.2.0", "uuid-1345": "^0.99.6", diff --git a/packages/electron-builder-util/package.json b/packages/electron-builder-util/package.json index dc40ac5db1e..00df3ab48f0 100644 --- a/packages/electron-builder-util/package.json +++ b/packages/electron-builder-util/package.json @@ -12,7 +12,7 @@ ], "dependencies": { "fs-extra-p": "^4.3.0", - "fcopy-pre-bundled": "0.2.0", + "fcopy-pre-bundled": "0.3.1", "is-ci": "^1.0.10", "stat-mode": "^0.2.2", "bluebird-lst": "^1.0.2", diff --git a/packages/electron-builder/src/builder.ts b/packages/electron-builder/src/builder.ts index d3ec1a7f98e..684d4f4dd31 100644 --- a/packages/electron-builder/src/builder.ts +++ b/packages/electron-builder/src/builder.ts @@ -31,7 +31,10 @@ export interface CliOptions extends PackagerOptions, PublishOptions { project?: string } -/** @private */ +/** + * @private + * @internal + */ export function normalizeOptions(args: CliOptions): BuildOptions { if (args.targets != null) { return args @@ -215,7 +218,10 @@ export async function build(rawOptions?: CliOptions): Promise> { }) } -/** @private */ +/** + * @private + * @internal + */ export function configureBuildCommand(yargs: yargs.Yargs): yargs.Yargs { const publishGroup = "Publishing:" const buildGroup = "Building:" diff --git a/packages/electron-builder/src/cli/create-self-signed-cert.ts b/packages/electron-builder/src/cli/create-self-signed-cert.ts index fc5dad24f7b..659e8f6ac6e 100644 --- a/packages/electron-builder/src/cli/create-self-signed-cert.ts +++ b/packages/electron-builder/src/cli/create-self-signed-cert.ts @@ -9,6 +9,7 @@ import sanitizeFileName from "sanitize-filename" import { quoteString } from "../targets/appx" import { getSignVendorPath } from "../windowsCodeSign" +/** @internal */ export async function createSelfSignedCert(publisher: string) { const tmpDir = new TmpDir() const targetDir = process.cwd() diff --git a/packages/electron-builder/src/cli/install-app-deps.ts b/packages/electron-builder/src/cli/install-app-deps.ts index cdb1bfc95e1..1e20af8ada7 100644 --- a/packages/electron-builder/src/cli/install-app-deps.ts +++ b/packages/electron-builder/src/cli/install-app-deps.ts @@ -12,6 +12,7 @@ declare const PACKAGE_VERSION: string // https://github.com/yargs/yargs/issues/760 // demandOption is required to be set +/** @internal */ export function configureInstallAppDepsCommand(yargs: yargs.Yargs): yargs.Yargs { return yargs .option("platform", { @@ -26,6 +27,7 @@ export function configureInstallAppDepsCommand(yargs: yargs.Yargs): yargs.Yargs }) } +/** @internal */ export async function installAppDeps(args: any) { try { log("electron-builder " + PACKAGE_VERSION) diff --git a/packages/electron-builder/src/packager.ts b/packages/electron-builder/src/packager.ts index d3762f50d97..2b4be393491 100644 --- a/packages/electron-builder/src/packager.ts +++ b/packages/electron-builder/src/packager.ts @@ -255,8 +255,9 @@ export class Packager implements BuildInfo { const targetList = createTargets(nameToTarget, targetNames.length === 0 ? packager.defaultTarget : targetNames, outDir, packager, cleanupTasks) const ourDirs = new Set() for (const target of targetList) { - if (!(target instanceof NoOpTarget) && !createdOutDirs.has(target.outDir)) { - ourDirs.add(target.outDir) + const outDir = target.outDir + if (!createdOutDirs.has(outDir) && !(target instanceof NoOpTarget)) { + ourDirs.add(outDir) } } diff --git a/packages/electron-builder/src/packager/dirPackager.ts b/packages/electron-builder/src/packager/dirPackager.ts index c224693d079..7fb797b454c 100644 --- a/packages/electron-builder/src/packager/dirPackager.ts +++ b/packages/electron-builder/src/packager/dirPackager.ts @@ -32,10 +32,12 @@ function subOptionWarning (properties: any, optionName: any, parameter: any, val properties[parameter] = value } +/** @internal */ export function unpackElectron(packager: PlatformPackager, out: string, platform: string, arch: string, version: string) { return unpack(packager, out, platform, createDownloadOpts(packager.config, platform, arch, version)) } +/** @internal */ export function unpackMuon(packager: PlatformPackager, out: string, platform: string, arch: string, version: string) { return unpack(packager, out, platform, Object.assign({ mirror: "https://github.com/brave/muon/releases/download/v", diff --git a/packages/electron-builder/src/packager/mac.ts b/packages/electron-builder/src/packager/mac.ts index ffb75d1f53b..ea39a9363ea 100644 --- a/packages/electron-builder/src/packager/mac.ts +++ b/packages/electron-builder/src/packager/mac.ts @@ -20,12 +20,14 @@ function moveHelpers(frameworksPath: string, appName: string, prefix: string) { }) } +/** @internal */ export function filterCFBundleIdentifier(identifier: string) { // Remove special characters and allow only alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.) // Apple documentation: https://developer.apple.com/library/mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070 return identifier.replace(/ /g, "-").replace(/[^a-zA-Z0-9.-]/g, "") } +/** @internal */ export async function createApp(packager: PlatformPackager, appOutDir: string, asarIntegrity: AsarIntegrity) { const appInfo = packager.appInfo const appFilename = appInfo.productFilename diff --git a/packages/electron-builder/src/repositoryInfo.ts b/packages/electron-builder/src/repositoryInfo.ts index 5c50ca98961..545d91a03cb 100644 --- a/packages/electron-builder/src/repositoryInfo.ts +++ b/packages/electron-builder/src/repositoryInfo.ts @@ -5,7 +5,7 @@ import * as path from "path" import { Metadata, RepositoryInfo } from "./metadata" export function getRepositoryInfo(projectDir: string, metadata?: Metadata, devMetadata?: Metadata): Promise { - return _getInfo(projectDir, (devMetadata == null ? null : devMetadata.repository) || (metadata == null ? null : metadata.repository)) + return _getInfo(projectDir, (devMetadata == null ? null : devMetadata.repository) || (metadata == null ? null : metadata.repository)) } async function getGitUrlFromGitConfig(projectDir: string): Promise { @@ -36,7 +36,7 @@ async function getGitUrlFromGitConfig(projectDir: string): Promise { +async function _getInfo(projectDir: string, repo?: RepositoryInfo | string | null): Promise { if (repo != null) { return parseRepositoryUrl(typeof repo === "string" ? repo : repo.url) } diff --git a/packages/tsconfig-base.json b/packages/tsconfig-base.json index 30b60eadaaa..86dda04a24e 100644 --- a/packages/tsconfig-base.json +++ b/packages/tsconfig-base.json @@ -2,18 +2,18 @@ "compilerOptions": { "module": "es2015", "target": "es2017", - "noImplicitAny": true, "newLine": "LF", "noEmitOnError": true, "inlineSources": true, "sourceMap": true, "noImplicitReturns": true, - "strictNullChecks": true, "noEmitHelpers": true, "noFallthroughCasesInSwitch": true, "noUnusedLocals": true, "skipLibCheck": true, "moduleResolution": "Node", - "baseUrl": "." + "baseUrl": ".", + "strict": true, + "stripInternal": true } } \ No newline at end of file diff --git a/test/src/BuildTest.ts b/test/src/BuildTest.ts index 02c81791862..bccd2150e69 100644 --- a/test/src/BuildTest.ts +++ b/test/src/BuildTest.ts @@ -2,7 +2,6 @@ import BluebirdPromise from "bluebird-lst" import { Arch, BuildOptions, createTargets, DIR_TARGET, Platform } from "electron-builder" import { walk } from "electron-builder-util/out/fs" import { readAsarJson } from "electron-builder/out/asar" -import { configureBuildCommand, normalizeOptions } from "electron-builder/out/builder" import { checkWineVersion } from "electron-builder/out/packager" import { move, outputJson } from "fs-extra-p" import * as path from "path" @@ -12,6 +11,8 @@ import { app, appTwo, appTwoThrows, assertPack, modifyPackageJson, packageJson } const linuxDirTarget = Platform.LINUX.createTarget(DIR_TARGET) test("cli", async () => { + // because these methods are internal + const { configureBuildCommand, normalizeOptions } = require("electron-builder/out/builder") const yargs = require("yargs") configureBuildCommand(yargs) diff --git a/yarn.lock b/yarn.lock index ad659a4b906..a80310831bd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -265,9 +265,9 @@ asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" -aws-sdk@^2.68.0: - version "2.68.0" - resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.68.0.tgz#9bad3135b31fa82be72a5985189a37aee70c6940" +aws-sdk@^2.69.0: + version "2.69.0" + resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.69.0.tgz#ae0cd12fda5e8cc7aa203229a80169167af15add" dependencies: buffer "5.0.6" crypto-browserify "1.0.9" @@ -1056,10 +1056,6 @@ dot-prop@^4.1.0: dependencies: is-obj "^1.0.0" -double-ended-queue@^2.1.0-0: - version "2.1.0-0" - resolved "https://registry.yarnpkg.com/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz#103d3527fd31528f40188130c841efdd78264e5c" - duplexer3@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" @@ -1231,9 +1227,9 @@ fb-watchman@^2.0.0: dependencies: bser "^2.0.0" -fcopy-pre-bundled@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/fcopy-pre-bundled/-/fcopy-pre-bundled-0.2.0.tgz#846195cb53cf0a987ca9ebee4d70f81277c10f8a" +fcopy-pre-bundled@0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/fcopy-pre-bundled/-/fcopy-pre-bundled-0.3.1.tgz#d7c5a171850a92cedd5370abe50976b013b1ed8d" feature-detect-es6@^1.3.1: version "1.3.1" @@ -3234,10 +3230,8 @@ test-value@^2.0.0, test-value@^2.1.0: typical "^2.6.0" throat@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/throat/-/throat-3.1.0.tgz#ef22d8855963b3fdc626d043508f24c4cdf7d3c3" - dependencies: - double-ended-queue "^2.1.0-0" + version "3.2.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-3.2.0.tgz#50cb0670edbc40237b9e347d7e1f88e4620af836" throttleit@0.0.2: version "0.0.2" @@ -3306,9 +3300,9 @@ ts-babel@^3.0.1: fs-extra-p "^4.3.0" source-map-support "^0.4.15" -ts-jsdoc@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/ts-jsdoc/-/ts-jsdoc-1.3.1.tgz#89f684d59332a62eeff3d33a663aaa6f13383974" +ts-jsdoc@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ts-jsdoc/-/ts-jsdoc-2.0.0.tgz#ac73a8e32870fda258546a82ed1d74275bcc09c3" dependencies: bluebird-lst "^1.0.2" chalk "^1.1.3" @@ -3356,8 +3350,8 @@ type-check@~0.3.2: prelude-ls "~1.1.2" typescript@next: - version "2.5.0-dev.20170613" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.5.0-dev.20170613.tgz#0819ffc7be1617b10728154dba65568ec454fd12" + version "2.5.0-dev.20170614" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.5.0-dev.20170614.tgz#eb77ed212a5e49ebc8392ba0a95713ef87d9f6f1" typescript@~2.1.5: version "2.1.6" @@ -3368,8 +3362,8 @@ typical@^2.4.2, typical@^2.6.0, typical@^2.6.1: resolved "https://registry.yarnpkg.com/typical/-/typical-2.6.1.tgz#5c080e5d661cbbe38259d2e70a3c7253e873881d" uglify-js@^2.6: - version "2.8.28" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.28.tgz#e335032df9bb20dcb918f164589d5af47f38834a" + version "2.8.29" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" dependencies: source-map "~0.5.1" yargs "~3.10.0"