@qijenchen/design-system 0.1.0-beta.57 → 0.1.0-beta.58

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.
@@ -51,7 +51,14 @@ fi
51
51
 
52
52
  CWD=$(pwd)
53
53
  URLS_FOUND=""
54
- BRANCH=$(echo "$CMD" | grep -oE 'origin\s+\S+' | awk '{print $2}' | head -1)
54
+ # 2026-06-07 ROOT fix:只從「git push ... origin <ref>」這一段擷取 branch,不是整條 compound command
55
+ # 第一個 `origin X`。否則 `git fetch origin --quiet && git push origin main` 會誤抓 fetch 段的 `--quiet`
56
+ # 當 branch → 推導 `--quiet--site` 404(此前 5 道 guard 都沒擋到,因 `--quiet` 全是合法 git ref 字元)。
57
+ # 隔出 push 段(到下個 command 分隔 ; & | 為止)後,取 origin 後第一個 token。
58
+ PUSH_SEG=$(echo "$CMD" | grep -oE '(^|[;&|(])[[:space:]]*git[[:space:]]+push[[:space:]][^;&|]*' | head -1)
59
+ BRANCH=$(echo "$PUSH_SEG" | grep -oE 'origin[[:space:]]+[^[:space:]]+' | head -1 | awk '{print $2}')
60
+ # origin 後第一個 token 是 flag(`git push origin --force` = 無顯式 branch)→ 清空走 current-branch fallback
61
+ case "$BRANCH" in -*) BRANCH="" ;; esac
55
62
  # 2026-06-06 fix:refspec `src:dst` → 取 dst(`HEAD:main` → `main`),否則推導出 `HEAD:main--site` 404 URL
56
63
  case "$BRANCH" in *:*) BRANCH="${BRANCH##*:}" ;; esac
57
64
  # 2026-06-06 fix:`git push origin HEAD`(或 `@`)= symbolic ref 指向當前 branch → 解析成真 branch 名,
@@ -41,6 +41,12 @@ head_leaked() { echo "$STDOUT" | grep -qE 'HEAD(--|:|\))'; }
41
41
  fn7() { echo "$STDOUT" | grep -q "feature-test" && ! head_leaked; }
42
42
  fn8() { ! head_leaked; }
43
43
  fn9() { echo "$STDOUT" | grep -q "feature-test"; }
44
+ has_feature() { echo "$STDOUT" | grep -q "feature-test"; }
45
+ no_quiet() { ! echo "$STDOUT" | grep -q -- "--quiet"; }
46
+ fn10() { has_feature && no_quiet; } # compound:fetch 段的 --quiet 不可被誤抓為 branch
47
+ fn11() { has_feature; } # compound:pull 段的 main 不可被誤抓(否則 grep feature-test 失敗)
48
+ fn12() { has_feature; } # bare push origin → fallback current branch
49
+ fn13() { has_feature; } # flag-after-origin → 清空 → fallback current branch
44
50
 
45
51
  check() { # <name> <expect: skip|fire> [extra-assert-fn]
46
52
  local name="$1" expect="$2" extra="${3:-}"
@@ -98,6 +104,23 @@ check "8 refspec HEAD:main → no HEAD leak" fire 'fn8'
98
104
  run_hook "git add -A && git push origin feature-test"
99
105
  check "9 real branch push (positive control) → fire" fire 'fn9'
100
106
 
107
+ # 10. ROOT regression:compound 命令前段 `git fetch origin --quiet` 的 flag 不可被誤抓為 branch
108
+ # (2026-06-07 anchor:merge 時 `git fetch origin --quiet && ... && git push origin main` 吐 `--quiet--site` 404)
109
+ run_hook "git fetch origin --quiet && git push origin feature-test"
110
+ check "10 compound w/ fetch flag → branch from push seg only (no --quiet leak)" fire 'fn10'
111
+
112
+ # 11. compound 前段 `git pull origin main` 的 main 不可被誤抓(branch 必來自 push 段)
113
+ run_hook "git pull origin main && git push origin feature-test"
114
+ check "11 compound w/ pull → branch from push seg (not pull's main)" fire 'fn11'
115
+
116
+ # 12. bare `git push origin`(無顯式 branch)→ fallback 當前 branch
117
+ run_hook "git push origin"
118
+ check "12 bare push origin → fallback current branch" fire 'fn12'
119
+
120
+ # 13. flag-after-origin `git push origin --force`(無顯式 branch)→ fallback 當前 branch
121
+ run_hook "git push origin --force"
122
+ check "13 flag-after-origin → fallback current branch (no flag-as-branch)" fire 'fn13'
123
+
101
124
  teardown
102
125
 
103
126
  echo ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qijenchen/design-system",
3
- "version": "0.1.0-beta.57",
3
+ "version": "0.1.0-beta.58",
4
4
  "private": false,
5
5
  "description": "World-class design system — components, patterns, tokens, hooks (single source of truth for team distribution).",
6
6
  "type": "module",