zen-gitsync 2.11.19 → 2.11.21

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 CHANGED
@@ -1,17 +1,134 @@
1
1
  # zen-gitsync
2
2
 
3
- `zen-gitsync` 是一个工作平台工具,集成部分 git 功能,可自定义命令,编排命令,设置自启动
3
+ [English](#zen-gitsync) | [中文](#zen-gitsync-1)
4
+
5
+ A Git automation platform with interactive commits, scheduled sync, custom command orchestration, file locking, and a visual GUI.
6
+
7
+ ## Installation
8
+
9
+ Install globally via npm:
10
+
11
+ ```bash
12
+ npm install -g zen-gitsync
13
+ ```
14
+
15
+ ## v2.x.x
16
+ - Added graphical user interface (GUI) mode
17
+ - Support for standardized commit message format
18
+
19
+ ### Launch GUI:
20
+ ```shell
21
+ $ g ui
22
+ ```
23
+ ![ui](https://home.flowdash.cn/upload/VditorFiles/2026-1/image_zbQZpiL6.png)
24
+
25
+ ### Command Orchestration
26
+
27
+ ![Command Orchestration](https://home.flowdash.cn/upload/VditorFiles/2026-1/zen-gitsync_SBAJdlvm.png)
28
+
29
+ ### Commands
30
+
31
+ #### Interactive commit:
32
+ ```bash
33
+ $ g
34
+ Enter your commit message: fix login page style
35
+ ```
36
+
37
+ #### Commit directly (skip prompt):
38
+ ```bash
39
+ $ g -y
40
+ ```
41
+
42
+ #### Set default commit message:
43
+ ```bash
44
+ $ g --set-default-message="update"
45
+ ```
46
+
47
+ #### Get current config:
48
+ ```bash
49
+ $ g get-config
50
+ ```
51
+
52
+ #### Commit with inline message:
53
+ ```bash
54
+ $ g -m <message>
55
+ $ g -m=<message>
56
+ ```
57
+
58
+ #### Show help:
59
+ ```shell
60
+ $ g -h
61
+ $ g --help
62
+ ```
63
+
64
+ #### Scheduled auto-commit (default interval: 1 hour):
65
+ ```bash
66
+ $ g -y --interval
67
+ $ g -y --interval=<seconds>
68
+ ```
69
+
70
+ #### Specify working directory:
71
+ ```bash
72
+ $ g --path=<path>
73
+ $ g --cwd=<path>
74
+ ```
75
+
76
+ #### Sync a folder in background (Windows cmd):
77
+ ```shell
78
+ start /min cmd /k "g -y --path=<your-folder> --interval"
79
+ ```
80
+
81
+ #### Scheduled command execution (Windows cmd):
82
+ ```shell
83
+ start /min cmd /k "g --cmd=\"echo hello\" --cmd-interval=5" # run every 5 seconds
84
+ start /min cmd /k "g --cmd=\"echo at-time\" --at=23:59" # run once at 23:59
85
+ start /min cmd /k "g --cmd=\"echo daily\" --at=23:59 --daily" # run daily at 23:59
86
+ ```
87
+
88
+ #### Suppress git diff output:
89
+ ```shell
90
+ $ g --no-diff
91
+ ```
92
+
93
+ #### Print formatted git log:
94
+ ```shell
95
+ $ g log
96
+ $ g log --n=5
97
+ ```
98
+
99
+ #### File locking (only effective within the tool):
100
+ ```shell
101
+ # Lock a file (locked files are excluded from commits)
102
+ $ g --lock-file=config.json
103
+
104
+ # Unlock a file
105
+ $ g --unlock-file=config.json
106
+
107
+ # List all locked files
108
+ $ g --list-locked
109
+
110
+ # Check if a file is locked
111
+ $ g --check-lock=config.json
112
+ ```
113
+
114
+ ---
115
+
116
+ # zen-gitsync
117
+
118
+ [English](#zen-gitsync) | [中文](#zen-gitsync-1)
119
+
120
+ `zen-gitsync` 是一个 Git 自动化工作平台,支持交互式提交、定时同步、自定义命令编排、文件锁定与可视化 GUI 界面。
4
121
 
5
122
  ## 安装
6
123
 
7
- 通过 npm 安装 `zen-gitsync`,并进行全局安装:
124
+ 通过 npm 全局安装:
8
125
 
9
126
  ```bash
10
127
  npm install -g zen-gitsync
11
128
  ```
12
129
 
13
130
  ## v2.x.x
14
- - 新增图形用户界面(GUI)模式
131
+ - 新增图形用户界面(GUI)模式
15
132
  - 支持标准化的提交信息格式
16
133
 
17
134
  ### 启动图形界面:
@@ -19,78 +136,82 @@ npm install -g zen-gitsync
19
136
  $ g ui
20
137
  ```
21
138
  ![ui](https://home.flowdash.cn/upload/VditorFiles/2026-1/image_zbQZpiL6.png)
139
+
22
140
  ### 命令编排
23
141
 
24
142
  ![命令编排](https://home.flowdash.cn/upload/VditorFiles/2026-1/zen-gitsync_SBAJdlvm.png)
25
143
 
26
- ### 其他命令:
144
+ ### 命令列表
145
+
27
146
  #### 交互式提交:
28
147
  ```bash
29
148
  $ g
30
149
  请输入你的提交信息: 修复了登录页样式问题
31
150
  ```
32
- #### 直接提交:
151
+
152
+ #### 直接提交(跳过输入):
33
153
  ```bash
34
154
  $ g -y
35
155
  ```
156
+
36
157
  #### 设置默认提交信息:
37
158
  ```bash
38
159
  $ g --set-default-message="提交"
39
160
  ```
40
- #### 获取默认提交信息:
161
+
162
+ #### 获取当前配置:
41
163
  ```bash
42
164
  $ g get-config
43
165
  ```
44
- #### 传入message直接提交:
166
+
167
+ #### 传入 message 直接提交:
45
168
  ```bash
46
169
  $ g -m <message>
47
170
  $ g -m=<message>
48
171
  ```
49
172
 
50
- #### 查看帮助
173
+ #### 查看帮助:
51
174
  ```shell
52
175
  $ g -h
53
176
  $ g --help
54
177
  ```
55
178
 
56
- #### 定时执行自动提交,默认间隔1小时
179
+ #### 定时执行自动提交(默认间隔 1 小时):
57
180
  ```bash
58
181
  $ g -y --interval
59
- $ g -y --interval=<seconds>
182
+ $ g -y --interval=<seconds>
60
183
  ```
61
- #### 指定目录提交
62
- ```bash
63
- $ g --path=<path>
64
- ```
65
-
184
+
185
+ #### 指定目录提交:
66
186
  ```bash
67
- $ g --cwd=<path>
187
+ $ g --path=<path>
188
+ $ g --cwd=<path>
68
189
  ```
69
190
 
70
- #### cmd同步文件夹
191
+ #### 后台同步文件夹(Windows cmd):
71
192
  ```shell
72
193
  start /min cmd /k "g -y --path=你要同步的文件夹 --interval"
73
194
  ```
74
195
 
75
- #### cmd 定时执行命令
196
+ #### 定时执行命令(Windows cmd):
76
197
  ```shell
77
- start /min cmd /k "g --cmd=\"echo hello\" --cmd-interval=5" # 每5秒执行一次echo hello
78
- start /min cmd /k "g --cmd=\"echo at-time\" --at=23:59" # 在23:59执行一次echo at-time
79
- start /min cmd /k "g --cmd=\"echo daily\" --at=23:59 --daily" # 每天23:59执行一次echo daily
198
+ start /min cmd /k "g --cmd=\"echo hello\" --cmd-interval=5" # 每5秒执行一次
199
+ start /min cmd /k "g --cmd=\"echo at-time\" --at=23:59" # 在23:59执行一次
200
+ start /min cmd /k "g --cmd=\"echo daily\" --at=23:59 --daily" # 每天23:59执行一次
80
201
  ```
81
202
 
82
- #### 不显示git diff内容
203
+ #### 不显示 git diff 内容:
83
204
  ```shell
84
205
  $ g --no-diff
85
206
  ```
86
207
 
87
- #### 格式化打印git log
208
+ #### 格式化打印 git log
88
209
  ```shell
89
210
  $ g log
90
211
  $ g log --n=5
91
212
  ```
92
- #### 文件锁定功能(仅在工具中有效)
93
213
 
214
+ #### 文件锁定功能(仅在工具中有效):
94
215
  ```shell
95
216
  # 锁定文件(锁定后的文件不会被包含在提交中)
96
217
  $ g --lock-file=config.json
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zen-gitsync",
3
- "version": "2.11.19",
4
- "description": "一个 git 提交的工具",
3
+ "version": "2.11.21",
4
+ "description": "A Git automation platform with interactive commits, scheduled sync, command orchestration, file locking, and a visual GUI.",
5
5
  "main": "index.js",
6
6
  "type": "module",
7
7
  "scripts": {
@@ -257,6 +257,26 @@ async function checkEnvironment() {
257
257
  }
258
258
  }
259
259
 
260
+ // TSC 类型检查
261
+ async function runTypeCheck() {
262
+ console.log(chalk.blue('\n=== TypeScript 类型检查 ==='));
263
+
264
+ const frontendDir = path.join(rootDir, 'src', 'ui', 'client');
265
+ if (!fs.existsSync(frontendDir)) {
266
+ console.log(chalk.yellow('前端项目目录不存在,跳过 TSC 检查'));
267
+ return;
268
+ }
269
+
270
+ try {
271
+ console.log(chalk.gray('执行 tsc --noEmit...'));
272
+ execSync('npx tsc --noEmit', { cwd: frontendDir, stdio: 'inherit' });
273
+ console.log(chalk.green('TSC 类型检查通过'));
274
+ } catch (error) {
275
+ console.error(chalk.red('TSC 类型检查失败,请修复以上错误后重新发布'));
276
+ process.exit(1);
277
+ }
278
+ }
279
+
260
280
  // 更新版本号
261
281
  function updateVersion() {
262
282
  console.log(chalk.blue('=== 更新版本号 ==='));
@@ -535,17 +555,20 @@ async function main() {
535
555
  try {
536
556
  // 1. 检查环境
537
557
  await checkEnvironment();
538
-
539
- // 2. 更新版本号
558
+
559
+ // 2. TSC 类型检查
560
+ await runTypeCheck();
561
+
562
+ // 3. 更新版本号
540
563
  const newVersion = updateVersion();
541
-
542
- // 3. 构建前端项目
564
+
565
+ // 4. 构建前端项目
543
566
  await buildFrontend();
544
-
545
- // 4. 提交更改到Git
567
+
568
+ // 5. 提交更改到Git
546
569
  await commitChanges(newVersion);
547
-
548
- // 5. 发布到NPM
570
+
571
+ // 6. 发布到NPM
549
572
  await publishToNpm();
550
573
 
551
574
  console.log(chalk.green('\n🎉 发布完成!'));