Skip to content

Commit e44a305

Browse files
committed
fix: try build purely from lib
1 parent e1d6445 commit e44a305

File tree

4 files changed

+69
-169
lines changed

4 files changed

+69
-169
lines changed

examples/SampleApp/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2777,7 +2777,7 @@ SPEC CHECKSUMS:
27772777
FirebaseRemoteConfigInterop: 7b74ceaa54e28863ed17fa39da8951692725eced
27782778
FirebaseSessions: eaa8ec037e7793769defe4201c20bd4d976f9677
27792779
fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd
2780-
glog: eb93e2f488219332457c3c4eafd2738ddc7e80b8
2780+
glog: 5683914934d5b6e4240e497e0f4a3b42d1854183
27812781
GoogleAppMeasurement: 0dfca1a4b534d123de3945e28f77869d10d0d600
27822782
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
27832783
GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1
@@ -2787,7 +2787,7 @@ SPEC CHECKSUMS:
27872787
op-sqlite: 6a5255f36253697406618ceba5212d6572012a9d
27882788
PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47
27892789
PromisesSwift: 9d77319bbe72ebf6d872900551f7eeba9bce2851
2790-
RCT-Folly: e78785aa9ba2ed998ea4151e314036f6c49e6d82
2790+
RCT-Folly: 36fe2295e44b10d831836cc0d1daec5f8abcf809
27912791
RCTDeprecation: c3e3f5b4ea83e7ff3bc86ce09e2a54b7affd687d
27922792
RCTRequired: ee438439880dffc9425930d1dd1a3c883ee6879c
27932793
RCTTypeSafety: fe728195791e1a0222aa83596a570cf377cd475e

examples/SampleApp/metro.config.js

Lines changed: 3 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,11 @@
1-
const { getDefaultConfig } = require('@react-native/metro-config');
2-
const { exclusionList, resolveUniqueModule } = require('@rnx-kit/metro-config');
1+
const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
32

43
/**
54
* Metro configuration
65
* https://reactnative.dev/docs/metro
76
*
87
* @type {import('@react-native/metro-config').MetroConfig}
98
*/
10-
const config = getDefaultConfig(__dirname);
9+
const config = {};
1110

12-
const PATH = require('path');
13-
const packageDirPath = PATH.resolve(__dirname, '../../package');
14-
const nativePackageDirPath = PATH.resolve(__dirname, '../../package/native-package');
15-
16-
const symlinked = {
17-
'stream-chat-react-native': nativePackageDirPath,
18-
'stream-chat-react-native-core': packageDirPath,
19-
};
20-
21-
// find what all modules need to be unique for the app (mainly react and react-native)
22-
// note: we filter the symlinked modules as they are already unique
23-
// and as they dont follow the workspace pattern the auto-generated path to the module is incorrect
24-
const dependencyPackageNames = Object.keys(require('./package.json').dependencies);
25-
26-
const uniqueModules = dependencyPackageNames.map((packageName) => {
27-
if (symlinked[packageName]) {
28-
const modulePath = symlinked[packageName];
29-
const escapedPackageName = PATH.normalize(packageName).replace(/\\/g, '\\\\');
30-
31-
// exclude the symlinked package from being resolved from node_modules
32-
// example: .*\/node_modules\/stream-chat-react-native-core\/.*
33-
// the above would avoid native-package to resolve core from its own node_modules
34-
const exclusionRE = new RegExp(
35-
`.*${PATH.sep}node_modules\\${PATH.sep}${escapedPackageName}\\${PATH.sep}.*`,
36-
);
37-
38-
return {
39-
packageName, // name of the package
40-
modulePath,
41-
blockPattern: exclusionRE, // paths that match this pattern will be blocked from being resolved
42-
};
43-
}
44-
const [modulePath, blockPattern] = resolveUniqueModule(packageName, __dirname);
45-
return {
46-
packageName, // name of the package
47-
modulePath, // actual path to the module in the project's node modules
48-
blockPattern, // paths that match this pattern will be blocked from being resolved
49-
};
50-
});
51-
52-
// block the other paths for unique modules from being resolved
53-
const blockList = uniqueModules.map(({ blockPattern }) => blockPattern);
54-
55-
// provide the path for the unique modules
56-
const extraNodeModules = uniqueModules.reduce((acc, item) => {
57-
acc[item.packageName] = item.modulePath;
58-
return acc;
59-
}, {});
60-
61-
config.resolver.blockList = exclusionList(blockList);
62-
config.resolver.extraNodeModules = extraNodeModules;
63-
64-
config.resolver.nodeModulesPaths = [PATH.resolve(__dirname, 'node_modules')];
65-
66-
// add the package dir for metro to access the package folder
67-
config.watchFolders = [packageDirPath];
68-
69-
module.exports = config;
11+
module.exports = mergeConfig(getDefaultConfig(__dirname), config);

examples/SampleApp/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@
4949
"react-native-share": "^12.0.11",
5050
"react-native-svg": "^15.12.0",
5151
"react-native-video": "^6.14.1",
52-
"stream-chat-react-native": "link:../../package/native-package",
53-
"stream-chat-react-native-core": "link:../../package"
52+
"stream-chat-react-native": "^7.1.2-beta.5"
5453
},
5554
"devDependencies": {
5655
"@babel/core": "^7.27.4",

0 commit comments

Comments
 (0)