Repository navigation
fix: template - collection block render, pattern headers and PHP checks in check:generation (BPS-10) - #61
Conversation
…ks in check:generation PHPCS failed on generated plugins with post types, and the collection blocks never rendered: - collection/block.json named a PHP function as "render", which WordPress reads as a file path. It now uses file:./render.php, which echoes the documented render function, as the slider block does. - The seven patterns said "ExamplePlugin" in their header and had unaligned array arrows (phpcbf). - check:generation now runs composer install, PHPCS, PHPStan and PHPUnit in each generated plugin; the CI job sets up PHP 8.4 as ls-test CI does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. Note Some coding-guideline sources were skipped; the reason is listed next to each one. Other guidelines were applied as usual. On a public repository, sources from your configuration are listed without their names. Skipped guideline sources: 1
Walkthrough
Merge Risk:
|
Part of BPS-10 (#55). Stacked on #60: merge that first, and GitHub then retargets this PR to
develop.This adds the generated plugin's Composer checks to
check:generationand fixes what they found. ls-test never caught these because it is functional-only and has no post types.Changes
src/blocks/collection/block.jsonset"render"to a PHP function name. WordPress readsrenderas a file path, so every generated collection block rendered nothing. It now usesfile:./render.php, andrender.phpechoes its documented render function, as the slider block does. The build now shipsrender.phpinbuild/blocks/<post-type>-collection/.{{name}}. Their array arrows are aligned withphpcbf. Alignment depends only on the key names, so it holds for every slug.check:generation. Aftercomposer validate(feat: generator - ship package-lock.json and composer.lock in generated plugins (BPS-10) #60), it now runscomposer install,composer run lint(PHPCS),composer run phpstanandcomposer run test(PHPUnit) in each generated plugin. The CI job sets up PHP 8.4 with Composer, using the same pinnedsetup-phpas ls-test CI.render.php. The functional-only test now expectsfile:./render.php.Testing
node scripts/toolchain/check-generation.js: both fixtures pass every step, including all four new Composer steps. Ondevelop, PHPCS fails thedefaultfixture with 1 error and 59 warnings in 8 files.fills plugin_slug placeholders from slug. That test already fails ondevelop, becausephpunit.xmldoesn't contain the slug.--e2erun. CI runs it for both fixtures.🤖 Generated with Claude Code
Summary by CodeRabbit