Options
All
  • Public
  • Public/Protected
  • All
Menu

@electron-forge/core

Index

Type aliases

ElectronPackagerAfterCopyHook

ElectronPackagerAfterCopyHook: function

Type declaration

    • (buildPath: string, electronVersion: string, pPlatform: ForgePlatform, pArch: ForgeArch, done: function): void
    • Parameters

      • buildPath: string
      • electronVersion: string
      • pPlatform: ForgePlatform
      • pArch: ForgeArch
      • done: function
          • (err?: Error): void
          • Parameters

            • Optional err: Error

            Returns void

      Returns void

PossibleModule

PossibleModule: object & T

Variables

Const BASE_OUT_DIR

BASE_OUT_DIR: "out" = "out"

Const EXTENSION

EXTENSION: ".forge.publish" = ".forge.publish"

Const GITHUB_API

GITHUB_API: "https://api.github.com" = "https://api.github.com"

allOfficialArchsForPlatformAndVersion

allOfficialArchsForPlatformAndVersion: any

Const api

api: ForgeAPI = new ForgeAPI()

Const corePackage

corePackage: any = fs.readJsonSync(path.resolve(__dirname, '../../../package.json'))

Const d

d: Debugger = debug('electron-forge:import')

Const deps

deps: string[] = ['electron-squirrel-startup']

Const devDeps

devDeps: string[] = [siblingDep('cli'),siblingDep('maker-squirrel'),siblingDep('maker-zip'),siblingDep('maker-deb'),siblingDep('maker-rpm'),]

Const electronPackageNames

electronPackageNames: string[] = ['electron-prebuilt-compile','electron-prebuilt','electron-nightly','electron',]

Const exactDevDeps

exactDevDeps: string[] = ['electron']

Const forge5MakerMappings

forge5MakerMappings: Map<string, string> = new Map<string, string>([['electronInstallerDebian', 'deb'],['electronInstallerDMG', 'dmg'],['electronInstallerFlatpak', 'flatpak'],['electronInstallerRedhat', 'rpm'],['electronInstallerSnap', 'snap'],['electronWinstallerConfig', 'squirrel'],['electronWixMSIConfig', 'wix'],['windowsStoreConfig', 'appx'],])

Const forge5PublisherMappings

forge5PublisherMappings: Map<string, string> = new Map<string, string>([['github_repository', 'github'],['s3', 's3'],['electron-release-server', 'electron-release-server'],['snapStore', 'snapcraft'],])

hostArch

hostArch: function

Type declaration

    • (): ForgeArch
    • Returns ForgeArch

Const nugget

nugget: any = require('nugget')

Const utils

utils: ForgeUtils = new ForgeUtils()

Functions

Const copy

  • copy(source: string, target: string): Promise<void>

findElectronDep

  • findElectronDep(dep: string): boolean

forgeConfigIsValidFilePath

  • forgeConfigIsValidFilePath(dir: string, forgeConfig: string | ForgeConfig): Promise<boolean>
  • Parameters

    • dir: string
    • forgeConfig: string | ForgeConfig

    Returns Promise<boolean>

fromBuildIdentifier

  • fromBuildIdentifier<T>(map: object): object
  • Type parameters

    • T

    Parameters

    • map: object
      • [key: string]: T | undefined

    Returns object

    • __isMagicBuildIdentifierMap: boolean
    • map: object
      • [key: string]: T | undefined

generateForgeMakerConfig

  • generateForgeMakerConfig(forge5Config: any): IForgeResolvableMaker[]

generateForgePublisherConfig

  • generateForgePublisherConfig(forge5Config: any): IForgeResolvablePublisher[]

getElectronVersion

  • getElectronVersion(dir: string, packageJSON: any): Promise<string>

Const hasYarn

  • hasYarn(): boolean

info

  • info(interactive: boolean, message: string): void
  • Parameters

    • interactive: boolean
    • message: string

    Returns void

isInstalled

  • isInstalled(pkg: string): boolean

