Skip to content

Commit a95dfff

Browse files
committed
Refactor project to implement Plausible Analytics MCP server with enhanced querying capabilities and improved configuration
1 parent 792bdf1 commit a95dfff

10 files changed

Lines changed: 469 additions & 149 deletions

File tree

.claude/hooks/postedit_ts.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
set -eo pipefail
3+
4+
# Read the hook JSON from stdin and extract the edited file path.
5+
payload="$(cat)"
6+
file_path="$(jq -r '.tool_input.file_path // .tool_response.filePath // empty' <<<"$payload")"
7+
8+
# Only act on TS files.
9+
case "$file_path" in
10+
*.ts)
11+
# Lint just the changed file (use auto-fix to correct issues).
12+
npm run lint:fix -- "$file_path" || {
13+
echo "ESLint failed for $file_path" >&2
14+
# Exit code 2 tells Claude to treat this as a blocking error and use stderr to fix it.
15+
exit 2
16+
}
17+
18+
# Project-wide typecheck (incremental cache makes repeated runs fast).
19+
npm run typecheck || {
20+
echo "TypeScript typecheck failed." >&2
21+
exit 2
22+
}
23+
;;
24+
esac
25+
26+
exit 0

.claude/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"hooks": [
77
{
88
"type": "command",
9-
"command": "cd \"$CLAUDE_PROJECT_DIR\" && npm run lint && npm run typecheck"
9+
"command": "$CLAUDE_PROJECT_DIR/.claude/hooks/postedit_ts.sh",
10+
"timeout": 120
1011
}
1112
]
1213
}

.husky/pre-commit

Lines changed: 0 additions & 1 deletion
This file was deleted.

CLAUDE.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)