You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Improve handling of files in monorepo
* Fix tests with my poor Ruby haha
* Remove note about monorepo from the docs
* wat
* Okay, this is how you do tests in Ruby
* Fix Ruby tests
* Always resolve correct root
* Move files around
* Add tests - one is failing, need to check why
* Fix tests
* Assert it works from the same level
* Warn if the root is passed
We do not need root anymore. However, we still accept one argument (config) for testing purposes. Without this check, users that pass custom root would accidentially break their projects as CLI would take it as a config value.
* Implement monorepo support for Android
* Note custom paths
* Add quiet flag
* Improve handling of files in monorepo
* Fix tests with my poor Ruby haha
* Remove note about monorepo from the docs
* wat
* Okay, this is how you do tests in Ruby
* Fix Ruby tests
* Always resolve correct root
* Move files around
* Add tests - one is failing, need to check why
* Fix tests
* Assert it works from the same level
* Warn if the root is passed
We do not need root anymore. However, we still accept one argument (config) for testing purposes. Without this check, users that pass custom root would accidentially break their projects as CLI would take it as a config value.
* Implement monorepo support for Android
* Note custom paths
* Add quiet flag
* update locfile
* Fix init - make detachedCommands and remove ugly setProjectDir hack
* Resolve conflicts
* Fix remainig uses or root and get rid of cwd
* Update paths
* Remove unused func
* Update templates.ts
* Fix unit tests
* Better logger
* Debug
* Add deprecations
* Fix a typo
* Better deprecation message
Copy file name to clipboardExpand all lines: docs/autolinking.md
+11-47Lines changed: 11 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,28 +36,6 @@ The implementation ensures that a library is imported only once. If you need to
36
36
37
37
See example usage in React Native template's [Podfile](https://github.com/facebook/react-native/blob/0.60-stable/template/ios/Podfile).
38
38
39
-
### Custom root (monorepos)
40
-
41
-
The project root is where `node_modules` with `react-native` is. Autolinking script assume your project root to be `".."`, relative to `ios` directory. If you're in a project with custom structure, like this:
42
-
43
-
```
44
-
root/
45
-
node_modules
46
-
example/
47
-
ios/
48
-
```
49
-
50
-
you'll need to set a custom root. Pass it as an argument to `use_native_modules!` function inside the targets and adjust the relatively required `native_modules` path accordingly:
The [native_modules.gradle](https://github.com/react-native-community/cli/blob/master/packages/platform-android/native_modules.gradle) script is included in your project's `settings.gradle` and `app/build.gradle` files and:
@@ -76,31 +54,6 @@ See example usage in React Native template:
The project root is where `node_modules` with `react-native` is. Autolinking scripts assume your project root to be `".."`, relative to `android` directory. If you're in a project with custom structure, like this:
82
-
83
-
```
84
-
root/
85
-
node_modules
86
-
example/
87
-
android/
88
-
```
89
-
90
-
you'll need to set a custom root. Pass it as a second argument to `applyNativeModulesSettingsGradle` and `applyNativeModulesAppBuildGradle` methods and adjust the `native_modules.gradle` path accordingly:
## What do I need to have in my package to make it work?
105
58
106
59
You’re already using Gradle, so Android support will work by default.
@@ -142,3 +95,14 @@ module.exports = {
142
95
},
143
96
};
144
97
```
98
+
99
+
## How can I use autolinking in a monorepo?
100
+
101
+
There is nothing extra you need to do - monorepos are supported by default.
102
+
103
+
Please note that in certain scenarios, such as when using Yarn workspaces, your packages might be hoisted to the root of the repository. If that is the case, please make sure that the following paths are pointing to the
104
+
correct location and update them accordingly:
105
+
106
+
- path to `native_modules.rb` in your `ios/Podfile`
107
+
- path to `native_modules.gradle` in your `android/settings.gradle`
108
+
- path to `native_modules.gradle` in your `android/app/build.gradle`
0 commit comments