zen-gitsync 1.5.6 → 2.0.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.
Files changed (34) hide show
  1. package/README.md +9 -0
  2. package/package.json +10 -3
  3. package/src/config.js +2 -1
  4. package/src/gitCommit.js +7 -0
  5. package/src/ui/client/README.md +5 -0
  6. package/src/ui/client/auto-imports.d.ts +10 -0
  7. package/src/ui/client/components.d.ts +31 -0
  8. package/src/ui/client/index.html +13 -0
  9. package/src/ui/client/package.json +27 -0
  10. package/src/ui/client/public/favicon.svg +27 -0
  11. package/src/ui/client/public/logo.svg +27 -0
  12. package/src/ui/client/public/vite.svg +1 -0
  13. package/src/ui/client/src/App.vue +539 -0
  14. package/src/ui/client/src/assets/logo.svg +27 -0
  15. package/src/ui/client/src/components/CommitForm.vue +904 -0
  16. package/src/ui/client/src/components/GitStatus.vue +799 -0
  17. package/src/ui/client/src/components/LogList.vue +270 -0
  18. package/src/ui/client/src/main.ts +4 -0
  19. package/src/ui/client/src/vite-env.d.ts +1 -0
  20. package/src/ui/client/stats.html +4949 -0
  21. package/src/ui/client/tsconfig.app.json +14 -0
  22. package/src/ui/client/tsconfig.json +7 -0
  23. package/src/ui/client/tsconfig.node.json +24 -0
  24. package/src/ui/client/vite.config.ts +48 -0
  25. package/src/ui/public/assets/index-BHmYZROy.css +1 -0
  26. package/src/ui/public/assets/index-kfMX1bxz.js +9 -0
  27. package/src/ui/public/assets/vendor-Dp0FkvMe.css +1 -0
  28. package/src/ui/public/assets/vendor-DxvF30ca.js +41 -0
  29. package/src/ui/public/favicon.svg +27 -0
  30. package/src/ui/public/index.html +16 -0
  31. package/src/ui/public/logo.svg +27 -0
  32. package/src/ui/public/vite.svg +1 -0
  33. package/src/ui/server/index.js +598 -0
  34. package/src/utils/index.js +4 -0
package/README.md CHANGED
@@ -86,3 +86,12 @@ $ g --no-diff
86
86
  $ g log
87
87
  $ g log --n=5
88
88
  ```
89
+
90
+ ## ✨ 新特性 (v2.0.0)
91
+ - 新增图形用户界面(GUI)模式
92
+ - 支持标准化的提交信息格式
93
+
94
+ ### 启动图形界面:
95
+ ```shell
96
+ $ g ui
97
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zen-gitsync",
3
- "version": "1.5.6",
3
+ "version": "2.0.3",
4
4
  "description": "一个 git 自动查看差异并提交的工具",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -21,10 +21,14 @@
21
21
  "g:addResetScript": "node ./src/gitCommit.js addResetScript",
22
22
  "g:set-default-message": "node ./src/gitCommit.js --set-default-message=\"提交\"",
23
23
  "g:y": "g -y",
24
- "g:reset": "git reset --hard origin/main"
24
+ "g:reset": "git reset --hard origin/main",
25
+ "g:ui": "node ./src/gitCommit.js ui",
26
+ "start:vue": "cd ./src/ui/client && npm run dev",
27
+ "start:server": "node -e \"import('./src/ui/server/index.js').then(module => module.default())\""
25
28
  },
26
29
  "files": [
27
30
  "src/*",
31
+ "!src/ui/client/**",
28
32
  "package.json",
29
33
  "index.js"
30
34
  ],
@@ -50,8 +54,11 @@
50
54
  "chalk": "^5.4.1",
51
55
  "cli-table3": "^0.6.5",
52
56
  "date-fns": "^4.1.0",
57
+ "express": "^5.1.0",
53
58
  "log-update": "^6.1.0",
59
+ "open": "^10.1.2",
54
60
  "ora": "^8.1.1",
61
+ "socket.io": "^4.8.1",
55
62
  "string-width": "^7.2.0"
56
63
  }
57
- }
64
+ }
package/src/config.js CHANGED
@@ -7,7 +7,8 @@ const configPath = path.join(os.homedir(), '.git-commit-tool.json');
7
7
 
