Conversation
mogmarsh
force-pushed
the
feature/issue-544/fix-configure-php-replacements
branch
from
September 9, 2026 21:16
c8d3f2d to
6ee89d7
Compare
mogmarsh
force-pushed
the
feature/issue-544/tests-for-configure-php-regressions
branch
from
September 9, 2026 21:31
d82ba1b to
41dbfe8
Compare
mogmarsh
force-pushed
the
feature/issue-544/fix-configure-php-replacements
branch
from
September 9, 2026 21:32
6ee89d7 to
1bc2192
Compare
mogmarsh
force-pushed
the
feature/issue-544/tests-for-configure-php-regressions
branch
from
September 9, 2026 21:34
41dbfe8 to
914359f
Compare
The tests added in the previous commit documented five defects in configure.php. This fixes them and turns those characterization assertions into assertions of the intended behavior. - Replacing `alleyinteractive` everywhere rewrote every reference to Alley's other packages when the vendor was someone else, producing a composer.json that cannot install (`test-vendor/wp-type-extensions`) and workflows that reference actions that do not exist. Replace `alleyinteractive/create-wordpress-plugin` — this skeleton's own repository — instead, and add a `vendor_slug` placeholder for the one remaining spot that wants the vendor on its own. - The bare `Create_WordPress_Plugin` token was only replaced as part of the full namespace, so it survived in `scaffold/config.json`, the feature docs and the README. Replace it with the last segment of the namespace, and fix the two places that meant the text domain instead. - The `.scaffolder` templates were excluded from the search and replace entirely, so scaffolded features landed in the skeleton's namespace. Include them, and give the generated test the namespace root it was missing. - The parent project rollup could not remove the Composer loader, because confirming Composer had already stripped the comments that mark it. Strip those comments at the end of the run instead. - `remove_phpstan()` left `scripts.lint` as a JSON object with a gap in its keys rather than a list. Also use the vendor prefix, not the vendor's display name, for the PHPCS global prefix, and remove the `test:configure` script without reformatting the rest of composer.json. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
mogmarsh
force-pushed
the
feature/issue-544/fix-configure-php-replacements
branch
from
September 9, 2026 21:34
1bc2192 to
5539961
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #546 — the base branch is
feature/issue-544/tests-for-configure-php-regressions, so review that one first (or read the diff against it).The tests in #546 documented five defects in
configure.php. This fixes them and turns those characterization assertions into assertions of the intended behavior.The fixes
Replacing
alleyinteractiveeverywhere rewrote every reference to Alley's other packages. For any vendor other than Alley, a scaffolded plugin got acomposer.jsonthat cannot install (test-vendor/composer-wordpress-autoloader,test-vendor/wp-type-extensions,test-vendor/alley-coding-standards), workflows pointing atuses: test-vendor/action-test-php@develop, and rewritten links to Alley's docs. The map now replacesalleyinteractive/create-wordpress-plugin— this skeleton's own repository — ahead of the slug rule, so everything else survives.composer install --dry-runin a configured copy now resolves cleanly. The one spot that legitimately wanted the vendor on its own (thecomposer.jsonkeyword) uses a newvendor_slugplaceholder.The bare
Create_WordPress_Plugintoken was never replaced, only the fully-qualified namespace, so it survived inscaffold/config.json's"namespace",src/features/README.md, the README usage example andCLAUDE.md. It now maps to the last segment of the namespace, using thestr_after()helper that was already in the file but unused. The two spots that actually meant the text domain becamecreate-wordpress-plugin, the README example was missing its namespace root, andCLAUDE.mdnow points at the replacement map instead of restating tokens that the map then rewrites. The JSON-escaped namespace rule also lost its trailing-\\requirement so it matches both the…\\Tests\\and…\\forms..scaffolderwas excluded from the search and replace entirely, sonpm run scaffoldin a configured plugin generated features inAlley\WP\Create_WordPress_Plugin\Features. It is included now. The generated test template also referencedCreate_WordPress_Plugin\Tests\TestCase, a namespace root that never existed — broken in the skeleton too — nowAlley\WP\Create_WordPress_Plugin\Tests\TestCase.The parent-project rollup could not remove the Composer loader. Confirming Composer ran
remove_composer_wrapper_comments(), which strips the/* Start|End Composer Loader */markers thatremove_composer_require()later matches on, so the rollup left the loader in place while printing that it had removed it. The comments are now stripped once at the end of the run, after every prompt that can remove the loader outright, and the function returns early when the markers are already gone.remove_phpstan()leftscripts.lintas a JSON object ({"0": "@phpcs", "2": "@rector"}) becausearray_filterpreserves keys.Two more while in there:
.phpcs.xmlended up with<element value="Test Vendor" />— not a usable prefix. It now uses avendor_prefixtoken (test_vendor).remove_configure_test()re-encodedcomposer.json, which would have reindented every scaffolded plugin'scomposer.jsonfrom two spaces to four. It now drops its two lines textually, falling back to a rewrite only if that would leave invalid JSON.Tests
test_documents_the_placeholders_that_are_left_behindis gone, replaced by three tests of the real behavior:test_keeps_references_to_third_party_packages,test_replaces_the_skeletons_own_repositoryandtest_replaces_the_placeholders_in_the_scaffolder_templates.Create_WordPress_Plugin,vendor_slugandvendor_prefixjoined the placeholder scan,.scaffolder/came off the untouched list, the rollup test asserts the loader is gone, and the PHPStan test assertsscripts.lint === ['@phpcs', '@rector'].21 tests / 285 assertions pass,
composer lintis clean, and the Mantle suite still passes. Each of the five fixes was mutated back to its broken form one at a time to confirm the suite catches it.🤖 Generated with Claude Code