Skip to content

Commit

Permalink
fix: peer dependencies for metro configuration and lottie version
Browse files Browse the repository at this point in the history
  • Loading branch information
matinzd authored and AlexanderEggers committed Aug 3, 2022
1 parent 5f17838 commit 2dcced7
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 17 deletions.
10 changes: 5 additions & 5 deletions example/ios/Podfile.lock
Expand Up @@ -11,9 +11,9 @@ PODS:
- ReactCommon/turbomodule/core (= 0.68.2)
- fmt (6.2.1)
- glog (0.3.5)
- lottie-ios (3.2.3)
- lottie-ios (3.4.0)
- lottie-react-native (5.1.3):
- lottie-ios (~> 3.2.3)
- lottie-ios (~> 3.4.0)
- React-Core
- RCT-Folly (2021.06.28.00-v2):
- boost
Expand Down Expand Up @@ -415,8 +415,8 @@ SPEC CHECKSUMS:
FBReactNativeSpec: 81ce99032d5b586fddd6a38d450f8595f7e04be4
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 476ee3e89abb49e07f822b48323c51c57124b572
lottie-ios: c058aeafa76daa4cf64d773554bccc8385d0150e
lottie-react-native: 058cb713f9eab4bb06cde9d7efd9c6a43ad8ff4a
lottie-ios: 69495122151a378fdc7d1bb4c5930347e37baf1f
lottie-react-native: f95a72b84460e0dc0f6341a0da9702111dd11171
RCT-Folly: 4d8508a426467c48885f1151029bc15fa5d7b3b8
RCTRequired: 3e917ea5377751094f38145fdece525aa90545a0
RCTTypeSafety: c43c072a4bd60feb49a9570b0517892b4305c45e
Expand Down Expand Up @@ -448,4 +448,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: b0ca67f3cbbf53f363fc1849b8f8052ba42f48a5

COCOAPODS: 1.11.3
COCOAPODS: 1.11.2
34 changes: 27 additions & 7 deletions example/metro.config.js
@@ -1,11 +1,31 @@
/**
* Metro configuration for React Native
* https://github.com/facebook/react-native
*
* @format
*/
const path = require('path');
const exclusionList = require('metro-config/src/defaults/exclusionList');
const escape = require('escape-string-regexp');
const pack = require('../package.json');

const root = path.resolve(__dirname, '..');

const modules = [...Object.keys(pack.peerDependencies)];

module.exports = {
projectRoot: __dirname,
watchFolders: [root],

// We need to make sure that only one version is loaded for peerDependencies
// So we exclude them at the root, and alias them to the versions in example's node_modules
resolver: {
blacklistRE: exclusionList(
modules.map(
m => new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`),
),
),

extraNodeModules: modules.reduce((acc, name) => {
acc[name] = path.join(__dirname, 'node_modules', name);
return acc;
}, {}),
},

transformer: {
getTransformOptions: async () => ({
transform: {
Expand All @@ -14,4 +34,4 @@ module.exports = {
},
}),
},
};
};
2 changes: 1 addition & 1 deletion example/package.json
Expand Up @@ -17,7 +17,7 @@
"react-native": "0.68.2",
"react-native-windows": "0.68.3",
"lottie-react-native": "file:..",
"lottie-ios": "^3.2.3",
"lottie-ios": "3.4.0",
"@react-native-community/slider": "^4.2.2",
"@react-native-picker/picker": "^2.4.1"
},
Expand Down
8 changes: 4 additions & 4 deletions example/yarn.lock
Expand Up @@ -4844,10 +4844,10 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0:
dependencies:
js-tokens "^3.0.0 || ^4.0.0"

lottie-ios@^3.2.3:
version "3.2.3"
resolved "https://registry.yarnpkg.com/lottie-ios/-/lottie-ios-3.2.3.tgz#d5a029ccce611603d178ea7ba725c1446f2310b4"
integrity sha512-mubYMN6+1HXa8z3EJKBvNBkl4UoVM4McjESeB2PgvRMSngmJtC5yUMRdhbbrIAn5Liu3hFGao/14s5hQIgtkRQ==
lottie-ios@3.4.0:
version "3.4.0"
resolved "https://registry.yarnpkg.com/lottie-ios/-/lottie-ios-3.4.0.tgz#a23be299760aefb44298b9cb5f60df489030adbf"
integrity sha512-qnV8UrawwnBRf5V0no2yxlPUE69vzfFqpxEEXGTZhb1/WX1xewqVNYvtbguqwQkdu9IT9D5WC1U9CHZ1KbkGDw==

"lottie-react-native@file:..":
version "5.1.3"
Expand Down

0 comments on commit 2dcced7

Please sign in to comment.