Skip to content

Commit c622216

Browse files
committed
bsconfig.json -> rescript.json in error messages + comments
1 parent c65c6c0 commit c622216

14 files changed

+19
-25
lines changed

analysis/reanalyze/src/Paths.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ module Config = struct
8181
| Some False -> RunConfig.transitive false
8282
| _ -> ()
8383

84-
(* Read the config from rescript.json/bsconfig.json and apply it to runConfig and suppress and unsuppress *)
84+
(* Read the config from rescript.json and apply it to runConfig and suppress and unsuppress *)
8585
let processBsconfig () =
8686
Lazy.force setReScriptProjectRoot;
8787
let rescriptFile = Filename.concat runConfig.projectRoot rescriptJson in

analysis/reanalyze/src/Reanalyze.ml

+1-3
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,7 @@ let cli () =
139139
"root_path Run all the analyses for all the .cmt files under the root \
140140
path" );
141141
("-ci", Unit (fun () -> Cli.ci := true), "Internal flag for use in CI");
142-
( "-config",
143-
Unit setConfig,
144-
"Read the analysis mode from rescript.json/bsconfig.json" );
142+
("-config", Unit setConfig, "Read the analysis mode from rescript.json");
145143
("-dce", Unit (fun () -> setDCE None), "Eperimental DCE");
146144
("-debug", Unit (fun () -> Cli.debug := true), "Print debug information");
147145
( "-dce-cmt",

analysis/src/CompletionDecorators.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Example `@raises(Exn)` or `@raises([E1, E2, E3])` for multiple exceptions.
164164

165165
You will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.
166166

167-
Note: The `@react.component` decorator requires the `jsx` config to be set in your `rescript.json`/`bsconfig.json` to enable the required React transformations.
167+
Note: The `@react.component` decorator requires the `jsx` config to be set in your `rescript.json` to enable the required React transformations.
168168

169169
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-decorator).|};
170170
] );

compiler/bsb/bsb_build_util.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ let rec walk_all_deps_aux (visited : string Hash_string.t) (paths : string list)
172172
"package name is expected to be %s but got %s" s str);
173173
str
174174
| Some _ | None ->
175-
Bsb_exception.errorf ~loc "package name missing in %s/bsconfig.json" dir
175+
Bsb_exception.errorf ~loc "package name missing in %s/rescript.json" dir
176176
in
177177
if Ext_list.mem_string paths cur_package_name then (
178178
Bsb_log.error "@{<error>Cyclic dependencies in package stack@}@.";

compiler/bsb/bsb_build_util.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ val include_dirs_by : 'a list -> ('a -> string) -> string
5757
val mkp : string -> unit
5858

