Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: improve TS definition syntax #26

Merged
merged 1 commit into from
Oct 12, 2024

Conversation

Wxh16144
Copy link
Member

试图解决:ant-design/ant-design#51171

问题过程:

发现 antd 的构建产物是有问题的:ref: https://npmmirror.com/package/antd/files/es/theme/util/genStyleUtils.d.ts?version=5.21.3#L6
image

追踪构建产物,发现是 cssinjs-utils 的构建产物长这样:https://npmmirror.com/package/@ant-design/cssinjs-utils/files/es/util/genStyleUtils.d.ts?version=1.1.0#L67-L68

image

上面这个 cssinjs-utils 的构建产物很奇怪,不缺定是不是 tsc 的问题还是 father 构建的问题。 @PeachScript 大佬有空可以帮忙看看,

解决方案

改用 Partial<Record<>> 代替 { [key in xxx]: xxx }. 方案。

最后 cssinjs-utils 的构建产物长这样:
image

能解决 antd 侧构建出来的内容缺少类型定义

Copy link

codecov bot commented Oct 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.71%. Comparing base (4d829bf) to head (20ae058).
Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #26      +/-   ##
==========================================
+ Coverage   84.00%   84.71%   +0.71%     
==========================================
  Files          11       11              
  Lines         300      301       +1     
  Branches       73       80       +7     
==========================================
+ Hits          252      255       +3     
+ Misses         48       46       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@afc163 afc163 merged commit 59ac605 into ant-design:master Oct 12, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants