Skip to content
Permalink
Browse files

refactor: convert from electron-download to @electron/get (#921)

  • Loading branch information
malept committed Jun 13, 2019
1 parent b3fbca8 commit e5f7416519421269cb0fbc61f4aa8fd9f48445d1
@@ -10,7 +10,7 @@ running `electron-forge`. This will print debug information from the specified m
value of the environment variable is a comma-separated list of modules which support this logging
feature. Known modules include:

* `electron-download`
* `@electron/get:*`
* `electron-forge:*` (always use this one before filing an issue)
* `electron-installer-debian`
* `electron-installer-dmg`
@@ -39,6 +39,7 @@
"postinstall": "rimraf node_modules/.bin/*.ps1 && ts-node tools/link-ts.ts"
},
"dependencies": {
"@electron/get": "^1.2.0",
"@octokit/rest": "^16.28.1",
"aws-sdk": "^2.472.0",
"colors": "^1.2.0",
@@ -47,7 +48,6 @@
"cross-spawn-promise": "^0.10.1",
"cross-zip": "^2.1.5",
"debug": "^4.1.0",
"electron-download": "^4.1.1",
"electron-osx-sign": "^0.4.10",
"electron-packager": "^13.0.0",
"electron-rebuild": "^1.8.5",
@@ -38,10 +38,10 @@
"@electron-forge/publisher-base": "6.0.0-beta.39",
"@electron-forge/shared-types": "6.0.0-beta.39",
"@electron-forge/template-webpack": "6.0.0-beta.39",
"@electron/get": "^1.2.0",
"colors": "^1.2.0",
"cross-spawn-promise": "^0.10.1",
"debug": "^4.1.0",
"electron-download": "^4.1.1",
"electron-packager": "^13.0.0",
"electron-rebuild": "^1.8.5",
"find-up": "^4.0.0",
@@ -63,4 +63,4 @@
"engines": {
"node": ">= 8.0"
}
}
}
@@ -111,6 +111,7 @@ export default async ({
const buildToolPackages: {
[key: string]: string | undefined;
} = {
'@electron/get': 'already uses this module as a transitive dependency',
'electron-builder': 'provides mostly equivalent functionality',
'electron-download': 'already uses this module as a transitive dependency',
'electron-forge': 'replaced with @electron-forge/cli',
@@ -1,5 +1,6 @@
import 'colors';
import { asyncOra } from '@electron-forge/async-ora';
import { getHostArch } from '@electron/get';
import {
IForgeResolvableMaker, ForgeConfig, ForgeArch, ForgePlatform, ForgeMakeResult,
} from '@electron-forge/shared-types';
@@ -19,8 +20,6 @@ import requireSearch from '../util/require-search';

import packager from './package';

const { host: hostArch }: { host: () => ForgeArch } = require('electron-download/lib/arch');

class MakerImpl extends MakerBase<any> {
name = 'impl';

@@ -62,7 +61,7 @@ export default async ({
dir = process.cwd(),
interactive = false,
skipPackage = false,
arch = hostArch(),
arch = getHostArch() as ForgeArch,
platform = process.platform as ForgePlatform,
overrideTargets,
outDir,
@@ -3,6 +3,7 @@ import { ora as realOra, fakeOra, OraImpl } from '@electron-forge/async-ora';
import { ForgeArch, ForgePlatform } from '@electron-forge/shared-types';
import debug from 'debug';
import fs from 'fs-extra';
import { getHostArch } from '@electron/get';
import glob from 'glob';
import path from 'path';
import pify from 'pify';
@@ -18,8 +19,6 @@ import resolveDir from '../util/resolve-dir';
import getCurrentOutDir from '../util/out-dir';
import { getElectronVersion } from '../util/electron-version';

const { host: hostArch }: { host: () => ForgeArch | 'all' } = require('electron-download/lib/arch');

const d = debug('electron-forge:packager');

type ElectronPackagerAfterCopyHook = (
@@ -86,7 +85,7 @@ export interface PackageOptions {
export default async ({
dir = process.cwd(),
interactive = false,
arch = hostArch(),
arch = getHostArch() as ForgeArch,
platform = process.platform as ForgePlatform,
outDir,
}: PackageOptions) => {

0 comments on commit e5f7416

Please sign in to comment.
You can’t perform that action at this time.