From fe6acebc24d7b70bc8ecca4feaf6a51592e8e5f4 Mon Sep 17 00:00:00 2001 From: Jordan Lavar Partridge Date: Sat, 22 Aug 2026 00:59:51 -0700 Subject: [PATCH 1/3] chore: allow Laravel 13 (illuminate ^13) Install-blocker on L13 apps. Spatie package-tools already allows contracts ^13. --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 884b6d4..0f57627 100644 --- a/composer.json +++ b/composer.json @@ -12,13 +12,13 @@ ], "require": { "php": "^8.2.0", - "illuminate/contracts": "^11.0", - "illuminate/database": "^11.0", - "illuminate/support": "^11.0" + "illuminate/contracts": "^11.0|^12.0|^13.0", + "illuminate/database": "^11.0|^12.0|^13.0", + "illuminate/support": "^11.0|^12.0|^13.0" }, "require-dev": { "pestphp/pest": "^3.0", - "orchestra/testbench": "^9.0", + "orchestra/testbench": "^9.0|^10.0|^11.0", "laravel/pint": "^1.18" }, "autoload": { From a6fb96aa535c9805c2b92c7e68656e6f14988ca5 Mon Sep 17 00:00:00 2001 From: Jordan Lavar Partridge Date: Sat, 22 Aug 2026 01:01:12 -0700 Subject: [PATCH 2/3] chore: allow pestphp/pest-plugin so L13 composer install can run --- composer.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/composer.json b/composer.json index 0f57627..303a6bc 100644 --- a/composer.json +++ b/composer.json @@ -36,6 +36,11 @@ "lint:test": "pint --test", "test": "pest" }, + "config": { + "allow-plugins": { + "pestphp/pest-plugin": true + } + }, "minimum-stability": "stable", "prefer-stable": true } \ No newline at end of file From 89a6ad959dd516cbadcd8ce502e5907b2ff7e2ea Mon Sep 17 00:00:00 2001 From: Jordan Lavar Partridge Date: Sat, 22 Aug 2026 10:43:10 -0700 Subject: [PATCH 3/3] fix: make Pint and Pest CI green Remove leftover root copies of src files (not autoloaded). Pint the src tree. Add phpunit.xml + a contract unit test so Pest no longer dies on a missing config ("--cache-directory"). --- .gitignore | 3 ++ Component.php | 25 ------------ ComponentInterface.php | 26 ------------ ComponentStorage.php | 49 ----------------------- phpunit.xml | 17 ++++++++ src/Contracts/ComponentInterface.php | 18 ++++----- src/Models/Component.php | 8 ++-- src/Services/ComponentStorage.php | 6 +-- tests/Pest.php | 3 ++ tests/Unit/ComponentContractTest.php | 60 ++++++++++++++++++++++++++++ 10 files changed, 99 insertions(+), 116 deletions(-) create mode 100644 .gitignore delete mode 100644 Component.php delete mode 100644 ComponentInterface.php delete mode 100644 ComponentStorage.php create mode 100644 phpunit.xml create mode 100644 tests/Pest.php create mode 100644 tests/Unit/ComponentContractTest.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9c7c6b9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/vendor/ +.phpunit.cache/ +composer.lock diff --git a/Component.php b/Component.php deleted file mode 100644 index 18e0fdc..0000000 --- a/Component.php +++ /dev/null @@ -1,25 +0,0 @@ - 'array', - 'installed_at' => 'datetime' - ]; -} \ No newline at end of file diff --git a/ComponentInterface.php b/ComponentInterface.php deleted file mode 100644 index 1a236d9..0000000 --- a/ComponentInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - $component->getName()], - [ - 'package_name' => $component->getName(), - 'version' => $component->getVersion(), - 'description' => $component->getDescription(), - 'metadata' => $component->getMetadata(), - 'status' => 'installed', - 'installed_at' => now() - ] - ); - } - - public function remove(string $name): bool - { - return Component::where('name', $name)->delete() > 0; - } - - public function get(string $name): ?Component - { - return Component::where('name', $name)->first(); - } - - public function all(): Collection - { - return Component::all(); - } - - public function isInstalled(string $name): bool - { - return Component::where('name', $name) - ->where('status', 'installed') - ->exists(); - } -} \ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..e067aae --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,17 @@ + + + + + tests/Unit + + + + + src + + + diff --git a/src/Contracts/ComponentInterface.php b/src/Contracts/ComponentInterface.php index 1a236d9..ea85ae2 100644 --- a/src/Contracts/ComponentInterface.php +++ b/src/Contracts/ComponentInterface.php @@ -7,20 +7,20 @@ interface ComponentInterface { public function getName(): string; - + public function getVersion(): string; - + public function getDescription(): string; - + public function getCommands(): array; - + public function install(): bool; - + public function uninstall(): bool; - + public function isInstalled(): bool; - + public function validate(): bool; - + public function getMetadata(): array; -} \ No newline at end of file +} diff --git a/src/Models/Component.php b/src/Models/Component.php index 18e0fdc..f172ed4 100644 --- a/src/Models/Component.php +++ b/src/Models/Component.php @@ -10,16 +10,16 @@ class Component extends Model { protected $fillable = [ 'name', - 'package_name', + 'package_name', 'version', 'description', 'metadata', 'installed_at', - 'status' + 'status', ]; protected $casts = [ 'metadata' => 'array', - 'installed_at' => 'datetime' + 'installed_at' => 'datetime', ]; -} \ No newline at end of file +} diff --git a/src/Services/ComponentStorage.php b/src/Services/ComponentStorage.php index a92d253..50307ad 100644 --- a/src/Services/ComponentStorage.php +++ b/src/Services/ComponentStorage.php @@ -4,8 +4,8 @@ namespace ConduitIo\Core\Services; -use ConduitIo\Core\Models\Component; use ConduitIo\Core\Contracts\ComponentInterface; +use ConduitIo\Core\Models\Component; use Illuminate\Support\Collection; class ComponentStorage @@ -20,7 +20,7 @@ public function store(ComponentInterface $component): Component 'description' => $component->getDescription(), 'metadata' => $component->getMetadata(), 'status' => 'installed', - 'installed_at' => now() + 'installed_at' => now(), ] ); } @@ -46,4 +46,4 @@ public function isInstalled(string $name): bool ->where('status', 'installed') ->exists(); } -} \ No newline at end of file +} diff --git a/tests/Pest.php b/tests/Pest.php new file mode 100644 index 0000000..174d7fd --- /dev/null +++ b/tests/Pest.php @@ -0,0 +1,3 @@ + 'test']; + } + }; + + expect($component->getName())->toBe('demo') + ->and($component->getVersion())->toBe('1.0.0') + ->and($component->getCommands())->toBe([]) + ->and($component->getMetadata())->toBe(['source' => 'test']); +});