zen-gitsync 2.1.3 → 2.1.6

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 (38) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +96 -96
  3. package/index.js +2 -2
  4. package/package.json +69 -66
  5. package/src/config.js +51 -51
  6. package/src/gitCommit.js +261 -261
  7. package/src/ui/public/assets/index-8gQo1ABk.js +20 -0
  8. package/src/ui/public/assets/index-IcGOG2Ja.css +1 -0
  9. package/src/ui/public/assets/{vendor-Dy1zosHw.js → vendor-Bm8yNvvz.js} +1 -1
  10. package/src/ui/public/favicon.svg +26 -26
  11. package/src/ui/public/index.html +3 -3
  12. package/src/ui/public/logo.svg +26 -26
  13. package/src/ui/server/index.js +141 -51
  14. package/src/ui/client/README.md +0 -5
  15. package/src/ui/client/auto-imports.d.ts +0 -10
  16. package/src/ui/client/components.d.ts +0 -33
  17. package/src/ui/client/index.html +0 -13
  18. package/src/ui/client/package.json +0 -28
  19. package/src/ui/client/public/favicon.svg +0 -27
  20. package/src/ui/client/public/logo.svg +0 -27
  21. package/src/ui/client/public/vite.svg +0 -1
  22. package/src/ui/client/src/App.vue +0 -984
  23. package/src/ui/client/src/assets/logo.svg +0 -27
  24. package/src/ui/client/src/components/CommitForm.vue +0 -2158
  25. package/src/ui/client/src/components/GitStatus.vue +0 -1621
  26. package/src/ui/client/src/components/LogList.vue +0 -1937
  27. package/src/ui/client/src/main.ts +0 -7
  28. package/src/ui/client/src/stores/configStore.ts +0 -212
  29. package/src/ui/client/src/stores/gitLogStore.ts +0 -790
  30. package/src/ui/client/src/stores/gitStore.ts +0 -443
  31. package/src/ui/client/src/vite-env.d.ts +0 -1
  32. package/src/ui/client/stats.html +0 -4949
  33. package/src/ui/client/tsconfig.app.json +0 -14
  34. package/src/ui/client/tsconfig.json +0 -7
  35. package/src/ui/client/tsconfig.node.json +0 -24
  36. package/src/ui/client/vite.config.ts +0 -50
  37. package/src/ui/public/assets/index-CekdGwXY.js +0 -20
  38. package/src/ui/public/assets/index-SwSkrgGk.css +0 -1
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 xz333221
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2024 xz333221
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,96 +1,96 @@
1
- # zen-gitsync
2
-
3
- `zen-gitsync` 是一个简单的命令行工具,用于自动化 Git 提交和推送操作。只需在控制台输入 `g`,并输入提交内容,即可自动执行 `git add`、`git commit` 和 `git push` 操作,极大提升 Git 工作流程的效率。
4
-
5
- ## 安装
6
-
7
- 通过 npm 安装 `zen-gitsync`,并进行全局安装:
8
-
9
- ```bash
10
- npm install -g zen-gitsync
11
- ```
12
-
13
- ## 使用方法
14
-
15
- 1. 在终端中,输入 `g` 并按回车。
16
- 2. 输入提交信息,按回车确认提交。
17
- 3. 工具将自动查看远程分支并自动提交
18
-
19
-
20
- ### 示例:
21
- #### 交互式提交:
22
- ```bash
23
- $ g
24
- 请输入你的提交信息: 修复了登录页样式问题
25
- ```
26
- #### 直接提交:
27
- ```bash
28
- $ g -y
29
- ```
30
- #### 设置默认提交信息:
31
- ```bash
32
- $ g --set-default-message="提交"
33
- ```
34
- #### 获取默认提交信息:
35
- ```bash
36
- $ g get-config
37
- ```
38
- #### 传入message直接提交:
39
- ```bash
40
- $ g -m <message>
41
- $ g -m=<message>
42
- ```
43
-
44
- #### 查看帮助
45
- ```shell
46
- $ g -h
47
- $ g --help
48
- ```
49
-
50
- #### 定时执行自动提交,默认间隔1小时
51
- ```bash
52
- $ g -y --interval
53
- $ g -y --interval=<seconds>
54
- ```
55
- #### 指定目录提交
56
- ```bash
57
- $ g --path=<path>
58
- ```
59
-
60
- ```bash
61
- $ g --cwd=<path>
62
- ```
63
-
64
- #### 添加项目script
65
- ```json
66
- {
67
- "scripts": {
68
- "g:y": "g -y"
69
- }
70
- }
71
- ```
72
-
73
- #### cmd同步文件夹
74
- ```shell
75
- start /min cmd /k "g -y --path=你要同步的文件夹 --interval"
76
- ```
77
-
78
- #### 不显示git diff内容
79
- ```shell
80
- $ g --no-diff
81
- ```
82
-
83
- #### 格式化打印git log
84
- ```shell
85
- $ g log
86
- $ g log --n=5
87
- ```
88
-
89
- ## ✨ 新特性 (v2.0.0)
90
- - 新增图形用户界面(GUI)模式
91
- - 支持标准化的提交信息格式
92
-
93
- ### 启动图形界面:
94
- ```shell
95
- $ g ui
96
- ```
1
+ # zen-gitsync
2
+
3
+ `zen-gitsync` 是一个简单的命令行工具,用于自动化 Git 提交和推送操作。只需在控制台输入 `g`,并输入提交内容,即可自动执行 `git add`、`git commit` 和 `git push` 操作,极大提升 Git 工作流程的效率。
4
+
5
+ ## 安装
6
+
7
+ 通过 npm 安装 `zen-gitsync`,并进行全局安装:
8
+
9
+ ```bash
10
+ npm install -g zen-gitsync
11
+ ```
12
+
13
+ ## 使用方法
14
+
15
+ 1. 在终端中,输入 `g` 并按回车。
16
+ 2. 输入提交信息,按回车确认提交。
17
+ 3. 工具将自动查看远程分支并自动提交
18
+
19
+
20
+ ### 示例:
21
+ #### 交互式提交:
22
+ ```bash
23
+ $ g
24
+ 请输入你的提交信息: 修复了登录页样式问题
25
+ ```
26
+ #### 直接提交:
27
+ ```bash
28
+ $ g -y
29
+ ```
30
+ #### 设置默认提交信息:
31
+ ```bash
32
+ $ g --set-default-message="提交"
33
+ ```
34
+ #### 获取默认提交信息:
35
+ ```bash
36
+ $ g get-config
37
+ ```
38
+ #### 传入message直接提交:
39
+ ```bash
40
+ $ g -m <message>
41
+ $ g -m=<message>
42
+ ```
43
+
44
+ #### 查看帮助
45
+ ```shell
46
+ $ g -h
47
+ $ g --help
48
+ ```
49
+
50
+ #### 定时执行自动提交,默认间隔1小时
51
+ ```bash
52
+ $ g -y --interval
53
+ $ g -y --interval=<seconds>
54
+ ```
55
+ #### 指定目录提交
56
+ ```bash
57
+ $ g --path=<path>
58
+ ```
59
+
60
+ ```bash
61
+ $ g --cwd=<path>
62
+ ```
63
+
64
+ #### 添加项目script
65
+ ```json
66
+ {
67
+ "scripts": {
68
+ "g:y": "g -y"
69
+ }
70
+ }
71
+ ```
72
+
73
+ #### cmd同步文件夹
74
+ ```shell
75
+ start /min cmd /k "g -y --path=你要同步的文件夹 --interval"
76
+ ```
77
+
78
+ #### 不显示git diff内容
79
+ ```shell
80
+ $ g --no-diff
81
+ ```
82
+
83
+ #### 格式化打印git log
84
+ ```shell
85
+ $ g log
86
+ $ g log --n=5
87
+ ```
88
+
89
+ ## ✨ 新特性 (v2.0.0)
90
+ - 新增图形用户界面(GUI)模式
91
+ - 支持标准化的提交信息格式
92
+
93
+ ### 启动图形界面:
94
+ ```shell
95
+ $ g ui
96
+ ```
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import config from './src/config.js'
2
- export default config
1
+ import config from './src/config.js'
2
+ export default config
package/package.json CHANGED
@@ -1,66 +1,69 @@
1
- {
2
- "name": "zen-gitsync",
3
- "version": "2.1.3",
4
- "description": "一个 git 自动查看差异并提交的工具",
5
- "main": "index.js",
6
- "type": "module",
7
- "scripts": {
8
- "g": "node ./src/gitCommit.js",
9
- "g:m": "node ./src/gitCommit.js -m='test'",
10
- "g:m2": "node ./src/gitCommit.js -m testmsg",
11
- "g:y:interval": "node ./src/gitCommit.js -y --interval",
12
- "g:y:interval10": "node ./src/gitCommit.js -y --interval=10",
13
- "g:cwd": "node ./src/gitCommit.js --path=./",
14
- "g:cwd2": "node ./src/gitCommit.js --path=../",
15
- "g:no-diff": "node ./src/gitCommit.js --no-diff",
16
- "g:log": "node ./src/gitCommit.js log",
17
- "g:log5": "node ./src/gitCommit.js log --n=5",
18
- "g:h": "node ./src/gitCommit.js -h",
19
- "g:get-config": "node ./src/gitCommit.js get-config",
20
- "g:addScript": "node ./src/gitCommit.js addScript",
21
- "g:addResetScript": "node ./src/gitCommit.js addResetScript",
22
- "g:set-default-message": "node ./src/gitCommit.js --set-default-message=\"提交\"",
23
- "g:y": "g -y",
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())\""
28
- },
29
- "files": [
30
- "src/*",
31
- "!src/ui/client/**",
32
- "package.json",
33
- "index.js"
34
- ],
35
- "bin": {
36
- "g": "./src/gitCommit.js"
37
- },
38
- "repository": {
39
- "type": "git",
40
- "url": "git+https://github.com/xz333221/zen-gitsync.git"
41
- },
42
- "keywords": [
43
- "gitsync",
44
- "git"
45
- ],
46
- "author": "",
47
- "license": "MIT",
48
- "bugs": {
49
- "url": "https://github.com/xz333221/zen-gitsync/issues"
50
- },
51
- "homepage": "https://github.com/xz333221/zen-gitsync#readme",
52
- "dependencies": {
53
- "boxen": "^8.0.1",
54
- "chalk": "^5.4.1",
55
- "chokidar": "^4.0.3",
56
- "cli-table3": "^0.6.5",
57
- "date-fns": "^4.1.0",
58
- "express": "^5.1.0",
59
- "log-update": "^6.1.0",
60
- "open": "^10.1.2",
61
- "ora": "^8.1.1",
62
- "socket.io": "^4.8.1",
63
- "socket.io-client": "^4.8.1",
64
- "string-width": "^7.2.0"
65
- }
66
- }
1
+ {
2
+ "name": "zen-gitsync",
3
+ "version": "2.1.6",
4
+ "description": "一个 git 自动查看差异并提交的工具",
5
+ "main": "index.js",
6
+ "type": "module",
7
+ "scripts": {
8
+ "g": "node ./src/gitCommit.js",
9
+ "g:m": "node ./src/gitCommit.js -m='test'",
10
+ "g:m2": "node ./src/gitCommit.js -m testmsg",
11
+ "g:y:interval": "node ./src/gitCommit.js -y --interval",
12
+ "g:y:interval10": "node ./src/gitCommit.js -y --interval=10",
13
+ "g:cwd": "node ./src/gitCommit.js --path=./",
14
+ "g:cwd2": "node ./src/gitCommit.js --path=../",
15
+ "g:no-diff": "node ./src/gitCommit.js --no-diff",
16
+ "g:log": "node ./src/gitCommit.js log",
17
+ "g:log5": "node ./src/gitCommit.js log --n=5",
18
+ "g:h": "node ./src/gitCommit.js -h",
19
+ "g:get-config": "node ./src/gitCommit.js get-config",
20
+ "g:addScript": "node ./src/gitCommit.js addScript",
21
+ "g:addResetScript": "node ./src/gitCommit.js addResetScript",
22
+ "g:set-default-message": "node ./src/gitCommit.js --set-default-message=\"提交\"",
23
+ "g:y": "g -y",
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())\""
28
+ },
29
+ "files": [
30
+ "src/ui/public/**",
31
+ "src/ui/server/**",
32
+ "src/utils/**",
33
+ "src/gitCommit.js",
34
+ "src/config.js",
35
+ "package.json",
36
+ "index.js"
37
+ ],
38
+ "bin": {
39
+ "g": "./src/gitCommit.js"
40
+ },
41
+ "repository": {
42
+ "type": "git",
43
+ "url": "git+https://github.com/xz333221/zen-gitsync.git"
44
+ },
45
+ "keywords": [
46
+ "gitsync",
47
+ "git"
48
+ ],
49
+ "author": "",
50
+ "license": "MIT",
51
+ "bugs": {
52
+ "url": "https://github.com/xz333221/zen-gitsync/issues"
53
+ },
54
+ "homepage": "https://github.com/xz333221/zen-gitsync#readme",
55
+ "dependencies": {
56
+ "boxen": "^8.0.1",
57
+ "chalk": "^5.4.1",
58
+ "chokidar": "^4.0.3",
59
+ "cli-table3": "^0.6.5",
60
+ "date-fns": "^4.1.0",
61
+ "express": "^5.1.0",
62
+ "log-update": "^6.1.0",
63
+ "open": "^10.1.2",
64
+ "ora": "^8.1.1",
65
+ "socket.io": "^4.8.1",
66
+ "socket.io-client": "^4.8.1",
67
+ "string-width": "^7.2.0"
68
+ }
69
+ }
package/src/config.js CHANGED
@@ -1,51 +1,51 @@
1
- import { promises as fs } from 'fs';
2
- import path from 'path';
3
- import os from 'os';
4
- import chalk from 'chalk';
5
-
6
- const configPath = path.join(os.homedir(), '.git-commit-tool.json');
7
-
8
- // 默认配置
9
- const defaultConfig = {
10
- defaultCommitMessage: "submit",
11
- descriptionTemplates: [] // 添加描述模板数组
12
- };
13
-
14
- // 异步读取配置文件
15
- async function loadConfig() {
16
- try {
17
- const data = await fs.readFile(configPath, 'utf-8');
18
- return { ...defaultConfig, ...JSON.parse(data) };
19
- } catch (error) {
20
- return defaultConfig;
21
- }
22
- }
23
-
24
- // 异步保存配置
25
- async function saveConfig(config) {
26
- await fs.writeFile(configPath, JSON.stringify(config, null, 2), 'utf-8');
27
- }
28
- // 添加配置管理函数
29
- async function handleConfigCommands() {
30
- if (process.argv.includes('get-config')) {
31
- const currentConfig = await loadConfig();
32
- console.log('Current configuration:');
33
- console.log(currentConfig);
34
- process.exit();
35
- }
36
-
37
- const setMsgArg = process.argv.find(arg => arg.startsWith('--set-default-message='));
38
- if (setMsgArg) {
39
- const newMessage = setMsgArg.split('=')[1];
40
- const currentConfig = await loadConfig();
41
- currentConfig.defaultCommitMessage = newMessage;
42
- await saveConfig(currentConfig);
43
- console.log(chalk.green(`✓ 默认提交信息已设置为: "${newMessage}"`));
44
- process.exit();
45
- }
46
- }
47
- export default {
48
- loadConfig,
49
- saveConfig,
50
- handleConfigCommands
51
- };
1
+ import { promises as fs } from 'fs';
2
+ import path from 'path';
3
+ import os from 'os';
4
+ import chalk from 'chalk';
5
+
6
+ const configPath = path.join(os.homedir(), '.git-commit-tool.json');
7
+
8
+ // 默认配置
9
+ const defaultConfig = {
10
+ defaultCommitMessage: "submit",
11
+ descriptionTemplates: [] // 添加描述模板数组
12
+ };
13
+
14
+ // 异步读取配置文件
15
+ async function loadConfig() {
16
+ try {
17
+ const data = await fs.readFile(configPath, 'utf-8');
18
+ return { ...defaultConfig, ...JSON.parse(data) };
19
+ } catch (error) {
20
+ return defaultConfig;
21
+ }
22
+ }
23
+
24
+ // 异步保存配置
25
+ async function saveConfig(config) {
26
+ await fs.writeFile(configPath, JSON.stringify(config, null, 2), 'utf-8');
27
+ }
28
+ // 添加配置管理函数
29
+ async function handleConfigCommands() {
30
+ if (process.argv.includes('get-config')) {
31
+ const currentConfig = await loadConfig();
32
+ console.log('Current configuration:');
33
+ console.log(currentConfig);
34
+ process.exit();
35
+ }
36
+
37
+ const setMsgArg = process.argv.find(arg => arg.startsWith('--set-default-message='));
38
+ if (setMsgArg) {
39
+ const newMessage = setMsgArg.split('=')[1];
40
+ const currentConfig = await loadConfig();
41
+ currentConfig.defaultCommitMessage = newMessage;
42
+ await saveConfig(currentConfig);
43
+ console.log(chalk.green(`✓ 默认提交信息已设置为: "${newMessage}"`));
44
+ process.exit();
45
+ }
46
+ }
47
+ export default {
48
+ loadConfig,
49
+ saveConfig,
50
+ handleConfigCommands
51
+ };