fix(templates): guard the release zip; correct stale architecture docs - #18
Merged
Merged
Conversation
package.json - plugin-zip now runs `composer prepare-dist` first, so a zip is never built without the production autoloader (previously skipped silently, exit 0, when vendor/ was absent). - drop unbuilt assets/src/ from files[] — no runtime PHP reads it. New readme.txt "== Development ==" section points to the repo for source, gated on has_webpack_build, linking AUTHOR_URI when set. templates/README.md - "Architecture & Services" described a Core\Container / Service_Provider / Conditional / <prefix>_providers filter system the generator has never produced. Replaced with a module-aware "Project structure" section. Releasing section updated for the chained plugin-zip. README.md (CLI's own) - same fictional architecture writeup corrected to the real singleton Plugin bootloader + plain init_hooks() modules; Releasing note updated. index.js - add has_author_uri template flag; point "Next steps" at packaging. tests - update the two plugin-zip assertions and the files[] assertion. Verified: 70/70 generator tests; scaffolds regenerated across build/no-build and woo/no-woo render clean with no stray tokens.
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.
What
Three areas, all landing in every scaffolded plugin (plus the CLI's own README).
1. The release zip can no longer be built broken
templates/package.json:plugin-zipchainscomposer prepare-dist—"composer prepare-dist && wp-scripts plugin-zip". Previouslynpm run plugin-zipwith novendor/on disk produced a zip with no autoloader, exit 0, no warning.assets/src/removed fromfiles[]— verified nothing in generated runtime PHP reads it (Block_Registrar→assets/build/blocks, Woo integration →assets/build/blocks-integration.js,Interactivity→assets/js/view.js; everyassets/srcmention is a doc comment).templates/readme.txtgains a== Development ==section pointing to the repo for unminified source — gated onhas_webpack_build, links{{AUTHOR_URI}}when set, else a fill-in placeholder. Keeps the wp.org "human-readable code" requirement satisfied now that source isn't shipped.2. Stale architecture docs
Both
templates/README.mdand the CLI's ownREADME.mddescribed aPlugin::create()/Core\Container/Contracts\Service_Provider/Contracts\Conditional/<prefix>_providersfilter system the generator has never produced. The real design is a singletonPlugin::instance()->boot()running a flat list of( new X() )->init_hooks()calls.templates/README.md: the section is replaced with a plain, module-aware## Project structurelist (conditionalassets/src/andtemplates/lines) — a generated plugin's README shouldn't carry an architecture essay.README.md(CLI):## Architecture (generated plugin)rewritten to match the code; intro line and module-table wording corrected;Releasingsections updated for the chainedplugin-zip.3. Supporting
index.js: newhas_author_uritemplate flag;Next stepsoutput now points at theReleasingsection.tests/generator.test.js: updated the twoplugin-zipstring assertions and thefiles[]assertion (now assertsassets/srcis absent).Not included
No version bump — following repo convention (bumps are separate release commits). Next release should be a minor (3.0.0 → 3.1.0):
plugin-zipnow requires Composer on PATH and generated output changes, but the CLI interface is unchanged.Verification
node --test tests/*.test.js→ 70/70 passreadme.txt,README.md,package.jsonrender with no stray{{...}}tokens;## Project structurematches the actual directory tree in each combonpm run build→composer install --no-dev --optimize-autoloader→npm run plugin-zip): 68-file zip,vendor/present with a clean autoloader (no phpunit/phpcs/wpcs leak), deployed and structurally validated