PHPackages                             sidworks/sw-plugin-devtools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sidworks/sw-plugin-devtools

ActiveShopware-platform-plugin[Utility &amp; Helpers](/categories/utility)

sidworks/sw-plugin-devtools
===========================

Sidworks Developer tools for Shopware 6

1.0.13(2mo ago)391↓93.8%MITJavaScript

Since Nov 17Pushed 2mo agoCompare

[ Source](https://github.com/sidworks-dev/sw-plugin-devtools)[ Packagist](https://packagist.org/packages/sidworks/sw-plugin-devtools)[ RSS](/packages/sidworks-sw-plugin-devtools/feed)WikiDiscussions main Synced yesterday

READMEChangelog (10)Dependencies (2)Versions (16)Used By (0)

Sidworks DevTools for Shopware 6
================================

[](#sidworks-devtools-for-shopware-6)

Never hunt for a Twig file again. Sidworks DevTools reveals the exact template and block behind every Shopware 6 element and lets you jump straight into your IDE with a single click. It also includes a optimised storefront watcher.

[![Screenshot](./docs/sw-devtools.png)](./docs/sw-devtools.png)

Features
--------

[](#features)

### Shopware Plugin

[](#shopware-plugin)

- **Smart Template Tracking**: Automatically tracks every Twig block with detailed metadata (template name, file path, line number, parent template)
- **HTML Markers**: Injects lightweight HTML comments (``) to map elements to their source templates
- **Intelligent Line Detection API**: Backend endpoint that searches template files to find the exact line of your selected element (not just the block start)
- **Security First**: Only active in debug mode (`APP_ENV=dev`) with configurable on/off switch
- **Zero Production Impact**: Completely disabled in production environments

### [Chrome extension](https://github.com/sidworks-dev/sw-plugin-devtools-chrome-extension)

[](#chrome-extension)

- **DevTools Sidebar Integration**: Adds a "Shopware" panel in Chrome's Elements sidebar
- **Instant Template Info**: Select any element to see its template, block name, file path, and inheritance chain
- **Smart IDE Integration**: One-click to open templates at the exact line in PHPStorm or VSCode
- **Intelligent Line Search**: Automatically finds the precise element line by searching for classes, IDs, and tags
- **Multi-Editor Support**: Works with PHPStorm and VSCode

### Optimized Storefront Watcher

[](#optimized-storefront-watcher)

- **One command start**: `bin/console sidworks:watch-storefront`
- **Theme picker by default**: Choose theme + domain directly in the terminal
- **Fast feedback**: Live SCSS updates with readable JS/Twig/SCSS logs
- **Simple toggles**: `--no-js`, `--no-twig`, `--no-scss`, `--skip-theme-dump`

Requirements
------------

[](#requirements)

- Shopware 6.6.x or 6.7.x
- PHP 8.1 or higher
- Chrome or Edge browser (for extension)
- Node.js 20+ (required for storefront watcher)
- [Bun](https://bun.sh) optional (set `SHOPWARE_STOREFRONT_WATCH_PM=bun` to use it)

Installation
------------

[](#installation)

### Plugin Installation

[](#plugin-installation)

#### Via Composer (Recommended)

[](#via-composer-recommended)

```
composer require sidworks/sw-plugin-devtools --dev
bin/console plugin:refresh
bin/console plugin:install --activate SidworksDevTools
bin/console cache:clear
```

#### Manual Installation

[](#manual-installation)

1. Clone or download this repository to `custom/plugins/SidworksDevTools`
2. Run the following commands:

```
bin/console plugin:refresh
bin/console plugin:install --activate SidworksDevTools
bin/console cache:clear
```

### Chrome Extension Installation

[](#chrome-extension-installation)

1. Download [Chrome extension](https://github.com/sidworks-dev/sw-plugin-devtools-chrome-extension)
2. Open Chrome and navigate to `chrome://extensions/`
3. Enable **Developer mode** (toggle in top right)
4. Click **Load unpacked**
5. Select the extension directory
6. The extension icon will appear in your toolbar

Configuration
-------------

[](#configuration)

### Plugin Configuration

[](#plugin-configuration)

1. Ensure Shopware is running in debug mode: set `APP_ENV=dev` in your `.env` file
2. (Optional) Navigate to **Settings** → **System** → **Plugins** in Shopware admin
3. Find **Sidworks DevTools** and click **Configuration** to enable/disable

### Extension Configuration

[](#extension-configuration)

1. Click the extension icon and select **Options**
2. Set your **Project Path** (e.g., `/Users/yourname/Projects/shopware`)
3. Choose your preferred **Editor** (PHPStorm or VSCode)
4. Enable/disable **IDE Integration**

The project path should be the absolute path to your Shopware root directory.

**Tip for Docker/DDEV users**: Add the `PROJECT_PATH` environment variable to your `docker-compose.yml` or `.ddev/config.yaml`:

```
web_environment:
  - PROJECT_PATH=/Users/yourname/Development/your-shopware-project
```

The plugin will automatically inject this path into the page, so you don't need to manually configure it in the extension options.

Usage
-----

[](#usage)

### Storefront Watcher (`sidworks:watch-storefront`)

[](#storefront-watcher-sidworkswatch-storefront)

Run from your project root:

```
bin/console sidworks:watch-storefront
```

What this gives you:

- Interactive theme/domain selection by default
- Fast defaults for day-to-day storefront work
- Clear terminal output with `[SCSS]`, `[TWIG]`, and `[JS]` log tags

Common toggles:

```
bin/console sidworks:watch-storefront --no-js
bin/console sidworks:watch-storefront --no-twig
bin/console sidworks:watch-storefront --no-scss
bin/console sidworks:watch-storefront --skip-theme-dump
```

By default, the watcher runs `theme:compile --active-only` and then interactive `theme:dump` (unless you pass `--skip-theme-dump`).

### Template Inspector — Basic Workflow

[](#template-inspector--basic-workflow)

1. **Enable debug mode** in Shopware (`.env`: `APP_ENV=dev`)
2. **Install both** the plugin and [Chrome extension](https://github.com/sidworks-dev/sw-plugin-devtools-chrome-extension)
3. **Visit your storefront** in Chrome
4. **Open DevTools** (F12 or right-click → Inspect)
5. **Select any element** in the Elements panel
6. **View template info** in the "Shopware" sidebar on the right
7. **Click the IDE link** to jump directly to the template file at the exact line

### What You'll See

[](#what-youll-see)

When you inspect an element, the sidebar shows:

- **Template Type**: Page, Component, or Utility
- **Block Name**: The Twig block that rendered this element
- **Template Path**: Full Shopware namespace path (e.g., `@Storefront/storefront/page/product-detail/index.html.twig`)
- **Parent Template**: The template this one extends (inheritance chain)
- **File Path**: Relative filesystem path
- **IDE Link**: Click to open in PHPStorm/VSCode at the exact element line
- **Element Info**: Tag name, ID, and classes

### Smart Line Detection

[](#smart-line-detection)

The extension doesn't just open templates at the block start—it searches for the exact line:

1. **Exact ID match**: `id="product-detail-123"` → finds exact match
2. **Partial ID match**: `id="product-{{ product.id }}"` → matches static prefix
3. **Multi-class match**: `class="btn btn-primary"` → tries all combinations
4. **Parent context**: Uses parent element classes to disambiguate similar elements
5. **Dynamic class prefix**: `class="card-{{ type }}"` → matches `card-` prefix
6. **Tag fallback**: Falls back to tag name (``, ``) if needed

### Example Output

[](#example-output)

```
📄 Page Template: index.html.twig

🚀 Open in PHPStorm
  └─ Open file at line 42
  └─ ✓ Found element at line 42 (matched: product-detail-content)

📦 Block Name: page_product_detail

📂 Full Path: @Storefront/storefront/page/product-detail/index.html.twig

⬆️ Extends: @Storefront/storefront/base.html.twig

💻 File Path: vendor/shopware/storefront/Resources/views/storefront/page/product-detail/index.html.twig

🏷️ Element: DIV#product-123.product-detail-content
🎨 Classes: product-detail-content container

```

How It Works
------------

[](#how-it-works)

### Backend (Plugin)

[](#backend-plugin)

1. **TemplateDebugNodeVisitor**: Twig compiler visitor that wraps every block with tracking functions
2. **TemplateDebugExtension**: Twig extension providing `swdt_track_block()`, `swdt_start_marker()`, and `swdt_end_marker()`
3. **TemplateRegistry**: In-memory registry collecting all template metadata during page render
4. **ResponseSubscriber**: Injects collected data into HTML response as JSON and wraps elements with `data-swdt` attributes
5. **TemplateSearchController**: API endpoint (`/_action/sidworks-devtools/find-line`) that searches template files to find exact element lines

### Frontend (Extension)

[](#frontend-extension)

1. **content.js**: Content script that detects DevTools data on page
2. **background.js**: Service worker managing extension state
3. **devtools-init.js**: Creates the "Shopware" sidebar panel
4. **inspector.js**: Sidebar logic that reads element data and communicates with the page
5. **Smart search**: Sends element classes/ID/tag to backend API to find exact line in template file

Security
--------

[](#security)

- **Debug Mode Only**: Plugin is completely disabled when `APP_ENV=prod`
- **Configurable**: Can be disabled even in debug mode via plugin settings
- **Input Validation**: API endpoint validates all inputs (class names, IDs, file paths)
- **Path Traversal Protection**: Only allows reading `.twig` files within project directory
- **No Production Data**: No overhead or data collection in production

Browser Compatibility
---------------------

[](#browser-compatibility)

The [Chrome extension](https://github.com/sidworks-dev/sw-plugin-devtools-chrome-extension) works with:

- Google Chrome (Manifest V3)
- Microsoft Edge (Chromium-based)
- Brave
- Other Chromium-based browsers

License
-------

[](#license)

MIT License - See [LICENSE](LICENSE.md) file for details

Author
------

[](#author)

**Sidworks**Website: [www.sidworks.nl](https://www.sidworks.nl)

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit issues or pull requests.

**Important**: This project consists of two components that work together:

- **[Shopware Plugin](https://github.com/sidworks-dev/sw-plugin-devtools)**
- **[Chrome extension](https://github.com/sidworks-dev/sw-plugin-devtools-chrome-extension)**

When updating the plugin, ensure you also update the extension if the changes affect the data format or API. Similarly, when updating the extension, verify compatibility with the plugin. Both components should be kept in sync.

Support
-------

[](#support)

For issues and questions:

- Create an issue on GitHub

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance83

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~11 days

Total

14

Last Release

87d ago

Major Versions

1.0.9 → v109.x-dev2026-02-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/2ee4de80f0235969a01da2eb7c088d6cf002d75a666728c6be5d81fc7ab186ed?d=identicon)[sidworks](/maintainers/sidworks)

---

Top Contributors

[![jellesiderius](https://avatars.githubusercontent.com/u/8039493?v=4)](https://github.com/jellesiderius "jellesiderius (50 commits)")

---

Tags

shopware6shopware6-plugin

### Embed Badge

![Health badge](/badges/sidworks-sw-plugin-devtools/health.svg)

```
[![Health](https://phpackages.com/badges/sidworks-sw-plugin-devtools/health.svg)](https://phpackages.com/packages/sidworks-sw-plugin-devtools)
```

###  Alternatives

[frosh/tools

Provides some basic things for managing the Shopware Installation

87820.7k3](/packages/frosh-tools)[shopware/storefront

Storefront for Shopware

684.6M236](/packages/shopware-storefront)[shopware/production

177209.0k](/packages/shopware-production)[shopware/conflicts

Shopware 6 conflicting packages

149.5M10](/packages/shopware-conflicts)[shopware/elasticsearch

Elasticsearch for Shopware

153.9M19](/packages/shopware-elasticsearch)[swag/migration-assistant

Migration plugin for shopware/platform

2042.5k](/packages/swag-migration-assistant)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
