Skip to content

plugin-calendar README 教的 calendarComponents 手动注册 API 不存在 —— 照抄即抛 #5010

Description

@yinlianghui

发现于 #5002 的实施(plugin-map README 重写)。Filed unassigned, not claiming.

现象

packages/plugin-calendar/README.md:106-112 的 "Manual Registration" 一节教:

import{calendarComponents}from'@object-ui/plugin-calendar';Object.entries(calendarComponents).forEach(([type,component])=>{ComponentRegistry.register(type,component);});

calendarComponentspackages/plugin-calendar/src一次都不出现(grep -rlnw calendarComponents packages/plugin-calendar/src 零命中)。包的真实导出在 src/index.tsx:20-34:222:ObjectCalendarCalendarViewObjectCalendarRenderer 及若干类型;注册是 import 的副作用。

照抄这段拿到 undefined,Object.entries(undefined) 直接抛 TypeError —— 也就是说这一节不是"渲染结果不对",而是根本跑不起来。

同族(共 7 个包)

#5002 是同一段复制品在 plugin-map 上的实例(mapComponents)。实施 #5002 时顺手把 19 个 packages/plugin-*/README.md 的自包导入名与各自 src/ 粗对了一遍,命中 7 个包:

  • *Components 手动注册虚构:calendar(本单)、form、gantt、grid、view
  • 类型导入虚构:dashboard(MetricCardSchema)、report(ReportBuilder / registerDrillHandler / ScheduleConfig)

#5002 认领评论的裁定「兄弟 README 只查不改」,各包各立一单,本单只覆盖 plugin-calendar。

值得记一笔:plugin-dashboarddashboardComponents真实存在的(src/index.tsx:338),所以这一族不能按名字模式批量断言,必须逐包对导出。

复核方式

grep -n "calendarComponents" packages/plugin-calendar/README.md
grep -rlnw "calendarComponents" packages/plugin-calendar/src # 零命中
grep -n "^export" packages/plugin-calendar/src/index.tsx

分级

交 PM 分诊。今天没有门禁看得到包内 README 的 API 断言(check-doc-links 只解析链接,check-doc-component-types 只扫 content/docs),这也是 #5002 那份漂移能活下来的原因。

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdocumentationImprovements or additions to documentationpm:queue

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions