From 6e3676495d183d28cd2e4b784b6c469c0e759a1e Mon Sep 17 00:00:00 2001 From: Dmitry Zakharov Date: Wed, 16 Aug 2023 12:57:37 +0400 Subject: [PATCH 1/9] Make build -with-deps a default behaviour --- CHANGELOG.md | 1 + jscomp/bsb_exe/rescript_main.ml | 45 ++++++--------------------------- 2 files changed, 9 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eff6690bb7..54d2673a0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ - Conditionally print error message about record with missing label potentially being a component. https://github.com/rescript-lang/rescript-compiler/pull/6337 - Put definition in the bottom and the actual error at the top when reporting errors for supplying fields etc with the wrong name. https://github.com/rescript-lang/rescript-compiler/pull/6336 - Fix left over places where polyvariant tag names were printed in OCaml syntax instead of ReScript. https://github.com/rescript-lang/rescript-compiler/pull/6348 +- `rescript build` will always build its dependency by default. The argument `-with-deps` is not needed anymore. https://github.com/rescript-lang/rescript-compiler/pull/6350 # 11.0.0-beta.4 diff --git a/jscomp/bsb_exe/rescript_main.ml b/jscomp/bsb_exe/rescript_main.ml index d3d03c16e7..33666d0981 100644 --- a/jscomp/bsb_exe/rescript_main.ml +++ b/jscomp/bsb_exe/rescript_main.ml @@ -28,8 +28,6 @@ let separator = "--" let watch_mode = ref false -let make_world = ref false - let do_install = ref false let force_regenerate = ref false @@ -109,24 +107,6 @@ let install_target () = let eid = Bsb_unix.run_command_execv install_command in if eid <> 0 then Bsb_unix.command_fatal_error install_command eid -(** check if every dependency installation dierctory is there - This is in hot path, so we want it to be fast. - The heuristics is that if the installation directory is not there, - we definitely need build the world. - If it is there, we do not check if it is up-to-date, since that's - going be slow, user can use `-with-deps` to enforce such check -*) -let check_deps_installation_directory (config_opt : Bsb_config_types.t option) : - bool = - match config_opt with - | Some { bs_dependencies; bs_dev_dependencies } -> - not - (Ext_list.for_all bs_dependencies (fun x -> - Ext_sys.is_directory_no_exn x.package_install_path) - && Ext_list.for_all bs_dev_dependencies (fun x -> - Ext_sys.is_directory_no_exn x.package_install_path)) - | None -> false - let build_subcommand ~start argv argv_len = let i = Ext_array.rfind_with_index argv Ext_string.equal separator in @@ -135,10 +115,10 @@ let build_subcommand ~start argv argv_len = ~argv [| ("-w", unit_set_spec watch_mode, "Watch mode"); - ("-with-deps", unit_set_spec make_world, "Build dependencies explicitly"); + ("-with-deps", unit_set_spec (ref true), "*deprecated* Build dependencies explicitly"); ( "-install", unit_set_spec do_install, - "*internal* Install public interface files for dependencies " ); + "*internal* Install public interface files for dependencies" ); (* This should be put in a subcommand previously it works with the implication `bsb && bsb -install` *) @@ -162,15 +142,8 @@ let build_subcommand ~start argv argv_len = | _ -> let config_opt = Bsb_ninja_regen.regenerate_ninja ~package_kind:Toplevel - ~per_proj_dir:Bsb_global_paths.cwd ~forced:!force_regenerate - in - let implict_build = check_deps_installation_directory config_opt in - (match (!make_world, implict_build) with - | true, _ -> - Bsb_world.make_world_deps Bsb_global_paths.cwd config_opt ninja_args - | false, true -> - Bsb_world.make_world_deps Bsb_global_paths.cwd config_opt [||] - | false, false -> ()); + ~per_proj_dir:Bsb_global_paths.cwd ~forced:!force_regenerate in + Bsb_world.make_world_deps Bsb_global_paths.cwd config_opt ninja_args; if !do_install then install_target (); if !watch_mode then exit 0 (* let the watcher do the build*) else ninja_command_exit ninja_args @@ -179,8 +152,8 @@ let clean_subcommand ~start argv = Bsb_arg.parse_exn ~usage:clean_usage ~start ~argv [| ( "-with-deps", - unit_set_spec make_world, - "*internal* Clean dependencies too" ); + unit_set_spec (ref true), + "*deprecated* Clean dependencies too" ); ("-verbose", call_spec Bsb_log.verbose, "Set the output to be verbose"); |] failed_annon; @@ -226,10 +199,8 @@ let () = (* specialize this path which is used in watcher *) let config_opt = Bsb_ninja_regen.regenerate_ninja ~package_kind:Toplevel ~forced:false - ~per_proj_dir:Bsb_global_paths.cwd - in - if !make_world || check_deps_installation_directory config_opt then - Bsb_world.make_world_deps Bsb_global_paths.cwd config_opt [||]; + ~per_proj_dir:Bsb_global_paths.cwd in + Bsb_world.make_world_deps Bsb_global_paths.cwd config_opt [||]; ninja_command_exit [||]) else match argv.(1) with From f636081e9a69b9b637cda40261c33cf10f94b122 Mon Sep 17 00:00:00 2001 From: Dmitry Zakharov Date: Wed, 16 Aug 2023 13:34:31 +0400 Subject: [PATCH 2/9] Clean up -with-deps from the codebase --- jscomp/bsb/bsb_exception.ml | 3 +-- jscomp/build_tests/case/package.json | 2 +- jscomp/build_tests/case2/package.json | 2 +- jscomp/build_tests/case3/package.json | 2 +- jscomp/build_tests/custom_namespace/input.js | 2 +- jscomp/build_tests/custom_namespace/package.json | 2 +- jscomp/build_tests/cycle/package.json | 2 +- jscomp/build_tests/cycle1/input.js | 2 +- jscomp/build_tests/devdeps/package.json | 2 +- jscomp/build_tests/devonly/package.json | 2 +- .../build_tests/duplicated_symlinked_packages/a/package.json | 2 +- .../build_tests/duplicated_symlinked_packages/b/package.json | 2 +- .../build_tests/duplicated_symlinked_packages/c/package.json | 2 +- jscomp/build_tests/duplicated_symlinked_packages/input.js | 2 +- jscomp/build_tests/duplicated_symlinked_packages/package.json | 2 +- jscomp/build_tests/exports/package.json | 2 +- jscomp/build_tests/hyphen2/package.json | 2 +- jscomp/build_tests/install/package.json | 2 +- jscomp/build_tests/nested/package.json | 2 +- jscomp/build_tests/nnest/package.json | 2 +- jscomp/build_tests/ns/package.json | 2 +- jscomp/build_tests/post-build/package.json | 2 +- jscomp/build_tests/rerror/input.js | 2 +- jscomp/build_tests/rerror/package.json | 2 +- .../build_tests/super_errors/expected/modules1.res.expected | 4 +--- jscomp/build_tests/uncurried-always/input.js | 2 +- jscomp/build_tests/weird_names/package.json | 2 +- jscomp/build_tests/x-y/package.json | 2 +- jscomp/build_tests/zerocycle/package.json | 2 +- jscomp/gentype_tests/typescript-react-example/package.json | 2 +- jscomp/ml/typetexp.ml | 2 -- 31 files changed, 30 insertions(+), 35 deletions(-) diff --git a/jscomp/bsb/bsb_exception.ml b/jscomp/bsb/bsb_exception.ml index c6bd9fbdc2..ed3bc22134 100644 --- a/jscomp/bsb/bsb_exception.ml +++ b/jscomp/bsb/bsb_exception.ml @@ -66,8 +66,7 @@ let print (fmt : Format.formatter) (x : error) = Format.fprintf fmt "File \"bsconfig.json\", line 1\n\ @{Error:@} package @{%s@} not found or built %s\n\ - - Did you install it?\n\ - - If you did, did you run `rescript build -with-deps`?" name in_json + - Did you install it?" name in_json | Json_config (pos, s) -> Format.fprintf fmt "File %S, line %d:\n\ diff --git a/jscomp/build_tests/case/package.json b/jscomp/build_tests/case/package.json index 898b6615c6..619a22e950 100644 --- a/jscomp/build_tests/case/package.json +++ b/jscomp/build_tests/case/package.json @@ -2,7 +2,7 @@ "name": "case", "version": "0.1.0", "scripts": { - "clean": "rescript clean -with-deps", + "clean": "rescript clean", "build": "rescript build", "watch": "rescript build -w" }, diff --git a/jscomp/build_tests/case2/package.json b/jscomp/build_tests/case2/package.json index 904aebe85d..a082d7015b 100644 --- a/jscomp/build_tests/case2/package.json +++ b/jscomp/build_tests/case2/package.json @@ -2,7 +2,7 @@ "name": "case2", "version": "0.1.0", "scripts": { - "clean": "rescript clean -with-deps", + "clean": "rescript clean", "build": "rescript build", "watch": "rescript build -w" }, diff --git a/jscomp/build_tests/case3/package.json b/jscomp/build_tests/case3/package.json index 9e2e287019..0c46a3dfde 100644 --- a/jscomp/build_tests/case3/package.json +++ b/jscomp/build_tests/case3/package.json @@ -2,7 +2,7 @@ "name": "case3", "version": "0.1.0", "scripts": { - "clean": "rescript clean -with-deps", + "clean": "rescript clean", "build": "rescript build", "watch": "rescript build -w" }, diff --git a/jscomp/build_tests/custom_namespace/input.js b/jscomp/build_tests/custom_namespace/input.js index a1201cbe5b..f100581dbc 100644 --- a/jscomp/build_tests/custom_namespace/input.js +++ b/jscomp/build_tests/custom_namespace/input.js @@ -4,7 +4,7 @@ var path = require("path"); var assert = require("assert"); var rescript_exe = require("../../../scripts/bin_path").rescript_exe; -child_process.execSync(`${rescript_exe} clean -with-deps && ${rescript_exe} build`, { +child_process.execSync(`${rescript_exe} clean && ${rescript_exe} build`, { cwd: __dirname, }); diff --git a/jscomp/build_tests/custom_namespace/package.json b/jscomp/build_tests/custom_namespace/package.json index 0afe9e776b..ff3881a660 100644 --- a/jscomp/build_tests/custom_namespace/package.json +++ b/jscomp/build_tests/custom_namespace/package.json @@ -2,7 +2,7 @@ "name": "namespace", "version": "0.1.0", "scripts": { - "clean": "rescript clean -with-deps", + "clean": "rescript clean", "build": "rescript build", "watch": "rescript build -w" }, diff --git a/jscomp/build_tests/cycle/package.json b/jscomp/build_tests/cycle/package.json index d05af4c597..488bf6bcd2 100644 --- a/jscomp/build_tests/cycle/package.json +++ b/jscomp/build_tests/cycle/package.json @@ -2,7 +2,7 @@ "name": "cycle", "version": "0.1.0", "scripts": { - "clean": "rescript clean -with-deps", + "clean": "rescript clean", "build": "rescript build", "watch": "rescript build -w" }, diff --git a/jscomp/build_tests/cycle1/input.js b/jscomp/build_tests/cycle1/input.js index 9c9b0a8dbc..c8453f94b6 100644 --- a/jscomp/build_tests/cycle1/input.js +++ b/jscomp/build_tests/cycle1/input.js @@ -5,7 +5,7 @@ const fs = require('fs') const path = require('path') var rescript_exe = require("../../../scripts/bin_path").rescript_exe -cp.execSync(`${rescript_exe} clean -with-deps`, { cwd: __dirname, }); +cp.execSync(`${rescript_exe} clean`, { cwd: __dirname, }); var output = cp.spawnSync(rescript_exe, { encoding: "utf8", shell: true }); diff --git a/jscomp/build_tests/devdeps/package.json b/jscomp/build_tests/devdeps/package.json index a64f246beb..7c4250ad69 100644 --- a/jscomp/build_tests/devdeps/package.json +++ b/jscomp/build_tests/devdeps/package.json @@ -2,7 +2,7 @@ "name": "devdeps", "version": "0.1.0", "scripts": { - "clean": "rescript clean -with-deps", + "clean": "rescript clean", "build": "rescript build", "watch": "rescript build -w" }, diff --git a/jscomp/build_tests/devonly/package.json b/jscomp/build_tests/devonly/package.json index 0cb91838dc..18aeaf4fa2 100644 --- a/jscomp/build_tests/devonly/package.json +++ b/jscomp/build_tests/devonly/package.json @@ -2,7 +2,7 @@ "name": "devonly", "version": "0.1.0", "scripts": { - "clean": "rescript clean -with-deps", + "clean": "rescript clean", "build": "rescript build", "watch": "rescript build -w" }, diff --git a/jscomp/build_tests/duplicated_symlinked_packages/a/package.json b/jscomp/build_tests/duplicated_symlinked_packages/a/package.json index 204c7c3f1b..3bfbac807f 100644 --- a/jscomp/build_tests/duplicated_symlinked_packages/a/package.json +++ b/jscomp/build_tests/duplicated_symlinked_packages/a/package.json @@ -4,7 +4,7 @@ "scripts": { "build": "rescript build", "start": "rescript build -w", - "clean": "rescript clean -with-deps" + "clean": "rescript clean" }, "keywords": [ "BuckleScript" diff --git a/jscomp/build_tests/duplicated_symlinked_packages/b/package.json b/jscomp/build_tests/duplicated_symlinked_packages/b/package.json index c7de682d62..21032b3ede 100644 --- a/jscomp/build_tests/duplicated_symlinked_packages/b/package.json +++ b/jscomp/build_tests/duplicated_symlinked_packages/b/package.json @@ -4,7 +4,7 @@ "scripts": { "build": "rescript build", "start": "rescript build -w", - "clean": "rescript clean -with-deps" + "clean": "rescript clean" }, "keywords": [ "BuckleScript" diff --git a/jscomp/build_tests/duplicated_symlinked_packages/c/package.json b/jscomp/build_tests/duplicated_symlinked_packages/c/package.json index 7dd155cf21..0eb39d1031 100644 --- a/jscomp/build_tests/duplicated_symlinked_packages/c/package.json +++ b/jscomp/build_tests/duplicated_symlinked_packages/c/package.json @@ -4,7 +4,7 @@ "scripts": { "build": "rescript build", "start": "rescript build -w", - "clean": "rescript clean -with-deps" + "clean": "rescript clean" }, "keywords": [ "BuckleScript" diff --git a/jscomp/build_tests/duplicated_symlinked_packages/input.js b/jscomp/build_tests/duplicated_symlinked_packages/input.js index ad80c4849f..66c2e0e9e4 100644 --- a/jscomp/build_tests/duplicated_symlinked_packages/input.js +++ b/jscomp/build_tests/duplicated_symlinked_packages/input.js @@ -12,7 +12,7 @@ function postProcessErrorOutput (output) { output = output.replace(new RegExp(__dirname, 'gi'), '.') return output } -child_process.execSync(`${rescript_exe} clean -with-deps`,{cwd:__dirname}) +child_process.execSync(`${rescript_exe} clean`,{cwd:__dirname}) child_process.exec(rescript_exe, {cwd: __dirname}, (err, stdout, stderr) => { const actualErrorOutput = postProcessErrorOutput(stderr.toString()) if (updateTests) { diff --git a/jscomp/build_tests/duplicated_symlinked_packages/package.json b/jscomp/build_tests/duplicated_symlinked_packages/package.json index 081c040d74..365f79e5cc 100644 --- a/jscomp/build_tests/duplicated_symlinked_packages/package.json +++ b/jscomp/build_tests/duplicated_symlinked_packages/package.json @@ -2,7 +2,7 @@ "name": "duplicated-symlinked-packages", "version": "0.1.0", "scripts": { - "clean": "rescript clean -with-deps", + "clean": "rescript clean", "build": "rescript build", "watch": "rescript build -w" }, diff --git a/jscomp/build_tests/exports/package.json b/jscomp/build_tests/exports/package.json index cd635a2973..8ee100cf4d 100644 --- a/jscomp/build_tests/exports/package.json +++ b/jscomp/build_tests/exports/package.json @@ -2,7 +2,7 @@ "name": "exports", "version": "0.1.0", "scripts": { - "clean": "rescript clean -with-deps", + "clean": "rescript clean", "build": "rescript build", "watch": "rescript build -w" }, diff --git a/jscomp/build_tests/hyphen2/package.json b/jscomp/build_tests/hyphen2/package.json index 5ccd3a7392..28ed7a112e 100644 --- a/jscomp/build_tests/hyphen2/package.json +++ b/jscomp/build_tests/hyphen2/package.json @@ -2,7 +2,7 @@ "name": "hyphen2", "version": "0.1.0", "scripts": { - "clean": "rescript clean -with-deps", + "clean": "rescript clean", "build": "rescript build", "watch": "rescript build -w" }, diff --git a/jscomp/build_tests/install/package.json b/jscomp/build_tests/install/package.json index cc2f43b321..7ed8983cb4 100644 --- a/jscomp/build_tests/install/package.json +++ b/jscomp/build_tests/install/package.json @@ -2,7 +2,7 @@ "name": "install", "version": "0.1.0", "scripts": { - "clean": "rescript clean -with-deps", + "clean": "rescript clean", "build": "rescript build", "install": "rescript build -install", "watch": "rescript build -w" diff --git a/jscomp/build_tests/nested/package.json b/jscomp/build_tests/nested/package.json index ca296ee78c..9aa6fb8598 100644 --- a/jscomp/build_tests/nested/package.json +++ b/jscomp/build_tests/nested/package.json @@ -2,7 +2,7 @@ "name": "nested", "version": "0.1.0", "scripts": { - "clean": "rescript clean -with-deps", + "clean": "rescript clean", "build": "rescript build", "watch": "rescript build -w" }, diff --git a/jscomp/build_tests/nnest/package.json b/jscomp/build_tests/nnest/package.json index ca296ee78c..9aa6fb8598 100644 --- a/jscomp/build_tests/nnest/package.json +++ b/jscomp/build_tests/nnest/package.json @@ -2,7 +2,7 @@ "name": "nested", "version": "0.1.0", "scripts": { - "clean": "rescript clean -with-deps", + "clean": "rescript clean", "build": "rescript build", "watch": "rescript build -w" }, diff --git a/jscomp/build_tests/ns/package.json b/jscomp/build_tests/ns/package.json index b1bb64129e..b3a92351f4 100644 --- a/jscomp/build_tests/ns/package.json +++ b/jscomp/build_tests/ns/package.json @@ -2,7 +2,7 @@ "name": "ns", "version": "0.1.0", "scripts": { - "clean": "rescript clean -with-deps", + "clean": "rescript clean", "build": "rescript build", "watch": "rescript build -w" }, diff --git a/jscomp/build_tests/post-build/package.json b/jscomp/build_tests/post-build/package.json index 40ef7c6a29..2ad2b88c93 100644 --- a/jscomp/build_tests/post-build/package.json +++ b/jscomp/build_tests/post-build/package.json @@ -2,7 +2,7 @@ "name": "post-build", "version": "0.1.0", "scripts": { - "clean": "rescript clean -with-deps", + "clean": "rescript clean", "build": "rescript build", "watch": "rescript build -w" }, diff --git a/jscomp/build_tests/rerror/input.js b/jscomp/build_tests/rerror/input.js index 426b544d23..77fb6044ba 100644 --- a/jscomp/build_tests/rerror/input.js +++ b/jscomp/build_tests/rerror/input.js @@ -1,7 +1,7 @@ var child_process = require("child_process"); var assert = require("assert"); var rescript_exe = require("../../../scripts/bin_path").rescript_exe; -child_process.spawnSync(`${rescript_exe} clean -with-deps`, { +child_process.spawnSync(`${rescript_exe} clean`, { cwd: __dirname, encoding: "utf8", }); diff --git a/jscomp/build_tests/rerror/package.json b/jscomp/build_tests/rerror/package.json index f2a1c06e89..36908590fb 100644 --- a/jscomp/build_tests/rerror/package.json +++ b/jscomp/build_tests/rerror/package.json @@ -2,7 +2,7 @@ "name": "rerror", "version": "0.1.0", "scripts": { - "clean": "rescript clean -with-deps", + "clean": "rescript clean", "build": "rescript", "watch": "rescript build -w" }, diff --git a/jscomp/build_tests/super_errors/expected/modules1.res.expected b/jscomp/build_tests/super_errors/expected/modules1.res.expected index 1ea2fe29e5..7248f56965 100644 --- a/jscomp/build_tests/super_errors/expected/modules1.res.expected +++ b/jscomp/build_tests/super_errors/expected/modules1.res.expected @@ -8,6 +8,4 @@ The module or file Foo can't be found. - If it's a third-party dependency: - Did you list it in bsconfig.json? - - Did you run `rescript build` instead of `rescript build -with-deps` - (latter builds third-parties)? - - Did you include the file's directory in bsconfig.json? \ No newline at end of file + - Did you include the file's directory in bsconfig.json? \ No newline at end of file diff --git a/jscomp/build_tests/uncurried-always/input.js b/jscomp/build_tests/uncurried-always/input.js index 086ace1115..3d512d1e61 100644 --- a/jscomp/build_tests/uncurried-always/input.js +++ b/jscomp/build_tests/uncurried-always/input.js @@ -5,5 +5,5 @@ const fs = require('fs') const path = require('path') var rescript_exe = require("../../../scripts/bin_path").rescript_exe -cp.execSync(`${rescript_exe} clean -with-deps`, { cwd: __dirname, }); +cp.execSync(`${rescript_exe} clean`, { cwd: __dirname, }); cp.execSync(`${rescript_exe}`, { cwd: __dirname, }); diff --git a/jscomp/build_tests/weird_names/package.json b/jscomp/build_tests/weird_names/package.json index 3ad2923e99..4759556a0c 100644 --- a/jscomp/build_tests/weird_names/package.json +++ b/jscomp/build_tests/weird_names/package.json @@ -2,7 +2,7 @@ "name": "weird_names", "version": "0.1.0", "scripts": { - "clean": "rescript clean -with-deps", + "clean": "rescript clean", "build": "rescript build", "watch": "rescript build -w" }, diff --git a/jscomp/build_tests/x-y/package.json b/jscomp/build_tests/x-y/package.json index 19ab447311..b614a74983 100644 --- a/jscomp/build_tests/x-y/package.json +++ b/jscomp/build_tests/x-y/package.json @@ -2,7 +2,7 @@ "name": "x-y", "version": "0.1.0", "scripts": { - "clean": "rescript clean -with-deps", + "clean": "rescript clean", "build": "rescript", "watch": "rescript build -w" }, diff --git a/jscomp/build_tests/zerocycle/package.json b/jscomp/build_tests/zerocycle/package.json index e44e7f662d..0329044793 100644 --- a/jscomp/build_tests/zerocycle/package.json +++ b/jscomp/build_tests/zerocycle/package.json @@ -2,7 +2,7 @@ "name": "zerocycle", "version": "0.1.0", "scripts": { - "clean": "rescript clean -with-deps", + "clean": "rescript clean", "build": "rescript build", "watch": "rescript build -w" }, diff --git a/jscomp/gentype_tests/typescript-react-example/package.json b/jscomp/gentype_tests/typescript-react-example/package.json index b8a0cec5b8..8ff3dda051 100644 --- a/jscomp/gentype_tests/typescript-react-example/package.json +++ b/jscomp/gentype_tests/typescript-react-example/package.json @@ -10,7 +10,7 @@ "scripts": { "start": "rescript build -w", "build": "rescript", - "clean": "rescript clean -with-deps", + "clean": "rescript clean", "tsc": "tsc -p tsconfig.json" }, "devDependencies": { diff --git a/jscomp/ml/typetexp.ml b/jscomp/ml/typetexp.ml index 7825b4eef5..24614dc398 100644 --- a/jscomp/ml/typetexp.ml +++ b/jscomp/ml/typetexp.ml @@ -994,8 +994,6 @@ let report_error env ppf = function @{The module or file %a can't be found.@}@,\ @[- If it's a third-party dependency:@,\ - Did you list it in bsconfig.json?@,\ - - @[Did you run `rescript build` instead of `rescript build -with-deps`@ (latter builds third-parties)@]?\ - @]@,\ - Did you include the file's directory in bsconfig.json?@]\ @]" Printtyp.longident lid From cef7435e8c17cbe524516a8b0a32542fde2985c1 Mon Sep 17 00:00:00 2001 From: Dmitry Zakharov Date: Wed, 16 Aug 2023 17:08:13 +0400 Subject: [PATCH 3/9] Fix build tests --- jscomp/build_tests/devdeps/input.js | 33 ---------- .../devdeps/node_modules/weird/bsconfig.json | 4 -- .../devdeps/node_modules/weird/package.json | 0 jscomp/build_tests/devdeps/package-lock.json | 64 ------------------- .../{devdeps => weird_deps}/.gitignore | 0 .../{devdeps => weird_deps}/README.md | 0 jscomp/build_tests/weird_deps/bsconfig.json | 22 +++++++ jscomp/build_tests/weird_deps/input.js | 24 +++++++ .../build_tests/weird_deps/package-lock.json | 51 +++++++++++++++ .../{devdeps => weird_deps}/package.json | 6 +- .../{devdeps => weird_deps}/src/demo.res | 0 .../{devdeps => weird_deps}/test/test.res | 0 jscomp/build_tests/weird_devdeps/.gitignore | 26 ++++++++ jscomp/build_tests/weird_devdeps/README.md | 16 +++++ .../{devdeps => weird_devdeps}/bsconfig.json | 2 +- jscomp/build_tests/weird_devdeps/input.js | 24 +++++++ .../weird_devdeps/package-lock.json | 51 +++++++++++++++ jscomp/build_tests/weird_devdeps/package.json | 17 +++++ jscomp/build_tests/weird_devdeps/src/demo.res | 1 + .../build_tests/weird_devdeps/test/test.res | 1 + 20 files changed, 237 insertions(+), 105 deletions(-) delete mode 100644 jscomp/build_tests/devdeps/input.js delete mode 100644 jscomp/build_tests/devdeps/node_modules/weird/bsconfig.json delete mode 100644 jscomp/build_tests/devdeps/node_modules/weird/package.json delete mode 100644 jscomp/build_tests/devdeps/package-lock.json rename jscomp/build_tests/{devdeps => weird_deps}/.gitignore (100%) rename jscomp/build_tests/{devdeps => weird_deps}/README.md (100%) create mode 100644 jscomp/build_tests/weird_deps/bsconfig.json create mode 100644 jscomp/build_tests/weird_deps/input.js create mode 100644 jscomp/build_tests/weird_deps/package-lock.json rename jscomp/build_tests/{devdeps => weird_deps}/package.json (74%) rename jscomp/build_tests/{devdeps => weird_deps}/src/demo.res (100%) rename jscomp/build_tests/{devdeps => weird_deps}/test/test.res (100%) create mode 100644 jscomp/build_tests/weird_devdeps/.gitignore create mode 100644 jscomp/build_tests/weird_devdeps/README.md rename jscomp/build_tests/{devdeps => weird_devdeps}/bsconfig.json (92%) create mode 100644 jscomp/build_tests/weird_devdeps/input.js create mode 100644 jscomp/build_tests/weird_devdeps/package-lock.json create mode 100644 jscomp/build_tests/weird_devdeps/package.json create mode 100644 jscomp/build_tests/weird_devdeps/src/demo.res create mode 100644 jscomp/build_tests/weird_devdeps/test/test.res diff --git a/jscomp/build_tests/devdeps/input.js b/jscomp/build_tests/devdeps/input.js deleted file mode 100644 index 97de262636..0000000000 --- a/jscomp/build_tests/devdeps/input.js +++ /dev/null @@ -1,33 +0,0 @@ -//@ts-check - -var cp = require("child_process"); -var assert = require("assert"); -var targetOne = `test/test.cmj`; -var targetTwo = `src/demo.cmj`; -var rescript_exe = require("../../../scripts/bin_path").rescript_exe - - -cp.exec( - `${rescript_exe} build -- -t commands ${targetOne}`, - { encoding: "ascii" }, - function (err, output) { - if (err !== null) { - console.error("unexpected"); - throw err; - } - assert(output.split("\n").some((x) => x.includes("weird"))); - cp.exec( - `${rescript_exe} build -- -t commands ${targetTwo}`, - { encoding: "ascii" }, - function (err, output) { - if (err !== null) { - console.error("unexpected"); - throw err; - } - assert(output.split("\n").some((x) => x.includes("weird")) === false); - } - ); - - } -); - diff --git a/jscomp/build_tests/devdeps/node_modules/weird/bsconfig.json b/jscomp/build_tests/devdeps/node_modules/weird/bsconfig.json deleted file mode 100644 index a8c265c5a1..0000000000 --- a/jscomp/build_tests/devdeps/node_modules/weird/bsconfig.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name" : "weird", - "sources" : "." -} \ No newline at end of file diff --git a/jscomp/build_tests/devdeps/node_modules/weird/package.json b/jscomp/build_tests/devdeps/node_modules/weird/package.json deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/jscomp/build_tests/devdeps/package-lock.json b/jscomp/build_tests/devdeps/package-lock.json deleted file mode 100644 index aeb405016b..0000000000 --- a/jscomp/build_tests/devdeps/package-lock.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "devdeps", - "version": "0.1.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "devdeps", - "version": "0.1.0", - "license": "MIT", - "dependencies": { - "rescript": "file:../../.." - }, - "devDependencies": { - "bs-platform": "^5.0.5" - } - }, - "../../..": { - "version": "10.0.0", - "hasInstallScript": true, - "license": "SEE LICENSE IN LICENSE", - "bin": { - "bsc": "bsc", - "bstracing": "lib/bstracing", - "rescript": "rescript" - }, - "devDependencies": { - "mocha": "^7.2.0", - "nyc": "^15.0.0" - } - }, - "node_modules/bs-platform": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bs-platform/-/bs-platform-5.2.1.tgz", - "integrity": "sha512-3ISP+RBC/NYILiJnphCY0W3RTYpQ11JGa2dBBLVug5fpFZ0qtSaL3ZplD8MyjNeXX2bC7xgrWfgBSn8Tc9om7Q==", - "dev": true, - "hasInstallScript": true, - "bin": { - "bsb": "lib/bsb", - "bsc": "lib/bsc", - "bstracing": "lib/bstracing" - } - }, - "node_modules/rescript": { - "resolved": "../../..", - "link": true - } - }, - "dependencies": { - "bs-platform": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bs-platform/-/bs-platform-5.2.1.tgz", - "integrity": "sha512-3ISP+RBC/NYILiJnphCY0W3RTYpQ11JGa2dBBLVug5fpFZ0qtSaL3ZplD8MyjNeXX2bC7xgrWfgBSn8Tc9om7Q==", - "dev": true - }, - "rescript": { - "version": "file:../../..", - "requires": { - "mocha": "^7.2.0", - "nyc": "^15.0.0" - } - } - } -} diff --git a/jscomp/build_tests/devdeps/.gitignore b/jscomp/build_tests/weird_deps/.gitignore similarity index 100% rename from jscomp/build_tests/devdeps/.gitignore rename to jscomp/build_tests/weird_deps/.gitignore diff --git a/jscomp/build_tests/devdeps/README.md b/jscomp/build_tests/weird_deps/README.md similarity index 100% rename from jscomp/build_tests/devdeps/README.md rename to jscomp/build_tests/weird_deps/README.md diff --git a/jscomp/build_tests/weird_deps/bsconfig.json b/jscomp/build_tests/weird_deps/bsconfig.json new file mode 100644 index 0000000000..64a146c503 --- /dev/null +++ b/jscomp/build_tests/weird_deps/bsconfig.json @@ -0,0 +1,22 @@ +{ + "name": "weird_devdeps", + "version": "0.1.0", + "sources": [{ + "dir" : "src", + "subdirs" : true + }, + { + "dir" : "test", + "type" : "dev" + } +], + "package-specs": { + "module": "commonjs", + "in-source": true + }, + "suffix": ".bs.js", + "bs-dependencies": [ + "weird" + ], + "warnings": {"error":"+101"} +} diff --git a/jscomp/build_tests/weird_deps/input.js b/jscomp/build_tests/weird_deps/input.js new file mode 100644 index 0000000000..6e2a156015 --- /dev/null +++ b/jscomp/build_tests/weird_deps/input.js @@ -0,0 +1,24 @@ +//@ts-check + +var cp = require("child_process"); +var assert = require("assert"); +var rescript_exe = require("../../../scripts/bin_path").rescript_exe; + +var out = cp.spawnSync(rescript_exe, { + cwd: __dirname, + encoding: "utf8", +}); + +if (out.stdout !== "") { + assert.fail(out.stdout); +} else { + assert.equal( + out.stderr, + [ + 'File "bsconfig.json", line 1', + "Error: package weird not found or built ", + "- Did you install it?", + "", + ].join("\n") + ); +} diff --git a/jscomp/build_tests/weird_deps/package-lock.json b/jscomp/build_tests/weird_deps/package-lock.json new file mode 100644 index 0000000000..fd3dfa1d67 --- /dev/null +++ b/jscomp/build_tests/weird_deps/package-lock.json @@ -0,0 +1,51 @@ +{ + "name": "weird_deps", + "version": "0.1.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "weird_deps", + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "rescript": "file:../../.." + } + }, + "../../..": { + "name": "rescript", + "version": "11.0.0-beta.5", + "hasInstallScript": true, + "license": "SEE LICENSE IN LICENSE", + "bin": { + "bsc": "bsc", + "bstracing": "lib/bstracing", + "rescript": "rescript" + }, + "devDependencies": { + "mocha": "^10.1.0", + "nyc": "^15.0.0", + "prettier": "^2.7.1", + "rollup": "^0.49.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/rescript": { + "resolved": "../../..", + "link": true + } + }, + "dependencies": { + "rescript": { + "version": "file:../../..", + "requires": { + "mocha": "^10.1.0", + "nyc": "^15.0.0", + "prettier": "^2.7.1", + "rollup": "^0.49.2" + } + } + } +} diff --git a/jscomp/build_tests/devdeps/package.json b/jscomp/build_tests/weird_deps/package.json similarity index 74% rename from jscomp/build_tests/devdeps/package.json rename to jscomp/build_tests/weird_deps/package.json index 7c4250ad69..89e420eb74 100644 --- a/jscomp/build_tests/devdeps/package.json +++ b/jscomp/build_tests/weird_deps/package.json @@ -1,5 +1,5 @@ { - "name": "devdeps", + "name": "weird_deps", "version": "0.1.0", "scripts": { "clean": "rescript clean", @@ -11,7 +11,7 @@ ], "author": "", "license": "MIT", - "devDependencies": { - "bs-platform": "^5.0.5" + "dependencies": { + "rescript": "file:../../.." } } \ No newline at end of file diff --git a/jscomp/build_tests/devdeps/src/demo.res b/jscomp/build_tests/weird_deps/src/demo.res similarity index 100% rename from jscomp/build_tests/devdeps/src/demo.res rename to jscomp/build_tests/weird_deps/src/demo.res diff --git a/jscomp/build_tests/devdeps/test/test.res b/jscomp/build_tests/weird_deps/test/test.res similarity index 100% rename from jscomp/build_tests/devdeps/test/test.res rename to jscomp/build_tests/weird_deps/test/test.res diff --git a/jscomp/build_tests/weird_devdeps/.gitignore b/jscomp/build_tests/weird_devdeps/.gitignore new file mode 100644 index 0000000000..1c2bb277a5 --- /dev/null +++ b/jscomp/build_tests/weird_devdeps/.gitignore @@ -0,0 +1,26 @@ +*.exe +*.obj +*.out +*.compile +*.native +*.byte +*.cmo +*.annot +*.cmi +*.cmx +*.cmt +*.cmti +*.cma +*.a +*.cmxa +*.obj +*~ +*.annot +*.cmj +*.bak +lib/bs +*.mlast +*.mliast +.vscode +.merlin +.bsb.lock \ No newline at end of file diff --git a/jscomp/build_tests/weird_devdeps/README.md b/jscomp/build_tests/weird_devdeps/README.md new file mode 100644 index 0000000000..1c02d2a072 --- /dev/null +++ b/jscomp/build_tests/weird_devdeps/README.md @@ -0,0 +1,16 @@ + + +# Build +``` +npm run build +``` + +# Watch + +``` +npm run watch +``` + + +# Editor +If you use `vscode`, Press `Windows + Shift + B` it will build automatically \ No newline at end of file diff --git a/jscomp/build_tests/devdeps/bsconfig.json b/jscomp/build_tests/weird_devdeps/bsconfig.json similarity index 92% rename from jscomp/build_tests/devdeps/bsconfig.json rename to jscomp/build_tests/weird_devdeps/bsconfig.json index 04e9b0a7ff..9b8640aff3 100644 --- a/jscomp/build_tests/devdeps/bsconfig.json +++ b/jscomp/build_tests/weird_devdeps/bsconfig.json @@ -1,5 +1,5 @@ { - "name": "devdeps", + "name": "weird_devdeps", "version": "0.1.0", "sources": [{ "dir" : "src", diff --git a/jscomp/build_tests/weird_devdeps/input.js b/jscomp/build_tests/weird_devdeps/input.js new file mode 100644 index 0000000000..6e2a156015 --- /dev/null +++ b/jscomp/build_tests/weird_devdeps/input.js @@ -0,0 +1,24 @@ +//@ts-check + +var cp = require("child_process"); +var assert = require("assert"); +var rescript_exe = require("../../../scripts/bin_path").rescript_exe; + +var out = cp.spawnSync(rescript_exe, { + cwd: __dirname, + encoding: "utf8", +}); + +if (out.stdout !== "") { + assert.fail(out.stdout); +} else { + assert.equal( + out.stderr, + [ + 'File "bsconfig.json", line 1', + "Error: package weird not found or built ", + "- Did you install it?", + "", + ].join("\n") + ); +} diff --git a/jscomp/build_tests/weird_devdeps/package-lock.json b/jscomp/build_tests/weird_devdeps/package-lock.json new file mode 100644 index 0000000000..d7fdbe617a --- /dev/null +++ b/jscomp/build_tests/weird_devdeps/package-lock.json @@ -0,0 +1,51 @@ +{ + "name": "weird_devdeps", + "version": "0.1.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "weird_devdeps", + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "rescript": "file:../../.." + } + }, + "../../..": { + "name": "rescript", + "version": "11.0.0-beta.5", + "hasInstallScript": true, + "license": "SEE LICENSE IN LICENSE", + "bin": { + "bsc": "bsc", + "bstracing": "lib/bstracing", + "rescript": "rescript" + }, + "devDependencies": { + "mocha": "^10.1.0", + "nyc": "^15.0.0", + "prettier": "^2.7.1", + "rollup": "^0.49.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/rescript": { + "resolved": "../../..", + "link": true + } + }, + "dependencies": { + "rescript": { + "version": "file:../../..", + "requires": { + "mocha": "^10.1.0", + "nyc": "^15.0.0", + "prettier": "^2.7.1", + "rollup": "^0.49.2" + } + } + } +} diff --git a/jscomp/build_tests/weird_devdeps/package.json b/jscomp/build_tests/weird_devdeps/package.json new file mode 100644 index 0000000000..857a3ca983 --- /dev/null +++ b/jscomp/build_tests/weird_devdeps/package.json @@ -0,0 +1,17 @@ +{ + "name": "weird_devdeps", + "version": "0.1.0", + "scripts": { + "clean": "rescript clean", + "build": "rescript build", + "watch": "rescript build -w" + }, + "keywords": [ + "BuckleScript" + ], + "author": "", + "license": "MIT", + "dependencies": { + "rescript": "file:../../.." + } +} \ No newline at end of file diff --git a/jscomp/build_tests/weird_devdeps/src/demo.res b/jscomp/build_tests/weird_devdeps/src/demo.res new file mode 100644 index 0000000000..9af096591d --- /dev/null +++ b/jscomp/build_tests/weird_devdeps/src/demo.res @@ -0,0 +1 @@ +let () = Js.log("Hello, BuckleScript") diff --git a/jscomp/build_tests/weird_devdeps/test/test.res b/jscomp/build_tests/weird_devdeps/test/test.res new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/jscomp/build_tests/weird_devdeps/test/test.res @@ -0,0 +1 @@ + From e8ee64860d2dd44ec27d2060d2d0e20fd8ba56ca Mon Sep 17 00:00:00 2001 From: Dmitry Zakharov Date: Wed, 16 Aug 2023 17:24:21 +0400 Subject: [PATCH 4/9] Update changelog --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54d2673a0e..22fe0b922e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ # 11.0.0-rc.2 (Unreleased) +#### :rocket: New Feature + +- `rescript build` will always build its dependency by default. The argument `-with-deps` is not needed anymore. https://github.com/rescript-lang/rescript-compiler/pull/6350 + #### :bug: Bug Fix - Fixed outcome printer resolution of uncurried config. https://github.com/rescript-lang/rescript-compiler/pull/6353 @@ -31,7 +35,6 @@ - Conditionally print error message about record with missing label potentially being a component. https://github.com/rescript-lang/rescript-compiler/pull/6337 - Put definition in the bottom and the actual error at the top when reporting errors for supplying fields etc with the wrong name. https://github.com/rescript-lang/rescript-compiler/pull/6336 - Fix left over places where polyvariant tag names were printed in OCaml syntax instead of ReScript. https://github.com/rescript-lang/rescript-compiler/pull/6348 -- `rescript build` will always build its dependency by default. The argument `-with-deps` is not needed anymore. https://github.com/rescript-lang/rescript-compiler/pull/6350 # 11.0.0-beta.4 From 8281983fce568b84fbcac4a36673841a4d0440cb Mon Sep 17 00:00:00 2001 From: Dmitry Zakharov Date: Fri, 18 Aug 2023 12:54:45 +0400 Subject: [PATCH 5/9] Update args parse message --- jscomp/bsb_exe/rescript_main.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jscomp/bsb_exe/rescript_main.ml b/jscomp/bsb_exe/rescript_main.ml index 33666d0981..8d041534f4 100644 --- a/jscomp/bsb_exe/rescript_main.ml +++ b/jscomp/bsb_exe/rescript_main.ml @@ -115,7 +115,7 @@ let build_subcommand ~start argv argv_len = ~argv [| ("-w", unit_set_spec watch_mode, "Watch mode"); - ("-with-deps", unit_set_spec (ref true), "*deprecated* Build dependencies explicitly"); + ("-with-deps", unit_set_spec (ref true), "*deprecated* This is the default behavior now. This option will be removed in a future release"); ( "-install", unit_set_spec do_install, "*internal* Install public interface files for dependencies" ); @@ -153,7 +153,7 @@ let clean_subcommand ~start argv = [| ( "-with-deps", unit_set_spec (ref true), - "*deprecated* Clean dependencies too" ); + "*deprecated* This is the default behavior now. This option will be removed in a future release" ); ("-verbose", call_spec Bsb_log.verbose, "Set the output to be verbose"); |] failed_annon; From ee7f8a8f88d9c866fed2a8b078403a18918ee9a8 Mon Sep 17 00:00:00 2001 From: Dmitry Zakharov Date: Fri, 18 Aug 2023 13:05:23 +0400 Subject: [PATCH 6/9] Fix error --- .../super_errors/expected/modules1.res.expected | 2 +- jscomp/ml/typetexp.ml | 1 + scripts/ciTest.js | 12 ++++++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/jscomp/build_tests/super_errors/expected/modules1.res.expected b/jscomp/build_tests/super_errors/expected/modules1.res.expected index 7248f56965..e818260bec 100644 --- a/jscomp/build_tests/super_errors/expected/modules1.res.expected +++ b/jscomp/build_tests/super_errors/expected/modules1.res.expected @@ -8,4 +8,4 @@ The module or file Foo can't be found. - If it's a third-party dependency: - Did you list it in bsconfig.json? - - Did you include the file's directory in bsconfig.json? \ No newline at end of file + - Did you include the file's directory in bsconfig.json? \ No newline at end of file diff --git a/jscomp/ml/typetexp.ml b/jscomp/ml/typetexp.ml index 24614dc398..1323664665 100644 --- a/jscomp/ml/typetexp.ml +++ b/jscomp/ml/typetexp.ml @@ -994,6 +994,7 @@ let report_error env ppf = function @{The module or file %a can't be found.@}@,\ @[- If it's a third-party dependency:@,\ - Did you list it in bsconfig.json?@,\ + @]@,\ - Did you include the file's directory in bsconfig.json?@]\ @]" Printtyp.longident lid diff --git a/scripts/ciTest.js b/scripts/ciTest.js index 1a60a36cf2..e10730c8b3 100644 --- a/scripts/ciTest.js +++ b/scripts/ciTest.js @@ -63,11 +63,11 @@ function runTests() { var buildTestDir = path.join(__dirname, "..", "jscomp", "build_tests"); var linkCmd = `npm link ../..`; console.log(linkCmd); - cp.execSync(linkCmd, { - cwd: buildTestDir, - stdio: [0, 1, 2], - encoding: "utf8", - }); + // cp.execSync(linkCmd, { + // cwd: buildTestDir, + // stdio: [0, 1, 2], + // encoding: "utf8", + // }); var files = fs.readdirSync(buildTestDir); files.forEach(function (file) { var testDir = path.join(buildTestDir, file); @@ -87,7 +87,7 @@ function runTests() { if (error !== null) { console.log(stderr); - throw new Error(`❌ error in ${file}: \n${error} `); + // throw new Error(`❌ error in ${file}: \n${error} `); } else { console.log("✅ success in ", file); } From 213b9654fd8ae84a2d77fa6f93e2a8bef02ea3d9 Mon Sep 17 00:00:00 2001 From: Dmitry Zakharov Date: Fri, 18 Aug 2023 15:16:14 +0400 Subject: [PATCH 7/9] Uncomment ciTest code --- scripts/ciTest.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/ciTest.js b/scripts/ciTest.js index e10730c8b3..1a60a36cf2 100644 --- a/scripts/ciTest.js +++ b/scripts/ciTest.js @@ -63,11 +63,11 @@ function runTests() { var buildTestDir = path.join(__dirname, "..", "jscomp", "build_tests"); var linkCmd = `npm link ../..`; console.log(linkCmd); - // cp.execSync(linkCmd, { - // cwd: buildTestDir, - // stdio: [0, 1, 2], - // encoding: "utf8", - // }); + cp.execSync(linkCmd, { + cwd: buildTestDir, + stdio: [0, 1, 2], + encoding: "utf8", + }); var files = fs.readdirSync(buildTestDir); files.forEach(function (file) { var testDir = path.join(buildTestDir, file); @@ -87,7 +87,7 @@ function runTests() { if (error !== null) { console.log(stderr); - // throw new Error(`❌ error in ${file}: \n${error} `); + throw new Error(`❌ error in ${file}: \n${error} `); } else { console.log("✅ success in ", file); } From 9fc06626241991ebb11d9986900e8cc9097026c4 Mon Sep 17 00:00:00 2001 From: Dmitry Zakharov Date: Fri, 18 Aug 2023 18:15:23 +0400 Subject: [PATCH 8/9] Update module not found error. --- .../super_errors/expected/modules1.res.expected | 4 ++-- jscomp/ml/typetexp.ml | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/jscomp/build_tests/super_errors/expected/modules1.res.expected b/jscomp/build_tests/super_errors/expected/modules1.res.expected index e818260bec..309f16af3d 100644 --- a/jscomp/build_tests/super_errors/expected/modules1.res.expected +++ b/jscomp/build_tests/super_errors/expected/modules1.res.expected @@ -7,5 +7,5 @@ The module or file Foo can't be found. - If it's a third-party dependency: - - Did you list it in bsconfig.json? - - Did you include the file's directory in bsconfig.json? \ No newline at end of file + - Did you add it to the "bs-dependencies" or "bs-dev-dependencies" in bsconfig.json? + - Did you include the file's directory to the "sources" in bsconfig.json? \ No newline at end of file diff --git a/jscomp/ml/typetexp.ml b/jscomp/ml/typetexp.ml index 1323664665..5e632574eb 100644 --- a/jscomp/ml/typetexp.ml +++ b/jscomp/ml/typetexp.ml @@ -993,10 +993,9 @@ let report_error env ppf = function Format.fprintf ppf "@[\ @{The module or file %a can't be found.@}@,\ @[- If it's a third-party dependency:@,\ - - Did you list it in bsconfig.json?@,\ - @]@,\ - - Did you include the file's directory in bsconfig.json?@]\ - @]" + - Did you add it to the \"bs-dependencies\" or \"bs-dev-dependencies\" in bsconfig.json?@]@,\ + - Did you include the file's directory to the \"sources\" in bsconfig.json?@,\ + " Printtyp.longident lid end end; From 4d983cb75afe6cff7f497378d8a3529ec5b2a7e3 Mon Sep 17 00:00:00 2001 From: Dmitry Zakharov Date: Fri, 18 Aug 2023 18:28:06 +0400 Subject: [PATCH 9/9] Clean up build_tests package jsons --- .../build_tests/weird_deps/package-lock.json | 40 +------------------ jscomp/build_tests/weird_deps/package.json | 5 +-- .../weird_devdeps/package-lock.json | 23 ++--------- jscomp/build_tests/weird_devdeps/package.json | 5 +-- 4 files changed, 6 insertions(+), 67 deletions(-) diff --git a/jscomp/build_tests/weird_deps/package-lock.json b/jscomp/build_tests/weird_deps/package-lock.json index fd3dfa1d67..4eb41c87e0 100644 --- a/jscomp/build_tests/weird_deps/package-lock.json +++ b/jscomp/build_tests/weird_deps/package-lock.json @@ -7,45 +7,7 @@ "": { "name": "weird_deps", "version": "0.1.0", - "license": "MIT", - "dependencies": { - "rescript": "file:../../.." - } - }, - "../../..": { - "name": "rescript", - "version": "11.0.0-beta.5", - "hasInstallScript": true, - "license": "SEE LICENSE IN LICENSE", - "bin": { - "bsc": "bsc", - "bstracing": "lib/bstracing", - "rescript": "rescript" - }, - "devDependencies": { - "mocha": "^10.1.0", - "nyc": "^15.0.0", - "prettier": "^2.7.1", - "rollup": "^0.49.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/rescript": { - "resolved": "../../..", - "link": true - } - }, - "dependencies": { - "rescript": { - "version": "file:../../..", - "requires": { - "mocha": "^10.1.0", - "nyc": "^15.0.0", - "prettier": "^2.7.1", - "rollup": "^0.49.2" - } + "license": "MIT" } } } diff --git a/jscomp/build_tests/weird_deps/package.json b/jscomp/build_tests/weird_deps/package.json index 89e420eb74..7c028a9906 100644 --- a/jscomp/build_tests/weird_deps/package.json +++ b/jscomp/build_tests/weird_deps/package.json @@ -10,8 +10,5 @@ "BuckleScript" ], "author": "", - "license": "MIT", - "dependencies": { - "rescript": "file:../../.." - } + "license": "MIT" } \ No newline at end of file diff --git a/jscomp/build_tests/weird_devdeps/package-lock.json b/jscomp/build_tests/weird_devdeps/package-lock.json index d7fdbe617a..5688c31658 100644 --- a/jscomp/build_tests/weird_devdeps/package-lock.json +++ b/jscomp/build_tests/weird_devdeps/package-lock.json @@ -7,14 +7,12 @@ "": { "name": "weird_devdeps", "version": "0.1.0", - "license": "MIT", - "dependencies": { - "rescript": "file:../../.." - } + "license": "MIT" }, "../../..": { "name": "rescript", - "version": "11.0.0-beta.5", + "version": "11.0.0-rc.2", + "extraneous": true, "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE", "bin": { @@ -31,21 +29,6 @@ "engines": { "node": ">=10" } - }, - "node_modules/rescript": { - "resolved": "../../..", - "link": true - } - }, - "dependencies": { - "rescript": { - "version": "file:../../..", - "requires": { - "mocha": "^10.1.0", - "nyc": "^15.0.0", - "prettier": "^2.7.1", - "rollup": "^0.49.2" - } } } } diff --git a/jscomp/build_tests/weird_devdeps/package.json b/jscomp/build_tests/weird_devdeps/package.json index 857a3ca983..b7116d34eb 100644 --- a/jscomp/build_tests/weird_devdeps/package.json +++ b/jscomp/build_tests/weird_devdeps/package.json @@ -10,8 +10,5 @@ "BuckleScript" ], "author": "", - "license": "MIT", - "dependencies": { - "rescript": "file:../../.." - } + "license": "MIT" } \ No newline at end of file