electronup 0.0.6 → 0.0.8

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.
@@ -0,0 +1,71 @@
1
+ import { Configuration } from 'electron-builder';
2
+ import { UserConfig } from 'vite';
3
+ import { Options } from 'tsup';
4
+
5
+ interface ViteConfig extends Omit<UserConfig, 'publicDir' | 'ssr'> { }
6
+
7
+ interface TsupConfig {
8
+ external?: (string | RegExp)[];
9
+ noExternal?: (string | RegExp)[];
10
+ }
11
+
12
+ interface BuilderConfig extends Configuration { }
13
+
14
+ interface ElectronupConfig {
15
+ viteConfig?: ViteConfig
16
+ tsupConfig?: TsupConfig
17
+ preloadTsup?: Options | Options[]
18
+ builderConfig: BuilderConfig
19
+
20
+ /**
21
+ * 渲染进程入口目录
22
+ * @default 'render'
23
+ */
24
+ renderDir?: string
25
+
26
+ /**
27
+ * 主进程入口目录
28
+ * @default 'main'
29
+ */
30
+ mainDir?: string
31
+
32
+ /**
33
+ * 静态资源目录
34
+ * @default 'public'
35
+ */
36
+ publicDir?: string
37
+
38
+ /**
39
+ * 动态库目录
40
+ * @default 'lib'
41
+ */
42
+ libDir?: string
43
+
44
+ /**
45
+ * 资源构建输出目录
46
+ * @default 'dist'
47
+ */
48
+ resourceDir?: string
49
+
50
+ /**
51
+ * electron-builder 输出目录
52
+ * @default 'out'
53
+ */
54
+ outDir?: string
55
+ }
56
+
57
+ interface ConfigEnv {
58
+ command: 'build' | 'serve'
59
+ root: string
60
+ }
61
+
62
+ type ElectronupConfigFnObject = (env: ConfigEnv) => ElectronupConfig;
63
+ type ElectronupConfigFnPromise = (env: ConfigEnv) => Promise<ElectronupConfig>;
64
+ type ElectronupConfigFn = (env: ConfigEnv) => ElectronupConfig | Promise<ElectronupConfig>;
65
+ type ElectronupConfigExport = ElectronupConfig | Promise<ElectronupConfig> | ElectronupConfigFnObject | ElectronupConfigFnPromise | ElectronupConfigFn;
66
+ declare function defineConfig(config: ElectronupConfig): ElectronupConfig;
67
+ declare function defineConfig(config: Promise<ElectronupConfig>): Promise<ElectronupConfig>;
68
+ declare function defineConfig(config: ElectronupConfigFnObject): ElectronupConfigFnObject;
69
+ declare function defineConfig(config: ElectronupConfigExport): ElectronupConfigExport;
70
+
71
+ export { BuilderConfig, ConfigEnv, ElectronupConfig, ElectronupConfigExport, ElectronupConfigFn, ElectronupConfigFnObject, ElectronupConfigFnPromise, TsupConfig, ViteConfig, defineConfig };
@@ -1,10 +1,8 @@
1
1
  import { Configuration } from 'electron-builder';
2
- import { UserConfig, PluginOption } from 'vite';
2
+ import { UserConfig } from 'vite';
3
3
  import { Options } from 'tsup';
4
4
 
5
- type ViteConfig = Omit<UserConfig, 'plugins' | 'publicDir'> & {
6
- plugins?: PluginOption[]
7
- }
5
+ interface ViteConfig extends Omit<UserConfig, 'publicDir' | 'ssr'> { }
8
6
 
