-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Fix #5 by properly encoding the name of scoped packages before requesting their package from npm #6
Conversation
@@ -18,8 +18,20 @@ function get(url, cb) { | |||
}); | |||
} | |||
|
|||
function getCleanName(name){ | |||
name = name.split('@'); |
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.
Why?
Thanks for the PR :) |
Can you use a descriptive pull request title? |
@sindresorhus I pushed an additional commit addressing you feedback, and changed the PR title to be more descriptive. Keep in mind that there is still a failing test case on this branch. |
} | ||
|
||
// test spec | ||
var spec = { |
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.
Glad to see all test cases applied to both scoped, and un-scoped, packages.
I like how every sub-test fails with a different error. I guess at least it's the same test case. |
@lzilioli Can you fix the tests? |
@sindresorhus and @lzilioli , I filed #7 as a follow-up to the scoped package metadata end-point. |
@lzilioli friendly ping :) |
Apologies! I have been on vacation the past two weeks, and did not have access to my computer most of that time. I am taking a look at the test cases now. I was surprised to learn that these test cases were failing, as I did not believe my changes would be responsible for breaking those cases. I performed a git bisect, and the following commit was identified as faulty:
This seems to indicate that npm may have changed something on their end with respect to the single-field endpoint. Is there documentation for this on their site? If so, I can update the single-field url we are fetching. Am I missing something here? |
@sindresorhus friendly ping |
@lzilioli please see my comment here. The My vote would be to add an extra commit to your merge request to comment out those tests. That would allow us to move more quickly with getting this fix out. However, given that the |
|
||
if (typeof version !== 'string') { | ||
cb = version; | ||
version = ''; | ||
} | ||
|
||
if(version && packageIsScoped(name)) { |
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.
@lzilioli for style consistency, can you add a space after if
?
|
||
if (typeof version !== 'string') { | ||
cb = version; | ||
version = ''; | ||
} | ||
|
||
if(version && packageIsScoped(name)) { | ||
throw new Error('Fetching a specific version of a scoped package is not allowed by npm.'); |
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.
I didn't even see this earlier. Thank you for adding a check here.
I've filed #8 to revert the by-field feature. |
@hbetts @destroyerofbuilds I just pushed two commits. One to address the space for consistency, and the other to remove the tests that it looks like will be reverted in #8 |
@sindresorhus Any plans to release this? |
This PR contains 1 breaking test case for the scoped package.