diff --git a/docs/api/electron-builder-http.md b/docs/api/electron-builder-http.md index 8225e37ff6f..a9570947f6b 100644 --- a/docs/api/electron-builder-http.md +++ b/docs/api/electron-builder-http.md @@ -7,6 +7,8 @@
electron-builder-http/out/ProgressCallbackTransform
+
electron-builder-http/out/rfc2253Parser
+
electron-builder-http
@@ -220,6 +222,18 @@ | encoding | String | | callback | function | + + +## electron-builder-http/out/rfc2253Parser + + +### `electron-builder-http/out/rfc2253Parser.parseDn(seq)` ⇒ Map<String \| String> +**Kind**: method of [electron-builder-http/out/rfc2253Parser](#module_electron-builder-http/out/rfc2253Parser) + +| Param | Type | +| --- | --- | +| seq | String | + ## electron-builder-http diff --git a/docs/api/electron-builder.md b/docs/api/electron-builder.md index 8773fc8c4d3..33ea329847d 100644 --- a/docs/api/electron-builder.md +++ b/docs/api/electron-builder.md @@ -467,11 +467,12 @@ * [electron-builder/out/linuxPackager](#module_electron-builder/out/linuxPackager) * [.LinuxPackager](#LinuxPackager) ⇐ [PlatformPackager](#PlatformPackager) * [`.createTargets(targets, mapper, cleanupTasks)`](#module_electron-builder/out/linuxPackager.LinuxPackager+createTargets) + * [`.computeSafeArtifactName(ext, arch, skipArchIfX64)`](#module_electron-builder/out/platformPackager.PlatformPackager+computeSafeArtifactName) ⇒ String * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< \| String> * [`.dispatchArtifactCreated(file, target, arch, safeArtifactName)`](#module_electron-builder/out/platformPackager.PlatformPackager+dispatchArtifactCreated) * [`.getElectronDestDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getElectronDestDir) ⇒ String * [`.getElectronSrcDir(dist)`](#module_electron-builder/out/platformPackager.PlatformPackager+getElectronSrcDir) ⇒ String - * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ String + * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern, skipArchIfX64)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ String * [`.expandMacro(pattern, arch, extra)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandMacro) ⇒ String * [`.generateName(ext, arch, deployment, classifier)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName) ⇒ String * [`.generateName2(ext, classifier, deployment)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName2) ⇒ String @@ -498,11 +499,12 @@ * [.LinuxPackager](#LinuxPackager) ⇐ [PlatformPackager](#PlatformPackager) * [`.createTargets(targets, mapper, cleanupTasks)`](#module_electron-builder/out/linuxPackager.LinuxPackager+createTargets) + * [`.computeSafeArtifactName(ext, arch, skipArchIfX64)`](#module_electron-builder/out/platformPackager.PlatformPackager+computeSafeArtifactName) ⇒ String * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< \| String> * [`.dispatchArtifactCreated(file, target, arch, safeArtifactName)`](#module_electron-builder/out/platformPackager.PlatformPackager+dispatchArtifactCreated) * [`.getElectronDestDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getElectronDestDir) ⇒ String * [`.getElectronSrcDir(dist)`](#module_electron-builder/out/platformPackager.PlatformPackager+getElectronSrcDir) ⇒ String - * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ String + * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern, skipArchIfX64)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ String * [`.expandMacro(pattern, arch, extra)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandMacro) ⇒ String * [`.generateName(ext, arch, deployment, classifier)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName) ⇒ String * [`.generateName2(ext, classifier, deployment)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName2) ⇒ String @@ -525,6 +527,17 @@ | mapper | callback | | cleanupTasks | Array<module:electron-builder/out/linuxPackager.__type> | + + +#### `linuxPackager.computeSafeArtifactName(ext, arch, skipArchIfX64)` ⇒ String +**Kind**: instance method of [LinuxPackager](#LinuxPackager) + +| Param | Type | +| --- | --- | +| ext | String | +| arch | [Arch](electron-builder-core#Arch) \| null | +| skipArchIfX64 | | + #### `linuxPackager.getDefaultIcon(ext)` ⇒ Promise< \| String> @@ -566,7 +579,7 @@ -#### `linuxPackager.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern)` ⇒ String +#### `linuxPackager.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern, skipArchIfX64)` ⇒ String **Kind**: instance method of [LinuxPackager](#LinuxPackager) | Param | Type | @@ -575,6 +588,7 @@ | ext | String | | arch | [Arch](electron-builder-core#Arch) \| null | | defaultPattern | String | +| skipArchIfX64 | | @@ -674,9 +688,10 @@ * [`.getElectronSrcDir(dist)`](#module_electron-builder/out/macPackager.MacPackager+getElectronSrcDir) ⇒ String * [`.getIconPath()`](#module_electron-builder/out/macPackager.MacPackager+getIconPath) ⇒ Promise< \| String> * [`.pack(outDir, arch, targets, postAsyncTasks)`](#module_electron-builder/out/macPackager.MacPackager+pack) ⇒ Promise<any> + * [`.computeSafeArtifactName(ext, arch, skipArchIfX64)`](#module_electron-builder/out/platformPackager.PlatformPackager+computeSafeArtifactName) ⇒ String * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< \| String> * [`.dispatchArtifactCreated(file, target, arch, safeArtifactName)`](#module_electron-builder/out/platformPackager.PlatformPackager+dispatchArtifactCreated) - * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ String + * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern, skipArchIfX64)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ String * [`.expandMacro(pattern, arch, extra)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandMacro) ⇒ String * [`.generateName(ext, arch, deployment, classifier)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName) ⇒ String * [`.generateName2(ext, classifier, deployment)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName2) ⇒ String @@ -705,9 +720,10 @@ * [`.getElectronSrcDir(dist)`](#module_electron-builder/out/macPackager.MacPackager+getElectronSrcDir) ⇒ String * [`.getIconPath()`](#module_electron-builder/out/macPackager.MacPackager+getIconPath) ⇒ Promise< \| String> * [`.pack(outDir, arch, targets, postAsyncTasks)`](#module_electron-builder/out/macPackager.MacPackager+pack) ⇒ Promise<any> + * [`.computeSafeArtifactName(ext, arch, skipArchIfX64)`](#module_electron-builder/out/platformPackager.PlatformPackager+computeSafeArtifactName) ⇒ String * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< \| String> * [`.dispatchArtifactCreated(file, target, arch, safeArtifactName)`](#module_electron-builder/out/platformPackager.PlatformPackager+dispatchArtifactCreated) - * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ String + * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern, skipArchIfX64)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ String * [`.expandMacro(pattern, arch, extra)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandMacro) ⇒ String * [`.generateName(ext, arch, deployment, classifier)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName) ⇒ String * [`.generateName2(ext, classifier, deployment)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName2) ⇒ String @@ -766,6 +782,17 @@ | targets | Array<[Target](electron-builder-core#Target)> | | postAsyncTasks | Array<Promise<any>> | + + +#### `macPackager.computeSafeArtifactName(ext, arch, skipArchIfX64)` ⇒ String +**Kind**: instance method of [MacPackager](#MacPackager) + +| Param | Type | +| --- | --- | +| ext | String | +| arch | [Arch](electron-builder-core#Arch) \| null | +| skipArchIfX64 | | + #### `macPackager.getDefaultIcon(ext)` ⇒ Promise< \| String> @@ -789,7 +816,7 @@ -#### `macPackager.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern)` ⇒ String +#### `macPackager.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern, skipArchIfX64)` ⇒ String **Kind**: instance method of [MacPackager](#MacPackager) | Param | Type | @@ -798,6 +825,7 @@ | ext | String | | arch | [Arch](electron-builder-core#Arch) \| null | | defaultPattern | String | +| skipArchIfX64 | | @@ -916,12 +944,13 @@ * [electron-builder/out/platformPackager](#module_electron-builder/out/platformPackager) * [.PlatformPackager](#PlatformPackager) + * [`.computeSafeArtifactName(ext, arch, skipArchIfX64)`](#module_electron-builder/out/platformPackager.PlatformPackager+computeSafeArtifactName) ⇒ String * [`.createTargets(targets, mapper, cleanupTasks)`](#module_electron-builder/out/platformPackager.PlatformPackager+createTargets) * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< \| String> * [`.dispatchArtifactCreated(file, target, arch, safeArtifactName)`](#module_electron-builder/out/platformPackager.PlatformPackager+dispatchArtifactCreated) * [`.getElectronDestDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getElectronDestDir) ⇒ String * [`.getElectronSrcDir(dist)`](#module_electron-builder/out/platformPackager.PlatformPackager+getElectronSrcDir) ⇒ String - * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ String + * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern, skipArchIfX64)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ String * [`.expandMacro(pattern, arch, extra)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandMacro) ⇒ String * [`.generateName(ext, arch, deployment, classifier)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName) ⇒ String * [`.generateName2(ext, classifier, deployment)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName2) ⇒ String @@ -959,12 +988,13 @@ * [.PlatformPackager](#PlatformPackager) + * [`.computeSafeArtifactName(ext, arch, skipArchIfX64)`](#module_electron-builder/out/platformPackager.PlatformPackager+computeSafeArtifactName) ⇒ String * [`.createTargets(targets, mapper, cleanupTasks)`](#module_electron-builder/out/platformPackager.PlatformPackager+createTargets) * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< \| String> * [`.dispatchArtifactCreated(file, target, arch, safeArtifactName)`](#module_electron-builder/out/platformPackager.PlatformPackager+dispatchArtifactCreated) * [`.getElectronDestDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getElectronDestDir) ⇒ String * [`.getElectronSrcDir(dist)`](#module_electron-builder/out/platformPackager.PlatformPackager+getElectronSrcDir) ⇒ String - * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ String + * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern, skipArchIfX64)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ String * [`.expandMacro(pattern, arch, extra)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandMacro) ⇒ String * [`.generateName(ext, arch, deployment, classifier)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName) ⇒ String * [`.generateName2(ext, classifier, deployment)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName2) ⇒ String @@ -975,6 +1005,17 @@ * [`.getResourcesDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getResourcesDir) ⇒ String * [`.getTempFile(suffix)`](#module_electron-builder/out/platformPackager.PlatformPackager+getTempFile) ⇒ Promise<String> + + +#### `platformPackager.computeSafeArtifactName(ext, arch, skipArchIfX64)` ⇒ String +**Kind**: instance method of [PlatformPackager](#PlatformPackager) + +| Param | Type | +| --- | --- | +| ext | String | +| arch | [Arch](electron-builder-core#Arch) \| null | +| skipArchIfX64 | | + #### `platformPackager.createTargets(targets, mapper, cleanupTasks)` @@ -1027,7 +1068,7 @@ -#### `platformPackager.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern)` ⇒ String +#### `platformPackager.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern, skipArchIfX64)` ⇒ String **Kind**: instance method of [PlatformPackager](#PlatformPackager) | Param | Type | @@ -1036,6 +1077,7 @@ | ext | String | | arch | [Arch](electron-builder-core#Arch) \| null | | defaultPattern | String | +| skipArchIfX64 | | @@ -1252,6 +1294,7 @@ * [electron-builder/out/targets/appx](#module_electron-builder/out/targets/appx) * [.AppXTarget](#AppXTarget) ⇐ [Target](electron-builder-core#Target) * [`.build(appOutDir, arch)`](#module_electron-builder/out/targets/appx.AppXTarget+build) ⇒ Promise<any> + * [`.quoteString(s)`](#module_electron-builder/out/targets/appx.quoteString) ⇒ String @@ -1274,6 +1317,15 @@ | appOutDir | String | | arch | [Arch](electron-builder-core#Arch) | + + +### `electron-builder/out/targets/appx.quoteString(s)` ⇒ String +**Kind**: method of [electron-builder/out/targets/appx](#module_electron-builder/out/targets/appx) + +| Param | Type | +| --- | --- | +| s | String | + ## electron-builder/out/targets/ArchiveTarget @@ -1753,11 +1805,12 @@ * [`.getIconPath()`](#module_electron-builder/out/winPackager.WinPackager+getIconPath) ⇒ Promise<String> * [`.sign(file, logMessagePrefix)`](#module_electron-builder/out/winPackager.WinPackager+sign) ⇒ Promise<void> * [`.signAndEditResources(file)`](#module_electron-builder/out/winPackager.WinPackager+signAndEditResources) ⇒ Promise<void> + * [`.computeSafeArtifactName(ext, arch, skipArchIfX64)`](#module_electron-builder/out/platformPackager.PlatformPackager+computeSafeArtifactName) ⇒ String * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< \| String> * [`.dispatchArtifactCreated(file, target, arch, safeArtifactName)`](#module_electron-builder/out/platformPackager.PlatformPackager+dispatchArtifactCreated) * [`.getElectronDestDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getElectronDestDir) ⇒ String * [`.getElectronSrcDir(dist)`](#module_electron-builder/out/platformPackager.PlatformPackager+getElectronSrcDir) ⇒ String - * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ String + * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern, skipArchIfX64)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ String * [`.expandMacro(pattern, arch, extra)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandMacro) ⇒ String * [`.generateName(ext, arch, deployment, classifier)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName) ⇒ String * [`.generateName2(ext, classifier, deployment)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName2) ⇒ String @@ -1827,9 +1880,9 @@ if (publisherName == null && cscFile != null) { if (process.platform === "win32") { try { - const subject = (await exec("powershell.exe", [`(Get-PfxCertificate "${cscFile}").Subject`])).trim().match(/CN=([^,]+)/) + const subject = parseDn(await exec("powershell.exe", [`(Get-PfxCertificate "${cscFile}").Subject`])).get("CN") if (subject) { - return asArray(subject[1]) + return asArray(subject) } } catch (e) { @@ -1861,11 +1914,12 @@ * [`.getIconPath()`](#module_electron-builder/out/winPackager.WinPackager+getIconPath) ⇒ Promise<String> * [`.sign(file, logMessagePrefix)`](#module_electron-builder/out/winPackager.WinPackager+sign) ⇒ Promise<void> * [`.signAndEditResources(file)`](#module_electron-builder/out/winPackager.WinPackager+signAndEditResources) ⇒ Promise<void> + * [`.computeSafeArtifactName(ext, arch, skipArchIfX64)`](#module_electron-builder/out/platformPackager.PlatformPackager+computeSafeArtifactName) ⇒ String * [`.getDefaultIcon(ext)`](#module_electron-builder/out/platformPackager.PlatformPackager+getDefaultIcon) ⇒ Promise< \| String> * [`.dispatchArtifactCreated(file, target, arch, safeArtifactName)`](#module_electron-builder/out/platformPackager.PlatformPackager+dispatchArtifactCreated) * [`.getElectronDestDir(appOutDir)`](#module_electron-builder/out/platformPackager.PlatformPackager+getElectronDestDir) ⇒ String * [`.getElectronSrcDir(dist)`](#module_electron-builder/out/platformPackager.PlatformPackager+getElectronSrcDir) ⇒ String - * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ String + * [`.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern, skipArchIfX64)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandArtifactNamePattern) ⇒ String * [`.expandMacro(pattern, arch, extra)`](#module_electron-builder/out/platformPackager.PlatformPackager+expandMacro) ⇒ String * [`.generateName(ext, arch, deployment, classifier)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName) ⇒ String * [`.generateName2(ext, classifier, deployment)`](#module_electron-builder/out/platformPackager.PlatformPackager+generateName2) ⇒ String @@ -1911,6 +1965,17 @@ | --- | --- | | file | String | + + +#### `winPackager.computeSafeArtifactName(ext, arch, skipArchIfX64)` ⇒ String +**Kind**: instance method of [WinPackager](#WinPackager) + +| Param | Type | +| --- | --- | +| ext | String | +| arch | [Arch](electron-builder-core#Arch) \| null | +| skipArchIfX64 | | + #### `winPackager.getDefaultIcon(ext)` ⇒ Promise< \| String> @@ -1952,7 +2017,7 @@ -#### `winPackager.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern)` ⇒ String +#### `winPackager.expandArtifactNamePattern(targetSpecificOptions, ext, arch, defaultPattern, skipArchIfX64)` ⇒ String **Kind**: instance method of [WinPackager](#WinPackager) | Param | Type | @@ -1961,6 +2026,7 @@ | ext | String | | arch | [Arch](electron-builder-core#Arch) \| null | | defaultPattern | String | +| skipArchIfX64 | | diff --git a/jsdoc/helpers.js b/jsdoc/helpers.js index 774e659fb96..411142713df 100644 --- a/jsdoc/helpers.js +++ b/jsdoc/helpers.js @@ -20,6 +20,12 @@ function renderTypeNames(types, delimiter, root, isTypeAsCode, isSkipNull) { const tagOpen = isTypeAsCode ? "" : "" const tagClose = isTypeAsCode ? "" : "" + for (let obj of types) { + if (obj.includes("CancellationToken")) { + break + } + } + if (isSkipNull) { types = types.filter(it => !isSkipNull || it !== "null") } @@ -173,18 +179,7 @@ function _link(input, options) { } } else { - let pageUrl = "" - for (const page of exports.pages) { - if (page.dataMap.has(linked.id)) { - const a = page.data - const b = options.data.root - if (a.length !== b.length && a[a.length - 1] !== b[a.length - 1]) { - pageUrl = page.pageUrl - } - break - } - } - output.url = `${pageUrl}#${anchorName.call(linked, options)}` + output.url = fullLink(linked, options.data.root) } return output } @@ -258,19 +253,23 @@ function identifierToLink(id, root) { } return output } + return `[${linked.name}](${fullLink(linked, root)})` +} +function fullLink(linked, root) { + const relativeName = anchorName.call(linked) let pageUrl = "" for (const page of exports.pages) { if (page.dataMap.has(linked.id)) { const a = page.data const b = root - if (a.length !== b.length && a[a.length - 1] !== b[a.length - 1]) { + if (a.length !== b.length || a[a.length - 1] !== b[a.length - 1]) { pageUrl = page.pageUrl } break } } - return `[${linked.name}](${pageUrl}#${anchorName.call(linked)})` + return `${pageUrl}#${relativeName}` } function resolveById(id) { diff --git a/package.json b/package.json index e0735be2630..4b4aad4d5c2 100644 --- a/package.json +++ b/package.json @@ -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.1.2", + "fcopy-pre-bundled": "0.2.0", "fs-extra-p": "^4.3.0", "hosted-git-info": "^2.4.2", "ini": "^1.3.4", diff --git a/packages/electron-builder-util/package.json b/packages/electron-builder-util/package.json index 1b9d89c8c70..dc40ac5db1e 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.1.2", + "fcopy-pre-bundled": "0.2.0", "is-ci": "^1.0.10", "stat-mode": "^0.2.2", "bluebird-lst": "^1.0.2", diff --git a/packages/electron-builder/src/macPackager.ts b/packages/electron-builder/src/macPackager.ts index cb72ce21a54..0d9b82e1077 100644 --- a/packages/electron-builder/src/macPackager.ts +++ b/packages/electron-builder/src/macPackager.ts @@ -236,7 +236,7 @@ export default class MacPackager extends PlatformPackager { const pkg = path.join(outDir!, this.expandArtifactNamePattern(masOptions, "pkg")) await this.doFlat(appPath, pkg, masInstallerIdentity, keychainName) - this.dispatchArtifactCreated(pkg, null, Arch.x64, `${this.appInfo.name}-${this.appInfo.version}.pkg`) + this.dispatchArtifactCreated(pkg, null, Arch.x64, this.computeSafeArtifactName("pkg")) } } diff --git a/packages/electron-builder/src/platformPackager.ts b/packages/electron-builder/src/platformPackager.ts index 9972335b379..8e21d7270db 100644 --- a/packages/electron-builder/src/platformPackager.ts +++ b/packages/electron-builder/src/platformPackager.ts @@ -341,12 +341,19 @@ export abstract class PlatformPackager await this.checkFileInPackage(resourcesDir, "package.json", "Application", isAsar) } - expandArtifactNamePattern(targetSpecificOptions: TargetSpecificOptions | n, ext: string, arch?: Arch | null, defaultPattern?: string): string { + computeSafeArtifactName(ext: string, arch?: Arch | null, skipArchIfX64 = true) { + return this.computeArtifactName("${name}-${version}-${arch}.${ext}", ext, skipArchIfX64 && arch === Arch.x64 ? null : arch) + } + + expandArtifactNamePattern(targetSpecificOptions: TargetSpecificOptions | n, ext: string, arch?: Arch | null, defaultPattern?: string, skipArchIfX64 = true): string { let pattern = targetSpecificOptions == null ? null : targetSpecificOptions.artifactName if (pattern == null) { - pattern = this.platformSpecificBuildOptions.artifactName || this.config.artifactName || defaultPattern || "${productName}-${version}.${ext}" + pattern = this.platformSpecificBuildOptions.artifactName || this.config.artifactName || defaultPattern || "${productName}-${version}-${arch}.${ext}" } + return this.computeArtifactName(pattern, ext, skipArchIfX64 && arch === Arch.x64 ? null : arch) + } + private computeArtifactName(pattern: any, ext: string, arch: Arch | null | undefined) { let archName: string | null = arch == null ? null : Arch[arch] if (arch === Arch.x64) { if (ext === "AppImage" || ext === "rpm") { diff --git a/packages/electron-builder/src/targets/ArchiveTarget.ts b/packages/electron-builder/src/targets/ArchiveTarget.ts index f36759cfbdb..a42182cecbf 100644 --- a/packages/electron-builder/src/targets/ArchiveTarget.ts +++ b/packages/electron-builder/src/targets/ArchiveTarget.ts @@ -18,7 +18,7 @@ export class ArchiveTarget extends Target { log(`Building ${isMac ? "macOS " : ""}${format}`) // do not specify arch if x64 - const outFile = path.join(this.outDir, packager.expandArtifactNamePattern(this.options, format, arch === Arch.x64 ? null : arch, packager.platform === Platform.LINUX ? "${name}-${version}-${arch}.${ext}" : "${productName}-${version}-${arch}-${os}.${ext}")) + const outFile = path.join(this.outDir, packager.expandArtifactNamePattern(this.options, format, arch, packager.platform === Platform.LINUX ? "${name}-${version}-${arch}.${ext}" : "${productName}-${version}-${arch}-${os}.${ext}")) if (format.startsWith("tar.")) { await tar(packager.config.compression, format, outFile, appOutDir, isMac) } diff --git a/packages/electron-builder/src/targets/appImage.ts b/packages/electron-builder/src/targets/appImage.ts index feccba0fe95..58c19e8efc0 100644 --- a/packages/electron-builder/src/targets/appImage.ts +++ b/packages/electron-builder/src/targets/appImage.ts @@ -38,7 +38,7 @@ export default class AppImageTarget extends Target { const packager = this.packager // https://github.com/electron-userland/electron-builder/issues/775 - const resultFile = path.join(this.outDir, packager.expandArtifactNamePattern(this.options, "AppImage", arch, "${name}-${version}-${arch}.${ext}")) + const resultFile = path.join(this.outDir, packager.computeSafeArtifactName("AppImage", arch, false)) await unlinkIfExists(resultFile) const appImagePath = await appImagePathPromise diff --git a/packages/electron-builder/src/targets/appx.ts b/packages/electron-builder/src/targets/appx.ts index f3d1eb16cad..274ead0beca 100644 --- a/packages/electron-builder/src/targets/appx.ts +++ b/packages/electron-builder/src/targets/appx.ts @@ -72,7 +72,7 @@ export default class AppXTarget extends Target { await spawn(path.join(vendorPath, "windows-10", arch === Arch.ia32 ? "ia32" : "x64", "makeappx.exe"), args) await packager.sign(destination) - packager.dispatchArtifactCreated(destination, this, arch, packager.expandArtifactNamePattern(this.options, "appx", arch, "${name}-${version}-${arch}.${ext}")) + packager.dispatchArtifactCreated(destination, this, arch, packager.computeSafeArtifactName("appx")) } private async writeManifest(templatePath: string, preAppx: string, safeName: string, arch: Arch, publisher: string) { diff --git a/packages/electron-builder/src/targets/dmg.ts b/packages/electron-builder/src/targets/dmg.ts index ba76e0ff905..b71ce04c428 100644 --- a/packages/electron-builder/src/targets/dmg.ts +++ b/packages/electron-builder/src/targets/dmg.ts @@ -23,7 +23,6 @@ export class DmgTarget extends Target { async build(appPath: string, arch: Arch) { const packager = this.packager - const appInfo = packager.appInfo log("Building DMG") const specification = await this.computeDmgOptions() @@ -178,7 +177,7 @@ export class DmgTarget extends Target { await addLicenseToDmg(packager, artifactPath) - this.packager.dispatchArtifactCreated(artifactPath, this, arch, `${appInfo.name}-${appInfo.version}.dmg`) + this.packager.dispatchArtifactCreated(artifactPath, this, arch, packager.computeSafeArtifactName("dmg")) } computeVolumeName(custom?: string | null): string { diff --git a/packages/electron-builder/src/targets/fpm.ts b/packages/electron-builder/src/targets/fpm.ts index b80813b2d9c..5a85a9b2c91 100644 --- a/packages/electron-builder/src/targets/fpm.ts +++ b/packages/electron-builder/src/targets/fpm.ts @@ -78,7 +78,7 @@ export default class FpmTarget extends Target { isUseArchIfX64 = true } - const destination = path.join(this.outDir, this.packager.expandArtifactNamePattern(this.options, target, arch !== Arch.x64 || isUseArchIfX64 ? arch : null, nameFormat)) + const destination = path.join(this.outDir, this.packager.expandArtifactNamePattern(this.options, target, arch, nameFormat, !isUseArchIfX64)) await unlinkIfExists(destination) if (this.packager.info.prepackaged != null) { await ensureDir(this.outDir) diff --git a/packages/jsdoc2md.js b/packages/jsdoc2md.js index b7991db4940..f1c88436943 100644 --- a/packages/jsdoc2md.js +++ b/packages/jsdoc2md.js @@ -63,6 +63,7 @@ async function main() { "!***/*-dmgLicense.js", "!***/*-repositoryInfo.js", "!***/*-readPackageJson.js", + "!***/*-create-self-signed-cert.js", ], {cwd: source})) .filter(it => !userFiles.includes(it)) @@ -77,10 +78,11 @@ async function main() { {page: "api/electron-updater.md", pageUrl: "electron-updater", files: updaterFiles}, {page: "Publishing Artifacts.md", pageUrl: "Publishing-Artifacts", mainHeader: "API", files: publishOptionsFiles}, + {page: "api/electron-publish.md", pageUrl: "electron-publish", files: publishFiles}, + {page: "api/electron-builder-util.md", pageUrl: "electron-builder-util", files: utilFiles}, {page: "api/electron-builder-core.md", pageUrl: "electron-builder-core", files: coreFiles}, {page: "api/electron-builder-http.md", pageUrl: "electron-builder-http", files: httpFiles}, - {page: "api/electron-publish.md", pageUrl: "electron-publish", files: publishFiles}, ] await render(pages, { @@ -169,7 +171,10 @@ async function render(pages, jsdoc2MdOptions) { sortAutoUpdate(pages) for (const page of pages) { - const finalOptions = Object.assign({data: page.data, "property-list-format": page === pages[0] ? "list" : "table"}, jsdoc2MdOptions) + const finalOptions = Object.assign({ + data: page.data, + "property-list-format": page === pages[0] ? "list" : "table" + }, jsdoc2MdOptions) if (page === pages[0]) { finalOptions["heading-depth"] = 1 diff --git a/test/out/windows/__snapshots__/appxTest.js.snap b/test/out/windows/__snapshots__/appxTest.js.snap index 5648b780213..7d49000a0eb 100644 --- a/test/out/windows/__snapshots__/appxTest.js.snap +++ b/test/out/windows/__snapshots__/appxTest.js.snap @@ -3,10 +3,15 @@ exports[`AppX 1`] = ` Object { "win": Array [ + Object { + "arch": 0, + "file": "Test App ßW-1.1.0-ia32.appx", + "safeArtifactName": "TestApp-1.1.0.appx", + }, Object { "arch": 1, "file": "Test App ßW-1.1.0.appx", - "safeArtifactName": "TestApp-1.1.0-x64.appx", + "safeArtifactName": "TestApp-1.1.0.appx", }, ], } diff --git a/test/src/windows/appxTest.ts b/test/src/windows/appxTest.ts index 0ed53cfaac7..61681ec51e2 100644 --- a/test/src/windows/appxTest.ts +++ b/test/src/windows/appxTest.ts @@ -1,9 +1,9 @@ -import { Platform } from "electron-builder" +import { Arch, Platform } from "electron-builder" import { app } from "../helpers/packTester" // noinspection SpellCheckingInspection test.ifWindows("AppX", app({ - targets: Platform.WINDOWS.createTarget(["appx"]), + targets: Platform.WINDOWS.createTarget(["appx"], Arch.ia32, Arch.x64), cscLink: "MIIKGgIBAzCCCdYGCSqGSIb3DQEHAaCCCccEggnDMIIJvzCCBggGCSqGSIb3DQEHAaCCBfkEggX1MIIF8TCCBe0GCyqGSIb3DQEMCgECoIIE/jCCBPowHAYKKoZIhvcNAQwBAzAOBAjFi6Zs82xXAQICB9AEggTYHjMRS2UaEBy1FAqMRnj3dsmKf1l66ZtETBK5E6LIEluIcDRnouWsz57ANmW7t+z5v6D1GKXeaPrLQVEmct3lpNhHu9f3BT1cJH7LP6NtxIBXYBvQAJusK7cGEC507kt46go/qG+EUhe4/jnJGOKbl9vcWfMf9V9OFOhe3j3hMWE1FbTiJt+eXM6eskV3H6w/vXrLPBZHkigKw+4EE1WB2Nq2tJSKAbEbLzPeGB/CWyQSJyAU8zxCcn8mSab0YjKaK9K/8hmsCqxXHL5d3P53dryBFWkl536tkVFT6U3iD2b9vTdf7RCkuybxiVOAUTfiBy39I77CoJ5zOGXfz5pfSGXn63iBuANiKITHkOREd2whmP74GO80xS2dH6CtvNz03QuYiaQJiXndCrEd8BLTq4hy+IFvNm4kgDULh03cqnwBGwJh4ATSGkztstsNWGb3hBk+99L2Jo77qUYK/L7Uhj0+0i1KG9x2UWL2oklSNtQJ2rkPIjAzIMXCskfoq763j8HMSyNG7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