def resolve_package_dependencies
      compile_dependency_tree
      definite_versions = resolve_tree
      specifier_map = map_specifiers_to_versions

      refs, dirs = {}, {}
      definite_versions.each do |v|
        package = v =~ Lyp::PACKAGE_RE && $1

        specifier_map[package].each_key {|s| refs[s] = package}
        dirs[package] = File.dirname(available_packages[v].path)
      end

      {
        user_file: @user_file,
        definite_versions: definite_versions,
        package_refs: refs,
        package_dirs: dirs,
        preload: @opts[:ext_require]
      }
    end
def resolve_package_dependencies
      compile_dependency_tree
      definite_versions = resolve_tree
      specifier_map = map_specifiers_to_versions

      refs, dirs = {}, {}
      definite_versions.each do |v|
        package = v =~ Lyp::PACKAGE_RE && $1

        specifier_map[package].each_key {|s| refs[s] = package}
        dirs[package] = File.dirname(available_packages[v].path)
      end

      {
        user_file: @user_file,
        definite_versions: definite_versions,
        package_refs: refs,
        package_dirs: dirs,
        preload: @opts[:ext_require]
      }
    end
Resolving package dependencies involves two stages:
 1. Create a dependency tree from user files and packages
 2. Resolve the dependency tree into a list of specific package versions