Skip to content

fix(cli): cleanup writeTemp on dev server restart#1693

Merged
meteorlxy merged 3 commits intomainfrom
write-temp
Apr 1, 2026
Merged

fix(cli): cleanup writeTemp on dev server restart#1693
meteorlxy merged 3 commits intomainfrom
write-temp

Conversation

@Mister-Hope
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings March 19, 2026 02:45
@coveralls
Copy link
Copy Markdown

coveralls commented Mar 19, 2026

Pull Request Test Coverage Report for Build 23278477878

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 3 of 4 (75.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 75.172%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/cli/src/commands/dev/dev.ts 0 1 0.0%
Totals Coverage Status
Change from base Build 23145752120: -0.02%
Covered Lines: 737
Relevant Lines: 981

💛 - Coveralls

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses dev server restarts by adding a cleanup mechanism to the writeTemp utility so its internal cache can be cleared, and adds a regression test to ensure the cache reset causes unchanged content to be written again.

Changes:

  • Extend AppWriteTemp to include a cleanup() method and implement it in resolveAppWriteTemp() by clearing the internal cache.
  • Call app.writeTemp.cleanup() during vuepress dev restart.
  • Add a unit test covering “rewrite after cleanup” behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
packages/core/tests/app/resolveAppWriteTemp.spec.ts Adds a test asserting cleanup clears the cache so unchanged content is written again.
packages/core/src/types/app/utils.ts Changes AppWriteTemp from a function type to a callable interface with a cleanup() method.
packages/core/src/app/resolveAppWriteTemp.ts Attaches cleanup() to the writeTemp function and clears the internal cache map.
packages/cli/src/commands/dev/dev.ts Invokes app.writeTemp.cleanup() as part of the restart flow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/core/src/types/app/utils.ts Outdated
Comment thread packages/cli/src/commands/dev/dev.ts
Comment thread packages/core/src/types/app/utils.ts
Mister-Hope and others added 2 commits March 19, 2026 11:29
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@meteorlxy meteorlxy changed the title fix: cleanup writeTemp on dev server restart fix(cli): cleanup writeTemp on dev server restart Apr 1, 2026
@meteorlxy meteorlxy merged commit ab6eada into main Apr 1, 2026
21 checks passed
@meteorlxy meteorlxy deleted the write-temp branch April 1, 2026 04:14
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.

4 participants