Skip to content

Commit f4a47e0

Browse files
authored
add error if the lib dir is included in the sources (v10.1) (#6055)
* add error if the lib dir is included in the sources * update CHANGELOG.md
1 parent d2427e8 commit f4a47e0

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#### :bug: Bug Fix
1616
- Fix implementation of directives https://github.com/rescript-lang/rescript-compiler/pull/6052
17+
- Fix issue if the `lib` dir is included in the sources of bsconfig.json https://github.com/rescript-lang/rescript-compiler/pull/6055
1718

1819
#### :rocket: New Feature
1920
- Add support for toplevel `await` https://github.com/rescript-lang/rescript-compiler/pull/6054

jscomp/bsb/bsb_parse_sources.ml

+3
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,9 @@ and parsing_single_source ({ package_kind; is_dev; cwd } as cxt)
298298
let dir =
299299
match map.?(Bsb_build_schemas.dir) with
300300
| Some (Str { str }) ->
301+
if str = Literals.library_file then
302+
Bsb_exception.config_error x (Printf.sprintf "dir field should be different from `%s`" Literals.library_file)
303+
else
301304
Ext_path.simple_convert_node_path_to_os_path str
302305
| Some x ->
303306
Bsb_exception.config_error x "dir expected to be a string"

lib/4.06.1/rescript.ml

+3
Original file line numberDiff line numberDiff line change
@@ -10333,6 +10333,9 @@ and parsing_single_source ({ package_kind; is_dev; cwd } as cxt)
1033310333
let dir =
1033410334
match map.?(Bsb_build_schemas.dir) with
1033510335
| Some (Str { str }) ->
10336+
if str = Literals.library_file then
10337+
Bsb_exception.config_error x (Printf.sprintf "dir field should be different from `%s`" Literals.library_file)
10338+
else
1033610339
Ext_path.simple_convert_node_path_to_os_path str
1033710340
| Some x ->
1033810341
Bsb_exception.config_error x "dir expected to be a string"

0 commit comments

Comments
 (0)