A complete tool for building modern Electron applications
—
Quality
Pending
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Pending
The risk profile of this skill
Commands for creating distributables and publishing Electron applications to various platforms and distribution channels.
Generate distributables for the current Electron application using configured makers.
/**
* Generate distributables for Electron application
* Usage: electron-forge make [dir] [options]
*/
interface MakeOptions {
/** Directory to run the command in */
dir: string;
/** Enable interactive prompts */
interactive: boolean;
/** Skip packaging step and use output from previous package run */
skipPackage?: boolean;
/** Override make targets for this run */
overrideTargets?: string[];
/** Target build architecture */
arch?: string;
/** Target build platform */
platform?: string;
}
/**
* Exported function for programmatic access to make options
* Parses command line arguments and returns configured MakeOptions
* @returns Promise resolving to MakeOptions configuration
*/
function getMakeOptions(): Promise<MakeOptions>;Usage Example:
import { getMakeOptions } from "@electron-forge/cli/dist/electron-forge-make";
// Get configured make options programmatically
const options = await getMakeOptions();
console.log(`Building for ${options.platform}/${options.arch}`);Command Line Usage:
# Make distributables for current directory
electron-forge make
# Make for specific directory
electron-forge make /path/to/project
# Skip packaging step (use previous package output)
electron-forge make --skip-package
# Override targets
electron-forge make --targets=dmg,zip
# Make for specific platform and architecture
electron-forge make --platform=win32 --arch=x64Command Options:
[dir] - Directory to run the command in (default: current directory)--skip-package - Skip packaging the Electron application, and use the output from a previous package run instead-a, --arch [arch] - Target build architecture (default: process.arch)-p, --platform [platform] - Target build platform (default: process.platform)--targets [targets] - Override your make targets for this run (comma-separated list)Publish the current Electron application to configured distribution platforms.
/**
* Publish Electron application to distribution platforms
* Usage: electron-forge publish [dir] [options]
*/
interface PublishOptions {
/** Directory to run the command in */
dir: string;
/** Enable interactive prompts */
interactive: boolean;
/** Run make command and save publish metadata without uploading */
dryRun?: boolean;
/** Publish artifacts from the last saved dry run */
dryRunResume?: boolean;
/** List of deployment targets to publish to */
publishTargets?: string[];
/** Make options configuration for building distributables */
makeOptions?: MakeOptions;
}Command Line Usage:
# Publish current directory project
electron-forge publish
# Publish specific directory
electron-forge publish /path/to/project
# Dry run (don't actually publish)
electron-forge publish --dry-run
# Publish from previous dry run
electron-forge publish --from-dry-run
# Publish to specific targets
electron-forge publish --target=github,s3Command Options:
[dir] - Directory to run the command in (default: current directory)--target [target[,target...]] - A comma-separated list of deployment targets (default: all publishers in your Forge config)--dry-run - Run the make command and save publish metadata without uploading anything--from-dry-run - Publish artifacts from the last saved dry run/**
* Core API functions for build and distribution
*/
interface ForgeAPI {
make(options: MakeOptions): Promise<void>;
publish(options: PublishOptions): Promise<void>;
}Install with Tessl CLI
npx tessl i tessl/npm-electron-forge--cli