electron-version-deployer-cli 0.0.4 → 0.0.6
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/cli.cjs +8 -6
- package/dist/main.d.ts +1 -1
- package/dist/main.js +3 -0
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -157,6 +157,7 @@ async function bundleConfigFileAndRead(configFilePath) {
|
|
|
157
157
|
}
|
|
158
158
|
},
|
|
159
159
|
build: {
|
|
160
|
+
ssr: true,
|
|
160
161
|
write: false,
|
|
161
162
|
commonjsOptions: {
|
|
162
163
|
esmExternals: true
|
|
@@ -167,17 +168,18 @@ async function bundleConfigFileAndRead(configFilePath) {
|
|
|
167
168
|
minify: false,
|
|
168
169
|
lib: {
|
|
169
170
|
entry: configFilePath,
|
|
170
|
-
// 注意,由于我们需要将文件打包到一起,所以用的 iife 格式
|
|
171
|
-
// 这里给一个全局名称,方便等等在上下文中获取
|
|
172
171
|
name: "_",
|
|
173
|
-
formats: ["
|
|
172
|
+
formats: ["cjs"]
|
|
174
173
|
}
|
|
175
174
|
}
|
|
176
175
|
}).then((data) => {
|
|
177
176
|
const script = new vm.Script(data[0].output[0].code);
|
|
178
|
-
const ctx = {
|
|
177
|
+
const ctx = {
|
|
178
|
+
require,
|
|
179
|
+
module
|
|
180
|
+
};
|
|
179
181
|
script.runInNewContext(ctx);
|
|
180
|
-
resolve(ctx.
|
|
182
|
+
resolve(ctx.module.exports);
|
|
181
183
|
});
|
|
182
184
|
});
|
|
183
185
|
}
|
|
@@ -493,4 +495,4 @@ async function installPrebuilt(configs) {
|
|
|
493
495
|
}
|
|
494
496
|
commander.program.description(
|
|
495
497
|
"Electron 版本部署 CLI,简化你的 Electron 软件更新,让一切变得简单。"
|
|
496
|
-
).helpOption("-h, --help", "使用帮助").version("0.0.
|
|
498
|
+
).helpOption("-h, --help", "使用帮助").version("0.0.6", "-V, --version", "显示版本号").parse(process.argv);
|
package/dist/main.d.ts
CHANGED
|
@@ -15,5 +15,5 @@ type EVDInitPropsType = {
|
|
|
15
15
|
onError?: (err: unknown) => void;
|
|
16
16
|
};
|
|
17
17
|
export declare function EVDInit(props: EVDInitPropsType): void;
|
|
18
|
-
export declare function EVDCheckUpdate(): Promise<
|
|
18
|
+
export declare function EVDCheckUpdate(): Promise<boolean>;
|
|
19
19
|
export {};
|
package/dist/main.js
CHANGED
|
@@ -113,6 +113,9 @@ async function EVDCheckUpdate() {
|
|
|
113
113
|
const remoteVersion = versionToNum(remoteJSON.version);
|
|
114
114
|
if (remoteVersion > localVersion) {
|
|
115
115
|
await showNewVersionDialog();
|
|
116
|
+
return true;
|
|
117
|
+
} else {
|
|
118
|
+
return false;
|
|
116
119
|
}
|
|
117
120
|
}
|
|
118
121
|
async function showNewVersionDialog() {
|