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() {
47
47
fi
48
48
49
49
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
50
63
51
64
echo " Checking '$package_json_path ' for peerDependencies with multiple versions defined"
52
65
deps_with_multiple_versions=$( jq -r ' .peerDependencies | to_entries[] | select(.value | contains("||")) | .key' " $package_json_path " )
@@ -68,6 +81,9 @@ processWorkspace() {
68
81
runTestSuite
69
82
fi
70
83
done
84
+
85
+ echo " -> Reverting version changes for $library "
86
+ yarn workspace " $workspace " add " $library @$versionValue " --peer
71
87
done
72
88
else
73
89
echo -e " -> No peerDependencies found with multiple versions defined\n"
You can’t perform that action at this time.
0 commit comments