Skip to content

Commit be33cb6

Browse files
committed
(fix) Remove remaining references to bs_suffix in bsb
This gets everything compiling again, but we're far from done! 😫
1 parent 818777e commit be33cb6

File tree

7 files changed

+20
-29
lines changed

7 files changed

+20
-29
lines changed

jscomp/bsb/bsb_ninja_file_groups.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ let make_common_shadows package_specs dirname dir_index :
6060

6161
let emit_module_build (rules : Bsb_ninja_rule.builtin)
6262
(package_specs : Bsb_package_specs.t) (group_dir_index : Bsb_dir_index.t) oc
63-
~bs_suffix js_post_build_cmd namespace (module_info : Bsb_db.module_info) =
63+
js_post_build_cmd namespace (module_info : Bsb_db.module_info) =
6464
let has_intf_file = module_info.info = Ml_mli in
6565
let is_re = module_info.is_re in
6666
let filename_sans_extension = module_info.name_sans_extension in
@@ -90,7 +90,7 @@ let emit_module_build (rules : Bsb_ninja_rule.builtin)
9090
let output_cmi = output_filename_sans_extension ^ Literals.suffix_cmi in
9191
let output_cmj = output_filename_sans_extension ^ Literals.suffix_cmj in
9292
let output_js =
93-
Bsb_package_specs.get_list_of_output_js package_specs bs_suffix
93+
Bsb_package_specs.get_list_of_output_js package_specs
9494
output_filename_sans_extension
9595
in
9696
let common_shadows =
@@ -155,8 +155,8 @@ let emit_module_build (rules : Bsb_ninja_rule.builtin)
155155
~order_only_deps:[ output_d ] ~rule
156156

157157

158-
let handle_files_per_dir oc ~bs_suffix ~(rules : Bsb_ninja_rule.builtin)
159-
~package_specs ~js_post_build_cmd ~(files_to_install : Hash_set_string.t)
158+
let handle_files_per_dir oc ~(rules : Bsb_ninja_rule.builtin) ~package_specs
159+
~js_post_build_cmd ~(files_to_install : Hash_set_string.t)
160160
~(namespace : string option) (group : Bsb_file_groups.file_group) : unit =
161161
handle_generators oc group rules.customs;
162162
let installable =
@@ -168,7 +168,7 @@ let handle_files_per_dir oc ~bs_suffix ~(rules : Bsb_ninja_rule.builtin)
168168
Map_string.iter group.sources (fun module_name module_info ->
169169
if installable module_name then
170170
Hash_set_string.add files_to_install module_info.name_sans_extension;
171-
emit_module_build rules package_specs group.dir_index oc ~bs_suffix
172-
js_post_build_cmd namespace module_info)
171+
emit_module_build rules package_specs group.dir_index oc js_post_build_cmd
172+
namespace module_info)
173173

174174
(* pseuduo targets per directory *)

jscomp/bsb/bsb_ninja_file_groups.mli

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
val handle_files_per_dir :
2626
out_channel ->
27-
bs_suffix:bool ->
2827
rules:Bsb_ninja_rule.builtin ->
2928
package_specs:Bsb_package_specs.t ->
3029
js_post_build_cmd:string option ->

jscomp/bsb/bsb_ninja_gen.ml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ let output_static_resources (static_resources : string list) copy_rule oc =
7070

