Commit 67ff6d2
authored
feat: Remove daemon from watch mode (#12175)
## Summary
Replaces the daemon gRPC IPC in `turbo watch` with in-process file
watching. All watcher components are instantiated directly in
`WatchClient`, eliminating the daemon as a dependency for watch mode.
- Introduces `OutputWatcher` trait to abstract output change tracking,
replacing `DaemonClient` in `RunCache`/`TaskCache`
- Builds the full watcher stack in-process: `FileSystemWatcher` →
`CookieWriter` → `GlobWatcher` + `PackageWatcher` → `HashWatcher` →
`PackageChangesWatcher`
- Pre-populates hash baselines at startup so build output writes don't
trigger spurious rebuilds
- Waits for active runs to complete before processing new change events,
preventing concurrent builds of the same package
- Makes TUI `start_task` resilient to out-of-order events from
concurrent runs
- Handles SIGINT as a clean exit (code 0) instead of propagating an
error
The daemon is still used by other consumers (`turbo daemon` CLI, LSP,
`turbo info`).
## Testing
Manually verified on the turborepo monorepo (24 packages):
- Initial build settles without spurious rebuilds
- File edits during builds are not lost
- Rapid successive edits are debounced
- Same-content writes don't trigger rebuilds
- Ctrl+C exits cleanly
- TUI stays alive across rebuilds
Automated: 11 E2E tests, 18 watch unit tests, 8 OutputWatcher trait
tests, 6 GlobWatcher delegation tests, 2 TUI start_task resilience tests
— all passing.1 parent 5e8fe42 commit 67ff6d2
File tree
9 files changed
+687
-266
lines changed- crates
- turborepo-lib/src
- cli
- run
- turborepo-run-cache
- src
- turborepo-ui/src/tui
- turborepo/tests
9 files changed
+687
-266
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1727 | 1727 | | |
1728 | 1728 | | |
1729 | 1729 | | |
1730 | | - | |
1731 | | - | |
1732 | | - | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
1733 | 1739 | | |
1734 | | - | |
1735 | | - | |
| 1740 | + | |
| 1741 | + | |
1736 | 1742 | | |
1737 | 1743 | | |
1738 | 1744 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
444 | | - | |
445 | | - | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
446 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
447 | 465 | | |
448 | 466 | | |
449 | 467 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
64 | | - | |
| 63 | + | |
65 | 64 | | |
66 | 65 | | |
67 | 66 | | |
68 | | - | |
| 67 | + | |
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
| |||
108 | 107 | | |
109 | 108 | | |
110 | 109 | | |
111 | | - | |
| 110 | + | |
112 | 111 | | |
113 | 112 | | |
114 | 113 | | |
| |||
118 | 117 | | |
119 | 118 | | |
120 | 119 | | |
121 | | - | |
122 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
| |||
471 | 473 | | |
472 | 474 | | |
473 | 475 | | |
474 | | - | |
| 476 | + | |
475 | 477 | | |
476 | 478 | | |
477 | 479 | | |
| |||
0 commit comments