9
7
  interface TsupConfig {
10
8
  external?: (string | RegExp)[];
@@ -61,13 +59,13 @@ interface ConfigEnv {
61
59
  root: string
62
60
  }
63
61
 
64
-
65
- type ElectronupConfigAsyncFn = (env: ConfigEnv) => Promise<ElectronupConfig>
66
- type ElectronupConfigFn = (env: ConfigEnv) => ElectronupConfig
67
-
62
+ type ElectronupConfigFnObject = (env: ConfigEnv) => ElectronupConfig;
63
+ type ElectronupConfigFnPromise = (env: ConfigEnv) => Promise<ElectronupConfig>;
64
+ type ElectronupConfigFn = (env: ConfigEnv) => ElectronupConfig | Promise<ElectronupConfig>;
65
+ type ElectronupConfigExport = ElectronupConfig | Promise<ElectronupConfig> | ElectronupConfigFnObject | ElectronupConfigFnPromise | ElectronupConfigFn;
68
66
  declare function defineConfig(config: ElectronupConfig): ElectronupConfig;
69
67
  declare function defineConfig(config: Promise<ElectronupConfig>): Promise<ElectronupConfig>;
70
- declare function defineConfig(config: ElectronupConfigFn): ElectronupConfigFn;
71
- declare function defineConfig(config: ElectronupConfigAsyncFn): ElectronupConfigAsyncFn;
68
+ declare function defineConfig(config: ElectronupConfigFnObject): ElectronupConfigFnObject;
69
+ declare function defineConfig(config: ElectronupConfigExport): ElectronupConfigExport;
72
70
 
73
- export { BuilderConfig, ConfigEnv, ElectronupConfig, TsupConfig, ViteConfig, defineConfig };
71
+ export { BuilderConfig, ConfigEnv, ElectronupConfig, ElectronupConfigExport, ElectronupConfigFn, ElectronupConfigFnObject, ElectronupConfigFnPromise, TsupConfig, ViteConfig, defineConfig };
@@ -3,6 +3,10 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
6
10
  var __copyProps = (to, from, except, desc) => {
7
11
  if (from && typeof from === "object" || typeof from === "function") {
8
12
  for (let key of __getOwnPropNames(from))
@@ -15,4 +19,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
15
19
 
16
20
  // index.ts
17
21
  var electronup_exports = {};
22
+ __export(electronup_exports, {
23
+ defineConfig: () => defineConfig
24
+ });
18
25
  module.exports = __toCommonJS(electronup_exports);
26
+ function defineConfig(config) {
27
+ return config;
28
+ }
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ defineConfig
32
+ });
@@ -0,0 +1,7 @@
1
+ // index.ts
2
+ function defineConfig(config) {
3
+ return config;
4
+ }
5
+ export {
6
+ defineConfig
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electronup",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "融合构建 electron 应用需要的构建工具,保留原有配置习惯的命令行工具 ",
5
5
  "author": "quiteer",
6
6
  "license": "MIT",
@@ -38,27 +38,23 @@
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@types/node": ">= 16",
41
- "electron": ">= 20",
42
41
  "node": ">= 16",
43
42
  "vue": ">= 3"
44
43
  },
45
44
  "dependencies": {
46
- "electron-builder": "^23.6.0",
47
- "tsup": "^6.7.0",
48
- "typescript": "^5.0.4",
49
- "vite": "^4.3.1"
50
- },
51
- "devDependencies": {
52
45
  "@quiteer/parser-config": "^1.0.3",
53
- "@types/inquirer": "^9.0.3",
54
- "@types/rimraf": "^3.0.2",
55
46
  "cac": "^6.7.14",
56
47
  "dotenv": "^16.3.1",
57
- "electron": "^22.3.6",
58
- "fs-extra": "^10.1.0",
59
- "inquirer": "8.2.5",
48
+ "electron": "^21.2.2",
49
+ "electron-builder": "^24.6.3",
50
+ "fs-extra": "^11.1.1",
51
+ "inquirer": "^9.2.10",
60
52
  "portfinder": "^1.0.32",
61
- "rimraf": "^3.0.2",
53
+ "tsup": "^7.2.0",
54
+ "vite": "^4.4.9",
62
55
  "yaml": "^2.3.1"
56
+ },
57
+ "devDependencies": {
58
+ "@types/inquirer": "^9.0.3"
63
59
  }
64
60
  }