5959
(* The path of [bsc] and [bsdep] is normalized so that the invokation of [./compiler/bin/bsb.exe]
60-
and [bsb.exe] (combined with a dirty bsconfig.json) will not trigger unnecessary rebuild.
60+
and [bsb.exe] (combined with a dirty rescript.json) will not trigger unnecessary rebuild.
6161
6262
The location of [bsc] and [bsdep] is configured by the combination of [Sys.executable_name]
6363
and [cwd].

compiler/bsb/bsb_exception.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ let print (fmt : Format.formatter) (x : error) =
4949
let name = Bsb_pkg_types.to_string name in
5050
if Ext_string.equal name !Bs_version.package_name then
5151
Format.fprintf fmt
52-
"File \"bsconfig.json\", line 1\n\
52+
"File \"rescript.json\", line 1\n\
5353
@{<error>Error:@} package @{<error>%s@} is not found\n\
5454
It's the basic, required package. If you have it installed globally,\n\
5555
Please run `npm link rescript` to make it available"
5656
name
5757
else
5858
Format.fprintf fmt
59-
"File \"bsconfig.json\", line 1\n\
59+
"File \"rescript.json\", line 1\n\
6060
@{<error>Error:@} package @{<error>%s@} not found or built\n\
6161
- Did you install it?"
6262
name
@@ -68,7 +68,7 @@ let print (fmt : Format.formatter) (x : error) =
6868
https://rescript-lang.org/docs/manual/latest/build-configuration-schema"
6969
pos.pos_fname pos.pos_lnum s
7070
| Invalid_spec s ->
71-
Format.fprintf fmt "@{<error>Error: Invalid bsconfig.json %s@}" s
71+
Format.fprintf fmt "@{<error>Error: Invalid rescript.json %s@}" s
7272

7373
let conflict_module modname dir1 dir2 =
7474
Error (Conflict_module (modname, dir1, dir2))

compiler/bsb/bsb_ninja_rule.mli

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ type builtin = {
5656
(** rules are generally composed of built-in rules and customized rules, there are two design choices:
5757
1. respect custom rules with the same name, then we need adjust our built-in
5858
rules dynamically in case the conflict.
59-
2. respect our built-in rules, then we only need re-load custom rules for each bsconfig.json
59+
2. respect our built-in rules, then we only need re-load custom rules for each rescript.json
6060
*)
6161

6262
type command = string
6363

64-
(* Since now we generate ninja files per bsconfig.json in a single process,
64+
(* Since now we generate ninja files per rescript.json in a single process,
6565
we must make sure it is re-entrant
6666
*)
6767
val make_custom_rules :

compiler/bsb/bsb_pkg.ml

-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ let ( // ) = Filename.concat
2626

2727
type t = Bsb_pkg_types.t
2828

29-
(* TODO: be more restrict
30-
[bsconfig.json] does not always make sense,
31-
when resolving [ppx-flags]
32-
*)
3329
let make_sub_path (x : t) : string =
3430
Literals.node_modules // Bsb_pkg_types.to_string x
3531

compiler/bsb/bsb_watcher_gen.mli

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424

2525
val generate_sourcedirs_meta : name:string -> Bsb_file_groups.t -> unit
2626
(** This module try to generate some meta data so that
27-
everytime [bsconfig.json] is reload, we can re-read
27+
everytime [rescript.json] is reloaded, we can re-read
2828
such meta data changes in the watcher.
2929
30-
Another way of doing it is processing [bsconfig.json]
30+
Another way of doing it is processing [rescript.json]
3131
directly in [watcher] but that would
3232
mean the duplication of logic in [bsb] and [bsb_watcher]
3333
*)

compiler/bsb_exe/rescript_main.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ let build_subcommand ~start argv argv_len =
135135
( "-regen",
136136
unit_set_spec force_regenerate,
137137
"*internal* \n\
138-
Always regenerate build.ninja no matter bsconfig.json is changed or \
139-
not" );
138+
Always regenerate build.ninja no matter if rescript.json is changed \
139+
or not" );
140140
( "-no-deps",
141141
unit_set_spec no_deps_mode,
142142
"*internal* Needed for watcher to build without dependencies on file \

compiler/jsoo/jsoo_playground_main.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
* -----------------------------
4646
* Version History: * v2: Remove refmt support (removes compiler.reason apis)
4747
* v3: Switched to Uncurried mode by default (requires third party packages
48-
to be built with uncurried: true in bsconfig.json). Also added
48+
to be built with uncurried: true in rescript.json). Also added
4949
`config.uncurried` to the BundleConfig.
5050
* v4: Added `config.open_modules` to the BundleConfig to enable implicitly opened
5151
* modules in the playground.

compiler/ml/typetexp.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -889,9 +889,9 @@ let report_error env ppf = function
889889
"@[<v>@{<info>The module or file %a can't be found.@}@,\
890890
@[<v 2>- If it's a third-party dependency:@,\
891891
- Did you add it to the \"bs-dependencies\" or \
892-
\"bs-dev-dependencies\" in bsconfig.json?@]@,\
892+
\"bs-dev-dependencies\" in rescript.json?@]@,\
893893
- Did you include the file's directory to the \"sources\" in \
894-
bsconfig.json?@,"
894+
rescript.json?@,"
895895
Printtyp.longident lid);
896896
super_spellcheck ppf Env.fold_modules env lid |> ignore
897897
| Unbound_constructor lid ->

docs/JSXV4.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The V4 representation is part of the spec, so `@react.component` is effectively
55

66
## Turn On V4
77

8-
To build an entire project in V4 mode, including all its dependencies, use the new `"jsx"` configuration in `bsconfig.json` instead of the old `"reason"`:
8+
To build an entire project in V4 mode, including all its dependencies, use the new `"jsx"` configuration in `rescript.json` instead of the old `"reason"`:
99

1010
```json
1111
"jsx": { "version": 4 }

runtime/Belt.res

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ If you want to open Belt globally for all files in your project instead, you can
5656
}
5757
```
5858
59-
into your `bsconfig.json`.
59+
into your `rescript.json`.
6060
6161
**Note**: this is the **only** `open` we encourage.
6262

0 commit comments

Comments
 (0)