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

fix: dts may lost if another dts has error in last time #717

Merged
merged 1 commit into from
Sep 19, 2023

Conversation

PeachScript
Copy link
Member

@PeachScript PeachScript commented Sep 19, 2023

修复前序 d.ts 编译失败时部分 d.ts 丢失的问题。

原因是 father 启用了 ts 的 incremental 特性,它会自动增量编译文件,即便前序 d.ts 编译时部分源代码的类型有误,在第二次编译时它也会尽可能少地重新编译文件;father 会用持久缓存对这些不再重复编译的 d.ts 做补齐,但缓存写入逻辑仅在不存在类型诊断错误时才会执行,和 ts 的 incremental 行为不一致,最终导致产物中丢失部分 d.ts 文件。

解法是把写缓存的逻辑提前到检查类型诊断错误之前,无论如何都写入缓存。

cc @zombieJ

@codecov
Copy link

codecov bot commented Sep 19, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (b8a7a79) 94.39% compared to head (4f11e18) 94.39%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #717   +/-   ##
=======================================
  Coverage   94.39%   94.39%           
=======================================
  Files          55       55           
  Lines        1551     1551           
  Branches      369      367    -2     
=======================================
  Hits         1464     1464           
+ Misses         87       82    -5     
- Partials        0        5    +5     
Files Changed Coverage Δ
src/builder/bundless/dts/index.ts 98.63% <100.00%> (ø)

... and 2 files with indirect coverage changes

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

@PeachScript PeachScript merged commit af0dbd5 into master Sep 19, 2023
9 checks passed
@delete-merged-branch delete-merged-branch bot deleted the hotfix/dts-lost-if-last-time-error branch September 19, 2023 08:29
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.

1 participant