-
Notifications
You must be signed in to change notification settings - Fork 248
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
Support repositories hosted outside of GitHub #51
Comments
I think that would be an awesome feature. It appears we would need to make See: https://github.com/stephenmathieson/clib-package/blob/master/src/clib-package.c#L473 |
If the goal is BitBucket support (which I'm in support of, btw) I'd go about it a bit differently. Rather than providing "url" and "version", maybe something like: "dependencies": {
"my-friend/my-friends-package": {
"host": "bitbucket.org", // host defaults to raw.github.com
"version": "0.1.0"
},
} Then we could get file URLs with |
+1 I like that idea |
err, actually, BitBucket raw URLs are |
Beyond BitBucket, parsing arbitrary URLs would allow development teams to split up large, private libraries into smaller repositories. Since enterprise solutions from GitHub and BitBucket cost a lot of money compared to self-hosting, many of these teams use internal Git servers. Supporting arbitrary URLs would also "future-proof" clib. Using the It might be a good idea to look at how |
This is true. We'd then either need libgit2 or to fetch a tar ball and extract certain files (like installing executables works currently). I'll have to look at |
What about: "dependencies": {
"my-friend/my-friends-package": {
"url_format": "https://{owner}@bitbucket.org/{owner}/{name}/raw/0.1.0/{file}"
}
} And let This will allow any arbitrary URL format to be specified, thus future-proofing and removing the need for libgit2. |
That seems fine to me. And since it's all JSON anyway we're free to change the structure in the future if need be. For future reference, though, why not use libgit2? It seems better than rewriting |
Well, we're not really cloning; we're just fetching the files listed in your package.json's |
Specifying a format instead of just an arbitrary URL seems like an undesirable UX imo. When would a user want to specify a format over just copy and pasting the URL from their browser? I'll also 👍 the comment for implementing a |
It appears
clib_package.c:clib_package_install
only supports repositories hosted on GitHub. Users should have the option to install packages hosted on any Git server. What's the core team's opinion on the following syntax forpackage.json
?If a package declares both a
url
and arepo
key, theurl
key is preferred and a warning should be displayed. If only arepo
key is declared, then it's business as usual and the repo is assumed to be hosted on GitHub.If
my-friends-package
uses a hash, as it does above, theurl
andversion
keys are required. If it is declared using the current syntax of"my-friends-package": "0.1.0"
, then it behaves as it does now. Therefore these syntax changes are backwards compatible.If there's interest in such a feature I'd love to work on it.
The text was updated successfully, but these errors were encountered: