From 002a7149ca71d931e061b42f5520458ac60262f0 Mon Sep 17 00:00:00 2001 From: develar Date: Tue, 2 May 2017 21:35:40 +0200 Subject: [PATCH] feat(forge): support electron-forge 3.0 API --- packages/electron-builder/src/forge/forge-maker.ts | 7 ++++++- packages/electron-forge-maker-appimage/main.js | 6 ++++-- packages/electron-forge-maker-nsis-web/main.js | 6 ++++-- packages/electron-forge-maker-nsis/main.js | 6 ++++-- packages/electron-forge-maker-snap/main.js | 6 ++++-- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/packages/electron-builder/src/forge/forge-maker.ts b/packages/electron-builder/src/forge/forge-maker.ts index bbbe73ab681..ecab74e3a32 100644 --- a/packages/electron-builder/src/forge/forge-maker.ts +++ b/packages/electron-builder/src/forge/forge-maker.ts @@ -1,7 +1,12 @@ import * as path from "path" import { build, CliOptions } from "../builder" -export function buildForge(appDir: string, options: CliOptions) { +export interface ForgeOptions { + readonly dir: string +} + +export function buildForge(forgeOptions: ForgeOptions, options: CliOptions) { + const appDir = forgeOptions.dir return build(Object.assign({ prepackaged: appDir, config: { diff --git a/packages/electron-forge-maker-appimage/main.js b/packages/electron-forge-maker-appimage/main.js index e949b92f636..8a64a186c0a 100644 --- a/packages/electron-forge-maker-appimage/main.js +++ b/packages/electron-forge-maker-appimage/main.js @@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", { const buildForge = require("electron-builder").buildForge -exports.default = function (appDir, appName, targetArch) { - return buildForge(appDir, {linux: [`appimage:${targetArch}`]}) +exports.isSupportedOnCurrentPlatform = () => Promise.resolve(true) + +exports.default = function (options) { + return buildForge(options, {linux: [`appimage:${options.targetArch}`]}) } \ No newline at end of file diff --git a/packages/electron-forge-maker-nsis-web/main.js b/packages/electron-forge-maker-nsis-web/main.js index f8cbccf62f5..6d6a9d025bb 100644 --- a/packages/electron-forge-maker-nsis-web/main.js +++ b/packages/electron-forge-maker-nsis-web/main.js @@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", { const buildForge = require("electron-builder").buildForge -exports.default = function (appDir, appName, targetArch) { - return buildForge(appDir, {win: [`nsis-web:${targetArch}`]}) +exports.isSupportedOnCurrentPlatform = () => Promise.resolve(true) + +exports.default = function (options) { + return buildForge(options, {win: [`nsis-web:${options.targetArch}`]}) } \ No newline at end of file diff --git a/packages/electron-forge-maker-nsis/main.js b/packages/electron-forge-maker-nsis/main.js index af4a3ec333b..518002cb659 100644 --- a/packages/electron-forge-maker-nsis/main.js +++ b/packages/electron-forge-maker-nsis/main.js @@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", { const buildForge = require("electron-builder").buildForge -exports.default = function (appDir, appName, targetArch) { - return buildForge(appDir, {win: [`nsis:${targetArch}`]}) +exports.isSupportedOnCurrentPlatform = () => Promise.resolve(true) + +exports.default = function (options) { + return buildForge(options, {win: [`nsis:${options.targetArch}`]}) } \ No newline at end of file diff --git a/packages/electron-forge-maker-snap/main.js b/packages/electron-forge-maker-snap/main.js index d3c5ffa2241..597888c5a71 100644 --- a/packages/electron-forge-maker-snap/main.js +++ b/packages/electron-forge-maker-snap/main.js @@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", { const buildForge = require("electron-builder").buildForge -exports.default = function (appDir, appName, targetArch) { - return buildForge(appDir, {linux: [`snap:${targetArch}`]}) +exports.isSupportedOnCurrentPlatform = () => Promise.resolve(true) + +exports.default = function (options) { + return buildForge(options, {linux: [`snap:${options.targetArch}`]}) } \ No newline at end of file