fn new(
        repo_root: AbsoluteSystemPathBuf,
        writer: CookieWriter,
    ) -> Result<Self, package_manager::Error> {
        let (package_discovery_tx, cookie_tx, package_discovery_lazy) =
            CookiedOptionalWatch::new(writer);
        let invalidation_paths = INVALIDATION_PATHS
            .iter()
            .map(|p| repo_root.join_component(p))
            .collect();
        Ok(Self {
            repo_root,
            invalidation_paths,
            package_discovery_tx,
            package_discovery_lazy,
            cookie_tx,
            next_version: AtomicUsize::new(0),
        })
    }
Creates a new instance of PackageDiscovery. This will start a task that
performs the initial discovery using the `backup_discovery` of your
choice, and then listens to file system events to keep the package
data up to date.
crates/turborepo-filewatch/src/package_watcher.rs