jspm / npm

NPM Location Service
19 stars 34 forks source link

add support for distribution tags (aliases) #137

Closed adamburgess closed 8 years ago

adamburgess commented 8 years ago

this fixes #61, by doing exactly what's in the OP:

Basically we need to be reading all the tags in dist-tags and adding them to the versions lookup object.

So, I think this method works fine. It's similar to the jspm github approach, i.e. github:user/repo@master fetches the HEAD on master on every install. npm uses a different approach - it saves the commit of master to package.json, and also for npm aliases, it will save the version the tag points to.

Though the npm way has nice pros (i.e. it creates no surprises), I think as long as the user knows that using an npm alias will result in possibly new versions on every install, everything is fine.

adamburgess commented 8 years ago

one small note: you need to clear your cache to use this for any package that already exists in the cache. perhaps consider changing the registry API to add a force parameter on at least the lookup hook? (or something more extensible, like an opts object)

guybedford commented 8 years ago

Thanks, this looks great to me!

This can be integrated as a minor by uncommenting the line at https://github.com/jspm/npm/blob/master/lib/npm.js#L46.

adamburgess commented 8 years ago

gotcha.

guybedford commented 8 years ago

👍