Skip to content

Commit b0bbabf

Browse files
author
Christopher J. Brody
committed
Fix defaults & help text in command.js & README.md
- remove redundant default values - add missing version specifier to README.md - other improvements to consistency in README.md - fix some defaults in the programmatic usage options with the CLI help text in README.md adjusted by the following command: node ./cli.js --help | sed 's/\[/</g' | sed 's/\]/>/g' | \ sed 's/\"/\`/g' | sed 's/default:/Default:/g'
1 parent ab35577 commit b0bbabf

2 files changed

Lines changed: 24 additions & 23 deletions

File tree

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,19 @@ Usage: create-react-native-module [options] <name>
6060
6161
Options:
6262
63-
--help output usage information
64-
--prefix <prefix> The prefix for the library (Default: ``)
63+
-V, --version output the version number
64+
--prefix <prefix> The prefix for the library module (Default: ``)
6565
--module-name <moduleName> The module library package name to be used in package.json. Default: react-native-(name in param-case)
66-
--module-prefix <modulePrefix> The module prefix for the library, ignored if --module-name is specified (Default: `react-native`)
66+
--module-prefix <modulePrefix> The module prefix for the library module, ignored if --module-name is specified (Default: `react-native`)
6767
--package-identifier <packageIdentifier> (Android only!) The package name for the Android module (Default: `com.reactlibrary`)
68-
--platforms <platforms> Platforms the library will be created for. (comma separated; default: `ios,android`)
69-
--github-account <github_account> The github account where the library is hosted (Default: `github_account`)
70-
--author-name <name> The author's name (Default: `Your Name`)
71-
--author-email <email> The author's email (Default: `yourname@email.com`)
72-
--license <license> The license type of this library (Default: `Apache-2.0`)
73-
--view Generate the module as a very simple native view component (Default: `false`)
74-
--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`)
68+
--platforms <platforms> Platforms the library module will be created for - comma separated (Default: `ios,android`)
69+
--github-account <githubAccount> The github account where the library module is hosted (Default: `github_account`)
70+
--author-name <authorName> The author's name (Default: `Your Name`)
71+
--author-email <authorEmail> The author's email (Default: `yourname@email.com`)
72+
--license <license> The license type (Default: `Apache-2.0`)
73+
--view Generate the module as a very simple native view component
74+
--generate-example Generate an example project and links the library module to it, requires both react-native-cli and yarn to be installed globally
75+
-h, --help output usage information
7576
```
7677

7778
## Programmatic usage
@@ -91,7 +92,7 @@ createLibraryModule({
9192
```javascript
9293
{
9394
name: String, /* The name of the library (Default: Library) */
94-
prefix: String, /* The prefix for the library (Default: RN) */
95+
prefix: String, /* The prefix for the library (Default: ``) */
9596
moduleName: String, /* The module library package name to be used in package.json. Default: react-native-(name in param-case) */
9697
modulePrefix: String, /* The module prefix for the library, ignored if moduleName is specified (Default: react-native) */
9798
platforms: Array, /* Platforms the library will be created for. (Default: ['ios', 'android']) */
@@ -100,8 +101,8 @@ createLibraryModule({
100101
authorName: String, /* The author's name (Default: `Your Name`) */
101102
authorEmail: String, /* The author's email (Default: `yourname@email.com`) */
102103
license: String, /* The license type of this library (Default: `Apache-2.0`) */
103-
view: Boolean, /* Generate the module as a very simple native view component (Default: `false`) */
104-
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`) */
104+
view: Boolean, /* Generate the module as a very simple native view component (Default: false) */
105+
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) */
105106
}
106107
```
107108

command.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,44 +62,44 @@ ${emoji.get('arrow_right')} To get started type \`cd ./${rootModuleName}\` and
6262
},
6363
options: [{
6464
command: '--prefix [prefix]',
65-
description: 'The prefix for the library module (Default: ``)',
65+
description: 'The prefix for the library module',
6666
default: '',
6767
}, {
6868
command: '--module-name [moduleName]',
6969
description: 'The module library package name to be used in package.json. Default: react-native-(name in param-case)',
7070
}, {
7171
command: '--module-prefix [modulePrefix]',
72-
description: 'The module prefix for the library module, ignored if --module-name is specified (Default: `react-native`)',
72+
description: 'The module prefix for the library module, ignored if --module-name is specified',
7373
default: 'react-native',
7474
}, {
7575
command: '--package-identifier [packageIdentifier]',
76-
description: '(Android only!) The package name for the Android module (Default: `com.reactlibrary`)',
76+
description: '(Android only!) The package name for the Android module',
7777
default: 'com.reactlibrary',
7878
}, {
7979
command: '--platforms <platforms>',
80-
description: 'Platforms the library module will be created for. (comma separated; default: `ios,android`)',
80+
description: 'Platforms the library module will be created for - comma separated',
8181
default: 'ios,android',
8282
}, {
8383
command: '--github-account [githubAccount]',
84-
description: 'The github account where the library module is hosted (Default: `github_account`)',
84+
description: 'The github account where the library module is hosted',
8585
default: 'github_account',
8686
}, {
8787
command: '--author-name [authorName]',
88-
description: 'The author\'s name (Default: `Your Name`)',
88+
description: 'The author\'s name',
8989
default: 'Your Name',
9090
}, {
9191
command: '--author-email [authorEmail]',
92-
description: 'The author\'s email (Default: `yourname@email.com`)',
92+
description: 'The author\'s email',
9393
default: 'yourname@email.com',
9494
}, {
9595
command: '--license [license]',
96-
description: 'The license type (Default: `Apache-2.0`)',
96+
description: 'The license type',
9797
default: 'Apache-2.0',
9898
}, {
9999
command: '--view',
100-
description: 'Generate the module as a very simple native view component (Default: `false`)',
100+
description: 'Generate the module as a very simple native view component',
101101
}, {
102102
command: '--generate-example',
103-
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`)',
103+
description: 'Generate an example project and links the library module to it, requires both react-native-cli and yarn to be installed globally',
104104
}]
105105
};

0 commit comments

Comments
 (0)