-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Feature] Mirror the binaries from the Yarn website #2033
Comments
I've setup a Cloudflare worker that mirrors our repository with a 7-days TTL: |
Interesting, I didn't think of using Cloudflare workers, but glad to know that it works. Is that free to use? |
Note to reliably serve in China, an ICP license from the Chinese government is required (Cloudflare, for instance). Another way would be to use CDN such as jsDelivr which has a multi-CDN network and the ICP license. jsDelivr seems to provide custom endpoints, too. |
Yep, up to a threshold. What's interesting is that it seems to be composable with the caching layer, so it's unlikely we'd hit the threshold! Only thing missing is to implement |
Hi all, |
I'd recommend jsDelivr. (https://cdn.jsdelivr.net/gh/yarnpkg/berry@latest/packages/yarnpkg-cli/bin/yarn.js , "latest" can be any tag) |
It will be great to have yarn2 on npm since as mentioned in #3001 many companies have their own internal indexes and also strict policies on what can be installed on production servers and installing from github (or other non-standard location) is nearly illegal |
New versions will use the Yarn website as source for the binaries (specifically, |
@arcanis I would second comments from @v1nc3n4 and @luislezcair I have a need to mirror repo.yarnpkg.com to a corporate Mirror (in my case Nexus Repository) so that it can be installed. I haven't found any Config or Environment Variable to tell Yarn where to get it from. Is this hardcoded without any chance to configure? If so this would be a big reason to migrate away from Yarn. For this to work
If it could be installed via npmjs would be even better as most Mirror-Repository Softwares have native support for such mirrors. Proxies are not an option. Thanks in advance. |
Describe the user story
Our binaries are built for every release and stored within the repository. As a result, the binary from any release can be accessed through the following url:
https://raw.githubusercontent.com/yarnpkg/berry/%40yarnpkg/cli/{}/packages/yarnpkg-cli/bin/yarn.js (replacing
{}
by the version number for the CLI one wish to obtain)Then the
yarn set version
command downloads the files from this url. It works well enough, but it has a few downside:Describe the solution you'd like
I'd like to mirror those URLs behind Cloudflare and expose them through
yarnpkg.com
(so thatbin.yarnpkg.com/2.0.0/packages/yarnpkg-cli/bin/yarn.js
would be a cached alias for the url aforementioned). @Daniel15 do you know if this is something we can do?Describe the drawbacks of your solution
The old url will still exist, so there is no backward incompatibility.
The text was updated successfully, but these errors were encountered: