Skip to content

🐛 Fix package manifest discovery for non-Bedrock project structures#511

Merged
retlehs merged 1 commit into
mainfrom
fix/package-manifest-paths
Mar 8, 2026
Merged

🐛 Fix package manifest discovery for non-Bedrock project structures#511
retlehs merged 1 commit into
mainfrom
fix/package-manifest-paths

Conversation

@retlehs

@retlehs retlehs commented Mar 8, 2026

Copy link
Copy Markdown
Member

Summary

  • 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 directory depths
  • Add acorn/composer_paths filter hook for customizing non-plugin root candidates (base path, content root, theme directories) without subclassing Application

The acorn/composer_paths filter covers project root candidates only. Active plugin paths remain auto-discovered from WordPress's active_plugins option and are merged separately. All paths (including filter-injected ones) pass through normalization, deduplication, and validation (composer.json + vendor/composer/installed.json must 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

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>
@retlehs retlehs self-assigned this Mar 8, 2026
@retlehs retlehs merged commit 33bf3f7 into main Mar 8, 2026
3 checks passed
@retlehs retlehs deleted the fix/package-manifest-paths branch March 8, 2026 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

packages not discovered due to numerous issues with package manifest search paths

1 participant