Skip to content

Commit 9b48c48

Browse files
committed
refactor: update Magento requirement to 2.4.7 and enhance custom theme builder documentation
1 parent 4cf92a8 commit 9b48c48

File tree

3 files changed

+84
-9
lines changed

3 files changed

+84
-9
lines changed

.github/workflows/magento-compatibility.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ jobs:
1717
include:
1818
- magento-version: '2.4.7'
1919
php-version: '8.3'
20-
- magento-version: '2.4.6'
21-
php-version: '8.2'
20+
#- magento-version: '2.4.6'
21+
# php-version: '8.2'
2222

2323
services:
2424
mysql:

README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,38 @@ MageForge is a Magento 2 module designed to assist frontend developers in stream
1212

1313
## Magento Requirements
1414

15-
MageForge requires Magento 2.4.6 or higher.
15+
MageForge requires Magento 2.4.7 or higher.
1616
Please ensure that your Magento installation meets this requirement before installation.
1717

1818
## Features
1919

20+
### Supported Theme-Types 🎨
21+
22+
| Theme Type | Support Status |
23+
|------------|----------------|
24+
| 🎯 Magento Standard | ✅ Fully Supported |
25+
| 🚀 Hyvä | ✅ Fully Supported |
26+
| 🔄 Hyvä Fallback | ✅ Fully Supported |
27+
| 🎨 Custom TailwindCSS (no Hyvä) | ✅ Fully Supported |
28+
| 💼 Avanta B2B | ✅ Fully Supported |
29+
| 🥰 Your Custom Theme | [Create your own Builder](./docs/custom_theme_builders.md) |
30+
31+
---
32+
2033
### Available Commands
2134

2235
| Command | Description |
2336
|---------------------------|-------------------------------------------------------------|
2437
| `mageforge:version` | Shows current and latest version of the module |
25-
| `mageforge:system-check` | Checks system requirements (PHP, MySQL, Node.js, etc.) |
38+
| `mageforge:system-check` | Get system information (OS, PHP, Database, Node.js, etc.) |
2639
| `mageforge:theme:list` | Lists all available themes |
2740
| `mageforge:theme:build` | Builds selected themes (CSS/TailwindCSS) |
2841
| `mageforge:theme:watch` | Starts watch mode for theme development |
2942

3043
---
3144

32-
## Installation
45+
## Getting Started
46+
### Installation
3347

3448
1. Add the repository to your `composer.json`:
3549
```json

docs/custom_theme_builders.md

Lines changed: 65 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,62 @@ The ThemeBuilder architecture consists of the following components:
1414
2. **BuilderPool**: Manages the available builders and selects the appropriate builder for a theme
1515
3. **Concrete Builder Implementations**: Specialized builders for different theme types
1616

17+
## Directory Structure for Your Custom Module
18+
19+
To create your own ThemeBuilder, you'll need to set up a custom Magento 2 module with the following structure:
20+
21+
```
22+
app/code/YourCompany/YourModule/
23+
├── Console/
24+
│ └── Command/
25+
│ └── [Optional custom commands]
26+
├── Service/
27+
│ └── ThemeBuilder/
28+
│ └── YourBuilder/
29+
│ └── Builder.php
30+
├── etc/
31+
│ ├── di.xml
32+
│ └── module.xml
33+
└── registration.php
34+
```
35+
36+
This is a minimal structure for your module. You can add more files and directories as needed for your specific implementation.
37+
1738
## Creating Your Own ThemeBuilder
1839

19-
### Step 1: Create a New Builder Class
40+
### Step 1: Create the Module Structure
2041

21-
Create a new class in one of your modules or in a custom MageForge plugin. The structure should look like this:
42+
First, create the basic module structure as shown above:
43+
44+
1. Create the module directory: `app/code/YourCompany/YourModule/`
45+
2. Create a registration.php file:
46+
```php
47+
<?php
48+
use Magento\Framework\Component\ComponentRegistrar;
49+
50+
ComponentRegistrar::register(
51+
ComponentRegistrar::MODULE,
52+
'YourCompany_YourModule',
53+
__DIR__
54+
);
55+
```
56+
57+
3. Create a module.xml file in the etc directory:
58+
```xml
59+
<?xml version="1.0"?>
60+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
61+
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
62+
<module name="YourCompany_YourModule" setup_version="1.0.0">
63+
<sequence>
64+
<module name="OpenForgeProject_MageForge"/>
65+
</sequence>
66+
</module>
67+
</config>
68+
```
69+
70+
### Step 2: Create a New Builder Class
71+
72+
Create a new Builder class in `app/code/YourCompany/YourModule/Service/ThemeBuilder/YourBuilder/Builder.php`:
2273

2374
```php
2475
<?php
@@ -121,9 +172,9 @@ class Builder implements BuilderInterface
121172
}
122173
```
123174

124-
### Step 2: Register Your Builder in the DI System
175+
### Step 3: Register Your Builder in the DI System
125176

126-
To make your builder available to MageForge, you need to register it in Magento's Dependency Injection system. Create a `di.xml` file in your module:
177+
Create a `di.xml` file in `app/code/YourCompany/YourModule/etc/`:
127178

128179
```xml
129180
<?xml version="1.0"?>
@@ -139,6 +190,16 @@ To make your builder available to MageForge, you need to register it in Magento'
139190
</config>
140191
```
141192

193+
### Step 4: Install and Enable Your Module
194+
195+
After creating all the required files, you need to enable your module:
196+
197+
1. Run `bin/magento module:enable YourCompany_YourModule`
198+
2. Run `bin/magento setup:upgrade`
199+
3. Run `bin/magento cache:clean`
200+
201+
After these steps, your custom ThemeBuilder will be available and integrated with MageForge.
202+
142203
## Implementation Details
143204

144205
### The detect() Method

0 commit comments

Comments
 (0)