Skip to content

fix --class-name & some other options #278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ Usage: create-react-native-module [options] <name>
Options:

-V, --version output the version number
--prefix <prefix> The prefix for the library module (Default: ``)
--prefix <prefix> The prefix of the native library module, ignored if --class-name is specified (Default: ``)
--module-name <moduleName> The module library package name to be used in package.json. Default: react-native-(name in param-case)
--module-prefix <modulePrefix> The module prefix for the library module, ignored if --module-name is specified (Default: `react-native`)
--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)
--module-prefix <modulePrefix> The native module prefix for the library module package name, ignored if --module-name is specified (Default: `react-native`)
--package-identifier <packageIdentifier> [Android] The Java package identifier used by the Android module (Default: `com.reactlibrary`)
--platforms <platforms> Platforms the library module will be created for - comma separated (Default: `ios,android`)
--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)
Expand Down Expand Up @@ -129,9 +130,10 @@ createLibraryModule({
```javascript
{
name: String, /* The name of the library (Default: Library) */
prefix: String, /* The prefix for the library (Default: ``) */
prefix: String, /* The prefix of the native library module, ignored if className is specified (Default: ``) */
moduleName: String, /* The module library package name to be used in package.json. Default: react-native-(name in param-case) */
modulePrefix: String, /* The module prefix for the library, ignored if moduleName is specified (Default: react-native) */
className: String, /* The name of the native object to be exported by the JavaScript and by the native code. Default: (prefix)(name in PascalCase) */
modulePrefix: String, /* The native module prefix for the library module package name, ignored if moduleName is specified (Default: react-native) */
platforms: Array | String, /* Platforms the library will be created for. (Default: ['android', 'ios']) */
packageIdentifier: String, /* [Android] The Java package identifier used by the Android module (Default: com.reactlibrary) */
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) */
Expand Down
7 changes: 5 additions & 2 deletions lib/cli-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,17 @@ ${postCreateInstructions(createOptions)}`);
},
options: [{
command: '--prefix [prefix]',
description: 'The prefix for the library module',
description: 'The prefix of the native library module, ignored if --class-name is specified',
default: '',
}, {
command: '--module-name [moduleName]',
description: 'The module library package name to be used in package.json. Default: react-native-(name in param-case)',
}, {
command: '--class-name [className]',
description: 'The name of the native object to be exported by the JavaScript and by the native code. Default: (prefix)(name in PascalCase)',
}, {
command: '--module-prefix [modulePrefix]',
description: 'The module prefix for the library module, ignored if --module-name is specified',
description: 'The native module prefix for the library module package name, ignored if --module-name is specified',
default: 'react-native',
}, {
command: '--package-identifier [packageIdentifier]',
Expand Down
1 change: 0 additions & 1 deletion lib/normalized-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ module.exports = (options) => {

const moduleName = options.moduleName;

// [TBD] option NOT DOCUMENTED & NOT SUPPORTED by CLI:
const className = options.className;

// namespace - library API member removed since Windows platform
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ creates a React Native library module for one or more platforms

Options:
-V, --version output the version number
--prefix [prefix] The prefix for the library module (default: \\"\\")
--prefix [prefix] The prefix of the native library module, ignored if --class-name is specified (default: \\"\\")
--module-name [moduleName] The module library package name to be used in package.json. Default: react-native-(name in param-case)
--module-prefix [modulePrefix] The module prefix for the library module, ignored if --module-name is specified (default: \\"react-native\\")
--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)
--module-prefix [modulePrefix] The native module prefix for the library module package name, ignored if --module-name is specified (default: \\"react-native\\")
--package-identifier [packageIdentifier] [Android] The Java package identifier used by the Android module (default: \\"com.reactlibrary\\")
--platforms <platforms> Platforms the library module will be created for - comma separated (default: \\"ios,android\\")
--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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ creates a React Native library module for one or more platforms

Options:
-V, --version output the version number
--prefix [prefix] The prefix for the library module (default: \\"\\")
--prefix [prefix] The prefix of the native library module, ignored if --class-name is specified (default: \\"\\")
--module-name [moduleName] The module library package name to be used in package.json. Default: react-native-(name in param-case)
--module-prefix [modulePrefix] The module prefix for the library module, ignored if --module-name is specified (default: \\"react-native\\")
--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)
--module-prefix [modulePrefix] The native module prefix for the library module package name, ignored if --module-name is specified (default: \\"react-native\\")
--package-identifier [packageIdentifier] [Android] The Java package identifier used by the Android module (default: \\"com.reactlibrary\\")
--platforms <platforms> Platforms the library module will be created for - comma separated (default: \\"ios,android\\")
--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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@ Object {
Object {
"command": "--prefix [prefix]",
"default": "",
"description": "The prefix for the library module",
"description": "The prefix of the native library module, ignored if --class-name is specified",
},
Object {
"command": "--module-name [moduleName]",
"description": "The module library package name to be used in package.json. Default: react-native-(name in param-case)",
},
Object {
"command": "--class-name [className]",
"description": "The name of the native object to be exported by the JavaScript and by the native code. Default: (prefix)(name in PascalCase)",
},
Object {
"command": "--module-prefix [modulePrefix]",
"default": "react-native",
"description": "The module prefix for the library module, ignored if --module-name is specified",
"description": "The native module prefix for the library module package name, ignored if --module-name is specified",
},
Object {
"command": "--package-identifier [packageIdentifier]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Array [
"option": Object {
"args": Array [
"--prefix [prefix]",
"The prefix for the library module",
"The prefix of the native library module, ignored if --class-name is specified",
[Function],
"",
],
Expand All @@ -47,11 +47,21 @@ Array [
],
},
},
Object {
"option": Object {
"args": Array [
"--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)",
[Function],
undefined,
],
},
},
Object {
"option": Object {
"args": Array [
"--module-prefix [modulePrefix]",
"The module prefix for the library module, ignored if --module-name is specified",
"The native module prefix for the library module package name, ignored if --module-name is specified",
[Function],
"react-native",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Array [
"option": Object {
"args": Array [
"--prefix [prefix]",
"The prefix for the library module",
"The prefix of the native library module, ignored if --class-name is specified",
[Function],
"",
],
Expand All @@ -45,11 +45,21 @@ Array [
],
},
},
Object {
"option": Object {
"args": Array [
"--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)",
[Function],
undefined,
],
},
},
Object {
"option": Object {
"args": Array [
"--module-prefix [modulePrefix]",
"The module prefix for the library module, ignored if --module-name is specified",
"The native module prefix for the library module package name, ignored if --module-name is specified",
[Function],
"react-native",
],
Expand Down