Documentation
¶
Index ¶
- func ApplyDevBranding(ctx context.Context, le *logrus.Entry, electronDistPath string, ...) (string, error)
- func BuildAsar(ctx context.Context, le *logrus.Entry, stateDir, buildDir, outPath string) error
- func BuildElectronBundle(ctx context.Context, le *logrus.Entry, ...) error
- func BuildElectronRendererIndex(buildDir string, importMap web_entrypoint_index.ImportMap) error
- func BuildMainBundle(ctx context.Context, le *logrus.Entry, stateDir, bldrDistRoot, buildDir string, ...) error
- func BuildPreloadBundle(ctx context.Context, le *logrus.Entry, stateDir, bldrDistRoot, buildDir string, ...) error
- func BuildRendererBundle(ctx context.Context, le *logrus.Entry, ...) error
- func DownloadElectronRedist(ctx context.Context, le *logrus.Entry, stateDir string, ...) error
- func ElectronDefine(devMode bool) map[string]string
- func GetElectronBinName(plat bldr_platform.Platform) string
- func SignElectron(ctx context.Context, le *logrus.Entry, stateDir string, ...) error
- func WriteElectronStableBootFiles(buildDir, serviceWorkerFilename, sharedWorkerFilename string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyDevBranding ¶
func ApplyDevBranding( ctx context.Context, le *logrus.Entry, electronDistPath string, stateDir string, plat bldr_platform.Platform, appName string, iconPath string, ) (string, error)
ApplyDevBranding applies NativeAppConfig branding to an extracted Electron.
electronDistPath is the directory containing the extracted Electron. stateDir is used for downloading tools (resedit-cli on Windows). appName is the display name from NativeAppConfig.AppName. iconPath is the absolute path to the source icon PNG (empty to skip icon).
Returns the new electron binary path relative to electronDistPath. Idempotent: skips if marker file matches appName.
func BuildAsar ¶
BuildAsar builds the app asar using the @electron/asar tool.
stateDir holds the installed tool and bun, when bun is not in PATH. buildDir should be pre-prepared using BuildElectronBundle. buildDir and outPath must be absolute.
func BuildElectronBundle ¶
func BuildElectronBundle(ctx context.Context, le *logrus.Entry, stateDir, bldrDistRoot, buildDir, startupFilename string, minify, devMode bool) error
BuildElectronBundle builds and outputs the web & service worker files.
stateDir is the directory where bun will be downloaded if not found in PATH. startupFilename is the path to the react component to load on startup (can be empty). minify enables JavaScript minification. devMode enables devMode extensions in Electron
func BuildElectronRendererIndex ¶ added in v0.51.8
func BuildElectronRendererIndex(buildDir string, importMap web_entrypoint_index.ImportMap) error
BuildElectronRendererIndex connects the renderer import map to stable boot.
func BuildMainBundle ¶
func BuildMainBundle( ctx context.Context, le *logrus.Entry, stateDir, bldrDistRoot, buildDir string, minify, devMode bool, ) error
BuildMainBundle builds the Electron main process through the direct owner.
func BuildPreloadBundle ¶
func BuildPreloadBundle( ctx context.Context, le *logrus.Entry, stateDir, bldrDistRoot, buildDir string, minify, devMode bool, ) error
BuildPreloadBundle builds the Electron preload through the direct owner.
func BuildRendererBundle ¶
func BuildRendererBundle( ctx context.Context, le *logrus.Entry, stateDir, bldrDistRoot, buildDir, runtimeJsPath, runtimeSwPath, runtimeShwPath, webStartupSrcPath string, minify, devMode bool, ) error
BuildRendererBundle builds the web renderer bundle files.
runtimeJsPath is the runtime module loaded by the renderer. runtimeSwPath is the service worker module loaded by the renderer. runtimeShwPath is the shared worker module loaded by the renderer. webStartupSrcPath is the path to the startup js module to load for the react app entrypoint (can be empty).
func DownloadElectronRedist ¶
func DownloadElectronRedist(ctx context.Context, le *logrus.Entry, stateDir string, plat bldr_platform.Platform, buildDir, destDir string, npmPkg string) error
DownloadElectronRedist downloads the electron redistributable to the destination dir.
stateDir is the directory where bun will be downloaded if not found in PATH. If npmPkg is empty, defaults to latest.
When plat is a NativePlatform whose goos/goarch differ from the host, npm_config_* and ELECTRON_INSTALL_* are set so Electron's installer fetches the target redistributable instead of the host's. Without this, cross-platform release builds land with a host-arch electron in dist/, which then fails downstream branding / packaging steps that expect target-arch layout.
func ElectronDefine ¶
ElectronDefine returns the define mapping for Electron.
devMode enables renderer debugging features.
func GetElectronBinName ¶
func GetElectronBinName(plat bldr_platform.Platform) string
GetElectronBinName returns the name of the electron binary.
Returns just "electron" if not known.
func SignElectron ¶
func SignElectron( ctx context.Context, le *logrus.Entry, stateDir string, platform bldr_platform.Platform, electronDistPath string, binaryName string, ) error
SignElectron signs the branded renderer before its bytes enter the plugin manifest. The Electron macOS signer handles nested helpers and JIT entitlements; Windows uses the same signing service as native Go plugins. Signing is disabled when the platform's signing identity is unset.
func WriteElectronStableBootFiles ¶ added in v0.51.8
func WriteElectronStableBootFiles(buildDir, serviceWorkerFilename, sharedWorkerFilename string) error
WriteElectronStableBootFiles publishes the renderer and worker boot metadata.
Types ¶
This section is empty.