merge: integrate origin/main (v0.4.3-v0.5.0) into team-supabase-store

Resolves conflict in scripts/gen-skill-docs.ts (keep both setup-team-sync
and new design/document-release skill templates).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-03-17 08:29:30 -07:00
40 changed files with 4948 additions and 139 deletions

View File

@@ -20,6 +20,11 @@ SNOOZE_FILE="$STATE_DIR/update-snoozed"
VERSION_FILE="$GSTACK_DIR/VERSION"
REMOTE_URL="${GSTACK_REMOTE_URL:-https://raw.githubusercontent.com/garrytan/gstack/main/VERSION}"
# ─── Force flag (busts cache for standalone /gstack-upgrade) ──
if [ "${1:-}" = "--force" ]; then
rm -f "$CACHE_FILE"
fi
# ─── Step 0: Check if updates are disabled ────────────────────
_UC=$("$GSTACK_DIR/bin/gstack-config" get update_check 2>/dev/null || true)
if [ "$_UC" = "false" ]; then
@@ -97,24 +102,27 @@ if [ -f "$MARKER_FILE" ]; then
exit 0
fi
# ─── Step 3: Check cache freshness (12h = 720 min) ──────────
# ─── Step 3: Check cache freshness ──────────────────────────
# UP_TO_DATE: 60 min TTL (detect new releases quickly)
# UPGRADE_AVAILABLE: 720 min TTL (keep nagging)
if [ -f "$CACHE_FILE" ]; then
# Cache is fresh if modified within 720 minutes
STALE=$(find "$CACHE_FILE" -mmin +720 2>/dev/null || true)
if [ -z "$STALE" ]; then
# Cache is fresh — read it
CACHED="$(cat "$CACHE_FILE" 2>/dev/null || true)"
CACHED="$(cat "$CACHE_FILE" 2>/dev/null || true)"
case "$CACHED" in
UP_TO_DATE*) CACHE_TTL=60 ;;
UPGRADE_AVAILABLE*) CACHE_TTL=720 ;;
*) CACHE_TTL=0 ;; # corrupt → force re-fetch
esac
STALE=$(find "$CACHE_FILE" -mmin +$CACHE_TTL 2>/dev/null || true)
if [ -z "$STALE" ] && [ "$CACHE_TTL" -gt 0 ]; then
case "$CACHED" in
UP_TO_DATE*)
# Verify local version still matches cached version
CACHED_VER="$(echo "$CACHED" | awk '{print $2}')"
if [ "$CACHED_VER" = "$LOCAL" ]; then
exit 0
fi
# Local version changed — fall through to re-check
;;
UPGRADE_AVAILABLE*)
# Verify local version still matches cached old version
CACHED_OLD="$(echo "$CACHED" | awk '{print $2}')"
if [ "$CACHED_OLD" = "$LOCAL" ]; then
CACHED_NEW="$(echo "$CACHED" | awk '{print $3}')"
@@ -124,7 +132,6 @@ if [ -f "$CACHE_FILE" ]; then
echo "$CACHED"
exit 0
fi
# Local version changed (manual upgrade?) — fall through to re-check
;;
esac
fi