-
Notifications
You must be signed in to change notification settings - Fork 246
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
Offline support #8
Comments
At the risk of plugging shamefully (😅) my recent Gittar can solve this issue, along with #1 and #3. The module does not ship with a CLI, so there's no overlap in that regard. A few key differences:
And with the included Let me know what you think. Happy to start working on integrating this into a PR if you'd like. No hard feelings if you don't want to go this route. 😃 |
Nice 👏 Since gittar would be doing most of the heavy lifting, what if we just merged these projects? In other words, have the CLI and the library in the same repo. If you reckon that's a good idea, then I could send you a PR to add a It occurs to me that Let me know what you think! |
Hey @Rich-Harris, thanks! I want to keep the API separate from the CLI -- I kinda like that approach. Even tho I totally understand that branch example. That's why I made sure to add a Originally, I wanted to decipher between a semver-tag & a branch-tag, but in the real world (unfortunately) not everyone is using semver, or necessarily even marks releases with a numerical system. Doing this would allow all semver(-like) tags to be cache-first & the rest ( |
The more I think about it, the more I think we have slightly different goals. You want offline-first, I want network-first, but I don't want to redownload tar files that I already have (so |
Okay! No problem 😃 While I do prioritize offline-first, I still want to be flexible. Would it help if I added an ~ The default would return opts.onParse = ({ site, repo, branch }) => branch === 'master';
if (opts.force || opts.onParse(info)) {
// send network
} else { ... } |
It wouldn't quite solve the problem of only wanting to download if the commit hash had changed for a given ref. In my testing, fetching refs is usually quite a bit quicker than redownloading (though obviously it depends on the size of the repo). |
Gotcha. Well if you have any suggestions, feel free to send 'em my way. This was borne out of what I needed, but I'd like it to be flexible for others too. Thanks! |
If we can't fetch refs because we're offline, it should still be possible to use a cached archive. Right now they're only stored by commit hash which is unhelpful — we could store some metadata alongside the tar files, indicating that (for example) 1234abcd is the latest
master
.The text was updated successfully, but these errors were encountered: