diff --git a/CHANGELOG.md b/CHANGELOG.md index 82df1452..e14a92d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Editor and tool files no longer tracked: `.cursor/` and `.windsurf/` rules from 2025 (superseded by `CLAUDE.md` and Nectar), a `.claude/` plan, a 2023 `.php-cs-fixer.cache`, and the unused StyleCI and Code Climate configurations (style is checked by Pint in CI, coverage by Codecov) ### 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); + }); +});