electron-incremental-update 2.0.0-beta.10 → 2.0.0-beta.11
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/dist/chunk-IABBXJFB.js +87 -0
- package/dist/{chunk-72ZAJ7AF.js → chunk-RCRKUKFX.js} +1 -1
- package/dist/index.cjs +68 -48
- package/dist/index.d.cts +33 -25
- package/dist/index.d.ts +33 -25
- package/dist/index.js +65 -47
- package/dist/provider.cjs +58 -44
- package/dist/provider.d.cts +13 -13
- package/dist/provider.d.ts +13 -13
- package/dist/provider.js +58 -45
- package/dist/{types-Bnc4jz6R.d.ts → types-C8JhnJjU.d.ts} +6 -4
- package/dist/{types-DEYw5VrL.d.cts → types-CGSkHX4Y.d.cts} +6 -4
- package/dist/utils.cjs +25 -17
- package/dist/utils.d.cts +10 -3
- package/dist/utils.d.ts +10 -3
- package/dist/utils.js +2 -2
- package/dist/{version-C4tF_trh.d.cts → version-BYVQ367i.d.cts} +5 -5
- package/dist/{version-C4tF_trh.d.ts → version-BYVQ367i.d.ts} +5 -5
- package/dist/vite.d.ts +3 -1
- package/dist/vite.js +31 -18
- package/package.json +5 -5
- package/dist/chunk-4MH6ZXCY.js +0 -81
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "electron-incremental-update",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.11",
|
|
5
5
|
"description": "Electron incremental update tools with vite plugin, support bytecode protection",
|
|
6
6
|
"author": "subframe7536",
|
|
7
7
|
"license": "MIT",
|
|
@@ -73,15 +73,15 @@
|
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@subframe7536/eslint-config": "^0.7.3",
|
|
75
75
|
"@types/babel__core": "^7.20.5",
|
|
76
|
-
"@types/node": "^20.14.
|
|
76
|
+
"@types/node": "^20.14.12",
|
|
77
77
|
"bumpp": "^9.4.1",
|
|
78
78
|
"electron": "28.2.10",
|
|
79
79
|
"eslint": "^9.7.0",
|
|
80
80
|
"esno": "^4.7.0",
|
|
81
|
-
"tsup": "^8.2.
|
|
82
|
-
"typescript": "^5.5.
|
|
81
|
+
"tsup": "^8.2.2",
|
|
82
|
+
"typescript": "^5.5.4",
|
|
83
83
|
"vite": "^5.3.4",
|
|
84
84
|
"vite-plugin-electron": "^0.28.7",
|
|
85
|
-
"vitest": "^2.0.
|
|
85
|
+
"vitest": "^2.0.4"
|
|
86
86
|
}
|
|
87
87
|
}
|
package/dist/chunk-4MH6ZXCY.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { __require } from './chunk-72ZAJ7AF.js';
|
|
2
|
-
import fs from 'node:fs';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { app } from 'electron';
|
|
5
|
-
|
|
6
|
-
var isDev = __EIU_IS_DEV__;
|
|
7
|
-
var isWin = process.platform === "win32";
|
|
8
|
-
var isMac = process.platform === "darwin";
|
|
9
|
-
var isLinux = process.platform === "linux";
|
|
10
|
-
function getPathFromAppNameAsar(...paths) {
|
|
11
|
-
return isDev ? "DEV.asar" : path.join(path.dirname(app.getAppPath()), `${app.name}.asar`, ...paths);
|
|
12
|
-
}
|
|
13
|
-
function getAppVersion() {
|
|
14
|
-
return isDev ? getEntryVersion() : fs.readFileSync(getPathFromAppNameAsar("version"), "utf-8");
|
|
15
|
-
}
|
|
16
|
-
function getEntryVersion() {
|
|
17
|
-
return app.getVersion();
|
|
18
|
-
}
|
|
19
|
-
function requireNative(moduleName) {
|
|
20
|
-
return __require(path.join(app.getAppPath(), __EIU_ENTRY_DIST_PATH__, moduleName));
|
|
21
|
-
}
|
|
22
|
-
function restartApp() {
|
|
23
|
-
app.relaunch();
|
|
24
|
-
app.quit();
|
|
25
|
-
}
|
|
26
|
-
function setAppUserModelId(id) {
|
|
27
|
-
if (isWin) {
|
|
28
|
-
app.setAppUserModelId(id ?? `org.${app.name}`);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function disableHWAccForWin7() {
|
|
32
|
-
if (__require("node:os").release().startsWith("6.1")) {
|
|
33
|
-
app.disableHardwareAcceleration();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
function singleInstance(window) {
|
|
37
|
-
const result = app.requestSingleInstanceLock();
|
|
38
|
-
if (result) {
|
|
39
|
-
app.on("second-instance", () => {
|
|
40
|
-
if (window) {
|
|
41
|
-
window.show();
|
|
42
|
-
if (window.isMinimized()) {
|
|
43
|
-
window.restore();
|
|
44
|
-
}
|
|
45
|
-
window.focus();
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
} else {
|
|
49
|
-
app.quit();
|
|
50
|
-
}
|
|
51
|
-
return result;
|
|
52
|
-
}
|
|
53
|
-
function setPortableAppDataPath(dirName = "data") {
|
|
54
|
-
const portablePath = path.join(path.dirname(app.getPath("exe")), dirName);
|
|
55
|
-
if (!fs.existsSync(portablePath)) {
|
|
56
|
-
fs.mkdirSync(portablePath);
|
|
57
|
-
}
|
|
58
|
-
app.setPath("appData", portablePath);
|
|
59
|
-
}
|
|
60
|
-
function loadPage(win, htmlFilePath = "index.html") {
|
|
61
|
-
if (isDev) {
|
|
62
|
-
win.loadURL(process.env.VITE_DEV_SERVER_URL + htmlFilePath);
|
|
63
|
-
} else {
|
|
64
|
-
win.loadFile(getPathFromAppNameAsar("renderer", htmlFilePath));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
function getPathFromPreload(...paths) {
|
|
68
|
-
return isDev ? path.join(app.getAppPath(), __EIU_ELECTRON_DIST_PATH__, "preload", ...paths) : getPathFromAppNameAsar("preload", ...paths);
|
|
69
|
-
}
|
|
70
|
-
function getPathFromPublic(...paths) {
|
|
71
|
-
return isDev ? path.join(app.getAppPath(), "public", ...paths) : getPathFromAppNameAsar("renderer", ...paths);
|
|
72
|
-
}
|
|
73
|
-
function getPathFromEntryAsar(...paths) {
|
|
74
|
-
return path.join(app.getAppPath(), __EIU_ENTRY_DIST_PATH__, ...paths);
|
|
75
|
-
}
|
|
76
|
-
function handleUnexpectedErrors(callback) {
|
|
77
|
-
process.on("uncaughtException", callback);
|
|
78
|
-
process.on("unhandledRejection", callback);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export { disableHWAccForWin7, getAppVersion, getEntryVersion, getPathFromAppNameAsar, getPathFromEntryAsar, getPathFromPreload, getPathFromPublic, handleUnexpectedErrors, isDev, isLinux, isMac, isWin, loadPage, requireNative, restartApp, setAppUserModelId, setPortableAppDataPath, singleInstance };
|