Skip to content

refactor: move plugin system to dedicated package #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 19, 2025

Conversation

nfebe
Copy link
Contributor

@nfebe nfebe commented Jun 16, 2025

  • Moved plugin system to whilesmart/laravel-plugin-engine package
  • Updated AppServiceProvider to use the new package's service provider
  • Removed old plugin system files that were moved to the package
  • Updated composer.json to require the new package
  • Cleaned up cached configuration files

@nfebe nfebe force-pushed the refactor/move-plugin-system-to-package branch 2 times, most recently from b9b9688 to afa170e Compare June 16, 2025 21:04
@nfebe nfebe requested a review from kofimokome June 16, 2025 21:04
@trakli trakli deleted a comment from coderabbitai bot Jun 16, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6b95f22 and afa170e.

⛔ Files ignored due to path filters (1)
  • composer.lock is excluded by !**/*.lock
📒 Files selected for processing (20)
  • .gitignore (1 hunks)
  • app/Console/Commands/Plugin/DisableCommand.php (0 hunks)
  • app/Console/Commands/Plugin/DiscoverCommand.php (0 hunks)
  • app/Console/Commands/Plugin/EnableCommand.php (0 hunks)
  • app/Console/Commands/Plugin/InfoCommand.php (0 hunks)
  • app/Console/Commands/Plugin/InstallCommand.php (0 hunks)
  • app/Console/Commands/Plugin/ListCommand.php (0 hunks)
  • app/Console/Commands/Plugin/PluginCommand.php (0 hunks)
  • app/Providers/AppServiceProvider.php (2 hunks)
  • app/Providers/PluginServiceProvider.php (0 hunks)
  • app/Services/PluginManager.php (0 hunks)
  • composer.json (2 hunks)
  • config/app.php (1 hunks)
  • plugins/example/composer.json (0 hunks)
  • plugins/example/plugin.json (0 hunks)
  • plugins/example/routes/api.php (0 hunks)
  • plugins/example/src/ExampleServiceProvider.php (0 hunks)
  • plugins/example/src/Http/Controllers/ExampleController.php (0 hunks)
  • tests/Feature/Plugin/PluginCommandsTest.php (0 hunks)
  • tests/Feature/Plugin/PluginManagerTest.php (0 hunks)
💤 Files with no reviewable changes (16)
  • app/Providers/PluginServiceProvider.php
  • plugins/example/plugin.json
  • app/Console/Commands/Plugin/EnableCommand.php
  • plugins/example/composer.json
  • plugins/example/src/Http/Controllers/ExampleController.php
  • app/Console/Commands/Plugin/DisableCommand.php
  • plugins/example/src/ExampleServiceProvider.php
  • app/Console/Commands/Plugin/InstallCommand.php
  • plugins/example/routes/api.php
  • app/Console/Commands/Plugin/ListCommand.php
  • app/Console/Commands/Plugin/DiscoverCommand.php
  • app/Console/Commands/Plugin/InfoCommand.php
  • app/Console/Commands/Plugin/PluginCommand.php
  • tests/Feature/Plugin/PluginCommandsTest.php
  • tests/Feature/Plugin/PluginManagerTest.php
  • app/Services/PluginManager.php
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Run Tests
🔇 Additional comments (6)
.gitignore (1)

20-22: Verify that ignoring the entire /plugins directory is really what you want

The new engine usually keeps first-party plugins inside plugins/ while shipping its own code via vendor/.
Completely ignoring the folder means any in-house plugins (or stub templates committed for CI) will never reach the repo.
If that is intentional (runtime-only or external distribution) ‑ great, otherwise consider a more granular rule (e.g. plugins/*/vendor).

app/Providers/AppServiceProvider.php (2)

6-6: Import looks fine but may be redundant

If whilesmart/laravel-plugin-engine exposes its provider through Composer auto-discovery (most Laravel packages do), the explicit import/registration becomes a double-register risk.


15-15: Double-registration risk – confirm the package is NOT auto-discovered

Calling

$this->app->register(PluginServiceProvider::class);

is only necessary when the package is excluded from auto-discovery via extra.laravel.dont-discover.
If it is still auto-discoverable, this manual call will execute the provider twice, potentially registering bindings, routes or event listeners twice.

Action: Check vendor/whilesmart/laravel-plugin-engine/composer.json (or the repo stub) for an extra.laravel.providers section. Remove this line or opt-out via dont-discover to avoid duplication.

config/app.php (1)

19-19: App name change acknowledged

No functional impact; just ensure any automated e-mails or notifications depending on the value are covered by tests.

composer.json (2)

23-25: Un-pinned @dev dependency can break CI reproducibility

Depending on the moving @dev tip means every composer install can pull arbitrary new commits.
Pin to a specific branch name (dev-main) or a commit hash using the "as" syntax to keep builds deterministic.


73-75: openapi:plugins script may fail if plugins/ directory is absent

The script calls:

./vendor/bin/openapi app plugins --debug ...

openapi treats each positional argument as a path. If plugins/ is ignored and missing in CI containers the command exits non-zero, breaking the pipeline.

Option A: add a guard like test -d plugins && ...;
Option B: point it to the engine’s plugin path (e.g. storage/plugins) if that’s where plugins end up.

@nfebe nfebe force-pushed the refactor/move-plugin-system-to-package branch from afa170e to 3763457 Compare June 16, 2025 21:07
@trakli trakli deleted a comment from coderabbitai bot Jun 16, 2025
- Moved plugin system to whilesmart/laravel-plugin-engine package
- Updated AppServiceProvider to use the new package's service provider
- Removed old plugin system files that were moved to the package
- Updated composer.json to require the new package
- Cleaned up cached configuration files
@nfebe nfebe force-pushed the refactor/move-plugin-system-to-package branch from 3763457 to e50beb5 Compare June 16, 2025 21:14
@trakli trakli deleted a comment from coderabbitai bot Jun 16, 2025
@kofimokome kofimokome merged commit 73303de into main Jun 19, 2025
2 checks passed
@kofimokome kofimokome deleted the refactor/move-plugin-system-to-package branch June 19, 2025 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants