Skip to content
Source
Sign inSign up
TanStack/cli

fix(cli): clean up failed watcher rebuilds #556

Mergedtannerlinsleymerged 1 commit intomain fromrefs/pull/556/headmerged by tannerlinsley

Showing 4 changed files with 61 additions and 10 deletions (loading 1).

x
0 of 4 viewed, 4 left
5 additions and 0 deletions.changeset/watch-failed-build-cleanup.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/cli': patch
+---
+​
+Remove temporary generation directories after failed dev-watch rebuilds as well as successful rebuilds.
9 additions and 9 deletionspackages/cli/src/dev-watch.tsModified
View file
@@ -304,15 +304,6 @@
this.lastSyncedSourceFiles = new Set(syncResult.sourceFiles)
​
- // Clean up temp directory after sync is complete
- try {
- await fs.promises.rm(this.tempDir, { recursive: true, force: true })
- } catch (cleanupError) {
- this.log.warning(
- `Failed to clean up temp directory: ${cleanupError instanceof Error ? cleanupError.message : String(cleanupError)}`,
- )
- }
-​
const elapsed = Date.now() - startTime
​
// Build tree-style summary
@@ -438,6 +429,15 @@
`Build #${buildId} failed: ${error instanceof Error ? error.message : String(error)}`,
} finally {
+ if (this.tempDir) {