🐛 Fix package manifest discovery for non-Bedrock project structures#511
Merged
Conversation
Replace hardcoded `dirname(WP_CONTENT_DIR, 2)` with a dynamic walk-up from `WP_CONTENT_DIR` to find the nearest `composer.json`, supporting standard WordPress (1 level), Bedrock (2 levels), and custom depths. Add `acorn/composer_paths` filter for non-plugin root candidates (base path, content root, theme directories) to allow customization without subclassing Application. Closes #410 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
dirname(WP_CONTENT_DIR, 2)with a dynamic walk-up fromWP_CONTENT_DIRto find the nearestcomposer.json, supporting standard WordPress (1 level), Bedrock (2 levels), and custom directory depthsacorn/composer_pathsfilter hook for customizing non-plugin root candidates (base path, content root, theme directories) without subclassingApplicationThe
acorn/composer_pathsfilter covers project root candidates only. Active plugin paths remain auto-discovered from WordPress'sactive_pluginsoption and are merged separately. All paths (including filter-injected ones) pass through normalization, deduplication, and validation (composer.json+vendor/composer/installed.jsonmust both exist).Closes #410
Verification
Reproduced and verified the fix on both Radicle (Bedrock structure) and Sage (theme-based) installs. Full test suite passes on the devcontainer (88 tests, 0 failures).
🤖 Generated with Claude Code