From a1ecc47b4d1dc4deb0795cc14070b09e4fc60fd7 Mon Sep 17 00:00:00 2001 From: Aaron Francis Date: Wed, 26 Nov 2025 22:06:15 -0600 Subject: [PATCH 1/8] Update CI and tooling to current best practices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add PHP 8.4 to test matrix - Remove unused MySQL service from tests workflow - Add laravel/pint as dev dependency - Update style workflow to use local pint instead of global install - Rename test suite from placeholder "TBD" to "Airdrop" - Remove legacy test script (referenced Laravel 7/8) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .github/workflows/style.yml | 8 ++++---- .github/workflows/tests.yml | 15 +-------------- composer.json | 3 ++- phpunit.xml.dist | 2 +- test | 21 --------------------- 5 files changed, 8 insertions(+), 41 deletions(-) delete mode 100755 test diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 02422c0..59d30ad 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fb465a3..9d757ca 100755 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 ] @@ -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 diff --git a/composer.json b/composer.json index 75fd76f..a8f0739 100644 --- a/composer.json +++ b/composer.json @@ -16,8 +16,9 @@ "illuminate/console": "^10.0|^11.0|^12.0" }, "require-dev": { - "orchestra/testbench": "^8.0|^9.0|^10.0", + "laravel/pint": "^1.0", "mockery/mockery": "^1.3.3", + "orchestra/testbench": "^8.0|^9.0|^10.0", "phpunit/phpunit": "^8.4|^9.5|^10.5|^11.5.3" }, "autoload": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index a218fca..3880384 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,7 +1,7 @@ - + tests tests/BaseTest.php diff --git a/test b/test deleted file mode 100755 index a122dcf..0000000 --- a/test +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -declare -a laravel=("7.*" "8.*") -declare -a testbench=("5.*" "6.*") - -for i in "${!laravel[@]}" -do - echo "${laravel[i]}" - echo "${testbench[i]}" - - composer remove --quiet illuminate/support orchestra/testbench - composer require --no-update --no-interaction --quiet "illuminate/support:${laravel[i]}" "orchestra/testbench:${testbench[i]}" - composer update --prefer-dist --no-interaction --quiet --prefer-lowest - ./vendor/bin/phpunit -done - - -## composer remove --quiet illuminate/support orchestra/testbench \ -## && composer require --no-update --no-interaction --quiet "illuminate/support:7" "orchestra/testbench:5" \ -## && composer update --prefer-lowest --prefer-dist --no-interaction \ -## && ./vendor/bin/phpunit \ No newline at end of file From acaabf611a00dafcacc6fa6d741c63c478ffc0fa Mon Sep 17 00:00:00 2001 From: Aaron Francis Date: Wed, 26 Nov 2025 22:07:14 -0600 Subject: [PATCH 2/8] Ignore --- .claude/settings.local.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .claude/settings.local.json diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..c849eac --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,15 @@ +{ + "permissions": { + "allow": [ + "Bash(cat:*)", + "Bash(composer update:*)", + "Bash(vendor/bin/phpunit:*)", + "Bash(vendor/bin/pint:*)", + "Bash(git checkout:*)", + "Bash(git add:*)", + "Bash(git commit:*)" + ], + "deny": [], + "ask": [] + } +} From cc99f6a5c96168ea7b1359805a218d0fc182a542 Mon Sep 17 00:00:00 2001 From: Aaron Francis Date: Wed, 26 Nov 2025 22:10:49 -0600 Subject: [PATCH 3/8] Fix dev dependency versions for PHPUnit 10+ compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update orchestra/testbench minimum to ^8.21 (fixes $latestResponse property issue) - Update phpunit/phpunit to ^10.5|^11.0 (drop legacy PHPUnit 8/9 support) - Update mockery/mockery minimum to ^1.6 The older testbench versions (8.0-8.20) don't have the $latestResponse static property that PHPUnit 10 expects, causing test failures on prefer-lowest builds. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index a8f0739..82e78e2 100644 --- a/composer.json +++ b/composer.json @@ -17,9 +17,9 @@ }, "require-dev": { "laravel/pint": "^1.0", - "mockery/mockery": "^1.3.3", - "orchestra/testbench": "^8.0|^9.0|^10.0", - "phpunit/phpunit": "^8.4|^9.5|^10.5|^11.5.3" + "mockery/mockery": "^1.6", + "orchestra/testbench": "^8.21|^9.0|^10.0", + "phpunit/phpunit": "^10.5|^11.0" }, "autoload": { "psr-4": { From 0ada31a6171510b59bc015ab41823274f94cb4e1 Mon Sep 17 00:00:00 2001 From: Aaron Francis Date: Wed, 26 Nov 2025 22:11:31 -0600 Subject: [PATCH 4/8] Ignore --- .claude/settings.local.json | 3 ++- .gitignore | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index c849eac..597c440 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -7,7 +7,8 @@ "Bash(vendor/bin/pint:*)", "Bash(git checkout:*)", "Bash(git add:*)", - "Bash(git commit:*)" + "Bash(git commit:*)", + "WebSearch" ], "deny": [], "ask": [] diff --git a/.gitignore b/.gitignore index ce08912..f9b02e2 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ bootstrap/cache/services.php docs/*.blade.php docs/**/*.blade.php .phpunit.cache/test-results +.claude/settings.local.json From 2de21f1b3260443398aae0433a4ac80cb84bcda9 Mon Sep 17 00:00:00 2001 From: Aaron Francis Date: Wed, 26 Nov 2025 22:12:11 -0600 Subject: [PATCH 5/8] Ignore .claude/ directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f9b02e2..d43edb1 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,4 @@ bootstrap/cache/services.php docs/*.blade.php docs/**/*.blade.php .phpunit.cache/test-results -.claude/settings.local.json +.claude/ From e13c57443836a40f9327647c5c0194e3387ca004 Mon Sep 17 00:00:00 2001 From: Aaron Francis Date: Wed, 26 Nov 2025 22:15:40 -0600 Subject: [PATCH 6/8] Bump testbench 9.x minimum to ^9.2 for latestResponse fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Version 9.1.4 made the $latestResponse static property optional, which is required for PHPUnit 10 compatibility on prefer-lowest builds. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 82e78e2..6682e73 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "require-dev": { "laravel/pint": "^1.0", "mockery/mockery": "^1.6", - "orchestra/testbench": "^8.21|^9.0|^10.0", + "orchestra/testbench": "^8.21|^9.2|^10.0", "phpunit/phpunit": "^10.5|^11.0" }, "autoload": { From 20845f0f46178bd03d5dcc06320c0f279df977aa Mon Sep 17 00:00:00 2001 From: Aaron Francis Date: Wed, 26 Nov 2025 22:17:07 -0600 Subject: [PATCH 7/8] Remove .claude/settings.local.json from tracking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit File was already in git before being added to .gitignore. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .claude/settings.local.json | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 .claude/settings.local.json diff --git a/.claude/settings.local.json b/.claude/settings.local.json deleted file mode 100644 index 597c440..0000000 --- a/.claude/settings.local.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "permissions": { - "allow": [ - "Bash(cat:*)", - "Bash(composer update:*)", - "Bash(vendor/bin/phpunit:*)", - "Bash(vendor/bin/pint:*)", - "Bash(git checkout:*)", - "Bash(git add:*)", - "Bash(git commit:*)", - "WebSearch" - ], - "deny": [], - "ask": [] - } -} From 0028f189883db09e2cfe2d2aa40f566e460bde5c Mon Sep 17 00:00:00 2001 From: Aaron Francis Date: Wed, 26 Nov 2025 22:17:54 -0600 Subject: [PATCH 8/8] Add CLAUDE.md for Claude Code guidance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- CLAUDE.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..7f3bd32 --- /dev/null +++ b/CLAUDE.md @@ -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