-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Make --scripts-version work with forked react-scripts #632
Conversation
Can you provide a test plan? Please see CONTRIBUTING.md. |
Should I create a file like |
For testing, I have tried running following commands:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two functions look confusing to me:
function getInstallPackage(version) {
var packageToInstall = 'react-scripts';
var validSemver = semver.valid(version);
if (validSemver) {
packageToInstall += '@' + validSemver;
} else if (version) {
// for tar.gz or alternative paths
packageToInstall = version;
}
return packageToInstall;
}
function getInstallPackageName(version) {
var validSemver = semver.valid(version);
if (validSemver) {
return 'react-scripts';
} else if (/^(https?:\/\/|\/)/.test(version)) {
return version.match(/^.+\/(.+)-.+\.tgz$/)[1];
} else {
return version;
}
}
I don’t quite understand what they’re doing, how their return values are different, why they both hardcode react-scripts
. It feels to me that they should be merged into a single function.
Can you please refactor so that they look less confusing, or best, merged?
These two functions exist for different purposes. Because of a package can be url or a path, so we need a function to get the package name from the url or path. I rewrite the |
Thanks! |
This should be fixed in 0.4.2. |
It works. |
If you have the time I would appreciate if you could look into adding something to our e2e test so we don't regress. |
Current e2e test only tests the normal workflow. But if we want test Should we create multiple e2e test case for different scenarios? |
We don’t have to do the same asserts after this special run with a fork. |
Attempt to fix #631.