electron-incremental-update 2.4.1 → 2.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -3
- package/dist/provider.cjs +0 -26
- package/dist/provider.d.cts +26 -26
- package/dist/provider.d.ts +26 -26
- package/dist/provider.js +0 -26
- package/dist/vite.d.ts +74 -17
- package/dist/vite.js +19 -8
- package/package.json +8 -9
package/README.md
CHANGED
|
@@ -857,13 +857,34 @@ export interface ElectronWithUpdaterOptions {
|
|
|
857
857
|
*
|
|
858
858
|
* To change output directories, use `options.updater.paths.electronDistPath` instead
|
|
859
859
|
*/
|
|
860
|
-
main:
|
|
860
|
+
main: {
|
|
861
|
+
/**
|
|
862
|
+
* Shortcut of `build.rollupOptions.input`
|
|
863
|
+
*/
|
|
864
|
+
files: NonNullable<ElectronOptions['entry']>
|
|
865
|
+
/**
|
|
866
|
+
* Electron App startup function.
|
|
867
|
+
*
|
|
868
|
+
* It will mount the Electron App child-process to `process.electronApp`.
|
|
869
|
+
* @param argv default value `['.', '--no-sandbox']`
|
|
870
|
+
* @param options options for `child_process.spawn`
|
|
871
|
+
* @param customElectronPkg custom electron package name (default: 'electron')
|
|
872
|
+
*/
|
|
873
|
+
onstart?: ElectronOptions['onstart']
|
|
874
|
+
} & ViteOverride
|
|
861
875
|
/**
|
|
862
876
|
* Preload process options
|
|
863
877
|
*
|
|
864
878
|
* To change output directories, use `options.updater.paths.electronDistPath` instead
|
|
865
879
|
*/
|
|
866
|
-
preload:
|
|
880
|
+
preload: {
|
|
881
|
+
/**
|
|
882
|
+
* Shortcut of `build.rollupOptions.input`.
|
|
883
|
+
*
|
|
884
|
+
* Preload scripts may contain Web assets, so use the `build.rollupOptions.input` instead `build.lib.entry`.
|
|
885
|
+
*/
|
|
886
|
+
files: NonNullable<ElectronOptions['entry']>
|
|
887
|
+
} & ViteOverride
|
|
867
888
|
/**
|
|
868
889
|
* Updater options
|
|
869
890
|
*/
|
|
@@ -997,7 +1018,7 @@ export interface BuildEntryOption {
|
|
|
997
1018
|
*/
|
|
998
1019
|
appEntryPath?: string
|
|
999
1020
|
/**
|
|
1000
|
-
*
|
|
1021
|
+
* Vite input options of native modules in entry directory
|
|
1001
1022
|
*
|
|
1002
1023
|
* @default {}
|
|
1003
1024
|
* @example
|
package/dist/provider.cjs
CHANGED
|
@@ -261,15 +261,6 @@ var BaseGitHubProvider = class extends BaseProvider {
|
|
|
261
261
|
var ERROR_MSG = "Cannot find UpdateJSON in latest release";
|
|
262
262
|
var GitHubApiProvider = class extends BaseGitHubProvider {
|
|
263
263
|
name = "GithubApiProvider";
|
|
264
|
-
/**
|
|
265
|
-
* Update Provider for Github API, you need to upload `version.json` to release as well
|
|
266
|
-
* - check update from `https://api.github.com/repos/{user}/{repo}/releases?per_page=1`
|
|
267
|
-
* - download update json and get version and download url
|
|
268
|
-
* - download update asar from update info
|
|
269
|
-
*
|
|
270
|
-
* you can setup `urlHandler` in options to modify url before request
|
|
271
|
-
* @param options provider options
|
|
272
|
-
*/
|
|
273
264
|
constructor(options) {
|
|
274
265
|
super(options);
|
|
275
266
|
}
|
|
@@ -302,15 +293,6 @@ var GitHubApiProvider = class extends BaseGitHubProvider {
|
|
|
302
293
|
// src/provider/github/atom.ts
|
|
303
294
|
var GitHubAtomProvider = class extends BaseGitHubProvider {
|
|
304
295
|
name = "GithubAtomProvider";
|
|
305
|
-
/**
|
|
306
|
-
* Update Provider for Github repo
|
|
307
|
-
* - check update from `https://github.com/{user}/{repo}/releases.atom`
|
|
308
|
-
* - download update json from `https://github.com/{user}/{repo}/releases/download/v{version}/{versionPath}`
|
|
309
|
-
* - download update asar from `https://github.com/{user}/{repo}/releases/download/v{version}/{name}-{version}.asar.gz`
|
|
310
|
-
*
|
|
311
|
-
* you can setup `urlHandler` in options to modify url before request
|
|
312
|
-
* @param options provider options
|
|
313
|
-
*/
|
|
314
296
|
constructor(options) {
|
|
315
297
|
super(options);
|
|
316
298
|
}
|
|
@@ -341,14 +323,6 @@ var GitHubAtomProvider = class extends BaseGitHubProvider {
|
|
|
341
323
|
// src/provider/github/file.ts
|
|
342
324
|
var GitHubProvider = class extends BaseGitHubProvider {
|
|
343
325
|
name = "GithubProvider";
|
|
344
|
-
/**
|
|
345
|
-
* Update Provider for Github repo
|
|
346
|
-
* - download update json from `https://github.com/{user}/{repo}/raw/HEAD/{versionPath}`
|
|
347
|
-
* - download update asar from `https://github.com/{user}/{repo}/releases/download/v{version}/{name}-{version}.asar.gz`
|
|
348
|
-
*
|
|
349
|
-
* you can setup `urlHandler` in options to modify url before request
|
|
350
|
-
* @param options provider options
|
|
351
|
-
*/
|
|
352
326
|
constructor(options) {
|
|
353
327
|
super(options);
|
|
354
328
|
if (!options.branch) {
|
package/dist/provider.d.cts
CHANGED
|
@@ -71,17 +71,17 @@ declare abstract class BaseGitHubProvider<T extends BaseGitHubProviderOptions =
|
|
|
71
71
|
interface GitHubApiProviderOptions extends BaseGitHubProviderOptions {
|
|
72
72
|
token?: string;
|
|
73
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Update Provider for Github API, you need to upload `version.json` to release as well
|
|
76
|
+
* - check update from `https://api.github.com/repos/{user}/{repo}/releases?per_page=1`
|
|
77
|
+
* - download update json and get version and download url
|
|
78
|
+
* - download update asar from update info
|
|
79
|
+
*
|
|
80
|
+
* you can setup `urlHandler` in options to modify url before request
|
|
81
|
+
* @param options provider options
|
|
82
|
+
*/
|
|
74
83
|
declare class GitHubApiProvider extends BaseGitHubProvider<GitHubApiProviderOptions> {
|
|
75
84
|
name: string;
|
|
76
|
-
/**
|
|
77
|
-
* Update Provider for Github API, you need to upload `version.json` to release as well
|
|
78
|
-
* - check update from `https://api.github.com/repos/{user}/{repo}/releases?per_page=1`
|
|
79
|
-
* - download update json and get version and download url
|
|
80
|
-
* - download update asar from update info
|
|
81
|
-
*
|
|
82
|
-
* you can setup `urlHandler` in options to modify url before request
|
|
83
|
-
* @param options provider options
|
|
84
|
-
*/
|
|
85
85
|
constructor(options: GitHubApiProviderOptions);
|
|
86
86
|
protected getHeaders(accept: string): Record<string, string>;
|
|
87
87
|
/**
|
|
@@ -90,17 +90,17 @@ declare class GitHubApiProvider extends BaseGitHubProvider<GitHubApiProviderOpti
|
|
|
90
90
|
protected getVersionURL(versionPath: string, signal: AbortSignal): Promise<string>;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
/**
|
|
94
|
+
* Update Provider for Github repo
|
|
95
|
+
* - check update from `https://github.com/{user}/{repo}/releases.atom`
|
|
96
|
+
* - download update json from `https://github.com/{user}/{repo}/releases/download/v{version}/{versionPath}`
|
|
97
|
+
* - download update asar from `https://github.com/{user}/{repo}/releases/download/v{version}/{name}-{version}.asar.gz`
|
|
98
|
+
*
|
|
99
|
+
* you can setup `urlHandler` in options to modify url before request
|
|
100
|
+
* @param options provider options
|
|
101
|
+
*/
|
|
93
102
|
declare class GitHubAtomProvider extends BaseGitHubProvider {
|
|
94
103
|
name: string;
|
|
95
|
-
/**
|
|
96
|
-
* Update Provider for Github repo
|
|
97
|
-
* - check update from `https://github.com/{user}/{repo}/releases.atom`
|
|
98
|
-
* - download update json from `https://github.com/{user}/{repo}/releases/download/v{version}/{versionPath}`
|
|
99
|
-
* - download update asar from `https://github.com/{user}/{repo}/releases/download/v{version}/{name}-{version}.asar.gz`
|
|
100
|
-
*
|
|
101
|
-
* you can setup `urlHandler` in options to modify url before request
|
|
102
|
-
* @param options provider options
|
|
103
|
-
*/
|
|
104
104
|
constructor(options: BaseGitHubProviderOptions);
|
|
105
105
|
protected getHeaders(accept: string): Record<string, string>;
|
|
106
106
|
/**
|
|
@@ -116,16 +116,16 @@ interface GitHubProviderOptions extends BaseGitHubProviderOptions {
|
|
|
116
116
|
*/
|
|
117
117
|
branch?: string;
|
|
118
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Update Provider for Github repo
|
|
121
|
+
* - download update json from `https://github.com/{user}/{repo}/raw/HEAD/{versionPath}`
|
|
122
|
+
* - download update asar from `https://github.com/{user}/{repo}/releases/download/v{version}/{name}-{version}.asar.gz`
|
|
123
|
+
*
|
|
124
|
+
* you can setup `urlHandler` in options to modify url before request
|
|
125
|
+
* @param options provider options
|
|
126
|
+
*/
|
|
119
127
|
declare class GitHubProvider extends BaseGitHubProvider<GitHubProviderOptions> {
|
|
120
128
|
name: string;
|
|
121
|
-
/**
|
|
122
|
-
* Update Provider for Github repo
|
|
123
|
-
* - download update json from `https://github.com/{user}/{repo}/raw/HEAD/{versionPath}`
|
|
124
|
-
* - download update asar from `https://github.com/{user}/{repo}/releases/download/v{version}/{name}-{version}.asar.gz`
|
|
125
|
-
*
|
|
126
|
-
* you can setup `urlHandler` in options to modify url before request
|
|
127
|
-
* @param options provider options
|
|
128
|
-
*/
|
|
129
129
|
constructor(options: GitHubProviderOptions);
|
|
130
130
|
protected getHeaders(accept: string): Record<string, string>;
|
|
131
131
|
protected getVersionURL(versionPath: string): string;
|
package/dist/provider.d.ts
CHANGED
|
@@ -71,17 +71,17 @@ declare abstract class BaseGitHubProvider<T extends BaseGitHubProviderOptions =
|
|
|
71
71
|
interface GitHubApiProviderOptions extends BaseGitHubProviderOptions {
|
|
72
72
|
token?: string;
|
|
73
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Update Provider for Github API, you need to upload `version.json` to release as well
|
|
76
|
+
* - check update from `https://api.github.com/repos/{user}/{repo}/releases?per_page=1`
|
|
77
|
+
* - download update json and get version and download url
|
|
78
|
+
* - download update asar from update info
|
|
79
|
+
*
|
|
80
|
+
* you can setup `urlHandler` in options to modify url before request
|
|
81
|
+
* @param options provider options
|
|
82
|
+
*/
|
|
74
83
|
declare class GitHubApiProvider extends BaseGitHubProvider<GitHubApiProviderOptions> {
|
|
75
84
|
name: string;
|
|
76
|
-
/**
|
|
77
|
-
* Update Provider for Github API, you need to upload `version.json` to release as well
|
|
78
|
-
* - check update from `https://api.github.com/repos/{user}/{repo}/releases?per_page=1`
|
|
79
|
-
* - download update json and get version and download url
|
|
80
|
-
* - download update asar from update info
|
|
81
|
-
*
|
|
82
|
-
* you can setup `urlHandler` in options to modify url before request
|
|
83
|
-
* @param options provider options
|
|
84
|
-
*/
|
|
85
85
|
constructor(options: GitHubApiProviderOptions);
|
|
86
86
|
protected getHeaders(accept: string): Record<string, string>;
|
|
87
87
|
/**
|
|
@@ -90,17 +90,17 @@ declare class GitHubApiProvider extends BaseGitHubProvider<GitHubApiProviderOpti
|
|
|
90
90
|
protected getVersionURL(versionPath: string, signal: AbortSignal): Promise<string>;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
/**
|
|
94
|
+
* Update Provider for Github repo
|
|
95
|
+
* - check update from `https://github.com/{user}/{repo}/releases.atom`
|
|
96
|
+
* - download update json from `https://github.com/{user}/{repo}/releases/download/v{version}/{versionPath}`
|
|
97
|
+
* - download update asar from `https://github.com/{user}/{repo}/releases/download/v{version}/{name}-{version}.asar.gz`
|
|
98
|
+
*
|
|
99
|
+
* you can setup `urlHandler` in options to modify url before request
|
|
100
|
+
* @param options provider options
|
|
101
|
+
*/
|
|
93
102
|
declare class GitHubAtomProvider extends BaseGitHubProvider {
|
|
94
103
|
name: string;
|
|
95
|
-
/**
|
|
96
|
-
* Update Provider for Github repo
|
|
97
|
-
* - check update from `https://github.com/{user}/{repo}/releases.atom`
|
|
98
|
-
* - download update json from `https://github.com/{user}/{repo}/releases/download/v{version}/{versionPath}`
|
|
99
|
-
* - download update asar from `https://github.com/{user}/{repo}/releases/download/v{version}/{name}-{version}.asar.gz`
|
|
100
|
-
*
|
|
101
|
-
* you can setup `urlHandler` in options to modify url before request
|
|
102
|
-
* @param options provider options
|
|
103
|
-
*/
|
|
104
104
|
constructor(options: BaseGitHubProviderOptions);
|
|
105
105
|
protected getHeaders(accept: string): Record<string, string>;
|
|
106
106
|
/**
|
|
@@ -116,16 +116,16 @@ interface GitHubProviderOptions extends BaseGitHubProviderOptions {
|
|
|
116
116
|
*/
|
|
117
117
|
branch?: string;
|
|
118
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Update Provider for Github repo
|
|
121
|
+
* - download update json from `https://github.com/{user}/{repo}/raw/HEAD/{versionPath}`
|
|
122
|
+
* - download update asar from `https://github.com/{user}/{repo}/releases/download/v{version}/{name}-{version}.asar.gz`
|
|
123
|
+
*
|
|
124
|
+
* you can setup `urlHandler` in options to modify url before request
|
|
125
|
+
* @param options provider options
|
|
126
|
+
*/
|
|
119
127
|
declare class GitHubProvider extends BaseGitHubProvider<GitHubProviderOptions> {
|
|
120
128
|
name: string;
|
|
121
|
-
/**
|
|
122
|
-
* Update Provider for Github repo
|
|
123
|
-
* - download update json from `https://github.com/{user}/{repo}/raw/HEAD/{versionPath}`
|
|
124
|
-
* - download update asar from `https://github.com/{user}/{repo}/releases/download/v{version}/{name}-{version}.asar.gz`
|
|
125
|
-
*
|
|
126
|
-
* you can setup `urlHandler` in options to modify url before request
|
|
127
|
-
* @param options provider options
|
|
128
|
-
*/
|
|
129
129
|
constructor(options: GitHubProviderOptions);
|
|
130
130
|
protected getHeaders(accept: string): Record<string, string>;
|
|
131
131
|
protected getVersionURL(versionPath: string): string;
|
package/dist/provider.js
CHANGED
|
@@ -73,15 +73,6 @@ var BaseGitHubProvider = class extends BaseProvider {
|
|
|
73
73
|
var ERROR_MSG = "Cannot find UpdateJSON in latest release";
|
|
74
74
|
var GitHubApiProvider = class extends BaseGitHubProvider {
|
|
75
75
|
name = "GithubApiProvider";
|
|
76
|
-
/**
|
|
77
|
-
* Update Provider for Github API, you need to upload `version.json` to release as well
|
|
78
|
-
* - check update from `https://api.github.com/repos/{user}/{repo}/releases?per_page=1`
|
|
79
|
-
* - download update json and get version and download url
|
|
80
|
-
* - download update asar from update info
|
|
81
|
-
*
|
|
82
|
-
* you can setup `urlHandler` in options to modify url before request
|
|
83
|
-
* @param options provider options
|
|
84
|
-
*/
|
|
85
76
|
constructor(options) {
|
|
86
77
|
super(options);
|
|
87
78
|
}
|
|
@@ -114,15 +105,6 @@ var GitHubApiProvider = class extends BaseGitHubProvider {
|
|
|
114
105
|
// src/provider/github/atom.ts
|
|
115
106
|
var GitHubAtomProvider = class extends BaseGitHubProvider {
|
|
116
107
|
name = "GithubAtomProvider";
|
|
117
|
-
/**
|
|
118
|
-
* Update Provider for Github repo
|
|
119
|
-
* - check update from `https://github.com/{user}/{repo}/releases.atom`
|
|
120
|
-
* - download update json from `https://github.com/{user}/{repo}/releases/download/v{version}/{versionPath}`
|
|
121
|
-
* - download update asar from `https://github.com/{user}/{repo}/releases/download/v{version}/{name}-{version}.asar.gz`
|
|
122
|
-
*
|
|
123
|
-
* you can setup `urlHandler` in options to modify url before request
|
|
124
|
-
* @param options provider options
|
|
125
|
-
*/
|
|
126
108
|
constructor(options) {
|
|
127
109
|
super(options);
|
|
128
110
|
}
|
|
@@ -153,14 +135,6 @@ var GitHubAtomProvider = class extends BaseGitHubProvider {
|
|
|
153
135
|
// src/provider/github/file.ts
|
|
154
136
|
var GitHubProvider = class extends BaseGitHubProvider {
|
|
155
137
|
name = "GithubProvider";
|
|
156
|
-
/**
|
|
157
|
-
* Update Provider for Github repo
|
|
158
|
-
* - download update json from `https://github.com/{user}/{repo}/raw/HEAD/{versionPath}`
|
|
159
|
-
* - download update asar from `https://github.com/{user}/{repo}/releases/download/v{version}/{name}-{version}.asar.gz`
|
|
160
|
-
*
|
|
161
|
-
* you can setup `urlHandler` in options to modify url before request
|
|
162
|
-
* @param options provider options
|
|
163
|
-
*/
|
|
164
138
|
constructor(options) {
|
|
165
139
|
super(options);
|
|
166
140
|
if (!options.branch) {
|
package/dist/vite.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Promisable, AnyFunction } from '@subframe7536/type-utils';
|
|
2
|
-
import { InlineConfig, PluginOption } from 'vite';
|
|
3
|
-
import {
|
|
4
|
-
import { ElectronSimpleOptions
|
|
2
|
+
import { InlineConfig, PluginOption, UserConfig, UserConfigFn } from 'vite';
|
|
3
|
+
import { ElectronOptions } from 'vite-plugin-electron';
|
|
4
|
+
import { ElectronSimpleOptions } from 'vite-plugin-electron/simple';
|
|
5
5
|
export { isCI } from 'ci-info';
|
|
6
6
|
export { getPackageInfo, getPackageInfoSync, loadPackageJSON, resolveModule } from 'local-pkg';
|
|
7
7
|
|
|
@@ -81,15 +81,11 @@ interface PKG {
|
|
|
81
81
|
main: string;
|
|
82
82
|
type: 'commonjs' | 'module';
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
[
|
|
89
|
-
};
|
|
90
|
-
type MakeRequiredAndReplaceKey<T, K extends keyof T, NewKey extends string> = MakeRequired<ReplaceKey<T, K, NewKey>, NewKey>;
|
|
91
|
-
type ExcludeOutputDirOptions = {
|
|
92
|
-
vite?: {
|
|
84
|
+
interface ViteOverride {
|
|
85
|
+
/**
|
|
86
|
+
* Override vite options
|
|
87
|
+
*/
|
|
88
|
+
vite?: ElectronOptions['vite'] & {
|
|
93
89
|
build?: {
|
|
94
90
|
outDir: never;
|
|
95
91
|
rollupOptions?: {
|
|
@@ -99,7 +95,7 @@ type ExcludeOutputDirOptions = {
|
|
|
99
95
|
};
|
|
100
96
|
};
|
|
101
97
|
};
|
|
102
|
-
}
|
|
98
|
+
}
|
|
103
99
|
interface ElectronWithUpdaterOptions {
|
|
104
100
|
/**
|
|
105
101
|
* Whether is in build mode
|
|
@@ -151,13 +147,34 @@ interface ElectronWithUpdaterOptions {
|
|
|
151
147
|
*
|
|
152
148
|
* To change output directories, use `options.updater.paths.electronDistPath` instead
|
|
153
149
|
*/
|
|
154
|
-
main:
|
|
150
|
+
main: {
|
|
151
|
+
/**
|
|
152
|
+
* Shortcut of `build.rollupOptions.input`
|
|
153
|
+
*/
|
|
154
|
+
files: NonNullable<ElectronOptions['entry']>;
|
|
155
|
+
/**
|
|
156
|
+
* Electron App startup function.
|
|
157
|
+
*
|
|
158
|
+
* It will mount the Electron App child-process to `process.electronApp`.
|
|
159
|
+
* @param argv default value `['.', '--no-sandbox']`
|
|
160
|
+
* @param options options for `child_process.spawn`
|
|
161
|
+
* @param customElectronPkg custom electron package name (default: 'electron')
|
|
162
|
+
*/
|
|
163
|
+
onstart?: ElectronOptions['onstart'];
|
|
164
|
+
} & ViteOverride;
|
|
155
165
|
/**
|
|
156
166
|
* Preload process options
|
|
157
167
|
*
|
|
158
168
|
* To change output directories, use `options.updater.paths.electronDistPath` instead
|
|
159
169
|
*/
|
|
160
|
-
preload:
|
|
170
|
+
preload: {
|
|
171
|
+
/**
|
|
172
|
+
* Shortcut of `build.rollupOptions.input`.
|
|
173
|
+
*
|
|
174
|
+
* Preload scripts may contain Web assets, so use the `build.rollupOptions.input` instead `build.lib.entry`.
|
|
175
|
+
*/
|
|
176
|
+
files: NonNullable<ElectronOptions['entry']>;
|
|
177
|
+
} & ViteOverride;
|
|
161
178
|
/**
|
|
162
179
|
* Updater options
|
|
163
180
|
*/
|
|
@@ -379,7 +396,7 @@ interface UpdaterOptions {
|
|
|
379
396
|
overrideGenerator?: GeneratorOverrideFunctions;
|
|
380
397
|
}
|
|
381
398
|
|
|
382
|
-
type StartupFn = NonNullable<NonNullable<ElectronSimpleOptions
|
|
399
|
+
type StartupFn = NonNullable<NonNullable<ElectronSimpleOptions['main']>['onstart']>;
|
|
383
400
|
/**
|
|
384
401
|
* Startup function for debug
|
|
385
402
|
* @see {@link https://github.com/electron-vite/electron-vite-vue/blob/main/vite.config.ts electron-vite-vue template}
|
|
@@ -473,4 +490,44 @@ declare function fixWinCharEncoding<T extends AnyFunction>(fn: T): T;
|
|
|
473
490
|
*/
|
|
474
491
|
declare function electronWithUpdater(options: ElectronWithUpdaterOptions): Promise<PluginOption[] | undefined>;
|
|
475
492
|
|
|
476
|
-
|
|
493
|
+
type MakeOptional<T, K extends keyof T> = Partial<Pick<T, K>> & Omit<T, K>;
|
|
494
|
+
interface ElectronViteHelperOptions extends MakeOptional<ElectronWithUpdaterOptions, 'isBuild'> {
|
|
495
|
+
/**
|
|
496
|
+
* Config for renderer process
|
|
497
|
+
*/
|
|
498
|
+
renderer?: UserConfig;
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Vite config helper
|
|
502
|
+
* @see {@link electronWithUpdater}
|
|
503
|
+
* @example
|
|
504
|
+
* ```ts
|
|
505
|
+
* import { defineElectronConfig } from 'electron-incremental-update/vite'
|
|
506
|
+
*
|
|
507
|
+
* export default defineElectronConfig({
|
|
508
|
+
* main: {
|
|
509
|
+
* files: ['./electron/main/index.ts', './electron/main/worker.ts'],
|
|
510
|
+
* // see https://github.com/electron-vite/electron-vite-vue/blob/85ed267c4851bf59f32888d766c0071661d4b94c/vite.config.ts#L22-L28
|
|
511
|
+
* onstart: debugStartup,
|
|
512
|
+
* },
|
|
513
|
+
* preload: {
|
|
514
|
+
* files: './electron/preload/index.ts',
|
|
515
|
+
* },
|
|
516
|
+
* updater: {
|
|
517
|
+
* // options
|
|
518
|
+
* },
|
|
519
|
+
* renderer: {
|
|
520
|
+
* server: process.env.VSCODE_DEBUG && (() => {
|
|
521
|
+
* const url = new URL(pkg.debug.env.VITE_DEV_SERVER_URL)
|
|
522
|
+
* return {
|
|
523
|
+
* host: url.hostname,
|
|
524
|
+
* port: +url.port,
|
|
525
|
+
* }
|
|
526
|
+
* })(),
|
|
527
|
+
* }
|
|
528
|
+
* })
|
|
529
|
+
* ```
|
|
530
|
+
*/
|
|
531
|
+
declare function defineElectronConfig(options: ElectronViteHelperOptions): UserConfigFn;
|
|
532
|
+
|
|
533
|
+
export { type ElectronViteHelperOptions, type ElectronWithUpdaterOptions, convertLiteral, debugStartup, electronWithUpdater as default, defineElectronConfig, electronWithUpdater, filterErrorMessageStartup, fixWinCharEncoding };
|
package/dist/vite.js
CHANGED
|
@@ -390,16 +390,16 @@ var CJSShim = `
|
|
|
390
390
|
import __cjs_url__ from 'node:url';
|
|
391
391
|
import __cjs_path__ from 'node:path';
|
|
392
392
|
import __cjs_mod__ from 'node:module';
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
393
|
+
var __filename = __cjs_url__.fileURLToPath(import.meta.url);
|
|
394
|
+
var __dirname = __cjs_path__.dirname(__filename);
|
|
395
|
+
var require = __cjs_mod__.createRequire(import.meta.url);
|
|
396
396
|
`;
|
|
397
397
|
var CJSShim_electron_30 = `
|
|
398
398
|
// -- CommonJS Shims --
|
|
399
399
|
import __cjs_mod__ from 'node:module';
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
400
|
+
var __filename = import.meta.filename;
|
|
401
|
+
var __dirname = import.meta.dirname;
|
|
402
|
+
var require = __cjs_mod__.createRequire(import.meta.url);
|
|
403
403
|
`;
|
|
404
404
|
var shim = electronMajorVersion >= 30 ? CJSShim_electron_30 : CJSShim;
|
|
405
405
|
|
|
@@ -854,7 +854,6 @@ async function electronWithUpdater(options) {
|
|
|
854
854
|
},
|
|
855
855
|
preload: {
|
|
856
856
|
input: _preload.files,
|
|
857
|
-
onstart: _preload.onstart,
|
|
858
857
|
vite: mergeConfig(
|
|
859
858
|
{
|
|
860
859
|
plugins: [
|
|
@@ -931,4 +930,16 @@ async function electronWithUpdater(options) {
|
|
|
931
930
|
return result;
|
|
932
931
|
}
|
|
933
932
|
|
|
934
|
-
|
|
933
|
+
// src/vite/define.ts
|
|
934
|
+
function defineElectronConfig(options) {
|
|
935
|
+
return ({ command }) => {
|
|
936
|
+
options.isBuild ??= command === "build";
|
|
937
|
+
const electronPlugin = electronWithUpdater(options);
|
|
938
|
+
const result = options.renderer ?? {};
|
|
939
|
+
result.plugins ??= [];
|
|
940
|
+
result.plugins.push(electronPlugin);
|
|
941
|
+
return result;
|
|
942
|
+
};
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
export { convertLiteral, debugStartup, electronWithUpdater as default, defineElectronConfig, electronWithUpdater, filterErrorMessageStartup, fixWinCharEncoding };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "electron-incremental-update",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.3",
|
|
5
5
|
"description": "Electron incremental update tools with Vite plugin, support bytecode protection",
|
|
6
6
|
"author": "subframe7536",
|
|
7
7
|
"license": "MIT",
|
|
@@ -59,24 +59,24 @@
|
|
|
59
59
|
"@electron/asar": "*"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@babel/core": "^7.
|
|
62
|
+
"@babel/core": "^7.28.0",
|
|
63
63
|
"@babel/plugin-transform-arrow-functions": "^7.27.1",
|
|
64
64
|
"@babel/plugin-transform-template-literals": "^7.27.1",
|
|
65
65
|
"@subframe7536/type-utils": "^0.2.0",
|
|
66
|
-
"ci-info": "^4.
|
|
66
|
+
"ci-info": "^4.3.0",
|
|
67
67
|
"local-pkg": "^1.1.1",
|
|
68
68
|
"magic-string": "^0.30.17",
|
|
69
|
-
"selfsigned": "^
|
|
69
|
+
"selfsigned": "^3.0.1",
|
|
70
70
|
"vite-plugin-electron": "^0.29.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@subframe7536/eslint-config": "^1.3.1",
|
|
74
74
|
"@types/babel__core": "^7.20.5",
|
|
75
|
-
"@types/node": "^22.
|
|
76
|
-
"@vitest/eslint-plugin": "^1.
|
|
75
|
+
"@types/node": "^22.17.0",
|
|
76
|
+
"@vitest/eslint-plugin": "^1.3.4",
|
|
77
77
|
"bumpp": "^10.1.1",
|
|
78
78
|
"electron": "36.2.0",
|
|
79
|
-
"esbuild": "^0.25.
|
|
79
|
+
"esbuild": "^0.25.8",
|
|
80
80
|
"eslint": "^9.28.0",
|
|
81
81
|
"tsup": "^8.5.0",
|
|
82
82
|
"typescript": "^5.8.3",
|
|
@@ -90,8 +90,7 @@
|
|
|
90
90
|
},
|
|
91
91
|
"onlyBuiltDependencies": [
|
|
92
92
|
"electron",
|
|
93
|
-
"esbuild"
|
|
94
|
-
"unrs-resolver"
|
|
93
|
+
"esbuild"
|
|
95
94
|
]
|
|
96
95
|
}
|
|
97
96
|
}
|