Skip to content

Conversation

@elvinas-engagecraft
Copy link
Contributor

Summary:

This fixes #1031 (a regression introduced with #910). It also makes sure that the package name contains only an allowed chars.

Theoretically NPM scope name can contain only a lowercase url-safe chars (a-z 0-9 - _ . ! ~ * ' ( )). But I did not tried to use those chars as the scope name. I mean the validator does not throw an error but I'm not sure if you can save it actually. I've attached some screenshots from npmjs.org:
Screenshot 2020-03-03 at 17 59 49
Screenshot 2020-03-03 at 17 59 59

On the other hand package name cannot contain these chars: / \ : < > " ? * |. So we definitely need to replace * to be 100% sure that the package name is correct. Also I replaced ~ ! ' ( ) too (or I shouldn't do that?).

Test Plan:

I've tried to add yarn add @bam.tech/react-native-snap-carousel and build the app.
The app builds successfully.

Also I've create a small groovy test script as an example:
https://groovyconsole.appspot.com/script/5174010459455488

This fixes react-native-community#1031 (a regression introduced with react-native-community#910). It also makes sure that the package name contains only allowed chars.
@grabbou grabbou merged commit 3f37b39 into react-native-community:master Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Npm scoped packages with . produces incorrect package name for Android

3 participants