7171
let output_ninja_and_namespace_map ~per_proj_dir ~toplevel
7272
({
73-
bs_suffix;
7473
package_name;
7574
external_includes;
7675
bsc_flags;
@@ -195,17 +194,16 @@ let output_ninja_and_namespace_map ~per_proj_dir ~toplevel
195194
~has_postbuild:(js_post_build_cmd <> None)
196195
~has_ppx:(ppx_files <> []) ~has_pp:(pp_file <> None)
197196
~has_builtin:(built_in_dependency <> None)
198-
~reason_react_jsx ~bs_suffix ~digest generators
197+
~reason_react_jsx ~digest generators
199198
in
200199

201200
emit_bsc_lib_includes bs_dependencies bsc_lib_dirs external_includes namespace
202201
oc;
203202
output_static_resources static_resources rules.copy_resources oc;
204203
(* Generate build statement for each file *)
205204
Ext_list.iter bs_file_groups (fun files_per_dir ->
206-
Bsb_ninja_file_groups.handle_files_per_dir oc ~bs_suffix ~rules
207-
~js_post_build_cmd ~package_specs ~files_to_install ~namespace
208-
files_per_dir);
205+
Bsb_ninja_file_groups.handle_files_per_dir oc ~rules ~js_post_build_cmd
206+
~package_specs ~files_to_install ~namespace files_per_dir);
209207

210208
Ext_option.iter namespace (fun ns ->
211209
let namespace_dir = per_proj_dir // Bsb_config.lib_bs in

jscomp/bsb/bsb_ninja_rule.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ type builtin = {
8989
}
9090

9191
let make_custom_rules ~(has_gentype : bool) ~(has_postbuild : bool)
92-
~(has_ppx : bool) ~(has_pp : bool) ~(has_builtin : bool) ~(bs_suffix : bool)
92+
~(has_ppx : bool) ~(has_pp : bool) ~(has_builtin : bool)
9393
~(reason_react_jsx : Bsb_config_types.reason_react_jsx option)
9494
~(digest : string) ~(refmt : string option)
9595
(* set refmt path when needed *)
@@ -100,7 +100,6 @@ let make_custom_rules ~(has_gentype : bool) ~(has_postbuild : bool)
100100
let mk_ml_cmj_cmd ~read_cmi ~is_dev ~postbuild : string =
101101
Buffer.clear buf;
102102
Buffer.add_string buf "$bsc -nostdlib $g_pkg_flg -color always";
103-
if bs_suffix then Buffer.add_string buf " -bs-suffix";
104103
if read_cmi then Buffer.add_string buf " -bs-read-cmi";
105104
if is_dev then Buffer.add_string buf " $g_dev_incls";
106105
Buffer.add_string buf " $g_lib_incls";

jscomp/bsb/bsb_ninja_rule.mli

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ val make_custom_rules :
5656
has_ppx:bool ->
5757
has_pp:bool ->
5858
has_builtin:bool ->
59-
bs_suffix:bool ->
6059
reason_react_jsx:Bsb_config_types.reason_react_jsx option ->
6160
digest:string ->
6261
refmt:string option ->

jscomp/bsb/bsb_package_specs.ml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ let ( // ) = Ext_path.combine
2727
(* TODO: sync up with {!Js_package_info.module_system} *)
2828
type format = NodeJS | Es6 | Es6_global
2929

30-
type spec = {
31-
format : format;
32-
in_source : bool;
33-
suffix : string
34-
}
30+
type spec = { format : format; in_source : bool; suffix : string }
3531

3632
module Spec_set = Set.Make (struct
3733
type t = spec
@@ -90,13 +86,13 @@ let default_suffix format in_source =
9086
| _, false -> Literals.suffix_mjs
9187
| _, true -> Literals.suffix_bs_mjs
9288

93-
module SS = Set.Make(String)
9489

95-
let supported_bs_suffixes = Literals.[suffix_bs_js; suffix_bs_mjs]
90+
module SS = Set.Make (String)
91+
92+
let supported_bs_suffixes = Literals.[ suffix_bs_js; suffix_bs_mjs ]
9693

9794
(** Produces a [list] of supported, bs-prefixed file-suffixes used in
98-
[in-source] package-specs.
99-
*)
95+
[in-source] package-specs. *)
10096
let extract_in_source_bs_suffixes (package_specs : Spec_set.t) =
10197
let f spec suffixes =
10298
if spec.in_source && List.mem spec.suffix supported_bs_suffixes then
@@ -106,6 +102,7 @@ let extract_in_source_bs_suffixes (package_specs : Spec_set.t) =
106102
let suffixes = Spec_set.fold f package_specs SS.empty in
107103
SS.elements suffixes
108104

105+
109106
let rec from_array (arr : Ext_json_types.t array) : Spec_set.t =
110107
let spec = ref Spec_set.empty in
111108
let has_in_source = ref false in
@@ -195,14 +192,13 @@ let default_package_specs =
195192

196193

197194
(** [get_list_of_output_js specs true "src/hi/hello"] *)
198-
let get_list_of_output_js (package_specs : Spec_set.t) (bs_suffix : bool)
195+
let get_list_of_output_js (package_specs : Spec_set.t)
199196
(output_file_sans_extension : string) =
200197
Spec_set.fold
201-
(fun (spec : spec) acc ->
198+
(fun spec acc ->
202199
let basename =
203200
Ext_namespace.replace_namespace_with_extension
204-
~name:output_file_sans_extension
205-
~ext:(if bs_suffix then Literals.suffix_bs_js else Literals.suffix_js)
201+
~name:output_file_sans_extension ~ext:spec.suffix
206202
in
207203
( Bsb_config.proj_rel
208204
@@

jscomp/bsb/bsb_package_specs.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ val default_package_specs : t
2828

2929
val from_json : Ext_json_types.t -> t
3030

31-
val get_list_of_output_js : t -> bool -> string -> string list
31+
val get_list_of_output_js : t -> string -> string list
3232

3333
val extract_in_source_bs_suffixes : t -> string list
3434

0 commit comments

Comments
 (0)