From 9344c4b2513c0527b30411152afaab6391155a53 Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Tue, 22 Jul 2025 20:33:45 +0200 Subject: [PATCH 1/2] Remove usage of deprecated rescript.json flags --- analysis/examples/example-project/rescript.json | 4 ++-- analysis/examples/larger-project/rescript.json | 4 ++-- .../examples/workspace-project/app/rescript.json | 4 ++-- analysis/examples/workspace-project/rescript.json | 2 +- docs/JSXV4.md | 2 +- packages/playground/rescript.json | 2 +- packages/playground/scripts/generate_cmijs.mjs | 2 +- rescript.json | 2 +- rewatch/CompilerConfigurationSpec.md | 6 +++--- rewatch/src/config.rs | 12 ++++++------ rewatch/testrepo/packages/file-casing/rescript.json | 2 +- rewatch/tests/compile.sh | 2 +- runtime/Belt.res | 2 +- runtime/rescript.json | 2 +- scripts/res/rescript.json | 2 +- .../tests-generic-jsx-transform/rescript.json | 2 +- .../tests-incremental-typechecking/rescript.json | 2 +- .../tests-reanalyze/deadcode/rescript.json | 2 +- .../tests-reanalyze/termination/rescript.json | 2 +- tests/analysis_tests/tests/rescript.json | 4 ++-- tests/build_tests/case/rescript.json | 2 +- tests/build_tests/case2/rescript.json | 2 +- tests/build_tests/case3/rescript.json | 2 +- tests/build_tests/custom_namespace/rescript.json | 2 +- tests/build_tests/cycle/rescript.json | 2 +- .../duplicated_symlinked_packages/a/rescript.json | 2 +- .../duplicated_symlinked_packages/b/rescript.json | 2 +- .../duplicated_symlinked_packages/rescript.json | 2 +- tests/build_tests/install/rescript.json | 2 +- .../jsx_settings_inheritance/rescript.json | 2 +- tests/build_tests/rerror/rescript.json | 2 +- .../transitive_dependency/a/rescript.json | 2 +- tests/build_tests/weird_deps/rescript.json | 2 +- tests/build_tests/weird_devdeps/rescript.json | 4 ++-- tests/build_tests/zerocycle/rescript.json | 2 +- .../typescript-react-example/rescript.json | 4 ++-- tests/ounit_tests/ounit_bsb_regex_tests.ml | 4 ++-- .../data/idempotency/genType/src/Config_.res | 2 +- tests/tests/rescript.json | 2 +- tests/tools_tests/rescript.json | 2 +- tools/README.md | 2 +- 41 files changed, 55 insertions(+), 55 deletions(-) diff --git a/analysis/examples/example-project/rescript.json b/analysis/examples/example-project/rescript.json index 3d9a812dc6..f21e34c7f1 100644 --- a/analysis/examples/example-project/rescript.json +++ b/analysis/examples/example-project/rescript.json @@ -1,11 +1,11 @@ { "name": "tryit", "sources": "src", - "bsc-flags": ["-bs-super-errors", "-open Belt"], + "compiler-flags": ["-open Belt"], "warnings": { "number": "-32-26-27-33" }, - "bs-dependencies": ["reason-react"], + "dependencies": ["reason-react"], "namespace": "my-namespace", "reanalyze": { "analysis": ["dce", "exception"] diff --git a/analysis/examples/larger-project/rescript.json b/analysis/examples/larger-project/rescript.json index 56d0975d84..0fa33bdec8 100644 --- a/analysis/examples/larger-project/rescript.json +++ b/analysis/examples/larger-project/rescript.json @@ -5,8 +5,8 @@ "unsuppress": [] }, "name": "sample-typescript-app", - "bsc-flags": ["-bs-super-errors -w a"], - "bs-dependencies": ["@rescript/react", "@glennsl/bs-json"], + "compiler-flags": ["-w a"], + "dependencies": ["@rescript/react", "@glennsl/bs-json"], "sources": [ { "dir": "src", diff --git a/analysis/examples/workspace-project/app/rescript.json b/analysis/examples/workspace-project/app/rescript.json index 0b1f288e0e..031725cf01 100644 --- a/analysis/examples/workspace-project/app/rescript.json +++ b/analysis/examples/workspace-project/app/rescript.json @@ -1,7 +1,7 @@ { "name": "app", - "bsc-flags": ["-open Common"], - "bs-dependencies": ["common", "myplugin"], + "compiler-flags": ["-open Common"], + "dependencies": ["common", "myplugin"], "sources": [ { "dir": "src", diff --git a/analysis/examples/workspace-project/rescript.json b/analysis/examples/workspace-project/rescript.json index 938e29b98a..483c535f85 100644 --- a/analysis/examples/workspace-project/rescript.json +++ b/analysis/examples/workspace-project/rescript.json @@ -7,5 +7,5 @@ "in-source": true }, "suffix": ".mjs", - "bs-dependencies": ["common", "myplugin", "app"] + "dependencies": ["common", "myplugin", "app"] } diff --git a/docs/JSXV4.md b/docs/JSXV4.md index 468643081f..fe90432236 100644 --- a/docs/JSXV4.md +++ b/docs/JSXV4.md @@ -27,7 +27,7 @@ For example, suppose a V3 project uses rescript-react 0.11, which requires compa "version": 3, "v3-dependencies": ["rescript-react-native", "rescript-react-navigation"] }, -"bsc-flags": ["-open ReactV3"] +"compiler-flags": ["-open ReactV3"] ``` Another example is a V4 project that also uses `"rescript-react-native", "rescript-react-navigation"`. Then the setting will be: diff --git a/packages/playground/rescript.json b/packages/playground/rescript.json index 2b3566fd74..917f2c35bb 100644 --- a/packages/playground/rescript.json +++ b/packages/playground/rescript.json @@ -10,7 +10,7 @@ "in-source": false, "suffix": ".res.js" }, - "bs-dependencies": [ + "dependencies": [ "@rescript/react" ] } diff --git a/packages/playground/scripts/generate_cmijs.mjs b/packages/playground/scripts/generate_cmijs.mjs index a89b899f32..e7194efca4 100644 --- a/packages/playground/scripts/generate_cmijs.mjs +++ b/packages/playground/scripts/generate_cmijs.mjs @@ -30,7 +30,7 @@ exec("yarn rescript legacy"); // Otherwise we can't use them for compilation within the playground. buildCmij(compilerRootDir, "compiler-builtins"); -const packages = resConfig["bs-dependencies"]; +const packages = resConfig["dependencies"]; for (const pkgName of packages) { buildCmij( path.join(compilerRootDir, "node_modules", pkgName), diff --git a/rescript.json b/rescript.json index 81a65948fd..1f566dcf3d 100644 --- a/rescript.json +++ b/rescript.json @@ -1,4 +1,4 @@ { "name": "rescript", - "bs-dependencies": ["@tests/gentype-react-example"] + "dependencies": ["@tests/gentype-react-example"] } diff --git a/rewatch/CompilerConfigurationSpec.md b/rewatch/CompilerConfigurationSpec.md index 4b9ba53dbd..b47b4da6d5 100644 --- a/rewatch/CompilerConfigurationSpec.md +++ b/rewatch/CompilerConfigurationSpec.md @@ -13,13 +13,13 @@ This document contains a list of all bsconfig parameters with remarks, and wheth | sources | Source | | [x] | | sources | array of Source | | [x] | | ignored-dirs | array of string | | [_] | -| bs-dependencies | array of string | | [x] | -| bs-dev-dependencies | array of string | | [x] | +| dependencies | array of string | | [x] | +| dev-dependencies | array of string | | [x] | | generators | array of Rule-Generator | | [_] | | cut-generators | boolean | | [_] | | jsx | JSX | | [x] | | gentypeconfig | Gentype | | [_] | -| bsc-flags | array of string | | [x] | +| compiler-flags | array of string | | [x] | | warnings | Warnings | | [x] | | ppx-flags | array of string | | [x] | | pp-flags | array of string | | [_] | diff --git a/rewatch/src/config.rs b/rewatch/src/config.rs index 744ddd7985..6d2878c790 100644 --- a/rewatch/src/config.rs +++ b/rewatch/src/config.rs @@ -655,7 +655,7 @@ pub mod tests { "sources": [ { "dir": "src/", "subdirs": true } ], "package-specs": [ { "module": "es6", "in-source": true } ], "suffix": ".mjs", - "bs-dependencies": [ "@teamwalnut/app" ] + "dependencies": [ "@teamwalnut/app" ] } "#; @@ -683,7 +683,7 @@ pub mod tests { "module": "esmodule", "in-source": true }, - "bs-dev-dependencies": ["@rescript/tools"], + "dev-dependencies": ["@rescript/tools"], "warnings": { "error": "+101" } @@ -714,7 +714,7 @@ pub mod tests { "module": "esmodule", "in-source": true }, - "bs-dev-dependencies": ["@rescript/tools"], + "dev-dependencies": ["@rescript/tools"], "suffix": ".mjs", "warnings": { "error": "+101" @@ -742,7 +742,7 @@ pub mod tests { "sources": [ { "dir": "src/", "subdirs": true } ], "package-specs": [ { "module": "es6", "in-source": true } ], "suffix": ".mjs", - "bs-dependencies": [ "@teamwalnut/app" ], + "dependencies": [ "@teamwalnut/app" ], "gentypeconfig": { "module": "esmodule", "generatedFileExtension": ".gen.tsx" @@ -763,7 +763,7 @@ pub mod tests { "sources": [ { "dir": "src/", "subdirs": true } ], "package-specs": [ { "module": "es6", "in-source": true } ], "suffix": ".mjs", - "bs-dependencies": [ "@teamwalnut/app" ], + "dependencies": [ "@teamwalnut/app" ], "jsx": { "module": "Voby.JSX" } @@ -792,7 +792,7 @@ pub mod tests { "sources": [ { "dir": "src/", "subdirs": true } ], "package-specs": [ { "module": "es6", "in-source": true } ], "suffix": ".mjs", - "bs-dependencies": [ "@teamwalnut/app" ], + "dependencies": [ "@teamwalnut/app" ], "jsx": { "version": 4, "preserve": true } } "#; diff --git a/rewatch/testrepo/packages/file-casing/rescript.json b/rewatch/testrepo/packages/file-casing/rescript.json index 941781cb67..50914c1025 100644 --- a/rewatch/testrepo/packages/file-casing/rescript.json +++ b/rewatch/testrepo/packages/file-casing/rescript.json @@ -14,7 +14,7 @@ ], "suffix": ".mjs", "dependencies": [], - "bsc-flags": [], + "compiler-flags": [], "jsx": { "version": 4 } diff --git a/rewatch/tests/compile.sh b/rewatch/tests/compile.sh index a8fe71ea91..6e98209466 100755 --- a/rewatch/tests/compile.sh +++ b/rewatch/tests/compile.sh @@ -78,7 +78,7 @@ rewatch build --snapshot-output &> ../tests/snapshots/dependency-cycle.txt normalize_paths ../tests/snapshots/dependency-cycle.txt git checkout -- packages/new-namespace/src/NS_alias.res -# this should not compile because "@rescript/webapi" is part of bs-dev-dependencies +# this should not compile because "@rescript/webapi" is part of dev-dependencies # and FileToTest.res is not listed as "type":"dev" echo 'open WebAPI' >> packages/with-dev-deps/src/FileToTest.res rewatch build --snapshot-output &> ../tests/snapshots/bs-dev-dependency-used-by-non-dev-source.txt diff --git a/runtime/Belt.res b/runtime/Belt.res index 56b56c9a27..059ecca9fe 100644 --- a/runtime/Belt.res +++ b/runtime/Belt.res @@ -52,7 +52,7 @@ If you want to open Belt globally for all files in your project instead, you can ```json { - "bsc-flags": ["-open Belt"] + "compiler-flags": ["-open Belt"] } ``` diff --git a/runtime/rescript.json b/runtime/rescript.json index 0d7134657b..2762d15ae7 100644 --- a/runtime/rescript.json +++ b/runtime/rescript.json @@ -15,7 +15,7 @@ "in-source": false } ], - "bsc-flags": [ + "compiler-flags": [ "-make-runtime", "-nostdlib", "-nopervasives", diff --git a/scripts/res/rescript.json b/scripts/res/rescript.json index 895807e9d1..31f7a5c6c3 100644 --- a/scripts/res/rescript.json +++ b/scripts/res/rescript.json @@ -6,7 +6,7 @@ "dir": "./" } ], - "bs-dependencies": ["@tests/docstring-tests"], + "dependencies": ["@tests/docstring-tests"], "package-specs": { "module": "esmodule", "in-source": true diff --git a/tests/analysis_tests/tests-generic-jsx-transform/rescript.json b/tests/analysis_tests/tests-generic-jsx-transform/rescript.json index 22fafc0470..1580c61aa5 100644 --- a/tests/analysis_tests/tests-generic-jsx-transform/rescript.json +++ b/tests/analysis_tests/tests-generic-jsx-transform/rescript.json @@ -6,6 +6,6 @@ "subdirs": true } ], - "bsc-flags": ["-w -33-44-8"], + "compiler-flags": ["-w -33-44-8"], "jsx": { "module": "GenericJsx" } } diff --git a/tests/analysis_tests/tests-incremental-typechecking/rescript.json b/tests/analysis_tests/tests-incremental-typechecking/rescript.json index 22fafc0470..1580c61aa5 100644 --- a/tests/analysis_tests/tests-incremental-typechecking/rescript.json +++ b/tests/analysis_tests/tests-incremental-typechecking/rescript.json @@ -6,6 +6,6 @@ "subdirs": true } ], - "bsc-flags": ["-w -33-44-8"], + "compiler-flags": ["-w -33-44-8"], "jsx": { "module": "GenericJsx" } } diff --git a/tests/analysis_tests/tests-reanalyze/deadcode/rescript.json b/tests/analysis_tests/tests-reanalyze/deadcode/rescript.json index dcab003eca..467c603309 100644 --- a/tests/analysis_tests/tests-reanalyze/deadcode/rescript.json +++ b/tests/analysis_tests/tests-reanalyze/deadcode/rescript.json @@ -7,7 +7,7 @@ }, "name": "sample-typescript-app", "jsx": { "version": 4 }, - "bs-dependencies": ["@rescript/react"], + "dependencies": ["@rescript/react"], "sources": [ { "dir": "src", diff --git a/tests/analysis_tests/tests-reanalyze/termination/rescript.json b/tests/analysis_tests/tests-reanalyze/termination/rescript.json index c1a2690d9d..3c8e376d60 100644 --- a/tests/analysis_tests/tests-reanalyze/termination/rescript.json +++ b/tests/analysis_tests/tests-reanalyze/termination/rescript.json @@ -5,7 +5,7 @@ "unsuppress": [] }, "name": "arnold", - "bs-dependencies": [], + "dependencies": [], "sources": [ { "dir": "src", diff --git a/tests/analysis_tests/tests/rescript.json b/tests/analysis_tests/tests/rescript.json index 731b10efe2..4a4757d332 100644 --- a/tests/analysis_tests/tests/rescript.json +++ b/tests/analysis_tests/tests/rescript.json @@ -9,8 +9,8 @@ "subdirs": true } ], - "bsc-flags": ["-w -33-44-8"], - "bs-dependencies": ["@rescript/react"], + "compiler-flags": ["-w -33-44-8"], + "dependencies": ["@rescript/react"], "jsx": { "version": 4 }, "suffix": ".res.js", "editor": { diff --git a/tests/build_tests/case/rescript.json b/tests/build_tests/case/rescript.json index 09ac723be8..bcc01e3fdf 100644 --- a/tests/build_tests/case/rescript.json +++ b/tests/build_tests/case/rescript.json @@ -2,5 +2,5 @@ "name": "case", "version": "0.1.0", "sources": ["src"], - "bs-dependencies": [] + "dependencies": [] } diff --git a/tests/build_tests/case2/rescript.json b/tests/build_tests/case2/rescript.json index ec8b8ce528..77dda5373b 100644 --- a/tests/build_tests/case2/rescript.json +++ b/tests/build_tests/case2/rescript.json @@ -2,5 +2,5 @@ "name": "case2", "version": "0.1.0", "sources": ["src"], - "bs-dependencies": [] + "dependencies": [] } diff --git a/tests/build_tests/case3/rescript.json b/tests/build_tests/case3/rescript.json index a543e5788c..4a96fcf304 100644 --- a/tests/build_tests/case3/rescript.json +++ b/tests/build_tests/case3/rescript.json @@ -10,6 +10,6 @@ "in-source": true }, "suffix": ".res.js", - "bs-dependencies": [], + "dependencies": [], "warnings": { "error": "+101" } } diff --git a/tests/build_tests/custom_namespace/rescript.json b/tests/build_tests/custom_namespace/rescript.json index 2d0bb7284b..0bea08b625 100644 --- a/tests/build_tests/custom_namespace/rescript.json +++ b/tests/build_tests/custom_namespace/rescript.json @@ -11,7 +11,7 @@ "in-source": true, "suffix": ".res.js" }, - "bsc-flags": ["-bs-no-version-header"], + "compiler-flags": ["-bs-no-version-header"], "warnings": { "number": "-40+6+7", "error": true diff --git a/tests/build_tests/cycle/rescript.json b/tests/build_tests/cycle/rescript.json index 397c6c585b..04e2afaf30 100644 --- a/tests/build_tests/cycle/rescript.json +++ b/tests/build_tests/cycle/rescript.json @@ -10,6 +10,6 @@ "in-source": true, "suffix": ".res.js" }, - "bs-dependencies": [], + "dependencies": [], "warnings": { "error": "+101" } } diff --git a/tests/build_tests/duplicated_symlinked_packages/a/rescript.json b/tests/build_tests/duplicated_symlinked_packages/a/rescript.json index 43650453d1..503ae7562c 100644 --- a/tests/build_tests/duplicated_symlinked_packages/a/rescript.json +++ b/tests/build_tests/duplicated_symlinked_packages/a/rescript.json @@ -10,7 +10,7 @@ "in-source": true, "suffix": ".res.js" }, - "bs-dependencies": ["c", "z"], + "dependencies": ["c", "z"], "warnings": { "error": "+101" }, "namespace": true } diff --git a/tests/build_tests/duplicated_symlinked_packages/b/rescript.json b/tests/build_tests/duplicated_symlinked_packages/b/rescript.json index 46f7424882..cd344e1cb3 100644 --- a/tests/build_tests/duplicated_symlinked_packages/b/rescript.json +++ b/tests/build_tests/duplicated_symlinked_packages/b/rescript.json @@ -10,7 +10,7 @@ "in-source": true, "suffix": ".res.js" }, - "bs-dependencies": ["c"], + "dependencies": ["c"], "warnings": { "error": "+101" }, "namespace": true } diff --git a/tests/build_tests/duplicated_symlinked_packages/rescript.json b/tests/build_tests/duplicated_symlinked_packages/rescript.json index f789256d93..9055da74e6 100644 --- a/tests/build_tests/duplicated_symlinked_packages/rescript.json +++ b/tests/build_tests/duplicated_symlinked_packages/rescript.json @@ -2,5 +2,5 @@ "name": "duplicated-symlinked-packages", "version": "0.1.0", "sources": ["src"], - "bs-dependencies": ["a", "b", "z"] + "dependencies": ["a", "b", "z"] } diff --git a/tests/build_tests/install/rescript.json b/tests/build_tests/install/rescript.json index b073ff2022..9b80d4967e 100644 --- a/tests/build_tests/install/rescript.json +++ b/tests/build_tests/install/rescript.json @@ -10,6 +10,6 @@ "in-source": true, "suffix": ".res.js" }, - "bs-dependencies": [], + "dependencies": [], "warnings": { "error": "+101" } } diff --git a/tests/build_tests/jsx_settings_inheritance/rescript.json b/tests/build_tests/jsx_settings_inheritance/rescript.json index 3036b57b61..d6c9b0d729 100644 --- a/tests/build_tests/jsx_settings_inheritance/rescript.json +++ b/tests/build_tests/jsx_settings_inheritance/rescript.json @@ -14,5 +14,5 @@ "suffix": ".res.js" }, "namespace": true, - "bs-dependencies": ["@rescript/react", "a", "b"] + "dependencies": ["@rescript/react", "a", "b"] } diff --git a/tests/build_tests/rerror/rescript.json b/tests/build_tests/rerror/rescript.json index cfbe852c5e..e7c2175756 100644 --- a/tests/build_tests/rerror/rescript.json +++ b/tests/build_tests/rerror/rescript.json @@ -2,5 +2,5 @@ "name": "rerror", "version": "0.1.0", "sources": ["src"], - "bs-dependencies": [] + "dependencies": [] } diff --git a/tests/build_tests/transitive_dependency/a/rescript.json b/tests/build_tests/transitive_dependency/a/rescript.json index 42e66a06c4..bf7dd301a1 100644 --- a/tests/build_tests/transitive_dependency/a/rescript.json +++ b/tests/build_tests/transitive_dependency/a/rescript.json @@ -18,5 +18,5 @@ "warnings": { "error": true }, - "bs-dependencies": ["b"] + "dependencies": ["b"] } diff --git a/tests/build_tests/weird_deps/rescript.json b/tests/build_tests/weird_deps/rescript.json index 30c2891d34..d824a4e88f 100644 --- a/tests/build_tests/weird_deps/rescript.json +++ b/tests/build_tests/weird_deps/rescript.json @@ -16,6 +16,6 @@ "in-source": true, "suffix": ".res.js" }, - "bs-dependencies": ["weird"], + "dependencies": ["weird"], "warnings": { "error": "+101" } } diff --git a/tests/build_tests/weird_devdeps/rescript.json b/tests/build_tests/weird_devdeps/rescript.json index 85174f02e8..20c4b2e687 100644 --- a/tests/build_tests/weird_devdeps/rescript.json +++ b/tests/build_tests/weird_devdeps/rescript.json @@ -16,7 +16,7 @@ "in-source": true, "suffix": ".res.js" }, - "bs-dependencies": [], - "bs-dev-dependencies": ["weird"], + "dependencies": [], + "dev-dependencies": ["weird"], "warnings": { "error": "+101" } } diff --git a/tests/build_tests/zerocycle/rescript.json b/tests/build_tests/zerocycle/rescript.json index 1c3fa9736f..92e6a9e416 100644 --- a/tests/build_tests/zerocycle/rescript.json +++ b/tests/build_tests/zerocycle/rescript.json @@ -7,5 +7,5 @@ "in-source": true }, "suffix": ".res.js", - "bs-dependencies": [] + "dependencies": [] } diff --git a/tests/gentype_tests/typescript-react-example/rescript.json b/tests/gentype_tests/typescript-react-example/rescript.json index 60f5f49259..bde1f40eb8 100644 --- a/tests/gentype_tests/typescript-react-example/rescript.json +++ b/tests/gentype_tests/typescript-react-example/rescript.json @@ -16,9 +16,9 @@ "exportInterfaces": false }, "name": "@tests/gentype-react-example", - "bsc-flags": [], + "compiler-flags": [], "jsx": { "version": 4 }, - "bs-dependencies": ["@rescript/react"], + "dependencies": ["@rescript/react"], "sources": [ { "dir": "src", diff --git a/tests/ounit_tests/ounit_bsb_regex_tests.ml b/tests/ounit_tests/ounit_bsb_regex_tests.ml index 0f46051536..9278126c7d 100644 --- a/tests/ounit_tests/ounit_bsb_regex_tests.ml +++ b/tests/ounit_tests/ounit_bsb_regex_tests.ml @@ -37,7 +37,7 @@ let suites = "sources": [ "src" ], - "bs-dependencies" : [ + "dependencies": [ ] } |} @@ -48,7 +48,7 @@ let suites = "sources": [ "src" ], - "bs-dependencies" : [ + "dependencies": [ ] } |} diff --git a/tests/syntax_tests/data/idempotency/genType/src/Config_.res b/tests/syntax_tests/data/idempotency/genType/src/Config_.res index ceb1ab42fe..8dee359a47 100644 --- a/tests/syntax_tests/data/idempotency/genType/src/Config_.res +++ b/tests/syntax_tests/data/idempotency/genType/src/Config_.res @@ -299,7 +299,7 @@ let readConfig = (~bsVersion, ~getConfigFile, ~getBsConfigFile, ~namespace) => { | Some(True(_)) => {...config, namespace: namespace} | _ => config } - let config = switch map->String_map.find_opt("bs-dependencies") { + let config = switch map->String_map.find_opt("dependencies") { | Some(Arr({content})) => let strings = ref(list{}) content->Array.iter(x => diff --git a/tests/tests/rescript.json b/tests/tests/rescript.json index 4a21d34945..508d9b5f65 100644 --- a/tests/tests/rescript.json +++ b/tests/tests/rescript.json @@ -11,7 +11,7 @@ "in-source": true, "suffix": ".mjs" }, - "bsc-flags": [ + "compiler-flags": [ "-w -3-6-26-27-29-30-32..40-44-45-52-60-9-106+104", "-warn-error A" ] diff --git a/tests/tools_tests/rescript.json b/tests/tools_tests/rescript.json index d901f81336..c3ea48e441 100644 --- a/tests/tools_tests/rescript.json +++ b/tests/tools_tests/rescript.json @@ -9,5 +9,5 @@ "in-source": true }, "suffix": ".res.js", - "bs-dependencies": ["@rescript/react"] + "dependencies": ["@rescript/react"] } diff --git a/tools/README.md b/tools/README.md index 874e189f6b..8b7ecb3214 100644 --- a/tools/README.md +++ b/tools/README.md @@ -37,7 +37,7 @@ rescript-tools reanalyze --help Add to `bs-dev-dependencies`: ```json -"bs-dev-dependencies": ["@rescript/tools"] +"dev-dependencies": ["@rescript/tools"] ``` ```rescript From 6c5b82f6e85ab941b329d5b95b3b4a3cdc12ae62 Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Wed, 23 Jul 2025 08:36:32 +0200 Subject: [PATCH 2/2] adapt bsb --- compiler/bsb/bsb_build_schemas.ml | 3 +++ compiler/bsb/bsb_build_util.ml | 5 ++++- compiler/bsb/bsb_config_parse.ml | 26 ++++++++++++++++++++++---- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/compiler/bsb/bsb_build_schemas.ml b/compiler/bsb/bsb_build_schemas.ml index 9590fd73df..24d14027e2 100644 --- a/compiler/bsb/bsb_build_schemas.ml +++ b/compiler/bsb/bsb_build_schemas.ml @@ -27,12 +27,15 @@ let name = "name" let ppx_flags = "ppx-flags" let pp_flags = "pp-flags" let bs_external_includes = "bs-external-includes" +let dependencies = "dependencies" let bs_dependencies = "bs-dependencies" +let dev_dependencies = "dev-dependencies" let bs_dev_dependencies = "bs-dev-dependencies" let sources = "sources" let dir = "dir" let files = "files" let subdirs = "subdirs" +let compiler_flags = "compiler-flags" let bsc_flags = "bsc-flags" let excludes = "excludes" let slow_re = "slow-re" diff --git a/compiler/bsb/bsb_build_util.ml b/compiler/bsb/bsb_build_util.ml index e017e12548..72e8ed5141 100644 --- a/compiler/bsb/bsb_build_util.ml +++ b/compiler/bsb/bsb_build_util.ml @@ -193,9 +193,12 @@ let rec walk_all_deps_aux (visited : string Hash_string.t) (paths : string list) ) |> ignore in + explore_deps Bsb_build_schemas.dependencies; explore_deps Bsb_build_schemas.bs_dependencies; (match top with - | Expect_none -> explore_deps Bsb_build_schemas.bs_dev_dependencies + | Expect_none -> + explore_deps Bsb_build_schemas.dev_dependencies; + explore_deps Bsb_build_schemas.bs_dev_dependencies | Expect_name _ -> ()); Queue.add {top; proj_dir = dir} queue; Hash_string.add visited cur_package_name dir diff --git a/compiler/bsb/bsb_config_parse.ml b/compiler/bsb/bsb_config_parse.ml index 829ee4f36e..a185c56c44 100644 --- a/compiler/bsb/bsb_config_parse.ml +++ b/compiler/bsb/bsb_config_parse.ml @@ -238,13 +238,24 @@ let interpret_json ~(filename : string) ~(json : Ext_json_types.t) .path) in let bs_dependencies = - extract_dependencies map per_proj_dir Bsb_build_schemas.bs_dependencies + let dependencies = + extract_dependencies map per_proj_dir Bsb_build_schemas.dependencies + in + if dependencies == [] then + extract_dependencies map per_proj_dir Bsb_build_schemas.bs_dependencies + else dependencies in let bs_dev_dependencies = match package_kind with | Toplevel -> - extract_dependencies map per_proj_dir - Bsb_build_schemas.bs_dev_dependencies + let dev_dependencies = + extract_dependencies map per_proj_dir + Bsb_build_schemas.dev_dependencies + in + if dev_dependencies == [] then + extract_dependencies map per_proj_dir + Bsb_build_schemas.bs_dev_dependencies + else dev_dependencies | Dependency _ -> [] in match map.?(Bsb_build_schemas.sources) with @@ -258,7 +269,14 @@ let interpret_json ~(filename : string) ~(json : Ext_json_types.t) (* ~namespace *) sources in - let bsc_flags = extract_string_list map Bsb_build_schemas.bsc_flags in + let bsc_flags = + let compiler_flags = + extract_string_list map Bsb_build_schemas.compiler_flags + in + if compiler_flags == [] then + extract_string_list map Bsb_build_schemas.bsc_flags + else compiler_flags + in let jsx = Bsb_jsx.from_map map in let jsx, bsc_flags = match package_kind with