@@ -43,14 +43,17 @@ let bad_module_format_message_exn ~loc format =
43
43
of: %s or %s"
44
44
format Literals. esmodule Literals. commonjs
45
45
46
+ let deprecated_option ~loc x message =
47
+ let loc_end =
48
+ {loc with Lexing. pos_cnum = loc.Lexing. pos_cnum + String. length x}
49
+ in
50
+ let loc = {Warnings. loc_start = loc; loc_end; loc_ghost = false } in
51
+ Location. deprecated loc message
52
+
46
53
let supported_format (x : string ) loc : Ext_module_system.t =
47
54
let _ =
48
55
if x = Literals. es6 || x = Literals. es6_global then
49
- let loc_end =
50
- {loc with Lexing. pos_cnum = loc.Lexing. pos_cnum + String. length x}
51
- in
52
- let loc = {Warnings. loc_start = loc; loc_end; loc_ghost = false } in
53
- Location. deprecated loc
56
+ deprecated_option ~loc x
54
57
(Printf. sprintf " Option \" %s\" is deprecated. Use \" %s\" instead." x
55
58
Literals. esmodule)
56
59
in
@@ -198,8 +201,15 @@ type json_map = Ext_json_types.t Map_string.t
198
201
let extract_js_suffix_exn (map : json_map ) : string =
199
202
match map.?(Bsb_build_schemas. suffix) with
200
203
| None -> Literals. suffix_js
201
- | Some (Str { str = suffix ; _ } ) when validate_js_suffix suffix -> suffix
202
- | Some ((Str {str; _} ) as config ) ->
204
+ | Some (Str { str = suffix ; loc } ) when validate_js_suffix suffix ->
205
+ deprecated_option ~loc
206
+ Literals. suffix_js
207
+ (Printf. sprintf " Top-level suffix is deprecated. Move it into each package-specs." );
208
+ suffix
209
+ | Some ((Str {str; loc} ) as config ) ->
210
+ deprecated_option ~loc
211
+ Literals. suffix_js
212
+ (Printf. sprintf " Top-level suffix is deprecated. Move it into each package-specs." );
203
213
Bsb_exception. config_error config
204
214
(" invalid suffix \" " ^ str ^ " \" . The suffix and may contain letters, digits, \" -\" , \" _\" and \" .\" and must end with .js, .mjs or .cjs." )
205
215
| Some config ->
0 commit comments