-
Notifications
You must be signed in to change notification settings - Fork 223
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
Better support for monorepos #278
Comments
Hi, would love to hear from the appcenter team if this is something they're interested in adding! |
Definitely interested. Just a matter of getting to it. We do monitor this repo heavily to see where people are heavily requesting certain features. |
Yeah +1 |
+1 |
I'm trying to use app center to build react-native. |
@EricYip you cannot specify the file path for builds today. Noted as something that would be important as part of this feature request. Thanks! |
We are using monorepo with Lerna and have structured the project with main App with sub packages with shared code and native dependancies. We need a way to specify with package should AppCenter build as main project and use Yarn workspaces or Lerna to install dependancies. |
As part of this, another issue I noticed is in the package dropdown, the current selected package shows up as just |
as monorepo become mainstream, this feature would benefit a lot of people out there. |
Hopefully the team will also fix the way a repository is scanned to detect React Native apps. As described in #928 if a RN app is in a subfolder, AppCenter doesn't detect it. Apparently also the "4 layers" search for |
+1 for AppCenter to support monorepo projects. We were using AppCenter to deploy our react-native project, but have had to move away from it recently after switching over to a monorepo w/ yarn workspaces. We miss you AppCenter! 😢 Our monorepo project structure is as follows:
|
I was able to get this to work with our RN monorepo (using yarn workspaces) by doing the following:
We also had to install a more recent version of node in our post-clone script so rn & others could install correctly. This is what
|
Thank you! That got me closer, but I'm still seeing errors. I wonder what's different between our configurations. I added For my iOS build, I have AppCenter configured as follows:
Here is where the build fails. The build script is looking for
|
Hello! I'm having the same issue as @brandonpearcy Thanks! |
Hello, also huge + for implementing monorepo support. |
Hello guys! Got it working by generating the main.js file manually and then pushing the file.
Remember to add this to the scripts part of package.json
When the folder is created, just do a release
or
|
Using RN 0.61.5 tried @zeevl solution, it does not work with following error:
I guess the problem is that @zeevl Maybe you have a clue? |
Hey @vitalyiegorov try generating the bundle js manually and uploading it to code push like I explained on my previus post. That should work and there is no need for black magic on the project. |
@agusvazquez Thanks for the solution! I will try to integrate it to speed up our builds. Your solution is viable but it does not fully fit our development process, as our project is in the MVP stage we continue adding new native modules, thus we need to rebuild our APK and CodePush deployment that you have suggested will only partly solve our needs as we would love to dedicate build process for iOS/Android to Appcenter. Anyway, we need someone help from @microsoft @patniko team to investigate and improve monorepo support as it is getting more and more popular, maybe some things need to be also fixed inside react-native-cli for running RNCLI inside the subfolders, latest RN 0.61.5 release states that monorepo support has been improved which means that the RN team dedicating its resources for it. |
@vitalyiegorov if your project has a lot of native modules, then Code Push makes no sense because you will always need to update the native code, therefore you will need to send another APK / IPA for approval to Google / iTunes. Unless you want to do quick JS only fixes. The solution I gave is for just doing a code push changing only javascript code. If you need to change native code of course you will need to recompile everything. |
@agusvazquez Again thank you very much for your advice, but this issue, in general, is not about publishing a new CodePush version, it is related to Appcenter monorepo support which is currently not working, we should be able to build monorepo projects. |
I guess we need to have a config for --entryFile for react native cli build command on AppCenter. Choosing package.json in the subdirectory of the monorepo is not enough. |
to fix @brandonpearcy issue and trick app-center when using a monorepo, a quick hack is it to create a
|
@GoMino I tried that and it seemed to fix the I have a hunch it's trying to resolve imports relative to the root, rather than the package/mobile directory because of Setting the build setting to use |
Hey all, just wanted to pipe in -- we're successfully building both iOS and android apps from a monorepo on appcenter, using the normal appcenter build tools. Keys for me were:
due to #1518 and react-native-community/cli#852 I'm not sure I'll be able to provide any support other than that, as so many of the issues in this thread are not issues I encountered. But, I wanted to post this to let you know, it is possible. |
@zeevl Did you change your build settings to use the root |
Yeah I wouldn't bother. Microsoft are focusing on GitHub and Azure. A more reliable monorepo react native ci system can be made with fastlane, dpx, changesets/cli and changesets/bot 👍 |
We’re moving away from app center for this very reason. But still, for those stuck with it, it’s not stale 😄 |
I just randomly landed on this thread after days of try / hard.
@airtonix Do you have a 2022 example, last time with fastlance for me was 5 years ago 😅 |
@brandonpearcy How can I use NX with the AppCenter CodePush? Or better asked: is there a CodePush Alternative? i don't really need App Center, I need only CodePush I would be very happy about every help https://www.reddit.com/r/reactnative/comments/ulo2mm/is_react_native_for_nx_stable_enough_are_there_no/ edit: is expo-updates compatible with NX? https://docs.expo.dev/versions/latest/sdk/updates/ |
@brandonpearcy which platform did you switch to build? |
Apologies, at the moment our implementation at Reckon is private. Through my experimentation I discovered that successful automation of both IOS and Android builds to the stores is not something you can do without also tying together the following:
Our fastlane implementation is not publicly available, but i can explain the concepts i had to deal with. But essentially, we use a combination of CircleCI (looking to move to github actions) and Fastlane with:
/app/ds/fastlane/config/settings.development-release.yml
/app/ds/fastlane/config/settings.yml
/tools/fastlane/config/settings.development-release.yml
/tools/fastlane/config/settings.yml
The biggest problem we have is due to not using NX.dev and instead relying on package.json deps for our depgraph as the mechanism for understanding what changed when we need to make a build. We only have two apps and about 30 design-system packages - a then a build can take somewhere between 15mins or an hour depending on the compute power available. I would strongly advise anyone setting up a new react-native monorepo to instead :
|
This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment. |
still need better support:) |
I managed to get it working through attempting various hacks over a whole day. I use Lerna and AWS Amplify and this is how the project directory is set up: packages
reactnativeapp has a dependency on shared. For the build configuration I have the package.json selected within the react native app package I managed to get everything working within the
Optionally if you are using AWS amplify and you have the backend within the Monorepo, here is a
I notices some comments in this thread are hidden, but after unhidding them they helped me achieve this solution |
I already have a disadvantage having a capacitor app it seems but now I also have a lerna/monorepo and it cannot find dependencies correctly. I guess I will just have to resort to manually uploading builds. |
+1 |
+1 for monorepo fetch support |
3 years waiting for this already |
as many pointed out, one problem is that appcenter's yarn detection is just broken. (see #278 (comment)) This is shocking as a more stable implementation would be very easy to do. If appcenter would at least give us more control over that, as they seem to fail to implement a simple fix for that problem. I am currently trying the hack described by #278 (comment) Edit: also switching to fastlane, since we already have a sophisticated CI/CD-pipeline |
This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment. |
This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment. |
+1 |
Keeping this alive. Happy 2024 🎉 ! |
+1 |
I'm just tired of making workarounds to use appcenter with monorepos :( |
Please we need support for monorepos 🙏🏻 |
Describe the solution you'd like
I would like to be able to control how AppCenter clones my git repo. My app lives inside of a monorepo which is pretty big. It would be nice if AppCenter had a way to configure the git cloning process to use something like a partial fetch.
Describe alternatives you've considered
Alternatives would be changing how our repo works. But I think there are enough monorepo users out there for AppCenter to consider this.
The text was updated successfully, but these errors were encountered: