electronup 0.2.0 → 0.2.2
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 +17 -13
- package/dist/client/index.d.mts +2 -2
- package/dist/client/index.mjs +1 -1
- package/package.json +4 -5
- package/dev.ts +0 -3
package/dist/bin/electronup.mjs
CHANGED
|
@@ -16,10 +16,10 @@ 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.2";
|
|
20
20
|
|
|
21
21
|
//#endregion
|
|
22
|
-
//#region utils/dirs.ts
|
|
22
|
+
//#region src/utils/dirs.ts
|
|
23
23
|
let DefaultDirs = /* @__PURE__ */ function(DefaultDirs) {
|
|
24
24
|
DefaultDirs["renderDir"] = "render";
|
|
25
25
|
DefaultDirs["mainDir"] = "main";
|
|
@@ -31,7 +31,7 @@ let DefaultDirs = /* @__PURE__ */ function(DefaultDirs) {
|
|
|
31
31
|
}({});
|
|
32
32
|
|
|
33
33
|
//#endregion
|
|
34
|
-
//#region utils/store.ts
|
|
34
|
+
//#region src/utils/store.ts
|
|
35
35
|
var Store = class Store {
|
|
36
36
|
static instance;
|
|
37
37
|
command;
|
|
@@ -75,7 +75,7 @@ var Store = class Store {
|
|
|
75
75
|
const store = Store.getInstance();
|
|
76
76
|
|
|
77
77
|
//#endregion
|
|
78
|
-
//#region transform/getConfig.ts
|
|
78
|
+
//#region src/transform/getConfig.ts
|
|
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) {
|
|
@@ -102,7 +102,7 @@ async function getConfig(filePath) {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
//#endregion
|
|
105
|
-
//#region configs/builder.ts
|
|
105
|
+
//#region src/configs/builder.ts
|
|
106
106
|
/**
|
|
107
107
|
* CliOptions 配置直接
|
|
108
108
|
*/
|
|
@@ -139,7 +139,7 @@ async function getBuilderConfig(config, allConfig) {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
//#endregion
|
|
142
|
-
//#region configs/tsdown.ts
|
|
142
|
+
//#region src/configs/tsdown.ts
|
|
143
143
|
/**
|
|
144
144
|
* Description 全局的环境变量路径
|
|
145
145
|
* @param {any} store.root
|
|
@@ -222,7 +222,11 @@ function startElectron(mainPath) {
|
|
|
222
222
|
manualRestart = false;
|
|
223
223
|
}, 5e3);
|
|
224
224
|
}
|
|
225
|
-
|
|
225
|
+
const env = {
|
|
226
|
+
...process.env,
|
|
227
|
+
...injectEnv()
|
|
228
|
+
};
|
|
229
|
+
electronProcess = spawn(electron, [mainPath], { env });
|
|
226
230
|
electronProcess.stdout.on("data", removeJunk);
|
|
227
231
|
electronProcess.stderr.on("data", removeJunk);
|
|
228
232
|
electronProcess.on("close", () => {
|
|
@@ -242,7 +246,7 @@ function removeJunk(chunk) {
|
|
|
242
246
|
}
|
|
243
247
|
|
|
244
248
|
//#endregion
|
|
245
|
-
//#region configs/vite.ts
|
|
249
|
+
//#region src/configs/vite.ts
|
|
246
250
|
function getViteConfig(config, allConfig) {
|
|
247
251
|
const { root, minify } = store;
|
|
248
252
|
return {
|
|
@@ -259,7 +263,7 @@ function getViteConfig(config, allConfig) {
|
|
|
259
263
|
}
|
|
260
264
|
|
|
261
265
|
//#endregion
|
|
262
|
-
//#region configs/electronup.ts
|
|
266
|
+
//#region src/configs/electronup.ts
|
|
263
267
|
async function getElectronupConfig(config) {
|
|
264
268
|
const { viteConfig, tsdownConfig, preload, builderConfig, ...dirConfig } = config;
|
|
265
269
|
const initConfig = {
|
|
@@ -275,7 +279,7 @@ async function getElectronupConfig(config) {
|
|
|
275
279
|
}
|
|
276
280
|
|
|
277
281
|
//#endregion
|
|
278
|
-
//#region transform/getExportConfig.ts
|
|
282
|
+
//#region src/transform/getExportConfig.ts
|
|
279
283
|
/**
|
|
280
284
|
* Description 解析用户自定义配置···
|
|
281
285
|
* @param {any} config:ElectronupConfigExport
|
|
@@ -293,7 +297,7 @@ async function exportElectronupConfig(config) {
|
|
|
293
297
|
const electronupConfig = async (config) => getElectronupConfig(await exportElectronupConfig(config));
|
|
294
298
|
|
|
295
299
|
//#endregion
|
|
296
|
-
//#region runner/build.ts
|
|
300
|
+
//#region src/runner/build.ts
|
|
297
301
|
const platformSelect = [
|
|
298
302
|
{
|
|
299
303
|
name: "Windows",
|
|
@@ -434,7 +438,7 @@ async function build$2(options) {
|
|
|
434
438
|
}
|
|
435
439
|
|
|
436
440
|
//#endregion
|
|
437
|
-
//#region runner/watch.ts
|
|
441
|
+
//#region src/runner/watch.ts
|
|
438
442
|
async function watch(options) {
|
|
439
443
|
const p = await getPortPromise({ port: Number(store.port) });
|
|
440
444
|
store.port = p;
|
|
@@ -449,7 +453,7 @@ async function watch(options) {
|
|
|
449
453
|
}
|
|
450
454
|
|
|
451
455
|
//#endregion
|
|
452
|
-
//#region cli.ts
|
|
456
|
+
//#region src/cli.ts
|
|
453
457
|
const cli = cac("electronup");
|
|
454
458
|
cli.option("-m , --mode <mode>", "[development | production | test | staging | ...] 环境模式 ");
|
|
455
459
|
cli.option("--no-minify", "使主进程和渲染进程代码不进行压缩 ");
|
package/dist/client/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { Configuration } from "electron-builder";
|
|
|
2
2
|
import { UserConfig } from "tsdown";
|
|
3
3
|
import { UserConfig as UserConfig$1 } from "vite";
|
|
4
4
|
|
|
5
|
-
//#region typings/electronup.d.ts
|
|
5
|
+
//#region src/typings/electronup.d.ts
|
|
6
6
|
interface ViteConfig extends Omit<UserConfig$1, 'publicDir' | 'ssr'> {}
|
|
7
7
|
interface TsdownConfig {
|
|
8
8
|
external?: (string | RegExp)[];
|
|
@@ -54,7 +54,7 @@ type ElectronupConfigFnPromise = (env: ConfigEnv) => Promise<ElectronupConfig>;
|
|
|
54
54
|
type ElectronupConfigFn = (env: ConfigEnv) => ElectronupConfig | Promise<ElectronupConfig>;
|
|
55
55
|
type ElectronupConfigExport = ElectronupConfig | Promise<ElectronupConfig> | ElectronupConfigFnObject | ElectronupConfigFnPromise | ElectronupConfigFn;
|
|
56
56
|
//#endregion
|
|
57
|
-
//#region index.d.ts
|
|
57
|
+
//#region src/index.d.ts
|
|
58
58
|
declare function defineConfig(config: ElectronupConfig): ElectronupConfig;
|
|
59
59
|
declare function defineConfig(config: Promise<ElectronupConfig>): Promise<ElectronupConfig>;
|
|
60
60
|
declare function defineConfig(config: ElectronupConfigFnObject): ElectronupConfigFnObject;
|
package/dist/client/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "electronup",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "融合构建 electron 应用需要的构建工具,保留原有配置习惯的命令行工具 ",
|
|
5
5
|
"author": "quiteer",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,9 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"exports": {
|
|
26
26
|
".": {
|
|
27
|
-
"types": "./dist/index.d.mts",
|
|
28
|
-
"import": "./dist/index.mjs"
|
|
29
|
-
"require": "./dist/index.mjs"
|
|
27
|
+
"types": "./dist/client/index.d.mts",
|
|
28
|
+
"import": "./dist/client/index.mjs"
|
|
30
29
|
}
|
|
31
30
|
},
|
|
32
31
|
"main": "dist/client/index.mjs",
|
|
@@ -44,7 +43,7 @@
|
|
|
44
43
|
"vue": ">= 3"
|
|
45
44
|
},
|
|
46
45
|
"dependencies": {
|
|
47
|
-
"@clack/prompts": "^1.0
|
|
46
|
+
"@clack/prompts": "^1.1.0",
|
|
48
47
|
"@quiteer/parser-config": "^1.0.3",
|
|
49
48
|
"cac": "^7.0.0",
|
|
50
49
|
"dotenv": "^17.3.1",
|
package/dev.ts
DELETED