Monorepo management for opam overlays
1(** Opamverse registry management.
2
3 The registry is a git repository containing a [opamverse.toml] file that
4 lists community members and their monorepo URLs. *)
5
6(** {1 Types} *)
7
8type member = {
9 handle : string; (** Tangled handle (e.g., "alice.bsky.social") *)
10 name : string option; (** Display name (e.g., "Alice Smith") *)
11 monorepo : string; (** Git URL of the member's monorepo *)
12 monorepo_branch : string option;
13 (** Optional branch for monorepo (from URL#branch) *)
14 opamrepo : string; (** Git URL of the member's opam overlay repository *)
15 opamrepo_branch : string option;
16 (** Optional branch for opam repo (from URL#branch) *)
17}
18(** A registry member entry.
19
20 URLs may include a [#branch] suffix to specify a non-default branch. For
21 example, ["https://github.com/user/repo#develop"]. *)
22
23type t = {
24 name : string; (** Registry name *)
25 description : string option; (** Registry description *)
26 members : member list; (** List of registered members *)
27}
28(** The parsed registry contents. *)
29
30(** {1 Registry Operations} *)
31
32val default_url : string
33(** [default_url] is the default registry URL:
34 [https://tangled.org/eeg.cl.cam.ac.uk/opamverse]. *)
35
36val clone_or_pull :
37 sw:Eio.Switch.t ->
38 proc:_ Eio.Process.mgr ->
39 fs:Eio.Fs.dir_ty Eio.Path.t ->
40 config:Verse_config.t ->
41 unit ->
42 (t, string) result
43(** [clone_or_pull ~sw ~proc ~fs ~config ()] clones the registry if not present,
44 or pulls updates if it exists. Returns the parsed registry contents.
45
46 The registry is cloned to [config.registry_path].
47
48 @param proc Eio process manager.
49 @param fs Eio filesystem.
50 @param config Workspace configuration. *)
51
52val load : fs:Eio.Fs.dir_ty Eio.Path.t -> Fpath.t -> (t, string) result
53(** [load ~fs path] loads the registry from a [opamverse.toml] file.
54
55 @param fs Eio filesystem.
56 @param path Path to the [opamverse.toml] file. *)
57
58(** {1 Member Lookup} *)
59
60val member : t -> handle:string -> member option
61(** [member registry ~handle] finds a member by their handle. *)
62
63val members : t -> handles:string list -> member list
64(** [members registry ~handles] finds multiple members by their handles. Returns
65 only the members that were found. *)
66
67(** {1 Pretty Printing} *)
68
69val pp_member : member Fmt.t
70(** [pp_member] formats a registry member. *)
71
72val pp : t Fmt.t
73(** [pp] formats the registry. *)