Skip to content

Add ResolveDeps for end-to-end dependency resolution#3

Open
andrew wants to merge 2 commits intomainfrom
add-resolve-deps
Open

Add ResolveDeps for end-to-end dependency resolution#3
andrew wants to merge 2 commits intomainfrom
add-resolve-deps

Conversation

@andrew
Copy link
Copy Markdown
Contributor

@andrew andrew commented Mar 27, 2026

Adds ResolveDeps() which creates a temporary project, adds dependencies using git-pkgs/managers, runs the manager's resolve command, and parses the output into a normalized dependency graph.

The flow branches on CapInit support. Managers with init (npm, cargo, bundler, etc.) get Init() then Add() for each dep. Managers without it (pip, maven, sbt, pub, mix, lein) get a hand-written manifest, then Install(). Both paths converge on Resolve() and the registered parser.

New public API:

  • ResolveDeps(ctx, manager, deps) - full init/add/resolve/parse pipeline
  • Managers() - list registered parser names
  • EcosystemForManager(name) - get ecosystem for a manager
  • InputDep{Name, Version} - input dependency type

Depends on git-pkgs/managers#14 for CapInit, Init(), and AddOptions.Version. Pinned to effbf8f on that branch.

Tested with npm (express@4.21.2, verifies transitive dep tree). Manifest writers have unit tests for each format with and without deps.

@andrew andrew force-pushed the add-resolve-deps branch 5 times, most recently from d30d092 to 326c4eb Compare March 27, 2026 14:39
@andrew andrew force-pushed the add-resolve-deps branch 2 times, most recently from ac82c74 to 8a6461a Compare March 27, 2026 15:21
Adds ResolveDeps() which creates a temporary project, adds dependencies
using the managers library (init + add), runs resolution, and parses the
output into a normalized dependency graph.

Also adds Managers() and EcosystemForManager() helpers for discovering
registered parsers.
@andrew andrew force-pushed the add-resolve-deps branch from 8a6461a to 8cfe901 Compare March 27, 2026 15:23
These managers lost CapInit in git-pkgs/managers because their new
commands create subdirectories rather than scaffolding in-place. They
now route through the writeManifest fallback alongside pip/maven/sbt.

- pubspec.yaml: name + sdk constraint + dependencies map
- mix.exs: minimal Mix.Project module with deps/0
- project.clj: defproject with org.clojure/clojure always present

Bumps git-pkgs/managers to effbf8f (init capability constants fixed,
AddOptions.Version wired through).
@andrew andrew marked this pull request as ready for review April 13, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant