diff --git a/CHANGELOG.md b/CHANGELOG.md index 050efd5c97..4f330627d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,10 @@ - Remove uncurried handling from rewatch. https://github.com/rescript-lang/rescript/pull/7625 +#### :nail_care: Polish + +- Add a warning if the name in package.json does not match the name in rescript.json. https://github.com/rescript-lang/rescript/pull/7604 + # 12.0.0-alpha.15 #### :boom: Breaking Change diff --git a/rewatch/src/build/packages.rs b/rewatch/src/build/packages.rs index bd30d2576f..92d15bb6fd 100644 --- a/rewatch/src/build/packages.rs +++ b/rewatch/src/build/packages.rs @@ -427,6 +427,17 @@ fn make_package(config: config::Config, package_path: &Path, is_pinned_dep: bool }; let package_name = read_package_name(package_path).expect("Could not read package name"); + if package_name != config.name { + log::warn!( + "\nPackage name mismatch for {}:\n\ +The package.json name is \"{}\", while the rescript.json name is \"{}\"\n\ +This inconsistency will cause issues with package resolution.\n", + package_path.to_string_lossy(), + package_name, + config.name, + ); + } + Package { name: package_name, config: config.to_owned(),