Repository navigation
✨ feat(bones): a plugin's own stubs/ comes first; stub:publish - #134
Merged
Merged
Conversation
…pies the framework's there Every make:* command read its stub from vendor/wpbones/wpbones/src/Console/stubs and nowhere else, so a team could change what the generators write only by editing vendor/, which the next composer update put back (#133). - getStubContent() reads stubs/{name}.stub from the plugin root first, says so, and falls back to the framework's. Every make:* command and migrate:to-v2's config files go through it. A stub found nowhere now stops the command before anything is written. - php bones stub:publish [<stub> ...] [--force] copies the framework's stubs into stubs/, all of them or the ones named (controller and controller.stub alike). A stub already there is kept unless --force; an unknown name exits 1 and writes nothing. - deploy leaves the plugin's .stub files out; a stubs/ folder that holds nothing else goes whole, one that ships other files keeps them. - The help lists stub:publish. Closes #133
This was referenced Oct 7, 2026
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.
Closes #133.
Every
make:*command read its stub fromvendor/wpbones/wpbones/src/Console/stubsand nowhere else, so a team could change what the generators write only by editingvendor/, which the nextcomposer updateput back.What changes
getStubContent()readsstubs/{name}.stubfrom the plugin root first, printsUsing stubs/{name}.stub, and falls back to the framework's. Everymake:*command andmigrate:to-v2's config files go through it. A stub found nowhere now stops the command before anything is written (it used to go on).php bones stub:publish [<stub> ...] [--force]copies the framework's stubs intostubs/: all of them, or the ones named (controllerandcontroller.stubalike). A stub already there is kept unless--force; an unknown name exits 1, lists the stubs there are, and writes nothing.deployleaves the plugin's.stubfiles out. Astubs/folder that holds nothing else goes whole; one that also ships other files keeps them, so a plugin with a runtimestubs/folder is not broken by the upgrade.stub:publishunder a new stub group.Proof
composer test: 360 tests, 993 assertions (350 / 897 on master).tests/Console/StubOverridesTest.php, 10 tests: 9 failed before the change (the fallback one passed, as it should)..claude/scripts/stubs-live-smoke.sh(new): 7 ✗ of 7 on v3.0.0, 7 ✓ of 7 on this branch,debug.logunchanged.stub:publish controllercopies the framework's stub byte for byte;make:controllerfills the edited copy, says so, and writes a file that parses;--forcereplaces it;deploy --no-buildships the plugin and leavesstubs/out (on v3.0.0 a hand-written stub was shipped);origin/master: no findings. Copilot's quota is exhausted.