Skip to content

Commit 7fd552f

Browse files
committed
build mac universal
1 parent f67da5b commit 7fd552f

19 files changed

+6721
-2
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,9 @@ 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
2832
*.tsbuildinfo

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/.gitignore

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
.DS_Store
18+
19+
# Directory for instrumented libs generated by jscoverage/JSCover
20+
lib-cov
21+
22+
# Coverage directory used by tools like istanbul
23+
coverage
24+
*.lcov
25+
26+
# nyc test coverage
27+
.nyc_output
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons (https://nodejs.org/api/addons.html)
33+
build/Release
34+
35+
# Dependency directories
36+
node_modules/
37+
jspm_packages/
38+
39+
# TypeScript v1 declaration files
40+
typings/
41+
42+
# TypeScript cache
43+
*.tsbuildinfo
44+
45+
# Optional npm cache directory
46+
.npm
47+
48+
# Optional eslint cache
49+
.eslintcache
50+
51+
# Optional REPL history
52+
.node_repl_history
53+
54+
# Output of 'npm pack'
55+
*.tgz
56+
57+
# Yarn Integrity file
58+
.yarn-integrity
59+
60+
# dotenv environment variables file
61+
.env
62+
.env.test
63+
64+
# parcel-bundler cache (https://parceljs.org/)
65+
.cache
66+
67+
# next.js build output
68+
.next
69+
70+
# nuxt.js build output
71+
.nuxt
72+
73+
# vuepress build output
74+
.vuepress/dist
75+
76+
# Serverless directories
77+
.serverless/
78+
79+
# FuseBox cache
80+
.fusebox/
81+
82+
# DynamoDB Local files
83+
.dynamodb/
84+
85+
# Webpack
86+
.webpack/
87+
88+
# Vite
89+
.vite/
90+
91+
# Electron-Forge
92+
out/

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.js

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

electron-forge/forge.config.ts

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
import { FusesPlugin } from '@electron-forge/plugin-fuses';
2+
import { FuseV1Options, FuseVersion } from '@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+
export default config;

0 commit comments

Comments
 (0)