@tomjs/vite-plugin-electron 2.0.2 → 2.1.0
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/index.mjs +7 -5
- package/package.json +20 -20
package/dist/index.mjs
CHANGED
|
@@ -5,12 +5,11 @@ import cloneDeep from "lodash.clonedeep";
|
|
|
5
5
|
import merge from "lodash.merge";
|
|
6
6
|
import os from "node:os";
|
|
7
7
|
import { cwd } from "node:process";
|
|
8
|
-
import
|
|
8
|
+
import { execa, execaSync } from "execa";
|
|
9
9
|
import dayjs from "dayjs";
|
|
10
10
|
import { blue, gray, green, red, yellow } from "kolorist";
|
|
11
11
|
import cp, { spawn } from "node:child_process";
|
|
12
12
|
import electron from "electron";
|
|
13
|
-
import { execa } from "execa";
|
|
14
13
|
import { build } from "tsdown";
|
|
15
14
|
|
|
16
15
|
//#region src/constants.ts
|
|
@@ -133,8 +132,8 @@ const logger$1 = createLogger();
|
|
|
133
132
|
function getMirror() {
|
|
134
133
|
let mirror = process.env.ELECTRON_MIRROR;
|
|
135
134
|
if (mirror) return mirror;
|
|
136
|
-
const res =
|
|
137
|
-
if (res.
|
|
135
|
+
const res = execaSync("npm config get registry", { shell: true });
|
|
136
|
+
if (res.exitCode === 0) {
|
|
138
137
|
let registry = res.stdout;
|
|
139
138
|
if (!registry) return;
|
|
140
139
|
registry = registry.trim();
|
|
@@ -237,7 +236,10 @@ async function runElectronBuilder(options, resolvedConfig) {
|
|
|
237
236
|
const DIST_PATH = path.join(cwd(), path.dirname(resolvedConfig.build.outDir));
|
|
238
237
|
createPkg(options, resolvedConfig);
|
|
239
238
|
logger$1.info(`create package.json and exec "npm install"`);
|
|
240
|
-
|
|
239
|
+
execaSync(`npm install --emit=dev`, {
|
|
240
|
+
cwd: DIST_PATH,
|
|
241
|
+
shell: true
|
|
242
|
+
});
|
|
241
243
|
logger$1.info(`run electron-builder to package app`);
|
|
242
244
|
const config = getBuilderConfig(options, resolvedConfig);
|
|
243
245
|
const { build: build$1 } = await import("electron-builder");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomjs/vite-plugin-electron",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0
|
|
4
|
+
"version": "2.1.0",
|
|
5
5
|
"description": "A simple vite plugin for electron, supports esm/cjs, support esm in electron v28+",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Tom Gao",
|
|
@@ -48,34 +48,34 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"dayjs": "^1.11.
|
|
52
|
-
"execa": "^
|
|
51
|
+
"dayjs": "^1.11.19",
|
|
52
|
+
"execa": "^9.6.1",
|
|
53
53
|
"kolorist": "^1.8.0",
|
|
54
54
|
"lodash.clonedeep": "^4.5.0",
|
|
55
55
|
"lodash.merge": "^4.6.2",
|
|
56
|
-
"
|
|
57
|
-
"tsdown": "~0.16.4"
|
|
56
|
+
"tsdown": "~0.18.1"
|
|
58
57
|
},
|
|
59
58
|
"devDependencies": {
|
|
60
|
-
"@commitlint/cli": "^
|
|
61
|
-
"@tomjs/commitlint": "^
|
|
62
|
-
"@tomjs/eslint": "^
|
|
63
|
-
"@tomjs/stylelint": "^
|
|
64
|
-
"@tomjs/tsconfig": "^2.
|
|
59
|
+
"@commitlint/cli": "^20.2.0",
|
|
60
|
+
"@tomjs/commitlint": "^5.0.0",
|
|
61
|
+
"@tomjs/eslint": "^6.0.0",
|
|
62
|
+
"@tomjs/stylelint": "^7.0.0",
|
|
63
|
+
"@tomjs/tsconfig": "^2.2.0",
|
|
65
64
|
"@types/lodash.clonedeep": "^4.5.9",
|
|
66
65
|
"@types/lodash.merge": "^4.6.9",
|
|
67
|
-
"@types/node": "^20.19.
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
66
|
+
"@types/node": "^20.19.27",
|
|
67
|
+
"electron": "^39.2.7",
|
|
68
|
+
"electron-builder": "^26.0.12",
|
|
69
|
+
"eslint": "^9.39.2",
|
|
70
|
+
"lint-staged": "^16.2.7",
|
|
71
71
|
"npm-run-all": "^4.1.5",
|
|
72
|
-
"publint": "^0.3.
|
|
73
|
-
"rimraf": "^6.
|
|
72
|
+
"publint": "^0.3.16",
|
|
73
|
+
"rimraf": "^6.1.2",
|
|
74
74
|
"simple-git-hooks": "^2.13.1",
|
|
75
|
-
"stylelint": "^16.
|
|
76
|
-
"tsx": "^4.
|
|
77
|
-
"typescript": "~5.9.
|
|
78
|
-
"vite": "^
|
|
75
|
+
"stylelint": "^16.26.1",
|
|
76
|
+
"tsx": "^4.21.0",
|
|
77
|
+
"typescript": "~5.9.3",
|
|
78
|
+
"vite": "^7.3.0"
|
|
79
79
|
},
|
|
80
80
|
"scripts": {
|
|
81
81
|
"dev": "tsdown --watch",
|