electronup 0.2.2 → 0.2.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/dist/bin/electronup.mjs +5 -2
- package/dist/client/index.mjs +1 -0
- package/package.json +1 -1
package/dist/bin/electronup.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { cac } from "cac";
|
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import * as prompts from "@clack/prompts";
|
|
7
7
|
import { Arch, Platform, build } from "electron-builder";
|
|
8
|
-
import
|
|
8
|
+
import fsExtra from "fs-extra";
|
|
9
9
|
import { blue, green, red, yellow } from "kolorist";
|
|
10
10
|
import { build as build$1, createServer } from "vite";
|
|
11
11
|
import { stringify } from "yaml";
|
|
@@ -16,7 +16,7 @@ import electron from "electron";
|
|
|
16
16
|
import { getPortPromise } from "portfinder";
|
|
17
17
|
|
|
18
18
|
//#region package.json
|
|
19
|
-
var version = "0.2.
|
|
19
|
+
var version = "0.2.3";
|
|
20
20
|
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/utils/dirs.ts
|
|
@@ -79,6 +79,7 @@ const store = Store.getInstance();
|
|
|
79
79
|
const NOT_FOUND = "找不到 electronup.config.ts | electronup.config.js | electronup.config.json , 请在根目录下添加配置文件 , 或显式的指定配置文件路径(相对于根目录)";
|
|
80
80
|
const PARSING_FAILED = "找到了配置文件,但解析配置文件失败!";
|
|
81
81
|
async function configPath(filePath) {
|
|
82
|
+
const { pathExists } = fsExtra;
|
|
82
83
|
const { root } = store;
|
|
83
84
|
if (filePath) return join(root, filePath);
|
|
84
85
|
const configList = [
|
|
@@ -107,6 +108,7 @@ async function getConfig(filePath) {
|
|
|
107
108
|
* CliOptions 配置直接
|
|
108
109
|
*/
|
|
109
110
|
async function getBuilderConfig(config, allConfig) {
|
|
111
|
+
const { readJSON } = fsExtra;
|
|
110
112
|
const packages = await readJSON(resolve(store.root, "package.json"));
|
|
111
113
|
const defaultConfig = {
|
|
112
114
|
asar: store.asar,
|
|
@@ -382,6 +384,7 @@ const platformSelect = [
|
|
|
382
384
|
}
|
|
383
385
|
];
|
|
384
386
|
async function build$2(options) {
|
|
387
|
+
const { writeFile } = fsExtra;
|
|
385
388
|
if (store.option) try {
|
|
386
389
|
const isMinify = await prompts.confirm({ message: green("是否压缩代码?") });
|
|
387
390
|
if (prompts.isCancel(isMinify)) throw new Error(`${red("✖")} Operation cancelled`);
|
package/dist/client/index.mjs
CHANGED