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.
@@ -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 { pathExists, readJSON, writeFile } from "fs-extra";
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.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`);
@@ -2,6 +2,7 @@
2
2
  function defineConfig(config) {
3
3
  return config;
4
4
  }
5
+ console.log("test :>> ");
5
6
 
6
7
  //#endregion
7
8
  export { defineConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electronup",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "融合构建 electron 应用需要的构建工具,保留原有配置习惯的命令行工具 ",
5
5
  "author": "quiteer",
6
6
  "license": "MIT",