hyva-cms-components-dump

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Hyvä CMS Component Dump

Hyvä CMS 组件导出

Locates all
components.json
files from Hyvä CMS modules and outputs a merged JSON object containing all component definitions from active modules.
查找Hyvä CMS模块中的所有
components.json
文件,并输出包含所有已启用模块组件定义的合并JSON对象。

Usage

使用方法

Important: Execute this script from the Magento project root directory.
Run the dump script:
bash
php <skill_path>/scripts/dump_cms_components.php
Where
<skill_path>
is the directory containing this SKILL.md file (e.g.,
.claude/skills/hyva-cms-components-dump
).
Output format: A single JSON object containing all merged CMS component definitions.
重要提示: 请从Magento项目根目录执行此脚本。
运行导出脚本:
bash
php <skill_path>/scripts/dump_cms_components.php
其中
<skill_path>
是包含此SKILL.md文件的目录(例如:
.claude/skills/hyva-cms-components-dump
)。
输出格式: 一个包含所有合并后CMS组件定义的JSON对象。

How It Works

工作原理

  1. Reads module configuration from
    app/etc/config.php
    to get the ordered list of modules
  2. Filters active modules - only modules with value
    1
    are included (disabled modules are skipped)
  3. Locates components.json files in:
    • app/code/{Vendor}/{Module}/etc/hyva_cms/components.json
    • vendor/{vendor-name}/{package-name}/*/etc/hyva_cms/components.json
  4. Maps paths to module names by reading each module's
    etc/module.xml
  5. Merges JSON objects in module load order as declared in
    config.php
  6. Outputs the result as formatted JSON
  1. 读取模块配置:从
    app/etc/config.php
    获取模块的有序列表
  2. 过滤已启用模块:仅包含值为
    1
    的模块(跳过禁用模块)
  3. 查找components.json文件:位置包括:
    • app/code/{Vendor}/{Module}/etc/hyva_cms/components.json
    • vendor/{vendor-name}/{package-name}/*/etc/hyva_cms/components.json
  4. 映射路径到模块名称:通过读取每个模块的
    etc/module.xml
    来实现
  5. 合并JSON对象:按照
    config.php
    中声明的模块加载顺序进行合并
  6. 输出结果:格式化为JSON输出

Module Load Order

模块加载顺序

Components are merged in the exact order modules appear in
app/etc/config.php
. Later modules can override components from earlier modules by using the same component key.
组件将严格按照
app/etc/config.php
中模块的出现顺序进行合并。后续模块可以通过使用相同的组件键来覆盖之前模块的组件。

Example 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
<!-- Copyright © Hyvä Themes https://hyva.io. All rights reserved. Licensed under OSL 3.0 -->
此技能可用于:
  • 调试CMS编辑器中可用的组件
  • 在创建新组件后验证组件注册情况
  • 检查模块之间的组件名称冲突
  • 导出组件定义用于文档编写
<!-- Copyright © Hyvä Themes https://hyva.io. All rights reserved. Licensed under OSL 3.0 -->