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 repo shortcuts (github, bitbucket, gitlab) #9
Conversation
c386ba1
to
2f3402d
Compare
The commit history here could be folded up quite a bit really, as most of this work got pushed out into another module. |
default: | ||
throw new Error('Unsupported URL Type: ' + arg) | ||
break | ||
else if (/^git([+](https?|rsync|ftp|ssh|file))?:$/.test(urlparse.protocol) || |
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.
TODO: Now that hosted git checking is totally separate, change this code back to what it was.
Nice! Is there accompanying documentation that explains what this is and how to use it? I peeked through some of the commits and didn't see any markdown files. |
Also: It looks like the work is already done, but I'll just leave these here in case:
There's a GUI for the github one: https://github-url-to-object.herokuapp.com/ |
@zeke Oh, I wish I'd known those existed! The actual redundant code lives here: https://github.com/npm/hosted-git-info Docs wise, thanks for catching that, I do want to add the other repo types to the README where github is already mentioned. |
b294d4d
to
b869c60
Compare
112078b
to
27c2b7d
Compare
Hmm, I'm actually thinking that this should dump the host specific prefixes (github/bitbucket/gitlab) and just have type=hosted and spec=hosted-git-info... |
65e6b79
to
228d587
Compare
@iarna what is the end-user purpose of this change? Forgive my ignorance, but I don't really know what npm-package-arg does. Is the goal to allow users to be more explicit when specifying dependencies in Purpose aside, I notice some inconsistency in these names:
|
@zeke The change? Well, currently we parse Regarding the naming, see updated patch. |
9540020
to
4c31e41
Compare
|
||
module.exports = npa | ||
|
||
var isWindows = process.platform === "win32" || global.FAKE_WINDOWS | ||
var slashRe = isWindows ? /\\|\// : /\// | ||
var slashRe = isWindows ? /\\|[/]/ : /[/]/ |
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.
\/
→ [/]
feels gratuitous, here and elsewhere.
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.
See below
A little more contextual documentation would be nice here. Aside from that, and the nits listed above, this looks good. Feel free to squash it down if you like, but keeping the functionality changes and the code cleanup changes in separate commits would be helpful. |
It's actually pretty squashed already, as there were previous design iterations. =p But yeah, I like keeping code cleanup and functionality changes distinct. And I think there's value in keeping module additions and their use distinct too. So yeah, no squashing. |
I'm not clear, however, on what you're looking for regarding contextual documentation? |
Oh, and the version bump, I should just mention, is major due to the dropping of the "github" type (as its replaced by type=hosted, hosted.type=github). Originally I just added gitlab and bitbucket types, but using a single hosted types lets us add more hosted git shortcuts by just editing hosted-git-info and bumping module versions. No npm code has to be touched, as it doesn't care what the "type" is, it just uses the urls in the hosted property. |
I was going to ask for the major version bump if you didn't do it, so I'm with you there. I guess I'd just like to see a little more verbiage around what the use cases are for this module and how it's supposed to be used. A little example? Especially now that you're adding more functionality into it, it would be helpful to give developers first encountering the module a little bit of orientation as to what it is and what it's for. |
722ba19
to
1af8df0
Compare
Ok, I |
Perfect! ⚓ |
cca65ad
to
7b7c9f3
Compare
7b7c9f3
to
263fd43
Compare
Adds a github prefixed shortcut and matching bitbucket and gitlab shortcuts. Adds detection and folding of github/bitbucket/gitlab git urls into shortcuts to allow consumers to do special handling without having to special case.