Skip to content

Commit 8be72cc

Browse files
committed
Mention which package was not found in the build state.
1 parent 76d783e commit 8be72cc

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

rescript.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"name": "rescript",
33
"bs-dependencies": [
4-
"@tests/gentype-react-example"
4+
"@tests/gentype-react-example",
5+
"@tests/rescript-react",
6+
"@tests/analysis"
57
]
68
}

rewatch/src/build/clean.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ fn clean_source_files(build_state: &BuildState, root_package: &packages::Package
6565
.values()
6666
.filter_map(|module| match &module.source_type {
6767
SourceType::SourceFile(source_file) => {
68-
let package = build_state.packages.get(&module.package_name).unwrap();
68+
let package = build_state.packages.get(&module.package_name).unwrap_or_else(|| {
69+
panic!(
70+
"Could not find package for \"{}\" in build state",
71+
&module.package_name
72+
)
73+
});
6974
Some(
7075
root_package
7176
.config

tests/analysis_tests/tests/rescript.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "test",
2+
"name": "@tests/analysis",
33
"reanalyze": {
44
"analysis": ["dce"]
55
},

tests/dependencies/rescript-react/rescript.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@rescript/react",
2+
"name": "@tests/rescript-react",
33
"jsx": {
44
"version": 4,
55
"mode": "classic"

0 commit comments

Comments
 (0)