mapMakeTargets

  • mapMakeTargets(forge5Config: any): Map<string, ForgePlatform[]>

parseArchs

  • parseArchs(platform: ForgePlatform | string, declaredArch: ForgeArch | "all" | string, electronVersion: string): ForgeArch[]
  • Parameters

    • platform: ForgePlatform | string
    • declaredArch: ForgeArch | "all" | string
    • electronVersion: string

    Returns ForgeArch[]

Const proxify

  • proxify<T>(buildIdentifier: string | function, object: T, envPrefix: string): T
  • Type parameters

    • T: object

    Parameters

    • buildIdentifier: string | function
    • object: T
    • envPrefix: string

    Returns T

Const publish

  • publish(__namedParameters: object): Promise<void>
  • Parameters

    • __namedParameters: object
      • dir: string
      • dryRun: boolean
      • dryRunResume: boolean
      • interactive: boolean
      • makeOptions: MakeOptions
      • makeResults: undefined | ForgeMakeResult[]
      • outDir: undefined | string
      • publishTargets: undefined | (string | IForgeResolvablePublisher | IForgePublisher)[]

    Returns Promise<void>

Const readMutatedPackageJson

  • readMutatedPackageJson(dir: string, forgeConfig: ForgeConfig): Promise<any>

Const readRawPackageJson

  • readRawPackageJson(dir: string): Promise<any>

requireSearchRaw

  • requireSearchRaw<T>(relativeTo: string, paths: string[]): T | null

resolveHooks

  • resolveHooks(hooks: (string | function)[] | undefined, dir: string): function[]
  • Resolves hooks if they are a path to a file (instead of a Function).

    Parameters

    • hooks: (string | function)[] | undefined
    • dir: string

    Returns function[]

Const runHook

  • runHook(forgeConfig: ForgeConfig, hookName: string, ...hookArgs: any[]): Promise<void>
  • Parameters

    • forgeConfig: ForgeConfig
    • hookName: string
    • Rest ...hookArgs: any[]

    Returns Promise<void>

runMutatingHook

  • runMutatingHook<T>(forgeConfig: ForgeConfig, hookName: string, item: T): Promise<T>
  • Type parameters

    • T

    Parameters

    • forgeConfig: ForgeConfig
    • hookName: string
    • item: T

    Returns Promise<T>

Const safeYarnOrNpm

  • safeYarnOrNpm(): any

sequentialHooks

  • sequentialHooks(hooks: Function[]): [function]
  • Runs given hooks sequentially by mapping them to promises and iterating through while awaiting

    Parameters

    • hooks: Function[]

    Returns [function]

setInitialForgeConfig

  • setInitialForgeConfig(packageJSON: any): void
  • Sets sensible defaults for the config.forge object.

    Parameters

    • packageJSON: any

    Returns void

siblingDep

  • siblingDep(name: string): string

Const sudo

  • sudo(type: string, prog: string, args: string): Promise<void>

transformGitHubPublisherConfig

  • transformGitHubPublisherConfig(config: any): any

Const underscoreCase

  • underscoreCase(str: string): string

updateElectronDependency

  • updateElectronDependency(packageJSON: any, dev: string[], exact: string[]): [string[], string[]]

updateUpgradedForgeDevDeps

  • updateUpgradedForgeDevDeps(packageJSON: any, devDeps: string[]): string[]

upgradeForgeConfig

  • upgradeForgeConfig(forge5Config: any): ForgeConfig

warn

  • warn(interactive: boolean, message: string): void
  • Parameters

    • interactive: boolean
    • message: string

    Returns void

Const which

  • which(type: string, prog: string, promise: function): Promise<void>
  • Parameters

    • type: string
    • prog: string
    • promise: function
        • (): Promise<any>
        • Returns Promise<any>

    Returns Promise<void>

Const yarnOrNpmSpawn

  • yarnOrNpmSpawn(args?: string[], opts?: any): Promise<Uint8Array>
  • Parameters

    • Optional args: string[]
    • Optional opts: any

    Returns Promise<Uint8Array>