From 39cdf934aed0715957be4de21827f16a9080e9dd Mon Sep 17 00:00:00 2001 From: Olivier Gorzalka Date: Wed, 7 Oct 2026 10:08:18 +0200 Subject: [PATCH] fix: leave the plugin template's bin/ out of generated plugins --- CHANGELOG.md | 1 + src/Plugin/UI/Console/MakePluginCommand.php | 1 + .../Plugin/MakePluginTemplateToolingTest.php | 30 +++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 tests/Feature/Plugin/MakePluginTemplateToolingTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 10ff8cbf..c6603077 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased](https://github.com/Pollora/framework/compare/v13.35.0...develop) ### Fixed +- `pollora:make:plugin` no longer copies the template's `bin/` (its packaging script and tests) into the new plugin, as `pollora:make:theme` already did - A plugin that answers from `template_redirect` and includes the theme's query template itself (`include get_query_template('404')`, WooCommerce's Review Order page) printed the Blade source of the view: the `{type}_template` filters now hand back a loader that renders it while `template_redirect` runs (#419) - `template_redirect` ran before the application's providers had booted — WordPress is loaded from a provider's boot, the theme's providers boot after it — so a view rendered from it lacked the theme's view composers and shared data. It now runs once every provider has booted, still before routing, and `pollora_loaded` after it (#419) - Trackbacks answered 500: `wp-trackback.php` was required from a method, where it found no `$wp` and loaded WordPress a second time (#419) diff --git a/src/Plugin/UI/Console/MakePluginCommand.php b/src/Plugin/UI/Console/MakePluginCommand.php index 1ce44077..39fb88a3 100644 --- a/src/Plugin/UI/Console/MakePluginCommand.php +++ b/src/Plugin/UI/Console/MakePluginCommand.php @@ -100,6 +100,7 @@ public function handle(): int version: $this->option('repo-version'), output: $this->getOutput(), fileFilter: fn (object $item): bool => ! $this->shouldExcludeAssetFile($item), + removeDirs: ['bin'], ); if (! $success && ! $this->scaffoldFromBundledTemplate()) { diff --git a/tests/Feature/Plugin/MakePluginTemplateToolingTest.php b/tests/Feature/Plugin/MakePluginTemplateToolingTest.php new file mode 100644 index 00000000..9f854d5f --- /dev/null +++ b/tests/Feature/Plugin/MakePluginTemplateToolingTest.php @@ -0,0 +1,30 @@ +set('plugin.path', $pluginsPath); + + $scaffolder = Mockery::mock(ModuleScaffolderService::class); + $scaffolder->shouldReceive('downloadAndScaffold') + ->once() + ->withArgs(fn (...$arguments): bool => ($arguments['removeDirs'] ?? $arguments[7] ?? null) === ['bin']) + ->andReturnTrue(); + $this->app->instance(ModuleScaffolderService::class, $scaffolder); + + $command = $this->app->make(MakePluginCommand::class); + $command->setLaravel($this->app); + + $input = new ArrayInput(['name' => 'acme', '--repository' => 'pollora/plugin-default']); + $input->setInteractive(false); + + expect($command->run($input, new BufferedOutput))->toBe(0); + }); +});