Skip to content

Commit 3520dc8

Browse files
committed
✨ feat: update CHANGELOG and improve di.xml formatting
1 parent ee13cc1 commit 3520dc8

3 files changed

Lines changed: 91 additions & 51 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
77
## UNRELEASED
88

99
### Added
10+
1011
- feat: add Hyvä compatibility checker command (`mageforge:hyva:compatibility:check`)
1112
- Scans Magento modules for Hyvä theme compatibility issues
1213
- Detects RequireJS, Knockout.js, jQuery, and UI Components usage

docs/commands.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,17 @@ All commands in MageForge follow a consistent structure based on Symfony's Conso
1919
**File**: `/src/Console/Command/ListThemeCommand.php`
2020

2121
**Dependencies**:
22+
2223
- `ThemeList` - Service to retrieve theme information
2324

2425
**Usage**:
26+
2527
```bash
2628
bin/magento mageforge:theme:list
2729
```
2830

2931
**Implementation Details**:
32+
3033
- Retrieves all themes from the `ThemeList` service
3134
- Displays a formatted table with theme information (code, title, path)
3235
- Returns success status code
@@ -40,16 +43,19 @@ bin/magento mageforge:theme:list
4043
**File**: `/src/Console/Command/BuildThemeCommand.php`
4144

4245
**Dependencies**:
46+
4347
- `ThemePath` - Service to resolve theme paths
4448
- `ThemeList` - Service to retrieve theme information
4549
- `BuilderPool` - Service to get appropriate builders for themes
4650

4751
**Usage**:
52+
4853
```bash
4954
bin/magento mageforge:theme:build [<themeCodes>...]
5055
```
5156

5257
**Implementation Details**:
58+
5359
- If no theme codes are provided, displays an interactive prompt to select themes
5460
- For each selected theme:
5561
1. Resolves the theme path
@@ -67,16 +73,19 @@ bin/magento mageforge:theme:build [<themeCodes>...]
6773
**File**: `/src/Console/Command/ThemeWatchCommand.php`
6874

6975
**Dependencies**:
76+
7077
- `BuilderPool` - Service to get appropriate builders for themes
7178
- `ThemeList` - Service to retrieve theme information
7279
- `ThemePath` - Service to resolve theme paths
7380

7481
**Usage**:
82+
7583
```bash
7684
bin/magento mageforge:theme:watch [--theme=THEME]
7785
```
7886

7987
**Implementation Details**:
88+
8089
- If no theme code is provided, displays an interactive prompt to select a theme
8190
- Resolves the theme path
8291
- Determines the appropriate builder for the theme type
@@ -92,15 +101,18 @@ bin/magento mageforge:theme:watch [--theme=THEME]
92101
**File**: `/src/Console/Command/SystemCheckCommand.php`
93102

94103
**Dependencies**:
104+
95105
- `ProductMetadataInterface` - For retrieving Magento version
96106
- `Escaper` - For HTML escaping output
97107

98108
**Usage**:
109+
99110
```bash
100111
bin/magento mageforge:system:check
101112
```
102113

103114
**Implementation Details**:
115+
104116
- Retrieves and displays:
105117
- PHP version
106118
- Node.js version (with comparison to latest LTS)
@@ -118,14 +130,17 @@ bin/magento mageforge:system:check
118130
**File**: `/src/Console/Command/VersionCommand.php`
119131

120132
**Dependencies**:
133+
121134
- `File` - Filesystem driver for reading files
122135

123136
**Usage**:
137+
124138
```bash
125139
bin/magento mageforge:version
126140
```
127141

128142
**Implementation Details**:
143+
129144
- Reads the current module version from `composer.lock`
130145
- Fetches the latest version from GitHub API
131146
- Displays both versions for comparison
@@ -139,20 +154,24 @@ bin/magento mageforge:version
139154
**File**: `/src/Console/Command/Hyva/CompatibilityCheckCommand.php`
140155

141156
**Dependencies**:
157+
142158
- `CompatibilityChecker` - Main orchestrator service for scanning modules
143159

144160
**Usage**:
161+
145162
```bash
146163
bin/magento mageforge:hyva:compatibility:check [options]
147164
```
148165

149166
**Aliases**:
167+
150168
- `m:h:c:c`
151169
- `hyva:check`
152170

