@kaitranntt/ccs 7.48.0 → 7.48.1

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
@@ -241,6 +241,16 @@ ccs update --force # Force reinstall
241
241
  ccs update --beta # Install dev channel
242
242
  ```
243
243
 
244
+ ### CI Parity Gate (for contributors)
245
+
246
+ Before opening or updating a PR, run:
247
+
248
+ ```bash
249
+ bun run validate:ci-parity
250
+ ```
251
+
252
+ This mirrors CI behavior (build + validate + base-branch freshness check) and is also enforced by the local `pre-push` hook.
253
+
244
254
  ### Sync Shared Items
245
255
 
246
256
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaitranntt/ccs",
3
- "version": "7.48.0",
3
+ "version": "7.48.1",
4
4
  "description": "Claude Code Switch - Instant profile switching between Claude Sonnet 4.5 and GLM 4.6",
5
5
  "keywords": [
6
6
  "cli",
@@ -43,7 +43,7 @@
43
43
  "node": ">=18.0.0",
44
44
  "bun": ">=1.0.0"
45
45
  },
46
- "packageManager": "bun@1.2.21",
46
+ "packageManager": "bun@1.3.9",
47
47
  "os": [
48
48
  "darwin",
49
49
  "linux",
@@ -66,6 +66,7 @@
66
66
  "format": "prettier --write src/",
67
67
  "format:check": "prettier --check src/",
68
68
  "validate": "bun run typecheck && bun run lint:fix && bun run format:check && bun run maintainability:check && bun run test:all",
69
+ "validate:ci-parity": "bash scripts/ci-parity-gate.sh",
69
70
  "verify:bundle": "node scripts/verify-bundle.js",
70
71
  "maintainability:baseline": "node scripts/maintainability-baseline.js --out docs/metrics/maintainability-baseline.json",
71
72
  "maintainability:check": "node scripts/maintainability-baseline.js --check docs/metrics/maintainability-baseline.json",
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
5
+ cd "$ROOT_DIR"
6
+
7
+ if [[ "${CCS_SKIP_PREPUSH_GATE:-}" == "1" ]]; then
8
+ echo "[i] Skipping pre-push CI parity gate (CCS_SKIP_PREPUSH_GATE=1)."
9
+ exit 0
10
+ fi
11
+
12
+ if [[ ! -f AGENTS.md ]]; then
13
+ echo "[X] Missing AGENTS.md in this worktree."
14
+ echo " Ensure you are in a valid CCS repository/worktree before pushing."
15
+ exit 1
16
+ fi
17
+
18
+ CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
19
+ if [[ -z "$CURRENT_BRANCH" || "$CURRENT_BRANCH" == "HEAD" ]]; then
20
+ echo "[i] Detached HEAD detected. Skipping pre-push CI parity gate."
21
+ exit 0
22
+ fi
23
+
24
+ BASE_BRANCH="${CCS_PR_BASE:-}"
25
+ if [[ -z "$BASE_BRANCH" ]]; then
26
+ if [[ "$CURRENT_BRANCH" == "main" || "$CURRENT_BRANCH" =~ ^hotfix/ || "$CURRENT_BRANCH" =~ ^kai/hotfix- ]]; then
27
+ BASE_BRANCH="main"
28
+ else
29
+ BASE_BRANCH="dev"
30
+ fi
31
+ fi
32
+
33
+ echo "[i] Pre-push CI parity gate"
34
+ echo " branch: $CURRENT_BRANCH"
35
+ echo " base: $BASE_BRANCH"
36
+
37
+ git fetch origin "$BASE_BRANCH" --quiet || true
38
+ if git show-ref --verify --quiet "refs/remotes/origin/$BASE_BRANCH"; then
39
+ if ! git merge-base --is-ancestor "origin/$BASE_BRANCH" HEAD; then
40
+ echo "[X] Branch '$CURRENT_BRANCH' is behind origin/$BASE_BRANCH."
41
+ echo " Rebase or merge before pushing:"
42
+ echo " git pull --rebase origin $BASE_BRANCH"
43
+ exit 1
44
+ fi
45
+ fi
46
+
47
+ echo "[i] Running CI-equivalent local checks..."
48
+ bun run build:all
49
+ bun run validate
50
+
51
+ echo "[OK] CI parity gate passed."