diff --git a/sources/code/build/forge.d.ts b/sources/code/build/forge.d.ts index 5c2c6d6c..430a8d83 100644 --- a/sources/code/build/forge.d.ts +++ b/sources/code/build/forge.d.ts @@ -9,7 +9,7 @@ // Forge types -import type { ForgeConfig } from "@electron-forge/shared-types"; +import type { ForgeConfig, ResolvedForgeConfig, ForgeHookMap } from "@electron-forge/shared-types"; import type { OfficialPlatform } from "electron-packager"; export type ForgePlatform = Exclude; @@ -37,6 +37,8 @@ type MPConfig = unknown | { }; interface MPBase { + /** Whenever given maker should be used. */ + enabled?: boolean; /** A Node.js package name that provides the maker or publisher functionality. */ name: string; /** Overrides the platform that this maker or publisher will be used on. */ @@ -98,4 +100,8 @@ export type ForgeConfigFile = Redeclare, { publishers?: ( PublisherGitHub )[]; + hooks?: Redeclare unknown; + packageAfterExtract: (ForgeConfig: ResolvedForgeConfig, path:string, electronVersion: string, platform: ForgePlatform) => unknown; + }>; }>; \ No newline at end of file diff --git a/sources/code/build/forge.ts b/sources/code/build/forge.ts index 9d24083b..9cc69b1e 100644 --- a/sources/code/build/forge.ts +++ b/sources/code/build/forge.ts @@ -163,7 +163,7 @@ const config: ForgeConfigFile = { } ], hooks: { - packageAfterCopy: async (_ForgeConfig, path:string, _electronVersion: string, platform: ForgePlatform) => { + packageAfterCopy: async (_ForgeConfig, path, _electronVersion, platform) => { /** Generates `buildInfo.json` file and saves it somewhe. */ async function writeBuildInfo() { const buildConfig: buildInfo = { @@ -189,7 +189,7 @@ const config: ForgeConfigFile = { ]); }, // Hardened Electron binary via Electron Fuses feature. - packageAfterExtract: (_ForgeConfig, path:string, _electronVersion: string, platform: ForgePlatform) => + packageAfterExtract: (_ForgeConfig, path, _electronVersion, platform) => flipFuses(resolve(path, getElectronPath(platform)), { version: FuseVersion.V1, [FuseV1Options.OnlyLoadAppFromAsar]: env.asar,