153171
**Options**:
172+
154173
- `--show-all` / `-a` - Show all modules including compatible ones
155-
- `--third-party-only` / `-t` - Check only third-party modules (exclude Magento_* modules)
174+
- `--third-party-only` / `-t` - Check only third-party modules (exclude Magento\_\* modules)
156175
- `--include-vendor` - Include Magento core modules in scan (default: third-party only)
157176
- `--detailed` / `-d` - Show detailed file-level issues for incompatible modules
158177

@@ -165,6 +184,7 @@ bin/magento m:h:c:c
165184
```
166185

167186
The menu allows you to select:
187+
168188
- ☐ Show all modules including compatible ones
169189
- ☐ Show only incompatible modules (default behavior)
170190
- ☐ Include Magento core modules (default: third-party only)
@@ -176,6 +196,7 @@ Use **Space** to toggle options, **Enter** to confirm and start the scan.
176196
Without any flags, the command scans **third-party modules only** (excludes `Magento_*` modules but includes vendor third-party like Hyva, PayPal, Mollie, etc.).
177197

178198
**Examples**:
199+
179200
```bash
180201
# Basic scan (third-party modules only - DEFAULT)
181202
bin/magento m:h:c:c
@@ -194,6 +215,7 @@ bin/magento mageforge:hyva:compatibility:check --detailed
194215
```
195216

196217
**Implementation Details**:
218+
197219
- Scans module directories for JS, XML, and PHTML files
198220
- Detects incompatibility patterns:
199221
- **Critical Issues**:
@@ -221,26 +243,30 @@ bin/magento mageforge:hyva:compatibility:check --detailed
221243

222244
**Detected Patterns**:
223245

224-
*JavaScript Files (.js)*:
246+
_JavaScript Files (.js)_:
247+
225248
- `define([` - RequireJS module definition
226249
- `require([` - RequireJS dependency loading
227250
- `ko.observable` / `ko.observableArray` / `ko.computed` - Knockout.js
228251
- `$.ajax` / `jQuery.ajax` - jQuery AJAX
229252
- `mage/` - Magento RequireJS module references
230253

231-
*XML Files (.xml)*:
254+
_XML Files (.xml)_:
255+
232256
- `<uiComponent` - UI Component declarations
233257
- `component="uiComponent"` - UI Component references
234258
- `component="Magento_Ui/js/` - Magento UI JS components
235259
- `<referenceBlock.*remove="true"` - Block removals
236260

237-
*PHTML Files (.phtml)*:
261+
_PHTML Files (.phtml)_:
262+
238263
- `data-mage-init=` - Magento JavaScript initialization
239264
- `x-magento-init` - Magento 2.4+ JavaScript initialization
240265
- `$(.*).` - jQuery DOM manipulation patterns
241266
- `require([` - RequireJS in templates
242267

243268
**Recommendations Provided**:
269+
244270
- Check for Hyvä compatibility packages on hyva.io/compatibility
245271
- Review module vendor documentation for Hyvä support
246272
- Consider refactoring RequireJS/Knockout to Alpine.js
@@ -253,23 +279,27 @@ bin/magento mageforge:hyva:compatibility:check --detailed
253279
The commands rely on several services for their functionality:
254280

255281
### Hyvä Services
282+
256283
- `CompatibilityChecker`: Main orchestrator for Hyvä compatibility scanning
257284
- `ModuleScanner`: Recursively scans module directories for relevant files
258285
- `IncompatibilityDetector`: Pattern matching service for detecting incompatibilities
259286

260287
### Builder Services
288+
261289
- `BuilderPool`: Manages theme builders and selects appropriate builders for themes
262290
- `BuilderInterface`: Implemented by all theme builders
263291
- `MagentoStandard\Builder`: Processes standard Magento LESS-based themes
264292
- Various other builders for different theme types
265293

266294
### Theme Services
295+
267296
- `ThemeList`: Retrieves all installed themes
268297
- `ThemePath`: Resolves theme codes to filesystem paths
269298
- `StaticContentDeployer`: Handles static content deployment
270299
- `CacheCleaner`: Manages cache cleaning after theme builds
271300

272301
### Utility Services
302+
273303
- `DependencyChecker`: Verifies required dependencies for theme building
274304
- `GruntTaskRunner`: Executes Grunt tasks for theme compilation
275305

src/etc/di.xml

Lines changed: 56 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,61 @@
11
<?xml version="1.0"?>
22
<config
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"
55
>
6-
<type name="Magento\Framework\Console\CommandList">
7-
<arguments>
8-
<argument
9-
name="commands"
10-
xsi:type="array"
11-
>
12-
<item name="mageforge_system_version"
13-
xsi:type="object"
14-
>OpenForgeProject\MageForge\Console\Command\System\VersionCommand</item>
15-
<item name="mageforge_system_check"
16-
xsi:type="object"
17-
>OpenForgeProject\MageForge\Console\Command\System\CheckCommand</item>
18-
<item name="mageforge_theme_list"
19-
xsi:type="object"
20-
>OpenForgeProject\MageForge\Console\Command\Theme\ListCommand</item>
21-
<item name="mageforge_theme_build"
22-
xsi:type="object"
23-
>OpenForgeProject\MageForge\Console\Command\Theme\BuildCommand</item>
24-
<item name="mageforge_theme_watch"
25-
xsi:type="object"
26-
>OpenForgeProject\MageForge\Console\Command\Theme\WatchCommand</item>
27-
<item name="mageforge_hyva_compatibility_check"
28-
xsi:type="object"
29-
>OpenForgeProject\MageForge\Console\Command\Hyva\CompatibilityCheckCommand</item>
30-
</argument>
31-
</arguments>
32-
</type>
6+
<type name="Magento\Framework\Console\CommandList">
7+
<arguments>
8+
<argument
9+
name="commands"
10+
xsi:type="array"
11+
>
12+
<item name="mageforge_system_version"
13+
xsi:type="object"
14+
>
15+
OpenForgeProject\MageForge\Console\Command\System\VersionCommand</item>
16+
<item name="mageforge_system_check"
17+
xsi:type="object"
18+
>
19+
OpenForgeProject\MageForge\Console\Command\System\CheckCommand</item>
20+
<item name="mageforge_theme_list"
21+
xsi:type="object"
22+
>
23+
OpenForgeProject\MageForge\Console\Command\Theme\ListCommand</item>
24+
<item name="mageforge_theme_build"
25+
xsi:type="object"
26+
>
27+
OpenForgeProject\MageForge\Console\Command\Theme\BuildCommand</item>
28+
<item name="mageforge_theme_watch"
29+
xsi:type="object"
30+
>
31+
OpenForgeProject\MageForge\Console\Command\Theme\WatchCommand</item>
32+
<item name="mageforge_hyva_compatibility_check"
33+
xsi:type="object"
34+
>
35+
OpenForgeProject\MageForge\Console\Command\Hyva\CompatibilityCheckCommand</item>
36+
</argument>
37+
</arguments>
38+
</type>
3339

34-
<!-- Configure Theme Builder Pool -->
35-
<type name="OpenForgeProject\MageForge\Service\ThemeBuilder\BuilderPool">
36-
<arguments>
37-
<argument name="builders"
38-
xsi:type="array"
39-
>
40-
<item name="hyva"
41-
xsi:type="object"
42-
>OpenForgeProject\MageForge\Service\ThemeBuilder\HyvaThemes\Builder</item>
43-
<item name="standard"
44-
xsi:type="object"
45-
>OpenForgeProject\MageForge\Service\ThemeBuilder\MagentoStandard\Builder</item>
46-
<item name="tailwindcss"
47-
xsi:type="object"
48-
>OpenForgeProject\MageForge\Service\ThemeBuilder\TailwindCSS\Builder</item>
49-
</argument>
50-
</arguments>
51-
</type>
40+
<!-- Configure Theme Builder Pool -->
41+
<type name="OpenForgeProject\MageForge\Service\ThemeBuilder\BuilderPool">
42+
<arguments>
43+
<argument name="builders"
44+
xsi:type="array"
45+
>
46+
<item name="hyva"
47+
xsi:type="object"
48+
>
49+
OpenForgeProject\MageForge\Service\ThemeBuilder\HyvaThemes\Builder</item>
50+
<item name="standard"
51+
xsi:type="object"
52+
>
53+
OpenForgeProject\MageForge\Service\ThemeBuilder\MagentoStandard\Builder</item>
54+
<item name="tailwindcss"
55+
xsi:type="object"
56+
>
57+
OpenForgeProject\MageForge\Service\ThemeBuilder\TailwindCSS\Builder</item>
58+
</argument>
59+
</arguments>
60+
</type>
5261
</config>

0 commit comments

Comments
 (0)