umijs / father

NPM package development tool
MIT License
2.12k stars 273 forks source link

fix: ignore fs-specific tmp files in watch mode #729

Closed PeachScript closed 10 months ago

PeachScript commented 10 months ago

修复在某些特殊文件系统(比如 CloudIDE)中会 watch 到临时文件,然后尝试读取导致报错的问题,错误类似:

error - ENOENT: no such file or directory, open '/path/to/index.tsx.450062575'

解法是使用 awaitWriteFinish 等文件稳定了再触发事件,目前检测时间间隔设置得很小,所以对 watch 性能的影响应该较小

codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (b4bd2bb) 94.43% compared to head (645fc9e) 94.43%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #729 +/- ## ======================================= Coverage 94.43% 94.43% ======================================= Files 55 55 Lines 1562 1562 Branches 373 351 -22 ======================================= Hits 1475 1475 - Misses 82 87 +5 + Partials 5 0 -5 ``` | [Files](https://app.codecov.io/gh/umijs/father/pull/729?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=umijs) | Coverage Δ | | |---|---|---| | [src/builder/bundless/index.ts](https://app.codecov.io/gh/umijs/father/pull/729?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=umijs#diff-c3JjL2J1aWxkZXIvYnVuZGxlc3MvaW5kZXgudHM=) | `91.66% <100.00%> (ø)` | | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/umijs/father/pull/729/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=umijs)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.