writing-registry-meta

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
  • The meta file must be in JSON format.
  • The meta file must be located in the same directory as the registry file.
  • The meta file must have the same name as the registry file, but with a .meta.json extension.
  • The meta file must contain the following fields:
    • name
      : The registry name in kebab-case, same as file name without extension.
    • title
      : The name of the registry usually the same as the component name in Pascal case.
    • type
      : always
      "registry:item"
      .
    • description
      : IMPORTANT! Describe the registry in detail to help LLM understand what the interface looks like and its purpose. Start with "Integrated [library name]" if using third-party libraries (e.g., Base UI). Focus on visible features (buttons, labels, states) and accessibility. DO NOT list individual Material UI components.
    • meta
      : Additional metadata about the registry
      • category
        : one of "primitive", "ai"
      • previewClassName
        : The extra class name to add to the preview container.
IMPORTANT! after writing/updating a meta file, run
pnpm registry:build
to populate the registry index.
  • 元文件必须为JSON格式。
  • 元文件必须与registry文件位于同一目录中。
  • 元文件的名称必须与registry文件相同,但扩展名为.meta.json。
  • 元文件必须包含以下字段:
    • name
      :registry的kebab-case格式名称,与不带扩展名的文件名相同。
    • title
      :registry的名称,通常与Pascal case格式的组件名称相同。
    • type
      :固定为
      "registry:item"
    • description
      :重要!详细描述registry以帮助LLM理解其接口外观和用途。如果使用第三方库(例如Base UI),请以“Integrated [library name]”开头。重点关注可见功能(按钮、标签、状态)和可访问性。请勿列出单个Material UI组件。
    • meta
      :关于registry的额外元数据
      • category
        :取值为"primitive"或"ai"之一
      • previewClassName
        :要添加到预览容器的额外类名。
重要提示!编写/更新元文件后,运行
pnpm registry:build
来填充registry索引。