fn is_dependency(&self, package_name: &PackageNode) -> bool {
        self.internal_dependencies.contains(package_name)
            || self
                .unresolved_external_dependencies
                .is_some_and(|external_dependencies| {
                    external_dependencies.contains_key(package_name.as_package_name().as_str())
                })
            || self
                .package_json
                .dependencies
                .as_ref()
                .is_some_and(|dependencies| {
                    dependencies.contains_key(package_name.as_package_name().as_str())
                })
            || self
                .package_json
                .dev_dependencies
                .as_ref()
                .is_some_and(|dev_dependencies| {
                    dev_dependencies.contains_key(package_name.as_package_name().as_str())
                })
            || self
                .package_json
                .peer_dependencies
                .as_ref()
                .is_some_and(|peer_dependencies| {
                    peer_dependencies.contains_key(package_name.as_package_name().as_str())
                })
            || self
                .package_json
                .optional_dependencies
                .as_ref()
                .is_some_and(|optional_dependencies| {
                    optional_dependencies.contains_key(package_name.as_package_name().as_str())
                })
            || self
                .implicit_dependencies
                .contains_key(package_name.as_package_name().as_str())
            || self
                .global_implicit_dependencies
                .contains_key(package_name.as_package_name().as_str())
    }
Go through all the possible places a package could be declared to see if
it's a valid import. We don't use `oxc_resolver` because there are some
cases where you can resolve a package that isn't declared properly.
crates/turborepo-lib/src/boundaries/imports.rs