Closed stereodenis closed 7 years ago
Hi @stereodenis, thank you for creating an issue. Currently there is a check in place for uppercase characters as the first two characters of the module to avoid developers including a prefix by accident. Is there any way you could not use an abbreviation for your module name?
Something like react-native-create-library MyFancyModule
instead of react-native-create-library MFM
?
This is also an issue for me, I am attempting to create a library wrapping the native iOS/Android UUID generators but getting blocked when I try to run react-native-create-library UUIDGenerator. Perhaps there could be a flag to override the prefix check?
@Traviskn: Good point. I agree with passing in an additional option to override the prefix check. I'll try to get that done within the next few hours.
@frostney Sounds great! No rush though, I made some manual adjustments to utils/hasPrefix.js to work around for now. Correct me if I'm wrong, but it seems to be the 'RN' prefix specifically we want to guard against, maybe a more specific check for that would work as well?
@frostney I hit this as well when attempting to create a library with the name "SQLite". What if we change hasPrefix
to check if name
starts withprefix
? That way an error would only get reported if the module name really started with the prefix you are currently using. It would no longer falsely error when a module name begins with a couple of uppercase letters.
I just published version 1.2.0
which allows to override the prefix check with --override-prefix
if using the command line. This disables the prefix checking for the name as well as the core module prefix check. Use with caution obviously 🙂
Please let me know if this fixes the issues and re-open if it does not or create a new issue.