$ show electron/packager
Electron Packager is a command-line tool and programmable library for packaging Electron applications into platform-specific distributables (e.g., .app, .exe, .deb). It handles Electron binary downloading, app bundling, code signing, notarization, and cross-platform builds (Windows, macOS, Linux, Mac App Store). The architecture centers around a Packager class that orchestrates the process, delegating platform-specific steps to subclasses (macOS, Win32, Linux) and utilizing utilities for dependency pruning, file filtering, ASAR creation, and hook execution. It is actively maintained with a modern TypeScript toolchain and comprehensive test suite.
The LLM identified 3 files worth highlighting for reuse:
Implements a reusable hook system for lifecycle events with parallel and serial execution modes. Low coupling, easy to extract, and demonstrates solid async error handling patterns.
Prunes node_modules to remove development dependencies using galactus. Self-contained with clear separation of concerns, reusable in any Node.js build tool needing dependency optimization.
Provides intelligent file copying with default ignores (package-lock.json, .git, etc.), custom ignore patterns, and recursion prevention. Well-encapsulated logic suitable for extraction as a standalone utility.