Skip to main content

Crate deps_core

Crate deps_core 

Source
Expand description

Core abstractions for deps-lsp.

This crate provides the foundational traits and utilities used across all ecosystem-specific implementations (Cargo, npm, PyPI, etc.).

§Architecture

deps-core defines:

  • Traits: Registry, Version, Metadata, Ecosystem, ParseResult
  • HTTP Cache: Shared caching layer with ETag/Last-Modified validation
  • Error Types: Unified error handling across all ecosystems

Re-exports§

pub use cache::BodyLimit;
pub use cache::CachedResponse;
pub use cache::HttpCache;
pub use deps_dev::DepsDevClient;
pub use deps_dev::ProvenanceStatus;
pub use deps_dev::ScorecardSummary;
pub use deps_dev::SupplyChainTrustSignal;
pub use ecosystem::Dependency;
pub use ecosystem::Ecosystem;
pub use ecosystem::EcosystemConfig;
pub use ecosystem::EcosystemId;
pub use ecosystem::ParseResult;
pub use ecosystem_registry::EcosystemRegistry;
pub use error::DepsError;
pub use error::FetchFailure;
pub use error::Result;
pub use freshness::DEFAULT_COOLDOWN_SECS;
pub use freshness::FreshnessSettings;
pub use freshness::PublishTime;
pub use freshness::format_relative_age;
pub use freshness::is_within_cooldown;
pub use json_ast::JsonAst;
pub use json_ast::JsonSection;
pub use json_ast::find_last_prop;
pub use lockfile::LockFileProvider;
pub use lockfile::ResolvedPackage;
pub use lockfile::ResolvedPackages;
pub use lockfile::ResolvedSource;
pub use lockfile::read_lockfile_content;
pub use lsp_helpers::DependencyOutcome;
pub use lsp_helpers::DependencyOutcomes;
pub use lsp_helpers::DiagnosticMessages;
pub use lsp_helpers::DiagnosticPolicy;
pub use lsp_helpers::DiagnosticSeverities;
pub use lsp_helpers::EcosystemFormatter;
pub use lsp_helpers::HOVER_RECENT_VERSIONS;
pub use lsp_helpers::LineOffsetTable;
pub use lsp_helpers::OsvNaming;
pub use lsp_helpers::PackageNaming;
pub use lsp_helpers::PackageRendering;
pub use lsp_helpers::PackageVersions;
pub use lsp_helpers::RequirementMatcher;
pub use lsp_helpers::RequirementResolution;
pub use lsp_helpers::RequirementStatus;
pub use lsp_helpers::SourcePolicy;
pub use lsp_helpers::UNSATISFIABLE_DIAGNOSTIC_CODE;
pub use lsp_helpers::VersionData;
pub use lsp_helpers::collect_update_all_edits;
pub use lsp_helpers::generate_code_actions as lsp_generate_code_actions;
pub use lsp_helpers::generate_code_lenses as lsp_generate_code_lenses;
pub use lsp_helpers::generate_hover as lsp_generate_hover;
pub use lsp_helpers::generate_inlay_hints as lsp_generate_inlay_hints;
pub use lsp_helpers::is_dot_segment;
pub use lsp_helpers::is_safe_maven_coordinate_segment;
pub use lsp_helpers::is_safe_package_name;
pub use lsp_helpers::is_safe_registry_url;
pub use lsp_helpers::is_safe_version_string;
pub use lsp_helpers::is_same_major_minor;
pub use lsp_helpers::position_in_range;
pub use lsp_helpers::requirement_is_unsatisfiable;
pub use lsp_helpers::warn_rejected_value;
pub use mtime_cache::DEFAULT_MAX_CACHED_FILES;
pub use mtime_cache::MAX_CACHED_FILE_BYTES;
pub use mtime_cache::MtimeFileCache;
pub use package::ConcreteVersion;
pub use package::InvalidPackageName;
pub use package::PackageName;
pub use package::VersionReq;
pub use parser::DependencySource;
pub use parser::LoadingState;
pub use parser::MAX_JSON_NESTING_DEPTH;
pub use parser::MAX_TOML_NESTING_DEPTH;
pub use parser::MAX_YAML_EXPANDED_BYTES;
pub use parser::MAX_YAML_NESTING_DEPTH;
pub use parser::check_json_nesting_depth;
pub use parser::check_toml_nesting_depth;
pub use parser::check_yaml_expansion;
pub use parser::check_yaml_nesting_depth;
pub use parser::parse_json_checked;
pub use registry::Deprecation;
pub use registry::Metadata;
pub use registry::Registry;
pub use registry::RemovalStatus;
pub use registry::Version;
pub use registry::find_latest_stable;
pub use registry::has_default_prerelease_marker;
pub use registry::hash_routing_key;
pub use registry::is_existence_wildcard;
pub use registry::is_existence_wildcard_str;
pub use registry::select_latest_for_existence;
pub use version_matcher::Pep440Matcher;
pub use version_matcher::SemverMatcher;
pub use version_matcher::VersionRequirementMatcher;
pub use version_matcher::extract_pypi_min_version;
pub use version_matcher::normalize_and_parse_version;
pub use version_matcher::normalize_operator_spacing;

Modules§

cache
completion
Core completion infrastructure for deps-lsp.
deps_dev
Supply-chain trust signal via deps.dev API v3.
ecosystem
ecosystem_registry
error
freshness
Release-freshness signal: publish-time tracking and cooldown-window checks.
fs_probe
Counted filesystem probe funnel, shared by every ecosystem crate’s config-file cache.
github
Shared GitHub tags-API client, used by every ecosystem that resolves package versions from GitHub repository tags rather than a dedicated package registry (deps-swift, deps-github-actions).
json_ast
Shared JSONC-AST helpers for recovering exact dependency source positions (#613).
lockfile
Lock file parsing abstractions.
lsp_helpers
Shared LSP response builders.
macros
Macro utilities for reducing boilerplate in ecosystem implementations.
mtime_cache
Generic per-path, mtime-gated file cache shared by every ecosystem config-file cache (deps-cargo’s .cargo/config.toml/$CARGO_HOME/config.toml, deps-npm’s .npmrc).
net_policy
Reachability policy for registry index URLs declared by a workspace file.
osv
OSV.dev vulnerability scanning.
package
Newtypes distinguishing package names, version requirement strings, and concrete resolved versions.
pagination
Generic paginated-fetch loop for a git-tags-shaped REST API returning per_page=100 pages.
parser
registry
secret
Generic “never surfaced via Debug/Display” wrapper for in-memory secrets.
test_util
Test fixtures and helpers shared across ecosystem crates.
version_matcher
Version requirement matching abstractions.

Macros§

impl_dependency
Implement the Dependency trait for a struct.
impl_metadata
Implement Metadata trait for a struct.
impl_parse_result
Implement ParseResult trait for a struct.
impl_version
Implement Version trait for a struct.