electron-incremental-update 0.8.3 → 0.8.4
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-7R4GHFED.mjs → chunk-CR6HTU6P.mjs} +3 -3
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/dist/utils.js +3 -3
- package/dist/utils.mjs +1 -1
- package/dist/vite.js +10 -18
- package/dist/vite.mjs +8 -16
- package/package.json +1 -1
|
@@ -13,13 +13,13 @@ var info = {
|
|
|
13
13
|
appPath: Electron.app?.getAppPath()
|
|
14
14
|
};
|
|
15
15
|
function getProductAsarPath(name) {
|
|
16
|
-
return info.dev ? join(dirname(info.appPath), `${name}.asar`)
|
|
16
|
+
return info.dev ? "dev.asar" : join(dirname(info.appPath), `${name}.asar`);
|
|
17
17
|
}
|
|
18
18
|
function getEntryVersion() {
|
|
19
19
|
return Electron.app.getVersion();
|
|
20
20
|
}
|
|
21
21
|
function getProductVersion(name) {
|
|
22
|
-
return info.dev ? readFileSync(join(getProductAsarPath(name), "version"), "utf-8")
|
|
22
|
+
return info.dev ? getEntryVersion() : readFileSync(join(getProductAsarPath(name), "version"), "utf-8");
|
|
23
23
|
}
|
|
24
24
|
var NoSuchNativeModuleError = class extends Error {
|
|
25
25
|
moduleName;
|
|
@@ -29,7 +29,7 @@ var NoSuchNativeModuleError = class extends Error {
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
function requireNative(packageName) {
|
|
32
|
-
const path = info.dev ? join(info.appPath, "node_modules", packageName)
|
|
32
|
+
const path = info.dev ? packageName : join(info.appPath, "node_modules", packageName);
|
|
33
33
|
try {
|
|
34
34
|
return __require(path);
|
|
35
35
|
} catch (error) {
|
package/dist/index.js
CHANGED
|
@@ -54,13 +54,13 @@ var info = {
|
|
|
54
54
|
appPath: import_electron.default.app?.getAppPath()
|
|
55
55
|
};
|
|
56
56
|
function getProductAsarPath(name) {
|
|
57
|
-
return info.dev ? (0, import_node_path.join)((0, import_node_path.dirname)(info.appPath), `${name}.asar`)
|
|
57
|
+
return info.dev ? "dev.asar" : (0, import_node_path.join)((0, import_node_path.dirname)(info.appPath), `${name}.asar`);
|
|
58
58
|
}
|
|
59
59
|
function getEntryVersion() {
|
|
60
60
|
return import_electron.default.app.getVersion();
|
|
61
61
|
}
|
|
62
62
|
function getProductVersion(name) {
|
|
63
|
-
return info.dev ? (0, import_node_fs.readFileSync)((0, import_node_path.join)(getProductAsarPath(name), "version"), "utf-8")
|
|
63
|
+
return info.dev ? getEntryVersion() : (0, import_node_fs.readFileSync)((0, import_node_path.join)(getProductAsarPath(name), "version"), "utf-8");
|
|
64
64
|
}
|
|
65
65
|
function waitAppReady(duration = 1e3) {
|
|
66
66
|
return new Promise((resolve2, reject) => {
|
package/dist/index.mjs
CHANGED
package/dist/utils.js
CHANGED
|
@@ -57,13 +57,13 @@ var info = {
|
|
|
57
57
|
appPath: import_electron.default.app?.getAppPath()
|
|
58
58
|
};
|
|
59
59
|
function getProductAsarPath(name) {
|
|
60
|
-
return info.dev ? (0, import_node_path.join)((0, import_node_path.dirname)(info.appPath), `${name}.asar`)
|
|
60
|
+
return info.dev ? "dev.asar" : (0, import_node_path.join)((0, import_node_path.dirname)(info.appPath), `${name}.asar`);
|
|
61
61
|
}
|
|
62
62
|
function getEntryVersion() {
|
|
63
63
|
return import_electron.default.app.getVersion();
|
|
64
64
|
}
|
|
65
65
|
function getProductVersion(name) {
|
|
66
|
-
return info.dev ? (0, import_node_fs.readFileSync)((0, import_node_path.join)(getProductAsarPath(name), "version"), "utf-8")
|
|
66
|
+
return info.dev ? getEntryVersion() : (0, import_node_fs.readFileSync)((0, import_node_path.join)(getProductAsarPath(name), "version"), "utf-8");
|
|
67
67
|
}
|
|
68
68
|
var NoSuchNativeModuleError = class extends Error {
|
|
69
69
|
moduleName;
|
|
@@ -73,7 +73,7 @@ var NoSuchNativeModuleError = class extends Error {
|
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
function requireNative(packageName) {
|
|
76
|
-
const path = info.dev ? (0, import_node_path.join)(info.appPath, "node_modules", packageName)
|
|
76
|
+
const path = info.dev ? packageName : (0, import_node_path.join)(info.appPath, "node_modules", packageName);
|
|
77
77
|
try {
|
|
78
78
|
return require(path);
|
|
79
79
|
} catch (error) {
|
package/dist/utils.mjs
CHANGED
package/dist/vite.js
CHANGED
|
@@ -33,13 +33,13 @@ __export(vite_exports, {
|
|
|
33
33
|
ElectronUpdater: () => ElectronUpdater
|
|
34
34
|
});
|
|
35
35
|
module.exports = __toCommonJS(vite_exports);
|
|
36
|
-
var
|
|
36
|
+
var import_vite = require("vite");
|
|
37
37
|
|
|
38
38
|
// src/build-plugins/build.ts
|
|
39
39
|
var import_promises = require("fs/promises");
|
|
40
40
|
var import_node_fs2 = require("fs");
|
|
41
41
|
var import_asar = __toESM(require("@electron/asar"));
|
|
42
|
-
var
|
|
42
|
+
var import_esbuild = require("esbuild");
|
|
43
43
|
|
|
44
44
|
// src/crypto.ts
|
|
45
45
|
var import_node_crypto = require("crypto");
|
|
@@ -184,21 +184,13 @@ async function buildEntry({
|
|
|
184
184
|
entryOutputPath: outfile,
|
|
185
185
|
minify
|
|
186
186
|
}) {
|
|
187
|
-
await (0,
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
rollupOptions: {
|
|
195
|
-
treeshake: true,
|
|
196
|
-
external: ["electron", "original-fs"],
|
|
197
|
-
output: {
|
|
198
|
-
file: outfile
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
187
|
+
await (0, import_esbuild.build)({
|
|
188
|
+
entryPoints: [entryPath],
|
|
189
|
+
bundle: true,
|
|
190
|
+
platform: "node",
|
|
191
|
+
outfile,
|
|
192
|
+
minify,
|
|
193
|
+
external: ["electron", "original-fs"]
|
|
202
194
|
});
|
|
203
195
|
}
|
|
204
196
|
|
|
@@ -353,7 +345,7 @@ function ElectronUpdater(options) {
|
|
|
353
345
|
const { entryPath, entryOutputPath } = buildEntryOption;
|
|
354
346
|
const { asarOutputPath } = buildAsarOption;
|
|
355
347
|
const id = "electron-incremental-updater";
|
|
356
|
-
const log = (0,
|
|
348
|
+
const log = (0, import_vite.createLogger)("info", { prefix: `[${id}]` });
|
|
357
349
|
return {
|
|
358
350
|
name: `vite-plugin-${id}`,
|
|
359
351
|
enforce: "post",
|
package/dist/vite.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
parseVersion,
|
|
6
6
|
zipFile
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CR6HTU6P.mjs";
|
|
8
8
|
import {
|
|
9
9
|
isUpdateJSON
|
|
10
10
|
} from "./chunk-2JVXVTC5.mjs";
|
|
@@ -17,7 +17,7 @@ import { createLogger } from "vite";
|
|
|
17
17
|
import { readFile, rename, writeFile } from "node:fs/promises";
|
|
18
18
|
import { existsSync } from "node:fs";
|
|
19
19
|
import Asar from "@electron/asar";
|
|
20
|
-
import { build } from "
|
|
20
|
+
import { build } from "esbuild";
|
|
21
21
|
async function buildAsar({
|
|
22
22
|
version,
|
|
23
23
|
asarOutputPath,
|
|
@@ -88,20 +88,12 @@ async function buildEntry({
|
|
|
88
88
|
minify
|
|
89
89
|
}) {
|
|
90
90
|
await build({
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
rollupOptions: {
|
|
98
|
-
treeshake: true,
|
|
99
|
-
external: ["electron", "original-fs"],
|
|
100
|
-
output: {
|
|
101
|
-
file: outfile
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
91
|
+
entryPoints: [entryPath],
|
|
92
|
+
bundle: true,
|
|
93
|
+
platform: "node",
|
|
94
|
+
outfile,
|
|
95
|
+
minify,
|
|
96
|
+
external: ["electron", "original-fs"]
|
|
105
97
|
});
|
|
106
98
|
}
|
|
107
99
|
|
package/package.json
CHANGED