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
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# create-react-native-module
2
2
3
-
Tool to create a React Native library module with a single command (based on [`react-native-create-library`](https://www.npmjs.com/package/react-native-create-library))
3
+
Tool to create a React Native library module, optionally as an extremely simple view component, with a single command (based on [`react-native-create-library`](https://www.npmjs.com/package/react-native-create-library))
@@ -15,8 +15,6 @@ If you are looking to create a native module for React Native, you need some nat
15
15
This is where this tool comes in. It creates a boilerplate with all current best practices in mind.
16
16
Why not use `react-native new-library`? Unfortunately that command doesn't create an up-to-date library, requires an already initialized React Native project and only sets up the iOS side of things.
17
17
18
-
Caution: This only creates native modules without a view component.
--author-name <name> The author's name (Default: `Your Name`)
59
57
--author-email <email> The author's email (Default: `yourname@email.com`)
60
58
--license <license> The license type of this library (Default: `Apache-2.0`)
59
+
--view Generate the module as a very simple native view component (Default: `false`)
61
60
--generate-example <shouldGenerate> Generate an example project and links the library module to it, requires both react-native-cli and yarn to be installed globally (Default: `false`)
62
61
```
63
62
@@ -86,6 +85,7 @@ createLibrary({
86
85
authorName:String, /* The author's name (Default: `Your Name`) */
87
86
authorEmail:String, /* The author's email (Default: `yourname@email.com`) */
88
87
license:String, /* The license type of this library (Default: `Apache-2.0`) */
88
+
view:Boolean, /* Generate the module as a very simple native view component (Default: `false`) */
89
89
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`) */
Copy file name to clipboardExpand all lines: command.js
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,7 @@ module.exports = {
17
17
constauthorName=options.authorName;
18
18
constauthorEmail=options.authorEmail;
19
19
constlicense=options.license;
20
+
constview=options.view;
20
21
constgenerateExample=options.generateExample;
21
22
22
23
constbeforeCreation=Date.now();
@@ -31,6 +32,7 @@ module.exports = {
31
32
authorName,
32
33
authorEmail,
33
34
license,
35
+
view,
34
36
generateExample,
35
37
}).then(()=>{
36
38
console.log(`
@@ -80,6 +82,9 @@ ${emoji.get('arrow_right')} To get started type \`cd ./${name}\` and run \`npm
80
82
command: '--license [license]',
81
83
description: 'The license type (Default: `Apache-2.0`)',
82
84
default: 'Apache-2.0',
85
+
},{
86
+
command: '--view',
87
+
description: 'Generate the module as a very simple native view component (Default: `false`)',
83
88
},{
84
89
command: '--generate-example',
85
90
description: 'Generate an example project and links the library module to it, requires both react-native-cli and yarn to be installed globally (Default: `false`)',
0 commit comments