-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(electron): upgrade Electron to v17
In the process, it was easier to switch from the seemingly not really maintained `electron-forge` to using `electron-builder` and `electron` directly. This did introduce one wrinkle: `electron-builder` uses `fpm` to build `.deb` packages, which itself depends on Ruby. `electron-builder` tries to use a self-contained `fpm` and Ruby build, but it doesn't work on ARM yet (electron-userland/electron-builder#5154). I work around this problem by telling `electron-build` (via an environment variable) to use the system version of `fpm`, then ensure that Ruby and the `fpm` gem are installed in `install-dependencies.sh`.
- Loading branch information
1 parent
6e7e18d
commit 6720727
Showing
19 changed files
with
1,164 additions
and
1,114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,6 +85,7 @@ typings/ | |
# Webpack | ||
.webpack/ | ||
|
||
# Electron-Forge | ||
# Build artifacts | ||
out/ | ||
dist/ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,14 +9,14 @@ | |
"email": "[email protected]", | ||
"url": "https://voting.works" | ||
}, | ||
"main": "dist/src/index.js", | ||
"main": "build/src/index.js", | ||
"scripts": { | ||
"app:dir": "electron-builder --dir", | ||
"app:dist": "USE_SYSTEM_FPM=true electron-builder", | ||
"postinstall": "electron-builder install-app-deps", | ||
"lint": "eslint 'src/**/*.ts'", | ||
"lint:fix": "yarn lint --fix", | ||
"make": "tsc && electron-forge make", | ||
"package": "tsc && electron-forge package", | ||
"publish": "tsc && electron-forge publish", | ||
"start": "tsc && electron-forge start", | ||
"start": "tsc && electron .", | ||
"test": "jest", | ||
"test:coverage": "jest --coverage", | ||
"test:watch": "jest --watch" | ||
|
@@ -30,17 +30,6 @@ | |
"*.ts": "eslint --quiet --fix", | ||
"package.json": "sort-package-json" | ||
}, | ||
"config": { | ||
"forge": { | ||
"packagerConfig": {}, | ||
"makers": [ | ||
{ | ||
"name": "@electron-forge/maker-deb", | ||
"config": {} | ||
} | ||
] | ||
} | ||
}, | ||
"dependencies": { | ||
"@types/luxon": "^1.25.0", | ||
"chalk": "^3.0.0", | ||
|
@@ -50,14 +39,12 @@ | |
"multimatch": "^4.0.0", | ||
"rxjs": "^6.5.4", | ||
"tmp-promise": "^3.0.3", | ||
"usb-detection": "votingworks/node-usb-detection", | ||
"usb-detection": "^4.14.1", | ||
"uuid": "^8.3.1", | ||
"xrandr-parse": "^1.0.0", | ||
"zod": "^1.10.2" | ||
}, | ||
"devDependencies": { | ||
"@electron-forge/cli": "6.0.0-beta.47", | ||
"@electron-forge/maker-deb": "6.0.0-beta.47", | ||
"@types/debug": "^4.1.5", | ||
"@types/electron-json-storage": "^4.0.0", | ||
"@types/jest": "^24.9.0", | ||
|
@@ -67,7 +54,8 @@ | |
"@types/uuid": "^8.3.0", | ||
"@typescript-eslint/eslint-plugin": "^2.15.0", | ||
"@typescript-eslint/parser": "^2.15.0", | ||
"electron": "7.2.4", | ||
"electron": "17", | ||
"electron-builder": "^23.0.3", | ||
"eslint": "^6.8.0", | ||
"eslint-config-prettier": "^6.9.0", | ||
"eslint-plugin-prettier": "^3.1.2", | ||
|
@@ -80,5 +68,15 @@ | |
"ts-jest": "^24.3.0", | ||
"typescript": "^3.7.0" | ||
}, | ||
"build": { | ||
"appId": "com.votingworks.kiosk-browser", | ||
"files": [ | ||
"build/src/**/*" | ||
], | ||
"linux": { | ||
"target": "deb", | ||
"category": "Utility" | ||
} | ||
}, | ||
"productName": "kiosk-browser" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
if ! command -v node >/dev/null 2>&1; then | ||
echo "node not found. please install it before continuing: https://nodejs.org/en/" >&2 | ||
exit 127 | ||
fi | ||
|
||
if ! command -v yarn >/dev/null 2>&1; then | ||
echo "yarn not found. please install it before continuing: https://www.yarnpkg.com/en/" >&2 | ||
exit 127 | ||
fi | ||
|
||
if ! command -v fpm >/dev/null 2>&1; then | ||
echo "fpm not found. please install it before continuing: https://fpm.readthedocs.io/en/latest/" >&2 | ||
exit 127 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
declare namespace Electron { | ||
interface PrinterInfo { | ||
/** | ||
* Add printer options such as `printer-is-accepting-jobs`. | ||
*/ | ||
options?: { [key: string]: string } | ||
interface Options { | ||
'device-uri'?: string | ||
} | ||
} |
Oops, something went wrong.