Skip to content

Commit 6bab6be

Browse files
committed
check-in. vite plugin electron forge 7.5
1 parent a8e005e commit 6bab6be

File tree

7 files changed

+509
-271
lines changed

7 files changed

+509
-271
lines changed

assets/trayIndex.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
const { ipcRenderer } = require('electron');
1+
// const { ipcRenderer } = require('electron');
2+
import { ipcRenderer } from 'electron';
23

34
const getIconKey = (status) => {
45
switch (status) {

forge.config.cts renamed to forge.config.ts

+33-27
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import type { ForgeConfig, ForgePackagerOptions } from '@electron-forge/shared-types';
1+
import type {
2+
ForgeConfig,
3+
ForgePackagerOptions,
4+
} from '@electron-forge/shared-types';
25
// import { MakerSquirrel } from '@electron-forge/maker-squirrel';
36
import { MakerZIP } from '@electron-forge/maker-zip';
47
// import { MakerDeb } from '@electron-forge/maker-deb';
@@ -14,7 +17,7 @@ const { version } = packageJson;
1417
const { versionPostfix } = process.env;
1518

1619
const iconDir = path.resolve('assets', 'icons');
17-
console.log("forge.config.ts iconDir: ", iconDir);
20+
console.log('forge.config.ts iconDir: ', iconDir);
1821

1922
const packagerConfig: ForgePackagerOptions = {
2023
asar: true,
@@ -25,9 +28,9 @@ const packagerConfig: ForgePackagerOptions = {
2528
{
2629
name: 'NiceNode Protocol',
2730
schemes: ['nice-node'],
28-
}
31+
},
2932
],
30-
appVersion: versionPostfix ? `${version}${versionPostfix}` : version
33+
appVersion: versionPostfix ? `${version}${versionPostfix}` : version,
3134
// unsure if this is needed below:
3235
// ignore: [ /stories/, /__tests__/, /.storybook/, /storybook/, /storybook-static/ ],
3336
};
@@ -48,28 +51,29 @@ const commonLinuxConfig = {
4851
},
4952
executableName: 'nice-node',
5053
productName: 'NiceNode',
51-
productDescription: "By running a node you become part of a global movement to decentralize a world of information. Prevent leaking your personal data to third party nodes. Ensure access when you need it, and don't be censored. Decentralization starts with you. Voice your choice, help your peers.",
52-
maintainer: "NiceNode LLC <[email protected]>",
54+
productDescription:
55+
"By running a node you become part of a global movement to decentralize a world of information. Prevent leaking your personal data to third party nodes. Ensure access when you need it, and don't be censored. Decentralization starts with you. Voice your choice, help your peers.",
56+
maintainer: 'NiceNode LLC <[email protected]>',
5357
categories: ['Utility', 'System', 'Network', 'Development'],
5458
mimeType: ['application/x-nice-node', 'x-scheme-handler/nice-node'],
55-
}
59+
};
5660

5761
// skip signing & notarizing on local builds
58-
console.log("process.env.CI: ", process.env.CI);
59-
if(process.env.CI && process.env.NO_CODE_SIGNING !== 'true') {
60-
console.log("Setting packagerConfig.osxSign and osxNotarize");
61-
if(process.env.APPLE_PROD_CERT_NAME) {
62-
console.log("process.env.APPLE_PROD_CERT_NAME is not null");
62+
console.log('process.env.CI: ', process.env.CI);
63+
if (process.env.CI && process.env.NO_CODE_SIGNING !== 'true') {
64+
console.log('Setting packagerConfig.osxSign and osxNotarize');
65+
if (process.env.APPLE_PROD_CERT_NAME) {
66+
console.log('process.env.APPLE_PROD_CERT_NAME is not null');
6367
}
6468
packagerConfig.osxSign = {
6569
identity: process.env.APPLE_PROD_CERT_NAME,
6670
};
6771
packagerConfig.osxNotarize = {
6872
appleId: process.env.APPLE_ID,
6973
appleIdPassword: process.env.APPLE_ID_PASSWORD,
70-
teamId: process.env.APPLE_TEAM_ID
74+
teamId: process.env.APPLE_TEAM_ID,
7175
};
72-
} else if(process.env.LOCAL_MAC_SIGNING === 'true') {
76+
} else if (process.env.LOCAL_MAC_SIGNING === 'true') {
7377
packagerConfig.osxSign = {}; // local keychain works automatically
7478
}
7579

@@ -87,27 +91,27 @@ const config: ForgeConfig = {
8791
exe: 'nice-node.exe',
8892
noMsi: true,
8993
setupExe: `NiceNode-${version}-windows-${arch}-setup.exe`,
90-
setupIcon: path.resolve(iconDir, '..', 'icon.ico')
94+
setupIcon: path.resolve(iconDir, '..', 'icon.ico'),
9195
}),
9296
},
9397
new MakerZIP({}),
9498
{
9599
name: '@electron-forge/maker-rpm',
96100
platforms: ['linux'],
97-
config: commonLinuxConfig
101+
config: commonLinuxConfig,
98102
},
99103
{
100104
name: '@electron-forge/maker-deb',
101105
platforms: ['linux'],
102-
config: commonLinuxConfig
106+
config: commonLinuxConfig,
107+
},
108+
{
109+
name: '@electron-forge/maker-dmg',
110+
config: {
111+
background: './assets/installer.icns',
112+
overwrite: true,
113+
},
103114
},
104-
new MakerDMG({
105-
background: './assets/dmg-background.tiff',
106-
// installer name. default includes version number in filename
107-
// name: "NiceNode Installer",
108-
icon: './assets/installer.icns',
109-
overwrite: true,
110-
}),
111115
],
112116
plugins: [
113117
new VitePlugin({
@@ -118,10 +122,12 @@ const config: ForgeConfig = {
118122
// `entry` is just an alias for `build.lib.entry` in the corresponding file of `config`.
119123
entry: 'src/main/main.ts',
120124
config: 'vite.main.config.ts',
125+
target: 'main',
121126
},
122127
{
123128
entry: 'src/main/preload.ts',
124129
config: 'vite.preload.config.ts',
130+
target: 'preload',
125131
},
126132
],
127133
renderer: [
@@ -133,7 +139,7 @@ const config: ForgeConfig = {
133139
}),
134140
{
135141
name: '@electron-forge/plugin-auto-unpack-natives',
136-
config: {}
142+
config: {},
137143
},
138144
// Fuses are used to enable/disable various Electron functionality
139145
// at package time, before code signing the application
@@ -156,10 +162,10 @@ const config: ForgeConfig = {
156162
name: 'nice-node',
157163
},
158164
prerelease: true,
159-
generateReleaseNotes: true
165+
generateReleaseNotes: true,
160166
},
161167
},
162-
]
168+
],
163169
};
164170

165171
export default config;

0 commit comments

Comments
 (0)