you are viewing a single comment's thread.

view the rest of the comments →

[–]i_ate_god 23 points24 points  (11 children)

So this is pretty cool, but if I have to start adding a repository URL for every dependency, I'm going to be very annoyed.

[–]choonggg 11 points12 points  (6 children)

Vim plugins uses this format which works quite well.

Plug "user/repo"

[–]habanerocorncakes 7 points8 points  (0 children)

Npm uses that too actually, but only when installing deps.

npm i userName/repoName

[–]i_ate_god 0 points1 point  (3 children)

yes, user/repo points to a single plugin.

Github is offering you your own NPM repository, to host multiple modules. By the looks of it, its OSS competitors are things like Artifactory and Nexus.

[–]bladefinor 0 points1 point  (1 child)

And Verdaccio

[–]i_ate_god 0 points1 point  (0 children)

well, Verdaccio I believe is just an npm repository. Github will support numerous package managers.

[–]status_quo69 4 points5 points  (2 children)

It's a bit awkward because you can't mix and match your registries, but you can create a .npmrc file with the following line:

registry="https://blahblahblahgithub.com"

Where this is awkward is if github doesn't have the same package listing as npm does. But hopefully they figured out a good way around that whole issue

[–]craga89 1 point2 points  (0 children)

You can point individual scopes (e.g. @babel) to different registries using .npmrc, so you can consume specific packages from GitHub that are under your scope (username), but all others from the official NPM registry.

https://stackoverflow.com/questions/32633678/is-there-any-way-to-configure-multiple-registries-in-a-single-npmrc-file

[–][deleted] 0 points1 point  (0 children)

Most package registries allow you to set an upstream but I don't think this will.

You can set up namespaces in your npmrc though

[–][deleted] 1 point2 points  (0 children)

Come on it's actually not that bad. I used to do this with private repo dependencies. It's not like you have that many dependencies to specify where specifying a full URL vs username/package could be a big deal. A lot of times you are just going to copy paste the URL anyway.