mirror of
https://github.com/davila7/claude-code-templates.git
synced 2026-09-19 01:30:23 +08:00
41cbbea00c
- Split components.json: índice sin content (1.9 MB / 249 KB br vs 15.6 MB / 4.15 MB br).
Generador produce component-content/{type}/{slug}.json por componente y auto-copia
a dashboard/public/. Página de detalle carga contenido on-demand via fetchComponentContent().
- Restaurar cabeceras de caché y seguridad perdidas en la migración Vercel→Cloudflare:
_headers con Cache-Control max-age=86400 para JSONs, immutable para _astro/*,
y HSTS, X-Frame-Options, Referrer-Policy, Permissions-Policy en todas las rutas.
- Eliminar dashboard/vercel.json (config muerta desde migración a Cloudflare Pages).
- Diferir hidratación: ClerkIsland y AuthButton client:load → client:idle;
SaveToCollectionButton → client:visible.
- Eliminar gpt-tokenizer del bundle del navegador: reemplazado por estimación chars/4.
- Actualizar .claude/rules/dashboard.md para reflejar hosting en Cloudflare Pages.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 line
2.7 KiB
JSON
1 line
2.7 KiB
JSON
{"content": "{\n \"description\": \"Neon database context statusline showing project name, active branch, compute state, and autoscaling CU range. Uses only Neon REST API (no SQL connections needed). Helps avoid mistakes like running migrations on the wrong branch. Setup: Export NEON_API_KEY and NEON_PROJECT_ID as environment variables, or add them to your project's .env file. Get your API key from console.neon.tech and project ID from your Neon dashboard.\",\n \"statusLine\": {\n \"type\": \"command\",\n \"command\": \"bash -c 'input=$(cat); DIR=$(echo \\\"$input\\\" | jq -r \\\".workspace.current_dir\\\" 2>/dev/null || echo \\\".\\\"); if [ -f \\\"$DIR/.env\\\" ]; then while IFS= read -r line; do case \\\"$line\\\" in NEON_API_KEY=*) export NEON_API_KEY=\\\"${line#*=}\\\";; NEON_PROJECT_ID=*) export NEON_PROJECT_ID=\\\"${line#*=}\\\";; esac; done < \\\"$DIR/.env\\\"; fi; if [ -z \\\"$NEON_API_KEY\\\" ] || [ -z \\\"$NEON_PROJECT_ID\\\" ]; then echo \\\"🐘 Neon 🔧 config-needed | set NEON_API_KEY & NEON_PROJECT_ID\\\"; exit 0; fi; PROJECT=$(curl -s -m 3 -H \\\"Authorization: Bearer $NEON_API_KEY\\\" \\\"https://console.neon.tech/api/v2/projects/$NEON_PROJECT_ID\\\" 2>/dev/null); PROJECT_NAME=$(echo \\\"$PROJECT\\\" | jq -r \\\".project.name // \\\\\\\"unknown\\\\\\\"\\\" 2>/dev/null || echo \\\"unknown\\\"); BRANCHES=$(curl -s -m 3 -H \\\"Authorization: Bearer $NEON_API_KEY\\\" \\\"https://console.neon.tech/api/v2/projects/$NEON_PROJECT_ID/branches\\\" 2>/dev/null); BRANCH_NAME=$(echo \\\"$BRANCHES\\\" | jq -r \\\"[.branches[] | select(.default == true)][0].name // \\\\\\\"unknown\\\\\\\"\\\" 2>/dev/null || echo \\\"unknown\\\"); BRANCH_ID=$(echo \\\"$BRANCHES\\\" | jq -r \\\"[.branches[] | select(.default == true)][0].id // \\\\\\\"\\\\\\\"\\\" 2>/dev/null); ENDPOINTS=$(curl -s -m 3 -H \\\"Authorization: Bearer $NEON_API_KEY\\\" \\\"https://console.neon.tech/api/v2/projects/$NEON_PROJECT_ID/endpoints\\\" 2>/dev/null); EP=$(echo \\\"$ENDPOINTS\\\" | jq -r --arg bid \\\"$BRANCH_ID\\\" \\\"[.endpoints[] | select(.branch_id == \\\\$bid)][0] // .endpoints[0]\\\"); STATE=$(echo \\\"$EP\\\" | jq -r \\\".current_state // \\\\\\\"unknown\\\\\\\"\\\" 2>/dev/null || echo \\\"unknown\\\"); MIN_CU=$(echo \\\"$EP\\\" | jq -r \\\".autoscaling_limit_min_cu // \\\\\\\"?\\\\\\\"\\\" 2>/dev/null || echo \\\"?\\\"); MAX_CU=$(echo \\\"$EP\\\" | jq -r \\\".autoscaling_limit_max_cu // \\\\\\\"?\\\\\\\"\\\" 2>/dev/null || echo \\\"?\\\"); case \\\"$STATE\\\" in active) STATE_ICON=\\\"🟢\\\";; idle) STATE_ICON=\\\"🟡\\\";; suspended) STATE_ICON=\\\"🔴\\\";; *) STATE_ICON=\\\"❓\\\";; esac; echo \\\"🐘 Neon | 📁 $PROJECT_NAME | 🌿 $BRANCH_NAME | $STATE_ICON $STATE | ⚡ $MIN_CU-$MAX_CU CU\\\"'\"\n }\n}\n"} |