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
8 changes: 4 additions & 4 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
php-version: "8.4"
extensions: json, dom, curl, libxml, mbstring
coverage: none

- name: Install Pint
run: composer global require laravel/pint
- name: Install dependencies
run: composer install --no-interaction --prefer-dist

- name: Run Pint
run: pint
run: vendor/bin/pint

- name: Commit linted files
uses: stefanzweifel/git-auto-commit-action@v5
Expand Down
15 changes: 1 addition & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ 8.1, 8.2, 8.3 ]
php: [ 8.1, 8.2, 8.3, 8.4 ]
laravel: [ '10.*', '11.*', '12.*' ]
dependency-version: [ prefer-lowest, prefer-stable ]

Expand All @@ -29,19 +29,6 @@ jobs:

name: P${{ matrix.php }} / L${{ matrix.laravel }} / ${{ matrix.dependency-version }}

services:
mysql:
image: mysql:8.0
env:
MYSQL_DATABASE: fast_paginate
MYSQL_HOST: 127.0.0.1
MYSQL_USER: test
MYSQL_PASSWORD: root
MYSQL_ROOT_PASSWORD: root
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ bootstrap/cache/services.php
docs/*.blade.php
docs/**/*.blade.php
.phpunit.cache/test-results
.claude/
50 changes: 50 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

Airdrop is a Laravel package that speeds up deployments by skipping asset compilation when possible. It calculates a hash of build inputs (packages, JS/CSS files, ENV vars, etc.) and reuses previously built assets if the configuration hasn't changed.

Full docs: https://hammerstone.dev/airdrop/docs

## Commands

```bash
# Run tests
vendor/bin/phpunit

# Run a single test
vendor/bin/phpunit --filter test_name

# Code formatting
vendor/bin/pint

# Check formatting without changes
vendor/bin/pint --test
```

## Architecture

**Drivers** (`src/Drivers/`) - Handle storage/retrieval of built assets:
- `BaseDriver` - Abstract base with `download()` and `upload()` methods
- `FilesystemDriver` - Uses Laravel's filesystem (local, S3, etc.)
- `GithubActionsDriver` - Uses GitHub Actions cache

**Triggers** (`src/Triggers/`) - Determine what affects the build hash:
- Implement `TriggerContract::triggerBuildWhenChanged($config)`
- `FileTrigger` - Hashes file contents
- `ConfigTrigger` - Hashes config values

**Commands** (`src/Commands/`):
- `airdrop:download` - Pull cached assets if hash matches
- `airdrop:upload` - Store built assets with current hash
- `airdrop:hash` - Output current hash
- `airdrop:debug` - Debug trigger outputs
- `airdrop:install` - Publish config file

## Code Style

Uses Laravel Pint with the Laravel preset. Key customizations in `pint.json`:
- `concat_space`: one space around concatenation operator
- `trailing_comma_in_multiline`: false
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
"illuminate/console": "^10.0|^11.0|^12.0"
},
"require-dev": {
"orchestra/testbench": "^8.0|^9.0|^10.0",
"mockery/mockery": "^1.3.3",
"phpunit/phpunit": "^8.4|^9.5|^10.5|^11.5.3"
"laravel/pint": "^1.0",
"mockery/mockery": "^1.6",
"orchestra/testbench": "^8.21|^9.2|^10.0",
"phpunit/phpunit": "^10.5|^11.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="TBD Test Suite">
<testsuite name="Airdrop Test Suite">
<directory>tests</directory>
<exclude>tests/BaseTest.php</exclude>
</testsuite>
Expand Down
21 changes: 0 additions & 21 deletions test

This file was deleted.