diff --git a/.claude/hooks/enforce-bun.sh b/.claude/hooks/enforce-bun.sh new file mode 100755 index 0000000000..802984b762 --- /dev/null +++ b/.claude/hooks/enforce-bun.sh @@ -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 diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000000..be2941c10f --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,15 @@ +{ + "hooks": { + "PreToolUse": [ + { + "matcher": "Bash", + "hooks": [ + { + "type": "command", + "command": ".claude/hooks/enforce-bun.sh" + } + ] + } + ] + } +} diff --git a/.gitignore b/.gitignore index 6e5f8cc59c..b47878efd4 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,6 @@ apps/web/src/components/__screenshots__ .vitest-* __screenshots__/ .tanstack +*.local.* +**/coverage/ +.playwright-mcp/