@electron/packager
Advanced tools
+4
-2
@@ -8,4 +8,6 @@ import { FinalizePackageTargetsHookFunction, HookFunction } from './types.js'; | ||
| * If you need the functions called serially, you can use the `serialHooks` utility function. | ||
| * | ||
| * The return value can be passed directly to hook options (e.g., `afterCopy`, `afterExtract`). | ||
| */ | ||
| export declare function serialHooks(hooks: HookFunction[]): (opts: Parameters<HookFunction>[0]) => Promise<void>; | ||
| export declare function serialHooks(hooks: FinalizePackageTargetsHookFunction[]): (opts: Parameters<FinalizePackageTargetsHookFunction>[0]) => Promise<void>; | ||
| export declare function serialHooks(hooks: HookFunction[]): [HookFunction]; | ||
| export declare function serialHooks(hooks: FinalizePackageTargetsHookFunction[]): [FinalizePackageTargetsHookFunction]; |
+7
-5
@@ -10,8 +10,10 @@ // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| export function serialHooks(hooks = []) { | ||
| return async function (opts) { | ||
| for (const hook of hooks) { | ||
| await hook(opts); | ||
| } | ||
| }; | ||
| return [ | ||
| async function (opts) { | ||
| for (const hook of hooks) { | ||
| await hook(opts); | ||
| } | ||
| }, | ||
| ]; | ||
| } | ||
| //# sourceMappingURL=hooks.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAUA,8DAA8D;AAC9D,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,KAAsB,EACtB,IAAsB;IAEtB,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACjD,OAAO;IACT,CAAC;IAED,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC;AAaD,8DAA8D;AAC9D,MAAM,UAAU,WAAW,CACzB,QAAa,EAAE;IAEf,OAAO,KAAK,WAAW,IAAsB;QAC3C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"} | ||
| {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAUA,8DAA8D;AAC9D,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,KAAsB,EACtB,IAAsB;IAEtB,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACjD,OAAO;IACT,CAAC;IAED,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC;AAaD,8DAA8D;AAC9D,MAAM,UAAU,WAAW,CACzB,QAAa,EAAE;IAEf,OAAO;QACL,KAAK,WAAW,IAAsB;YACpC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACzB,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;YACnB,CAAC;QACH,CAAM;KACP,CAAC;AACJ,CAAC"} |
+16
-18
@@ -6,8 +6,4 @@ import { CreateOptions as AsarOptions } from '@electron/asar'; | ||
| import { SignOptions as WindowsSignOptions } from '@electron/windows-sign'; | ||
| import type { makeUniversalApp } from '@electron/universal'; | ||
| import type { MakeUniversalOpts } from '@electron/universal'; | ||
| /** | ||
| * @internal | ||
| */ | ||
| export type MakeUniversalOpts = Parameters<typeof makeUniversalApp>[0]; | ||
| /** | ||
| * Architectures that have been supported by the official Electron prebuilt binaries, past | ||
@@ -38,9 +34,2 @@ * and present. | ||
| /** | ||
| * A function that is called on the completion of a packaging stage. | ||
| * | ||
| * By default, the functions are called in parallel (via | ||
| * [`Promise.all`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all)). | ||
| * If you need the functions called serially, there is a utility function provided. Please note that | ||
| * **callback-style functions are not supported by `serialHooks`.** | ||
| * | ||
| * @param buildPath - For {@link Options.afterExtract | afterExtract}, the path to the temporary folder where the prebuilt | ||
@@ -54,3 +43,17 @@ * Electron binary has been extracted to. For {@link Options.afterCopy | afterCopy} and {@link Options.afterPrune | afterPrune}, the path to the | ||
| * @param callback - Must be called once you have completed your actions. | ||
| */ | ||
| export type HookFunctionArgs = { | ||
| buildPath: string; | ||
| electronVersion: string; | ||
| platform: OfficialPlatform; | ||
| arch: OfficialArch; | ||
| }; | ||
| /** | ||
| * A function that is called on the completion of a packaging stage. | ||
| * | ||
| * By default, the functions are called in parallel (via | ||
| * [`Promise.all`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all)). | ||
| * If you need the functions called serially, there is a utility function provided. Please note that | ||
| * **callback-style functions are not supported by `serialHooks`.** | ||
| * | ||
| * @example | ||
@@ -83,8 +86,3 @@ * | ||
| */ | ||
| export type HookFunction = (options: { | ||
| buildPath: string; | ||
| electronVersion: string; | ||
| platform: OfficialPlatform; | ||
| arch: OfficialArch; | ||
| }) => void | Promise<void>; | ||
| export type HookFunction = (options: HookFunctionArgs) => void | Promise<void>; | ||
| export type TargetDefinition = { | ||
@@ -91,0 +89,0 @@ arch: OfficialArch; |
+2
-2
| { | ||
| "name": "@electron/packager", | ||
| "version": "19.0.1", | ||
| "version": "19.0.2", | ||
| "description": "Customize and package your Electron app with OS-specific bundles (.app, .exe, etc.) via JS or CLI", | ||
@@ -74,3 +74,3 @@ "type": "module", | ||
| "tsx": "^4.20.4", | ||
| "typedoc": "~0.25.4", | ||
| "typedoc": "~0.28.14", | ||
| "typescript": "^5.9.2", | ||
@@ -77,0 +77,0 @@ "vitest": "^3.2.4" |
+2
-2
@@ -9,2 +9,3 @@ # @electron/packager | ||
| [](https://npm.im/@electron/packager) | ||
| [](https://packages.electronjs.org/packager) | ||
| [](https://discord.com/invite/APGC3k5yaH) | ||
@@ -15,3 +16,2 @@ | ||
| [Usage](#usage) | | ||
| [API](https://electron.github.io/packager/main/) | | ||
| [Contributing](https://github.com/electron/packager/blob/main/CONTRIBUTING.md) | | ||
@@ -70,3 +70,3 @@ [Support](https://github.com/electron/packager/blob/main/SUPPORT.md) | | ||
| JavaScript API usage can be found in the [API documentation](https://electron.github.io/packager/main/). | ||
| JavaScript API usage can be found in the [API documentation](https://packages.electronjs.org/packager). | ||
@@ -73,0 +73,0 @@ ### From the command line |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
231060
0.09%3121
0.06%0
-100%