From bcb40d4ebf2f124fc6a3490a2e8f302348b6ef36 Mon Sep 17 00:00:00 2001 From: Snider Date: Tue, 17 Mar 2026 09:04:27 +0000 Subject: [PATCH] fix(dx): add strict_types, composer scripts, and fix test discovery - Add declare(strict_types=1) to 17 PHP files missing it (13 Livewire modals, 1 route file, 1 migration, 1 test use case, TestCase) - Add composer test/lint scripts to composer.json for monorepo consistency - Fix phpunit.xml to discover tests in src/Search/Tests and src/Mod/Hub/Tests - Update CLAUDE.md commands section to document composer test/lint Co-Authored-By: Virgil --- CLAUDE.md | 13 +++++++------ composer.json | 4 ++++ phpunit.xml | 4 ++++ ...2026_01_11_000001_create_honeypot_hits_table.php | 2 ++ src/Mod/Hub/Tests/UseCase/DashboardBasic.php | 2 ++ src/Website/Hub/Routes/admin.php | 2 ++ src/Website/Hub/View/Modal/Admin/AIServices.php | 2 ++ src/Website/Hub/View/Modal/Admin/AccountUsage.php | 2 ++ src/Website/Hub/View/Modal/Admin/Analytics.php | 2 ++ src/Website/Hub/View/Modal/Admin/BoostPurchase.php | 2 ++ src/Website/Hub/View/Modal/Admin/Console.php | 2 ++ src/Website/Hub/View/Modal/Admin/Content.php | 2 ++ src/Website/Hub/View/Modal/Admin/ContentEditor.php | 2 ++ src/Website/Hub/View/Modal/Admin/ContentManager.php | 2 ++ src/Website/Hub/View/Modal/Admin/Platform.php | 2 ++ src/Website/Hub/View/Modal/Admin/PlatformUser.php | 2 ++ src/Website/Hub/View/Modal/Admin/Profile.php | 2 ++ src/Website/Hub/View/Modal/Admin/Settings.php | 2 ++ src/Website/Hub/View/Modal/Admin/UsageDashboard.php | 2 ++ tests/TestCase.php | 2 ++ 20 files changed, 49 insertions(+), 6 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 450b223..35c627e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -9,12 +9,13 @@ This is the **Core Admin Package** (`lthn/php-admin`) - an admin panel and servi ## Commands ```bash -php artisan serve # Laravel dev server -npm run dev # Vite dev server (Tailwind v4) -npm run build # Production asset build -./vendor/bin/pint --dirty # Format changed files only -./vendor/bin/pest # Run all tests -./vendor/bin/pest --filter=SearchTest # Run specific test +composer test # Run all tests (Pest) +composer test -- --filter=SearchTest # Run specific test +composer lint # Fix code style (Pint) +./vendor/bin/pint --dirty # Format changed files only +php artisan serve # Laravel dev server +npm run dev # Vite dev server (Tailwind v4) +npm run build # Production asset build ``` CI matrix: PHP 8.2, 8.3, 8.4. diff --git a/composer.json b/composer.json index c8d46ee..7062f18 100644 --- a/composer.json +++ b/composer.json @@ -26,6 +26,10 @@ ] } }, + "scripts": { + "test": "vendor/bin/pest", + "lint": "vendor/bin/pint" + }, "minimum-stability": "stable", "prefer-stable": true, "replace": { diff --git a/phpunit.xml b/phpunit.xml index 61c031c..28b553c 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -11,6 +11,10 @@ tests/Feature + + src/Search/Tests + src/Mod/Hub/Tests + diff --git a/src/Mod/Hub/Migrations/2026_01_11_000001_create_honeypot_hits_table.php b/src/Mod/Hub/Migrations/2026_01_11_000001_create_honeypot_hits_table.php index 75b5bce..967dcae 100644 --- a/src/Mod/Hub/Migrations/2026_01_11_000001_create_honeypot_hits_table.php +++ b/src/Mod/Hub/Migrations/2026_01_11_000001_create_honeypot_hits_table.php @@ -1,5 +1,7 @@