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§
- Resolved
Dep - One resolved direct dependency, ready to download.
Functions§
- already_
satisfied - The resolved dependency when
name@version-satisfying-reqis already pinned in the lockfile and present in the local store — the offline-reproducible fast path: a secondpack installtouches no network for satisfied dependencies. - locked_
version - Version of
namepinned 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 isroot_name) against the registry atbase. 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.