app-builder-lib 25.0.5 → 25.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/codeSign/windowsCodeSign.d.ts +2 -31
- package/out/codeSign/windowsCodeSign.js +28 -246
- package/out/codeSign/windowsCodeSign.js.map +1 -1
- package/out/codeSign/windowsSignAzureManager.d.ts +12 -0
- package/out/codeSign/windowsSignAzureManager.js +81 -0
- package/out/codeSign/windowsSignAzureManager.js.map +1 -0
- package/out/codeSign/windowsSignToolManager.d.ts +53 -0
- package/out/codeSign/windowsSignToolManager.js +341 -0
- package/out/codeSign/windowsSignToolManager.js.map +1 -0
- package/out/configuration.d.ts +14 -12
- package/out/configuration.js.map +1 -1
- package/out/electron/electronVersion.js +3 -3
- package/out/electron/electronVersion.js.map +1 -1
- package/out/electron/electronWin.js +1 -1
- package/out/electron/electronWin.js.map +1 -1
- package/out/electron/injectFFMPEG.js +1 -1
- package/out/electron/injectFFMPEG.js.map +1 -1
- package/out/index.d.ts +5 -4
- package/out/index.js +4 -4
- package/out/index.js.map +1 -1
- package/out/macPackager.js +2 -1
- package/out/macPackager.js.map +1 -1
- package/out/options/winOptions.d.ts +89 -4
- package/out/options/winOptions.js.map +1 -1
- package/out/packager.d.ts +1 -1
- package/out/packager.js +12 -12
- package/out/packager.js.map +1 -1
- package/out/platformPackager.d.ts +4 -5
- package/out/platformPackager.js +4 -50
- package/out/platformPackager.js.map +1 -1
- package/out/publish/PublishManager.js +3 -3
- package/out/publish/PublishManager.js.map +1 -1
- package/out/targets/AppxTarget.js +6 -5
- package/out/targets/AppxTarget.js.map +1 -1
- package/out/targets/FpmTarget.js +1 -1
- package/out/targets/FpmTarget.js.map +1 -1
- package/out/targets/nsis/nsisOptions.d.ts +1 -2
- package/out/targets/nsis/nsisOptions.js.map +1 -1
- package/out/util/NodeModuleCopyHelper.js +2 -2
- package/out/util/NodeModuleCopyHelper.js.map +1 -1
- package/out/util/{config.d.ts → config/config.d.ts} +1 -1
- package/out/util/{config.js → config/config.js} +7 -7
- package/out/util/config/config.js.map +1 -0
- package/out/util/config/load.d.ts +21 -0
- package/out/util/config/load.js +128 -0
- package/out/util/config/load.js.map +1 -0
- package/out/util/packageDependencies.d.ts +1 -1
- package/out/util/packageDependencies.js +4 -2
- package/out/util/packageDependencies.js.map +1 -1
- package/out/util/resolve.d.ts +2 -0
- package/out/util/resolve.js +54 -0
- package/out/util/resolve.js.map +1 -0
- package/out/version.d.ts +1 -1
- package/out/version.js +1 -1
- package/out/version.js.map +1 -1
- package/out/winPackager.d.ts +6 -7
- package/out/winPackager.js +28 -103
- package/out/winPackager.js.map +1 -1
- package/package.json +15 -11
- package/scheme.json +150 -2
- package/out/util/config.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PlatformSpecificBuildOptions, TargetConfigType } from "../index";
|
|
2
|
-
import { CustomWindowsSign } from "../codeSign/
|
|
2
|
+
import { CustomWindowsSign } from "../codeSign/windowsSignToolManager";
|
|
3
3
|
export interface WindowsConfiguration extends PlatformSpecificBuildOptions {
|
|
4
4
|
/**
|
|
5
5
|
* The target package type: list of `nsis`, `nsis-web` (Web installer), `portable` ([portable](/configuration/nsis#portable) app without installation), `appx`, `msi`, `msi-wrapped`, `squirrel`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.
|
|
@@ -21,50 +21,67 @@ export interface WindowsConfiguration extends PlatformSpecificBuildOptions {
|
|
|
21
21
|
readonly legalTrademarks?: string | null;
|
|
22
22
|
/**
|
|
23
23
|
* Array of signing algorithms used. For AppX `sha256` is always used.
|
|
24
|
-
* @
|
|
24
|
+
* @deprecated Please use {@link signtoolOptions.signingHashAlgorithms}
|
|
25
25
|
*/
|
|
26
26
|
readonly signingHashAlgorithms?: Array<"sha1" | "sha256"> | null;
|
|
27
27
|
/**
|
|
28
|
-
* The custom function (or path to file or module id) to sign Windows
|
|
28
|
+
* The custom function (or path to file or module id) to sign Windows executables
|
|
29
|
+
* @deprecated Please use {@link signtoolOptions.sign}
|
|
29
30
|
*/
|
|
30
31
|
readonly sign?: CustomWindowsSign | string | null;
|
|
31
32
|
/**
|
|
32
33
|
* 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.
|
|
33
34
|
* Please see [Code Signing](/code-signing).
|
|
35
|
+
* @deprecated Please use {@link signtoolOptions.certificateFile}
|
|
34
36
|
*/
|
|
35
37
|
readonly certificateFile?: string | null;
|
|
36
38
|
/**
|
|
37
39
|
* The password to the certificate provided in `certificateFile`. Please use it only if you cannot use env variable `CSC_KEY_PASSWORD` (`WIN_CSC_KEY_PASSWORD`) for some reason.
|
|
38
40
|
* Please see [Code Signing](/code-signing).
|
|
41
|
+
* @deprecated Please use {@link signtoolOptions.certificatePassword}
|
|
39
42
|
*/
|
|
40
43
|
readonly certificatePassword?: string | null;
|
|
41
44
|
/**
|
|
42
45
|
* The name of the subject of the signing certificate, which is often labeled with the field name `issued to`. Required only for EV Code Signing and works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).
|
|
46
|
+
* @deprecated Please use {@link signtoolOptions.certificateSubjectName}
|
|
43
47
|
*/
|
|
44
48
|
readonly certificateSubjectName?: string | null;
|
|
45
49
|
/**
|
|
46
50
|
* The SHA1 hash of the signing certificate. The SHA1 hash is commonly specified when multiple certificates satisfy the criteria specified by the remaining switches. Works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).
|
|
51
|
+
* @deprecated Please use win.signtoolOptions.certificateSha1
|
|
47
52
|
*/
|
|
48
53
|
readonly certificateSha1?: string | null;
|
|
49
54
|
/**
|
|
50
55
|
* The path to an additional certificate file you want to add to the signature block.
|
|
56
|
+
* @deprecated Please use {@link signtoolOptions.additionalCertificateFile}
|
|
51
57
|
*/
|
|
52
58
|
readonly additionalCertificateFile?: string | null;
|
|
53
59
|
/**
|
|
54
60
|
* The URL of the RFC 3161 time stamp server.
|
|
55
61
|
* @default http://timestamp.digicert.com
|
|
62
|
+
* @deprecated Please use {@link signtoolOptions.rfc3161TimeStampServer}
|
|
56
63
|
*/
|
|
57
64
|
readonly rfc3161TimeStampServer?: string | null;
|
|
58
65
|
/**
|
|
59
66
|
* The URL of the time stamp server.
|
|
60
67
|
* @default http://timestamp.digicert.com
|
|
68
|
+
* @deprecated Please use {@link signtoolOptions.timeStampServer}
|
|
61
69
|
*/
|
|
62
70
|
readonly timeStampServer?: string | null;
|
|
63
71
|
/**
|
|
64
72
|
* [The publisher name](https://github.com/electron-userland/electron-builder/issues/1187#issuecomment-278972073), exactly as in your code signed certificate. Several names can be provided.
|
|
65
73
|
* Defaults to common name from your code signing certificate.
|
|
74
|
+
* @deprecated Please use {@link signtoolOptions.publisherName}
|
|
66
75
|
*/
|
|
67
76
|
readonly publisherName?: string | Array<string> | null;
|
|
77
|
+
/**
|
|
78
|
+
* Options for usage with signtool.exe
|
|
79
|
+
*/
|
|
80
|
+
readonly signtoolOptions?: WindowsSigntoolConfiguration | null;
|
|
81
|
+
/**
|
|
82
|
+
* Options for usage of Azure Trusted Signing (beta)
|
|
83
|
+
*/
|
|
84
|
+
readonly azureSignOptions?: WindowsAzureSigningConfiguration | null;
|
|
68
85
|
/**
|
|
69
86
|
* Whether to verify the signature of an available update before installation.
|
|
70
87
|
* The [publisher name](#publisherName) will be used for the signature verification.
|
|
@@ -87,7 +104,7 @@ export interface WindowsConfiguration extends PlatformSpecificBuildOptions {
|
|
|
87
104
|
* Whether to sign DLL files. Advanced option.
|
|
88
105
|
* @see https://github.com/electron-userland/electron-builder/issues/3101#issuecomment-404212384
|
|
89
106
|
* @default false
|
|
90
|
-
* @deprecated Use
|
|
107
|
+
* @deprecated Use {@link signExts} instead for more explicit control
|
|
91
108
|
*/
|
|
92
109
|
readonly signDlls?: boolean;
|
|
93
110
|
/**
|
|
@@ -98,3 +115,71 @@ export interface WindowsConfiguration extends PlatformSpecificBuildOptions {
|
|
|
98
115
|
readonly signExts?: string[] | null;
|
|
99
116
|
}
|
|
100
117
|
export type RequestedExecutionLevel = "asInvoker" | "highestAvailable" | "requireAdministrator";
|
|
118
|
+
export interface WindowsSigntoolConfiguration {
|
|
119
|
+
/**
|
|
120
|
+
* The custom function (or path to file or module id) to sign Windows executables
|
|
121
|
+
*/
|
|
122
|
+
readonly sign?: CustomWindowsSign | string | null;
|
|
123
|
+
/**
|
|
124
|
+
* Array of signing algorithms used. For AppX `sha256` is always used.
|
|
125
|
+
* @default ['sha1', 'sha256']
|
|
126
|
+
*/
|
|
127
|
+
readonly signingHashAlgorithms?: Array<"sha1" | "sha256"> | null;
|
|
128
|
+
/**
|
|
129
|
+
* 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.
|
|
130
|
+
* Please see [Code Signing](/code-signing).
|
|
131
|
+
*/
|
|
132
|
+
readonly certificateFile?: string | null;
|
|
133
|
+
/**
|
|
134
|
+
* The password to the certificate provided in `certificateFile`. Please use it only if you cannot use env variable `CSC_KEY_PASSWORD` (`WIN_CSC_KEY_PASSWORD`) for some reason.
|
|
135
|
+
* Please see [Code Signing](/code-signing).
|
|
136
|
+
*/
|
|
137
|
+
readonly certificatePassword?: string | null;
|
|
138
|
+
/**
|
|
139
|
+
* The name of the subject of the signing certificate, which is often labeled with the field name `issued to`. Required only for EV Code Signing and works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).
|
|
140
|
+
*/
|
|
141
|
+
readonly certificateSubjectName?: string | null;
|
|
142
|
+
/**
|
|
143
|
+
* The SHA1 hash of the signing certificate. The SHA1 hash is commonly specified when multiple certificates satisfy the criteria specified by the remaining switches. Works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).
|
|
144
|
+
*/
|
|
145
|
+
readonly certificateSha1?: string | null;
|
|
146
|
+
/**
|
|
147
|
+
* The path to an additional certificate file you want to add to the signature block.
|
|
148
|
+
*/
|
|
149
|
+
readonly additionalCertificateFile?: string | null;
|
|
150
|
+
/**
|
|
151
|
+
* The URL of the RFC 3161 time stamp server.
|
|
152
|
+
* @default http://timestamp.digicert.com
|
|
153
|
+
*/
|
|
154
|
+
readonly rfc3161TimeStampServer?: string | null;
|
|
155
|
+
/**
|
|
156
|
+
* The URL of the time stamp server.
|
|
157
|
+
* @default http://timestamp.digicert.com
|
|
158
|
+
*/
|
|
159
|
+
readonly timeStampServer?: string | null;
|
|
160
|
+
/**
|
|
161
|
+
* [The publisher name](https://github.com/electron-userland/electron-builder/issues/1187#issuecomment-278972073), exactly as in your code signed certificate. Several names can be provided.
|
|
162
|
+
* Defaults to common name from your code signing certificate.
|
|
163
|
+
*/
|
|
164
|
+
readonly publisherName?: string | Array<string> | null;
|
|
165
|
+
}
|
|
166
|
+
export interface WindowsAzureSigningConfiguration {
|
|
167
|
+
/**
|
|
168
|
+
* The Trusted Signing Account endpoint. The URI value must have a URI that aligns to the
|
|
169
|
+
* region your Trusted Signing Account and Certificate Profile you are specifying were created
|
|
170
|
+
* in during the setup of these resources.
|
|
171
|
+
*
|
|
172
|
+
* Translates to field: Endpoint
|
|
173
|
+
*
|
|
174
|
+
* Requires one of environment variable configurations for authenticating to Microsoft Entra ID per [Microsoft's documentation](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.environmentcredential?view=azure-dotnet#definition)
|
|
175
|
+
*/
|
|
176
|
+
readonly endpoint: string;
|
|
177
|
+
/**
|
|
178
|
+
* The Certificate Profile name. Translates to field: CertificateProfileName
|
|
179
|
+
*/
|
|
180
|
+
readonly certificateProfileName: string;
|
|
181
|
+
/**
|
|
182
|
+
* Allow other CLI parameters (verbatim case-sensitive) to `Invoke-TrustedSigning`
|
|
183
|
+
*/
|
|
184
|
+
[k: string]: string;
|
|
185
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"winOptions.js","sourceRoot":"","sources":["../../src/options/winOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { PlatformSpecificBuildOptions, TargetConfigType } from \"../index\"\nimport { CustomWindowsSign } from \"../codeSign/
|
|
1
|
+
{"version":3,"file":"winOptions.js","sourceRoot":"","sources":["../../src/options/winOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { PlatformSpecificBuildOptions, TargetConfigType } from \"../index\"\nimport { CustomWindowsSign } from \"../codeSign/windowsSignToolManager\"\n\nexport interface WindowsConfiguration extends PlatformSpecificBuildOptions {\n /**\n * The target package type: list of `nsis`, `nsis-web` (Web installer), `portable` ([portable](/configuration/nsis#portable) app without installation), `appx`, `msi`, `msi-wrapped`, `squirrel`, `7z`, `zip`, `tar.xz`, `tar.lz`, `tar.gz`, `tar.bz2`, `dir`.\n * AppX package can be built only on Windows 10.\n *\n * To use Squirrel.Windows please install `electron-builder-squirrel-windows` dependency.\n *\n * @default nsis\n */\n readonly target?: TargetConfigType\n\n /**\n * The path to application icon.\n * @default build/icon.ico\n */\n readonly icon?: string | null\n\n /**\n * The trademarks and registered trademarks.\n */\n readonly legalTrademarks?: string | null\n\n /**\n * Array of signing algorithms used. For AppX `sha256` is always used.\n * @deprecated Please use {@link signtoolOptions.signingHashAlgorithms}\n */\n readonly signingHashAlgorithms?: Array<\"sha1\" | \"sha256\"> | null\n /**\n * The custom function (or path to file or module id) to sign Windows executables\n * @deprecated Please use {@link signtoolOptions.sign}\n */\n readonly sign?: CustomWindowsSign | string | null\n /**\n * 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.\n * Please see [Code Signing](/code-signing).\n * @deprecated Please use {@link signtoolOptions.certificateFile}\n */\n readonly certificateFile?: string | null\n /**\n * The password to the certificate provided in `certificateFile`. Please use it only if you cannot use env variable `CSC_KEY_PASSWORD` (`WIN_CSC_KEY_PASSWORD`) for some reason.\n * Please see [Code Signing](/code-signing).\n * @deprecated Please use {@link signtoolOptions.certificatePassword}\n */\n readonly certificatePassword?: string | null\n /**\n * The name of the subject of the signing certificate, which is often labeled with the field name `issued to`. Required only for EV Code Signing and works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).\n * @deprecated Please use {@link signtoolOptions.certificateSubjectName}\n */\n readonly certificateSubjectName?: string | null\n /**\n * The SHA1 hash of the signing certificate. The SHA1 hash is commonly specified when multiple certificates satisfy the criteria specified by the remaining switches. Works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).\n * @deprecated Please use win.signtoolOptions.certificateSha1\n */\n readonly certificateSha1?: string | null\n /**\n * The path to an additional certificate file you want to add to the signature block.\n * @deprecated Please use {@link signtoolOptions.additionalCertificateFile}\n */\n readonly additionalCertificateFile?: string | null\n /**\n * The URL of the RFC 3161 time stamp server.\n * @default http://timestamp.digicert.com\n * @deprecated Please use {@link signtoolOptions.rfc3161TimeStampServer}\n */\n readonly rfc3161TimeStampServer?: string | null\n /**\n * The URL of the time stamp server.\n * @default http://timestamp.digicert.com\n * @deprecated Please use {@link signtoolOptions.timeStampServer}\n */\n readonly timeStampServer?: string | null\n\n /**\n * [The publisher name](https://github.com/electron-userland/electron-builder/issues/1187#issuecomment-278972073), exactly as in your code signed certificate. Several names can be provided.\n * Defaults to common name from your code signing certificate.\n * @deprecated Please use {@link signtoolOptions.publisherName}\n */\n readonly publisherName?: string | Array<string> | null\n\n /**\n * Options for usage with signtool.exe\n */\n readonly signtoolOptions?: WindowsSigntoolConfiguration | null\n\n /**\n * Options for usage of Azure Trusted Signing (beta)\n */\n readonly azureSignOptions?: WindowsAzureSigningConfiguration | null\n\n /**\n * Whether to verify the signature of an available update before installation.\n * The [publisher name](#publisherName) will be used for the signature verification.\n *\n * @default true\n */\n readonly verifyUpdateCodeSignature?: boolean\n\n /**\n * The [security level](https://msdn.microsoft.com/en-us/library/6ad1fshk.aspx#Anchor_9) at which the application requests to be executed.\n * Cannot be specified per target, allowed only in the `win`.\n * @default asInvoker\n */\n readonly requestedExecutionLevel?: RequestedExecutionLevel | null\n\n /**\n * Whether to sign and add metadata to executable. Advanced option.\n * @default true\n */\n readonly signAndEditExecutable?: boolean\n\n /**\n * Whether to sign DLL files. Advanced option.\n * @see https://github.com/electron-userland/electron-builder/issues/3101#issuecomment-404212384\n * @default false\n * @deprecated Use {@link signExts} instead for more explicit control\n */\n readonly signDlls?: boolean\n\n /**\n * Explicit file extensions to also sign. Advanced option.\n * @see https://github.com/electron-userland/electron-builder/issues/7329\n * @default null\n */\n readonly signExts?: string[] | null\n}\n\nexport type RequestedExecutionLevel = \"asInvoker\" | \"highestAvailable\" | \"requireAdministrator\"\n\nexport interface WindowsSigntoolConfiguration {\n /**\n * The custom function (or path to file or module id) to sign Windows executables\n */\n readonly sign?: CustomWindowsSign | string | null\n\n /**\n * Array of signing algorithms used. For AppX `sha256` is always used.\n * @default ['sha1', 'sha256']\n */\n readonly signingHashAlgorithms?: Array<\"sha1\" | \"sha256\"> | null\n\n /**\n * 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.\n * Please see [Code Signing](/code-signing).\n */\n readonly certificateFile?: string | null\n\n /**\n * The password to the certificate provided in `certificateFile`. Please use it only if you cannot use env variable `CSC_KEY_PASSWORD` (`WIN_CSC_KEY_PASSWORD`) for some reason.\n * Please see [Code Signing](/code-signing).\n */\n readonly certificatePassword?: string | null\n\n /**\n * The name of the subject of the signing certificate, which is often labeled with the field name `issued to`. Required only for EV Code Signing and works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).\n */\n readonly certificateSubjectName?: string | null\n\n /**\n * The SHA1 hash of the signing certificate. The SHA1 hash is commonly specified when multiple certificates satisfy the criteria specified by the remaining switches. Works only on Windows (or on macOS if [Parallels Desktop](https://www.parallels.com/products/desktop/) Windows 10 virtual machines exits).\n */\n readonly certificateSha1?: string | null\n\n /**\n * The path to an additional certificate file you want to add to the signature block.\n */\n readonly additionalCertificateFile?: string | null\n\n /**\n * The URL of the RFC 3161 time stamp server.\n * @default http://timestamp.digicert.com\n */\n readonly rfc3161TimeStampServer?: string | null\n\n /**\n * The URL of the time stamp server.\n * @default http://timestamp.digicert.com\n */\n readonly timeStampServer?: string | null\n\n /**\n * [The publisher name](https://github.com/electron-userland/electron-builder/issues/1187#issuecomment-278972073), exactly as in your code signed certificate. Several names can be provided.\n * Defaults to common name from your code signing certificate.\n */\n readonly publisherName?: string | Array<string> | null\n}\n\n// https://learn.microsoft.com/en-us/azure/trusted-signing/how-to-signing-integrations\nexport interface WindowsAzureSigningConfiguration {\n /**\n * The Trusted Signing Account endpoint. The URI value must have a URI that aligns to the\n * region your Trusted Signing Account and Certificate Profile you are specifying were created\n * in during the setup of these resources.\n *\n * Translates to field: Endpoint\n *\n * Requires one of environment variable configurations for authenticating to Microsoft Entra ID per [Microsoft's documentation](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.environmentcredential?view=azure-dotnet#definition)\n */\n readonly endpoint: string\n /**\n * The Certificate Profile name. Translates to field: CertificateProfileName\n */\n readonly certificateProfileName: string\n /**\n * Allow other CLI parameters (verbatim case-sensitive) to `Invoke-TrustedSigning`\n */\n [k: string]: string\n}\n"]}
|
package/out/packager.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export declare class Packager {
|
|
|
36
36
|
readonly debugLogger: DebugLogger;
|
|
37
37
|
get repositoryInfo(): Promise<SourceRepositoryInfo | null>;
|
|
38
38
|
private nodeDependencyInfo;
|
|
39
|
-
getNodeDependencyInfo(platform: Platform | null): Lazy<Array<NodeModuleInfo | NodeModuleDirInfo>>;
|
|
39
|
+
getNodeDependencyInfo(platform: Platform | null, flatten?: boolean): Lazy<Array<NodeModuleInfo | NodeModuleDirInfo>>;
|
|
40
40
|
stageDirPathCustomizer: (target: Target, packager: PlatformPackager<any>, arch: Arch) => string;
|
|
41
41
|
private _buildResourcesDir;
|
|
42
42
|
get buildResourcesDir(): string;
|
package/out/packager.js
CHANGED
|
@@ -13,10 +13,9 @@ const asar_1 = require("./asar/asar");
|
|
|
13
13
|
const core_1 = require("./core");
|
|
14
14
|
const ElectronFramework_1 = require("./electron/ElectronFramework");
|
|
15
15
|
const LibUiFramework_1 = require("./frameworks/LibUiFramework");
|
|
16
|
-
const platformPackager_1 = require("./platformPackager");
|
|
17
16
|
const ProtonFramework_1 = require("./ProtonFramework");
|
|
18
17
|
const targetFactory_1 = require("./targets/targetFactory");
|
|
19
|
-
const config_1 = require("./util/config");
|
|
18
|
+
const config_1 = require("./util/config/config");
|
|
20
19
|
const macroExpander_1 = require("./util/macroExpander");
|
|
21
20
|
const packageDependencies_1 = require("./util/packageDependencies");
|
|
22
21
|
const packageMetadata_1 = require("./util/packageMetadata");
|
|
@@ -24,6 +23,7 @@ const repositoryInfo_1 = require("./util/repositoryInfo");
|
|
|
24
23
|
const yarn_1 = require("./util/yarn");
|
|
25
24
|
const version_1 = require("./version");
|
|
26
25
|
const os_1 = require("os");
|
|
26
|
+
const resolve_1 = require("./util/resolve");
|
|
27
27
|
function addHandler(emitter, event, handler) {
|
|
28
28
|
emitter.on(event, handler);
|
|
29
29
|
}
|
|
@@ -76,8 +76,8 @@ class Packager {
|
|
|
76
76
|
get repositoryInfo() {
|
|
77
77
|
return this._repositoryInfo.value;
|
|
78
78
|
}
|
|
79
|
-
getNodeDependencyInfo(platform) {
|
|
80
|
-
let key = "";
|
|
79
|
+
getNodeDependencyInfo(platform, flatten = true) {
|
|
80
|
+
let key = "" + flatten.toString();
|
|
81
81
|
let excludedDependencies = null;
|
|
82
82
|
if (platform != null && this.framework.getExcludedDependencies != null) {
|
|
83
83
|
excludedDependencies = this.framework.getExcludedDependencies(platform);
|
|
@@ -87,7 +87,7 @@ class Packager {
|
|
|
87
87
|
}
|
|
88
88
|
let result = this.nodeDependencyInfo.get(key);
|
|
89
89
|
if (result == null) {
|
|
90
|
-
result = (0, packageDependencies_1.createLazyProductionDeps)(this.appDir, excludedDependencies);
|
|
90
|
+
result = (0, packageDependencies_1.createLazyProductionDeps)(this.appDir, excludedDependencies, flatten);
|
|
91
91
|
this.nodeDependencyInfo.set(key, result);
|
|
92
92
|
}
|
|
93
93
|
return result;
|
|
@@ -207,7 +207,7 @@ class Packager {
|
|
|
207
207
|
arch: event.arch == null ? null : builder_util_1.Arch[event.arch],
|
|
208
208
|
file: builder_util_1.log.filePath(event.file),
|
|
209
209
|
}, "building");
|
|
210
|
-
const handler = await (0,
|
|
210
|
+
const handler = await (0, resolve_1.resolveFunction)(this.appInfo.type, this.config.artifactBuildStarted, "artifactBuildStarted");
|
|
211
211
|
if (handler != null) {
|
|
212
212
|
await Promise.resolve(handler(event));
|
|
213
213
|
}
|
|
@@ -219,20 +219,20 @@ class Packager {
|
|
|
219
219
|
this.eventEmitter.emit("artifactCreated", event);
|
|
220
220
|
}
|
|
221
221
|
async callArtifactBuildCompleted(event) {
|
|
222
|
-
const handler = await (0,
|
|
222
|
+
const handler = await (0, resolve_1.resolveFunction)(this.appInfo.type, this.config.artifactBuildCompleted, "artifactBuildCompleted");
|
|
223
223
|
if (handler != null) {
|
|
224
224
|
await Promise.resolve(handler(event));
|
|
225
225
|
}
|
|
226
226
|
this.dispatchArtifactCreated(event);
|
|
227
227
|
}
|
|
228
228
|
async callAppxManifestCreated(path) {
|
|
229
|
-
const handler = await (0,
|
|
229
|
+
const handler = await (0, resolve_1.resolveFunction)(this.appInfo.type, this.config.appxManifestCreated, "appxManifestCreated");
|
|
230
230
|
if (handler != null) {
|
|
231
231
|
await Promise.resolve(handler(path));
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
async callMsiProjectCreated(path) {
|
|
235
|
-
const handler = await (0,
|
|
235
|
+
const handler = await (0, resolve_1.resolveFunction)(this.appInfo.type, this.config.msiProjectCreated, "msiProjectCreated");
|
|
236
236
|
if (handler != null) {
|
|
237
237
|
await Promise.resolve(handler(path));
|
|
238
238
|
}
|
|
@@ -406,7 +406,7 @@ class Packager {
|
|
|
406
406
|
builder_util_1.log.info({ reason: "npmRebuild is set to false" }, "skipped dependencies rebuild");
|
|
407
407
|
return;
|
|
408
408
|
}
|
|
409
|
-
const beforeBuild = await (0,
|
|
409
|
+
const beforeBuild = await (0, resolve_1.resolveFunction)(this.appInfo.type, config.beforeBuild, "beforeBuild");
|
|
410
410
|
if (beforeBuild != null) {
|
|
411
411
|
const performDependenciesInstallOrRebuild = await beforeBuild({
|
|
412
412
|
appDir: this.appDir,
|
|
@@ -428,12 +428,12 @@ class Packager {
|
|
|
428
428
|
frameworkInfo,
|
|
429
429
|
platform: platform.nodeName,
|
|
430
430
|
arch: builder_util_1.Arch[arch],
|
|
431
|
-
productionDeps: this.getNodeDependencyInfo(null),
|
|
431
|
+
productionDeps: this.getNodeDependencyInfo(null, false),
|
|
432
432
|
});
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
async afterPack(context) {
|
|
436
|
-
const afterPack = await (0,
|
|
436
|
+
const afterPack = await (0, resolve_1.resolveFunction)(this.appInfo.type, this.config.afterPack, "afterPack");
|
|
437
437
|
const handlers = this.afterPackHandlers.slice();
|
|
438
438
|
if (afterPack != null) {
|
|
439
439
|
// user handler should be last
|
package/out/packager.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packager.js","sourceRoot":"","sources":["../src/packager.ts"],"names":[],"mappings":";;;AAAA,+CAeqB;AACrB,+DAAwD;AACxD,mCAAqC;AACrC,uCAAoD;AACpD,8BAA6B;AAC7B,uCAA+B;AAC/B,6BAA4B;AAC5B,uCAAmC;AACnC,sCAA0C;AAE1C,iCAA+D;AAC/D,oEAA6E;AAE7E,gEAA4D;AAG5D,yDAAsE;AACtE,uDAAmD;AACnD,2DAAgG;AAChG,0CAA4F;AAC5F,wDAAkD;AAClD,oEAAwG;AACxG,4DAAuE;AACvE,0DAAyD;AACzD,sCAA8D;AAC9D,uCAA2C;A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CAAC,EAAE,CAAC;QACvB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IAC1B,CAAC;IAED,OAAO,OAAO,CAAC,GAAG,CAChB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;SAChB,IAAI,EAAE;SACN,GAAG,CAAC,GAAG,CAAC,EAAE;QACT,OAAO,IAAA,iBAAM,EAAC,GAAG,CAAC;aACf,IAAI,CAAC,GAAG,EAAE,CAAC,IAAA,gBAAK,EAAC,GAAG,EAAE,KAAK,CAAC,CAAC,oBAAoB,CAAC;aAClD,IAAI,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;IACxC,CAAC,CAAC,CACL,CAAA;AACH,CAAC;AASD,SAAS,sBAAsB,CAAC,aAA4B;IAC1D,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,gCAAiB,EAAC,aAAa,CAAC,CAAC,CAAA;IACtD,IAAI,CAAC,CAAC,OAAO,IAAI,IAAI,EAAE,CAAC;QACtB,CAAC,CAAC,OAAO,GAAG,qBAAqB,CAAA;IACnC,CAAC;IACD,OAAO,IAAA,8BAAe,EAAC,CAAC,EAAE,IAAI,CAAC,CAAA;AACjC,CAAC","sourcesContent":["import {\n addValue,\n Arch,\n archFromString,\n AsyncTaskManager,\n DebugLogger,\n deepAssign,\n InvalidConfigurationError,\n log,\n safeStringifyJson,\n serializeToYaml,\n TmpDir,\n executeFinally,\n orNullIfFileNotExist,\n getArtifactArchName,\n} from \"builder-util\"\nimport { CancellationToken } from \"builder-util-runtime\"\nimport { EventEmitter } from \"events\"\nimport { mkdirs, chmod, outputFile } from \"fs-extra\"\nimport * as isCI from \"is-ci\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { AppInfo } from \"./appInfo\"\nimport { readAsarJson } from \"./asar/asar\"\nimport { AfterPackContext, Configuration } from \"./configuration\"\nimport { Platform, SourceRepositoryInfo, Target } from \"./core\"\nimport { createElectronFrameworkSupport } from \"./electron/ElectronFramework\"\nimport { Framework } from \"./Framework\"\nimport { LibUiFramework } from \"./frameworks/LibUiFramework\"\nimport { Metadata } from \"./options/metadata\"\nimport { ArtifactBuildStarted, ArtifactCreated, PackagerOptions } from \"./packagerApi\"\nimport { PlatformPackager, resolveFunction } from \"./platformPackager\"\nimport { ProtonFramework } from \"./ProtonFramework\"\nimport { computeArchToTargetNamesMap, createTargets, NoOpTarget } from \"./targets/targetFactory\"\nimport { computeDefaultAppDirectory, getConfig, validateConfiguration } from \"./util/config\"\nimport { expandMacro } from \"./util/macroExpander\"\nimport { createLazyProductionDeps, NodeModuleDirInfo, NodeModuleInfo } from \"./util/packageDependencies\"\nimport { checkMetadata, readPackageJson } from \"./util/packageMetadata\"\nimport { getRepositoryInfo } from \"./util/repositoryInfo\"\nimport { installOrRebuild, nodeGypRebuild } from \"./util/yarn\"\nimport { PACKAGE_VERSION } from \"./version\"\nimport { release as getOsRelease } from \"os\"\n\nfunction addHandler(emitter: EventEmitter, event: string, handler: (...args: Array<any>) => void) {\n emitter.on(event, handler)\n}\n\nasync function createFrameworkInfo(configuration: Configuration, packager: Packager): Promise<Framework> {\n let framework = configuration.framework\n if (framework != null) {\n framework = framework.toLowerCase()\n }\n\n let nodeVersion = configuration.nodeVersion\n if (framework === \"electron\" || framework == null) {\n return await createElectronFrameworkSupport(configuration, packager)\n }\n\n if (nodeVersion == null || nodeVersion === \"current\") {\n nodeVersion = process.versions.node\n }\n\n const distMacOsName = `${packager.appInfo.productFilename}.app`\n const isUseLaunchUi = configuration.launchUiVersion !== false\n if (framework === \"proton\" || framework === \"proton-native\") {\n return new ProtonFramework(nodeVersion, distMacOsName, isUseLaunchUi)\n } else if (framework === \"libui\") {\n return new LibUiFramework(nodeVersion, distMacOsName, isUseLaunchUi)\n } else {\n throw new InvalidConfigurationError(`Unknown framework: ${framework}`)\n }\n}\n\nexport class Packager {\n readonly projectDir: string\n\n private _appDir: string\n get appDir(): string {\n return this._appDir\n }\n\n private _metadata: Metadata | null = null\n get metadata(): Metadata {\n return this._metadata!\n }\n\n private _nodeModulesHandledExternally = false\n\n get areNodeModulesHandledExternally(): boolean {\n return this._nodeModulesHandledExternally\n }\n\n private _isPrepackedAppAsar = false\n\n get isPrepackedAppAsar(): boolean {\n return this._isPrepackedAppAsar\n }\n\n private _devMetadata: Metadata | null = null\n get devMetadata(): Metadata | null {\n return this._devMetadata\n }\n\n private _configuration: Configuration | null = null\n\n get config(): Configuration {\n return this._configuration!\n }\n\n isTwoPackageJsonProjectLayoutUsed = false\n\n readonly eventEmitter = new EventEmitter()\n\n _appInfo: AppInfo | null = null\n get appInfo(): AppInfo {\n return this._appInfo!\n }\n\n readonly tempDirManager = new TmpDir(\"packager\")\n\n private _repositoryInfo = new Lazy<SourceRepositoryInfo | null>(() => getRepositoryInfo(this.projectDir, this.metadata, this.devMetadata))\n\n private readonly afterPackHandlers: Array<(context: AfterPackContext) => Promise<any> | null> = []\n\n readonly options: PackagerOptions\n\n readonly debugLogger = new DebugLogger(log.isDebugEnabled)\n\n get repositoryInfo(): Promise<SourceRepositoryInfo | null> {\n return this._repositoryInfo.value\n }\n\n private nodeDependencyInfo = new Map<string, Lazy<Array<any>>>()\n\n getNodeDependencyInfo(platform: Platform | null): Lazy<Array<NodeModuleInfo | NodeModuleDirInfo>> {\n let key = \"\"\n let excludedDependencies: Array<string> | null = null\n if (platform != null && this.framework.getExcludedDependencies != null) {\n excludedDependencies = this.framework.getExcludedDependencies(platform)\n if (excludedDependencies != null) {\n key += `-${platform.name}`\n }\n }\n\n let result = this.nodeDependencyInfo.get(key)\n if (result == null) {\n result = createLazyProductionDeps(this.appDir, excludedDependencies)\n this.nodeDependencyInfo.set(key, result)\n }\n return result\n }\n\n stageDirPathCustomizer: (target: Target, packager: PlatformPackager<any>, arch: Arch) => string = (target, packager, arch) => {\n return path.join(target.outDir, `__${target.name}-${getArtifactArchName(arch, target.name)}`)\n }\n\n private _buildResourcesDir: string | null = null\n\n get buildResourcesDir(): string {\n let result = this._buildResourcesDir\n if (result == null) {\n result = path.resolve(this.projectDir, this.relativeBuildResourcesDirname)\n this._buildResourcesDir = result\n }\n return result\n }\n\n get relativeBuildResourcesDirname(): string {\n return this.config.directories!.buildResources!\n }\n\n private _framework: Framework | null = null\n get framework(): Framework {\n return this._framework!\n }\n\n private readonly toDispose: Array<() => Promise<void>> = []\n\n disposeOnBuildFinish(disposer: () => Promise<void>) {\n this.toDispose.push(disposer)\n }\n\n //noinspection JSUnusedGlobalSymbols\n constructor(\n options: PackagerOptions,\n readonly cancellationToken = new CancellationToken()\n ) {\n if (\"devMetadata\" in options) {\n throw new InvalidConfigurationError(\"devMetadata in the options is deprecated, please use config instead\")\n }\n if (\"extraMetadata\" in options) {\n throw new InvalidConfigurationError(\"extraMetadata in the options is deprecated, please use config.extraMetadata instead\")\n }\n\n const targets = options.targets || new Map<Platform, Map<Arch, Array<string>>>()\n if (options.targets == null) {\n options.targets = targets\n }\n\n function processTargets(platform: Platform, types: Array<string>) {\n function commonArch(currentIfNotSpecified: boolean): Array<Arch> {\n const result = Array<Arch>()\n return result.length === 0 && currentIfNotSpecified ? [archFromString(process.arch)] : result\n }\n\n let archToType = targets.get(platform)\n if (archToType == null) {\n archToType = new Map<Arch, Array<string>>()\n targets.set(platform, archToType)\n }\n\n if (types.length === 0) {\n for (const arch of commonArch(false)) {\n archToType.set(arch, [])\n }\n return\n }\n\n for (const type of types) {\n const suffixPos = type.lastIndexOf(\":\")\n if (suffixPos > 0) {\n addValue(archToType, archFromString(type.substring(suffixPos + 1)), type.substring(0, suffixPos))\n } else {\n for (const arch of commonArch(true)) {\n addValue(archToType, arch, type)\n }\n }\n }\n }\n\n if (options.mac != null) {\n processTargets(Platform.MAC, options.mac)\n }\n if (options.linux != null) {\n processTargets(Platform.LINUX, options.linux)\n }\n if (options.win != null) {\n processTargets(Platform.WINDOWS, options.win)\n }\n\n this.projectDir = options.projectDir == null ? process.cwd() : path.resolve(options.projectDir)\n this._appDir = this.projectDir\n this.options = {\n ...options,\n prepackaged: options.prepackaged == null ? null : path.resolve(this.projectDir, options.prepackaged),\n }\n\n try {\n log.info({ version: PACKAGE_VERSION, os: getOsRelease() }, \"electron-builder\")\n } catch (e: any) {\n // error in dev mode without babel\n if (!(e instanceof ReferenceError)) {\n throw e\n }\n }\n }\n\n addAfterPackHandler(handler: (context: AfterPackContext) => Promise<any> | null) {\n this.afterPackHandlers.push(handler)\n }\n\n artifactCreated(handler: (event: ArtifactCreated) => void): Packager {\n addHandler(this.eventEmitter, \"artifactCreated\", handler)\n return this\n }\n\n async callArtifactBuildStarted(event: ArtifactBuildStarted, logFields?: any): Promise<void> {\n log.info(\n logFields || {\n target: event.targetPresentableName,\n arch: event.arch == null ? null : Arch[event.arch],\n file: log.filePath(event.file),\n },\n \"building\"\n )\n const handler = await resolveFunction(this.appInfo.type, this.config.artifactBuildStarted, \"artifactBuildStarted\")\n if (handler != null) {\n await Promise.resolve(handler(event))\n }\n }\n\n /**\n * Only for sub artifacts (update info), for main artifacts use `callArtifactBuildCompleted`.\n */\n dispatchArtifactCreated(event: ArtifactCreated): void {\n this.eventEmitter.emit(\"artifactCreated\", event)\n }\n\n async callArtifactBuildCompleted(event: ArtifactCreated): Promise<void> {\n const handler = await resolveFunction(this.appInfo.type, this.config.artifactBuildCompleted, \"artifactBuildCompleted\")\n if (handler != null) {\n await Promise.resolve(handler(event))\n }\n\n this.dispatchArtifactCreated(event)\n }\n\n async callAppxManifestCreated(path: string): Promise<void> {\n const handler = await resolveFunction(this.appInfo.type, this.config.appxManifestCreated, \"appxManifestCreated\")\n if (handler != null) {\n await Promise.resolve(handler(path))\n }\n }\n\n async callMsiProjectCreated(path: string): Promise<void> {\n const handler = await resolveFunction(this.appInfo.type, this.config.msiProjectCreated, \"msiProjectCreated\")\n if (handler != null) {\n await Promise.resolve(handler(path))\n }\n }\n\n async validateConfig(): Promise<void> {\n let configPath: string | null = null\n let configFromOptions = this.options.config\n if (typeof configFromOptions === \"string\") {\n // it is a path to config file\n configPath = configFromOptions\n configFromOptions = null\n } else if (configFromOptions != null && typeof configFromOptions.extends === \"string\" && configFromOptions.extends.includes(\".\")) {\n configPath = configFromOptions.extends\n delete configFromOptions.extends\n }\n\n const projectDir = this.projectDir\n\n const devPackageFile = path.join(projectDir, \"package.json\")\n this._devMetadata = await orNullIfFileNotExist(readPackageJson(devPackageFile))\n\n const devMetadata = this.devMetadata\n const configuration = await getConfig(projectDir, configPath, configFromOptions, new Lazy(() => Promise.resolve(devMetadata)))\n if (log.isDebugEnabled) {\n log.debug({ config: getSafeEffectiveConfig(configuration) }, \"effective config\")\n }\n\n this._appDir = await computeDefaultAppDirectory(projectDir, configuration.directories!.app)\n this.isTwoPackageJsonProjectLayoutUsed = this._appDir !== projectDir\n\n const appPackageFile = this.isTwoPackageJsonProjectLayoutUsed ? path.join(this.appDir, \"package.json\") : devPackageFile\n\n // tslint:disable:prefer-conditional-expression\n if (this.devMetadata != null && !this.isTwoPackageJsonProjectLayoutUsed) {\n this._metadata = this.devMetadata\n } else {\n this._metadata = await this.readProjectMetadataIfTwoPackageStructureOrPrepacked(appPackageFile)\n }\n deepAssign(this.metadata, configuration.extraMetadata)\n\n if (this.isTwoPackageJsonProjectLayoutUsed) {\n log.debug({ devPackageFile, appPackageFile }, \"two package.json structure is used\")\n }\n checkMetadata(this.metadata, this.devMetadata, appPackageFile, devPackageFile)\n\n await validateConfiguration(configuration, this.debugLogger)\n\n this._configuration = configuration\n this._devMetadata = devMetadata\n }\n\n // external caller of this method always uses isTwoPackageJsonProjectLayoutUsed=false and appDir=projectDir, no way (and need) to use another values\n async build(repositoryInfo?: SourceRepositoryInfo): Promise<BuildResult> {\n await this.validateConfig()\n\n if (repositoryInfo != null) {\n this._repositoryInfo.value = Promise.resolve(repositoryInfo)\n }\n\n this._appInfo = new AppInfo(this, null)\n this._framework = await createFrameworkInfo(this.config, this)\n\n const commonOutDirWithoutPossibleOsMacro = path.resolve(\n this.projectDir,\n expandMacro(this.config.directories!.output!, null, this._appInfo, {\n os: \"\",\n })\n )\n\n if (!isCI && (process.stdout as any).isTTY) {\n const effectiveConfigFile = path.join(commonOutDirWithoutPossibleOsMacro, \"builder-effective-config.yaml\")\n log.info({ file: log.filePath(effectiveConfigFile) }, \"writing effective config\")\n await outputFile(effectiveConfigFile, getSafeEffectiveConfig(this.config))\n }\n\n // because artifact event maybe dispatched several times for different publish providers\n const artifactPaths = new Set<string>()\n this.artifactCreated(event => {\n if (event.file != null) {\n artifactPaths.add(event.file)\n }\n })\n\n this.disposeOnBuildFinish(() => this.tempDirManager.cleanup())\n const platformToTargets = await executeFinally(this.doBuild(), async () => {\n if (this.debugLogger.isEnabled) {\n await this.debugLogger.save(path.join(commonOutDirWithoutPossibleOsMacro, \"builder-debug.yml\"))\n }\n\n const toDispose = this.toDispose.slice()\n this.toDispose.length = 0\n for (const disposer of toDispose) {\n await disposer().catch((e: any) => {\n log.warn({ error: e }, \"cannot dispose\")\n })\n }\n })\n\n return {\n outDir: commonOutDirWithoutPossibleOsMacro,\n artifactPaths: Array.from(artifactPaths),\n platformToTargets,\n configuration: this.config,\n }\n }\n\n private async readProjectMetadataIfTwoPackageStructureOrPrepacked(appPackageFile: string): Promise<Metadata> {\n let data = await orNullIfFileNotExist(readPackageJson(appPackageFile))\n if (data != null) {\n return data\n }\n\n data = await orNullIfFileNotExist(readAsarJson(path.join(this.projectDir, \"app.asar\"), \"package.json\"))\n if (data != null) {\n this._isPrepackedAppAsar = true\n return data\n }\n\n throw new Error(`Cannot find package.json in the ${path.dirname(appPackageFile)}`)\n }\n\n private async doBuild(): Promise<Map<Platform, Map<string, Target>>> {\n const taskManager = new AsyncTaskManager(this.cancellationToken)\n const syncTargetsIfAny = [] as Target[]\n\n const platformToTarget = new Map<Platform, Map<string, Target>>()\n const createdOutDirs = new Set<string>()\n\n for (const [platform, archToType] of this.options.targets!) {\n if (this.cancellationToken.cancelled) {\n break\n }\n\n if (platform === Platform.MAC && process.platform === Platform.WINDOWS.nodeName) {\n throw new InvalidConfigurationError(\"Build for macOS is supported only on macOS, please see https://electron.build/multi-platform-build\")\n }\n\n const packager = await this.createHelper(platform)\n const nameToTarget: Map<string, Target> = new Map()\n platformToTarget.set(platform, nameToTarget)\n\n for (const [arch, targetNames] of computeArchToTargetNamesMap(archToType, packager, platform)) {\n if (this.cancellationToken.cancelled) {\n break\n }\n\n // support os and arch macro in output value\n const outDir = path.resolve(this.projectDir, packager.expandMacro(this.config.directories!.output!, Arch[arch]))\n const targetList = createTargets(nameToTarget, targetNames.length === 0 ? packager.defaultTarget : targetNames, outDir, packager)\n await createOutDirIfNeed(targetList, createdOutDirs)\n await packager.pack(outDir, arch, targetList, taskManager)\n }\n\n if (this.cancellationToken.cancelled) {\n break\n }\n\n for (const target of nameToTarget.values()) {\n if (target.isAsyncSupported) {\n taskManager.addTask(target.finishBuild())\n } else {\n syncTargetsIfAny.push(target)\n }\n }\n }\n\n await taskManager.awaitTasks()\n\n for (const target of syncTargetsIfAny) {\n await target.finishBuild()\n }\n return platformToTarget\n }\n\n private async createHelper(platform: Platform): Promise<PlatformPackager<any>> {\n if (this.options.platformPackagerFactory != null) {\n return this.options.platformPackagerFactory(this, platform)\n }\n\n switch (platform) {\n case Platform.MAC: {\n const helperClass = (await import(\"./macPackager\")).MacPackager\n return new helperClass(this)\n }\n\n case Platform.WINDOWS: {\n const helperClass = (await import(\"./winPackager\")).WinPackager\n return new helperClass(this)\n }\n\n case Platform.LINUX:\n return new (await import(\"./linuxPackager\")).LinuxPackager(this)\n\n default:\n throw new Error(`Unknown platform: ${platform}`)\n }\n }\n\n public async installAppDependencies(platform: Platform, arch: Arch): Promise<any> {\n if (this.options.prepackaged != null || !this.framework.isNpmRebuildRequired) {\n return\n }\n\n const frameworkInfo = { version: this.framework.version, useCustomDist: true }\n const config = this.config\n if (config.nodeGypRebuild === true) {\n await nodeGypRebuild(platform.nodeName, Arch[arch], frameworkInfo)\n }\n\n if (config.npmRebuild === false) {\n log.info({ reason: \"npmRebuild is set to false\" }, \"skipped dependencies rebuild\")\n return\n }\n\n const beforeBuild = await resolveFunction(this.appInfo.type, config.beforeBuild, \"beforeBuild\")\n if (beforeBuild != null) {\n const performDependenciesInstallOrRebuild = await beforeBuild({\n appDir: this.appDir,\n electronVersion: this.config.electronVersion!,\n platform,\n arch: Arch[arch],\n })\n\n // If beforeBuild resolves to false, it means that handling node_modules is done outside of electron-builder.\n this._nodeModulesHandledExternally = !performDependenciesInstallOrRebuild\n if (!performDependenciesInstallOrRebuild) {\n return\n }\n }\n\n if (config.buildDependenciesFromSource === true && platform.nodeName !== process.platform) {\n log.info({ reason: \"platform is different and buildDependenciesFromSource is set to true\" }, \"skipped dependencies rebuild\")\n } else {\n await installOrRebuild(config, this.appDir, {\n frameworkInfo,\n platform: platform.nodeName,\n arch: Arch[arch],\n productionDeps: this.getNodeDependencyInfo(null) as Lazy<Array<NodeModuleDirInfo>>,\n })\n }\n }\n\n async afterPack(context: AfterPackContext): Promise<any> {\n const afterPack = await resolveFunction(this.appInfo.type, this.config.afterPack, \"afterPack\")\n const handlers = this.afterPackHandlers.slice()\n if (afterPack != null) {\n // user handler should be last\n handlers.push(afterPack)\n }\n\n for (const handler of handlers) {\n await Promise.resolve(handler(context))\n }\n }\n}\n\nfunction createOutDirIfNeed(targetList: Array<Target>, createdOutDirs: Set<string>): Promise<any> {\n const ourDirs = new Set<string>()\n for (const target of targetList) {\n // noinspection SuspiciousInstanceOfGuard\n if (target instanceof NoOpTarget) {\n continue\n }\n\n const outDir = target.outDir\n if (!createdOutDirs.has(outDir)) {\n ourDirs.add(outDir)\n }\n }\n\n if (ourDirs.size === 0) {\n return Promise.resolve()\n }\n\n return Promise.all(\n Array.from(ourDirs)\n .sort()\n .map(dir => {\n return mkdirs(dir)\n .then(() => chmod(dir, 0o755) /* set explicitly */)\n .then(() => createdOutDirs.add(dir))\n })\n )\n}\n\nexport interface BuildResult {\n readonly outDir: string\n readonly artifactPaths: Array<string>\n readonly platformToTargets: Map<Platform, Map<string, Target>>\n readonly configuration: Configuration\n}\n\nfunction getSafeEffectiveConfig(configuration: Configuration): string {\n const o = JSON.parse(safeStringifyJson(configuration))\n if (o.cscLink != null) {\n o.cscLink = \"<hidden by builder>\"\n }\n return serializeToYaml(o, true)\n}\n"]}
|
|
1
|
+
{"version":3,"file":"packager.js","sourceRoot":"","sources":["../src/packager.ts"],"names":[],"mappings":";;;AAAA,+CAeqB;AACrB,+DAAwD;AACxD,mCAAqC;AACrC,uCAAoD;AACpD,8BAA6B;AAC7B,uCAA+B;AAC/B,6BAA4B;AAC5B,uCAAmC;AACnC,sCAA0C;AAE1C,iCAA+D;AAC/D,oEAA6E;AAE7E,gEAA4D;AAI5D,uDAAmD;AACnD,2DAAgG;AAChG,iDAAmG;AACnG,wDAAkD;AAClD,oEAAwG;AACxG,4DAAuE;AACvE,0DAAyD;AACzD,sCAA8D;AAC9D,uCAA2C;AAC3C,2BAA4C;AAC5C,4CAAgD;AAEhD,SAAS,UAAU,CAAC,OAAqB,EAAE,KAAa,EAAE,OAAsC;IAC9F,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;AAC5B,CAAC;AAED,KAAK,UAAU,mBAAmB,CAAC,aAA4B,EAAE,QAAkB;IACjF,IAAI,SAAS,GAAG,aAAa,CAAC,SAAS,CAAA;IACvC,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;QACtB,SAAS,GAAG,SAAS,CAAC,WAAW,EAAE,CAAA;IACrC,CAAC;IAED,IAAI,WAAW,GAAG,aAAa,CAAC,WAAW,CAAA;IAC3C,IAAI,SAAS,KAAK,UAAU,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;QAClD,OAAO,MAAM,IAAA,kDAA8B,EAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;IACtE,CAAC;IAED,IAAI,WAAW,IAAI,IAAI,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QACrD,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC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CAAC,CAAA;IACtD,IAAI,CAAC,CAAC,OAAO,IAAI,IAAI,EAAE,CAAC;QACtB,CAAC,CAAC,OAAO,GAAG,qBAAqB,CAAA;IACnC,CAAC;IACD,OAAO,IAAA,8BAAe,EAAC,CAAC,EAAE,IAAI,CAAC,CAAA;AACjC,CAAC","sourcesContent":["import {\n addValue,\n Arch,\n archFromString,\n AsyncTaskManager,\n DebugLogger,\n deepAssign,\n InvalidConfigurationError,\n log,\n safeStringifyJson,\n serializeToYaml,\n TmpDir,\n executeFinally,\n orNullIfFileNotExist,\n getArtifactArchName,\n} from \"builder-util\"\nimport { CancellationToken } from \"builder-util-runtime\"\nimport { EventEmitter } from \"events\"\nimport { mkdirs, chmod, outputFile } from \"fs-extra\"\nimport * as isCI from \"is-ci\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { AppInfo } from \"./appInfo\"\nimport { readAsarJson } from \"./asar/asar\"\nimport { AfterPackContext, Configuration } from \"./configuration\"\nimport { Platform, SourceRepositoryInfo, Target } from \"./core\"\nimport { createElectronFrameworkSupport } from \"./electron/ElectronFramework\"\nimport { Framework } from \"./Framework\"\nimport { LibUiFramework } from \"./frameworks/LibUiFramework\"\nimport { Metadata } from \"./options/metadata\"\nimport { ArtifactBuildStarted, ArtifactCreated, PackagerOptions } from \"./packagerApi\"\nimport { PlatformPackager } from \"./platformPackager\"\nimport { ProtonFramework } from \"./ProtonFramework\"\nimport { computeArchToTargetNamesMap, createTargets, NoOpTarget } from \"./targets/targetFactory\"\nimport { computeDefaultAppDirectory, getConfig, validateConfiguration } from \"./util/config/config\"\nimport { expandMacro } from \"./util/macroExpander\"\nimport { createLazyProductionDeps, NodeModuleDirInfo, NodeModuleInfo } from \"./util/packageDependencies\"\nimport { checkMetadata, readPackageJson } from \"./util/packageMetadata\"\nimport { getRepositoryInfo } from \"./util/repositoryInfo\"\nimport { installOrRebuild, nodeGypRebuild } from \"./util/yarn\"\nimport { PACKAGE_VERSION } from \"./version\"\nimport { release as getOsRelease } from \"os\"\nimport { resolveFunction } from \"./util/resolve\"\n\nfunction addHandler(emitter: EventEmitter, event: string, handler: (...args: Array<any>) => void) {\n emitter.on(event, handler)\n}\n\nasync function createFrameworkInfo(configuration: Configuration, packager: Packager): Promise<Framework> {\n let framework = configuration.framework\n if (framework != null) {\n framework = framework.toLowerCase()\n }\n\n let nodeVersion = configuration.nodeVersion\n if (framework === \"electron\" || framework == null) {\n return await createElectronFrameworkSupport(configuration, packager)\n }\n\n if (nodeVersion == null || nodeVersion === \"current\") {\n nodeVersion = process.versions.node\n }\n\n const distMacOsName = `${packager.appInfo.productFilename}.app`\n const isUseLaunchUi = configuration.launchUiVersion !== false\n if (framework === \"proton\" || framework === \"proton-native\") {\n return new ProtonFramework(nodeVersion, distMacOsName, isUseLaunchUi)\n } else if (framework === \"libui\") {\n return new LibUiFramework(nodeVersion, distMacOsName, isUseLaunchUi)\n } else {\n throw new InvalidConfigurationError(`Unknown framework: ${framework}`)\n }\n}\n\nexport class Packager {\n readonly projectDir: string\n\n private _appDir: string\n get appDir(): string {\n return this._appDir\n }\n\n private _metadata: Metadata | null = null\n get metadata(): Metadata {\n return this._metadata!\n }\n\n private _nodeModulesHandledExternally = false\n\n get areNodeModulesHandledExternally(): boolean {\n return this._nodeModulesHandledExternally\n }\n\n private _isPrepackedAppAsar = false\n\n get isPrepackedAppAsar(): boolean {\n return this._isPrepackedAppAsar\n }\n\n private _devMetadata: Metadata | null = null\n get devMetadata(): Metadata | null {\n return this._devMetadata\n }\n\n private _configuration: Configuration | null = null\n\n get config(): Configuration {\n return this._configuration!\n }\n\n isTwoPackageJsonProjectLayoutUsed = false\n\n readonly eventEmitter = new EventEmitter()\n\n _appInfo: AppInfo | null = null\n get appInfo(): AppInfo {\n return this._appInfo!\n }\n\n readonly tempDirManager = new TmpDir(\"packager\")\n\n private _repositoryInfo = new Lazy<SourceRepositoryInfo | null>(() => getRepositoryInfo(this.projectDir, this.metadata, this.devMetadata))\n\n private readonly afterPackHandlers: Array<(context: AfterPackContext) => Promise<any> | null> = []\n\n readonly options: PackagerOptions\n\n readonly debugLogger = new DebugLogger(log.isDebugEnabled)\n\n get repositoryInfo(): Promise<SourceRepositoryInfo | null> {\n return this._repositoryInfo.value\n }\n\n private nodeDependencyInfo = new Map<string, Lazy<Array<any>>>()\n\n getNodeDependencyInfo(platform: Platform | null, flatten: boolean = true): Lazy<Array<NodeModuleInfo | NodeModuleDirInfo>> {\n let key = \"\" + flatten.toString()\n let excludedDependencies: Array<string> | null = null\n if (platform != null && this.framework.getExcludedDependencies != null) {\n excludedDependencies = this.framework.getExcludedDependencies(platform)\n if (excludedDependencies != null) {\n key += `-${platform.name}`\n }\n }\n\n let result = this.nodeDependencyInfo.get(key)\n if (result == null) {\n result = createLazyProductionDeps(this.appDir, excludedDependencies, flatten)\n this.nodeDependencyInfo.set(key, result)\n }\n return result\n }\n\n stageDirPathCustomizer: (target: Target, packager: PlatformPackager<any>, arch: Arch) => string = (target, packager, arch) => {\n return path.join(target.outDir, `__${target.name}-${getArtifactArchName(arch, target.name)}`)\n }\n\n private _buildResourcesDir: string | null = null\n\n get buildResourcesDir(): string {\n let result = this._buildResourcesDir\n if (result == null) {\n result = path.resolve(this.projectDir, this.relativeBuildResourcesDirname)\n this._buildResourcesDir = result\n }\n return result\n }\n\n get relativeBuildResourcesDirname(): string {\n return this.config.directories!.buildResources!\n }\n\n private _framework: Framework | null = null\n get framework(): Framework {\n return this._framework!\n }\n\n private readonly toDispose: Array<() => Promise<void>> = []\n\n disposeOnBuildFinish(disposer: () => Promise<void>) {\n this.toDispose.push(disposer)\n }\n\n //noinspection JSUnusedGlobalSymbols\n constructor(\n options: PackagerOptions,\n readonly cancellationToken = new CancellationToken()\n ) {\n if (\"devMetadata\" in options) {\n throw new InvalidConfigurationError(\"devMetadata in the options is deprecated, please use config instead\")\n }\n if (\"extraMetadata\" in options) {\n throw new InvalidConfigurationError(\"extraMetadata in the options is deprecated, please use config.extraMetadata instead\")\n }\n\n const targets = options.targets || new Map<Platform, Map<Arch, Array<string>>>()\n if (options.targets == null) {\n options.targets = targets\n }\n\n function processTargets(platform: Platform, types: Array<string>) {\n function commonArch(currentIfNotSpecified: boolean): Array<Arch> {\n const result = Array<Arch>()\n return result.length === 0 && currentIfNotSpecified ? [archFromString(process.arch)] : result\n }\n\n let archToType = targets.get(platform)\n if (archToType == null) {\n archToType = new Map<Arch, Array<string>>()\n targets.set(platform, archToType)\n }\n\n if (types.length === 0) {\n for (const arch of commonArch(false)) {\n archToType.set(arch, [])\n }\n return\n }\n\n for (const type of types) {\n const suffixPos = type.lastIndexOf(\":\")\n if (suffixPos > 0) {\n addValue(archToType, archFromString(type.substring(suffixPos + 1)), type.substring(0, suffixPos))\n } else {\n for (const arch of commonArch(true)) {\n addValue(archToType, arch, type)\n }\n }\n }\n }\n\n if (options.mac != null) {\n processTargets(Platform.MAC, options.mac)\n }\n if (options.linux != null) {\n processTargets(Platform.LINUX, options.linux)\n }\n if (options.win != null) {\n processTargets(Platform.WINDOWS, options.win)\n }\n\n this.projectDir = options.projectDir == null ? process.cwd() : path.resolve(options.projectDir)\n this._appDir = this.projectDir\n this.options = {\n ...options,\n prepackaged: options.prepackaged == null ? null : path.resolve(this.projectDir, options.prepackaged),\n }\n\n try {\n log.info({ version: PACKAGE_VERSION, os: getOsRelease() }, \"electron-builder\")\n } catch (e: any) {\n // error in dev mode without babel\n if (!(e instanceof ReferenceError)) {\n throw e\n }\n }\n }\n\n addAfterPackHandler(handler: (context: AfterPackContext) => Promise<any> | null) {\n this.afterPackHandlers.push(handler)\n }\n\n artifactCreated(handler: (event: ArtifactCreated) => void): Packager {\n addHandler(this.eventEmitter, \"artifactCreated\", handler)\n return this\n }\n\n async callArtifactBuildStarted(event: ArtifactBuildStarted, logFields?: any): Promise<void> {\n log.info(\n logFields || {\n target: event.targetPresentableName,\n arch: event.arch == null ? null : Arch[event.arch],\n file: log.filePath(event.file),\n },\n \"building\"\n )\n const handler = await resolveFunction(this.appInfo.type, this.config.artifactBuildStarted, \"artifactBuildStarted\")\n if (handler != null) {\n await Promise.resolve(handler(event))\n }\n }\n\n /**\n * Only for sub artifacts (update info), for main artifacts use `callArtifactBuildCompleted`.\n */\n dispatchArtifactCreated(event: ArtifactCreated): void {\n this.eventEmitter.emit(\"artifactCreated\", event)\n }\n\n async callArtifactBuildCompleted(event: ArtifactCreated): Promise<void> {\n const handler = await resolveFunction(this.appInfo.type, this.config.artifactBuildCompleted, \"artifactBuildCompleted\")\n if (handler != null) {\n await Promise.resolve(handler(event))\n }\n\n this.dispatchArtifactCreated(event)\n }\n\n async callAppxManifestCreated(path: string): Promise<void> {\n const handler = await resolveFunction(this.appInfo.type, this.config.appxManifestCreated, \"appxManifestCreated\")\n if (handler != null) {\n await Promise.resolve(handler(path))\n }\n }\n\n async callMsiProjectCreated(path: string): Promise<void> {\n const handler = await resolveFunction(this.appInfo.type, this.config.msiProjectCreated, \"msiProjectCreated\")\n if (handler != null) {\n await Promise.resolve(handler(path))\n }\n }\n\n async validateConfig(): Promise<void> {\n let configPath: string | null = null\n let configFromOptions = this.options.config\n if (typeof configFromOptions === \"string\") {\n // it is a path to config file\n configPath = configFromOptions\n configFromOptions = null\n } else if (configFromOptions != null && typeof configFromOptions.extends === \"string\" && configFromOptions.extends.includes(\".\")) {\n configPath = configFromOptions.extends\n delete configFromOptions.extends\n }\n\n const projectDir = this.projectDir\n\n const devPackageFile = path.join(projectDir, \"package.json\")\n this._devMetadata = await orNullIfFileNotExist(readPackageJson(devPackageFile))\n\n const devMetadata = this.devMetadata\n const configuration = await getConfig(projectDir, configPath, configFromOptions, new Lazy(() => Promise.resolve(devMetadata)))\n if (log.isDebugEnabled) {\n log.debug({ config: getSafeEffectiveConfig(configuration) }, \"effective config\")\n }\n\n this._appDir = await computeDefaultAppDirectory(projectDir, configuration.directories!.app)\n this.isTwoPackageJsonProjectLayoutUsed = this._appDir !== projectDir\n\n const appPackageFile = this.isTwoPackageJsonProjectLayoutUsed ? path.join(this.appDir, \"package.json\") : devPackageFile\n\n // tslint:disable:prefer-conditional-expression\n if (this.devMetadata != null && !this.isTwoPackageJsonProjectLayoutUsed) {\n this._metadata = this.devMetadata\n } else {\n this._metadata = await this.readProjectMetadataIfTwoPackageStructureOrPrepacked(appPackageFile)\n }\n deepAssign(this.metadata, configuration.extraMetadata)\n\n if (this.isTwoPackageJsonProjectLayoutUsed) {\n log.debug({ devPackageFile, appPackageFile }, \"two package.json structure is used\")\n }\n checkMetadata(this.metadata, this.devMetadata, appPackageFile, devPackageFile)\n\n await validateConfiguration(configuration, this.debugLogger)\n\n this._configuration = configuration\n this._devMetadata = devMetadata\n }\n\n // external caller of this method always uses isTwoPackageJsonProjectLayoutUsed=false and appDir=projectDir, no way (and need) to use another values\n async build(repositoryInfo?: SourceRepositoryInfo): Promise<BuildResult> {\n await this.validateConfig()\n\n if (repositoryInfo != null) {\n this._repositoryInfo.value = Promise.resolve(repositoryInfo)\n }\n\n this._appInfo = new AppInfo(this, null)\n this._framework = await createFrameworkInfo(this.config, this)\n\n const commonOutDirWithoutPossibleOsMacro = path.resolve(\n this.projectDir,\n expandMacro(this.config.directories!.output!, null, this._appInfo, {\n os: \"\",\n })\n )\n\n if (!isCI && (process.stdout as any).isTTY) {\n const effectiveConfigFile = path.join(commonOutDirWithoutPossibleOsMacro, \"builder-effective-config.yaml\")\n log.info({ file: log.filePath(effectiveConfigFile) }, \"writing effective config\")\n await outputFile(effectiveConfigFile, getSafeEffectiveConfig(this.config))\n }\n\n // because artifact event maybe dispatched several times for different publish providers\n const artifactPaths = new Set<string>()\n this.artifactCreated(event => {\n if (event.file != null) {\n artifactPaths.add(event.file)\n }\n })\n\n this.disposeOnBuildFinish(() => this.tempDirManager.cleanup())\n const platformToTargets = await executeFinally(this.doBuild(), async () => {\n if (this.debugLogger.isEnabled) {\n await this.debugLogger.save(path.join(commonOutDirWithoutPossibleOsMacro, \"builder-debug.yml\"))\n }\n\n const toDispose = this.toDispose.slice()\n this.toDispose.length = 0\n for (const disposer of toDispose) {\n await disposer().catch((e: any) => {\n log.warn({ error: e }, \"cannot dispose\")\n })\n }\n })\n\n return {\n outDir: commonOutDirWithoutPossibleOsMacro,\n artifactPaths: Array.from(artifactPaths),\n platformToTargets,\n configuration: this.config,\n }\n }\n\n private async readProjectMetadataIfTwoPackageStructureOrPrepacked(appPackageFile: string): Promise<Metadata> {\n let data = await orNullIfFileNotExist(readPackageJson(appPackageFile))\n if (data != null) {\n return data\n }\n\n data = await orNullIfFileNotExist(readAsarJson(path.join(this.projectDir, \"app.asar\"), \"package.json\"))\n if (data != null) {\n this._isPrepackedAppAsar = true\n return data\n }\n\n throw new Error(`Cannot find package.json in the ${path.dirname(appPackageFile)}`)\n }\n\n private async doBuild(): Promise<Map<Platform, Map<string, Target>>> {\n const taskManager = new AsyncTaskManager(this.cancellationToken)\n const syncTargetsIfAny = [] as Target[]\n\n const platformToTarget = new Map<Platform, Map<string, Target>>()\n const createdOutDirs = new Set<string>()\n\n for (const [platform, archToType] of this.options.targets!) {\n if (this.cancellationToken.cancelled) {\n break\n }\n\n if (platform === Platform.MAC && process.platform === Platform.WINDOWS.nodeName) {\n throw new InvalidConfigurationError(\"Build for macOS is supported only on macOS, please see https://electron.build/multi-platform-build\")\n }\n\n const packager = await this.createHelper(platform)\n const nameToTarget: Map<string, Target> = new Map()\n platformToTarget.set(platform, nameToTarget)\n\n for (const [arch, targetNames] of computeArchToTargetNamesMap(archToType, packager, platform)) {\n if (this.cancellationToken.cancelled) {\n break\n }\n\n // support os and arch macro in output value\n const outDir = path.resolve(this.projectDir, packager.expandMacro(this.config.directories!.output!, Arch[arch]))\n const targetList = createTargets(nameToTarget, targetNames.length === 0 ? packager.defaultTarget : targetNames, outDir, packager)\n await createOutDirIfNeed(targetList, createdOutDirs)\n await packager.pack(outDir, arch, targetList, taskManager)\n }\n\n if (this.cancellationToken.cancelled) {\n break\n }\n\n for (const target of nameToTarget.values()) {\n if (target.isAsyncSupported) {\n taskManager.addTask(target.finishBuild())\n } else {\n syncTargetsIfAny.push(target)\n }\n }\n }\n\n await taskManager.awaitTasks()\n\n for (const target of syncTargetsIfAny) {\n await target.finishBuild()\n }\n return platformToTarget\n }\n\n private async createHelper(platform: Platform): Promise<PlatformPackager<any>> {\n if (this.options.platformPackagerFactory != null) {\n return this.options.platformPackagerFactory(this, platform)\n }\n\n switch (platform) {\n case Platform.MAC: {\n const helperClass = (await import(\"./macPackager\")).MacPackager\n return new helperClass(this)\n }\n\n case Platform.WINDOWS: {\n const helperClass = (await import(\"./winPackager\")).WinPackager\n return new helperClass(this)\n }\n\n case Platform.LINUX:\n return new (await import(\"./linuxPackager\")).LinuxPackager(this)\n\n default:\n throw new Error(`Unknown platform: ${platform}`)\n }\n }\n\n public async installAppDependencies(platform: Platform, arch: Arch): Promise<any> {\n if (this.options.prepackaged != null || !this.framework.isNpmRebuildRequired) {\n return\n }\n\n const frameworkInfo = { version: this.framework.version, useCustomDist: true }\n const config = this.config\n if (config.nodeGypRebuild === true) {\n await nodeGypRebuild(platform.nodeName, Arch[arch], frameworkInfo)\n }\n\n if (config.npmRebuild === false) {\n log.info({ reason: \"npmRebuild is set to false\" }, \"skipped dependencies rebuild\")\n return\n }\n\n const beforeBuild = await resolveFunction(this.appInfo.type, config.beforeBuild, \"beforeBuild\")\n if (beforeBuild != null) {\n const performDependenciesInstallOrRebuild = await beforeBuild({\n appDir: this.appDir,\n electronVersion: this.config.electronVersion!,\n platform,\n arch: Arch[arch],\n })\n\n // If beforeBuild resolves to false, it means that handling node_modules is done outside of electron-builder.\n this._nodeModulesHandledExternally = !performDependenciesInstallOrRebuild\n if (!performDependenciesInstallOrRebuild) {\n return\n }\n }\n\n if (config.buildDependenciesFromSource === true && platform.nodeName !== process.platform) {\n log.info({ reason: \"platform is different and buildDependenciesFromSource is set to true\" }, \"skipped dependencies rebuild\")\n } else {\n await installOrRebuild(config, this.appDir, {\n frameworkInfo,\n platform: platform.nodeName,\n arch: Arch[arch],\n productionDeps: this.getNodeDependencyInfo(null, false) as Lazy<Array<NodeModuleDirInfo>>,\n })\n }\n }\n\n async afterPack(context: AfterPackContext): Promise<any> {\n const afterPack = await resolveFunction(this.appInfo.type, this.config.afterPack, \"afterPack\")\n const handlers = this.afterPackHandlers.slice()\n if (afterPack != null) {\n // user handler should be last\n handlers.push(afterPack)\n }\n\n for (const handler of handlers) {\n await Promise.resolve(handler(context))\n }\n }\n}\n\nfunction createOutDirIfNeed(targetList: Array<Target>, createdOutDirs: Set<string>): Promise<any> {\n const ourDirs = new Set<string>()\n for (const target of targetList) {\n // noinspection SuspiciousInstanceOfGuard\n if (target instanceof NoOpTarget) {\n continue\n }\n\n const outDir = target.outDir\n if (!createdOutDirs.has(outDir)) {\n ourDirs.add(outDir)\n }\n }\n\n if (ourDirs.size === 0) {\n return Promise.resolve()\n }\n\n return Promise.all(\n Array.from(ourDirs)\n .sort()\n .map(dir => {\n return mkdirs(dir)\n .then(() => chmod(dir, 0o755) /* set explicitly */)\n .then(() => createdOutDirs.add(dir))\n })\n )\n}\n\nexport interface BuildResult {\n readonly outDir: string\n readonly artifactPaths: Array<string>\n readonly platformToTargets: Map<Platform, Map<string, Target>>\n readonly configuration: Configuration\n}\n\nfunction getSafeEffectiveConfig(configuration: Configuration): string {\n const o = JSON.parse(safeStringifyJson(configuration))\n if (o.cscLink != null) {\n o.cscLink = \"<hidden by builder>\"\n }\n return serializeToYaml(o, true)\n}\n"]}
|
|
@@ -21,9 +21,9 @@ export declare abstract class PlatformPackager<DC extends PlatformSpecificBuildO
|
|
|
21
21
|
protected prepareAppInfo(appInfo: AppInfo): AppInfo;
|
|
22
22
|
private static normalizePlatformSpecificBuildOptions;
|
|
23
23
|
abstract createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
getCscPassword(): string;
|
|
25
|
+
getCscLink(extraEnvName?: string | null): string | null | undefined;
|
|
26
|
+
doGetCscPassword(): string | null | undefined;
|
|
27
27
|
protected computeAppOutDir(outDir: string, arch: Arch): string;
|
|
28
28
|
dispatchArtifactCreated(file: string, target: Target | null, arch: Arch | null, safeArtifactName?: string | null): Promise<void>;
|
|
29
29
|
pack(outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): Promise<any>;
|
|
@@ -70,5 +70,4 @@ export type IconFormat = "icns" | "ico" | "set";
|
|
|
70
70
|
export declare function isSafeGithubName(name: string): boolean;
|
|
71
71
|
export declare function computeSafeArtifactNameIfNeeded(suggestedName: string | null, safeNameProducer: () => string): string | null;
|
|
72
72
|
export declare function normalizeExt(ext: string): string;
|
|
73
|
-
export declare function
|
|
74
|
-
export declare function chooseNotNull(v1: string | null | undefined, v2: string | null | undefined): string | null | undefined;
|
|
73
|
+
export declare function chooseNotNull<T>(v1: T | null | undefined, v2: T | null | undefined): T | null | undefined;
|
package/out/platformPackager.js
CHANGED
|
@@ -4,7 +4,6 @@ exports.PlatformPackager = void 0;
|
|
|
4
4
|
exports.isSafeGithubName = isSafeGithubName;
|
|
5
5
|
exports.computeSafeArtifactNameIfNeeded = computeSafeArtifactNameIfNeeded;
|
|
6
6
|
exports.normalizeExt = normalizeExt;
|
|
7
|
-
exports.resolveFunction = resolveFunction;
|
|
8
7
|
exports.chooseNotNull = chooseNotNull;
|
|
9
8
|
const bluebird_lst_1 = require("bluebird-lst");
|
|
10
9
|
const builder_util_1 = require("builder-util");
|
|
@@ -12,7 +11,6 @@ const builder_util_2 = require("builder-util");
|
|
|
12
11
|
const promises_1 = require("fs/promises");
|
|
13
12
|
const lazy_val_1 = require("lazy-val");
|
|
14
13
|
const path = require("path");
|
|
15
|
-
const url_1 = require("url");
|
|
16
14
|
const appInfo_1 = require("./appInfo");
|
|
17
15
|
const asarFileChecker_1 = require("./asar/asarFileChecker");
|
|
18
16
|
const asarUtil_1 = require("./asar/asarUtil");
|
|
@@ -24,6 +22,7 @@ const index_1 = require("./index");
|
|
|
24
22
|
const appBuilder_1 = require("./util/appBuilder");
|
|
25
23
|
const appFileCopier_1 = require("./util/appFileCopier");
|
|
26
24
|
const macroExpander_1 = require("./util/macroExpander");
|
|
25
|
+
const resolve_1 = require("./util/resolve");
|
|
27
26
|
class PlatformPackager {
|
|
28
27
|
get packagerOptions() {
|
|
29
28
|
return this.info.options;
|
|
@@ -151,7 +150,7 @@ class PlatformPackager {
|
|
|
151
150
|
}
|
|
152
151
|
// Due to node-gyp rewriting GYP_MSVS_VERSION when reused across the same session, we must reset the env var: https://github.com/electron-userland/electron-builder/issues/7256
|
|
153
152
|
delete process.env.GYP_MSVS_VERSION;
|
|
154
|
-
const beforePack = await resolveFunction(this.appInfo.type, this.config.beforePack, "beforePack");
|
|
153
|
+
const beforePack = await (0, resolve_1.resolveFunction)(this.appInfo.type, this.config.beforePack, "beforePack");
|
|
155
154
|
if (beforePack != null) {
|
|
156
155
|
await beforePack({
|
|
157
156
|
appOutDir,
|
|
@@ -180,7 +179,7 @@ class PlatformPackager {
|
|
|
180
179
|
arch: builder_util_1.Arch[arch],
|
|
181
180
|
version: framework.version,
|
|
182
181
|
});
|
|
183
|
-
const afterExtract = await resolveFunction(this.appInfo.type, this.config.afterExtract, "afterExtract");
|
|
182
|
+
const afterExtract = await (0, resolve_1.resolveFunction)(this.appInfo.type, this.config.afterExtract, "afterExtract");
|
|
184
183
|
if (afterExtract != null) {
|
|
185
184
|
await afterExtract({
|
|
186
185
|
appOutDir,
|
|
@@ -265,7 +264,7 @@ class PlatformPackager {
|
|
|
265
264
|
electronPlatformName: platformName,
|
|
266
265
|
};
|
|
267
266
|
const didSign = await this.signApp(packContext, isAsar);
|
|
268
|
-
const afterSign = await resolveFunction(this.appInfo.type, this.config.afterSign, "afterSign");
|
|
267
|
+
const afterSign = await (0, resolve_1.resolveFunction)(this.appInfo.type, this.config.afterSign, "afterSign");
|
|
269
268
|
if (afterSign != null) {
|
|
270
269
|
if (didSign) {
|
|
271
270
|
await Promise.resolve(afterSign(packContext));
|
|
@@ -601,51 +600,6 @@ function computeSafeArtifactNameIfNeeded(suggestedName, safeNameProducer) {
|
|
|
601
600
|
function normalizeExt(ext) {
|
|
602
601
|
return ext.startsWith(".") ? ext.substring(1) : ext;
|
|
603
602
|
}
|
|
604
|
-
async function resolveModule(type, name) {
|
|
605
|
-
var _a, _b, _c;
|
|
606
|
-
const extension = path.extname(name).toLowerCase();
|
|
607
|
-
const isModuleType = type === "module";
|
|
608
|
-
try {
|
|
609
|
-
if (extension === ".mjs" || (extension === ".js" && isModuleType)) {
|
|
610
|
-
const fileUrl = (0, url_1.pathToFileURL)(name).href;
|
|
611
|
-
return await eval("import('" + fileUrl + "')");
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
catch (error) {
|
|
615
|
-
builder_util_1.log.debug({ moduleName: name, message: (_a = error.message) !== null && _a !== void 0 ? _a : error.stack }, "Unable to dynamically import hook, falling back to `require`");
|
|
616
|
-
}
|
|
617
|
-
try {
|
|
618
|
-
return require(name);
|
|
619
|
-
}
|
|
620
|
-
catch (error) {
|
|
621
|
-
builder_util_1.log.error({ moduleName: name, message: (_b = error.message) !== null && _b !== void 0 ? _b : error.stack }, "Unable to `require` hook");
|
|
622
|
-
throw new Error((_c = error.message) !== null && _c !== void 0 ? _c : error.stack);
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
async function resolveFunction(type, executor, name) {
|
|
626
|
-
if (executor == null || typeof executor !== "string") {
|
|
627
|
-
return executor;
|
|
628
|
-
}
|
|
629
|
-
let p = executor;
|
|
630
|
-
if (p.startsWith(".")) {
|
|
631
|
-
p = path.resolve(p);
|
|
632
|
-
}
|
|
633
|
-
try {
|
|
634
|
-
p = require.resolve(p);
|
|
635
|
-
}
|
|
636
|
-
catch (e) {
|
|
637
|
-
(0, builder_util_1.debug)(e);
|
|
638
|
-
p = path.resolve(p);
|
|
639
|
-
}
|
|
640
|
-
const m = await resolveModule(type, p);
|
|
641
|
-
const namedExport = m[name];
|
|
642
|
-
if (namedExport == null) {
|
|
643
|
-
return m.default || m;
|
|
644
|
-
}
|
|
645
|
-
else {
|
|
646
|
-
return namedExport;
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
603
|
function chooseNotNull(v1, v2) {
|
|
650
604
|
return v1 == null ? v2 : v1;
|
|
651
605
|
}
|