Skip to content

Commit 4e23620

Browse files
authored
Merge pull request #241 from dicekeys/build-with-electron-forge
Updates for 1.0
2 parents 79bb8ea + 49dd970 commit 4e23620

File tree

157 files changed

+19391
-13573
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+19391
-13573
lines changed

.github/workflows/ci.js.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99

1010
strategy:
1111
matrix:
12-
node-version: [16.x]
12+
node-version: [18.x]
1313

1414

1515
steps:

.gitignore

+8-1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,12 @@ electron/electron-js/
2424
electron/electron-html/
2525
electron/out/
2626

27+
28+
electron-forge/electron-js/
29+
electron-forge/electron-html/
30+
2731
# buildinfo files
28-
*.tsbuildinfo
32+
*.tsbuildinfo
33+
34+
electron-forge/forge.config.js
35+
electron-forge/out

.vscode/settings.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"erline",
3030
"examplesuffixattack",
3131
"field",
32+
"gcloud",
3233
"Googlebot",
3334
"gsutil",
3435
"icloud",
@@ -39,6 +40,7 @@
3940
"keytar",
4041
"lastpass",
4142
"Marshallers",
43+
"Mersenne",
4244
"monospace",
4345
"monospace span",
4446
"nnext",
@@ -57,6 +59,7 @@
5759
"reloadable",
5860
"seedable",
5961
"setmeta",
62+
"Shamir",
6063
"span",
6164
"src",
6265
"stic",
@@ -67,6 +70,7 @@
6770
"suffixattack",
6871
"Teoma",
6972
"tlds",
73+
"togglefullscreen",
7074
"TRBL",
7175
"ts",
7276
"tsbuildinfo",
@@ -99,5 +103,6 @@
99103
],
100104
"files.exclude": {
101105
"**/node_modules": true
102-
}
106+
},
107+
"typescript.preferences.importModuleSpecifier": "relative"
103108
}

README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,8 @@ We borrow from environments like SwiftUI, which allow you to run and inspect ind
116116
creating preview HTML files for key components that operate only on the subset of the application state that required for those views.
117117

118118
```bash
119-
vite src/preview.html
119+
npm run preview
120120
```
121-
Then load [http://localhost:3000/](http://localhost:3000/)
122-
123121

124122
### Windows USB device handling
125123
Windows requires the app to have admin rights in order to list FIDO usb devices and write to them.

common/IElectronBridge.ts

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export type RemoveListener = () => void;
5353
export interface MainToPrimaryRendererAsyncApi {
5454
getRecipesToExport: () => Promise<string>;
5555
loadRandomDiceKey: () => void;
56+
loadFromShares: () => void;
5657
importRecipes: (jsonRecipesToImport: string) => void;
5758
}
5859

common/package-lock.json

+7-33
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

electron-forge/.eslintrc.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es6": true,
5+
"node": true
6+
},
7+
"extends": [
8+
"eslint:recommended",
9+
"plugin:@typescript-eslint/eslint-recommended",
10+
"plugin:@typescript-eslint/recommended",
11+
"plugin:import/errors",
12+
"plugin:import/warnings",
13+
"plugin:import/typescript"
14+
],
15+
"parser": "@typescript-eslint/parser"
16+
}

electron-forge/.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@dicekeys:registry=https://npm.pkg.github.com

electron-forge/forge.config.ts

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
const { FusesPlugin } = require('@electron-forge/plugin-fuses');
2+
const { FuseV1Options, FuseVersion } = require('@electron/fuses');
3+
4+
import type { ForgeConfig } from '@electron-forge/shared-types';
5+
6+
const config: ForgeConfig = {
7+
packagerConfig: {
8+
icon: "./packaging/icon",
9+
extendInfo: {
10+
"CFBundleURLSchemes": ["dicekeys"]
11+
},
12+
osxSign: {
13+
"identity": "DiceKeys, LLC (CTDV6HX5KK)",
14+
optionsForFile: (filePath) => {
15+
// Here, we keep it simple and return a single entitlements.plist file.
16+
// You can use this callback to map different sets of entitlements
17+
// to specific files in your packaged app.
18+
return {
19+
entitlements: './packaging/entitlements.mac.plist'
20+
};
21+
},
22+
},
23+
osxNotarize: {
24+
// tool: 'notarytool',
25+
appleId: process.env.APPLE_ID!,
26+
appleIdPassword: process.env.APPLE_ID_PASSWORD!,
27+
teamId: "CTDV6HX5KK",
28+
},
29+
asar: true,
30+
protocols: [
31+
{
32+
"name": "Electron Fiddle",
33+
"schemes": ["electron-fiddle"]
34+
}
35+
],
36+
},
37+
rebuildConfig: {},
38+
makers: [
39+
{
40+
name: '@electron-forge/maker-squirrel',
41+
config: {},
42+
},
43+
{
44+
name: '@electron-forge/maker-zip',
45+
platforms: ['darwin'],
46+
config: {},
47+
},
48+
{
49+
"name": "@electron-forge/maker-deb",
50+
"config": {
51+
"mimeType": ["x-scheme-handler/electron-fiddle"]
52+
}
53+
},
54+
{
55+
name: '@electron-forge/maker-rpm',
56+
config: {},
57+
}, {
58+
name: '@electron-forge/maker-dmg',
59+
config: {
60+
"format": "ULMO",
61+
"icon": "./packaging/icon.icns",
62+
"background": "./packaging/dmg/background.tiff",
63+
"debug": true,
64+
}
65+
},
66+
],
67+
plugins: [
68+
{
69+
name: '@electron-forge/plugin-auto-unpack-natives',
70+
config: {},
71+
},
72+
// Fuses are used to enable/disable various Electron functionality
73+
// at package time, before code signing the application
74+
new FusesPlugin({
75+
version: FuseVersion.V1,
76+
[FuseV1Options.RunAsNode]: false,
77+
[FuseV1Options.EnableCookieEncryption]: true,
78+
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
79+
[FuseV1Options.EnableNodeCliInspectArguments]: false,
80+
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
81+
[FuseV1Options.OnlyLoadAppFromAsar]: true,
82+
}),
83+
]
84+
};
85+
86+
const {packagerConfig, rebuildConfig, makers, plugins} = config;
87+
88+
export {packagerConfig, rebuildConfig, makers, plugins}

0 commit comments

Comments
 (0)