8
8
  // 默认配置
9
9
  const defaultConfig = {
10
- defaultCommitMessage: "submit"
10
+ defaultCommitMessage: "submit",
11
+ descriptionTemplates: [] // 添加描述模板数组
11
12
  };
12
13
 
13
14
  // 异步读取配置文件
package/src/gitCommit.js CHANGED
@@ -11,6 +11,7 @@ import boxen from 'boxen';
11
11
  import config from './config.js';
12
12
  import dateFormat from 'date-fns/format';
13
13
  import logUpdate from 'log-update';
14
+ import startUIServer from './ui/server/index.js';
14
15
 
15
16
  let countdownInterval = null;
16
17
 
@@ -111,6 +112,12 @@ async function createGitCommit(options) {
111
112
  async function main() {
112
113
  judgePlatform()
113
114
 
115
+ // 检查是否是UI命令
116
+ if (process.argv.includes('ui')) {
117
+ await startUIServer();
118
+ return;
119
+ }
120
+
114
121
  // 检查是否是添加脚本命令
115
122
  if (process.argv.includes('addScript')) {
116
123
  await addScriptToPackageJson();
@@ -0,0 +1,5 @@
1
+ # Vue 3 + TypeScript + Vite
2
+
3
+ This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
4
+
5
+ Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).
@@ -0,0 +1,10 @@
1
+ /* eslint-disable */
2
+ /* prettier-ignore */
3
+ // @ts-nocheck
4
+ // noinspection JSUnusedGlobalSymbols
5
+ // Generated by unplugin-auto-import
6
+ // biome-ignore lint: disable
7
+ export {}
8
+ declare global {
9
+
10
+ }
@@ -0,0 +1,31 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ // Generated by unplugin-vue-components
4
+ // Read more: https://github.com/vuejs/core/pull/3399
5
+ // biome-ignore lint: disable
6
+ export {}
7
+
8
+ /* prettier-ignore */
9
+ declare module 'vue' {
10
+ export interface GlobalComponents {
11
+ CommitForm: typeof import('./src/components/CommitForm.vue')['default']
12
+ ElButton: typeof import('element-plus/es')['ElButton']
13
+ ElCard: typeof import('element-plus/es')['ElCard']
14
+ ElDialog: typeof import('element-plus/es')['ElDialog']
15
+ ElEmpty: typeof import('element-plus/es')['ElEmpty']
16
+ ElForm: typeof import('element-plus/es')['ElForm']
17
+ ElFormItem: typeof import('element-plus/es')['ElFormItem']
18
+ ElIcon: typeof import('element-plus/es')['ElIcon']
19
+ ElInput: typeof import('element-plus/es')['ElInput']
20
+ ElOption: typeof import('element-plus/es')['ElOption']
21
+ ElRow: typeof import('element-plus/es')['ElRow']
22
+ ElSelect: typeof import('element-plus/es')['ElSelect']
23
+ ElSwitch: typeof import('element-plus/es')['ElSwitch']
24
+ ElTooltip: typeof import('element-plus/es')['ElTooltip']
25
+ GitStatus: typeof import('./src/components/GitStatus.vue')['default']
26
+ LogList: typeof import('./src/components/LogList.vue')['default']
27
+ }
28
+ export interface ComponentCustomProperties {
29
+ vLoading: typeof import('element-plus/es')['ElLoadingDirective']
30
+ }
31
+ }
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Zen-GitSync - Git同步工具</title>
8
+ </head>
9
+ <body>
10
+ <div id="app"></div>
11
+ <script type="module" src="/src/main.ts"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "client",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "vue-tsc -b && vite build",
9
+ "preview": "vite preview"
10
+ },
11
+ "dependencies": {
12
+ "@gitgraph/js": "^1.4.0",
13
+ "element-plus": "^2.9.9",
14
+ "socket.io-client": "^4.8.1",
15
+ "vue": "^3.5.13"
16
+ },
17
+ "devDependencies": {
18
+ "@vitejs/plugin-vue": "^5.2.2",
19
+ "@vue/tsconfig": "^0.7.0",
20
+ "rollup-plugin-visualizer": "^5.14.0",
21
+ "typescript": "~5.7.2",
22
+ "unplugin-auto-import": "^19.2.0",
23
+ "unplugin-vue-components": "^28.5.0",
24
+ "vite": "^6.3.1",
25
+ "vue-tsc": "^2.2.8"
26
+ }
27
+ }
@@ -0,0 +1,27 @@
1
+ <svg width="200" height="200" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
2
+ <!-- 主分支 -->
3
+ <line x1="40" y1="40" x2="40" y2="160" stroke="#34495e" stroke-width="8" stroke-linecap="round" />
4
+
5
+ <!-- 特性分支 -->
6
+ <path d="M40,70 C60,70 80,90 80,110 L80,130" stroke="#3498db" stroke-width="8" stroke-linecap="round" stroke-linejoin="round" fill="none" />
7
+
8
+ <!-- 开发分支 -->
9
+ <path d="M40,100 C60,100 100,110 100,130 L100,160" stroke="#2ecc71" stroke-width="8" stroke-linecap="round" stroke-linejoin="round" fill="none" />
10
+
11
+ <!-- 修复分支 -->
12
+ <path d="M40,130 C60,130 120,140 120,160" stroke="#e74c3c" stroke-width="8" stroke-linecap="round" stroke-linejoin="round" fill="none" />
13
+
14
+ <!-- 合并点 -->
15
+ <path d="M80,130 C80,145 60,145 40,145" stroke="#3498db" stroke-width="8" stroke-linecap="round" stroke-linejoin="round" fill="none" />
16
+
17
+ <!-- 节点 -->
18
+ <circle cx="40" cy="40" r="10" fill="#34495e" />
19
+ <circle cx="40" cy="70" r="10" fill="#34495e" />
20
+ <circle cx="40" cy="100" r="10" fill="#34495e" />
21
+ <circle cx="40" cy="130" r="10" fill="#34495e" />
22
+ <circle cx="40" cy="145" r="10" fill="#34495e" />
23
+ <circle cx="40" cy="160" r="10" fill="#34495e" />
24
+ <circle cx="80" cy="130" r="10" fill="#3498db" />
25
+ <circle cx="100" cy="160" r="10" fill="#2ecc71" />
26
+ <circle cx="120" cy="160" r="10" fill="#e74c3c" />
27
+ </svg>
@@ -0,0 +1,27 @@
1
+ <svg width="200" height="200" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
2
+ <!-- 主分支 -->
3
+ <line x1="40" y1="40" x2="40" y2="160" stroke="#34495e" stroke-width="8" stroke-linecap="round" />
4
+
5
+ <!-- 特性分支 -->
6
+ <path d="M40,70 C60,70 80,90 80,110 L80,130" stroke="#3498db" stroke-width="8" stroke-linecap="round" stroke-linejoin="round" fill="none" />
7
+
8
+ <!-- 开发分支 -->
9
+ <path d="M40,100 C60,100 100,110 100,130 L100,160" stroke="#2ecc71" stroke-width="8" stroke-linecap="round" stroke-linejoin="round" fill="none" />
10
+
11
+ <!-- 修复分支 -->
12
+ <path d="M40,130 C60,130 120,140 120,160" stroke="#e74c3c" stroke-width="8" stroke-linecap="round" stroke-linejoin="round" fill="none" />
13
+
14
+ <!-- 合并点 -->
15
+ <path d="M80,130 C80,145 60,145 40,145" stroke="#3498db" stroke-width="8" stroke-linecap="round" stroke-linejoin="round" fill="none" />
16
+
17
+ <!-- 节点 -->
18
+ <circle cx="40" cy="40" r="10" fill="#34495e" />
19
+ <circle cx="40" cy="70" r="10" fill="#34495e" />
20
+ <circle cx="40" cy="100" r="10" fill="#34495e" />
21
+ <circle cx="40" cy="130" r="10" fill="#34495e" />
22
+ <circle cx="40" cy="145" r="10" fill="#34495e" />
23
+ <circle cx="40" cy="160" r="10" fill="#34495e" />
24
+ <circle cx="80" cy="130" r="10" fill="#3498db" />
25
+ <circle cx="100" cy="160" r="10" fill="#2ecc71" />
26
+ <circle cx="120" cy="160" r="10" fill="#e74c3c" />
27
+ </svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>