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

Return correct package name when using a custom react-script scoped package #848

Closed

Conversation

dpoineau
Copy link

@dpoineau dpoineau commented Oct 5, 2016

Currently the getPackageName method returns an empty string when attempting to use a custom react-scripts package that's a scoped package (e.g. create-react-app my-test-app --scripts-version=@dpoineau/react-scripts), which causes the final step of create-react-app to fail.

This slightly tweaks the condition so that it will work correctly with scoped packages too.

@facebook-github-bot
Copy link

Thank you for your pull request. As you may know, we require contributors to sign our Contributor License Agreement, and we don't seem to have you on file and listed as active anymore. In order for us to review and merge your code, please email cla@fb.com with your details so we can update your status.

@dpoineau
Copy link
Author

dpoineau commented Oct 5, 2016

Hmm, actually this fix will still fail when attempting to use a scoped package at a specific version (e.g. @dpoineau/react-scripts@0.5)

Edit: I think something like the below might be needed to account for this:

else if (installPackage.lastIndexOf('@') > 0) {
    var versionSeparatorIndex = installPackage.lastIndexOf('@');
    return installPackage.substring(0, versionSeparatorIndex);
}

I'll test this tomorrow and make the modification to the PR once I confirm it works.

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@thien-do
Copy link
Contributor

thien-do commented Oct 5, 2016

Hi @dpoineau , is this PR related: #826

@dpoineau
Copy link
Author

dpoineau commented Oct 5, 2016

@dvkndn ah yes, that's the exact same issue, my mistake, somehow I missed it. I'll close the PR I opened in favor of that one. Thanks for pointing it out!

@dpoineau dpoineau closed this Oct 5, 2016
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants