@tomjs/vite-plugin-electron 1.9.1 → 1.9.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/README.md +3 -3
- package/README.zh_CN.md +3 -3
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +18 -17
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @tomjs/vite-plugin-electron
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@tomjs/vite-plugin-electron)   [](https://www.npmjs.com/package/@tomjs/vite-plugin-electron)   [](https://www.jsdocs.io/package/@tomjs/vite-plugin-electron)
|
|
4
4
|
|
|
5
5
|
**English** | [中文](./README.zh_CN.md)
|
|
6
6
|
|
|
@@ -214,7 +214,7 @@ The `recommended` option is used to set the default configuration and behavior,
|
|
|
214
214
|
|
|
215
215
|
### MainOptions
|
|
216
216
|
|
|
217
|
-
Based on [Options](https://
|
|
217
|
+
Based on [Options](https://www.jsdocs.io/package/tsup) of [tsup](https://tsup.egoist.dev/), some default values are added for ease of use.
|
|
218
218
|
|
|
219
219
|
| Property | Type | Default | Description |
|
|
220
220
|
| --- | --- | --- | --- |
|
|
@@ -225,7 +225,7 @@ Based on [Options](https://paka.dev/npm/tsup) of [tsup](https://tsup.egoist.dev/
|
|
|
225
225
|
|
|
226
226
|
### PreloadOptions
|
|
227
227
|
|
|
228
|
-
Based on [Options](https://
|
|
228
|
+
Based on [Options](https://www.jsdocs.io/package/tsup) of [tsup](https://tsup.egoist.dev/), some default values are added for ease of use.
|
|
229
229
|
|
|
230
230
|
| Property | Type | Default | Description |
|
|
231
231
|
| --- | --- | --- | --- |
|
package/README.zh_CN.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @tomjs/vite-plugin-electron
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@tomjs/vite-plugin-electron)   [](https://www.npmjs.com/package/@tomjs/vite-plugin-electron)   [](https://www.jsdocs.io/package/@tomjs/vite-plugin-electron)
|
|
4
4
|
|
|
5
5
|
[English](./README.md) | **中文**
|
|
6
6
|
|
|
@@ -213,7 +213,7 @@ export default defineConfig({
|
|
|
213
213
|
|
|
214
214
|
### MainOptions
|
|
215
215
|
|
|
216
|
-
继承自 [tsup](https://tsup.egoist.dev/) 的 [Options](https://
|
|
216
|
+
继承自 [tsup](https://tsup.egoist.dev/) 的 [Options](https://www.jsdocs.io/package/tsup),添加了一些默认值,方便使用。
|
|
217
217
|
|
|
218
218
|
| 参数名 | 类型 | 默认值 | 说明 |
|
|
219
219
|
| --- | --- | --- | --- |
|
|
@@ -224,7 +224,7 @@ export default defineConfig({
|
|
|
224
224
|
|
|
225
225
|
### PreloadOptions
|
|
226
226
|
|
|
227
|
-
继承自 [tsup](https://tsup.egoist.dev/) 的 [Options](https://
|
|
227
|
+
继承自 [tsup](https://tsup.egoist.dev/) 的 [Options](https://www.jsdocs.io/package/tsup),添加了一些默认值,方便使用。
|
|
228
228
|
|
|
229
229
|
| 参数名 | 类型 | 默认值 | 说明 |
|
|
230
230
|
| --- | --- | --- | --- |
|
package/dist/index.d.mts
CHANGED
|
@@ -3,8 +3,8 @@ import { Configuration } from 'electron-builder';
|
|
|
3
3
|
import { Options } from 'tsup';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Electron main process options. See [tsup](https://tsup.egoist.dev/) and [API Doc](https://
|
|
7
|
-
* @see https://
|
|
6
|
+
* Electron main process options. See [tsup](https://tsup.egoist.dev/) and [API Doc](https://www.jsdocs.io/package/tsup) for more information.
|
|
7
|
+
* @see https://www.jsdocs.io/package/tsup
|
|
8
8
|
* @see https://unpkg.com/browse/tsup/dist/index.d.ts
|
|
9
9
|
*/
|
|
10
10
|
interface MainOptions extends Omit<Options, 'entry' | 'format' | 'outDir' | 'watch' | 'onSuccess'> {
|
|
@@ -27,8 +27,8 @@ interface MainOptions extends Omit<Options, 'entry' | 'format' | 'outDir' | 'wat
|
|
|
27
27
|
onSuccess?: () => Promise<void | undefined | (() => void | Promise<void>)>;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
* Electron preload process options. See [tsup](https://tsup.egoist.dev/) and [API Doc](https://
|
|
31
|
-
* @see https://
|
|
30
|
+
* Electron preload process options. See [tsup](https://tsup.egoist.dev/) and [API Doc](https://www.jsdocs.io/package/tsup) for more information.
|
|
31
|
+
* @see https://www.jsdocs.io/package/tsup
|
|
32
32
|
* @see https://unpkg.com/browse/tsup/dist/index.d.ts
|
|
33
33
|
*/
|
|
34
34
|
interface PreloadOptions extends Omit<Options, 'entry' | 'format' | 'outDir' | 'watch' | 'onSuccess'> {
|
|
@@ -59,7 +59,7 @@ interface PreloadOptions extends Omit<Options, 'entry' | 'format' | 'outDir' | '
|
|
|
59
59
|
interface BuilderOptions {
|
|
60
60
|
/**
|
|
61
61
|
* Whether to enable the [electron-builder](https://www.electron.build), the default is false.
|
|
62
|
-
* @default
|
|
62
|
+
* @default false
|
|
63
63
|
* @deprecated
|
|
64
64
|
*/
|
|
65
65
|
enable?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { Configuration } from 'electron-builder';
|
|
|
3
3
|
import { Options } from 'tsup';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Electron main process options. See [tsup](https://tsup.egoist.dev/) and [API Doc](https://
|
|
7
|
-
* @see https://
|
|
6
|
+
* Electron main process options. See [tsup](https://tsup.egoist.dev/) and [API Doc](https://www.jsdocs.io/package/tsup) for more information.
|
|
7
|
+
* @see https://www.jsdocs.io/package/tsup
|
|
8
8
|
* @see https://unpkg.com/browse/tsup/dist/index.d.ts
|
|
9
9
|
*/
|
|
10
10
|
interface MainOptions extends Omit<Options, 'entry' | 'format' | 'outDir' | 'watch' | 'onSuccess'> {
|
|
@@ -27,8 +27,8 @@ interface MainOptions extends Omit<Options, 'entry' | 'format' | 'outDir' | 'wat
|
|
|
27
27
|
onSuccess?: () => Promise<void | undefined | (() => void | Promise<void>)>;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
* Electron preload process options. See [tsup](https://tsup.egoist.dev/) and [API Doc](https://
|
|
31
|
-
* @see https://
|
|
30
|
+
* Electron preload process options. See [tsup](https://tsup.egoist.dev/) and [API Doc](https://www.jsdocs.io/package/tsup) for more information.
|
|
31
|
+
* @see https://www.jsdocs.io/package/tsup
|
|
32
32
|
* @see https://unpkg.com/browse/tsup/dist/index.d.ts
|
|
33
33
|
*/
|
|
34
34
|
interface PreloadOptions extends Omit<Options, 'entry' | 'format' | 'outDir' | 'watch' | 'onSuccess'> {
|
|
@@ -59,7 +59,7 @@ interface PreloadOptions extends Omit<Options, 'entry' | 'format' | 'outDir' | '
|
|
|
59
59
|
interface BuilderOptions {
|
|
60
60
|
/**
|
|
61
61
|
* Whether to enable the [electron-builder](https://www.electron.build), the default is false.
|
|
62
|
-
* @default
|
|
62
|
+
* @default false
|
|
63
63
|
* @deprecated
|
|
64
64
|
*/
|
|
65
65
|
enable?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -116,7 +116,6 @@ function getMirror() {
|
|
|
116
116
|
}
|
|
117
117
|
function getBuilderConfig(options, resolvedConfig) {
|
|
118
118
|
var _a;
|
|
119
|
-
createPkg(options, resolvedConfig);
|
|
120
119
|
const config = {
|
|
121
120
|
directories: {
|
|
122
121
|
buildResources: "electron/build",
|
|
@@ -232,8 +231,9 @@ async function runElectronBuilder(options, resolvedConfig) {
|
|
|
232
231
|
}
|
|
233
232
|
logger.info("building electron app...");
|
|
234
233
|
const DIST_PATH = _path2.default.join(_process.cwd.call(void 0, ), _path2.default.dirname(resolvedConfig.build.outDir));
|
|
234
|
+
createPkg(options, resolvedConfig);
|
|
235
235
|
logger.info(`create package.json and exec "npm install"`);
|
|
236
|
-
_shelljs2.default.exec(`cd ${DIST_PATH} && npm
|
|
236
|
+
_shelljs2.default.exec(`cd ${DIST_PATH} && npm install --emit=dev`);
|
|
237
237
|
logger.info(`run electron-builder to package app`);
|
|
238
238
|
const config = getBuilderConfig(options, resolvedConfig);
|
|
239
239
|
const { build } = await Promise.resolve().then(() => _interopRequireWildcard(require("electron-builder")));
|
package/dist/index.mjs
CHANGED
|
@@ -115,7 +115,6 @@ function getMirror() {
|
|
|
115
115
|
}
|
|
116
116
|
function getBuilderConfig(options, resolvedConfig) {
|
|
117
117
|
var _a;
|
|
118
|
-
createPkg(options, resolvedConfig);
|
|
119
118
|
const config = {
|
|
120
119
|
directories: {
|
|
121
120
|
buildResources: "electron/build",
|
|
@@ -231,8 +230,9 @@ async function runElectronBuilder(options, resolvedConfig) {
|
|
|
231
230
|
}
|
|
232
231
|
logger.info("building electron app...");
|
|
233
232
|
const DIST_PATH = path.join(cwd(), path.dirname(resolvedConfig.build.outDir));
|
|
233
|
+
createPkg(options, resolvedConfig);
|
|
234
234
|
logger.info(`create package.json and exec "npm install"`);
|
|
235
|
-
shell.exec(`cd ${DIST_PATH} && npm
|
|
235
|
+
shell.exec(`cd ${DIST_PATH} && npm install --emit=dev`);
|
|
236
236
|
logger.info(`run electron-builder to package app`);
|
|
237
237
|
const config = getBuilderConfig(options, resolvedConfig);
|
|
238
238
|
const { build } = await import("electron-builder");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomjs/vite-plugin-electron",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.3",
|
|
4
4
|
"description": "A simple vite plugin for electron, supports esm/cjs, support esm in electron v28+",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vite",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"url": "git+https://github.com/tomjs/vite-plugin-electron.git"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"dayjs": "^1.11.
|
|
49
|
+
"dayjs": "^1.11.12",
|
|
50
50
|
"kolorist": "^1.8.0",
|
|
51
51
|
"lodash.clonedeep": "^4.5.0",
|
|
52
52
|
"lodash.merge": "^4.6.2",
|
|
@@ -55,25 +55,26 @@
|
|
|
55
55
|
"tsup": "7.2.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@commitlint/cli": "^
|
|
59
|
-
"@tomjs/commitlint": "^
|
|
60
|
-
"@tomjs/eslint": "^
|
|
61
|
-
"@tomjs/prettier": "^1.
|
|
62
|
-
"@tomjs/stylelint": "^2.
|
|
63
|
-
"@tomjs/tsconfig": "^1.
|
|
58
|
+
"@commitlint/cli": "^19.3.0",
|
|
59
|
+
"@tomjs/commitlint": "^3.3.0",
|
|
60
|
+
"@tomjs/eslint": "^3.3.0",
|
|
61
|
+
"@tomjs/prettier": "^1.4.1",
|
|
62
|
+
"@tomjs/stylelint": "^2.6.1",
|
|
63
|
+
"@tomjs/tsconfig": "^1.7.1",
|
|
64
64
|
"@types/lodash.clonedeep": "^4.5.9",
|
|
65
65
|
"@types/lodash.merge": "^4.6.9",
|
|
66
|
-
"@types/node": "^18.19.
|
|
66
|
+
"@types/node": "^18.19.42",
|
|
67
67
|
"@types/shelljs": "^0.8.15",
|
|
68
|
-
"eslint": "^8.
|
|
69
|
-
"husky": "^
|
|
70
|
-
"lint-staged": "^15.2.
|
|
68
|
+
"eslint": "^8.57.0",
|
|
69
|
+
"husky": "^9.1.4",
|
|
70
|
+
"lint-staged": "^15.2.7",
|
|
71
71
|
"npm-run-all": "^4.1.5",
|
|
72
|
-
"prettier": "^3.
|
|
73
|
-
"rimraf": "^
|
|
74
|
-
"stylelint": "^16.
|
|
75
|
-
"
|
|
76
|
-
"
|
|
72
|
+
"prettier": "^3.3.3",
|
|
73
|
+
"rimraf": "^6.0.1",
|
|
74
|
+
"stylelint": "^16.8.1",
|
|
75
|
+
"vite": "^5.3.5",
|
|
76
|
+
"tsx": "^4.16.5",
|
|
77
|
+
"typescript": "~5.5.4"
|
|
77
78
|
},
|
|
78
79
|
"peerDependencies": {
|
|
79
80
|
"electron": ">=12.0.0",
|