Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 7 additions & 7 deletions .github/workflows/magento-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ jobs:
bin/magento m:h:c:c --show-all --detailed

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

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

echo "Test Theme Name Suggestions (non-interactive):"
Expand All @@ -165,7 +165,7 @@ jobs:
bin/magento mageforge:theme:watch Magent/lum --help || echo "Expected failure - WatchCommand"

echo "Testing CleanCommand with invalid theme name:"
bin/magento mageforge:static:clean Magent/lum --dry-run || echo "Expected failure - CleanCommand"
bin/magento mageforge:theme:clean Magent/lum --dry-run || echo "Expected failure - CleanCommand"

echo "Testing TokensCommand with invalid theme name:"
bin/magento mageforge:hyva:tokens Magent/lum --help || echo "Expected failure - TokensCommand"
Expand Down Expand Up @@ -306,10 +306,10 @@ jobs:
bin/magento m:h:c:c --show-all --detailed

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

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

echo "Test Theme Name Suggestions (non-interactive):"
Expand All @@ -320,7 +320,7 @@ jobs:
bin/magento mageforge:theme:watch Magent/lum --help || echo "Expected failure - WatchCommand"

echo "Testing CleanCommand with invalid theme name:"
bin/magento mageforge:static:clean Magent/lum --dry-run || echo "Expected failure - CleanCommand"
bin/magento mageforge:theme:clean Magent/lum --dry-run || echo "Expected failure - CleanCommand"

echo "Testing TokensCommand with invalid theme name:"
bin/magento mageforge:hyva:tokens Magent/lum --help || echo "Expected failure - TokensCommand"
Expand Down
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ All notable changes to this project will be documented in this file.
- Detailed file-level issues with line numbers
- Exit code 1 for critical issues, 0 for success
- Command aliases: `m:h:c:c`, `hyva:check`
- 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 `mageforge:theme:clean` command for comprehensive cache and generated files cleanup
- feat: add interactive multi-theme selection for theme: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
- feat: add CI/CD tests for theme:clean command in compatibility workflow

#### Fixed

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Please ensure that your Magento installation meets this requirement before insta
| `mageforge:theme:watch` | Starts watch mode for theme development | `m:t:w`, `frontend:watch` |
| `mageforge:hyva:tokens` | Generate Hyvä design tokens (Hyvä themes only) | `m:h:t` |
| `mageforge:hyva:compatibility:check`| Check modules for Hyvä theme compatibility issues | `m:h:c:c`, `hyva:check` |
| `mageforge:static:clean` | Clean static files, cache and generated files for a theme | `m:st:c`,`frontend:clean` |
| `mageforge:theme:clean` | Clean theme static files and cache directories | `m:t:c`, `frontend:clean` |

---

Expand Down
6 changes: 3 additions & 3 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ bin/magento mageforge:theme:watch [--theme=THEME]

---

### 4. CleanCommand (`mageforge:static:clean`)
### 4. CleanCommand (`mageforge:theme: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`
**File**: `/src/Console/Command/Theme/CleanCommand.php`

**Dependencies**:

Expand All @@ -109,7 +109,7 @@ bin/magento mageforge:theme:watch [--theme=THEME]
**Usage**:

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

**Implementation Details**:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace OpenForgeProject\MageForge\Console\Command\Static;
namespace OpenForgeProject\MageForge\Console\Command\Theme;

use Laravel\Prompts\MultiSelectPrompt;
use Magento\Framework\App\Filesystem\DirectoryList;
Expand Down Expand Up @@ -46,12 +46,8 @@ public function __construct(
*/
protected function configure(): void
{
$this->setName($this->getCommandName('static', 'clean'))
->setDescription(
'Clean theme-specific static files (var/view_preprocessed, pub/static) '
. 'for selected themes and global cache directories '
. '(var/page_cache, var/tmp, generated)'
)
$this->setName($this->getCommandName('theme', 'clean'))
->setDescription('Clean theme static files and cache directories')
->addArgument(
'themeCodes',
InputArgument::IS_ARRAY,
Expand All @@ -69,7 +65,7 @@ protected function configure(): void
InputOption::VALUE_NONE,
'Show what would be cleaned without actually deleting anything'
)
->setAliases(['m:st:c', 'frontend:clean']);
->setAliases(['m:t:c', 'frontend:clean']);
}

/**
Expand Down Expand Up @@ -178,9 +174,9 @@ private function displayAvailableThemes(array $themes): void
}

$this->io->newLine();
$this->io->info('Usage: bin/magento mageforge:static:clean <theme-code> [<theme-code>...]');
$this->io->info(' bin/magento mageforge:static:clean --all');
$this->io->info('Example: bin/magento mageforge:static:clean Magento/luma');
$this->io->info('Usage: bin/magento mageforge:theme:clean <theme-code> [<theme-code>...]');
$this->io->info(' bin/magento mageforge:theme:clean --all');
$this->io->info('Example: bin/magento mageforge:theme:clean Magento/luma');
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
OpenForgeProject\MageForge\Console\Command\Theme\BuildCommand</item>
<item name="mageforge_theme_watch" xsi:type="object">
OpenForgeProject\MageForge\Console\Command\Theme\WatchCommand</item>
<item name="mageforge_static_clean" xsi:type="object">
OpenForgeProject\MageForge\Console\Command\Static\CleanCommand</item>
<item name="mageforge_theme_clean" xsi:type="object">
OpenForgeProject\MageForge\Console\Command\Theme\CleanCommand</item>
<item name="mageforge_hyva_compatibility_check" xsi:type="object">
OpenForgeProject\MageForge\Console\Command\Hyva\CompatibilityCheckCommand</item>
<item name="mageforge_theme_tokens" xsi:type="object">
Expand Down