Skip to content

Commit 21e7260

Browse files
author
Christopher J. Brody
committed
blank prefix by default
and do not show warning if default prefix is used
1 parent 3a062b1 commit 21e7260

3 files changed

Lines changed: 4 additions & 9 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Usage: create-react-native-module [options] <name>
6161
Options:
6262
6363
--help output usage information
64-
--prefix <prefix> The prefix for the library (Default: `RN`)
64+
--prefix <prefix> The prefix for the library (Default: ``)
6565
--module-prefix <modulePrefix> The module prefix for the library (Default: `react-native`)
6666
--package-identifier <packageIdentifier> (Android only!) The package name for the Android module (Default: `com.reactlibrary`)
6767
--platforms <platforms> Platforms the library will be created for. (comma separated; default: `ios,android`)

command.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ ${emoji.get('arrow_right')} To get started type \`cd ./${name}\` and run \`npm
4747
},
4848
options: [{
4949
command: '--prefix [prefix]',
50-
description: 'The prefix for the library module (Default: `RN`)',
51-
default: 'RN',
50+
description: 'The prefix for the library module (Default: ``)',
51+
default: '',
5252
}, {
5353
command: '--module-prefix [modulePrefix]',
5454
description: 'The module prefix for the library module (Default: `react-native`)',

lib.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const { hasPrefix, createFile, createFolder, npmAddScriptSync, exec } = require(
88
const { execSync } = require('child_process');
99

1010
const DEFAULT_NAME = 'Library';
11-
const DEFAULT_PREFIX = 'RN';
11+
const DEFAULT_PREFIX = '';
1212
const DEFAULT_MODULE_PREFIX = 'react-native';
1313
const DEFAULT_PACKAGE_IDENTIFIER = 'com.reactlibrary';
1414
const DEFAULT_PLATFORMS = ['android', 'ios'];
@@ -50,11 +50,6 @@ module.exports = ({
5050
throw new Error('Please specify at least one platform to generate the library.');
5151
}
5252

53-
if (prefix === DEFAULT_PREFIX) {
54-
console.warn(`While \`${DEFAULT_PREFIX}\` is the default prefix,
55-
it is recommended to customize the prefix.`);
56-
}
57-
5853
if (packageIdentifier === DEFAULT_PACKAGE_IDENTIFIER) {
5954
console.warn(`While \`{DEFAULT_PACKAGE_IDENTIFIER}\` is the default package
6055
identifier, it is recommended to customize the package identifier.`);

0 commit comments

Comments
 (0)