@jetthai/cuora 1.1.427 → 1.1.428-dev.0

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.
@@ -4,7 +4,43 @@
4
4
 
5
5
  ---
6
6
 
7
- ## Step 1 — 檢查工作區狀態
7
+ ## Step 1 — 同步遠端分支
8
+
9
+ 檢查當前分支的遠端是否有更新:
10
+
11
+ ```bash
12
+ git fetch origin
13
+ git status
14
+ ```
15
+
16
+ 如果本地已經是最新(沒有 behind commits),直接進入 Step 2。
17
+
18
+ 如果遠端有更新(本地 behind),執行 pull:
19
+
20
+ ```bash
21
+ git pull
22
+ ```
23
+
24
+ 如果 pull 發生衝突:
25
+
26
+ 1. 取消 merge:
27
+ ```bash
28
+ git merge --abort
29
+ ```
30
+ 2. 告知使用者:「遠端有更新且與本地變更衝突,請先還原當前所有檔案的異動,還原完成後請回覆。」
31
+ 3. 等待使用者回覆。
32
+ 4. 使用者回覆後,重新執行 pull:
33
+ ```bash
34
+ git pull
35
+ ```
36
+ 5. Pull 成功後,告知使用者:「遠端同步完成,請將剛才還原的異動重新加回,完成後請回覆。」
37
+ 6. 等待使用者回覆確認已全部加回,再繼續後續流程。
38
+
39
+ 出現錯誤則停止,詢問使用者要怎麼做。
40
+
41
+ ---
42
+
43
+ ## Step 2 — 檢查工作區狀態
8
44
 
