Skip to content
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

Add react-native-prompt-android package #5

Draft
wants to merge 4 commits into
base: trunk
Choose a base branch
from

Conversation

fluiddot
Copy link
Contributor

@fluiddot fluiddot commented Mar 9, 2022

This PR adds the react-native-prompt-android package from its forked repository. For this case, I created a new branch wp-fork-only-android-changes that contains only the changes required for that package (without the Android publishing logic).

If we could also publish this type of dependencies via this repository, it would simplify the changes in the forked repositories and most likely, reduce the updates we have to do there, as most of the updates are related to the publishing logic.

NOTE: This PR also includes changes from #2.

@fluiddot fluiddot requested a review from oguzkocer March 9, 2022 17:53
Copy link
Contributor

@oguzkocer oguzkocer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fluiddot Let's hold off on forks for now.

# Conflicts:
#	build.gradle.kts
#	package-lock.json
#	package.json
#	settings.gradle.kts
@fluiddot fluiddot force-pushed the add-react-native-prompt-android branch from 049cb3d to 7c6fd48 Compare March 10, 2022 15:51
Comment on lines +105 to +114
// Extract version from filename of tarball URL
val isTarball = packageVersion.endsWith(".tgz")
if (isTarball) {
// Replace special characters of package name as "npm pack" command does, to be used in the filename.
// Reference: https://github.com/npm/cli/blob/699c2d708d2a24b4f495a74974b2a345f33ee08a/lib/pack.js#L66-L67
val packageNameSanitized = jsonProperty.replace("@", "").replace("/", "-")
val fileName = packageVersion.substring(packageVersion.lastIndexOf("/") + 1)
val version = fileName.replace(packageNameSanitized + "-", "").replace(".tgz", "")
return version
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will calculate the version of the package from the tarball filename, as we do in Gutenberg (reference).

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.

None yet

2 participants