yireo / magento2-theme-override-checker
N/A
0.0.5
2024-09-12 12:39 UTC
Requires
- ext-dom: *
- magento/framework: ^101.0.1|^101.1|^102.0|^103.0
- sebastian/diff: ^1.0 || ^2.0 || ^3.0 || ^4.0 || ^5.0
- symfony/finder: ^4.0 || ^5.0 || ^6.0
This package is auto-updated.
Last update: 2024-09-12 12:39:45 UTC
README
这是一个用于查找给定 Magento 主题(例如 Magento/luma
)所有文件的 Magento 模块,将找到的文件与父主题(和/或模块)进行比较,并返回是否存在差异。
当前状态:测试版,可用于测试
安装
composer require yireo/magento2-theme-override-checker:@dev bin/magento module:enable Yireo_ThemeOverrideChecker
使用方法
列出所有可能的覆盖项,对于不必要的覆盖项(无更改)给出警告,当行不同时显示红色警告
bin/magento yireo:theme-overrides:check Magento/luma
列出特定文件的特定覆盖详细情况
bin/magento yireo:theme-overrides:show Magento/luma web/jquery.js bin/magento yireo:theme-overrides:show Magento/blank web/css/source/_theme.less
列出当前版本与父主题版本之间的差异
bin/magento yireo:theme-overrides:diff Magento/luma web/css/source/_theme.less
常见问题解答
这是如何工作的?
AmpersandHQ 开发了一个出色的工具 ampersand-magento2-upgrade-patch-helper 来检查当前项目的状态。这包括扫描主题中的覆盖文件。然而,它不会报告实际覆盖文件的含义。例如,覆盖 XML 布局文件是好事还是坏事?覆盖 JavaScript 文件类有多少行被归类为不良实践?
待办事项
- 支持多个父主题
- 使 DifferFactory 中的
contextLines
可配置 - 改进建议器
- 具有数十行差异的 XML 布局文件是可以的
- XML 覆盖文件是危险的
- 具有数十行差异的 PHTML / JS / CSS 文件是危险的
- Markdown 和文本文件可以是相同的
- SVG 文件可以完全不同