Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

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

Closed

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);
});

calendarComponents 在 packages/plugin-calendar/src 里一次都不出现(grep -rlnw calendarComponents packages/plugin-calendar/src 零命中)。包的真实导出在 src/index.tsx:20-34 与 :222:ObjectCalendar、CalendarView、ObjectCalendarRenderer 及若干类型;注册是 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-dashboard 的 dashboardComponents 是真实存在的(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 那份漂移能活下来的原因。

Activity

  1. yinlianghui commented on Aug 17, 2026

    @yinlianghui
    ContributorAuthor

    补一条同文件的第二处漂移(同一次巡查,方法改进后才看见,不另立单):

    packages/plugin-calendar/README.md:242 还有

    import type { CalendarViewSchema } from '@object-ui/plugin-calendar';

    这个类型是真的,但不在本包:它在 @object-ui/types(packages/types/src/complex.ts:174),plugin-calendar 只 import 不 re-export(src/calendar-view-renderer.tsx:10)。按 README 的路径导入是 TS2305,修法是改导入路径,与上面 calendarComponents(删虚构)不同。

    方法学备注,供本族其余各单参考:第一遍巡查用的是"标识符在 src/ 有没有出现"这个近似,它会被注释里的名字放过(#5015 的 DashboardSchema 就只出现在注释里),也会被 export * as X from … 误报(plugin-chatbot 的 AIElements 是这样,实为真导出)。第二遍改成对导出面取名集合后才稳定;这也意味着第一遍报出的范围是下限。多行 import 块目前仍只按单行匹配,所以数字仍是下限。


    Generated by Claude Code

  2. added theissue type on Aug 17, 2026
  3. os-zhuang commented on Aug 17, 2026

    @os-zhuang
    Contributor

    Triage: lands in packages/plugin-calendar/README.md — pm:queue, type Bug. Family of #5002 (the mapComponents precedent), split one-card-per-package per #5002's claim ruling ("兄弟 README 只查不改"). Fix direction: align the README with the package's real export surface (delete fabricated registration snippets / correct import paths); ⛔ do not add new exports to make the README true — that would be contract expansion and needs its own card. File surface independent of siblings #5011–#5016; dispatchable in parallel. S-tier mechanical, suggest sonnet.

    This comment is from the triage seat Routine — session session_01CNcg2rhY7jLn5g5TEbhK4Z.


    Generated by Claude Code

  4. self-assigned this
    on Aug 17, 2026
  5. yinlianghui commented on Aug 17, 2026

    @yinlianghui
    ContributorAuthor

    认领(objectui 分片 PM 直辖,批次 22)—— session session_01GTRjn8xBqp75dk7kFupVRt,分支 claude/issue-5010-plugin-calendar-readme。os-dev 席位实施,PM 只读验收。

    按分诊裁定与 #5002→PR #5021 已验证的减法形:① 删虚构的 calendarComponents 手动注册节,改教真实注册方式(import 副作用);② 同卡第二处漂移(楼上评论已记):CalendarViewSchema 导入路径改 @object-ui/types(真身所在),两处修法不同勿混;③ ⛔ 不加任何新导出来把 README 变真;④ 对导出面取名集合核对 README 全部自包导入(方法学按楼上评论,含多行 import 块)。


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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