Skip to content
Merged
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
24 changes: 24 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh

echo "Running pre-commit hook..."

# Navigate to frontend directory
cd frontend || exit 1

# Check if bun is installed
if ! command -v bun &> /dev/null; then
echo "Error: bun is not installed. Please install bun before committing."
exit 1
fi

# Run the build command
echo "Running bun build..."
if ! bun run build; then
echo ""
echo "Error: Build failed! Please fix the build errors before committing."
echo "Run 'cd frontend && bun run build' to see the errors."
exit 1
fi

echo "Build successful! Proceeding with commit..."
exit 0
53 changes: 49 additions & 4 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,64 @@ jobs:
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
contents: write
pull-requests: write
issues: write
id-token: write
actions: read
checks: write
statuses: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
fetch-depth: 0

- name: Setup git hooks
run: |
chmod +x ./setup-hooks.sh
./setup-hooks.sh

- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.2.2

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin,x86_64-apple-darwin,aarch64-apple-ios

- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: "frontend/src-tauri -> target"
cache-on-failure: true

- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev

- name: Install frontend dependencies
working-directory: ./frontend
run: bun install

- name: Install Tauri CLI
run: cargo install tauri-cli

- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@beta
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
allowed_tools: "Bash(bun install),Bash(bun run build),Bash(bun run lint),Bash(bun run format),Bash(bun run format:check),Bash(bun run dev),Bash(bun run preview),Bash(bun add),Bash(bun remove),Bash(bun update),Bash(bun test),Bash(cargo build),Bash(cargo test),Bash(cargo tauri build),Bash(bun tauri build),Bash(bun tauri dev),Bash(bun tauri ios build),Bash(bun tauri ios dev),Bash(bun tauri android build),Bash(bun tauri android dev),Bash(git status),Bash(git diff),Bash(git log),Bash(git branch),Bash(git checkout),Bash(git pull),Bash(git push),Bash(git add),Bash(git commit),Bash(git rebase),Bash(git merge),Bash(ls),Bash(cat),Bash(mkdir),Bash(rm),Bash(mv),Bash(cp),Bash(pwd),Bash(cd),Bash(echo),Bash(grep),Bash(find),Bash(sed),Bash(awk),Bash(curl),Bash(wget),Edit,Replace,NotebookEditCell"

9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ sudo apt install libwebkit2gtk-4.1-dev \
rustup target add aarch64-apple-darwin x86_64-apple-darwin
```

## Setup

1. Clone the repository and run the setup script:
```bash
./setup-hooks.sh
Comment on lines +49 to +51
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Missing step to clone the repository before running setup-hooks.sh

Suggested change
1. Clone the repository and run the setup script:
```bash
./setup-hooks.sh
1. Clone the repository and run the setup script:
```bash
git clone <repository-url>
cd <repository-name>
./setup-hooks.sh

```

This will configure git to use the project's pre-commit hooks, which run `bun run build` before each commit.

## Development

1. Install dependencies:
Expand Down
17 changes: 17 additions & 0 deletions setup-hooks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

echo "Setting up git hooks..."

# Get the root directory of the git repository
GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)

if [ -z "$GIT_ROOT" ]; then
echo "Error: Not in a git repository"
exit 1
fi

# Set git to use our hooks directory
git config core.hooksPath .githooks
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Using a relative path (.githooks) could fail if script is run from a subdirectory. Use $GIT_ROOT/.githooks for reliability.

Suggested change
git config core.hooksPath .githooks
git config core.hooksPath "$GIT_ROOT/.githooks"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Check if .githooks directory exists before configuring it


echo "✅ Git hooks configured successfully!"
echo "The pre-commit hook will now run 'bun run build' before each commit."
Loading