File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,19 @@ processWorkspace() {
4747 fi
4848
4949 echo -e " Processing workspace $workspace at location $location ...\n"
50+
51+ echo " Checking '$package_json_path ' for peerDependencies and importmap dependencies to have the same version"
52+ deps=$( jq -r ' .peerDependencies | keys[]' " $package_json_path " )
53+ for library in $deps ; do
54+ version=$( jq -r " .peerDependencies.\" $library \" " " $package_json_path " )
55+ importmap_version=$( jq -r " .symfony.importmap.\" $library \" " " $package_json_path " )
56+
57+ if [ " $version " != " $importmap_version " ]; then
58+ echo " -> Version mismatch for $library : $version (peerDependencies) vs $importmap_version (importmap)"
59+ echo " -> You need to match the version of the \" peerDependency\" with the version in the \" importmap\" "
60+ exit
61+ fi
62+ done
5063
5164 echo " Checking '$package_json_path ' for peerDependencies with multiple versions defined"
5265 deps_with_multiple_versions=$( jq -r ' .peerDependencies | to_entries[] | select(.value | contains("||")) | .key' " $package_json_path " )
@@ -68,6 +81,9 @@ processWorkspace() {
6881 runTestSuite
6982 fi
7083 done
84+
85+ echo " -> Reverting version changes for $library "
86+ yarn workspace " $workspace " add " $library @$versionValue " --peer
7187 done
7288 else
7389 echo -e " -> No peerDependencies found with multiple versions defined\n"
You can’t perform that action at this time.
0 commit comments