Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .claude/hooks/enforce-bun.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
# PreToolUse hook: Block npm, npx, yarn, and pnpm commands — this project uses bun exclusively.

INPUT=$(cat)
COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty')

if [ -z "$COMMAND" ]; then
exit 0
fi

# Check for npm commands (including npx)
if echo "$COMMAND" | grep -qE '(^|[;&|][[:space:]]*)npm([[:space:]]|$)'; then
echo "This project uses bun, not npm. Use the equivalent bun command instead." >&2
exit 2
fi

if echo "$COMMAND" | grep -qE '(^|[;&|][[:space:]]*)npx([[:space:]]|$)'; then
echo "This project uses bun, not npx. Use 'bunx' instead of 'npx'." >&2
exit 2
fi

# Check for yarn commands
if echo "$COMMAND" | grep -qE '(^|[;&|][[:space:]]*)yarn([[:space:]]|$)'; then
echo "This project uses bun, not yarn. Use the equivalent bun command instead." >&2
exit 2
fi

# Check for pnpm commands
if echo "$COMMAND" | grep -qE '(^|[;&|][[:space:]]*)pnpm([[:space:]]|$)'; then
echo "This project uses bun, not pnpm. Use the equivalent bun command instead." >&2
exit 2
fi

exit 0
15 changes: 15 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": ".claude/hooks/enforce-bun.sh"
}
]
}
]
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ apps/web/src/components/__screenshots__
.vitest-*
__screenshots__/
.tanstack
*.local.*
**/coverage/
.playwright-mcp/
Loading