Skip to content

fix(init): unlink example taxonomies when post-types is removed - #82

Open
Adi-ty wants to merge 2 commits into
mainfrom
fix/remove-post-type-taxonomy-link
Open

Adi-ty wants to merge 2 commits into
mainfrom
fix/remove-post-type-taxonomy-link

Conversation

@Adi-ty

@Adi-ty Adi-ty commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Fixes npm run init leaving the example taxonomies linked to removed example post types, and makes npm run test:php reuse a running wp-env test environment instead of restarting it every run.

Technical Details

  • Strip post-type imports, taxonomy associations and related test assertions when post-types is removed.
  • Reuse the running wp-env environment and reinstall Composer dependencies when the autoloader is older than composer.lock.
  • Remove the unused test theme.
  • Update feature and maintainer documentation.

Checklist

  • Lint passes.
  • PHPStan reports no errors.
  • PHPUnit passes: 118 tests, 241 assertions.
  • pretest:php verified warm (1.8 s vs ~6 s before) and cold from a stopped environment (16 s, full suite green).
  • Strip engine simulated in both states (post-types kept and removed): touched PHP files pass php -l and PHPCS, and the kept taxonomies no longer reference ExamplePostType.

Screenshots

N/A

Fixes/Covers issue

N/A

pretest:php only runs wp-env start when the test environment is not already up (about 1.7 s instead of 8.5 s on a running env), and reinstalls Composer dependencies when composer.lock is newer than vendor/autoload.php, not only when vendor/ is missing. In CI the test environment is not running, so it still starts with WP_ENV_CORE and WP_ENV_PHP_VERSION applied.
Wrap the example post type reference in each example taxonomy in wp:example:post-types markers, so init drops the link instead of leaving a call to a deleted class. The new markers end in a full stop and the taxonomy arrays keep a comment, so PHPCS passes with no new exclusions.
@Adi-ty
Adi-ty marked this pull request as ready for review November 10, 2026 17:06
Copilot AI balanced review requested due to automatic review settings November 10, 2026 17:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

This branch has not been deployed

No deployments
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.

2 participants