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 +145 -24
- package/package.json +2 -2
- package/scripts/release.js +31 -8
- package/src/ui/public/assets/css.worker-Wv5dxAWO.js +89 -0
- package/src/ui/public/assets/editor.worker-Bd9IXS8d.js +26 -0
- package/src/ui/public/assets/html.worker-CQP8QQsS.js +502 -0
- package/src/ui/public/assets/index-DI8xah2P.css +1 -0
- package/src/ui/public/assets/index-I2BT9uSF.js +92 -0
- package/src/ui/public/assets/json.worker-DzV-CpCQ.js +58 -0
- package/src/ui/public/assets/rolldown-runtime-BM3Ffeng.js +1 -0
- package/src/ui/public/assets/{ts.worker--OkPaiLD.js → ts.worker-Dth06zuC.js} +253 -250
- package/src/ui/public/assets/vendor-CjiV6IT4.css +1 -0
- package/src/ui/public/assets/vendor-CsS_wI9o.js +1323 -0
- package/src/ui/public/index.html +5 -4
- package/src/ui/server/routes/fs.js +117 -0
- package/src/ui/public/assets/css.worker-DJHgoStD.js +0 -93
- package/src/ui/public/assets/editor.worker-1JAmoQSB.js +0 -26
- package/src/ui/public/assets/html.worker-BSNtyp_I.js +0 -470
- package/src/ui/public/assets/index-DGWy-waR.css +0 -1
- package/src/ui/public/assets/index-JZlboou5.js +0 -109
- package/src/ui/public/assets/json.worker--DwPKSpO.js +0 -58
- package/src/ui/public/assets/vendor-CKZkoBDj.css +0 -1
- package/src/ui/public/assets/vendor-Ih5RdUJO.js +0 -1341
package/README.md
CHANGED
|
@@ -1,17 +1,134 @@
|
|
|
1
1
|
# zen-gitsync
|
|
2
2
|
|
|
3
|
-
|
|
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
|
+

|
|
24
|
+
|
|
25
|
+
### Command Orchestration
|
|
26
|
+
|
|
27
|
+

|
|
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
|
|
124
|
+
通过 npm 全局安装:
|
|
8
125
|
|
|
9
126
|
```bash
|
|
10
127
|
npm install -g zen-gitsync
|
|
11
128
|
```
|
|
12
129
|
|
|
13
130
|
## v2.x.x
|
|
14
|
-
-
|
|
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
|

|
|
139
|
+
|
|
22
140
|
### 命令编排
|
|
23
141
|
|
|
24
142
|

|
|
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
|
-
|
|
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
|
-
####
|
|
179
|
+
#### 定时执行自动提交(默认间隔 1 小时):
|
|
57
180
|
```bash
|
|
58
181
|
$ g -y --interval
|
|
59
|
-
$ g -y --interval=<seconds>
|
|
182
|
+
$ g -y --interval=<seconds>
|
|
60
183
|
```
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
$ g --path=<path>
|
|
64
|
-
```
|
|
65
|
-
或
|
|
184
|
+
|
|
185
|
+
#### 指定目录提交:
|
|
66
186
|
```bash
|
|
67
|
-
$ g --
|
|
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秒执行一次
|
|
78
|
-
start /min cmd /k "g --cmd=\"echo at-time\" --at=23:59"
|
|
79
|
-
start /min cmd /k "g --cmd=\"echo daily\" --at=23:59 --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.
|
|
4
|
-
"description": "
|
|
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": {
|
package/scripts/release.js
CHANGED
|
@@ -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
|
-
//
|
|
564
|
+
|
|
565
|
+
// 4. 构建前端项目
|
|
543
566
|
await buildFrontend();
|
|
544
|
-
|
|
545
|
-
//
|
|
567
|
+
|
|
568
|
+
// 5. 提交更改到Git
|
|
546
569
|
await commitChanges(newVersion);
|
|
547
|
-
|
|
548
|
-
//
|
|
570
|
+
|
|
571
|
+
// 6. 发布到NPM
|
|
549
572
|
await publishToNpm();
|
|
550
573
|
|
|
551
574
|
console.log(chalk.green('\n🎉 发布完成!'));
|