Electronite Local Development

How to make changes to Electronite while using a local development server.

Table of Contents

Windows, MacOS, or Linux

Prerequisites

  1. See Environment Requirements.

  2. Consider App Spin-up and Scripts.

Electronite Dev Viewer

  1. πŸ’‘ To create an Electronite viewer for use with your local dev build environment, run this script while online:
    • Linux: cd linux/scripts ./build_viewer.bsh
    • Windows: cd windows\\scripts .\build_viewer.ps1 (use a powershell terminal)
    • MacOS: cd macos/scripts ./build_viewer.zsh
  2. Read the β€˜Use’ and β€˜Client Development’ sections at the top of Scripts.

  • πŸ’‘ When the server is running (the run script), start the Electronite viewer created by the build_viewer script:
    • Linux: cd linux/scripts ./viewer.bsh – Dev Tools: Ctrl + Shift + I”
    • Windows: cd windows\scripts .\viewer.bat – Dev Tools: Ctrl + Shift + I”
    • MacOS: cd macos/scripts ./viewer.zsh – Dev Tools: Cmd + Option + I”

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.json as 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

See bundle_viewer. Before doing this, also consider To Generate Artifacts