@zat-design/sisyphus-react 4.0.17 → 4.0.19-beta.2

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.
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: sync-commits
3
+ description: "Syncs commits between sisyphus v3 and v4 repositories via cherry-pick. Use when asked to sync, cherry-pick, or transfer commits between v3 (xk-sisyphus-web) and v4 (xk-sisyphus4-web)."
4
+ argument-hint: "<commit-hash> <direction: 3to4 | 4to3>"
5
+ ---
6
+
7
+ # Sync Commits Between Sisyphus v3 and v4
8
+
9
+ 同步西西弗组件库 v3 和 v4 版本之间的提交。
10
+
11
+ ## 仓库信息
12
+
13
+ | 版本 | 仓库 | 分支 | 远程名 |
14
+ |------|------|------|--------|
15
+ | v3 | git@git.zhonganinfo.com:zaxk/xk-sisyphus-web.git | dev_3.0.0 | source |
16
+ | v4 | git@git.zhonganinfo.com:zaxk/xk-sisyphus4-web.git | dev_4 | origin |
17
+
18
+ ## 使用方法
19
+
20
+ 调用此 skill 时传入参数:
21
+ - `<commit-hash>`: 要同步的提交 hash
22
+ - `<direction>`: 同步方向
23
+ - `3to4`: 从 v3 同步到 v4(默认)
24
+ - `4to3`: 从 v4 同步到 v3
25
+
26
+ ## 执行流程
27
+
28
+ ### 1. 确保远程仓库已配置
29
+
30
+ ```bash
31
+ # 检查远程配置
32
+ git remote -v
33
+
34
+ # 如果缺少 source 远程,添加 v3 仓库
35
+ git remote add source https://xk-wanchongyang:AAAbbb111@git.zhonganinfo.com/zaxk/xk-sisyphus-web.git
36
+ ```
37
+
38
+ ### 2. 同步提交 (3to4 方向)
39
+
40
+ ```bash
41
+ # 1. Fetch v3 分支
42
+ git fetch source dev_3.0.0
43
+
44
+ # 2. 查看提交内容
45
+ git show <commit-hash> --stat
46
+
47
+ # 3. Cherry-pick
48
+ git cherry-pick <commit-hash>
49
+ ```
50
+
51
+ ### 3. 同步提交 (4to3 方向)
52
+
53
+ ```bash
54
+ # 1. 切换到 v3 仓库目录或使用 worktree
55
+ # 2. Fetch v4 分支
56
+ git fetch origin dev_4
57
+
58
+ # 3. Cherry-pick
59
+ git cherry-pick <commit-hash>
60
+ ```
61
+
62
+ ## 冲突处理
63
+
64
+ ### moment vs dayjs
65
+
66
+ v3 使用 `moment`,v4 使用 `dayjs`(antd 6 标准)。
67
+
68
+ 解决冲突时:
69
+ - **3to4**: 将 `moment` 替换为 `dayjs`
70
+ - **4to3**: 将 `dayjs` 替换为 `moment`
71
+
72
+ ```typescript
73
+ // v3 (moment)
74
+ import moment from 'moment';
75
+ const date = moment(value);
76
+
77
+ // v4 (dayjs)
78
+ import dayjs from 'dayjs';
79
+ const date = dayjs(value);
80
+ ```
81
+
82
+ ### antd API 差异
83
+
84
+ | 功能 | v3 (antd 5) | v4 (antd 6) |
85
+ |------|-------------|-------------|
86
+ | 日期库 | moment | dayjs |
87
+ | CSS | Less 引入 | CSS-in-JS |
88
+ | 类型 | Moment | Dayjs |
89
+
90
+ ## 完成后
91
+
92
+ 1. 解决所有冲突
93
+ 2. 运行 `git add .`
94
+ 3. 运行 `git cherry-pick --continue`
95
+ 4. 验证测试通过:`yarn test`
96
+
97
+ ## 示例
98
+
99
+ ```
100
+ # 从 v3 同步提交到 v4
101
+ sync-commits 91c2d08fb5a5ad5e15bbdee252756f16e592b610 3to4
102
+
103
+ # 从 v4 同步提交到 v3
104
+ sync-commits abc123def456 4to3
105
+ ```