Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/poor-bats-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"app-builder-lib": minor
"builder-util": minor
---

feat: migrate `electronDownload` to use `electron/get` official package. provides much better support for mirrors
1 change: 1 addition & 0 deletions packages/app-builder-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"@develar/schema-utils": "~2.6.5",
"@electron/asar": "3.4.1",
"@electron/fuses": "^1.8.0",
"@electron/get": "^3.1.0",
"@electron/notarize": "2.5.0",
"@electron/osx-sign": "1.3.3",
"@electron/rebuild": "4.0.1",
Expand Down
42 changes: 40 additions & 2 deletions packages/app-builder-lib/scheme.json
Original file line number Diff line number Diff line change
Expand Up @@ -1071,10 +1071,34 @@
},
"version": {
"type": "string"
},
"checksums": {
"type": "object"
}
},
"type": "object"
},
"ElectronGetOptions": {
"additionalProperties": false,
"properties": {
"checksums": {
"$ref": "#/definitions/Record<string,string>",
"description": "Provides checksums for the artifact as strings.\nCan be used if you already know the checksums of the Electron artifact\nyou are downloading and want to skip the checksum file download\nwithout skipping the checksum validation.\n\nThis should be an object whose keys are the file names of the artifacts and\nthe values are their respective SHA256 checksums."
},
"force": {
"description": "Whether to download an artifact regardless of whether it's in the cache directory.",
"type": "boolean"
},
"isGeneric": {
"const": false,
"type": "boolean"
},
"unsafelyDisableChecksums": {
"description": "When set to `true`, disables checking that the artifact download completed successfully\nwith the correct payload.",
"type": "boolean"
}
}
},
"FileAssociation": {
"additionalProperties": false,
"description": "File associations.\n\nmacOS (corresponds to [CFBundleDocumentTypes](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-101685)), NSIS, and MSI only.\n\nOn Windows (NSIS) works only if [nsis.perMachine](https://www.electron.build/nsis) is set to `true`.",
Expand Down Expand Up @@ -5574,6 +5598,10 @@
],
"type": "object"
},
"Record<string,string>": {
"additionalProperties": false,
"type": "object"
},
"ReleaseInfo": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -7337,8 +7365,18 @@
"description": "The function (or path to file or module id) to be run when staging the electron artifact environment.\nReturns the path to custom Electron build (e.g. `~/electron/out/R`) or folder of electron zips.\n\nZip files must follow the pattern `electron-v${version}-${platformName}-${arch}.zip`, otherwise it will be assumed to be an unpacked Electron app directory"
},
"electronDownload": {
"$ref": "#/definitions/ElectronDownloadOptions",
"description": "The [electron-download](https://github.com/electron-userland/electron-download#usage) options."
"anyOf": [
{
"$ref": "#/definitions/ElectronDownloadOptions"
},
{
"$ref": "#/definitions/ElectronGetOptions"
},
{
"type": "null"
}
],
"description": "The [electron-download](https://github.com/electron-userland/electron-download#usage) options. (legacy)\nAlternatively, you can use [electron/get](https://github.com/electron/get#usage) options."
},
"electronFuses": {
"anyOf": [
Expand Down
8 changes: 5 additions & 3 deletions packages/app-builder-lib/src/configuration.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Arch } from "builder-util"
import { BeforeBuildContext, Target } from "./core"
import { ElectronBrandingOptions, ElectronDownloadOptions } from "./electron/ElectronFramework"
import { ElectronBrandingOptions } from "./electron/ElectronFramework"
import { PrepareApplicationStageDirectoryOptions } from "./Framework"
import { AppXOptions } from "./options/AppXOptions"
import { AppImageOptions, DebOptions, FlatpakOptions, LinuxConfiguration, LinuxTargetSpecificOptions } from "./options/linuxOptions"
Expand All @@ -16,6 +16,7 @@ import { BuildResult } from "./packager"
import { ArtifactBuildStarted, ArtifactCreated } from "./packagerApi"
import { PlatformPackager } from "./platformPackager"
import { NsisOptions, NsisWebOptions, PortableOptions } from "./targets/nsis/nsisOptions"
import { ElectronDownloadOptions, ElectronGetOptions } from "./util/electronGet"

// duplicate appId here because it is important
/**
Expand Down Expand Up @@ -201,9 +202,10 @@ export interface Configuration extends CommonConfiguration, PlatformSpecificBuil
readonly electronCompile?: boolean

/**
* The [electron-download](https://github.com/electron-userland/electron-download#usage) options.
* The [electron-download](https://github.com/electron-userland/electron-download#usage) options. (legacy)
* Alternatively, you can use [electron/get](https://github.com/electron/get#usage) options.
*/
readonly electronDownload?: ElectronDownloadOptions
readonly electronDownload?: ElectronDownloadOptions | ElectronGetOptions | null

/**
* The branding used by Electron's distributables. This is needed if a fork has modified Electron's BRANDING.json file.
Expand Down
Loading
Loading