Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/Plugin/UI/Console/MakePluginCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
30 changes: 30 additions & 0 deletions tests/Feature/Plugin/MakePluginTemplateToolingTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

declare(strict_types=1);

use Pollora\Modules\Infrastructure\Services\ModuleScaffolderService;
use Pollora\Plugin\UI\Console\MakePluginCommand;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\BufferedOutput;

describe('pollora:make:plugin', function (): void {
it('leaves the template packaging tooling in bin/ out of the new plugin', function (): void {
$pluginsPath = sys_get_temp_dir().'/pollora-make-plugin-'.uniqid();
config()->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);
});
});
Loading