electron-incremental-update 0.8.8 → 0.8.9
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 +0 -1
- package/dist/{chunk-OGAOUYV3.mjs → chunk-6V5SXFGA.mjs} +6 -11
- package/dist/index.js +6 -11
- package/dist/index.mjs +1 -1
- package/dist/utils.d.mts +6 -3
- package/dist/utils.d.ts +6 -3
- package/dist/utils.js +6 -11
- package/dist/utils.mjs +1 -1
- package/dist/vite.d.mts +1 -1
- package/dist/vite.d.ts +1 -1
- package/package.json +36 -36
package/README.md
CHANGED
|
@@ -13,15 +13,13 @@ var appInfo = {
|
|
|
13
13
|
win: process.platform === "win32",
|
|
14
14
|
mac: process.platform === "darwin",
|
|
15
15
|
linux: process.platform === "linux",
|
|
16
|
-
electronVersion: getElectronVersion(),
|
|
17
|
-
appVersion: getAppVersion,
|
|
18
16
|
systemVersion: release()
|
|
19
17
|
};
|
|
20
18
|
function getLocale() {
|
|
21
19
|
return app.isReady() ? app.getLocale() : void 0;
|
|
22
20
|
}
|
|
23
21
|
function getProductAsarPath(name = DEFAULT_APP_NAME) {
|
|
24
|
-
return !app.isPackaged ?
|
|
22
|
+
return !app.isPackaged ? join(dirname(app.getAppPath()), `${name}.asar`) : "DEV.asar";
|
|
25
23
|
}
|
|
26
24
|
function getElectronVersion() {
|
|
27
25
|
return app.getVersion();
|
|
@@ -63,16 +61,13 @@ function restartApp() {
|
|
|
63
61
|
app2.relaunch();
|
|
64
62
|
app2.quit();
|
|
65
63
|
}
|
|
66
|
-
function waitAppReady(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
return new Promise((resolve, reject) => {
|
|
71
|
-
const timeout = setTimeout(() => {
|
|
64
|
+
function waitAppReady(timeout = 1e3) {
|
|
65
|
+
return app2.isReady() ? Promise.resolve() : new Promise((resolve, reject) => {
|
|
66
|
+
const _ = setTimeout(() => {
|
|
72
67
|
reject(new Error("app is not ready"));
|
|
73
|
-
},
|
|
68
|
+
}, timeout);
|
|
74
69
|
app2.whenReady().then(() => {
|
|
75
|
-
clearTimeout(
|
|
70
|
+
clearTimeout(_);
|
|
76
71
|
resolve();
|
|
77
72
|
});
|
|
78
73
|
});
|
package/dist/index.js
CHANGED
|
@@ -44,12 +44,10 @@ var appInfo = {
|
|
|
44
44
|
win: process.platform === "win32",
|
|
45
45
|
mac: process.platform === "darwin",
|
|
46
46
|
linux: process.platform === "linux",
|
|
47
|
-
electronVersion: getElectronVersion(),
|
|
48
|
-
appVersion: getAppVersion,
|
|
49
47
|
systemVersion: (0, import_node_os.release)()
|
|
50
48
|
};
|
|
51
49
|
function getProductAsarPath(name = DEFAULT_APP_NAME) {
|
|
52
|
-
return !import_electron.app.isPackaged ?
|
|
50
|
+
return !import_electron.app.isPackaged ? (0, import_node_path.join)((0, import_node_path.dirname)(import_electron.app.getAppPath()), `${name}.asar`) : "DEV.asar";
|
|
53
51
|
}
|
|
54
52
|
function getElectronVersion() {
|
|
55
53
|
return import_electron.app.getVersion();
|
|
@@ -106,16 +104,13 @@ async function unzipFile(gzipPath, targetFilePath = gzipPath.slice(0, -3)) {
|
|
|
106
104
|
|
|
107
105
|
// src/utils/utils.ts
|
|
108
106
|
var import_electron2 = require("electron");
|
|
109
|
-
function waitAppReady(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
return new Promise((resolve2, reject) => {
|
|
114
|
-
const timeout = setTimeout(() => {
|
|
107
|
+
function waitAppReady(timeout = 1e3) {
|
|
108
|
+
return import_electron2.app.isReady() ? Promise.resolve() : new Promise((resolve2, reject) => {
|
|
109
|
+
const _ = setTimeout(() => {
|
|
115
110
|
reject(new Error("app is not ready"));
|
|
116
|
-
},
|
|
111
|
+
}, timeout);
|
|
117
112
|
import_electron2.app.whenReady().then(() => {
|
|
118
|
-
clearTimeout(
|
|
113
|
+
clearTimeout(_);
|
|
119
114
|
resolve2();
|
|
120
115
|
});
|
|
121
116
|
});
|
package/dist/index.mjs
CHANGED
package/dist/utils.d.mts
CHANGED
|
@@ -4,8 +4,6 @@ type Info = {
|
|
|
4
4
|
win: boolean;
|
|
5
5
|
mac: boolean;
|
|
6
6
|
linux: boolean;
|
|
7
|
-
electronVersion: string;
|
|
8
|
-
appVersion: (name?: string) => string;
|
|
9
7
|
/**
|
|
10
8
|
* `os.release()`
|
|
11
9
|
*/
|
|
@@ -68,8 +66,13 @@ declare function parseGithubCdnURL(originRepoURL: string, cdnPrefix: string, rel
|
|
|
68
66
|
declare function restartApp(): void;
|
|
69
67
|
/**
|
|
70
68
|
* ensure app is ready.
|
|
69
|
+
* @param timeout wait timeout, @default 1000
|
|
70
|
+
*/
|
|
71
|
+
declare function waitAppReady(timeout?: number): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* handle all unhandled error
|
|
74
|
+
* @param callback callback function
|
|
71
75
|
*/
|
|
72
|
-
declare function waitAppReady(duration?: number): Promise<void>;
|
|
73
76
|
declare function handleUnexpectedErrors(callback: (err: unknown) => void): void;
|
|
74
77
|
|
|
75
78
|
export { DEFAULT_APP_NAME, NoSuchNativeModuleError, Version, appInfo, getAppVersion, getElectronVersion, getLocale, getProductAsarPath, handleUnexpectedErrors, isNoSuchNativeModuleError, parseGithubCdnURL, parseVersion, requireNative, restartApp, unzipFile, waitAppReady, zipFile };
|
package/dist/utils.d.ts
CHANGED
|
@@ -4,8 +4,6 @@ type Info = {
|
|
|
4
4
|
win: boolean;
|
|
5
5
|
mac: boolean;
|
|
6
6
|
linux: boolean;
|
|
7
|
-
electronVersion: string;
|
|
8
|
-
appVersion: (name?: string) => string;
|
|
9
7
|
/**
|
|
10
8
|
* `os.release()`
|
|
11
9
|
*/
|
|
@@ -68,8 +66,13 @@ declare function parseGithubCdnURL(originRepoURL: string, cdnPrefix: string, rel
|
|
|
68
66
|
declare function restartApp(): void;
|
|
69
67
|
/**
|
|
70
68
|
* ensure app is ready.
|
|
69
|
+
* @param timeout wait timeout, @default 1000
|
|
70
|
+
*/
|
|
71
|
+
declare function waitAppReady(timeout?: number): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* handle all unhandled error
|
|
74
|
+
* @param callback callback function
|
|
71
75
|
*/
|
|
72
|
-
declare function waitAppReady(duration?: number): Promise<void>;
|
|
73
76
|
declare function handleUnexpectedErrors(callback: (err: unknown) => void): void;
|
|
74
77
|
|
|
75
78
|
export { DEFAULT_APP_NAME, NoSuchNativeModuleError, Version, appInfo, getAppVersion, getElectronVersion, getLocale, getProductAsarPath, handleUnexpectedErrors, isNoSuchNativeModuleError, parseGithubCdnURL, parseVersion, requireNative, restartApp, unzipFile, waitAppReady, zipFile };
|
package/dist/utils.js
CHANGED
|
@@ -50,15 +50,13 @@ var appInfo = {
|
|
|
50
50
|
win: process.platform === "win32",
|
|
51
51
|
mac: process.platform === "darwin",
|
|
52
52
|
linux: process.platform === "linux",
|
|
53
|
-
electronVersion: getElectronVersion(),
|
|
54
|
-
appVersion: getAppVersion,
|
|
55
53
|
systemVersion: (0, import_node_os.release)()
|
|
56
54
|
};
|
|
57
55
|
function getLocale() {
|
|
58
56
|
return import_electron.app.isReady() ? import_electron.app.getLocale() : void 0;
|
|
59
57
|
}
|
|
60
58
|
function getProductAsarPath(name = DEFAULT_APP_NAME) {
|
|
61
|
-
return !import_electron.app.isPackaged ?
|
|
59
|
+
return !import_electron.app.isPackaged ? (0, import_node_path.join)((0, import_node_path.dirname)(import_electron.app.getAppPath()), `${name}.asar`) : "DEV.asar";
|
|
62
60
|
}
|
|
63
61
|
function getElectronVersion() {
|
|
64
62
|
return import_electron.app.getVersion();
|
|
@@ -161,16 +159,13 @@ function restartApp() {
|
|
|
161
159
|
import_electron2.app.relaunch();
|
|
162
160
|
import_electron2.app.quit();
|
|
163
161
|
}
|
|
164
|
-
function waitAppReady(
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}
|
|
168
|
-
return new Promise((resolve, reject) => {
|
|
169
|
-
const timeout = setTimeout(() => {
|
|
162
|
+
function waitAppReady(timeout = 1e3) {
|
|
163
|
+
return import_electron2.app.isReady() ? Promise.resolve() : new Promise((resolve, reject) => {
|
|
164
|
+
const _ = setTimeout(() => {
|
|
170
165
|
reject(new Error("app is not ready"));
|
|
171
|
-
},
|
|
166
|
+
}, timeout);
|
|
172
167
|
import_electron2.app.whenReady().then(() => {
|
|
173
|
-
clearTimeout(
|
|
168
|
+
clearTimeout(_);
|
|
174
169
|
resolve();
|
|
175
170
|
});
|
|
176
171
|
});
|
package/dist/utils.mjs
CHANGED
package/dist/vite.d.mts
CHANGED
package/dist/vite.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,29 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "electron-incremental-update",
|
|
3
|
-
"
|
|
4
|
-
"version": "0.8.8",
|
|
3
|
+
"version": "0.8.9",
|
|
5
4
|
"description": "electron incremental update tools, powered by vite",
|
|
6
|
-
"
|
|
7
|
-
"build": "tsup && node fix-module.js",
|
|
8
|
-
"release": "pnpm test && pnpm run build && bumpp --all && npm publish",
|
|
9
|
-
"test": "vitest --run",
|
|
10
|
-
"lint": "eslint . --fix"
|
|
11
|
-
},
|
|
12
|
-
"publishConfig": {
|
|
13
|
-
"access": "public",
|
|
14
|
-
"registry": "https://registry.npmjs.org/"
|
|
15
|
-
},
|
|
16
|
-
"repository": "https://github.com/subframe7536/electron-incremental-update",
|
|
5
|
+
"author": "subframe7536",
|
|
17
6
|
"license": "MIT",
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"utils.d.ts"
|
|
7
|
+
"repository": "https://github.com/subframe7536/electron-incremental-update",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"electron",
|
|
10
|
+
"incremental update",
|
|
11
|
+
"updater"
|
|
24
12
|
],
|
|
25
|
-
"main": "dist/index.js",
|
|
26
|
-
"module": "dist/index.mjs",
|
|
27
13
|
"exports": {
|
|
28
14
|
".": {
|
|
29
15
|
"import": "./dist/index.mjs",
|
|
@@ -38,25 +24,39 @@
|
|
|
38
24
|
"require": "./dist/utils.js"
|
|
39
25
|
}
|
|
40
26
|
},
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
27
|
+
"main": "dist/index.js",
|
|
28
|
+
"module": "dist/index.mjs",
|
|
29
|
+
"files": [
|
|
30
|
+
"dist",
|
|
31
|
+
"utils.d.ts",
|
|
32
|
+
"utils.js",
|
|
33
|
+
"vite.d.ts",
|
|
34
|
+
"vite.js"
|
|
45
35
|
],
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsup && node fix-module.js",
|
|
38
|
+
"release": "pnpm test && pnpm run build && bumpp --all && npm publish",
|
|
39
|
+
"test": "vitest --run",
|
|
40
|
+
"lint": "eslint . --fix"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public",
|
|
44
|
+
"registry": "https://registry.npmjs.org/"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@electron/asar": "^3.2.8",
|
|
48
|
+
"ci-info": "^4.0.0",
|
|
49
|
+
"selfsigned": "^2.4.1",
|
|
50
|
+
"vite": "^4.5.0"
|
|
51
|
+
},
|
|
46
52
|
"devDependencies": {
|
|
47
|
-
"@subframe7536/eslint-config": "^0.
|
|
48
|
-
"@types/node": "^20.
|
|
53
|
+
"@subframe7536/eslint-config": "^0.4.1",
|
|
54
|
+
"@types/node": "^20.9.0",
|
|
49
55
|
"bumpp": "^9.2.0",
|
|
50
|
-
"electron": "^
|
|
51
|
-
"eslint": "^8.
|
|
56
|
+
"electron": "^27.0.4",
|
|
57
|
+
"eslint": "^8.53.0",
|
|
52
58
|
"tsup": "^7.2.0",
|
|
53
59
|
"typescript": "^5.2.2",
|
|
54
|
-
"vitest": "^0.34.
|
|
55
|
-
},
|
|
56
|
-
"dependencies": {
|
|
57
|
-
"@electron/asar": "^3.2.4",
|
|
58
|
-
"ci-info": "^3.8.0",
|
|
59
|
-
"selfsigned": "^2.1.1",
|
|
60
|
-
"vite": "^4.4.9"
|
|
60
|
+
"vitest": "^0.34.6"
|
|
61
61
|
}
|
|
62
62
|
}
|