Skip to content

Commit

Permalink
Ensure composite dependencies are version limited
Browse files Browse the repository at this point in the history
Use versions restricted to semver major component for additional
packages added to the composite to avoid breaking compatibility.
  • Loading branch information
friederbluemle committed Mar 10, 2023
1 parent ee9cda1 commit 0d6aec3
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ern-composite-gen/src/generateComposite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ async function generateFullComposite(
);
// Also add latest version of the bridge
extraJsDependencies.push(
PackagePath.fromString(`react-native-electrode-bridge`),
PackagePath.fromString('react-native-electrode-bridge@^1.0.0'),
);
extraJsDependencies = [...extraJsDependencies, ...jsApiImplDependencies];
}
Expand All @@ -213,8 +213,8 @@ async function generateFullComposite(
installExtraPackages({
cwd: outDir,
extraJsDependencies: [
PackagePath.fromString('ern-bundle-store-metro-asset-plugin'),
PackagePath.fromString('react-native-svg-transformer'),
PackagePath.fromString('ern-bundle-store-metro-asset-plugin@^1.0.0'),
PackagePath.fromString('react-native-svg-transformer@^1.0.0'),
...extraJsDependencies,
],
}),
Expand Down Expand Up @@ -248,9 +248,10 @@ async function generateFullComposite(
// Exclude api/api impls as they are not native modules
allNativeDeps.apis = [];
allNativeDeps.nativeApisImpl = [];
const dedupedNativeModules = nativeDepenciesVersionResolution.resolveNativeDependenciesVersionsEx(
allNativeDeps,
);
const dedupedNativeModules =
nativeDepenciesVersionResolution.resolveNativeDependenciesVersionsEx(
allNativeDeps,
);

if (dedupedNativeModules.pluginsWithMismatchingVersions.length > 0) {
let errorMsg = `Mismatching native module versions detected.
Expand Down

0 comments on commit 0d6aec3

Please sign in to comment.