Skip to content

docs: explain plugin scaffolding and generator troubleshooting - #2473

Open
somethings (lasomethingsomething) wants to merge 23 commits into
mainfrom
docs/scaffolding-q-and-a-findings
Open

docs: explain plugin scaffolding and generator troubleshooting#2473
somethings (lasomethingsomething) wants to merge 23 commits into
mainfrom
docs/scaffolding-q-and-a-findings

Conversation

@lasomethingsomething

@lasomethingsomething somethings (lasomethingsomething) commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

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:create scaffolding and cross-checked against current shopware/shopware scaffolding generators and the proposed shopware-cli extension create generator 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.

@shopware-dev-docs-connector

shopware-dev-docs-connector Bot commented Aug 21, 2026

Copy link
Copy Markdown

Developer Docs healthcheck

Status: Completed with success.
Repository: shopware/docs
Commit: a3e144f
Preview: https://developer-documentation-fp38rtrl9-shopware-frontends.vercel.app
Workflow run: #5035

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>
@lasomethingsomething
somethings (lasomethingsomething) marked this pull request as ready for review August 24, 2026 14:18
Copilot AI lite review requested due to automatic review settings August 24, 2026 14:18
@github-actions

Copy link
Copy Markdown
Contributor

📢 Developer Announcement Recommendation

Recommendation: ❌ No Announcement Recommended

No developer announcement signals were detected.

This PR does not appear to introduce developer-facing changes that require a community announcement.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment on lines 69 to +71
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.
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.

3 participants