Skip to content

Commit a65c085

Browse files
authored
chore(Example): Updated the example app to use the local package source (#90)
* chore(Example): update configuration to link local package * chore: update package.json to include react-native and source fields * chore: update package.json to change "typings" to "types"
1 parent b6b3287 commit a65c085

File tree

6 files changed

+86
-226
lines changed

6 files changed

+86
-226
lines changed

Examples/CodePushDemoApp/ios/CodePushDemoApp.xcodeproj/project.pbxproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,10 @@
193193
inputFileListPaths = (
194194
"${PODS_ROOT}/Target Support Files/Pods-CodePushDemoApp/Pods-CodePushDemoApp-frameworks-${CONFIGURATION}-input-files.xcfilelist",
195195
);
196-
inputPaths = (
197-
);
198196
name = "[CP] Embed Pods Frameworks";
199197
outputFileListPaths = (
200198
"${PODS_ROOT}/Target Support Files/Pods-CodePushDemoApp/Pods-CodePushDemoApp-frameworks-${CONFIGURATION}-output-files.xcfilelist",
201199
);
202-
outputPaths = (
203-
);
204200
runOnlyForDeploymentPostprocessing = 0;
205201
shellPath = /bin/sh;
206202
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CodePushDemoApp/Pods-CodePushDemoApp-frameworks.sh\"\n";
@@ -236,14 +232,10 @@
236232
inputFileListPaths = (
237233
"${PODS_ROOT}/Target Support Files/Pods-CodePushDemoApp/Pods-CodePushDemoApp-resources-${CONFIGURATION}-input-files.xcfilelist",
238234
);
239-
inputPaths = (
240-
);
241235
name = "[CP] Copy Pods Resources";
242236
outputFileListPaths = (
243237
"${PODS_ROOT}/Target Support Files/Pods-CodePushDemoApp/Pods-CodePushDemoApp-resources-${CONFIGURATION}-output-files.xcfilelist",
244238
);
245-
outputPaths = (
246-
);
247239
runOnlyForDeploymentPostprocessing = 0;
248240
shellPath = /bin/sh;
249241
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-CodePushDemoApp/Pods-CodePushDemoApp-resources.sh\"\n";

Examples/CodePushDemoApp/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PODS:
22
- Base64 (1.1.2)
33
- boost (1.84.0)
4-
- CodePush (12.0.1):
4+
- CodePush (12.0.2):
55
- Base64 (~> 1.1)
66
- JWT (~> 3.0.0-beta.12)
77
- React-Core
@@ -1729,7 +1729,7 @@ EXTERNAL SOURCES:
17291729
SPEC CHECKSUMS:
17301730
Base64: cecfb41a004124895a7bcee567a89bae5a89d49b
17311731
boost: 7e761d76ca2ce687f7cc98e698152abd03a18f90
1732-
CodePush: 4cadecf79f6a25a8e29595c354fa3d84b0798f35
1732+
CodePush: 4712921047c2729f2f0f26268cea24a9e1a478f7
17331733
DoubleConversion: cb417026b2400c8f53ae97020b2be961b59470cb
17341734
fast_float: 06eeec4fe712a76acc9376682e4808b05ce978b6
17351735
FBLazyVector: 79c4b7ec726447eec5f8593379466bd9fde1aa14
Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1+
const path = require('path');
12
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
23

4+
const projectRoot = __dirname;
5+
const workspaceRoot = path.resolve(projectRoot, '../..');
6+
37
/**
48
* Metro configuration
59
* https://reactnative.dev/docs/metro
610
*
711
* @type {import('@react-native/metro-config').MetroConfig}
812
*/
9-
const config = {};
13+
const config = {
14+
projectRoot: projectRoot,
15+
watchFolders: [workspaceRoot],
16+
resolver: {
17+
// Always resolve deps from the example app to avoid module duplication.
18+
extraNodeModules: new Proxy(
19+
{},
20+
{
21+
get: (_, name) => path.join(projectRoot, 'node_modules', name),
22+
},
23+
),
24+
},
25+
};
1026

11-
module.exports = mergeConfig(getDefaultConfig(__dirname), config);
27+
module.exports = mergeConfig(getDefaultConfig(projectRoot), config);

0 commit comments

Comments
 (0)