Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4a2676a
Initial plan
Copilot Jan 9, 2026
623b29a
Add mageforge:static:clean command implementation
Copilot Jan 9, 2026
ca26e55
Update documentation for static:clean command
Copilot Jan 9, 2026
d83dcce
Refactor: Extract theme name parsing logic to reduce duplication
Copilot Jan 9, 2026
d9bf58d
Remove invalid shortcode from README for static:clean command
Copilot Jan 9, 2026
06588ca
Add cleaning of var/page_cache, var/tmp and generated directories
Copilot Jan 9, 2026
5596b42
Fix cleanGenerated to track successful deletions properly
Copilot Jan 9, 2026
59b813c
✨ feat: enhance CleanCommand with multi-theme support and dry-run option
dermatz Jan 9, 2026
5b53b10
✨ feat: add dry-run option and aliases for static clean command
dermatz Jan 9, 2026
dba8dc0
✨ feat: add mageforge:static:clean command and multi-theme support
dermatz Jan 9, 2026
5945960
Update docs/commands.md
dermatz Jan 9, 2026
486cc76
Update CHANGELOG.md
dermatz Jan 9, 2026
0212e95
Update src/Console/Command/Static/CleanCommand.php
dermatz Jan 9, 2026
aee96de
Update README.md
dermatz Jan 9, 2026
1ca04dc
Update .github/workflows/magento-compatibility.yml
dermatz Jan 9, 2026
76a6cc4
Update .github/workflows/magento-compatibility.yml
dermatz Jan 9, 2026
0b32c93
Update src/Console/Command/Static/CleanCommand.php
dermatz Jan 9, 2026
3dc4e9f
Update src/Console/Command/Static/CleanCommand.php
dermatz Jan 9, 2026
76acfb4
Update docs/commands.md
dermatz Jan 9, 2026
4588bc8
Update src/Console/Command/Static/CleanCommand.php
dermatz Jan 9, 2026
e8d6a2f
Fix getCachedEnvironmentVariables to use class-level static variable
Copilot Jan 9, 2026
aa6c24b
🔧 fix: correct alias for MageForge Static Clean command
dermatz Jan 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/magento-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,15 @@ jobs:
echo "Test MageForge Theme List command:"
bin/magento mageforge:theme:list

echo "Test MageForge Static Clean command with dry-run:"
bin/magento mageforge:static:clean --all --dry-run

echo "Test MageForge Static Clean aliases:"
bin/magento mageforge:static:clean --all --dry-run
echo "Test MageForge Static Clean aliases:"
bin/magento m:st:c --help
bin/magento frontend:clean --help

- name: Test Summary
run: |
echo "MageForge module compatibility test with Magento ${{ matrix.magento-version }} completed"
Expand Down Expand Up @@ -255,6 +264,13 @@ jobs:
echo "Test MageForge Theme List command:"
bin/magento mageforge:theme:list

echo "Test MageForge Static Clean command with dry-run:"
bin/magento mageforge:static:clean --all --dry-run

echo "Test MageForge Static Clean alias:"
bin/magento m:st:c --help
bin/magento frontend:clean --help

- name: Test Summary
run: |
echo "MageForge module compatibility test with Magento 2.4.8 completed"
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ All notable changes to this project will be documented in this file.

## UNRELEASED

### Added

- feat: add `mageforge:static:clean` command for comprehensive cache and generated files cleanup
- feat: add interactive multi-theme selection for static:clean command using Laravel Prompts
- feat: add `--all` option to clean all themes at once
- feat: add `--dry-run` option to preview what would be cleaned without deleting
- feat: add command alias `frontend:clean` for quick access
- feat: add CI/CD tests for static:clean command in compatibility workflow

### Changed

- refactor: split complex executeCommand method into smaller, focused methods to reduce cyclomatic complexity
- docs: update copilot-instructions.md with CI/CD integration guidelines for new commands

## Latest Release

### [0.2.2] - 2025-06-05
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Please ensure that your Magento installation meets this requirement before insta
| `mageforge:theme:list` | Lists all available themes | `m:t:l` |
| `mageforge:theme:build` | Builds selected themes (CSS/TailwindCSS) | `m:t:b`, `frontend:build` |
| `mageforge:theme:watch` | Starts watch mode for theme development | `m:t:w`, `frontend:watch` |
| `mageforge:static:clean` | Clean static files, cache and generated files for a theme | `frontend:clean` |

---

Expand Down
38 changes: 36 additions & 2 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,41 @@ bin/magento mageforge:theme:watch [--theme=THEME]

---

### 4. SystemCheckCommand (`mageforge:system:check`)
### 4. CleanCommand (`mageforge:static:clean`)

**Purpose**: Cleans var/view_preprocessed, pub/static, var/page_cache, var/tmp and generated directories for specific theme.

**File**: `/src/Console/Command/Static/CleanCommand.php`

**Dependencies**:
- `Filesystem` - Magento filesystem component for file operations
- `ThemeList` - Service to retrieve theme information
- `ThemePath` - Service to resolve theme paths

**Usage**:
```bash
bin/magento mageforge:static:clean [<themename>]
```

**Implementation Details**:
- If no theme name is provided:
- In interactive terminals, displays an interactive prompt to select the theme to clean
- In non-interactive environments, prints the list of available themes and exits, requiring an explicit theme name
- Validates that the specified theme exists
- Cleans the following directories for the theme:
- `var/view_preprocessed/css/frontend/Vendor/theme`
- `var/view_preprocessed/source/frontend/Vendor/theme`
- `pub/static/frontend/Vendor/theme`
- Additionally cleans these global directories:
- `var/page_cache/*`
- `var/tmp/*`
- `generated/*`
- Displays a summary of cleaned directories
- Returns success status code

---

### 5. SystemCheckCommand (`mageforge:system:check`)

**Purpose**: Displays system information relevant to Magento development.

Expand All @@ -111,7 +145,7 @@ bin/magento mageforge:system:check

---

### 5. VersionCommand (`mageforge:version`)
### 6. VersionCommand (`mageforge:version`)

**Purpose**: Displays the current and latest version of the MageForge module.

Expand Down
Loading