Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integration with patch-package #2642

Closed
aprilmintacpineda opened this issue Apr 4, 2021 · 5 comments
Closed

integration with patch-package #2642

aprilmintacpineda opened this issue Apr 4, 2021 · 5 comments
Labels

Comments

@aprilmintacpineda
Copy link

Current behaviour

Expected behaviour

I'm trying to apply the following patch:

diff --git a/node_modules/react-native-paper/src/components/Avatar/AvatarImage.tsx b/node_modules/react-native-paper/src/components/Avatar/AvatarImage.tsx
index 3b71389..a874e2b 100644
--- a/node_modules/react-native-paper/src/components/Avatar/AvatarImage.tsx
+++ b/node_modules/react-native-paper/src/components/Avatar/AvatarImage.tsx
@@ -58,6 +58,8 @@ const AvatarImage = ({
   source,
   style,
   theme,
+  onError,
+  onLoad,
   ...rest
 }: Props) => {
   const { colors } = theme;
@@ -82,6 +84,8 @@ const AvatarImage = ({
         <Image
           source={source}
           style={{ width: size, height: size, borderRadius: size / 2 }}
+          onError={onError}
+          onLoad={onLoad}
         />
       )}
     </View>
diff --git a/node_modules/react-native-paper/src/components/Drawer/DrawerItem.tsx b/node_modules/react-native-paper/src/components/Drawer/DrawerItem.tsx
index 503cfab..cd3933d 100644
--- a/node_modules/react-native-paper/src/components/Drawer/DrawerItem.tsx
+++ b/node_modules/react-native-paper/src/components/Drawer/DrawerItem.tsx
@@ -5,6 +5,7 @@ import Text from '../Typography/Text';
 import Icon, { IconSource } from '../Icon';
 import TouchableRipple from '../TouchableRipple/TouchableRipple';
 import { withTheme } from '../../core/theming';
+import Badge from '../Badge';
 
 type Props = React.ComponentPropsWithRef<typeof View> & {
   /**
@@ -67,6 +68,7 @@ const DrawerItem = ({
   style,
   onPress,
   accessibilityLabel,
+  badge,
   ...rest
 }: Props) => {
   const { colors, roundness } = theme;
@@ -100,22 +102,25 @@ const DrawerItem = ({
         accessibilityState={{ selected: active }}
         accessibilityLabel={accessibilityLabel}
       >
-        <View style={styles.wrapper}>
-          {icon ? <Icon source={icon} size={24} color={contentColor} /> : null}
-          <Text
-            selectable={false}
-            numberOfLines={1}
-            style={[
-              styles.label,
-              {
-                color: contentColor,
-                ...font,
-                marginLeft: labelMargin,
-              },
-            ]}
-          >
-            {label}
-          </Text>
+        <View style={styles.badgeContainer}>
+          <View style={styles.wrapper}>
+            {icon ? <Icon source={icon} size={24} color={contentColor} /> : null}
+            <Text
+              selectable={false}
+              numberOfLines={1}
+              style={[
+                styles.label,
+                {
+                  color: contentColor,
+                  ...font,
+                  marginLeft: labelMargin,
+                },
+              ]}
+            >
+              I am patch-package
+            </Text>
+          </View>
+          {!isNaN(badge) ? <Badge visible={Boolean(badge)}>{badge}</Badge> : null}
         </View>
       </TouchableRipple>
     </View>
@@ -131,12 +136,17 @@ const styles = StyleSheet.create({
   },
   wrapper: {
     flexDirection: 'row',
-    alignItems: 'center',
-    padding: 8,
+    alignItems: 'center'
   },
   label: {
     marginRight: 32,
   },
+  badgeContainer: {
+    flexDirection: 'row',
+    justifyContent: 'space-between',
+    alignItems: 'center',
+    padding: 8,
+  },
 });
 
 export default withTheme(DrawerItem);

These are some of my custom changes, it seems to work when running my app locally on my device, but when I deploy it to production, I don't see my patches being applied, I even put I am patch-package there in purpose just to see, but it didn't work.

I'm running the build and deploy using this bash script

export STAGE="<hidden value>"
export API_BASE_URL="<hidden value>"
export APPLE_ID="<hidden value>"
export APPSTORE_ISSUER_ID="<hidden value>"
export APPSTORE_KEY_ID="<hidden value>"
export APPSTORE_TEAM_ID="<hidden value>"
export MATCH_GIT_BASIC_AUTHORIZATION="<hidden value>"
export MATCH_PASSWORD="<hidden value>"
export MATCH_REPO="<hidden value>"

rm -rf ios-build
git clone <hidden value>.git ios-build
cp FastlaneDeploymentCI.p8 ios-build/ios/FastlaneDeploymentCI.p8
cp GoogleService-Info.plist ios-build/ios/my-app/GoogleService-Info.plist
cd ios-build
cp src/env.example.js src/env.js
bundle
yarn --prefer-offline
cd ios
NODE_ENV=production pod install
yarn patch-package
bundle exec fastlane ios preprod
cd ../../
rm -rf ios-build

As you can see, I'm already manually running the yarn patch-package command, plus on my package.json, I have "postinstall": "husky install && patch-package", but I manually ran patch-package while debugging because I'm trying to figure out why it's happening, he only reason I can see is because there's src and lib. It could be that when building for production, the metro bundler is looking at lib instead of src, but all my patches are in src not in lib because the lib is built, that would mean I will have to build react-native-paper locally but I can't because I don't think the files I get are complete, bob build fails when I try it out.

Code sample

N/A

Screenshots (if applicable)

N/A

What have you tried

N/A

Your Environment

software version
ios or android
react-native
react-native-paper
node
npm or yarn
expo sdk
@github-actions
Copy link

github-actions bot commented Apr 4, 2021

Couldn't find version numbers for the following packages in the issue:

  • react-native
  • react-native-paper
  • react-native-vector-icons
  • yarn
  • npm
  • expo

Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

@aprilmintacpineda
Copy link
Author

Couldn't find version numbers for the following packages in the issue:

  • react-native
  • react-native-paper
  • react-native-vector-icons
  • yarn
  • npm
  • expo

Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

I don't think that will change anything.

@aprilmintacpineda
Copy link
Author

REF: ds300/patch-package#304

@github-actions
Copy link

github-actions bot commented Jun 4, 2021

Hello 👋, this issue has been open for more than 2 months with no activity on it. If the issue is still present in the latest version, please leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution on workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix the issue.

@shubhamdeol
Copy link

Why this is closed and ignored :(
Having same issue. can not build locally some files are missing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants