Open ivanov opened 1 year ago
Hey @ivanov ! That situation on the plane sounds really annoying, sorry about that. You're totally right, what you tried should have worked, and we want folks to be able to use Gleam even when offline.
The good news is that we already have that package cache so this should be not to much work to build.
The network is being used here to ask Hex what the current versions of the packages are so we can determine what versions to use. If the network cannot be reached we could used a cached version of this information instead, while printing a warning to say that package versions may be out-of-date.
We'll need to work out exactly what information to cache, but that should be no major problem.
A good place to start would just be calling dependencies::download
after we generate the template files.
I can look into this after local deps are done.
Thank you for your work on gleam.
This request is a more fleshed out version of #1069, but as I did not create that issue, I am unable to reopen it.
I wanted to try
gleam
, installed it, rangleam new
which succeeded, and got on a flight without wifi, thinking I'll be able to play with it while offline.But this was not to be, because neither
gleam build
norgleam test
work on first run in a project without an internet connection.It would be great if
gleam new
did the steps necessary to have a minimally working version of the package it creates be buildable.I imagine that one way to do this would be to use a centralized cache for gleam packages that can be shared across repositories, so that once a user has successfully built one project from a quickstart
gleam new
, building another project from a barebonesgleam new
would grab those same standard libraries, instead of re-downloading them for every firstgleam build
in any given project.I do want to acknowledge that
gleam build
andgleam test
do not require an internet connection on subsequent calls (provided no new libraries are added).