crates/turborepo-filewatch/README.md
File watching utilities with cross-platform consistency. Provides watchers that consume file events and produce derived data like changed packages.
turborepo-filewatch
├── FileSystemWatcher
│ ├── macOS: FSEvents (custom impl)
│ ├── Linux: inotify (recursive)
│ └── Windows: ReadDirectoryChanges
├── PackageWatcher - maps file changes to packages
└── GlobWatcher - filters by glob patterns
Platform differences:
Event processing must be fast to avoid lag. The common pattern is: accumulate events in one thread, process in another. Uses tokio::sync::Notify or intervals to coordinate. A Lagged event indicates the receiver fell behind.