Electronite Local Development
How to make changes to Electronite while using a local development server.
Table of Contents
Windows, MacOS, or Linux
Prerequisites
-
Consider App Spin-up and Scripts.
Electronite Dev Viewer
- π‘ To create an Electronite viewer for use with your local dev build environment, run this script while online:
- Linux:
cd linux/scriptsthen./build_viewer.bsh - Windows:
cd windows\\scriptsthen.\build_viewer.ps1(use a powershell terminal) - MacOS:
cd macos/scriptsthen./build_viewer.zsh
- Linux:
-
Read the βUseβ and βClient Developmentβ sections at the top of Scripts.
- π‘ When the server is running (the
runscript), start the Electronite viewer created by thebuild_viewerscript:- Linux:
cd linux/scriptsthen./viewer.bshβ Dev Tools: Ctrl + Shift + Iβ - Windows:
cd windows\scriptsthen.\viewer.batβ Dev Tools: Ctrl + Shift + Iβ - MacOS:
cd macos/scriptsthen./viewer.zshβ Dev Tools: Cmd + Option + Iβ
- Linux:
Making dev changes to Electronite
Electronite is a drop-in replacement for electron that provides an enhanced font rendering system. Make your dev changes the same way as for an Electron viewer.
This project works in either a web browser or the Electronite viewer. Only add code to Electron/Electronite that are necessary for it to handle things that web browser already do (e.g., Print, Find, Zoom, Back, Forward). Avoid coding in such a way that prevents web browser use.
π‘ The way to develop in Electronite is to start by modifying sourcecode in the following location. The electron orechestrator is electronStartup.js.
βββ buildResources
βββ electron
βββ config
β βββ paths.js
βββ core
β βββ archiveUtil.js
β βββ downloadUtil.js
β βββ ports.js
β βββ server.js
β βββ startupErrors.js
β βββ window.js
βββ features
β βββ ffmpeg.js
β βββ firefox.js
β βββ pdf.js
βββ electronStartup.js
βββ package.json
βββ preload.js
Deploying tested dev changes to Electronite
Test by re-running the build_viewer script. See Electronite Dev Viewer above. This will setup the Electron files above in the following location with app-specific variables configured.
βββ [linux | windows | macos]
βββ viewer
βββ project
βββ payload
βββ app
βββ electron
Test bundle_viewer.<bsh|ps1|zsh> by either building locally on Windows or MacOS or by pushing a branch, building via git hub actions, then testing the resulting installs.
Required packages are copied by script!
If packages required in Electron are changed or updated, it is not enough to address them in the repo root
package.jsonas applicable files from this repo copied into installs rather than being handled by a package manager. See additional info to make and test changes.
If a change needs to be made to favicon*.png, make those changes in the globalBuildResources directory. The same test instructions above apply.
Local Installer Build
Before doing this, also consider To Generate Artifacts
Prerequisites:
-
Ensure the local server is current! This is the
build_serverscript, or./build_server.[ext] devor./build_server.[ext] qaif/local_server.envhas different versions from the panksomia_web in/local_server/Cargo.toml. - Windows has an additional requirement for running this bundle_viewer build locally:
-
Install Inno Setup -tested with v6.4.3
-
bundle_viewer script
- Windows -
cd windows\scriptsthen.\bundle_viewer.ps1- Optional arguments:
-
.\bundle_viewer.ps1 -ServerOff "Y"
or: βyβ; Will not ask if server is off
-
- Deletes the last bundles and temp contents for the given OS (if they exist), then on this repo runs git checkout main, git pull, and pnpm i, runs app_setup.bat to ensure version consistency, runs node build.js, then makes a zip release bundle and a stand-alone exe installer.
- Optional arguments:
- MacOS -
cd /macos/scriptsthen./bundle_viewer.zsh- Optional arguments:
-
./bundle_viewer.zsh -s
Will not ask if server is off
-
- Deletes the last bundles and temp contents for the given OS (if they exist), then on this repo runs git checkout main, git pull, and pnpm i, runs app_setup.bat to ensure version consistency, runs node build.js, then makes a zip release bundle and a stand-alone exe installer.
- Optional arguments:
- Linux -
cd /linux/scriptsthen./bundle_viewer.bsh- Before running:
- manually delete prior local builds
- pnpm i (if not already run)
- app_setup.bat to ensure version consistency (unless already current)
-
run run
./bundle_tgz.bsh -
then run
./bundle_viewer.bsh
- Before running:
bundle_viewer script Outputs:
- Windows:
releases\\windows\\intel64\\[app-name]-[version]-windows-[x64|arm64].exe - MacOS:
releases/macos/[intel64|arm64]/[app-name]-[version]-macos-[x64|arm64].pkg - Linux:
releases/linux/[app-name]-[version]-linux-[x64|arm64].deb