9
45
  ```bash
10
46
  git status
@@ -18,7 +54,7 @@ git status
18
54
 
19
55
  ---
20
56
 
21
- ## Step 2 — Stage 變更
57
+ ## Step 3 — Stage 變更
22
58
 
23
59
  將所有變更加入 staging area:
24
60
 
@@ -30,7 +66,7 @@ git add -A
30
66
 
31
67
  ---
32
68
 
33
- ## Step 3 — 選擇 Commit Message 方式
69
+ ## Step 4 — 選擇 Commit Message 方式
34
70
 
35
71
  使用 `AskUserQuestion` 工具顯示選單,讓使用者從以下選項中選擇:
36
72
 
@@ -44,7 +80,7 @@ git add -A
44
80
 
45
81
  ---
46
82
 
47
- ## Step 4 — 生成 Commit Message
83
+ ## Step 5 — 生成 Commit Message
48
84
 
49
85
  根據使用者在 Step 3 的選擇執行:
50
86
 
@@ -55,7 +91,27 @@ git add -A
55
91
  - 格式:`type(scope): description`
56
92
  - type:feat / fix / refactor / style / docs / chore / perf / test
57
93
  - scope:根據變更的主要目錄或功能模組決定(可省略)
58
- - description:簡潔描述變更內容(英文)
94
+ - description:簡潔描述變更內容(中文)
95
+
96
+ 當變更涉及多個不同類型或模組時,自行分類並以條列式呈現:
97
+
98
+ ```
99
+ type(scope): 主要描述
100
+
101
+ - type(scope): 細項描述 1
102
+ - type(scope): 細項描述 2
103
+ - type(scope): 細項描述 3
104
+ ```
105
+
106
+ 例如:
107
+
108
+ ```
109
+ feat(payment): 新增加密貨幣存款功能
110
+
111
+ - feat(deposit): 新增 USDT 存款方式
112
+ - fix(withdraw): 修正提款金額驗證邏輯
113
+ - style(modal): 調整存款彈窗樣式
114
+ ```
59
115
 
60
116
  如果是選項 2,將生成的 message 顯示給使用者,等待使用者確認或提供修改後的版本。
61
117
 
@@ -71,7 +127,7 @@ git add -A
71
127
 
72
128
  ---
73
129
 
74
- ## Step 5 — 執行 Commit
130
+ ## Step 6 — 執行 Commit
75
131
 
76
132
  使用確定的 commit message 執行 commit:
77
133
 
@@ -89,20 +145,20 @@ git commit -m "<title>" -m "<body>"
89
145
 
90
146
  ---
91
147
 
92
- ## Step 6 — 確認是否 Push
148
+ ## Step 7 — 確認是否 Push
93
149
 
94
150
  使用 `AskUserQuestion` 工具顯示選單,讓使用者從以下選項中選擇:
95
151
 
96
152
  - **Push** — 立即 push 到遠端
97
- - **不 Push** — 只 commit,不 push
153
+ - **Skip** — 跳過 push,僅完成 commit
98
154
 
99
155
  等待使用者選擇。
100
156
 
101
- 如果使用者選擇「不 Push」,跳過 push 直接進入 Step 8 完成回報。
102
-
103
157
  ---
104
158
 
105
- ## Step 7 — 執行 Push
159
+ ## Step 8 — 執行 Push(如使用者選擇 Push)
160
+
161
+ 如果使用者選擇 Skip,跳過此步驟直接到 Step 9。
106
162
 
107
163
  將 commit push 到遠端:
108
164
 
@@ -120,10 +176,10 @@ git push --set-upstream origin <current_branch>
120
176
 
121
177
  ---
122
178
 
123
- ## Step 8 — 完成回報
179
+ ## Step 9 — 完成回報
124
180
 
125
181
  顯示以下資訊:
126
182
 
127
183
  - 分支名稱
128
184
  - Commit message 內容
129
- - Push 結果(成功/失敗)
185
+ - Push 結果(成功/失敗/已跳過)
@@ -17,7 +17,9 @@
17
17
  "mcp__sentry__get_issue_details",
18
18
  "mcp__sentry__search_issues",
19
19
  "Bash(git add:*)",
20
- "Bash(git commit:*)"
20
+ "Bash(git commit:*)",
21
+ "Bash(git branch:*)",
22
+ "Bash(git merge:*)"
21
23
  ]
22
24
  }
23
25
  }
@@ -1,25 +1,29 @@
1
- # post-checkout receives: prev_HEAD new_HEAD checkout_type
2
- # checkout_type: 1 = branch checkout, 0 = file checkout
1
+ # post-checkout hook 接收參數:prev_HEAD new_HEAD checkout_type
2
+ # checkout_type:1 = 切換分支,0 = 切換檔案
3
3
  CHECKOUT_TYPE=$3
4
4
 
5
- # Only run on branch checkout, skip file checkout
5
+ # 僅在切換分支時執行,切換檔案時跳過
6
6
  [ "$CHECKOUT_TYPE" != "1" ] && exit 0
7
7
 
8
+ # 取得切換後的當前分支名稱
8
9
  CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
9
10
 
10
- TARGET_BRANCHES="dev qa"
11
+ # 僅針對 dev、qa、master 這三個目標分支執行自動拉取
12
+ TARGET_BRANCHES="dev qa master"
11
13
  match=0
12
14
  for branch in $TARGET_BRANCHES; do
13
15
  [ "$CURRENT_BRANCH" = "$branch" ] && match=1 && break
14
16
  done
15
17
 
16
18
  if [ "$match" = "1" ]; then
19
+ # 檢查本地是否有尚未推送的 commit,有的話跳過自動拉取(避免覆蓋本地變更)
17
20
  LOCAL_AHEAD=$(git rev-list --count origin/"$CURRENT_BRANCH"..HEAD 2>/dev/null || echo 0)
18
21
  if [ "$LOCAL_AHEAD" -gt 0 ]; then
19
22
  echo "You have $LOCAL_AHEAD unpushed commit(s) on '$CURRENT_BRANCH'. Skipping auto-pull."
20
23
  exit 0
21
24
  fi
22
25
 
26
+ # 自動從遠端拉取最新程式碼(使用 rebase 保持線性歷史)
23
27
  echo "Auto pulling '$CURRENT_BRANCH' from remote..."
24
28
  git pull --rebase origin "$CURRENT_BRANCH" || {
25
29
  echo "Failed to pull '$CURRENT_BRANCH'. Please resolve manually."
package/.husky/pre-commit CHANGED
@@ -1,4 +1,2 @@
1
- #!/usr/bin/env sh
2
- . "$(dirname -- "$0")/_/husky.sh"
3
-
1
+ # 提交前自動格式化程式碼(Prettier),並將格式化後的變更加入暫存區
4
2
  npm run format && git add .
package/.husky/pre-push CHANGED
@@ -1,5 +1,27 @@
1
- #!/usr/bin/env sh
2
- . "$(dirname -- "$0")/_/husky.sh"
1
+ # 從 stdin 偵測是否為 force push(非 fast-forward)
2
+ # pre-push hook 會收到:<local_ref> <local_sha> <remote_ref> <remote_sha>
3
+ IS_FORCE=false
4
+ while read local_ref local_sha remote_ref remote_sha; do
5
+ # 跳過新建分支或刪除分支的情況(sha 全為 0)
6
+ [ "$remote_sha" = "0000000000000000000000000000000000000000" ] && continue
7
+ [ "$local_sha" = "0000000000000000000000000000000000000000" ] && continue
8
+ # 若遠端 sha 不是本地 sha 的祖先,代表是 force push
9
+ if ! git merge-base --is-ancestor "$remote_sha" "$local_sha" 2>/dev/null; then
10
+ IS_FORCE=true
11
+ break
12
+ fi
13
+ done
3
14
 
15
+ # 取得當前分支名稱
16
+ BRANCH=$(git rev-parse --abbrev-ref HEAD)
17
+
18
+ # 在 dev/qa 分支的 force push 跳過所有 pre-push hook(避免干擾強制推送)
19
+ if [ "$IS_FORCE" = true ] && { [ "$BRANCH" = "dev" ] || [ "$BRANCH" = "qa" ]; }; then
20
+ echo "Force push detected on $BRANCH, skipping pre-push hooks."
21
+ exit 0
22
+ fi
23
+
24
+ # 清理不合規的 tag(本地 + 遠端)
4
25
  sh scripts/clean-tags.sh
26
+ # 自動升版並發布(僅 dev/qa 分支會實際執行,$1 為遠端名稱)
5
27
  sh scripts/auto-version.sh "$1"
package/.prettierignore CHANGED
@@ -1 +1,2 @@
1
- dist/
1
+ dist/
2
+ CHANGELOG.md
package/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.1.428-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.427...v1.1.428-dev.0) (2026-04-13)
6
+
7
+
8
+ ### Features
9
+
10
+ * **husky:** skip pre-push hooks on force push to dev/qa ([79e9df9](https://github.com/jetthai/cuora-module/commit/79e9df9bfd9335dca7d5aec590fa25d7580586ac))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **deposit:** 修正 crypto_way_cash 計算失敗狀態及提交金額驗證 ([726c449](https://github.com/jetthai/cuora-module/commit/726c4493267b6ca502fc241385b251f6caaf84b5))
16
+ * **deposit:** 強化 crypto_way_cash isSubmittable guard 的金額驗證 ([9361a5c](https://github.com/jetthai/cuora-module/commit/9361a5cc37bb0d7d65144b875baecced7f7e0f9f))
17
+ * **deposit:** 防止 crypto_way_cash 金額輸入 NaN 及負數 ([608da8a](https://github.com/jetthai/cuora-module/commit/608da8a35dc111ee3e7e9fccea94a366d1b99599))
18
+
19
+ ### [1.1.427-dev.5](https://github.com/jetthai/cuora-module/compare/v1.1.427...v1.1.427-dev.5) (2026-04-12)
20
+
21
+ ### [1.1.427-dev.4](https://github.com/jetthai/cuora-module/compare/v1.1.427-dev.0...v1.1.427-dev.4) (2026-04-12)
22
+
23
+ ### [1.1.427-dev.0](https://github.com/jetthai/cuora-module/compare/v1.1.427...v1.1.427-dev.0) (2026-04-12)
24
+
5
25
  ### [1.1.427](https://github.com/jetthai/cuora-module/compare/v1.1.426...v1.1.427) (2026-04-07)
6
26
 
7
27
  ### [1.1.426](https://github.com/jetthai/cuora-module/compare/v1.1.425...v1.1.426) (2026-03-31)
@@ -20,7 +40,77 @@ All notable changes to this project will be documented in this file. See [standa
20
40
 
21
41
  ### [1.1.424](https://github.com/jetthai/cuora-module/compare/v1.1.423...v1.1.424) (2026-03-17)
22
42
 
23
- ### [1.1.423](https://github.com/jetthai/cuora-module/compare/v1.1.422...v1.1.423) (2026-03-17)
43
+ ### [1.1.422-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.422-dev-1...v1.1.422-dev-2) (2026-03-17)
44
+
45
+ ### [1.1.422-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.422...v1.1.422-dev-1) (2026-03-16)
46
+
47
+ ### [1.1.413-dev-11](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-10...v1.1.413-dev-11) (2026-03-12)
48
+
49
+ ### [1.1.413-dev-10](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-9...v1.1.413-dev-10) (2026-03-11)
50
+
51
+ ### [1.1.413-dev-9](https://github.com/jetthai/cuora-module/compare/v1.1.421...v1.1.413-dev-9) (2026-03-11)
52
+
53
+ ### [1.1.413-dev-8](https://github.com/jetthai/cuora-module/compare/v1.1.420...v1.1.413-dev-8) (2026-03-10)
54
+
55
+ ### [1.1.413-dev-7](https://github.com/jetthai/cuora-module/compare/v1.1.413-6...v1.1.413-dev-7) (2026-03-06)
56
+
57
+ ### [1.1.413-6](https://github.com/jetthai/cuora-module/compare/v1.1.416...v1.1.413-6) (2026-03-06)
58
+
59
+ ### [1.1.413-5](https://github.com/jetthai/cuora-module/compare/v1.1.413...v1.1.413-5) (2026-03-05)
60
+
61
+ ### [1.1.422-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.422-dev-1...v1.1.422-dev-2) (2026-03-17)
62
+
63
+ ### [1.1.422-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.422...v1.1.422-dev-1) (2026-03-16)
64
+
65
+ ### [1.1.413-dev-11](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-10...v1.1.413-dev-11) (2026-03-12)
66
+
67
+ ### [1.1.413-dev-10](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-9...v1.1.413-dev-10) (2026-03-11)
68
+
69
+ ### [1.1.413-dev-9](https://github.com/jetthai/cuora-module/compare/v1.1.421...v1.1.413-dev-9) (2026-03-11)
70
+
71
+ ### [1.1.413-dev-8](https://github.com/jetthai/cuora-module/compare/v1.1.420...v1.1.413-dev-8) (2026-03-10)
72
+
73
+ ### [1.1.413-dev-7](https://github.com/jetthai/cuora-module/compare/v1.1.413-6...v1.1.413-dev-7) (2026-03-06)
74
+
75
+ ### [1.1.413-6](https://github.com/jetthai/cuora-module/compare/v1.1.416...v1.1.413-6) (2026-03-06)
76
+
77
+ ### [1.1.413-5](https://github.com/jetthai/cuora-module/compare/v1.1.413...v1.1.413-5) (2026-03-05)
78
+
79
+ ### [1.1.422-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.422-dev-1...v1.1.422-dev-2) (2026-03-17)
80
+
81
+ ### [1.1.422-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.422...v1.1.422-dev-1) (2026-03-16)
82
+
83
+ ### [1.1.413-dev-11](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-10...v1.1.413-dev-11) (2026-03-12)
84
+
85
+ ### [1.1.413-dev-10](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-9...v1.1.413-dev-10) (2026-03-11)
86
+
87
+ ### [1.1.413-dev-9](https://github.com/jetthai/cuora-module/compare/v1.1.421...v1.1.413-dev-9) (2026-03-11)
88
+
89
+ ### [1.1.413-dev-8](https://github.com/jetthai/cuora-module/compare/v1.1.420...v1.1.413-dev-8) (2026-03-10)
90
+
91
+ ### [1.1.413-dev-7](https://github.com/jetthai/cuora-module/compare/v1.1.413-6...v1.1.413-dev-7) (2026-03-06)
92
+
93
+ ### [1.1.413-6](https://github.com/jetthai/cuora-module/compare/v1.1.416...v1.1.413-6) (2026-03-06)
94
+
95
+ ### [1.1.413-5](https://github.com/jetthai/cuora-module/compare/v1.1.413...v1.1.413-5) (2026-03-05)
96
+
97
+ ### [1.1.422-dev-2](https://github.com/jetthai/cuora-module/compare/v1.1.422-dev-1...v1.1.422-dev-2) (2026-03-17)
98
+
99
+ ### [1.1.422-dev-1](https://github.com/jetthai/cuora-module/compare/v1.1.422...v1.1.422-dev-1) (2026-03-16)
100
+
101
+ ### [1.1.413-dev-11](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-10...v1.1.413-dev-11) (2026-03-12)
102
+
103
+ ### [1.1.413-dev-10](https://github.com/jetthai/cuora-module/compare/v1.1.413-dev-9...v1.1.413-dev-10) (2026-03-11)
104
+
105
+ ### [1.1.413-dev-9](https://github.com/jetthai/cuora-module/compare/v1.1.421...v1.1.413-dev-9) (2026-03-11)
106
+
107
+ ### [1.1.413-dev-8](https://github.com/jetthai/cuora-module/compare/v1.1.420...v1.1.413-dev-8) (2026-03-10)
108
+
109
+ ### [1.1.413-dev-7](https://github.com/jetthai/cuora-module/compare/v1.1.413-6...v1.1.413-dev-7) (2026-03-06)
110
+
111
+ ### [1.1.413-6](https://github.com/jetthai/cuora-module/compare/v1.1.416...v1.1.413-6) (2026-03-06)
112
+
113
+ ### [1.1.413-5](https://github.com/jetthai/cuora-module/compare/v1.1.413...v1.1.413-5) (2026-03-05)
24
114
 
25
115
  ### [1.1.422](https://github.com/jetthai/cuora-module/compare/v1.1.421...v1.1.422) (2026-03-16)
26
116