yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.4k stars 2.72k forks source link

Statically hosted 'offline' mirror #6938

Open mungojam opened 5 years ago

mungojam commented 5 years ago

We currently store our 'offline mirror' in source control for use by multiple projects so that we can have a subset of approved external and internal packages in there. The problem is that consumers have to pull latest on the offline mirror repo whenever there are new packages being used in their projects. Some users forget to do it and then get confused by yarn errors.

So we'd like to move to hosting the repository over http(s), but we only have access to static hosting so we can't run a traditional npm mirror. Other package solutions like nuget (with sleet) and python-pip support a statically hosted html feed.

It would be great if the 'offline mirror' could actually be hosted as a simple http folder, potentially with an index.html listing the links to the packages as pip does it, or fancy json index files like nuget does it.

This may be a duplicate of https://github.com/yarnpkg/yarn/issues/4236 but it wasn't clear what was being asked there and it has been closed for a while.

mungojam commented 5 years ago

I wonder if this could be done with a plugin in v2. I've also now created a static NPM registry solution which works for the basics though not with GitHub pages due to special character treatment.