fix: extract embedded shared component props - #213
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthrough本次变更扩展 API 提取器,支持递归解析本地 ChangesAPI 提取与验证
v5 浮层属性文档
v6 组件与浮层文档
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #213 +/- ##
=======================================
Coverage 99.69% 99.69%
=======================================
Files 40 40
Lines 2599 2599
Branches 801 801
=======================================
Hits 2591 2591
Misses 8 8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 17
🧹 Nitpick comments (1)
scripts/extractors/__tests__/props.test.ts (1)
89-209: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win补充递归 embed 和循环引用的回归测试。
当前 fixture 只验证一级
<embed>。它不能验证嵌套共享文件会被展开,也不能验证循环引用会安全终止。让共享文件再嵌入一个属性文件,并让该属性文件引用上层文件。断言嵌套属性只出现一次,且
extractProps正常返回。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/extractors/__tests__/props.test.ts` around lines 89 - 209, 扩展现有 extractProps 回归测试的 fixture:让 sharedProps 文件嵌入另一个属性文件,并让该属性文件反向引用上层共享文件,覆盖嵌套 embed 与循环引用场景。更新期望结果,断言嵌套属性仅展开一次且不会因循环引用重复或失控,同时保留现有属性、重复字段及子组件断言,确认 extractProps 能正常返回。
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@data/v5.23.4.json`:
- Around line 13890-13930: Update the Popconfirm API metadata defaults for
cancelText, disabled, icon, okText, and okType from "-" to Cancel, false, the
ExclamationCircle icon, OK, and primary respectively, matching antd 5.23.4.
In `@data/v5.24.9.json`:
- Around line 13936-13984: 更新 Popconfirm 元数据中
cancelText、disabled、icon、okText、okType 和 showCancel 的 default 值,分别记录为
`Cancel`、false、<ExclamationCircle />、`OK`、`primary` 和 true,替换当前的 `-`,其余字段保持不变。
In `@data/v5.25.4.json`:
- Around line 14171-14218: 更新 Popconfirm 元数据中
cancelText、disabled、icon、okText、okType 和 showCancel 的 default 字段,分别恢复为
Cancel、false、<ExclamationCircle />、OK、primary 和 true;仅修改这些属性的默认值,保持其他描述和字段不变。
In `@data/v5.26.7.json`:
- Around line 14183-14194: 在 Popconfirm 属性定义中恢复默认值:将
cancelText、disabled、icon、okText、okType 和 showCancel 分别设置为
Cancel、false、<ExclamationCircle />、OK、primary 和 true,替换当前的 "-" 占位值。
In `@data/v5.27.6.json`:
- Around line 14242-14289: Update the Popconfirm API entries for cancelText,
disabled, icon, okText, okType, and showCancel to use their actual defaults:
`Cancel`, false, <ExclamationCircle />, `OK`, `primary`, and true respectively,
while leaving the existing descriptions unchanged.
In `@data/v5.28.1.json`:
- Around line 14235-14283: Update the Popconfirm metadata entries for
cancelText, disabled, icon, okText, okType, and showCancel to use the upstream
v5.28.1 default values: "Cancel", "false", "<ExclamationCircle />", "OK",
"`primary`", and "true", respectively, replacing each "-" placeholder.
In `@data/v6.0.1.json`:
- Around line 16174-16199: 更新 Popover
属性提取器的共享属性合并逻辑:合并组件专属属性与共享属性时,若名称已存在于组件专属记录中,则跳过对应共享记录,并优先保留组件专属的非空字段。仅过滤共享属性中的重复项,不要去重组件专属表内合法的同名条目,确保
classNames 和 styles 各只输出一次。
- Around line 19416-19419: 更新 data/v6.0.1.json 中 width 配置项的
descriptionZh,将其改为与英文 “Set the width of title” 及当前 number | string
类型一致的标题宽度说明,移除段落占位图和数组行为描述。
In `@data/v6.1.4.json`:
- Around line 19450-19454: Update the descriptionZh field for
SkeletonTitleProps.width to describe the title placeholder width, removing the
incorrect paragraph-placeholder wording and all array-specific behavior.
- Around line 16258-16263: Remove the duplicate classNames property from the
Popover props metadata, retaining the existing definition in the earlier props
entry. Update the extraction/merge deduplication logic to enforce uniqueness by
property name so repeated classNames entries are not emitted in generated API
metadata or documentation.
In `@data/v6.2.3.json`:
- Around line 16230-16235: Remove the later duplicate Popover semantic-property
entries for classNames and styles, retaining the earlier definitions. Update the
merge/generation logic to deduplicate entries by name so regeneration does not
reintroduce these duplicate API records.
- Around line 19489-19492: 更新 width 配置项的
descriptionZh,使其仅描述标题占位图的宽度,并移除数组及按行宽度相关表述;保持与 type 为 number | string 及英文
description 的语义一致。
In `@data/v6.4.5.json`:
- Around line 20874-20875: 删除该条目中的 since 字段,并移除 descriptionZh
行末的逗号;未标注版本时保持字段省略,不要替换为空字符串或连字符。
In `@data/v6.5.3.json`:
- Around line 21166-21167: 删除 active 条目中的 since 字段,不要保留 "-"
占位值;确保该条目在没有上游版本标签时省略 since 元数据。
In `@data/v6.json`:
- Around line 21166-21167: 删除 data/v6.json 中该条目值为 "-" 的 since
字段;上游未标注版本时省略字段,不要保留占位符。
- Around line 18036-18041: Remove the duplicate styles property entry from the
Popover props definition in components[42], keeping only one complete styles
record with its existing metadata and description so the generated documentation
lists the property once.
In `@scripts/extractors/props.ts`:
- Around line 234-266: Update readMarkdownWithEmbeds to resolve both rootDir and
filePath with fs.realpathSync before path.relative checks and cycle detection,
so symlinked embeds outside the root are rejected. Use the canonical resolved
file path for subsequent existence, reading, recursion, and stack tracking while
preserving the existing empty-string behavior for invalid or cyclic references.
---
Nitpick comments:
In `@scripts/extractors/__tests__/props.test.ts`:
- Around line 89-209: 扩展现有 extractProps 回归测试的 fixture:让 sharedProps
文件嵌入另一个属性文件,并让该属性文件反向引用上层共享文件,覆盖嵌套 embed
与循环引用场景。更新期望结果,断言嵌套属性仅展开一次且不会因循环引用重复或失控,同时保留现有属性、重复字段及子组件断言,确认 extractProps
能正常返回。
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8238f26c-9a36-49cd-b2f6-b7d590b80ff6
⛔ Files ignored due to path filters (1)
src/__tests__/snapshots/__snapshots__/changelog.test.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (19)
data/v5.22.7.jsondata/v5.23.4.jsondata/v5.24.9.jsondata/v5.25.4.jsondata/v5.26.7.jsondata/v5.27.6.jsondata/v5.28.1.jsondata/v5.29.3.jsondata/v5.jsondata/v6.0.1.jsondata/v6.1.4.jsondata/v6.2.3.jsondata/v6.3.7.jsondata/v6.4.5.jsondata/v6.5.3.jsondata/v6.jsonscripts/extractors/__tests__/props.test.tsscripts/extractors/props.tsspec.md
背景
antd 的 Tooltip、Popover、Popconfirm 等组件通过 dumi embed 复用共享 API 表,当前提取器未展开嵌入文件,导致 antd info Tooltip --version 6.4.5 漏掉共享属性。
改动
验证
Summary by CodeRabbit
width、classNames、styles和动画相关文档。