Monorepo management for opam overlays
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

toml: rename from tomlt, split raw AST into Value submodule

Drops the "t" suffix and follows the value/codec/toml/core pattern
(jsont.json_base style). The internal raw TOML module moves from
[Toml] to [Value] (file: lib/value.ml, was lib/toml.ml) to make room
for the top-level Toml facade (file: lib/toml.ml, was lib/tomlt.ml).

External callers now reach the raw AST through [Toml.Value.X] instead
of [Tomlt.Toml.X]. Every downstream reference updated in lockstep.

+38 -38
+1 -1
dune-project
··· 19 19 (eio (>= 1.2)) 20 20 (eio_main (>= 1.2)) 21 21 (git (>= 0.1.0)) 22 - (tomlt (>= 0.1.0)) 22 + (toml (>= 0.1.0)) 23 23 (xdge (>= 0.1.0)) 24 24 (opam-file-format (>= 2.1.0)) 25 25 (cmdliner (>= 1.3.0))
+17 -17
lib/config.ml
··· 14 14 15 15 let branch t = t.branch 16 16 17 - let codec : t Tomlt.t = 18 - Tomlt.( 17 + let codec : t Toml.t = 18 + Toml.( 19 19 Table.( 20 20 obj (fun branch -> { branch }) 21 21 |> opt_mem "branch" string ~enc:(fun c -> c.branch) ··· 130 130 | None -> s 131 131 else s 132 132 133 - let fpath_codec : Fpath.t Tomlt.t = 134 - Tomlt.map 133 + let fpath_codec : Fpath.t Toml.t = 134 + Toml.map 135 135 ~dec:(fun s -> 136 136 let s = expand_tilde s in 137 137 match Fpath.of_string s with Ok p -> p | Error (`Msg m) -> failwith m) 138 - ~enc:Fpath.to_string Tomlt.string 138 + ~enc:Fpath.to_string Toml.string 139 139 140 - let paths_codec : paths Tomlt.t = 141 - Tomlt.( 140 + let paths_codec : paths Toml.t = 141 + Toml.( 142 142 Table.( 143 143 obj (fun mono src verse -> 144 144 { ··· 170 170 type workspace_section = { w_root : Fpath.t } 171 171 type identity_section = { i_handle : string; i_knot : string } 172 172 173 - let workspace_codec : workspace_section Tomlt.t = 174 - Tomlt.( 173 + let workspace_codec : workspace_section Toml.t = 174 + Toml.( 175 175 Table.( 176 176 obj (fun w_root -> { w_root }) 177 177 |> mem "root" fpath_codec ~enc:(fun w -> w.w_root) 178 178 |> finish)) 179 179 180 - let identity_codec : identity_section Tomlt.t = 181 - Tomlt.( 180 + let identity_codec : identity_section Toml.t = 181 + Toml.( 182 182 Table.( 183 183 obj (fun i_handle i_knot -> { i_handle; i_knot }) 184 184 |> mem "handle" string ~enc:(fun i -> i.i_handle) ··· 186 186 |> finish)) 187 187 188 188 (* Codec for the [packages] table which contains subtree->override mappings *) 189 - let packages_table_codec : (string * Package_config.t) list Tomlt.t = 190 - Tomlt.( 189 + let packages_table_codec : (string * Package_config.t) list Toml.t = 190 + Toml.( 191 191 Table.( 192 192 obj (fun pkgs -> pkgs) 193 193 |> keep_unknown ~enc:(fun pkgs -> pkgs) (Mems.assoc Package_config.codec) 194 194 |> finish)) 195 195 196 - let codec : t Tomlt.t = 197 - Tomlt.( 196 + let codec : t Toml.t = 197 + Toml.( 198 198 Table.( 199 199 obj (fun workspace identity packages paths -> 200 200 let packages = Option.value ~default:[] packages in ··· 283 283 let eio_path = Eio.Path.(fs / path_str) in 284 284 match Eio.Path.kind ~follow:true eio_path with 285 285 | `Regular_file -> ( 286 - try Ok (Tomlt_eio.decode_path_exn codec ~fs path_str) with 286 + try Ok (Toml_eio.decode_path_exn codec ~fs path_str) with 287 287 | Failure msg -> Error (Invalid { path; msg }) 288 288 | exn -> Error (Io_error { path; msg = Printexc.to_string exn })) 289 289 | _ -> Error (Not_found path) ··· 307 307 (* Ensure XDG config directory exists *) 308 308 let dir_path = Eio.Path.(fs / Fpath.to_string dir) in 309 309 (try Eio.Path.mkdirs ~perm:0o755 dir_path with Eio.Io _ -> ()); 310 - Tomlt_eio.encode_path codec t ~fs (Fpath.to_string path); 310 + Toml_eio.encode_path codec t ~fs (Fpath.to_string path); 311 311 Ok () 312 312 with Eio.Io _ as e -> Error (Printexc.to_string e) 313 313
+2 -2
lib/dune
··· 3 3 (public_name monopam) 4 4 (libraries 5 5 eio 6 - tomlt 7 - tomlt.eio 6 + toml 7 + toml.eio 8 8 xdge 9 9 opam-file-format 10 10 fmt
+9 -9
lib/sources_registry.ml
··· 83 83 # presence of a sources.toml file inside open-mono/. 84 84 *) 85 85 86 - let origin_codec : origin Tomlt.t = 87 - Tomlt.map 86 + let origin_codec : origin Toml.t = 87 + Toml.map 88 88 ~dec:(function 89 89 | "fork" -> Fork 90 90 | "join" -> Join 91 91 | s -> Fmt.failwith "Invalid origin: %s (expected 'fork' or 'join')" s) 92 92 ~enc:(function Fork -> "fork" | Join -> "join") 93 - Tomlt.string 93 + Toml.string 94 94 95 - let entry_codec : entry Tomlt.t = 96 - Tomlt.( 95 + let entry_codec : entry Toml.t = 96 + Toml.( 97 97 Table.( 98 98 obj (fun source upstream branch reason entry_origin ref_ path -> 99 99 { ··· 114 114 |> opt_mem "path" string ~enc:(fun (e : entry) -> e.path) 115 115 |> finish)) 116 116 117 - let codec : t Tomlt.t = 118 - Tomlt.( 117 + let codec : t Toml.t = 118 + Toml.( 119 119 Table.( 120 120 obj (fun origin entries -> { origin; entries }) 121 121 |> opt_mem "origin" string ~enc:(fun t -> t.origin) ··· 127 127 let eio_path = Eio.Path.(fs / path_str) in 128 128 match Eio.Path.kind ~follow:true eio_path with 129 129 | `Regular_file -> ( 130 - try Ok (Tomlt_eio.decode_path_exn codec ~fs path_str) with 130 + try Ok (Toml_eio.decode_path_exn codec ~fs path_str) with 131 131 | Failure msg -> err_invalid msg 132 132 | exn -> err_load exn) 133 133 | _ -> Ok empty (* File doesn't exist, return empty registry *) ··· 136 136 let save ~fs path t = 137 137 let path_str = Fpath.to_string path in 138 138 try 139 - Tomlt_eio.encode_path codec t ~fs path_str; 139 + Toml_eio.encode_path codec t ~fs path_str; 140 140 Ok () 141 141 with exn -> Error (Printexc.to_string exn) 142 142
+8 -8
lib/verse_registry.ml
··· 50 50 opamrepo = "https://github.com/alice/opam-repo" 51 51 *) 52 52 53 - let member_codec : member Tomlt.t = 54 - Tomlt.( 53 + let member_codec : member Toml.t = 54 + Toml.( 55 55 Table.( 56 56 obj (fun handle name monorepo_raw opamrepo_raw -> 57 57 let monorepo, monorepo_branch = parse_url_with_branch monorepo_raw in ··· 67 67 68 68 type registry_info = { r_name : string; r_description : string option } 69 69 70 - let registry_info_codec : registry_info Tomlt.t = 71 - Tomlt.( 70 + let registry_info_codec : registry_info Toml.t = 71 + Toml.( 72 72 Table.( 73 73 obj (fun r_name r_description -> { r_name; r_description }) 74 74 |> mem "name" string ~enc:(fun r -> r.r_name) 75 75 |> opt_mem "description" string ~enc:(fun r -> r.r_description) 76 76 |> finish)) 77 77 78 - let codec : t Tomlt.t = 79 - Tomlt.( 78 + let codec : t Toml.t = 79 + Toml.( 80 80 Table.( 81 81 obj (fun registry members -> 82 82 { ··· 104 104 let path_str = Fpath.to_string path in 105 105 Logs.info (fun m -> m "Loading registry from path: %s" path_str); 106 106 try 107 - let registry = Tomlt_eio.decode_path_exn codec ~fs path_str in 107 + let registry = Toml_eio.decode_path_exn codec ~fs path_str in 108 108 Logs.info (fun m -> 109 109 m "Registry loaded: %d members" (List.length registry.members)); 110 110 Ok registry ··· 123 123 let save ~fs path registry = 124 124 let path_str = Fpath.to_string path in 125 125 try 126 - Tomlt_eio.encode_path codec registry ~fs path_str; 126 + Toml_eio.encode_path codec registry ~fs path_str; 127 127 Ok () 128 128 with Eio.Io _ as e -> Error (Printexc.to_string e) 129 129
+1 -1
monopam.opam
··· 16 16 "eio" {>= "1.2"} 17 17 "eio_main" {>= "1.2"} 18 18 "git" {>= "0.1.0"} 19 - "tomlt" {>= "0.1.0"} 19 + "toml" {>= "0.1.0"} 20 20 "xdge" {>= "0.1.0"} 21 21 "opam-file-format" {>= "2.1.0"} 22 22 "cmdliner" {>= "1.3.0"}