@tomjs/vite-plugin-electron 2.0.1 → 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.
Files changed (2) hide show
  1. package/dist/index.mjs +11 -6
  2. 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 shell from "shelljs";
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 = shell.exec("npm config get registry", { silent: true });
137
- if (res.code === 0) {
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();
@@ -161,7 +160,10 @@ function getBuilderConfig(options, resolvedConfig) {
161
160
  target: "nsis",
162
161
  arch: ["x64"]
163
162
  }] },
164
- mac: { target: ["dmg"] },
163
+ mac: {
164
+ target: ["zip"],
165
+ sign: async () => {}
166
+ },
165
167
  linux: { target: ["zip"] },
166
168
  nsis: {
167
169
  oneClick: false,
@@ -234,7 +236,10 @@ async function runElectronBuilder(options, resolvedConfig) {
234
236
  const DIST_PATH = path.join(cwd(), path.dirname(resolvedConfig.build.outDir));
235
237
  createPkg(options, resolvedConfig);
236
238
  logger$1.info(`create package.json and exec "npm install"`);
237
- shell.exec(`cd ${DIST_PATH} && npm install --emit=dev`);
239
+ execaSync(`npm install --emit=dev`, {
240
+ cwd: DIST_PATH,
241
+ shell: true
242
+ });
238
243
  logger$1.info(`run electron-builder to package app`);
239
244
  const config = getBuilderConfig(options, resolvedConfig);
240
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.1",
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.18",
52
- "execa": "^8.0.1",
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
- "shelljs": "^0.10.0",
57
- "tsdown": "~0.16.4"
56
+ "tsdown": "~0.18.1"
58
57
  },
59
58
  "devDependencies": {
60
- "@commitlint/cli": "^19.8.1",
61
- "@tomjs/commitlint": "^4.0.0",
62
- "@tomjs/eslint": "^5.2.0",
63
- "@tomjs/stylelint": "^6.0.0",
64
- "@tomjs/tsconfig": "^2.0.0",
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.25",
68
- "@types/shelljs": "^0.8.17",
69
- "eslint": "^9.35.0",
70
- "lint-staged": "^16.1.6",
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.15",
73
- "rimraf": "^6.0.1",
72
+ "publint": "^0.3.16",
73
+ "rimraf": "^6.1.2",
74
74
  "simple-git-hooks": "^2.13.1",
75
- "stylelint": "^16.24.0",
76
- "tsx": "^4.20.5",
77
- "typescript": "~5.9.2",
78
- "vite": "^6.3.6"
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",