This template was created to speedup the development of Electron applications with essential features like automatic app updates and useful customizable shortcuts, making it versatile for creating complex applications. It also follows a simplified app architecture that allows for multiple apps within a single Electron application, although this might require some adaptation.
Clone the repository and install dependencies:
git clone https://github.com/AdamUhh/enhanced-erb-template.git your-project-name
cd your-project-name
npm install
Starting the app (development):
npm start
This project follows the two package.json structure recommended by electron-builder. This structure is beneficial for smaller builds, better performance, and more efficient development workflows.
Before packaging your application, ensure that the following files are updated with your specific project details:
Update the following fields with your own details:
author
description
homepage
repository.url
bugs.url
build.productName
(Name of the app that appears on Windows)build.appId
(e.g., com.example.app)build.publish.owner
(GitHub username)build.publish.repo
(GitHub repository name)build.publish.releaseType
(draft/prerelease/release)
This file is used for the setup executable:
name
(Name of the app)author
(Same as main package.json)description
(Same as main package.json)version
(Important for GitHub release versioning)
To package the application for your local platform:
npm run package
To package the application and create a release on GitHub, follow these steps:
-
Ensure GitHub Token: Ensure you have a GitHub token named
GH_TOKEN
saved in your.env
file, or manually set it before running the packaging command. -
Versioning: Ensure your versioning number follows the Semantic Versioning rules, (e.g.
0.0.10
).
Windows:
bash publish.sh 0.0.10
Note: Ensure you are in a Bash terminal, and
jq
is installed viachoco install jq
.
Linux:
npm run publish-github -- 0.0.10
-
Update the version number in
./release/app/package.json
. Ensure it is just numbers (e.g.0.0.10
). -
Commit the changes:
git commit -am "v0.0.10"
-
Tag the commit:
git tag v0.0.10
-
Push changes to GitHub:
git push && git push --tags
-
Publish the release:
GH_TOKEN=YOUR_GITHUB_TOKEN_HERE npm run package-publish
Electron-builder recommends using Docker.
- Webpack plugins, such as
monaco-editor-webpack-plugin
, must be listed indevDependencies
to avoid packaging issues.
Contributions are welcome! Please follow the standard GitHub workflow for submitting pull requests and issues.
- Base electron code by electron-react-boilerplate
- App architecture by thenewboston - tnbOS
This project is licensed under the MIT License. See the LICENSE file for details.