Bug 291321 - Mk/Uses/electron.mk and companion scripts: Helper makefile and scripts for easily porting Electron-based applications
Summary: Mk/Uses/electron.mk and companion scripts: Helper makefile and scripts for ea...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Port Management Team
URL: https://reviews.freebsd.org/D54005
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-01 07:13 UTC by Hiroki Tagato
Modified: 2025-12-01 07:13 UTC (History)
1 user (show)

See Also:


Attachments
Patch to add electron.mk and companion scripts (35.45 KB, patch)
2025-12-01 07:13 UTC, Hiroki Tagato
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hiroki Tagato freebsd_committer freebsd_triage 2025-12-01 07:13:15 UTC
Created attachment 265744 [details]
Patch to add electron.mk and companion scripts

I would like to propose a new electron.mk and companion scripts for making it easier to port Electron-based applications.

There are a number of obstacles in porting Electron-based appications, namely:
- Need to adapt to different node package managers used in a project (npm, yarn, and pnpm)
  Different package managers have different commands and options. With electron.mk, porters don't have to worry about those differences using USE_ELECTRON=npm feature.
- Need to create an archive of necessary node modules and host the file somewhere online
  An Electron-based project usually tries to install npm install command during the build phase. We can't allow this because npm install involves network access. So we had to pre-generate an archive for necessary node modules and host it somewhere online. electron.mk eliminates the necessity by locally generating the distfile for node modules on-the-fly at a host building the port during the fetch phase.
- Need to adapt to different package builders used (electron-builder, electron-packager, and electron-forge)
  Different package builders have different commands and options. With electron.mk, porters don't have to worry about those differences using USE_ELECTRON=build feature.

In sumary, electron.mk hides the complexities of porting Electron-based applications under the hood with USES=electron and USE_ELECTRON features.
Comment 1 Hiroki Tagato freebsd_committer freebsd_triage 2025-12-01 07:13:45 UTC
Phabricator review request at https://reviews.freebsd.org/D54005.