dominictarr / npmd

MIT License
450 stars 37 forks source link

npmd does not allow use of a different npm repository #27

Open tomgco opened 10 years ago

tomgco commented 10 years ago

npmd is hardcoded to use

registry: 'http://isaacs.iriscouch.com/registry',

Currently the option to use a different repository is commented out.

https://github.com/dominictarr/npmd/blob/master/config.js#L12

dominictarr commented 10 years ago

would merge a pull request that added this. although, you'd probably have to rebuild the local database, I don't think couch has the same update_seq across different databases.

I am thinking about ways to handle multiple registries, but it will be different to mirroring the whole database, which works less and less well as more and more modules are published...

Probably it will just be allowing npmd to refer to modules in other registries...

Hmm, okay, here is an idea to allow multiple registries that would be compatible with the current npm, so, npm currently supports "module-name": "http://tarball.com/path/to"

So, if you had a slightly smarter server, you could do this:

http://myregistry.com/module-name@~1.0.0

Use a url that has a semver in it, and use a server that is semver aware, which resolves locally, and sends you the current tarball... this would already work with the current npm.

question: is it possible to have a couchdb rewrite rule that performs a query, to see what versions could match a given semver?

If it was the same couch db app then the npm publish stuff would still work, but the biggest change to npm would probably be to send different auth to different registries.

This would require a PR into the bowels of npm... I don't know how deep...

comments please: @izs @luk-