Skip to main content

Module deps

Module deps 

Source
Expand description

Depth-1 dependency resolution at install time (GH #727, Phase 3).

A package may declare PackageDependency entries (SemVer ranges). On pack install / addon add, the direct dependencies of the root package are resolved against the registry index and installed alongside it — one consent surface listing everything that will land.

Depth-1 is deliberate (issue non-goal: no transitive graphs): only the root’s own dependencies resolve; a dependency’s dependencies do not. That keeps resolution O(deps), makes cycles impossible beyond self-reference (which is refused), and keeps the consent prompt honest — nothing installs that was not listed.

Determinism: given the same registry index, resolution always picks the highest non-yanked version matching the range — and repeated installs short-circuit offline via the lockfile + local store (already_satisfied).

Structs§

ResolvedDep
One resolved direct dependency, ready to download.

Functions§

already_satisfied
The resolved dependency when name@version-satisfying-req is already pinned in the lockfile and present in the local store — the offline-reproducible fast path: a second pack install touches no network for satisfied dependencies.
locked_version
Version of name pinned in the project lockfile, if any.
parse_version_req
Parse a SemVer range. An empty/* requirement means “any version”.
pick_highest_match
Highest non-yanked version matching req. Non-SemVer versions in the index are skipped (they can never match a range).
resolve_dependencies
Resolve the direct, non-optional dependencies in deps (declared by the root package whose scoped reference is root_name) against the registry at base. Fails on: unscoped names, self-dependency, invalid ranges, and ranges with no installable match — a partially-resolved install is worse than a refused one.
resolve_one
Resolve a single declared dependency against the registry index.