hyva-cms-components-dump
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHyvä CMS Component Dump
Hyvä CMS 组件导出
Locates all files from Hyvä CMS modules and outputs a merged JSON object containing all component definitions from active modules.
components.json查找Hyvä CMS模块中的所有文件,并输出包含所有已启用模块组件定义的合并JSON对象。
components.jsonUsage
使用方法
Important: Execute this script from the Magento project root directory.
Run the dump script:
bash
php <skill_path>/scripts/dump_cms_components.phpWhere is the directory containing this SKILL.md file (e.g., ).
<skill_path>.claude/skills/hyva-cms-components-dumpOutput format: A single JSON object containing all merged CMS component definitions.
重要提示: 请从Magento项目根目录执行此脚本。
运行导出脚本:
bash
php <skill_path>/scripts/dump_cms_components.php其中是包含此SKILL.md文件的目录(例如:)。
<skill_path>.claude/skills/hyva-cms-components-dump输出格式: 一个包含所有合并后CMS组件定义的JSON对象。
How It Works
工作原理
- Reads module configuration from to get the ordered list of modules
app/etc/config.php - Filters active modules - only modules with value are included (disabled modules are skipped)
1 - Locates components.json files in:
app/code/{Vendor}/{Module}/etc/hyva_cms/components.jsonvendor/{vendor-name}/{package-name}/*/etc/hyva_cms/components.json
- Maps paths to module names by reading each module's
etc/module.xml - Merges JSON objects in module load order as declared in
config.php - Outputs the result as formatted JSON
- 读取模块配置:从获取模块的有序列表
app/etc/config.php - 过滤已启用模块:仅包含值为的模块(跳过禁用模块)
1 - 查找components.json文件:位置包括:
app/code/{Vendor}/{Module}/etc/hyva_cms/components.jsonvendor/{vendor-name}/{package-name}/*/etc/hyva_cms/components.json
- 映射路径到模块名称:通过读取每个模块的来实现
etc/module.xml - 合并JSON对象:按照中声明的模块加载顺序进行合并
config.php - 输出结果:格式化为JSON输出
Module Load Order
模块加载顺序
Components are merged in the exact order modules appear in . Later modules can override components from earlier modules by using the same component key.
app/etc/config.php组件将严格按照中模块的出现顺序进行合并。后续模块可以通过使用相同的组件键来覆盖之前模块的组件。
app/etc/config.phpExample Output
示例输出
json
{
"text_block": {
"label": "Text Block",
"category": "Content",
"template": "Hyva_CmsBase::elements/text-block.phtml",
...
},
"feature_card": {
"label": "Feature Card",
"category": "Elements",
"template": "Custom_Module::elements/feature-card.phtml",
...
}
}json
{
"text_block": {
"label": "Text Block",
"category": "Content",
"template": "Hyva_CmsBase::elements/text-block.phtml",
...
},
"feature_card": {
"label": "Feature Card",
"category": "Elements",
"template": "Custom_Module::elements/feature-card.phtml",
...
}
}Integration with Other Skills
与其他技能的集成
This skill can be used to:
- Debug which components are available in the CMS editor
- Verify component registration after creating new components
- Check for component name conflicts between modules
- Export component definitions for documentation
此技能可用于:
- 调试CMS编辑器中可用的组件
- 在创建新组件后验证组件注册情况
- 检查模块之间的组件名称冲突
- 导出组件定义用于文档编写