HexSolver.Registry implementation for npm packages.
Bridges the npm registry to hex_solver's PubGrub dependency resolver. Packuments are cached in an ETS table for the duration of a resolution.
Summary
Functions
@spec clear_cache() :: :ok
Clear the packument cache.
@spec resolve( %{required(String.t()) => String.t()}, keyword() ) :: {:ok, %{required(String.t()) => String.t()}} | {:error, String.t()}
Resolve a set of root dependencies to exact versions.
Uses a two-phase approach:
- Try flat resolution with PubGrub
- On conflict, identify conflicting packages and retry with those excluded, tracking them as nested dependencies
Returns {:ok, %{name => version}} where the map includes
a :nested key with nested package info when version conflicts exist.