@zwa73/dev-utils 1.0.67 → 1.0.68

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 (24) hide show
  1. package/data/InitElectron/gitignore +92 -0
  2. package/data/{CreateElectronFrame → InitElectron}/package.json +2 -0
  3. package/data/{CreateElectronFrame → InitElectron}/src/Backend/BridgeBackend.ts +6 -6
  4. package/data/InitElectron/src/app.tsx +16 -0
  5. package/data/{CreateElectronFrame → InitElectron}/src/index.html +10 -0
  6. package/dist/Command/InitElectron.js +2 -1
  7. package/package.json +1 -1
  8. package/src/Command/InitElectron.ts +3 -1
  9. package/data/CreateElectronFrame/package-lock.json +0 -21433
  10. package/data/CreateElectronFrame/src/app.tsx +0 -6
  11. /package/data/{CreateElectronFrame → InitElectron}/.eslintrc.js +0 -0
  12. /package/data/{CreateElectronFrame → InitElectron}/forge.config.ts +0 -0
  13. /package/data/{CreateElectronFrame → InitElectron}/src/Backend/index.ts +0 -0
  14. /package/data/{CreateElectronFrame → InitElectron}/src/Frontend/Base.tsx +0 -0
  15. /package/data/{CreateElectronFrame → InitElectron}/src/Frontend/ContextProxy.ts +0 -0
  16. /package/data/{CreateElectronFrame → InitElectron}/src/Frontend/index.ts +0 -0
  17. /package/data/{CreateElectronFrame → InitElectron}/src/index.ts +0 -0
  18. /package/data/{CreateElectronFrame → InitElectron}/src/preload.ts +0 -0
  19. /package/data/{CreateElectronFrame → InitElectron}/src/renderer.ts +0 -0
  20. /package/data/{CreateElectronFrame → InitElectron}/tsconfig.json +0 -0
  21. /package/data/{CreateElectronFrame → InitElectron}/webpack.main.config.ts +0 -0
  22. /package/data/{CreateElectronFrame → InitElectron}/webpack.plugins.ts +0 -0
  23. /package/data/{CreateElectronFrame → InitElectron}/webpack.renderer.config.ts +0 -0
  24. /package/data/{CreateElectronFrame → InitElectron}/webpack.rules.ts +0 -0
@@ -0,0 +1,92 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ lerna-debug.log*
8
+
9
+ # Diagnostic reports (https://nodejs.org/api/report.html)
10
+ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11
+
12
+ # Runtime data
13
+ pids
14
+ *.pid
15
+ *.seed
16
+ *.pid.lock
17
+ .DS_Store
18
+
19
+ # Directory for instrumented libs generated by jscoverage/JSCover
20
+ lib-cov
21
+
22
+ # Coverage directory used by tools like istanbul
23
+ coverage
24
+ *.lcov
25
+
26
+ # nyc test coverage
27
+ .nyc_output
28
+
29
+ # node-waf configuration
30
+ .lock-wscript
31
+
32
+ # Compiled binary addons (https://nodejs.org/api/addons.html)
33
+ build/Release
34
+
35
+ # Dependency directories
36
+ node_modules/
37
+ jspm_packages/
38
+
39
+ # TypeScript v1 declaration files
40
+ typings/
41
+
42
+ # TypeScript cache
43
+ *.tsbuildinfo
44
+
45
+ # Optional npm cache directory
46
+ .npm
47
+
48
+ # Optional eslint cache
49
+ .eslintcache
50
+
51
+ # Optional REPL history
52
+ .node_repl_history
53
+
54
+ # Output of 'npm pack'
55
+ *.tgz
56
+
57
+ # Yarn Integrity file
58
+ .yarn-integrity
59
+
60
+ # dotenv environment variables file
61
+ .env
62
+ .env.test
63
+
64
+ # parcel-bundler cache (https://parceljs.org/)
65
+ .cache
66
+
67
+ # next.js build output
68
+ .next
69
+
70
+ # nuxt.js build output
71
+ .nuxt
72
+
73
+ # vuepress build output
74
+ .vuepress/dist
75
+
76
+ # Serverless directories
77
+ .serverless/
78
+
79
+ # FuseBox cache
80
+ .fusebox/
81
+
82
+ # DynamoDB Local files
83
+ .dynamodb/
84
+
85
+ # Webpack
86
+ .webpack/
87
+
88
+ # Vite
89
+ .vite/
90
+
91
+ # Electron-Forge
92
+ out/
@@ -49,6 +49,8 @@
49
49
  },
50
50
  "license": "MIT",
