@@ -56,7 +56,7 @@ type package_name =
5656
5757
5858
59- let runtime_package_name = " bs-platform "
59+
6060
6161
6262let (// ) = Filename. concat
@@ -70,7 +70,7 @@ let runtime_dir_of_module_system (ms : module_system ) =
7070let runtime_package_path
7171 (ms : module_system )
7272 js_file =
73- runtime_package_name // " lib" // runtime_dir_of_module_system ms // js_file
73+ ! Bs_version. package_name // " lib" // runtime_dir_of_module_system ms // js_file
7474
7575
7676type t =
@@ -86,6 +86,14 @@ let runtime_package_specs : t = {
8686 {module_system = NodeJS ; path = " lib/js" ; suffix = Js };
8787 ]
8888}
89+
90+ (* *
91+ populated by the command line
92+ *)
93+ let runtime_test_package_specs : t = {
94+ name = Pkg_runtime ;
95+ module_systems = []
96+ }
8997let same_package_by_name (x : t ) (y : t ) = x.name = y.name
9098
9199let is_runtime_package (x : t ) =
@@ -112,16 +120,10 @@ let empty : t =
112120 module_systems = []
113121 }
114122
115- let from_name (name : string ) =
116- if name = runtime_package_name then
117- {
118- name = Pkg_runtime ; module_systems = []
119- }
120- else
121- {
122- name = Pkg_normal name ;
123- module_systems = []
124- }
123+ let from_name (name : string ) : t = {
124+ name = Pkg_normal name ;
125+ module_systems = []
126+ }
125127
126128let is_empty (x : t ) =
127129 x.name = Pkg_empty
@@ -156,7 +158,7 @@ let dump_package_name fmt (x : package_name) =
156158 match x with
157159 | Pkg_empty -> Format. fprintf fmt " @empty_pkg@"
158160 | Pkg_normal s -> Format. pp_print_string fmt s
159- | Pkg_runtime -> Format. pp_print_string fmt runtime_package_name
161+ | Pkg_runtime -> Format. pp_print_string fmt " @runtime "
160162
161163let dump_packages_info
162164 (fmt : Format.formatter )
@@ -208,7 +210,7 @@ let query_package_infos
208210 compatible k.module_system module_system) with
209211 | Some k ->
210212 let rel_path = k.path in
211- let pkg_rel_path = runtime_package_name // rel_path in
213+ let pkg_rel_path = ! Bs_version. package_name // rel_path in
212214 Package_found
213215 {
214216 rel_path ;
@@ -221,7 +223,8 @@ let query_package_infos
221223
222224let get_js_path
223225 (x : t )
224- module_system
226+ (module_system : module_system )
227+ : string
225228 =
226229 match Ext_list. find_first x.module_systems (fun k ->
227230 compatible k.module_system module_system) with
0 commit comments