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
Copy file name to clipboardExpand all lines: README.md
+38-30Lines changed: 38 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,20 +28,15 @@ This tool based on [`react-native-create-library`](https://www.npmjs.com/package
28
28
### General status
29
29
30
30
-**React Native versions supported:**
31
-
- recommended: `0.60`, `0.61-rc` (see known quirks and issues below)
32
-
- outdated: `0.59`
33
-
- Known quirks & issues on React Native 0.60(+):
34
-
-[issue #99](https://github.com/brodybits/create-react-native-module/issues/99) - additional `pod install` step needed for RN 0.60 on iOS
35
-
-[issue #29](https://github.com/brodybits/create-react-native-module/issues/29) - View does not work with RN 0.60 on Android (quick patch needed)
36
-
- React Native 0.60(+) currently not supported by Expo or react-native-windows
31
+
- recommended: `0.61`
32
+
- minimum (outdated): `0.60`
37
33
- Platform fork support
38
-
- tvOS platform support
34
+
- tvOS platform fork
39
35
- requires use of `--tvos-enabled` option as documented below
40
-
- requires the [`react-native-tvos`](https://www.npmjs.com/package/react-native-tvos) fork (see discussion in [react-native-community/react-native-tvos#11](https://github.com/react-native-community/react-native-tvos/issues/11))
36
+
- requires the [`react-native-tvos`](https://www.npmjs.com/package/react-native-tvos) fork, with minimum version of 0.60 ref: [react-native-community/react-native-tvos#11](https://github.com/react-native-community/react-native-tvos/issues/11)), [issue #95](https://github.com/brodybits/create-react-native-module/issues/95)
41
37
- unstable with very limited testing, with limited if any active support from the primary maintainer [@brodybits](https://github.com/brodybits) (see [issue #127](https://github.com/brodybits/create-react-native-module/issues/127))
42
-
- minimum react-native-tvos version is 0.60 (see [issue #95](https://github.com/brodybits/create-react-native-module/issues/95))
43
-
- Out-of-tree platform support
44
-
- Windows - unstable (not tested, see [issue #23](https://github.com/brodybits/create-react-native-module/issues/23)); now deprecated and may be removed in the near future (see [issue #43](https://github.com/brodybits/create-react-native-module/issues/43))
38
+
- Out-of-tree platforms
39
+
- Windows - no longer supported for reasons discussed in issues [#23](https://github.com/brodybits/create-react-native-module/issues/23) and [#43](https://github.com/brodybits/create-react-native-module/issues/43) (existing Windows C# template is kept in `unsupported-platforms` for now (at least) and further discussion would be welcome in a new issue on GitHub)
45
40
- for future consideration: macOS (see [issue #94](https://github.com/brodybits/create-react-native-module/issues/94))
46
41
- Node.js pre-10 support is deprecated and will be removed in the near future (see [issue #38](https://github.com/brodybits/create-react-native-module/issues/38))
47
42
@@ -54,8 +49,10 @@ Why not use `react-native new-library`? Unfortunately that command doesn't creat
-[`brodybits/react-native-module-init`](https://github.com/brodybits/react-native-module-init) - new interactive CLI that uses the templates from this utiity
53
+
-[`react-native-community/bob`](https://github.com/react-native-community/bob) - opinionated, interactive library CLI that is designed to support both native libraries and libraries with web support
54
+
55
+
__Outdated alternatives:__ see [acknowledgements](#acknowledgements) below
--prefix <prefix> The prefix for the library module (Default: ``)
96
+
--prefix <prefix> The prefix of the native library module, ignored if --class-name is specified (Default: ``)
100
97
--module-name <moduleName> The module library package name to be used in package.json. Default: react-native-(name in param-case)
101
-
--module-prefix <modulePrefix> The module prefix for the library module, ignored if --module-name is specified (Default: `react-native`)
98
+
--class-name <className> The name of the native object to be exported by the JavaScript and by the native code. Default: (prefix)(name in PascalCase)
99
+
--module-prefix <modulePrefix> The native module prefix for the library module package name, ignored if --module-name is specified (Default: `react-native`)
102
100
--package-identifier <packageIdentifier> [Android] The Java package identifier used by the Android module (Default: `com.reactlibrary`)
103
101
--platforms <platforms> Platforms the library module will be created for - comma separated (Default: `ios,android`)
104
102
--tvos-enabled Generate the module with tvOS build enabled (requires react-native-tvos fork, with minimum version of 0.60, and iOS platform to be enabled)
@@ -110,7 +108,7 @@ Options:
110
108
--use-apple-networking [iOS] Use `AFNetworking` dependency as a sample in the podspec & use it from the iOS code
111
109
--generate-example Generate an example project and links the library module to it, requires both react-native-cli and yarn to be installed globally
112
110
--example-name <exampleName> Name for the example project (default: `example`)
113
-
--example-react-native-version <version> React Native version for the generated example project (default: `react-native@0.59`)
111
+
--example-react-native-version <version> React Native version for the generated example project (default: `react-native@latest`)
114
112
--write-example-podfile [iOS] EXPERIMENTAL FEATURE NOT SUPPORTED: write (or overwrite) example ios/Podfile
115
113
-h, --help output usage information
116
114
```
@@ -132,9 +130,10 @@ createLibraryModule({
132
130
```javascript
133
131
{
134
132
name:String, /* The name of the library (Default: Library) */
135
-
prefix:String, /* The prefix for the library (Default: ``) */
133
+
prefix:String, /* The prefix of the native library module, ignored if className is specified (Default: ``) */
136
134
moduleName:String, /* The module library package name to be used in package.json. Default: react-native-(name in param-case) */
137
-
modulePrefix:String, /* The module prefix for the library, ignored if moduleName is specified (Default: react-native) */
135
+
className:String, /* The name of the native object to be exported by the JavaScript and by the native code. Default: (prefix)(name in PascalCase) */
136
+
modulePrefix:String, /* The native module prefix for the library module package name, ignored if moduleName is specified (Default: react-native) */
138
137
platforms:Array|String, /* Platforms the library will be created for. (Default: ['android', 'ios']) */
139
138
packageIdentifier:String, /* [Android] The Java package identifier used by the Android module (Default: com.reactlibrary) */
140
139
tvosEnabled:Boolean, /* Generate the module with tvOS build enabled (requires react-native-tvos fork, with minimum version of 0.60, and iOS platform to be enabled) */
@@ -146,15 +145,11 @@ createLibraryModule({
146
145
view:Boolean, /* Generate the module as a very simple native view component (Default: false) */
147
146
generateExample:Boolean, /* Generate an example project and links the library module to it, requires both react-native-cli and yarn to be installed globally (Default: false) */
148
147
exampleName:String, /* Name for the example project (Default: `example`) */
149
-
exampleReactNativeVersion:String, /* React Native version for the generated example project (Default: `react-native@0.59`) */
148
+
exampleReactNativeVersion:String, /* React Native version for the generated example project (Default: `react-native@latest`) */
150
149
writeExamplePodfile:Boolean, /* [iOS] EXPERIMENTAL FEATURE NOT SUPPORTED: write (or overwrite) example ios/Podfile (Default: false) */
151
150
}
152
151
```
153
152
154
-
## Behavior not tested or supported
155
-
156
-
- Windows platform support
157
-
158
153
## Examples
159
154
160
155
### Example module with no view
@@ -175,12 +170,16 @@ cd react-native-alice-helper/example
175
170
176
171
#### Running the example app
177
172
178
-
__Within the example test app subdirectory:__
173
+
**Recommended:** Follow the instructions shown in the end of the console log output, which are more likely to be up-to-date.
174
+
175
+
__Extra notes:__
176
+
177
+
_Within the example test app subdirectory:_
179
178
180
179
It is *recommended* to start the Metro Bundler manually (within `react-native-alice-helper/example`), which would run in the foreground:
181
180
182
181
```
183
-
npm start
182
+
yarn start
184
183
```
185
184
186
185
Otherwise, React Native will open its own window to run the Metro Bundler.
Extra installation step needed on React Native 0.60(+) (see [issue #28](https://github.com/brodybits/create-react-native-module/issues/28)):
201
+
Extra installation step needed _in case of clean checkout only_:
203
202
204
203
```
205
204
cd ios && pod install && cd ..
@@ -217,7 +216,7 @@ or do the following command to open the iOS project in Xcode:
217
216
open ios/example.xcodeproj
218
217
```
219
218
220
-
__Expected result:__
219
+
#### Expected result
221
220
222
221
The example app shows the following indications:
223
222
@@ -242,17 +241,26 @@ Then go into the example app subdirectory:
242
241
cd react-native-carol-widget/example
243
242
```
244
243
245
-
__Within the example test app subdirectory:__
244
+
#### Running the view example app
245
+
246
+
**Recommended:** Follow the instructions shown in the end of the console log output, which are more likely to be up-to-date.
247
+
248
+
__Some extra notes:__
249
+
250
+
_Within the example test app subdirectory:_
246
251
247
252
It is *recommended* to start the Metro Bundler manually as described above (within `react-native-carol-widget/example`):
248
253
249
254
```
250
-
npm start
255
+
yarn start
251
256
```
252
257
253
258
To run on Android: do `react-native run-android` as described for the other example above.
254
259
255
-
To run on iOS: do `pod install` in `ios` subdirectory for React Native 0.60(+) (see above), then do `react-native run-ios` or `open ios/example.xcodeproj` as described for the other example above.
260
+
To run on iOS (as described above):
261
+
262
+
-_in case of clean checkout **only**_: do `pod install` in `ios` subdirectory
263
+
- do `react-native run-ios` or `open ios/example.xcodeproj`
0 commit comments