51
51
  "dependencies": {
52
+ "@zwa73/react-utils": "*",
53
+ "@zwa73/utils": "*",
52
54
  "electron-squirrel-startup": "^1.0.1",
53
55
  "react": "^18.3.1",
54
56
  "react-dom": "^18.3.1",
@@ -1,3 +1,4 @@
1
+ import { assertType } from "@zwa73/utils";
1
2
  import { IpcMainInvokeEvent, app } from "electron";
2
3
 
3
4
  /**后端桥对象 */
@@ -6,14 +7,13 @@ export const BridgeBackend = {
6
7
  return app.getAppPath();
7
8
  },
8
9
  test(e: IpcMainInvokeEvent, text: string) {
9
- return text + 0;
10
+ return text + " BridgeBackendTest";
10
11
  },
11
12
  };
12
13
  export type BridgeBackend = typeof BridgeBackend;
13
14
 
14
15
  //断言确保桥符合类型
15
- const assertBridge = <
16
- T extends {
17
- [key in string|number|symbol]: (arg1: IpcMainInvokeEvent, ...args: any[]) => any;
18
- } & { getBridgeKeys?: never } >(t:T) => undefined;
19
- assertBridge(BridgeBackend);
16
+
17
+ assertType<{
18
+ [key in string|number|symbol]: (arg1: IpcMainInvokeEvent, ...args: any[]) => any;
19
+ } & { getBridgeKeys?: never }>(BridgeBackend);
@@ -0,0 +1,16 @@
1
+ import { createRoot } from 'react-dom/client';
2
+ import { UtilRT } from '@zwa73/react-utils';
3
+ import { Base } from './Frontend';
4
+
5
+
6
+ UtilRT.setStyleVar(document.documentElement,{
7
+ "--background-color-1": "rgb(16, 18, 18)", // 深色背景1
8
+ "--background-color-2": "rgb(32, 34, 34)", // 深色背景2
9
+ "--background-color-3": "rgb(48, 50, 50)", // 深色背景3
10
+ "--background-color-1-trans": "rgba(16, 18, 18, 0.5)", // 深色背景1透明
11
+ "--font-color-1": "rgb(200, 200, 200)", // 亮色字体1
12
+ "--font-color-2": "rgb(100, 149, 237)", // 亮色字体2 (CornflowerBlue)
13
+ });
14
+ const container = document.getElementById('app-root')!;
15
+ const root = createRoot(container);
16
+ root.render(<Base/>);
@@ -7,6 +7,12 @@
7
7
  <style>
8
8
  html,
9
9
  body {
10
+ margin: 0;
11
+ padding: 0;
12
+ width: 100%;
13
+ height: 100%;
14
+ }
15
+ #app-root {
10
16
  overflow: hidden;
11
17
  margin: 0;
12
18
  padding: 0;
@@ -17,4 +23,8 @@
17
23
  </style>
18
24
  </head>
19
25
 
26
+ <body>
27
+ <div id="app-root"></div>
28
+ </body>
29
+
20
30
  </html>
@@ -31,7 +31,7 @@ const fs = __importStar(require("fs"));
31
31
  const pathe_1 = __importDefault(require("pathe"));
32
32
  const utils_1 = require("@zwa73/utils");
33
33
  const RouteInterface_1 = require("./RouteInterface");
34
- const InitDataPath = pathe_1.default.join(RouteInterface_1.DATA_PATH, 'CreateElectronFrame');
34
+ const InitDataPath = pathe_1.default.join(RouteInterface_1.DATA_PATH, 'InitElectron');
35
35
  /**复制基础文件 */
36
36
  async function copyData() {
37
37
  const filelist = await fs.promises.readdir(InitDataPath);
@@ -46,6 +46,7 @@ async function copyData() {
46
46
  return null;
47
47
  });
48
48
  await Promise.all(plist);
49
+ await fs.promises.rename('./gitignore', 'gitignore');
49
50
  }
50
51
  /**对项目进行初始化 */
51
52
  const CmdInitElectron = (program) => program
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zwa73/dev-utils",
3
- "version": "1.0.67",
3
+ "version": "1.0.68",
4
4
  "description": "编译与调试工具",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -7,7 +7,7 @@ import { SLogger, UtilFT, UtilFunc } from '@zwa73/utils';
7
7
  import { checkProject, DATA_PATH, MIRROR_SOURCE, PROJECT_PATH } from './RouteInterface';
8
8
 
9
9
 
10
- const InitDataPath = path.join(DATA_PATH,'CreateElectronFrame');
10
+ const InitDataPath = path.join(DATA_PATH,'InitElectron');
11
11
 
12
12
  /**复制基础文件 */
13
13
  async function copyData() {
@@ -23,8 +23,10 @@ async function copyData() {
23
23
  return null;
24
24
  })
25
25
  await Promise.all(plist);
26
+ await fs.promises.rename('./gitignore','gitignore');
26
27
  }
27
28
 
29
+
28
30
  /**对项目进行初始化 */
29
31
  export const CmdInitElectron = (program:Command)=>program
30
32
  .command('Init-Electron')