jfmengels / node-elm-review

CLI for elm-review
https://package.elm-lang.org/packages/jfmengels/elm-review/latest/
BSD 3-Clause "New" or "Revised" License
47 stars 25 forks source link

Add --offline flag and replace elm-json by elm-solve-deps-wasm #144

Closed jfmengels closed 8 months ago

jfmengels commented 8 months ago

Fixes #61 by adding an offline mode Fixes #81 by replacing elm-json by elm-solve-deps-wasm Fixes #51 #137 by removing elm-json and all the related problems

This was not as straightforward as I thought, hence the mess of the commit history. Turns out elm-solve-deps has a pretty different purpose than elm-json, but given enough tricks you can make it do the same thing.

Consider how many areas of the tool this change affects (regular review, init, new-package, --template, ...), I'm willing to release this as a beta version so that people can try it out and report problems before we cut a new release.

@gpampara I've added a --offline flag. Do you think you need a elm-review build (name TBD) command to pre-compile the application (into elm-stuff + ELM_HOME) so that you can then run it in --offline mode in CI?

Remaining:

socket-security[bot] commented 8 months ago

New and updated dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
elm-solve-deps-wasm 1.0.2 None +0 279 kB mattpiz
elm-review 2.10.3...2.11.0-beta.3 network +1/-0 715 kB jfmengels
gpampara commented 8 months ago

@jfmengels This is great! I think an option like that might be quite useful and I'd like to hear the comments of others on this. I don't foresee that the build needs to happen ahead of time, but all dependencies would be needed for this offline operation.

jfmengels commented 8 months ago

@gpampara How do you currently download all dependencies (in CI I mean)?

gpampara commented 8 months ago

@jfmengels We use the tool elm2nix to prepare all the dependencies into Nix, but it's essentially means that upon build they are available. This is then used to recreate the ELM_HOME locally such that when the compiler runs, it's none the wiser about how the dependencies got there and because they are there at the correct versions, compile runs without trying to go online. This would be similar to caching ELM_HOME on other CI systems (if you squint at it 😄)