Skip to content
Permalink
Browse files

chore(generic): upgrade to Electron Packager 12 (#478)

* chore(generic): upgrade to Electron Packager 12

* Drop ref from dependencies in tests
  • Loading branch information
malept authored and MarshallOfSound committed Apr 16, 2018
1 parent 25b2fcc commit cd4161a529d4a35997e2d95245692be9d9511589
@@ -40,7 +40,7 @@
"electron-forge-template-react": "^1.0.2",
"electron-forge-template-react-typescript": "^1.0.3",
"electron-forge-template-vue": "^1.0.2",
"electron-packager": "^11.0.0",
"electron-packager": "^12.0.1",
"electron-rebuild": "^1.6.0",
"form-data": "^2.1.4",
"fs-extra": "^5.0.0",
@@ -41,7 +41,7 @@
"colors": "^1.1.2",
"cross-spawn-promise": "^0.10.1",
"debug": "^3.0.0",
"electron-packager": "^11.0.0",
"electron-packager": "^12.0.1",
"electron-rebuild": "^1.6.0",
"fs-extra": "^5.0.0",
"glob": "^7.1.1",
@@ -60,4 +60,4 @@
"engines": {
"node": ">= 6.0"
}
}
}
@@ -89,12 +89,6 @@ export default async (providedOptions = {}) => {

const pruneEnabled = !('prune' in forgeConfig.packagerConfig) || forgeConfig.packagerConfig.prune;

const rebuildHookFn = async (buildPath, electronVersion, pPlatform, pArch, done) => {
await rebuildHook(buildPath, electronVersion, pPlatform, pArch, forgeConfig.rebuildConfig);
packagerSpinner = ora('Packaging Application').start();
done();
};

const afterCopyHooks = [
async (buildPath, electronVersion, pPlatform, pArch, done) => {
if (packagerSpinner) {
@@ -112,12 +106,13 @@ export default async (providedOptions = {}) => {
await runHook(forgeConfig, 'packageAfterCopy', buildPath, electronVersion, pPlatform, pArch);
done();
},
async (buildPath, electronVersion, pPlatform, pArch, done) => {
await rebuildHook(buildPath, electronVersion, pPlatform, pArch, forgeConfig.rebuildConfig);
packagerSpinner = ora('Packaging Application').start();
done();
},
];

if (!pruneEnabled) {
afterCopyHooks.push(rebuildHookFn);
}

afterCopyHooks.push(async (buildPath, electronVersion, pPlatform, pArch, done) => {
const copiedPackageJSON = await readPackageJSON(buildPath);
if (copiedPackageJSON.config && copiedPackageJSON.config.forge) {
@@ -132,7 +127,6 @@ export default async (providedOptions = {}) => {
const afterPruneHooks = [];

if (pruneEnabled) {
afterPruneHooks.push(rebuildHookFn);
afterPruneHooks.push(...resolveHooks(forgeConfig.packagerConfig.afterPrune, dir));
}

@@ -2,7 +2,6 @@ import fs from 'fs-extra';
import path from 'path';
import _template from 'lodash.template';
import readPackageJSON from './read-package-json';
import yarnOrNpm from './yarn-or-npm';
import PluginInterface from './plugin-interface';

const underscoreCase = str => str.replace(/(.)([A-Z][a-z]+)/g, '$1_$2').replace(/([a-z0-9])([A-Z])/g, '$1_$2').toUpperCase();
@@ -47,7 +46,6 @@ export function setInitialForgeConfig(packageJSON) {

/* eslint-disable no-param-reassign */
packageJSON.config.forge.makers[0].config.name = name.replace(/-/g, '_');
packageJSON.config.forge.packagerConfig.packageManager = yarnOrNpm();
/* eslint-enable no-param-reassign */
}

@@ -245,6 +245,7 @@ describe(`electron-forge API (with installer=${nodeInstaller})`, () => {

it('can package without errors', async () => {
const packageJSON = await readPackageJSON(dir);
delete packageJSON.dependencies.ref;
packageJSON.config.forge.packagerConfig.asar = true;
await fs.writeJson(path.resolve(dir, 'package.json'), packageJSON);

@@ -621,10 +621,6 @@ ansistyles@~0.1.3:
version "0.1.3"
resolved "https://registry.yarnpkg.com/ansistyles/-/ansistyles-0.1.3.tgz#5de60415bda071bb37127854c864f41b23254539"

any-promise@^1.0.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f"

anymatch@^1.3.0:
version "1.3.2"
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a"
@@ -2332,28 +2328,27 @@ electron-osx-sign@^0.4.1:
minimist "^1.2.0"
plist "^2.1.0"

electron-packager@^11.0.0:
version "11.0.1"
resolved "https://registry.yarnpkg.com/electron-packager/-/electron-packager-11.0.1.tgz#c2d1ff9eca8110be9ebc81826e2a921c04d1200e"
electron-packager@^12.0.1:
version "12.0.1"
resolved "https://registry.yarnpkg.com/electron-packager/-/electron-packager-12.0.1.tgz#6634edc00eb98b98d212095fc7623d94b003095f"
dependencies:
asar "^0.14.0"
debug "^3.0.0"
electron-download "^4.0.0"
electron-osx-sign "^0.4.1"
extract-zip "^1.0.3"
fs-extra "^5.0.0"
galactus "^0.2.1"
get-package-info "^1.0.0"
mz "^2.6.0"
nodeify "^1.0.1"
parse-author "^2.0.0"
pify "^3.0.0"
plist "^2.0.0"
pruner "^0.0.7"
rcedit "^1.0.0"
resolve "^1.1.6"
sanitize-filename "^1.6.0"
semver "^5.3.0"
yargs-parser "^9.0.2"
yargs-parser "^10.0.0"

electron-rebuild@^1.6.0:
version "1.7.3"
@@ -3068,6 +3063,13 @@ flatten-packages@^0.1.4:
semver "~2.2.1"
wrench "~1.5.4"

flora-colossus@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/flora-colossus/-/flora-colossus-1.0.0.tgz#54729c361edecee014dd441679e1a37c1d773a45"
dependencies:
debug "^3.1.0"
fs-extra "^4.0.0"

flush-write-stream@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.0.2.tgz#c81b90d8746766f1a609a46809946c45dd8ae417"
@@ -3305,6 +3307,14 @@ function-bind@^1.0.2:
version "1.1.1"
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"

galactus@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/galactus/-/galactus-0.2.1.tgz#cbed2d20a40c1f5679a35908e2b9415733e78db9"
dependencies:
debug "^3.1.0"
flora-colossus "^1.0.0"
fs-extra "^4.0.0"

gar@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/gar/-/gar-1.0.2.tgz#5b7ecbbde1d3a1a8037cccc49971274250ff865b"
@@ -5231,14 +5241,6 @@ mute-stream@0.0.7, mute-stream@~0.0.4:
version "0.0.7"
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"

mz@^2.6.0:
version "2.7.0"
resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32"
dependencies:
any-promise "^1.0.0"
object-assign "^4.0.1"
thenify-all "^1.0.0"

nan-x@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/nan-x/-/nan-x-1.0.0.tgz#0ee78e8d1cd0592d5b4260a5940154545c61c121"
@@ -6288,12 +6290,6 @@ prr@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476"

pruner@^0.0.7:
version "0.0.7"
resolved "https://registry.yarnpkg.com/pruner/-/pruner-0.0.7.tgz#345fbcb3e80701163a1d7adf56bac229a5a1e4c1"
dependencies:
fs-extra "^4.0.0"

ps-tree@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.1.0.tgz#b421b24140d6203f1ed3c76996b4427b08e8c014"
@@ -7601,18 +7597,6 @@ text-table@~0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"

thenify-all@^1.0.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726"
dependencies:
thenify ">= 3.1.0 < 4"

"thenify@>= 3.1.0 < 4":
version "3.3.0"
resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.0.tgz#e69e38a1babe969b0108207978b9f62b88604839"
dependencies:
any-promise "^1.0.0"

throttleit@0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-0.0.2.tgz#cfedf88e60c00dd9697b61fdd2a8343a9b680eaf"
@@ -8319,6 +8303,12 @@ yallist@^2.0.0, yallist@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"

yargs-parser@^10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-10.0.0.tgz#c737c93de2567657750cb1f2c00be639fd19c994"
dependencies:
camelcase "^4.1.0"

yargs-parser@^4.2.0:
version "4.2.1"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c"

0 comments on commit cd4161a

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