Skip to content

Commit ebba2ef

Browse files
committed
Merge branch 'main' of github.com:callstack/react-native-brownfield into feat/use-script-for-post-integrate
2 parents ba6bb5b + 28b77bc commit ebba2ef

8 files changed

Lines changed: 71 additions & 31 deletions

File tree

apps/ExpoApp/app.json

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,7 @@
4141
}
4242
}
4343
],
44-
[
45-
"@callstack/react-native-brownfield",
46-
{
47-
"ios": {
48-
"frameworkName": "BrownfieldLib"
49-
},
50-
"android": {
51-
"moduleName": "brownfieldlib"
52-
},
53-
"debug": true
54-
}
55-
]
44+
"@callstack/react-native-brownfield"
5645
],
5746
"experiments": {
5847
"typedRoutes": true,

docs/docs/docs/getting-started/expo.mdx

Lines changed: 63 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,8 @@ This guide walks you through packaging your Expo React Native app as an **AAR**
1414
```json
1515
{
1616
"plugins": [
17-
[
18-
"@callstack/react-native-brownfield",
19-
{
20-
"ios": {
21-
"frameworkName": "BrownfieldLib"
22-
},
23-
"android": {
24-
"moduleName": "brownfieldlib"
25-
},
26-
"debug": true
27-
}
17+
"@callstack/react-native-brownfield",
2818
]
29-
]
3019
}
3120
```
3221

@@ -42,6 +31,8 @@ This guide walks you through packaging your Expo React Native app as an **AAR**
4231
}
4332
```
4433

34+
> The names `brownfieldlib` or `BrownfieldLib` are the default for AAR and Framework. You can configure different names, see [here](expo#plugin-options).
35+
4536
That is pretty much it from the configuration step. Now let's start with generating the AAR and later consuming it.
4637

4738
## Android Integration
@@ -164,3 +155,63 @@ let RNView = ReactNativeHostManager.shared.loadView(moduleName: "ExpoRNApp", ini
164155
You can see the demo integration in [Apple App](https://github.com/callstack/react-native-brownfield/blob/main/apps/AppleApp/Brownfield%20Apple%20App/BrownfieldAppleApp.swift) as well
165156

166157
4. Build and install the iOS application 🚀
158+
159+
<hr/>
160+
161+
## Plugin Options
162+
163+
You can pass plugin options through the second item in the `plugins` tuple in `app.json`:
164+
165+
```json
166+
{
167+
"plugins": [
168+
[
169+
"@callstack/react-native-brownfield",
170+
{
171+
"ios": {
172+
"frameworkName": "MyBrownfieldLib",
173+
"bundleIdentifier": "com.example.app.brownfield",
174+
...
175+
},
176+
"android": {
177+
"moduleName": "mybrownfieldlib",
178+
"packageName": "com.example.mybrownfieldlib",
179+
...
180+
}
181+
}
182+
]
183+
]
184+
}
185+
```
186+
187+
### iOS
188+
189+
- `frameworkName` (`string`, default: `"BrownfieldLib"`)
190+
- Name of the generated framework. This is also used as the XCFramework name.
191+
- `bundleIdentifier` (`string`, default: app bundle identifier + `.brownfield`)
192+
- Bundle identifier assigned to the generated framework.
193+
- `buildSettings` (`Record<string, string | boolean | number>`, optional)
194+
- Additional Xcode build settings applied when building the framework.
195+
- `deploymentTarget` (`string`, default: `"15.0"`)
196+
- Minimum iOS version supported by the generated framework.
197+
- `frameworkVersion` (`string`, default: `"1"`)
198+
- Framework version used for Apple build settings (must be an integer or floating point value, for example `"1"` or `"2.1"`).
199+
200+
### Android
201+
202+
- `moduleName` (`string`, default: `"brownfieldlib"`)
203+
- Name of the generated Android library module.
204+
- `packageName` (`string`, default: app package name)
205+
- Package name used for the Android library module.
206+
- `minSdkVersion` (`number`, default: `24`)
207+
- Minimum Android SDK supported by the library.
208+
- `targetSdkVersion` (`number`, default: `35`)
209+
- Target Android SDK version for the library.
210+
- `compileSdkVersion` (`number`, default: `35`)
211+
- Compile Android SDK version used to build the library.
212+
- `groupId` (`string`, default: package name)
213+
- Maven group ID used when publishing the AAR.
214+
- `artifactId` (`string`, default: module name)
215+
- Maven artifact ID used when publishing the AAR.
216+
- `version` (`string`, default: `"0.0.1-SNAPSHOT"`)
217+
- Maven version used when publishing the AAR.

docs/docs/docs/getting-started/introduction.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ React Native Brownfield is a library that simplifies integrating React Native in
1010
- Reuse the same instance of React Native between different components
1111
- Use predefined **native building blocks** - crafted for React Native
1212
- Disable and enable **native gestures and hardware buttons** from JavaScript
13-
- Compatible with **Expo**
13+
- **Expo Config Plugin** for seamless Expo integration
1414
- Works well with **any native navigation** pattern, as well as any React Native JavaScript-based navigation
1515
- Compatible with all native languages **Objective-C**, **Swift**, **Java** and **Kotlin**
1616
- Supports UIKit and SwiftUI on iOS and Fragments and Jetpack Compose on Android

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@callstack/brownfield-cli",
3-
"version": "1.0.4",
3+
"version": "2.0.0-rc.1",
44
"license": "MIT",
55
"author": "Artur Morys-Magiera <artus9033@gmail.com>",
66
"bin": {

packages/react-native-brownfield/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@callstack/react-native-brownfield",
3-
"version": "2.2.0",
3+
"version": "3.0.0-rc.1",
44
"license": "MIT",
55
"author": "Michal Chudziak <mike.chudziak@callstack.com>",
66
"bin": {

packages/react-native-brownfield/src/expo-config-plugin/types/android/BrownfieldPluginAndroidConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
export interface BrownfieldPluginAndroidConfig {
55
/**
66
* The name of the Android library module to create
7-
* @default "brownfield"
7+
* @default "brownfieldlib"
88
*/
99
moduleName?: string;
1010

packages/react-native-brownfield/src/expo-config-plugin/types/ios/BrownfieldPluginIosConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export interface BrownfieldPluginIosConfig {
55
/**
66
* The name of the framework to create
77
* This will be used as the XCFramework name
8-
* @default "App"
8+
* @default "BrownfieldLib"
99
*/
1010
frameworkName?: string;
1111

packages/react-native-brownfield/src/expo-config-plugin/withBrownfield.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ function resolveConfig(
2828
Logger.setIsDebug(config.debug ?? false);
2929

3030
const androidPackage = expoConfig.android?.package;
31-
const androidModuleName = config.android?.moduleName ?? 'brownfield';
31+
const androidModuleName = config.android?.moduleName ?? 'brownfieldlib';
3232

3333
return {
3434
ios: expoConfig.ios
3535
? {
36-
frameworkName: config.ios?.frameworkName ?? 'App',
36+
frameworkName: config.ios?.frameworkName ?? 'BrownfieldLib',
3737
bundleIdentifier:
3838
config.ios?.bundleIdentifier ??
3939
`${expoConfig.ios.bundleIdentifier}.brownfield`,

0 commit comments

Comments
 (0)