docs: explain plugin scaffolding and generator troubleshooting - #2473
docs: explain plugin scaffolding and generator troubleshooting#2473somethings (lasomethingsomething) wants to merge 23 commits into
Conversation
Developer Docs healthcheckStatus: Completed with |
Adds Storefront controller lifecycle guide explaining how controller class, route attributes, routing import, service registration, and cache connect. Warns about generated plugin base class name mismatches when plugin name does not follow UpperCamelCase, which can cause PluginBaseClassNotFoundException during installation even when plugin:refresh succeeds. Links lifecycle guides from index pages and remaining documentation. Aligns all lifecycle pages with repo formatting conventions (frontmatter blank lines, consistent command formatting, improved phrasing). Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-authored-by: lasomethingsomething <2453640+lasomethingsomething@users.noreply.github.com>
📢 Developer Announcement RecommendationRecommendation: ❌ No Announcement Recommended No developer announcement signals were detected.
|
There was a problem hiding this comment.
Pull request overview
This PR strengthens the Shopware plugin documentation by explaining how generator output typically represents coordinated framework wiring (registration, discovery, build/runtime), helping readers interpret scaffolded files as connected parts rather than isolated artifacts.
Changes:
- Adds short “generator output is a connected chain” explanations across Storefront JS, controllers, scheduled tasks, Store API routes, and Administration modules.
- Extends the “Creating Plugins” guide with troubleshooting context emphasizing wiring/discovery/build boundaries.
- Refines a few in-guide code comments to better align with the narrative (e.g., “Register your custom Storefront plugin”).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| guides/plugins/plugins/storefront/javascript/add-custom-javascript.md | Adds generator-chain context for main.js/plugin class/selector and updates code comment wording. |
| guides/plugins/plugins/storefront/controllers/add-custom-controller.md | Adds info callouts explaining how controllers relate to service registration and route discovery. |
| guides/plugins/plugins/plugin-fundamentals/add-scheduled-task.md | Adds explanation of scheduled task vs handler roles and generator wiring implications. |
| guides/plugins/plugins/plugin-base-guide.md | Adds a generator-output framing paragraph to connect the base guide to focused feature guides. |
| guides/plugins/plugins/framework/store-api/add-store-api-route.md | Adds info callouts clarifying route/service/routes.php responsibilities and debugging interpretation. |
| guides/plugins/plugins/creating-plugins.md | Adds troubleshooting guidance about generated output and reinforces version/adaptation context. |
| guides/plugins/plugins/administration/module-component-management/add-custom-module.md | Adds info callouts explaining how module entrypoints, registration, snippets, and build relate. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| Shopware is automatically looking for a `main.js` file in a directory `<plugin root>/src/Resources/app/storefront/src`, which then will be loaded automatically. Consider this to be your main storefront JavaScript entrypoint. | ||
|
|
||
| The entry point, plugin class, and optional DOM selector form one runtime chain. A generator creates these pieces together: `main.js` imports and registers the class, the selector connects it to rendered markup when one is used, and the Storefront build produces the asset the browser loads. Keeping that relationship in mind makes generated output easier to adapt without treating each file as an independent feature. |
| This is done with a `routes.php` file at `<plugin root>/src/Resources/config/` location. | ||
| Take a look at the official [Symfony documentation](https://symfony.com/doc/current/routing.html) about routes and how they are registered. | ||
|
|
||
| The route import is the discovery half of the feature: it tells Shopware which controller files to inspect for route attributes. A controller can therefore exist and be a valid service while still not expose a URL until its route is imported. |
Summary
Adds context explaining how Shopware plugin generators produce coordinated framework features, rather than isolated files.
New info is based on a hands-on walkthrough of current
bin/console plugin:createscaffolding and cross-checked against currentshopware/shopwarescaffolding generators and the proposedshopware-cli extension creategenerator epics: shopware/shopware-cli#1255, shopware/shopware-cli#1280.The goal is to bridge the gap between “the generator created these files” and “here’s how those pieces work together”, without adding another workflow or duplicating existing guides.