Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 8, 2026

Implements command to clean var/view_preprocessed/* and pub/static/* directories for specified themes.

Implementation

  • CleanCommand (src/Console/Command/Static/CleanCommand.php)

    • Accepts theme codes as arguments (single or multiple)
    • Removes <area>/<theme> directories from var/view_preprocessed/ and pub/static/
    • Supports both frontend and adminhtml areas via constant
    • Lists available themes when invoked without arguments
  • DI Registration (src/etc/di.xml)

    • Added command to Magento's CommandList
  • Documentation

    • Updated README.md commands table with mageforge:static:clean (shortcode: m:st:c)
    • Added detailed command documentation to docs/commands.md

Usage

# Clean single theme
bin/magento mageforge:static:clean Magento/luma

# Clean multiple themes
bin/magento mageforge:static:clean Magento/luma Vendor/custom-theme

# Show available themes
bin/magento mageforge:static:clean

Security & Performance

  • Caches theme list to avoid redundant fetching during validation
  • Permission checks (readable/writable) before file operations
  • Race condition handling via file existence checks post-operation
  • Proper error propagation without suppression

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/magento/magento-coding-standard/zipball/f24dd98f46a98cd7081e4648b19299c27db35264
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/RMm2Gx /usr/bin/composer create-project magento/magento-coding-standard --stability=dev /tmp/magento-coding-standard (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Feature-Request: clean up command</issue_title>
<issue_description>Clean var/view_preprocessed/* and pub/static/* folder for the specific theme which will be build

Commandname:

  • mageforge:static:clean
  • mageforge:static:clean themename </issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes OpenForgeProject/mageforge#53

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 7 commits January 8, 2026 14:29
Co-authored-by: dermatz <6103201+dermatz@users.noreply.github.com>
Co-authored-by: dermatz <6103201+dermatz@users.noreply.github.com>
Co-authored-by: dermatz <6103201+dermatz@users.noreply.github.com>
Co-authored-by: dermatz <6103201+dermatz@users.noreply.github.com>
Co-authored-by: dermatz <6103201+dermatz@users.noreply.github.com>
…ace conditions

Co-authored-by: dermatz <6103201+dermatz@users.noreply.github.com>
…on handling

Co-authored-by: dermatz <6103201+dermatz@users.noreply.github.com>
Copilot AI changed the title [WIP] Add clean command for static files Add mageforge:static:clean command to remove theme static files Jan 8, 2026
Copilot AI requested a review from dermatz January 8, 2026 14:42
@dermatz dermatz closed this Jan 9, 2026
@dermatz dermatz deleted the copilot/add-clean-command-feature branch January 9, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants